Revved to chromium c06ba3f6d7a67bc04ae2f6c041c22a86bdcf372a refs/remotes/origin/HEAD
diff --git a/.gitignore b/.gitignore
index 0173fb7..2b40704 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,6 +44,7 @@
/_out
/android_emulator_sdk
/arm-sysroot
+/ash/ash_unittests_run.xml
/base/base_unittests_run.xml
/breakpad/src/
/build/Debug
@@ -131,20 +132,29 @@
/chrome/tools/memory
/chrome/tools/test/reference_build
/chrome/unit_tests_run.xml
+/chrome/web_ui_mojo_bindings.xml
/chrome_elf/chrome_elf_resources.xml
/cloud_print/cloud_print_version_resources.xml
/components/chrome_settings_proto_generated_compile.xml
/components/cloud_policy_proto_generated_compile.xml
+/components/gcm_driver.xml
+/components/leveldb_proto_test_support.xml
/components/rappor.xml
/components/search_engines/prepopulated_engines.xml
+/components/suggestions.xml
/components/variations.xml
+/content/browser/service_worker/proto.xml
+/content/content_browsertests_run.xml
+/content/content_common_mojo_bindings.xml
/content/content_unittests_run.xml
/content/test/data/gpu/generated/
/content/test/data/gpu/gpu_reference/
/content/test/data/layout_tests/
/content/test/data/plugin/
+/content/web_ui_test_mojo_bindings.xml
/data
/delegate_execute
+/device/serial/device_serial_mojo.xml
/google_apis/gcm/gcm.xml
/google_apis/internal
/googleurl
@@ -154,24 +164,53 @@
/media/cast/logging/cast_logging_proto_lib.xml
/media/cdm/ppapi/api
/media/media_asm.xml
+/media/media_mojo_bindings.xml
/media/test/data/content
/media/test/data/security
/media/yuv_convert_simd_x86.xml
/metro_driver
/mojo/hello_world_service.xml
+/mojo/mojo_application_bindings.xml
/mojo/mojo_application_manager_unittests.xml
+/mojo/mojo_apps_js_bindings.xml
+/mojo/mojo_apps_js_unittests_run.xml
+/mojo/mojo_clipboard_bindings.xml
+/mojo/mojo_content_handler_bindings.xml
+/mojo/mojo_core_window_manager_bindings.xml
+/mojo/mojo_echo_service_bindings.xml
+/mojo/mojo_example_service_bindings.xml
+/mojo/mojo_external_service_bindings.xml
+/mojo/mojo_geometry_bindings.xml
/mojo/mojo_gles2_bindings.xml
+/mojo/mojo_gpu_bindings.xml
+/mojo/mojo_input_events_bindings.xml
+/mojo/mojo_js_unittests_run.xml
+/mojo/mojo_keyboard_bindings.xml
/mojo/mojo_launcher_bindings.xml
+/mojo/mojo_media_viewer_bindings.xml
/mojo/mojo_native_viewport_bindings.xml
+/mojo/mojo_navigation_bindings.xml
+/mojo/mojo_network_bindings.xml
/mojo/mojo_public_bindings_unittests.xml
+/mojo/mojo_public_test_interfaces.xml
/mojo/mojo_public_unittests.xml
/mojo/mojo_sample_service.xml
/mojo/mojo_shell_bindings.xml
+/mojo/mojo_shell_lib.xml
+/mojo/mojo_spy.xml
+/mojo/mojo_surface_id_bindings.xml
+/mojo/mojo_surfaces_app_bindings.xml
+/mojo/mojo_surfaces_bindings.xml
+/mojo/mojo_test_service_bindings.xml
/mojo/mojo_view_manager_bindings.xml
+/mojo/mojo_window_manager_bindings.xml
+/mojo/mojo_wm_flow_embeddee_bindings.xml
+/mojo/mojo_wm_flow_embedder_bindings.xml
/mojo/mojom_test.xml
/mojo/sample_service.xml
/native_client
/net/Debug
+/net/net_derived_sources.xml
/net/net_unittests_run.xml
/net/Release
/net/testserver.log
@@ -179,19 +218,15 @@
/out_*
/ppapi/native_client/nacl_irt.xml
/ppapi/native_client/ppapi_lib.xml
-/ppapi/native_client/src/shared/ppapi_proxy/nacl_ppapi_browser.xml
-/ppapi/native_client/src/shared/ppapi_proxy/ppruntime_lib.xml
/ppapi/native_client/src/trusted/plugin/ppGoogleNaClPluginChrome.xml
/remoting/appengine/
/remoting/host/installer/linux/internal/
/remoting/proto/chromotocol_proto_lib.xml
-/remoting/proto/trace_proto_lib.xml
/remoting/remoting_core_resources.xml
/remoting/remoting_elevated_controller.xml
/remoting/remoting_host.xml
/remoting/remoting_host_event_logger.xml
/remoting/remoting_host_installation.xml
-/remoting/remoting_host_installation_unittest.xml
/remoting/remoting_host_messages.xml
/remoting/remoting_infoplist_strings.xml
/remoting/remoting_lib_idl.xml
@@ -205,6 +240,7 @@
/sdch/open-vcdiff
/seccompsandbox
/skia/tools/clusterfuzz-data/
+/sql/sql_unittests_run.xml
/sync/sync.xml
/sync_testserver.log
/testing/gmock
@@ -378,6 +414,7 @@
/tools/win/link_limiter/build
/ui/surface/surface.xml
/ui/surface/surface_gpu_tests.xml
+/ui/keyboard/keyboard_mojom_bindings.xml
/v8
/webkit/data/bmp_decoder
/webkit/data/ico_decoder
diff --git a/AUTHORS b/AUTHORS
index b6073cb..2e9a4d2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -244,6 +244,7 @@
Kim Christensen <kimworking@gmail.com>
Kingshuk Jana <kingshuk.j@samsung.com>
Klemen Forstnerič <klemen.forstneric@gmail.com>
+Krishna Chaitanya <krish.botta@samsung.com>
Krzysztof Wolanski <k.wolanski@samsung.com>
Kunal Thakar <kunalt@gmail.com>
Kushal Pisavadia <kushi.p@gmail.com>
@@ -287,6 +288,7 @@
Matthias Reitinger <reimarvin@gmail.com>
Max Perepelitsyn <pph34r@gmail.com>
Max Vujovic <mvujovic@adobe.com>
+Mayur Kankanwadi <mayurk.vk@samsung.com>
Michael Gilbert <floppymaster@gmail.com>
Michael Schechter <mike.schechter@gmail.com>
Michael Zugelder <michael@zugelder.org>
@@ -306,6 +308,7 @@
Mohan Reddy <mohan.reddy@samsung.com>
Mrunal Kapade <mrunal.kapade@intel.com>
Myles C. Maxfield <mymax@amazon.com>
+Nagarjuna Atluri <nagarjuna.a@samsung.com>
Naiem Shaik <naiem.shaik@gmail.com>
Naoki Takano <takano.naoki@gmail.com>
Naveen Bobbili <naveenbobbili@motorola.com>
@@ -344,6 +347,7 @@
Po-Chun Chang <pochang0403@gmail.com>
Prashant Hiremath <prashhir@cisco.com>
Prashant Nevase <prashant.n@samsung.com>
+Praveen Akkiraju <praveen.anp@samsung.com>
Pritam Nikam <pritam.nikam@samsung.com>
Puttaraju R <puttaraju.r@samsung.com>
Qiankun Miao <qiankun.miao@intel.com>
diff --git a/base/BUILD.gn b/base/BUILD.gn
index d4283ae..a190ea3 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -445,6 +445,7 @@
"power_monitor/power_monitor_device_source.h",
"power_monitor/power_monitor_device_source_android.cc",
"power_monitor/power_monitor_device_source_android.h",
+ "power_monitor/power_monitor_device_source_chromeos.cc",
"power_monitor/power_monitor_device_source_ios.mm",
"power_monitor/power_monitor_device_source_mac.mm",
"power_monitor/power_monitor_device_source_posix.cc",
@@ -802,6 +803,12 @@
]
}
+ if (is_chromeos) {
+ sources -= [
+ "power_monitor/power_monitor_device_source_posix.cc",
+ ]
+ }
+
if (is_nacl) {
# These things would otherwise be built on a Posix build but aren't
# supported on NaCl.
@@ -1317,6 +1324,7 @@
"//base/test:run_all_unittests",
"//base/test:test_support",
"//base/third_party/dynamic_annotations",
+ "//base/third_party/nspr",
"//testing/gmock",
"//testing/gtest",
"//third_party/icu",
diff --git a/base/PRESUBMIT.py b/base/PRESUBMIT.py
index 732ac27..758a790 100644
--- a/base/PRESUBMIT.py
+++ b/base/PRESUBMIT.py
@@ -8,6 +8,10 @@
for more details on the presubmit API built into gcl.
"""
+import re
+
+BASE_SOURCE_FILES=(r'^base/.*\.(cc|h|mm)$',)
+
def _CheckNoInterfacesInBase(input_api, output_api):
"""Checks to make sure no files in libbase.a have |@interface|."""
pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
@@ -36,8 +40,45 @@
results.extend(_CheckNoInterfacesInBase(input_api, output_api))
return results
+def _CheckOverrideFinal(input_api, output_api,
+ whitelist=BASE_SOURCE_FILES, blacklist=None):
+ """Make sure new lines of code don't use the OVERRIDE or FINAL macros."""
+
+ # TODO(mostynb): remove this check once the macros are removed
+ # from base/compiler_specific.h.
+
+ errors = []
+
+ source_file_filter = lambda x: input_api.FilterSourceFile(
+ x, white_list=BASE_SOURCE_FILES, black_list=None)
+
+ override_files = []
+ final_files = []
+
+ for f in input_api.AffectedSourceFiles(source_file_filter):
+ contents = input_api.ReadFile(f, 'rb')
+
+ # "override" and "final" should be used instead of OVERRIDE/FINAL now.
+ if re.search(r"\bOVERRIDE\b", contents):
+ override_files.append(f.LocalPath())
+
+ if re.search(r"\bFINAL\b", contents):
+ final_files.append(f.LocalPath())
+
+ if override_files:
+ return [output_api.PresubmitError(
+ 'These files use OVERRIDE instead of using override:',
+ items=override_files)]
+ if final_files:
+ return [output_api.PresubmitError(
+ 'These files use FINAL instead of using final:',
+ items=final_files)]
+
+ return []
+
def CheckChangeOnUpload(input_api, output_api):
results = []
+ results.extend(_CheckOverrideFinal(input_api, output_api))
results.extend(_CommonChecks(input_api, output_api))
return results
diff --git a/base/android/trace_event_binding.cc b/base/android/trace_event_binding.cc
index e261411..216ba7b 100644
--- a/base/android/trace_event_binding.cc
+++ b/base/android/trace_event_binding.cc
@@ -57,11 +57,11 @@
class TraceEnabledObserver : public debug::TraceLog::EnabledStateObserver {
public:
- virtual void OnTraceLogEnabled() OVERRIDE {
+ virtual void OnTraceLogEnabled() override {
JNIEnv* env = base::android::AttachCurrentThread();
base::android::Java_TraceEvent_setEnabled(env, true);
}
- virtual void OnTraceLogDisabled() OVERRIDE {
+ virtual void OnTraceLogDisabled() override {
JNIEnv* env = base::android::AttachCurrentThread();
base::android::Java_TraceEvent_setEnabled(env, false);
}
diff --git a/base/async_socket_io_handler.h b/base/async_socket_io_handler.h
index 2f4b13d..71ca5f4 100644
--- a/base/async_socket_io_handler.h
+++ b/base/async_socket_io_handler.h
@@ -78,11 +78,11 @@
// Implementation of IOHandler on Windows.
virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context,
DWORD bytes_transfered,
- DWORD error) OVERRIDE;
+ DWORD error) override;
#elif defined(OS_POSIX)
// Implementation of base::MessageLoopForIO::Watcher.
- virtual void OnFileCanWriteWithoutBlocking(int socket) OVERRIDE {}
- virtual void OnFileCanReadWithoutBlocking(int socket) OVERRIDE;
+ virtual void OnFileCanWriteWithoutBlocking(int socket) override {}
+ virtual void OnFileCanReadWithoutBlocking(int socket) override;
void EnsureWatchingSocket();
#endif
diff --git a/base/base.gypi b/base/base.gypi
index 8a37249..c5796ef 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -432,6 +432,7 @@
'power_monitor/power_monitor.h',
'power_monitor/power_monitor_device_source_android.cc',
'power_monitor/power_monitor_device_source_android.h',
+ 'power_monitor/power_monitor_device_source_chromeos.cc',
'power_monitor/power_monitor_device_source.cc',
'power_monitor/power_monitor_device_source.h',
'power_monitor/power_monitor_device_source_ios.mm',
@@ -838,6 +839,11 @@
'ANDROID_SINCOS_PROVIDED',
],
}],
+ ['<(chromeos) == 1', {
+ 'sources!': [
+ 'power_monitor/power_monitor_device_source_posix.cc',
+ ],
+ }],
['OS == "ios" and _toolset != "host"', {
'sources/': [
# Pull in specific Mac files for iOS (which have been filtered out
diff --git a/base/base.isolate b/base/base.isolate
index be190f3..047d5de 100644
--- a/base/base.isolate
+++ b/base/base.isolate
@@ -16,6 +16,13 @@
],
},
}],
+ ['OS=="mac" and asan==1', {
+ 'variables': {
+ 'files': [
+ '<(PRODUCT_DIR)/libclang_rt.asan_osx_dynamic.dylib',
+ ],
+ },
+ }],
['OS=="win" and component=="shared_library" and CONFIGURATION_NAME=="Debug"', {
'variables': {
'files': [
diff --git a/base/bind_internal_win.h b/base/bind_internal_win.h
index 7a8486a..c3f7477 100644
--- a/base/bind_internal_win.h
+++ b/base/bind_internal_win.h
@@ -1,8 +1,3 @@
-// This file was GENERATED by command:
-// pump.py bind_internal_win.h.pump
-// DO NOT EDIT BY HAND!!!
-
-
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -24,340 +19,40 @@
template <typename Functor>
class RunnableAdapter;
-// __stdcall Function: Arity 0.
-template <typename R>
-class RunnableAdapter<R(__stdcall *)()> {
+// __stdcall Function.
+template <typename R, typename... Args>
+class RunnableAdapter<R(__stdcall *)(Args...)> {
public:
- typedef R (RunType)();
+ typedef R (RunType)(Args...);
- explicit RunnableAdapter(R(__stdcall *function)())
+ explicit RunnableAdapter(R(__stdcall *function)(Args...))
: function_(function) {
}
- R Run() {
- return function_();
+ R Run(typename CallbackParamTraits<Args>::ForwardType... args) {
+ return function_(args...);
}
private:
- R (__stdcall *function_)();
+ R (__stdcall *function_)(Args...);
};
-// __fastcall Function: Arity 0.
-template <typename R>
-class RunnableAdapter<R(__fastcall *)()> {
+// __fastcall Function.
+template <typename R, typename... Args>
+class RunnableAdapter<R(__fastcall *)(Args...)> {
public:
- typedef R (RunType)();
+ typedef R (RunType)(Args...);
- explicit RunnableAdapter(R(__fastcall *function)())
+ explicit RunnableAdapter(R(__fastcall *function)(Args...))
: function_(function) {
}
- R Run() {
- return function_();
+ R Run(typename CallbackParamTraits<Args>::ForwardType... args) {
+ return function_(args...);
}
private:
- R (__fastcall *function_)();
-};
-
-// __stdcall Function: Arity 1.
-template <typename R, typename A1>
-class RunnableAdapter<R(__stdcall *)(A1)> {
- public:
- typedef R (RunType)(A1);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
- return function_(a1);
- }
-
- private:
- R (__stdcall *function_)(A1);
-};
-
-// __fastcall Function: Arity 1.
-template <typename R, typename A1>
-class RunnableAdapter<R(__fastcall *)(A1)> {
- public:
- typedef R (RunType)(A1);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1) {
- return function_(a1);
- }
-
- private:
- R (__fastcall *function_)(A1);
-};
-
-// __stdcall Function: Arity 2.
-template <typename R, typename A1, typename A2>
-class RunnableAdapter<R(__stdcall *)(A1, A2)> {
- public:
- typedef R (RunType)(A1, A2);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1, A2))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2) {
- return function_(a1, a2);
- }
-
- private:
- R (__stdcall *function_)(A1, A2);
-};
-
-// __fastcall Function: Arity 2.
-template <typename R, typename A1, typename A2>
-class RunnableAdapter<R(__fastcall *)(A1, A2)> {
- public:
- typedef R (RunType)(A1, A2);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1, A2))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2) {
- return function_(a1, a2);
- }
-
- private:
- R (__fastcall *function_)(A1, A2);
-};
-
-// __stdcall Function: Arity 3.
-template <typename R, typename A1, typename A2, typename A3>
-class RunnableAdapter<R(__stdcall *)(A1, A2, A3)> {
- public:
- typedef R (RunType)(A1, A2, A3);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3) {
- return function_(a1, a2, a3);
- }
-
- private:
- R (__stdcall *function_)(A1, A2, A3);
-};
-
-// __fastcall Function: Arity 3.
-template <typename R, typename A1, typename A2, typename A3>
-class RunnableAdapter<R(__fastcall *)(A1, A2, A3)> {
- public:
- typedef R (RunType)(A1, A2, A3);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3) {
- return function_(a1, a2, a3);
- }
-
- private:
- R (__fastcall *function_)(A1, A2, A3);
-};
-
-// __stdcall Function: Arity 4.
-template <typename R, typename A1, typename A2, typename A3, typename A4>
-class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4) {
- return function_(a1, a2, a3, a4);
- }
-
- private:
- R (__stdcall *function_)(A1, A2, A3, A4);
-};
-
-// __fastcall Function: Arity 4.
-template <typename R, typename A1, typename A2, typename A3, typename A4>
-class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4) {
- return function_(a1, a2, a3, a4);
- }
-
- private:
- R (__fastcall *function_)(A1, A2, A3, A4);
-};
-
-// __stdcall Function: Arity 5.
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5>
-class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4, A5);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4,
- typename CallbackParamTraits<A5>::ForwardType a5) {
- return function_(a1, a2, a3, a4, a5);
- }
-
- private:
- R (__stdcall *function_)(A1, A2, A3, A4, A5);
-};
-
-// __fastcall Function: Arity 5.
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5>
-class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4, A5);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4,
- typename CallbackParamTraits<A5>::ForwardType a5) {
- return function_(a1, a2, a3, a4, a5);
- }
-
- private:
- R (__fastcall *function_)(A1, A2, A3, A4, A5);
-};
-
-// __stdcall Function: Arity 6.
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6>
-class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4, A5, A6);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4,
- typename CallbackParamTraits<A5>::ForwardType a5,
- typename CallbackParamTraits<A6>::ForwardType a6) {
- return function_(a1, a2, a3, a4, a5, a6);
- }
-
- private:
- R (__stdcall *function_)(A1, A2, A3, A4, A5, A6);
-};
-
-// __fastcall Function: Arity 6.
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6>
-class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4, A5, A6);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4,
- typename CallbackParamTraits<A5>::ForwardType a5,
- typename CallbackParamTraits<A6>::ForwardType a6) {
- return function_(a1, a2, a3, a4, a5, a6);
- }
-
- private:
- R (__fastcall *function_)(A1, A2, A3, A4, A5, A6);
-};
-
-// __stdcall Function: Arity 7.
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7>
-class RunnableAdapter<R(__stdcall *)(A1, A2, A3, A4, A5, A6, A7)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
-
- explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4,
- typename CallbackParamTraits<A5>::ForwardType a5,
- typename CallbackParamTraits<A6>::ForwardType a6,
- typename CallbackParamTraits<A7>::ForwardType a7) {
- return function_(a1, a2, a3, a4, a5, a6, a7);
- }
-
- private:
- R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7);
-};
-
-// __fastcall Function: Arity 7.
-template <typename R, typename A1, typename A2, typename A3, typename A4,
- typename A5, typename A6, typename A7>
-class RunnableAdapter<R(__fastcall *)(A1, A2, A3, A4, A5, A6, A7)> {
- public:
- typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7);
-
- explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7))
- : function_(function) {
- }
-
- R Run(typename CallbackParamTraits<A1>::ForwardType a1,
- typename CallbackParamTraits<A2>::ForwardType a2,
- typename CallbackParamTraits<A3>::ForwardType a3,
- typename CallbackParamTraits<A4>::ForwardType a4,
- typename CallbackParamTraits<A5>::ForwardType a5,
- typename CallbackParamTraits<A6>::ForwardType a6,
- typename CallbackParamTraits<A7>::ForwardType a7) {
- return function_(a1, a2, a3, a4, a5, a6, a7);
- }
-
- private:
- R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7);
+ R (__fastcall *function_)(Args...);
};
} // namespace internal
diff --git a/base/bind_internal_win.h.pump b/base/bind_internal_win.h.pump
deleted file mode 100644
index cd108b6..0000000
--- a/base/bind_internal_win.h.pump
+++ /dev/null
@@ -1,81 +0,0 @@
-$$ This is a pump file for generating file templates. Pump is a python
-$$ script that is part of the Google Test suite of utilities. Description
-$$ can be found here:
-$$
-$$ http://code.google.com/p/googletest/wiki/PumpManual
-$$
-
-$$ See comment for MAX_ARITY in base/bind.h.pump.
-$var MAX_ARITY = 7
-
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Specializations of RunnableAdapter<> for Windows specific calling
-// conventions. Please see base/bind_internal.h for more info.
-
-#ifndef BASE_BIND_INTERNAL_WIN_H_
-#define BASE_BIND_INTERNAL_WIN_H_
-
-// In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all
-// the same as __cdecl which would turn the following specializations into
-// multiple definitions.
-#if !defined(ARCH_CPU_X86_64)
-
-namespace base {
-namespace internal {
-
-template <typename Functor>
-class RunnableAdapter;
-
-$range ARITY 0..MAX_ARITY
-$for ARITY [[
-$range ARG 1..ARITY
-
-// __stdcall Function: Arity $(ARITY).
-template <typename R[[]]
-$if ARITY > 0[[, ]] $for ARG , [[typename A$(ARG)]]>
-class RunnableAdapter<R(__stdcall *)($for ARG , [[A$(ARG)]])> {
- public:
- typedef R (RunType)($for ARG , [[A$(ARG)]]);
-
- explicit RunnableAdapter(R(__stdcall *function)($for ARG , [[A$(ARG)]]))
- : function_(function) {
- }
-
- R Run($for ARG , [[typename CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) {
- return function_($for ARG , [[a$(ARG)]]);
- }
-
- private:
- R (__stdcall *function_)($for ARG , [[A$(ARG)]]);
-};
-
-// __fastcall Function: Arity $(ARITY).
-template <typename R[[]]
-$if ARITY > 0[[, ]] $for ARG , [[typename A$(ARG)]]>
-class RunnableAdapter<R(__fastcall *)($for ARG , [[A$(ARG)]])> {
- public:
- typedef R (RunType)($for ARG , [[A$(ARG)]]);
-
- explicit RunnableAdapter(R(__fastcall *function)($for ARG , [[A$(ARG)]]))
- : function_(function) {
- }
-
- R Run($for ARG , [[typename CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) {
- return function_($for ARG , [[a$(ARG)]]);
- }
-
- private:
- R (__fastcall *function_)($for ARG , [[A$(ARG)]]);
-};
-
-]] $$for ARITY
-
-} // namespace internal
-} // namespace base
-
-#endif // !defined(ARCH_CPU_X86_64)
-
-#endif // BASE_BIND_INTERNAL_WIN_H_
diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc
index e1f15cb..ce1af1b 100644
--- a/base/bind_unittest.cc
+++ b/base/bind_unittest.cc
@@ -66,7 +66,7 @@
class Child : public Parent {
public:
- virtual void VirtualSet() OVERRIDE { value = kChildValue; }
+ virtual void VirtualSet() override { value = kChildValue; }
void NonVirtualSet() { value = kChildValue; }
};
@@ -78,7 +78,7 @@
};
class NoRefChild : public NoRefParent {
- virtual void VirtualSet() OVERRIDE { value = kChildValue; }
+ virtual void VirtualSet() override { value = kChildValue; }
void NonVirtualSet() { value = kChildValue; }
};
diff --git a/base/callback_list.h b/base/callback_list.h
index 5b911fd..aeed5f1 100644
--- a/base/callback_list.h
+++ b/base/callback_list.h
@@ -1,8 +1,3 @@
-// This file was GENERATED by command:
-// pump.py callback_list.h.pump
-// DO NOT EDIT BY HAND!!!
-
-
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -208,192 +203,21 @@
template <typename Sig> class CallbackList;
-template <>
-class CallbackList<void(void)>
- : public internal::CallbackListBase<Callback<void(void)> > {
+template <typename... Args>
+class CallbackList<void(Args...)>
+ : public internal::CallbackListBase<Callback<void(Args...)> > {
public:
- typedef Callback<void(void)> CallbackType;
+ typedef Callback<void(Args...)> CallbackType;
CallbackList() {}
- void Notify() {
- internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run();
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1>
-class CallbackList<void(A1)>
- : public internal::CallbackListBase<Callback<void(A1)> > {
- public:
- typedef Callback<void(A1)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1) {
+ void Notify(
+ typename internal::CallbackParamTraits<Args>::ForwardType... args) {
typename internal::CallbackListBase<CallbackType>::Iterator it =
this->GetIterator();
CallbackType* cb;
while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1, typename A2>
-class CallbackList<void(A1, A2)>
- : public internal::CallbackListBase<Callback<void(A1, A2)> > {
- public:
- typedef Callback<void(A1, A2)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2) {
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1, a2);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1, typename A2, typename A3>
-class CallbackList<void(A1, A2, A3)>
- : public internal::CallbackListBase<Callback<void(A1, A2, A3)> > {
- public:
- typedef Callback<void(A1, A2, A3)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2,
- typename internal::CallbackParamTraits<A3>::ForwardType a3) {
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1, a2, a3);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1, typename A2, typename A3, typename A4>
-class CallbackList<void(A1, A2, A3, A4)>
- : public internal::CallbackListBase<Callback<void(A1, A2, A3, A4)> > {
- public:
- typedef Callback<void(A1, A2, A3, A4)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2,
- typename internal::CallbackParamTraits<A3>::ForwardType a3,
- typename internal::CallbackParamTraits<A4>::ForwardType a4) {
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1, a2, a3, a4);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5>
-class CallbackList<void(A1, A2, A3, A4, A5)>
- : public internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5)> > {
- public:
- typedef Callback<void(A1, A2, A3, A4, A5)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2,
- typename internal::CallbackParamTraits<A3>::ForwardType a3,
- typename internal::CallbackParamTraits<A4>::ForwardType a4,
- typename internal::CallbackParamTraits<A5>::ForwardType a5) {
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1, a2, a3, a4, a5);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6>
-class CallbackList<void(A1, A2, A3, A4, A5, A6)>
- : public internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5,
- A6)> > {
- public:
- typedef Callback<void(A1, A2, A3, A4, A5, A6)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2,
- typename internal::CallbackParamTraits<A3>::ForwardType a3,
- typename internal::CallbackParamTraits<A4>::ForwardType a4,
- typename internal::CallbackParamTraits<A5>::ForwardType a5,
- typename internal::CallbackParamTraits<A6>::ForwardType a6) {
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1, a2, a3, a4, a5, a6);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-template <typename A1, typename A2, typename A3, typename A4, typename A5,
- typename A6, typename A7>
-class CallbackList<void(A1, A2, A3, A4, A5, A6, A7)>
- : public internal::CallbackListBase<Callback<void(A1, A2, A3, A4, A5, A6,
- A7)> > {
- public:
- typedef Callback<void(A1, A2, A3, A4, A5, A6, A7)> CallbackType;
-
- CallbackList() {}
-
- void Notify(typename internal::CallbackParamTraits<A1>::ForwardType a1,
- typename internal::CallbackParamTraits<A2>::ForwardType a2,
- typename internal::CallbackParamTraits<A3>::ForwardType a3,
- typename internal::CallbackParamTraits<A4>::ForwardType a4,
- typename internal::CallbackParamTraits<A5>::ForwardType a5,
- typename internal::CallbackParamTraits<A6>::ForwardType a6,
- typename internal::CallbackParamTraits<A7>::ForwardType a7) {
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run(a1, a2, a3, a4, a5, a6, a7);
+ cb->Run(args...);
}
}
diff --git a/base/callback_list.h.pump b/base/callback_list.h.pump
deleted file mode 100644
index d7f8473..0000000
--- a/base/callback_list.h.pump
+++ /dev/null
@@ -1,269 +0,0 @@
-$$ This is a pump file for generating file templates. Pump is a python
-$$ script that is part of the Google Test suite of utilities. Description
-$$ can be found here:
-$$
-$$ http://code.google.com/p/googletest/wiki/PumpManual
-$$
-
-$$ See comment for MAX_ARITY in base/bind.h.pump.
-$var MAX_ARITY = 7
-
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_CALLBACK_LIST_H_
-#define BASE_CALLBACK_LIST_H_
-
-#include <list>
-
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/callback_internal.h"
-#include "base/compiler_specific.h"
-#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
-
-// OVERVIEW:
-//
-// A container for a list of callbacks. Unlike a normal STL vector or list,
-// this container can be modified during iteration without invalidating the
-// iterator. It safely handles the case of a callback removing itself
-// or another callback from the list while callbacks are being run.
-//
-// TYPICAL USAGE:
-//
-// class MyWidget {
-// public:
-// ...
-//
-// typedef base::Callback<void(const Foo&)> OnFooCallback;
-//
-// scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
-// RegisterCallback(const OnFooCallback& cb) {
-// return callback_list_.Add(cb);
-// }
-//
-// private:
-// void NotifyFoo(const Foo& foo) {
-// callback_list_.Notify(foo);
-// }
-//
-// base::CallbackList<void(const Foo&)> callback_list_;
-//
-// DISALLOW_COPY_AND_ASSIGN(MyWidget);
-// };
-//
-//
-// class MyWidgetListener {
-// public:
-// MyWidgetListener::MyWidgetListener() {
-// foo_subscription_ = MyWidget::GetCurrent()->RegisterCallback(
-// base::Bind(&MyWidgetListener::OnFoo, this)));
-// }
-//
-// MyWidgetListener::~MyWidgetListener() {
-// // Subscription gets deleted automatically and will deregister
-// // the callback in the process.
-// }
-//
-// private:
-// void OnFoo(const Foo& foo) {
-// // Do something.
-// }
-//
-// scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
-// foo_subscription_;
-//
-// DISALLOW_COPY_AND_ASSIGN(MyWidgetListener);
-// };
-
-namespace base {
-
-namespace internal {
-
-template <typename CallbackType>
-class CallbackListBase {
- public:
- class Subscription {
- public:
- Subscription(CallbackListBase<CallbackType>* list,
- typename std::list<CallbackType>::iterator iter)
- : list_(list),
- iter_(iter) {
- }
-
- ~Subscription() {
- if (list_->active_iterator_count_) {
- iter_->Reset();
- } else {
- list_->callbacks_.erase(iter_);
- if (!list_->removal_callback_.is_null())
- list_->removal_callback_.Run();
- }
- }
-
- private:
- CallbackListBase<CallbackType>* list_;
- typename std::list<CallbackType>::iterator iter_;
-
- DISALLOW_COPY_AND_ASSIGN(Subscription);
- };
-
- // Add a callback to the list. The callback will remain registered until the
- // returned Subscription is destroyed, which must occur before the
- // CallbackList is destroyed.
- scoped_ptr<Subscription> Add(const CallbackType& cb) WARN_UNUSED_RESULT {
- DCHECK(!cb.is_null());
- return scoped_ptr<Subscription>(
- new Subscription(this, callbacks_.insert(callbacks_.end(), cb)));
- }
-
- // Sets a callback which will be run when a subscription list is changed.
- void set_removal_callback(const Closure& callback) {
- removal_callback_ = callback;
- }
-
- // Returns true if there are no subscriptions. This is only valid to call when
- // not looping through the list.
- bool empty() {
- DCHECK_EQ(0, active_iterator_count_);
- return callbacks_.empty();
- }
-
- protected:
- // An iterator class that can be used to access the list of callbacks.
- class Iterator {
- public:
- explicit Iterator(CallbackListBase<CallbackType>* list)
- : list_(list),
- list_iter_(list_->callbacks_.begin()) {
- ++list_->active_iterator_count_;
- }
-
- Iterator(const Iterator& iter)
- : list_(iter.list_),
- list_iter_(iter.list_iter_) {
- ++list_->active_iterator_count_;
- }
-
- ~Iterator() {
- if (list_ && --list_->active_iterator_count_ == 0) {
- list_->Compact();
- }
- }
-
- CallbackType* GetNext() {
- while ((list_iter_ != list_->callbacks_.end()) && list_iter_->is_null())
- ++list_iter_;
-
- CallbackType* cb = NULL;
- if (list_iter_ != list_->callbacks_.end()) {
- cb = &(*list_iter_);
- ++list_iter_;
- }
- return cb;
- }
-
- private:
- CallbackListBase<CallbackType>* list_;
- typename std::list<CallbackType>::iterator list_iter_;
- };
-
- CallbackListBase() : active_iterator_count_(0) {}
-
- ~CallbackListBase() {
- DCHECK_EQ(0, active_iterator_count_);
- DCHECK_EQ(0U, callbacks_.size());
- }
-
- // Returns an instance of a CallbackListBase::Iterator which can be used
- // to run callbacks.
- Iterator GetIterator() {
- return Iterator(this);
- }
-
- // Compact the list: remove any entries which were NULLed out during
- // iteration.
- void Compact() {
- typename std::list<CallbackType>::iterator it = callbacks_.begin();
- bool updated = false;
- while (it != callbacks_.end()) {
- if ((*it).is_null()) {
- updated = true;
- it = callbacks_.erase(it);
- } else {
- ++it;
- }
-
- if (updated && !removal_callback_.is_null())
- removal_callback_.Run();
- }
- }
-
- private:
- std::list<CallbackType> callbacks_;
- int active_iterator_count_;
- Closure removal_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(CallbackListBase);
-};
-
-} // namespace internal
-
-template <typename Sig> class CallbackList;
-
-
-$range ARITY 0..MAX_ARITY
-$for ARITY [[
-$range ARG 1..ARITY
-
-$if ARITY == 0 [[
-template <>
-class CallbackList<void(void)>
- : public internal::CallbackListBase<Callback<void(void)> > {
-]] $else [[
-template <$for ARG , [[typename A$(ARG)]]>
-class CallbackList<void($for ARG , [[A$(ARG)]])>
- : public internal::CallbackListBase<Callback<void($for ARG , [[A$(ARG)]])> > {
-]]
-
- public:
-$if ARITY == 0 [[
-
- typedef Callback<void(void)> CallbackType;
-]] $else [[
-
- typedef Callback<void($for ARG , [[A$(ARG)]])> CallbackType;
-]]
-
-
- CallbackList() {}
-
- void Notify($for ARG ,
- [[typename internal::CallbackParamTraits<A$(ARG)>::ForwardType a$(ARG)]]) {
-$if ARITY == 0 [[
-
- internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
-]] $else [[
-
- typename internal::CallbackListBase<CallbackType>::Iterator it =
- this->GetIterator();
-]]
-
- CallbackType* cb;
- while ((cb = it.GetNext()) != NULL) {
- cb->Run($for ARG , [[a$(ARG)]]);
- }
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CallbackList);
-};
-
-
-]] $$ for ARITY
-} // namespace base
-
-#endif // BASE_CALLBACK_LIST_H_
diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc
index 9e477cf..ae40d7c 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -402,7 +402,7 @@
public:
PrintBacktraceOutputHandler() {}
- virtual void HandleOutput(const char* output) OVERRIDE {
+ virtual void HandleOutput(const char* output) override {
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
PrintToStderr(output);
@@ -417,7 +417,7 @@
explicit StreamBacktraceOutputHandler(std::ostream* os) : os_(os) {
}
- virtual void HandleOutput(const char* output) OVERRIDE {
+ virtual void HandleOutput(const char* output) override {
(*os_) << output;
}
diff --git a/base/debug/trace_event.h b/base/debug/trace_event.h
index db78f74..62a9b1f 100644
--- a/base/debug/trace_event.h
+++ b/base/debug/trace_event.h
@@ -144,7 +144,7 @@
// class MyData : public base::debug::ConvertableToTraceFormat {
// public:
// MyData() {}
-// virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+// virtual void AppendAsTraceFormat(std::string* out) const override {
// out->append("{\"foo\":1}");
// }
// private:
diff --git a/base/debug/trace_event_argument.h b/base/debug/trace_event_argument.h
index 9d35358..7aa7c87 100644
--- a/base/debug/trace_event_argument.h
+++ b/base/debug/trace_event_argument.h
@@ -40,7 +40,7 @@
void BeginArray();
void BeginDictionary();
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE;
+ virtual void AppendAsTraceFormat(std::string* out) const override;
private:
virtual ~TracedValue();
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index 9110bf2..0607a19 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -140,7 +140,7 @@
recyclable_chunks_queue_[i] = i;
}
- virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) OVERRIDE {
+ virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) override {
// Because the number of threads is much less than the number of chunks,
// the queue should never be empty.
DCHECK(!QueueIsEmpty());
@@ -163,7 +163,7 @@
}
virtual void ReturnChunk(size_t index,
- scoped_ptr<TraceBufferChunk> chunk) OVERRIDE {
+ scoped_ptr<TraceBufferChunk> chunk) override {
// When this method is called, the queue should not be full because it
// can contain all chunks including the one to be returned.
DCHECK(!QueueIsFull());
@@ -175,20 +175,20 @@
queue_tail_ = NextQueueIndex(queue_tail_);
}
- virtual bool IsFull() const OVERRIDE {
+ virtual bool IsFull() const override {
return false;
}
- virtual size_t Size() const OVERRIDE {
+ virtual size_t Size() const override {
// This is approximate because not all of the chunks are full.
return chunks_.size() * kTraceBufferChunkSize;
}
- virtual size_t Capacity() const OVERRIDE {
+ virtual size_t Capacity() const override {
return max_chunks_ * kTraceBufferChunkSize;
}
- virtual TraceEvent* GetEventByHandle(TraceEventHandle handle) OVERRIDE {
+ virtual TraceEvent* GetEventByHandle(TraceEventHandle handle) override {
if (handle.chunk_index >= chunks_.size())
return NULL;
TraceBufferChunk* chunk = chunks_[handle.chunk_index];
@@ -197,7 +197,7 @@
return chunk->GetEventAt(handle.event_index);
}
- virtual const TraceBufferChunk* NextChunk() OVERRIDE {
+ virtual const TraceBufferChunk* NextChunk() override {
if (chunks_.empty())
return NULL;
@@ -212,7 +212,7 @@
return NULL;
}
- virtual scoped_ptr<TraceBuffer> CloneForIteration() const OVERRIDE {
+ virtual scoped_ptr<TraceBuffer> CloneForIteration() const override {
scoped_ptr<ClonedTraceBuffer> cloned_buffer(new ClonedTraceBuffer());
for (size_t queue_index = queue_head_; queue_index != queue_tail_;
queue_index = NextQueueIndex(queue_index)) {
@@ -231,26 +231,26 @@
ClonedTraceBuffer() : current_iteration_index_(0) {}
// The only implemented method.
- virtual const TraceBufferChunk* NextChunk() OVERRIDE {
+ virtual const TraceBufferChunk* NextChunk() override {
return current_iteration_index_ < chunks_.size() ?
chunks_[current_iteration_index_++] : NULL;
}
- virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) OVERRIDE {
+ virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) override {
NOTIMPLEMENTED();
return scoped_ptr<TraceBufferChunk>();
}
virtual void ReturnChunk(size_t index,
- scoped_ptr<TraceBufferChunk>) OVERRIDE {
+ scoped_ptr<TraceBufferChunk>) override {
NOTIMPLEMENTED();
}
- virtual bool IsFull() const OVERRIDE { return false; }
- virtual size_t Size() const OVERRIDE { return 0; }
- virtual size_t Capacity() const OVERRIDE { return 0; }
- virtual TraceEvent* GetEventByHandle(TraceEventHandle handle) OVERRIDE {
+ virtual bool IsFull() const override { return false; }
+ virtual size_t Size() const override { return 0; }
+ virtual size_t Capacity() const override { return 0; }
+ virtual TraceEvent* GetEventByHandle(TraceEventHandle handle) override {
return NULL;
}
- virtual scoped_ptr<TraceBuffer> CloneForIteration() const OVERRIDE {
+ virtual scoped_ptr<TraceBuffer> CloneForIteration() const override {
NOTIMPLEMENTED();
return scoped_ptr<TraceBuffer>();
}
@@ -306,7 +306,7 @@
chunks_.reserve(max_chunks_);
}
- virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) OVERRIDE {
+ virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) override {
// This function may be called when adding normal events or indirectly from
// AddMetadataEventsWhileLocked(). We can not DECHECK(!IsFull()) because we
// have to add the metadata events and flush thread-local buffers even if
@@ -320,7 +320,7 @@
}
virtual void ReturnChunk(size_t index,
- scoped_ptr<TraceBufferChunk> chunk) OVERRIDE {
+ scoped_ptr<TraceBufferChunk> chunk) override {
DCHECK_GT(in_flight_chunk_count_, 0u);
DCHECK_LT(index, chunks_.size());
DCHECK(!chunks_[index]);
@@ -328,20 +328,20 @@
chunks_[index] = chunk.release();
}
- virtual bool IsFull() const OVERRIDE {
+ virtual bool IsFull() const override {
return chunks_.size() >= max_chunks_;
}
- virtual size_t Size() const OVERRIDE {
+ virtual size_t Size() const override {
// This is approximate because not all of the chunks are full.
return chunks_.size() * kTraceBufferChunkSize;
}
- virtual size_t Capacity() const OVERRIDE {
+ virtual size_t Capacity() const override {
return max_chunks_ * kTraceBufferChunkSize;
}
- virtual TraceEvent* GetEventByHandle(TraceEventHandle handle) OVERRIDE {
+ virtual TraceEvent* GetEventByHandle(TraceEventHandle handle) override {
if (handle.chunk_index >= chunks_.size())
return NULL;
TraceBufferChunk* chunk = chunks_[handle.chunk_index];
@@ -350,7 +350,7 @@
return chunk->GetEventAt(handle.event_index);
}
- virtual const TraceBufferChunk* NextChunk() OVERRIDE {
+ virtual const TraceBufferChunk* NextChunk() override {
while (current_iteration_index_ < chunks_.size()) {
// Skip in-flight chunks.
const TraceBufferChunk* chunk = chunks_[current_iteration_index_++];
@@ -360,7 +360,7 @@
return NULL;
}
- virtual scoped_ptr<TraceBuffer> CloneForIteration() const OVERRIDE {
+ virtual scoped_ptr<TraceBuffer> CloneForIteration() const override {
NOTIMPLEMENTED();
return scoped_ptr<TraceBuffer>();
}
@@ -869,7 +869,7 @@
virtual ~TraceSamplingThread();
// Implementation of PlatformThread::Delegate:
- virtual void ThreadMain() OVERRIDE;
+ virtual void ThreadMain() override;
static void DefaultSamplingCallback(TraceBucketData* bucekt_data);
@@ -1066,7 +1066,7 @@
private:
// MessageLoop::DestructionObserver
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+ virtual void WillDestroyCurrentMessageLoop() override;
void FlushWhileLocked();
diff --git a/base/debug/trace_event_memory.cc b/base/debug/trace_event_memory.cc
index 3c46827..5cb0908 100644
--- a/base/debug/trace_event_memory.cc
+++ b/base/debug/trace_event_memory.cc
@@ -33,7 +33,7 @@
explicit MemoryDumpHolder(char* dump) : dump_(dump) {}
// base::debug::ConvertableToTraceFormat overrides:
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ virtual void AppendAsTraceFormat(std::string* out) const override {
AppendHeapProfileAsTraceFormat(dump_, out);
}
diff --git a/base/debug/trace_event_memory.h b/base/debug/trace_event_memory.h
index df2e663..4caeef4 100644
--- a/base/debug/trace_event_memory.h
+++ b/base/debug/trace_event_memory.h
@@ -47,8 +47,8 @@
virtual ~TraceMemoryController();
// base::debug::TraceLog::EnabledStateChangedObserver overrides:
- virtual void OnTraceLogEnabled() OVERRIDE;
- virtual void OnTraceLogDisabled() OVERRIDE;
+ virtual void OnTraceLogEnabled() override;
+ virtual void OnTraceLogDisabled() override;
// Starts heap memory profiling.
void StartProfiling();
diff --git a/base/debug/trace_event_synthetic_delay.cc b/base/debug/trace_event_synthetic_delay.cc
index 868a777..efb797a 100644
--- a/base/debug/trace_event_synthetic_delay.cc
+++ b/base/debug/trace_event_synthetic_delay.cc
@@ -23,7 +23,7 @@
void ResetAllDelays();
// TraceEventSyntheticDelayClock implementation.
- virtual base::TimeTicks Now() OVERRIDE;
+ virtual base::TimeTicks Now() override;
private:
TraceEventSyntheticDelayRegistry();
diff --git a/base/debug/trace_event_synthetic_delay_unittest.cc b/base/debug/trace_event_synthetic_delay_unittest.cc
index a418eed..124706f 100644
--- a/base/debug/trace_event_synthetic_delay_unittest.cc
+++ b/base/debug/trace_event_synthetic_delay_unittest.cc
@@ -26,7 +26,7 @@
}
// TraceEventSyntheticDelayClock implementation.
- virtual base::TimeTicks Now() OVERRIDE {
+ virtual base::TimeTicks Now() override {
AdvanceTime(base::TimeDelta::FromMilliseconds(kShortDurationMs / 10));
return now_;
}
diff --git a/base/debug/trace_event_system_stats_monitor.cc b/base/debug/trace_event_system_stats_monitor.cc
index a712838..b2bf2ae 100644
--- a/base/debug/trace_event_system_stats_monitor.cc
+++ b/base/debug/trace_event_system_stats_monitor.cc
@@ -31,7 +31,7 @@
void GetSystemProfilingStats();
// base::debug::ConvertableToTraceFormat overrides:
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ virtual void AppendAsTraceFormat(std::string* out) const override {
AppendSystemProfileAsTraceFormat(system_stats_, out);
}
diff --git a/base/debug/trace_event_system_stats_monitor.h b/base/debug/trace_event_system_stats_monitor.h
index 1a8b328..f676fce 100644
--- a/base/debug/trace_event_system_stats_monitor.h
+++ b/base/debug/trace_event_system_stats_monitor.h
@@ -36,8 +36,8 @@
virtual ~TraceEventSystemStatsMonitor();
// base::debug::TraceLog::EnabledStateChangedObserver overrides:
- virtual void OnTraceLogEnabled() OVERRIDE;
- virtual void OnTraceLogDisabled() OVERRIDE;
+ virtual void OnTraceLogEnabled() override;
+ virtual void OnTraceLogDisabled() override;
// Retrieves system profiling at the current time.
void DumpSystemStats();
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index 581906b..90be070 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -125,7 +125,7 @@
base::Unretained(flush_complete_event)));
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
const char* name = PlatformThread::GetName();
old_thread_name_ = name ? strdup(name) : NULL;
@@ -136,7 +136,7 @@
trace_buffer_.SetOutputCallback(json_output_.GetCallback());
event_watch_notification_ = 0;
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (TraceLog::GetInstance())
EXPECT_FALSE(TraceLog::GetInstance()->IsEnabled());
PlatformThread::SetName(old_thread_name_ ? old_thread_name_ : "");
@@ -996,11 +996,11 @@
virtual ~AfterStateChangeEnabledStateObserver() {}
// TraceLog::EnabledStateObserver overrides:
- virtual void OnTraceLogEnabled() OVERRIDE {
+ virtual void OnTraceLogEnabled() override {
EXPECT_TRUE(TraceLog::GetInstance()->IsEnabled());
}
- virtual void OnTraceLogDisabled() OVERRIDE {
+ virtual void OnTraceLogDisabled() override {
EXPECT_FALSE(TraceLog::GetInstance()->IsEnabled());
}
};
@@ -1029,9 +1029,9 @@
virtual ~SelfRemovingEnabledStateObserver() {}
// TraceLog::EnabledStateObserver overrides:
- virtual void OnTraceLogEnabled() OVERRIDE {}
+ virtual void OnTraceLogEnabled() override {}
- virtual void OnTraceLogDisabled() OVERRIDE {
+ virtual void OnTraceLogDisabled() override {
TraceLog::GetInstance()->RemoveEnabledStateObserver(this);
}
};
@@ -1919,7 +1919,7 @@
public:
MyData() {}
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ virtual void AppendAsTraceFormat(std::string* out) const override {
out->append("{\"foo\":1}");
}
@@ -2203,12 +2203,12 @@
class TraceEventCallbackTest : public TraceEventTestFixture {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
TraceEventTestFixture::SetUp();
ASSERT_EQ(NULL, s_instance);
s_instance = this;
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
TraceLog::GetInstance()->SetDisabled();
ASSERT_TRUE(!!s_instance);
s_instance = NULL;
diff --git a/base/deferred_sequenced_task_runner.h b/base/deferred_sequenced_task_runner.h
index 00ab050..3220ac1 100644
--- a/base/deferred_sequenced_task_runner.h
+++ b/base/deferred_sequenced_task_runner.h
@@ -29,14 +29,14 @@
// TaskRunner implementation
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
// SequencedTaskRunner implementation
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
+ TimeDelta delay) override;
// Start the execution - posts all queued tasks to the target executor. The
// deferred tasks are posted with their initial delay, meaning that the task
diff --git a/base/environment.cc b/base/environment.cc
index c547730..94a766c 100644
--- a/base/environment.cc
+++ b/base/environment.cc
@@ -23,7 +23,7 @@
class EnvironmentImpl : public base::Environment {
public:
virtual bool GetVar(const char* variable_name,
- std::string* result) OVERRIDE {
+ std::string* result) override {
if (GetVarImpl(variable_name, result))
return true;
@@ -43,11 +43,11 @@
}
virtual bool SetVar(const char* variable_name,
- const std::string& new_value) OVERRIDE {
+ const std::string& new_value) override {
return SetVarImpl(variable_name, new_value);
}
- virtual bool UnSetVar(const char* variable_name) OVERRIDE {
+ virtual bool UnSetVar(const char* variable_name) override {
return UnSetVarImpl(variable_name);
}
diff --git a/base/file_version_info_mac.h b/base/file_version_info_mac.h
index f0edb3a..50a04eb 100644
--- a/base/file_version_info_mac.h
+++ b/base/file_version_info_mac.h
@@ -23,22 +23,22 @@
// Accessors to the different version properties.
// Returns an empty string if the property is not found.
- virtual base::string16 company_name() OVERRIDE;
- virtual base::string16 company_short_name() OVERRIDE;
- virtual base::string16 product_name() OVERRIDE;
- virtual base::string16 product_short_name() OVERRIDE;
- virtual base::string16 internal_name() OVERRIDE;
- virtual base::string16 product_version() OVERRIDE;
- virtual base::string16 private_build() OVERRIDE;
- virtual base::string16 special_build() OVERRIDE;
- virtual base::string16 comments() OVERRIDE;
- virtual base::string16 original_filename() OVERRIDE;
- virtual base::string16 file_description() OVERRIDE;
- virtual base::string16 file_version() OVERRIDE;
- virtual base::string16 legal_copyright() OVERRIDE;
- virtual base::string16 legal_trademarks() OVERRIDE;
- virtual base::string16 last_change() OVERRIDE;
- virtual bool is_official_build() OVERRIDE;
+ virtual base::string16 company_name() override;
+ virtual base::string16 company_short_name() override;
+ virtual base::string16 product_name() override;
+ virtual base::string16 product_short_name() override;
+ virtual base::string16 internal_name() override;
+ virtual base::string16 product_version() override;
+ virtual base::string16 private_build() override;
+ virtual base::string16 special_build() override;
+ virtual base::string16 comments() override;
+ virtual base::string16 original_filename() override;
+ virtual base::string16 file_description() override;
+ virtual base::string16 file_version() override;
+ virtual base::string16 legal_copyright() override;
+ virtual base::string16 legal_trademarks() override;
+ virtual base::string16 last_change() override;
+ virtual bool is_official_build() override;
private:
// Returns a base::string16 value for a property name.
diff --git a/base/file_version_info_win.h b/base/file_version_info_win.h
index 34bc675..0e0f271 100644
--- a/base/file_version_info_win.h
+++ b/base/file_version_info_win.h
@@ -22,22 +22,22 @@
// Accessors to the different version properties.
// Returns an empty string if the property is not found.
- virtual base::string16 company_name() OVERRIDE;
- virtual base::string16 company_short_name() OVERRIDE;
- virtual base::string16 product_name() OVERRIDE;
- virtual base::string16 product_short_name() OVERRIDE;
- virtual base::string16 internal_name() OVERRIDE;
- virtual base::string16 product_version() OVERRIDE;
- virtual base::string16 private_build() OVERRIDE;
- virtual base::string16 special_build() OVERRIDE;
- virtual base::string16 comments() OVERRIDE;
- virtual base::string16 original_filename() OVERRIDE;
- virtual base::string16 file_description() OVERRIDE;
- virtual base::string16 file_version() OVERRIDE;
- virtual base::string16 legal_copyright() OVERRIDE;
- virtual base::string16 legal_trademarks() OVERRIDE;
- virtual base::string16 last_change() OVERRIDE;
- virtual bool is_official_build() OVERRIDE;
+ virtual base::string16 company_name() override;
+ virtual base::string16 company_short_name() override;
+ virtual base::string16 product_name() override;
+ virtual base::string16 product_short_name() override;
+ virtual base::string16 internal_name() override;
+ virtual base::string16 product_version() override;
+ virtual base::string16 private_build() override;
+ virtual base::string16 special_build() override;
+ virtual base::string16 comments() override;
+ virtual base::string16 original_filename() override;
+ virtual base::string16 file_description() override;
+ virtual base::string16 file_version() override;
+ virtual base::string16 legal_copyright() override;
+ virtual base::string16 legal_trademarks() override;
+ virtual base::string16 last_change() override;
+ virtual bool is_official_build() override;
// Lets you access other properties not covered above.
BASE_EXPORT bool GetValue(const wchar_t* name, std::wstring* value);
diff --git a/base/files/file_path_unittest.cc b/base/files/file_path_unittest.cc
index 8b6f3a8..906d8df 100644
--- a/base/files/file_path_unittest.cc
+++ b/base/files/file_path_unittest.cc
@@ -50,10 +50,10 @@
// to be a PlatformTest
class FilePathTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
PlatformTest::SetUp();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
PlatformTest::TearDown();
}
};
diff --git a/base/files/file_path_watcher_browsertest.cc b/base/files/file_path_watcher_browsertest.cc
index 5cf75fc..f6d6d33 100644
--- a/base/files/file_path_watcher_browsertest.cc
+++ b/base/files/file_path_watcher_browsertest.cc
@@ -113,7 +113,7 @@
}
virtual ~TestDelegate() {}
- virtual void OnFileChanged(const FilePath& path, bool error) OVERRIDE {
+ virtual void OnFileChanged(const FilePath& path, bool error) override {
if (error)
ADD_FAILURE() << "Error " << path.value();
else
@@ -146,7 +146,7 @@
virtual ~FilePathWatcherTest() {}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Create a separate file thread in order to test proper thread usage.
base::Thread::Options options(MessageLoop::TYPE_IO, 0);
ASSERT_TRUE(file_thread_.StartWithOptions(options));
@@ -154,7 +154,7 @@
collector_ = new NotificationCollector();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
RunLoop().RunUntilIdle();
}
@@ -274,7 +274,7 @@
}
virtual ~Deleter() {}
- virtual void OnFileChanged(const FilePath&, bool) OVERRIDE {
+ virtual void OnFileChanged(const FilePath&, bool) override {
watcher_.reset();
loop_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
}
diff --git a/base/files/file_path_watcher_fsevents.h b/base/files/file_path_watcher_fsevents.h
index 5640b4d..d2fb8da 100644
--- a/base/files/file_path_watcher_fsevents.h
+++ b/base/files/file_path_watcher_fsevents.h
@@ -38,8 +38,8 @@
// FilePathWatcher::PlatformDelegate overrides.
virtual bool Watch(const FilePath& path,
bool recursive,
- const FilePathWatcher::Callback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
+ const FilePathWatcher::Callback& callback) override;
+ virtual void Cancel() override;
private:
virtual ~FilePathWatcherFSEvents();
@@ -51,7 +51,7 @@
void StartEventStream(FSEventStreamEventId start_event);
// Cleans up and stops the event stream.
- virtual void CancelOnMessageLoopThread() OVERRIDE;
+ virtual void CancelOnMessageLoopThread() override;
// Callback to notify upon changes.
FilePathWatcher::Callback callback_;
diff --git a/base/files/file_path_watcher_kqueue.h b/base/files/file_path_watcher_kqueue.h
index 703fda6..aa13af3 100644
--- a/base/files/file_path_watcher_kqueue.h
+++ b/base/files/file_path_watcher_kqueue.h
@@ -33,17 +33,17 @@
FilePathWatcherKQueue();
// MessageLoopForIO::Watcher overrides.
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanReadWithoutBlocking(int fd) override;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override;
// MessageLoop::DestructionObserver overrides.
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+ virtual void WillDestroyCurrentMessageLoop() override;
// FilePathWatcher::PlatformDelegate overrides.
virtual bool Watch(const FilePath& path,
bool recursive,
- const FilePathWatcher::Callback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
+ const FilePathWatcher::Callback& callback) override;
+ virtual void Cancel() override;
protected:
virtual ~FilePathWatcherKQueue();
@@ -60,7 +60,7 @@
typedef std::vector<struct kevent> EventVector;
// Can only be called on |io_message_loop_|'s thread.
- virtual void CancelOnMessageLoopThread() OVERRIDE;
+ virtual void CancelOnMessageLoopThread() override;
// Returns true if the kevent values are error free.
bool AreKeventValuesValid(struct kevent* kevents, int count);
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc
index d5d664e..fb5ba62 100644
--- a/base/files/file_path_watcher_linux.cc
+++ b/base/files/file_path_watcher_linux.cc
@@ -112,18 +112,18 @@
// Returns true if watch for |path| has been added successfully.
virtual bool Watch(const FilePath& path,
bool recursive,
- const FilePathWatcher::Callback& callback) OVERRIDE;
+ const FilePathWatcher::Callback& callback) override;
// Cancel the watch. This unregisters the instance with InotifyReader.
- virtual void Cancel() OVERRIDE;
+ virtual void Cancel() override;
// Cleans up and stops observing the message_loop() thread.
- virtual void CancelOnMessageLoopThread() OVERRIDE;
+ virtual void CancelOnMessageLoopThread() override;
// Deletion of the FilePathWatcher will call Cancel() to dispose of this
// object in the right thread. This also observes destruction of the required
// cleanup thread, in case it quits before Cancel() is called.
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+ virtual void WillDestroyCurrentMessageLoop() override;
// Inotify watches are installed for all directory components of |target_|. A
// WatchEntry instance holds the watch descriptor for a component and the
diff --git a/base/files/file_path_watcher_mac.cc b/base/files/file_path_watcher_mac.cc
index b21ba1d..58f78bd 100644
--- a/base/files/file_path_watcher_mac.cc
+++ b/base/files/file_path_watcher_mac.cc
@@ -17,7 +17,7 @@
public:
virtual bool Watch(const FilePath& path,
bool recursive,
- const FilePathWatcher::Callback& callback) OVERRIDE {
+ const FilePathWatcher::Callback& callback) override {
// Use kqueue for non-recursive watches and FSEvents for recursive ones.
DCHECK(!impl_.get());
if (recursive) {
@@ -33,13 +33,13 @@
return impl_->Watch(path, recursive, callback);
}
- virtual void Cancel() OVERRIDE {
+ virtual void Cancel() override {
if (impl_.get())
impl_->Cancel();
set_cancelled();
}
- virtual void CancelOnMessageLoopThread() OVERRIDE {
+ virtual void CancelOnMessageLoopThread() override {
if (impl_.get())
impl_->Cancel();
set_cancelled();
diff --git a/base/files/file_path_watcher_stub.cc b/base/files/file_path_watcher_stub.cc
index afca0da..d7ad206 100644
--- a/base/files/file_path_watcher_stub.cc
+++ b/base/files/file_path_watcher_stub.cc
@@ -15,13 +15,13 @@
public:
virtual bool Watch(const FilePath& path,
bool recursive,
- const FilePathWatcher::Callback& callback) OVERRIDE {
+ const FilePathWatcher::Callback& callback) override {
return false;
}
- virtual void Cancel() OVERRIDE {}
+ virtual void Cancel() override {}
- virtual void CancelOnMessageLoopThread() OVERRIDE {}
+ virtual void CancelOnMessageLoopThread() override {}
protected:
virtual ~FilePathWatcherImpl() {}
diff --git a/base/files/file_path_watcher_win.cc b/base/files/file_path_watcher_win.cc
index 54a2388..98169ab 100644
--- a/base/files/file_path_watcher_win.cc
+++ b/base/files/file_path_watcher_win.cc
@@ -30,13 +30,13 @@
// FilePathWatcher::PlatformDelegate overrides.
virtual bool Watch(const FilePath& path,
bool recursive,
- const FilePathWatcher::Callback& callback) OVERRIDE;
- virtual void Cancel() OVERRIDE;
+ const FilePathWatcher::Callback& callback) override;
+ virtual void Cancel() override;
// Deletion of the FilePathWatcher will call Cancel() to dispose of this
// object in the right thread. This also observes destruction of the required
// cleanup thread, in case it quits before Cancel() is called.
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+ virtual void WillDestroyCurrentMessageLoop() override;
// Callback from MessageLoopForIO.
virtual void OnObjectSignaled(HANDLE object);
@@ -59,7 +59,7 @@
void DestroyWatch();
// Cleans up and stops observing the |message_loop_| thread.
- void CancelOnMessageLoopThread() OVERRIDE;
+ void CancelOnMessageLoopThread() override;
// Callback to notify upon changes.
FilePathWatcher::Callback callback_;
diff --git a/base/files/file_proxy_unittest.cc b/base/files/file_proxy_unittest.cc
index 2c62fa9..0034a1c 100644
--- a/base/files/file_proxy_unittest.cc
+++ b/base/files/file_proxy_unittest.cc
@@ -24,7 +24,7 @@
bytes_written_(-1),
weak_factory_(this) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(dir_.CreateUniqueTempDir());
ASSERT_TRUE(file_thread_.Start());
}
diff --git a/base/files/file_util.h b/base/files/file_util.h
index feebeed..ecc0d58 100644
--- a/base/files/file_util.h
+++ b/base/files/file_util.h
@@ -326,14 +326,16 @@
int size);
#if defined(OS_POSIX)
-// Append the data to |fd|. Does not close |fd| when done.
-BASE_EXPORT int WriteFileDescriptor(const int fd, const char* data, int size);
+// Appends |data| to |fd|. Does not close |fd| when done. Returns true iff
+// |size| bytes of |data| were written to |fd|.
+BASE_EXPORT bool WriteFileDescriptor(const int fd, const char* data, int size);
#endif
-// Append the given buffer into the file. Returns the number of bytes written,
-// or -1 on error.
-BASE_EXPORT int AppendToFile(const FilePath& filename,
- const char* data, int size);
+// Appends |data| to |filename|. Returns true iff |size| bytes of |data| were
+// written to |filename|.
+BASE_EXPORT bool AppendToFile(const FilePath& filename,
+ const char* data,
+ int size);
// Gets the current working directory for the process.
BASE_EXPORT bool GetCurrentDirectory(FilePath* path);
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
index 07c21d1..561f5c7 100644
--- a/base/files/file_util_posix.cc
+++ b/base/files/file_util_posix.cc
@@ -682,13 +682,13 @@
if (fd < 0)
return -1;
- int bytes_written = WriteFileDescriptor(fd, data, size);
+ int bytes_written = WriteFileDescriptor(fd, data, size) ? size : -1;
if (IGNORE_EINTR(close(fd)) < 0)
return -1;
return bytes_written;
}
-int WriteFileDescriptor(const int fd, const char* data, int size) {
+bool WriteFileDescriptor(const int fd, const char* data, int size) {
// Allow for partial writes.
ssize_t bytes_written_total = 0;
for (ssize_t bytes_written_partial = 0; bytes_written_total < size;
@@ -697,22 +697,33 @@
HANDLE_EINTR(write(fd, data + bytes_written_total,
size - bytes_written_total));
if (bytes_written_partial < 0)
- return -1;
+ return false;
}
- return bytes_written_total;
+ return true;
}
-int AppendToFile(const FilePath& filename, const char* data, int size) {
+bool AppendToFile(const FilePath& filename, const char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
+ bool ret = true;
int fd = HANDLE_EINTR(open(filename.value().c_str(), O_WRONLY | O_APPEND));
- if (fd < 0)
- return -1;
+ if (fd < 0) {
+ VPLOG(1) << "Unable to create file " << filename.value();
+ return false;
+ }
- int bytes_written = WriteFileDescriptor(fd, data, size);
- if (IGNORE_EINTR(close(fd)) < 0)
- return -1;
- return bytes_written;
+ // This call will either write all of the data or return false.
+ if (!WriteFileDescriptor(fd, data, size)) {
+ VPLOG(1) << "Error while writing to file " << filename.value();
+ ret = false;
+ }
+
+ if (IGNORE_EINTR(close(fd)) < 0) {
+ VPLOG(1) << "Error while closing file " << filename.value();
+ return false;
+ }
+
+ return ret;
}
// Gets the current working directory for the process.
diff --git a/base/files/file_util_proxy_unittest.cc b/base/files/file_util_proxy_unittest.cc
index a18cd43..87ae66a 100644
--- a/base/files/file_util_proxy_unittest.cc
+++ b/base/files/file_util_proxy_unittest.cc
@@ -23,7 +23,7 @@
bytes_written_(-1),
weak_factory_(this) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(dir_.CreateUniqueTempDir());
ASSERT_TRUE(file_thread_.Start());
}
diff --git a/base/files/file_util_unittest.cc b/base/files/file_util_unittest.cc
index 47dec30..bd4839a 100644
--- a/base/files/file_util_unittest.cc
+++ b/base/files/file_util_unittest.cc
@@ -184,7 +184,7 @@
// to be a PlatformTest
class FileUtilTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
PlatformTest::SetUp();
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
}
@@ -1977,11 +1977,10 @@
FilePath foobar(data_dir.Append(FILE_PATH_LITERAL("foobar.txt")));
std::string data("hello");
- EXPECT_EQ(-1, AppendToFile(foobar, data.c_str(), data.length()));
+ EXPECT_FALSE(AppendToFile(foobar, data.c_str(), data.size()));
EXPECT_EQ(static_cast<int>(data.length()),
WriteFile(foobar, data.c_str(), data.length()));
- EXPECT_EQ(static_cast<int>(data.length()),
- AppendToFile(foobar, data.c_str(), data.length()));
+ EXPECT_TRUE(AppendToFile(foobar, data.c_str(), data.size()));
const std::wstring read_content = ReadTextFile(foobar);
EXPECT_EQ(L"hellohello", read_content);
@@ -2151,7 +2150,7 @@
// with a common SetUp() method.
class VerifyPathControlledByUserTest : public FileUtilTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
FileUtilTest::SetUp();
// Create a basic structure used by each test.
diff --git a/base/files/file_util_win.cc b/base/files/file_util_win.cc
index b586191..733c32c 100644
--- a/base/files/file_util_win.cc
+++ b/base/files/file_util_win.cc
@@ -644,7 +644,7 @@
return -1;
}
-int AppendToFile(const FilePath& filename, const char* data, int size) {
+bool AppendToFile(const FilePath& filename, const char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
base::win::ScopedHandle file(CreateFile(filename.value().c_str(),
FILE_APPEND_DATA,
@@ -654,26 +654,24 @@
0,
NULL));
if (!file.IsValid()) {
- DPLOG(WARNING) << "CreateFile failed for path "
- << UTF16ToUTF8(filename.value());
- return -1;
+ VPLOG(1) << "CreateFile failed for path " << UTF16ToUTF8(filename.value());
+ return false;
}
DWORD written;
BOOL result = ::WriteFile(file.Get(), data, size, &written, NULL);
if (result && static_cast<int>(written) == size)
- return written;
+ return true;
if (!result) {
// WriteFile failed.
- DPLOG(WARNING) << "writing file " << UTF16ToUTF8(filename.value())
- << " failed";
+ VPLOG(1) << "Writing file " << UTF16ToUTF8(filename.value()) << " failed";
} else {
// Didn't write all the bytes.
- DLOG(WARNING) << "wrote" << written << " bytes to "
- << UTF16ToUTF8(filename.value()) << " expected " << size;
+ VPLOG(1) << "Only wrote " << written << " out of " << size << " byte(s) to "
+ << UTF16ToUTF8(filename.value());
}
- return -1;
+ return false;
}
// Gets the current working directory for the process.
diff --git a/base/files/important_file_writer_unittest.cc b/base/files/important_file_writer_unittest.cc
index c55f0cc..71242ee 100644
--- a/base/files/important_file_writer_unittest.cc
+++ b/base/files/important_file_writer_unittest.cc
@@ -33,7 +33,7 @@
explicit DataSerializer(const std::string& data) : data_(data) {
}
- virtual bool SerializeData(std::string* output) OVERRIDE {
+ virtual bool SerializeData(std::string* output) override {
output->assign(data_);
return true;
}
diff --git a/base/files/memory_mapped_file_unittest.cc b/base/files/memory_mapped_file_unittest.cc
index 6627d40..36999bf 100644
--- a/base/files/memory_mapped_file_unittest.cc
+++ b/base/files/memory_mapped_file_unittest.cc
@@ -29,7 +29,7 @@
class MemoryMappedFileTest : public PlatformTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
PlatformTest::SetUp();
CreateTemporaryFile(&temp_file_path_);
}
diff --git a/base/json/json_file_value_serializer.h b/base/json/json_file_value_serializer.h
index 8006373..fc12b6b 100644
--- a/base/json/json_file_value_serializer.h
+++ b/base/json/json_file_value_serializer.h
@@ -32,7 +32,7 @@
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the file whose name was passed into the constructor.
- virtual bool Serialize(const base::Value& root) OVERRIDE;
+ virtual bool Serialize(const base::Value& root) override;
// Equivalent to Serialize(root) except binary values are omitted from the
// output.
@@ -46,7 +46,7 @@
// error message including the location of the error if appropriate.
// The caller takes ownership of the returned value.
virtual base::Value* Deserialize(int* error_code,
- std::string* error_message) OVERRIDE;
+ std::string* error_message) override;
// This enum is designed to safely overlap with JSONReader::JsonParseError.
enum JsonFileError {
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc
index 32e55e8..a74da5f 100644
--- a/base/json/json_parser.cc
+++ b/base/json/json_parser.cc
@@ -37,7 +37,7 @@
DictionaryValue::Swap(static_cast<DictionaryValue*>(root));
}
- virtual void Swap(DictionaryValue* other) OVERRIDE {
+ virtual void Swap(DictionaryValue* other) override {
DVLOG(1) << "Swap()ing a DictionaryValue inefficiently.";
// First deep copy to convert JSONStringValue to std::string and swap that
@@ -56,7 +56,7 @@
// the method below.
virtual bool RemoveWithoutPathExpansion(const std::string& key,
- scoped_ptr<Value>* out) OVERRIDE {
+ scoped_ptr<Value>* out) override {
// If the caller won't take ownership of the removed value, just call up.
if (!out)
return DictionaryValue::RemoveWithoutPathExpansion(key, out);
@@ -87,7 +87,7 @@
ListValue::Swap(static_cast<ListValue*>(root));
}
- virtual void Swap(ListValue* other) OVERRIDE {
+ virtual void Swap(ListValue* other) override {
DVLOG(1) << "Swap()ing a ListValue inefficiently.";
// First deep copy to convert JSONStringValue to std::string and swap that
@@ -102,7 +102,7 @@
ListValue::Swap(copy.get());
}
- virtual bool Remove(size_t index, scoped_ptr<Value>* out) OVERRIDE {
+ virtual bool Remove(size_t index, scoped_ptr<Value>* out) override {
// If the caller won't take ownership of the removed value, just call up.
if (!out)
return ListValue::Remove(index, out);
@@ -137,18 +137,18 @@
}
// Overridden from base::Value:
- virtual bool GetAsString(std::string* out_value) const OVERRIDE {
+ virtual bool GetAsString(std::string* out_value) const override {
string_piece_.CopyToString(out_value);
return true;
}
- virtual bool GetAsString(string16* out_value) const OVERRIDE {
+ virtual bool GetAsString(string16* out_value) const override {
*out_value = UTF8ToUTF16(string_piece_);
return true;
}
- virtual Value* DeepCopy() const OVERRIDE {
+ virtual Value* DeepCopy() const override {
return new StringValue(string_piece_.as_string());
}
- virtual bool Equals(const Value* other) const OVERRIDE {
+ virtual bool Equals(const Value* other) const override {
std::string other_string;
return other->IsType(TYPE_STRING) && other->GetAsString(&other_string) &&
StringPiece(other_string) == string_piece_;
diff --git a/base/json/json_string_value_serializer.h b/base/json/json_string_value_serializer.h
index 014ef9f..7fc5c6e 100644
--- a/base/json/json_string_value_serializer.h
+++ b/base/json/json_string_value_serializer.h
@@ -38,7 +38,7 @@
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the string passed into the constructor.
- virtual bool Serialize(const base::Value& root) OVERRIDE;
+ virtual bool Serialize(const base::Value& root) override;
// Equivalent to Serialize(root) except binary values are omitted from the
// output.
@@ -52,7 +52,7 @@
// error message including the location of the error if appropriate.
// The caller takes ownership of the returned value.
virtual base::Value* Deserialize(int* error_code,
- std::string* error_message) OVERRIDE;
+ std::string* error_message) override;
void set_pretty_print(bool new_value) { pretty_print_ = new_value; }
bool pretty_print() { return pretty_print_; }
diff --git a/base/json/json_value_converter.h b/base/json/json_value_converter.h
index cf3c74f..f049d9a 100644
--- a/base/json/json_value_converter.h
+++ b/base/json/json_value_converter.h
@@ -123,7 +123,7 @@
}
virtual bool ConvertField(
- const base::Value& value, StructType* dst) const OVERRIDE {
+ const base::Value& value, StructType* dst) const override {
return value_converter_->Convert(value, &(dst->*field_pointer_));
}
@@ -141,7 +141,7 @@
public:
BasicValueConverter() {}
- virtual bool Convert(const base::Value& value, int* field) const OVERRIDE {
+ virtual bool Convert(const base::Value& value, int* field) const override {
return value.GetAsInteger(field);
}
@@ -155,7 +155,7 @@
BasicValueConverter() {}
virtual bool Convert(
- const base::Value& value, std::string* field) const OVERRIDE {
+ const base::Value& value, std::string* field) const override {
return value.GetAsString(field);
}
@@ -169,7 +169,7 @@
BasicValueConverter() {}
virtual bool Convert(
- const base::Value& value, string16* field) const OVERRIDE {
+ const base::Value& value, string16* field) const override {
return value.GetAsString(field);
}
@@ -182,7 +182,7 @@
public:
BasicValueConverter() {}
- virtual bool Convert(const base::Value& value, double* field) const OVERRIDE {
+ virtual bool Convert(const base::Value& value, double* field) const override {
return value.GetAsDouble(field);
}
@@ -195,7 +195,7 @@
public:
BasicValueConverter() {}
- virtual bool Convert(const base::Value& value, bool* field) const OVERRIDE {
+ virtual bool Convert(const base::Value& value, bool* field) const override {
return value.GetAsBoolean(field);
}
@@ -212,7 +212,7 @@
: convert_func_(convert_func) {}
virtual bool Convert(const base::Value& value,
- FieldType* field) const OVERRIDE {
+ FieldType* field) const override {
return convert_func_(&value, field);
}
@@ -231,7 +231,7 @@
: convert_func_(convert_func) {}
virtual bool Convert(const base::Value& value,
- FieldType* field) const OVERRIDE {
+ FieldType* field) const override {
std::string string_value;
return value.GetAsString(&string_value) &&
convert_func_(string_value, field);
@@ -249,7 +249,7 @@
NestedValueConverter() {}
virtual bool Convert(
- const base::Value& value, NestedType* field) const OVERRIDE {
+ const base::Value& value, NestedType* field) const override {
return converter_.Convert(value, field);
}
@@ -264,7 +264,7 @@
RepeatedValueConverter() {}
virtual bool Convert(
- const base::Value& value, ScopedVector<Element>* field) const OVERRIDE {
+ const base::Value& value, ScopedVector<Element>* field) const override {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list)) {
// The field is not a list.
@@ -300,7 +300,7 @@
RepeatedMessageConverter() {}
virtual bool Convert(const base::Value& value,
- ScopedVector<NestedType>* field) const OVERRIDE {
+ ScopedVector<NestedType>* field) const override {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list))
return false;
@@ -337,7 +337,7 @@
: convert_func_(convert_func) {}
virtual bool Convert(const base::Value& value,
- ScopedVector<NestedType>* field) const OVERRIDE {
+ ScopedVector<NestedType>* field) const override {
const base::ListValue* list = NULL;
if (!value.GetAsList(&list))
return false;
diff --git a/base/json/json_value_serializer_unittest.cc b/base/json/json_value_serializer_unittest.cc
index 3be8bbf..dc43693 100644
--- a/base/json/json_value_serializer_unittest.cc
+++ b/base/json/json_value_serializer_unittest.cc
@@ -372,7 +372,7 @@
class JSONFileValueSerializerTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
}
diff --git a/base/lazy_instance_unittest.cc b/base/lazy_instance_unittest.cc
index e25366e..bf293c7 100644
--- a/base/lazy_instance_unittest.cc
+++ b/base/lazy_instance_unittest.cc
@@ -46,7 +46,7 @@
explicit SlowDelegate(base::LazyInstance<SlowConstructor>* lazy)
: lazy_(lazy) {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
EXPECT_EQ(12, lazy_->Get().some_int());
EXPECT_EQ(12, lazy_->Pointer()->some_int());
}
diff --git a/base/mac/libdispatch_task_runner.h b/base/mac/libdispatch_task_runner.h
index b1d90e2..afe1fb7 100644
--- a/base/mac/libdispatch_task_runner.h
+++ b/base/mac/libdispatch_task_runner.h
@@ -40,14 +40,14 @@
// base::TaskRunner:
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- base::TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ base::TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
// base::SequencedTaskRunner:
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const Closure& task,
- base::TimeDelta delay) OVERRIDE;
+ base::TimeDelta delay) override;
// This blocks the calling thread until all work on the dispatch queue has
// been run and the queue has been destroyed. Destroying a queue requires
diff --git a/base/mac/libdispatch_task_runner_unittest.cc b/base/mac/libdispatch_task_runner_unittest.cc
index a4f3202..cad0efa 100644
--- a/base/mac/libdispatch_task_runner_unittest.cc
+++ b/base/mac/libdispatch_task_runner_unittest.cc
@@ -12,7 +12,7 @@
class LibDispatchTaskRunnerTest : public testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
task_runner_ = new base::mac::LibDispatchTaskRunner(
"org.chromium.LibDispatchTaskRunnerTest");
}
diff --git a/base/memory/discardable_memory_ashmem.h b/base/memory/discardable_memory_ashmem.h
index 8436f5d..392f290 100644
--- a/base/memory/discardable_memory_ashmem.h
+++ b/base/memory/discardable_memory_ashmem.h
@@ -30,14 +30,14 @@
bool Initialize();
// Overridden from DiscardableMemory:
- virtual DiscardableMemoryLockStatus Lock() OVERRIDE;
- virtual void Unlock() OVERRIDE;
- virtual void* Memory() const OVERRIDE;
+ virtual DiscardableMemoryLockStatus Lock() override;
+ virtual void Unlock() override;
+ virtual void* Memory() const override;
// Overridden from internal::DiscardableMemoryManagerAllocation:
- virtual bool AllocateAndAcquireLock() OVERRIDE;
- virtual void ReleaseLock() OVERRIDE;
- virtual void Purge() OVERRIDE;
+ virtual bool AllocateAndAcquireLock() override;
+ virtual void ReleaseLock() override;
+ virtual void Purge() override;
private:
const size_t bytes_;
diff --git a/base/memory/discardable_memory_emulated.h b/base/memory/discardable_memory_emulated.h
index d928513..33889ad 100644
--- a/base/memory/discardable_memory_emulated.h
+++ b/base/memory/discardable_memory_emulated.h
@@ -31,14 +31,14 @@
bool Initialize();
// Overridden from DiscardableMemory:
- virtual DiscardableMemoryLockStatus Lock() OVERRIDE;
- virtual void Unlock() OVERRIDE;
- virtual void* Memory() const OVERRIDE;
+ virtual DiscardableMemoryLockStatus Lock() override;
+ virtual void Unlock() override;
+ virtual void* Memory() const override;
// Overridden from internal::DiscardableMemoryManagerAllocation:
- virtual bool AllocateAndAcquireLock() OVERRIDE;
- virtual void ReleaseLock() OVERRIDE {}
- virtual void Purge() OVERRIDE;
+ virtual bool AllocateAndAcquireLock() override;
+ virtual void ReleaseLock() override {}
+ virtual void Purge() override;
private:
const size_t bytes_;
diff --git a/base/memory/discardable_memory_mac.cc b/base/memory/discardable_memory_mac.cc
index fa6a231..231eb17 100644
--- a/base/memory/discardable_memory_mac.cc
+++ b/base/memory/discardable_memory_mac.cc
@@ -56,7 +56,7 @@
}
// Overridden from DiscardableMemory:
- virtual DiscardableMemoryLockStatus Lock() OVERRIDE {
+ virtual DiscardableMemoryLockStatus Lock() override {
DCHECK(!is_locked_);
bool purged = false;
@@ -68,19 +68,19 @@
: DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS;
}
- virtual void Unlock() OVERRIDE {
+ virtual void Unlock() override {
DCHECK(is_locked_);
g_shared_state.Pointer()->manager.ReleaseLock(this);
is_locked_ = false;
}
- virtual void* Memory() const OVERRIDE {
+ virtual void* Memory() const override {
DCHECK(is_locked_);
return reinterpret_cast<void*>(memory_.address());
}
// Overridden from internal::DiscardableMemoryManagerAllocation:
- virtual bool AllocateAndAcquireLock() OVERRIDE {
+ virtual bool AllocateAndAcquireLock() override {
kern_return_t ret;
bool persistent;
if (!memory_.size()) {
@@ -123,7 +123,7 @@
return persistent;
}
- virtual void ReleaseLock() OVERRIDE {
+ virtual void ReleaseLock() override {
int state = VM_PURGABLE_VOLATILE | VM_VOLATILE_GROUP_DEFAULT;
kern_return_t ret = vm_purgable_control(mach_task_self(),
memory_.address(),
@@ -141,7 +141,7 @@
#endif
}
- virtual void Purge() OVERRIDE {
+ virtual void Purge() override {
memory_.reset();
}
diff --git a/base/memory/discardable_memory_malloc.h b/base/memory/discardable_memory_malloc.h
index 7729ce5..e22d515 100644
--- a/base/memory/discardable_memory_malloc.h
+++ b/base/memory/discardable_memory_malloc.h
@@ -18,9 +18,9 @@
bool Initialize();
// Overridden from DiscardableMemory:
- virtual DiscardableMemoryLockStatus Lock() OVERRIDE;
- virtual void Unlock() OVERRIDE;
- virtual void* Memory() const OVERRIDE;
+ virtual DiscardableMemoryLockStatus Lock() override;
+ virtual void Unlock() override;
+ virtual void* Memory() const override;
private:
scoped_ptr<uint8, FreeDeleter> memory_;
diff --git a/base/memory/discardable_memory_manager_unittest.cc b/base/memory/discardable_memory_manager_unittest.cc
index 674499f..18ceec3 100644
--- a/base/memory/discardable_memory_manager_unittest.cc
+++ b/base/memory/discardable_memory_manager_unittest.cc
@@ -18,18 +18,18 @@
virtual ~TestAllocationImpl() { DCHECK(!is_locked_); }
// Overridden from internal::DiscardableMemoryManagerAllocation:
- virtual bool AllocateAndAcquireLock() OVERRIDE {
+ virtual bool AllocateAndAcquireLock() override {
bool was_allocated = is_allocated_;
is_allocated_ = true;
DCHECK(!is_locked_);
is_locked_ = true;
return was_allocated;
}
- virtual void ReleaseLock() OVERRIDE {
+ virtual void ReleaseLock() override {
DCHECK(is_locked_);
is_locked_ = false;
}
- virtual void Purge() OVERRIDE {
+ virtual void Purge() override {
DCHECK(is_allocated_);
is_allocated_ = false;
}
@@ -58,7 +58,7 @@
private:
// Overriden from internal::DiscardableMemoryManager:
- virtual TimeTicks Now() const OVERRIDE { return now_; }
+ virtual TimeTicks Now() const override { return now_; }
TimeTicks now_;
};
@@ -456,9 +456,9 @@
: memory_usage_thread_("memory_usage_thread"),
thread_sync_(true, false) {}
- virtual void SetUp() OVERRIDE { memory_usage_thread_.Start(); }
+ virtual void SetUp() override { memory_usage_thread_.Start(); }
- virtual void TearDown() OVERRIDE { memory_usage_thread_.Stop(); }
+ virtual void TearDown() override { memory_usage_thread_.Stop(); }
void UseMemoryHelper() {
size_t size = 1024;
diff --git a/base/memory/linked_ptr_unittest.cc b/base/memory/linked_ptr_unittest.cc
index 8b938f2..2dbc4bd 100644
--- a/base/memory/linked_ptr_unittest.cc
+++ b/base/memory/linked_ptr_unittest.cc
@@ -26,7 +26,7 @@
struct B: public A {
B() { history += base::StringPrintf("B%d ctor\n", mynum); }
virtual ~B() { history += base::StringPrintf("B%d dtor\n", mynum); }
- virtual void Use() OVERRIDE {
+ virtual void Use() override {
history += base::StringPrintf("B%d use\n", mynum);
}
};
diff --git a/base/memory/ref_counted_memory.h b/base/memory/ref_counted_memory.h
index a238c3a..f7acc65 100644
--- a/base/memory/ref_counted_memory.h
+++ b/base/memory/ref_counted_memory.h
@@ -52,8 +52,8 @@
length_(length) {}
// Overridden from RefCountedMemory:
- virtual const unsigned char* front() const OVERRIDE;
- virtual size_t size() const OVERRIDE;
+ virtual const unsigned char* front() const override;
+ virtual size_t size() const override;
private:
virtual ~RefCountedStaticMemory();
@@ -81,8 +81,8 @@
static RefCountedBytes* TakeVector(std::vector<unsigned char>* to_destroy);
// Overridden from RefCountedMemory:
- virtual const unsigned char* front() const OVERRIDE;
- virtual size_t size() const OVERRIDE;
+ virtual const unsigned char* front() const override;
+ virtual size_t size() const override;
const std::vector<unsigned char>& data() const { return data_; }
std::vector<unsigned char>& data() { return data_; }
@@ -107,8 +107,8 @@
static RefCountedString* TakeString(std::string* to_destroy);
// Overridden from RefCountedMemory:
- virtual const unsigned char* front() const OVERRIDE;
- virtual size_t size() const OVERRIDE;
+ virtual const unsigned char* front() const override;
+ virtual size_t size() const override;
const std::string& data() const { return data_; }
std::string& data() { return data_; }
@@ -129,8 +129,8 @@
RefCountedMallocedMemory(void* data, size_t length);
// Overridden from RefCountedMemory:
- virtual const unsigned char* front() const OVERRIDE;
- virtual size_t size() const OVERRIDE;
+ virtual const unsigned char* front() const override;
+ virtual size_t size() const override;
private:
virtual ~RefCountedMallocedMemory();
diff --git a/base/memory/scoped_ptr.h b/base/memory/scoped_ptr.h
index 81b4a62..d93a8b4 100644
--- a/base/memory/scoped_ptr.h
+++ b/base/memory/scoped_ptr.h
@@ -308,7 +308,7 @@
// types.
template <class T, class D = base::DefaultDeleter<T> >
class scoped_ptr {
- MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue)
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(scoped_ptr)
COMPILE_ASSERT(base::internal::IsNotRefCounted<T>::value,
T_is_refcounted_type_and_needs_scoped_refptr);
@@ -346,9 +346,6 @@
COMPILE_ASSERT(!base::is_array<U>::value, U_cannot_be_an_array);
}
- // Constructor. Move constructor for C++03 move emulation of this type.
- scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {}
-
// operator=. Allows assignment from a scoped_ptr rvalue for a convertible
// type and deleter.
//
@@ -457,7 +454,7 @@
template <class T, class D>
class scoped_ptr<T[], D> {
- MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue)
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(scoped_ptr)
public:
// The element and deleter types.
@@ -488,21 +485,12 @@
// Constructor. Allows construction from a scoped_ptr rvalue.
scoped_ptr(scoped_ptr&& other) : impl_(&other.impl_) {}
- // Constructor. Move constructor for C++03 move emulation of this type.
- scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) {}
-
// operator=. Allows assignment from a scoped_ptr rvalue.
scoped_ptr& operator=(scoped_ptr&& rhs) {
impl_.TakeState(&rhs.impl_);
return *this;
}
- // operator=. Move operator= for C++03 move emulation of this type.
- scoped_ptr& operator=(RValue rhs) {
- impl_.TakeState(&rhs.object->impl_);
- return *this;
- }
-
// operator=. Allows assignment from a nullptr. Deletes the currently owned
// array, if any.
scoped_ptr& operator=(decltype(nullptr)) {
diff --git a/base/memory/scoped_ptr_unittest.cc b/base/memory/scoped_ptr_unittest.cc
index 7a1e41e..2ea44e9 100644
--- a/base/memory/scoped_ptr_unittest.cc
+++ b/base/memory/scoped_ptr_unittest.cc
@@ -27,9 +27,9 @@
explicit ConDecLogger(int* ptr) { SetPtr(ptr); }
virtual ~ConDecLogger() { --*ptr_; }
- virtual void SetPtr(int* ptr) OVERRIDE { ptr_ = ptr; ++*ptr_; }
+ virtual void SetPtr(int* ptr) override { ptr_ = ptr; ++*ptr_; }
- virtual int SomeMeth(int x) const OVERRIDE { return x; }
+ virtual int SomeMeth(int x) const override { return x; }
private:
int* ptr_;
@@ -398,17 +398,17 @@
EXPECT_TRUE(scoper3.get());
}
- // Test uncaught Pass() does not leak.
+ // Test uncaught Pass() does not have side effects.
{
ConDecLogger* logger = new ConDecLogger(&constructed);
scoped_ptr<ConDecLogger> scoper(logger);
EXPECT_EQ(1, constructed);
// Should auto-destruct logger by end of scope.
- scoper.Pass();
- // This differs from unique_ptr, as Pass() has side effects but std::move()
- // does not.
- EXPECT_FALSE(scoper.get());
+ scoped_ptr<ConDecLogger>&& rvalue = scoper.Pass();
+ // The Pass() function mimics std::move(), which does not have side-effects.
+ EXPECT_TRUE(scoper.get());
+ EXPECT_TRUE(rvalue);
}
EXPECT_EQ(0, constructed);
diff --git a/base/memory/scoped_vector_unittest.cc b/base/memory/scoped_vector_unittest.cc
index efcc047..ae870d5 100644
--- a/base/memory/scoped_vector_unittest.cc
+++ b/base/memory/scoped_vector_unittest.cc
@@ -66,7 +66,7 @@
// Assert INITIAL -> CONSTRUCTED and no LifeCycleObject associated with this
// LifeCycleWatcher.
- virtual void OnLifeCycleConstruct(LifeCycleObject* object) OVERRIDE {
+ virtual void OnLifeCycleConstruct(LifeCycleObject* object) override {
ASSERT_EQ(LC_INITIAL, life_cycle_state_);
ASSERT_EQ(NULL, constructed_life_cycle_object_.get());
life_cycle_state_ = LC_CONSTRUCTED;
@@ -75,7 +75,7 @@
// Assert CONSTRUCTED -> DESTROYED and the |object| being destroyed is the
// same one we saw constructed.
- virtual void OnLifeCycleDestroy(LifeCycleObject* object) OVERRIDE {
+ virtual void OnLifeCycleDestroy(LifeCycleObject* object) override {
ASSERT_EQ(LC_CONSTRUCTED, life_cycle_state_);
LifeCycleObject* constructed_life_cycle_object =
constructed_life_cycle_object_.release();
diff --git a/base/memory/shared_memory_unittest.cc b/base/memory/shared_memory_unittest.cc
index 34c1106..775e1c8 100644
--- a/base/memory/shared_memory_unittest.cc
+++ b/base/memory/shared_memory_unittest.cc
@@ -55,7 +55,7 @@
}
// PlatformThread::Delegate interface.
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
#if defined(OS_MACOSX)
mac::ScopedNSAutoreleasePool pool;
#endif
@@ -104,7 +104,7 @@
virtual ~MultipleLockThread() {}
// PlatformThread::Delegate interface.
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
const uint32 kDataSize = sizeof(int);
SharedMemoryHandle handle = NULL;
{
diff --git a/base/memory/singleton_unittest.cc b/base/memory/singleton_unittest.cc
index 5d05904..41bd75c 100644
--- a/base/memory/singleton_unittest.cc
+++ b/base/memory/singleton_unittest.cc
@@ -154,7 +154,7 @@
public:
SingletonTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
non_leak_called_ = false;
leaky_called_ = false;
static_called_ = false;
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index c9a9185..bc98251 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -442,9 +442,9 @@
void HistogramEvent(int event);
// MessagePump::Delegate methods:
- virtual bool DoWork() OVERRIDE;
- virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE;
- virtual bool DoIdleWork() OVERRIDE;
+ virtual bool DoWork() override;
+ virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) override;
+ virtual bool DoIdleWork() override;
const Type type_;
diff --git a/base/message_loop/message_loop_proxy_impl.h b/base/message_loop/message_loop_proxy_impl.h
index b7f62b9..ca9543e 100644
--- a/base/message_loop/message_loop_proxy_impl.h
+++ b/base/message_loop/message_loop_proxy_impl.h
@@ -27,12 +27,12 @@
// MessageLoopProxy implementation
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
+ base::TimeDelta delay) override;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ base::TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
private:
friend class RefCountedThreadSafe<MessageLoopProxyImpl>;
diff --git a/base/message_loop/message_loop_proxy_impl_unittest.cc b/base/message_loop/message_loop_proxy_impl_unittest.cc
index 81c9b0c..5f31140 100644
--- a/base/message_loop/message_loop_proxy_impl_unittest.cc
+++ b/base/message_loop/message_loop_proxy_impl_unittest.cc
@@ -38,14 +38,14 @@
}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
io_thread_.reset(new Thread("MessageLoopProxyImplTest_IO"));
file_thread_.reset(new Thread("MessageLoopProxyImplTest_File"));
io_thread_->Start();
file_thread_->Start();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
io_thread_->Stop();
file_thread_->Stop();
}
diff --git a/base/message_loop/message_loop_proxy_unittest.cc b/base/message_loop/message_loop_proxy_unittest.cc
index ada9080..673ed88 100644
--- a/base/message_loop/message_loop_proxy_unittest.cc
+++ b/base/message_loop/message_loop_proxy_unittest.cc
@@ -31,7 +31,7 @@
}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Use SetUp() instead of the constructor to avoid posting a task to a
// partialy constructed object.
task_thread_.Start();
@@ -42,7 +42,7 @@
Bind(&MessageLoopProxyTest::BlockTaskThreadHelper, Unretained(this)));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Make sure the |task_thread_| is not blocked, and stop the thread
// fully before destuction because its tasks may still depend on the
// |thread_sync_| event.
diff --git a/base/message_loop/message_loop_unittest.cc b/base/message_loop/message_loop_unittest.cc
index b07ba0e..1a42cc6 100644
--- a/base/message_loop/message_loop_unittest.cc
+++ b/base/message_loop/message_loop_unittest.cc
@@ -425,7 +425,7 @@
public:
DispatcherImpl() : dispatch_count_(0) {}
- virtual uint32_t Dispatch(const NativeEvent& msg) OVERRIDE {
+ virtual uint32_t Dispatch(const NativeEvent& msg) override {
::TranslateMessage(&msg);
::DispatchMessage(&msg);
// Do not count WM_TIMER since it is not what we post and it will cause
@@ -666,14 +666,14 @@
virtual ~DummyTaskObserver() {}
- virtual void WillProcessTask(const PendingTask& pending_task) OVERRIDE {
+ virtual void WillProcessTask(const PendingTask& pending_task) override {
num_tasks_started_++;
EXPECT_TRUE(pending_task.time_posted != TimeTicks());
EXPECT_LE(num_tasks_started_, num_tasks_);
EXPECT_EQ(num_tasks_started_, num_tasks_processed_ + 1);
}
- virtual void DidProcessTask(const PendingTask& pending_task) OVERRIDE {
+ virtual void DidProcessTask(const PendingTask& pending_task) override {
num_tasks_processed_++;
EXPECT_TRUE(pending_task.time_posted != TimeTicks());
EXPECT_LE(num_tasks_started_, num_tasks_);
@@ -756,10 +756,10 @@
class QuitDelegate : public MessageLoopForIO::Watcher {
public:
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {
MessageLoop::current()->QuitWhenIdle();
}
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int fd) override {
MessageLoop::current()->QuitWhenIdle();
}
};
@@ -857,7 +857,7 @@
destruction_observer_called_(destruction_observer_called),
task_destroyed_before_message_loop_(false) {
}
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE {
+ virtual void WillDestroyCurrentMessageLoop() override {
task_destroyed_before_message_loop_ = *task_destroyed_;
*destruction_observer_called_ = true;
}
diff --git a/base/message_loop/message_pump_android.h b/base/message_loop/message_pump_android.h
index 8a07a0f..9b4540f 100644
--- a/base/message_loop/message_pump_android.h
+++ b/base/message_loop/message_pump_android.h
@@ -24,10 +24,10 @@
MessagePumpForUI();
virtual ~MessagePumpForUI();
- virtual void Run(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
- virtual void ScheduleWork() OVERRIDE;
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
+ virtual void Run(Delegate* delegate) override;
+ virtual void Quit() override;
+ virtual void ScheduleWork() override;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
virtual void Start(Delegate* delegate);
diff --git a/base/message_loop/message_pump_default.h b/base/message_loop/message_pump_default.h
index 19e7200..e9f7302 100644
--- a/base/message_loop/message_pump_default.h
+++ b/base/message_loop/message_pump_default.h
@@ -18,10 +18,10 @@
virtual ~MessagePumpDefault();
// MessagePump methods:
- virtual void Run(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
- virtual void ScheduleWork() OVERRIDE;
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
+ virtual void Run(Delegate* delegate) override;
+ virtual void Quit() override;
+ virtual void ScheduleWork() override;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
private:
// This flag is set to false when Run should return.
diff --git a/base/message_loop/message_pump_glib.h b/base/message_loop/message_pump_glib.h
index a13493a..0f797c5 100644
--- a/base/message_loop/message_pump_glib.h
+++ b/base/message_loop/message_pump_glib.h
@@ -35,10 +35,10 @@
void HandleDispatch();
// Overridden from MessagePump:
- virtual void Run(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
- virtual void ScheduleWork() OVERRIDE;
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
+ virtual void Run(Delegate* delegate) override;
+ virtual void Quit() override;
+ virtual void ScheduleWork() override;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
private:
bool ShouldQuit() const;
diff --git a/base/message_loop/message_pump_glib_unittest.cc b/base/message_loop/message_pump_glib_unittest.cc
index aaf6b4d..ae4fefe 100644
--- a/base/message_loop/message_pump_glib_unittest.cc
+++ b/base/message_loop/message_pump_glib_unittest.cc
@@ -161,11 +161,11 @@
MessagePumpGLibTest() : loop_(NULL), injector_(NULL) { }
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
loop_ = new MessageLoop(MessageLoop::TYPE_UI);
injector_ = new EventInjector();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
delete injector_;
injector_ = NULL;
delete loop_;
diff --git a/base/message_loop/message_pump_io_ios_unittest.cc b/base/message_loop/message_pump_io_ios_unittest.cc
index e6dcc33..0bf8c08 100644
--- a/base/message_loop/message_pump_io_ios_unittest.cc
+++ b/base/message_loop/message_pump_io_ios_unittest.cc
@@ -20,7 +20,7 @@
io_thread_("MessagePumpIOSForIOTestIOThread") {}
virtual ~MessagePumpIOSForIOTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
Thread::Options options(MessageLoop::TYPE_IO, 0);
ASSERT_TRUE(io_thread_.StartWithOptions(options));
ASSERT_EQ(MessageLoop::TYPE_IO, io_thread_.message_loop()->type());
@@ -30,7 +30,7 @@
ASSERT_EQ(0, ret);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (IGNORE_EINTR(close(pipefds_[0])) < 0)
PLOG(ERROR) << "close";
if (IGNORE_EINTR(close(pipefds_[1])) < 0)
@@ -67,8 +67,8 @@
virtual ~StupidWatcher() {}
// base:MessagePumpIOSForIO::Watcher interface
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE {}
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {}
+ virtual void OnFileCanReadWithoutBlocking(int fd) override {}
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {}
};
#if GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
@@ -96,11 +96,11 @@
virtual ~BaseWatcher() {}
// MessagePumpIOSForIO::Watcher interface
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int /* fd */) override {
NOTREACHED();
}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {
NOTREACHED();
}
@@ -118,7 +118,7 @@
DCHECK(!controller_);
}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {
DCHECK(controller_);
delete controller_;
controller_ = NULL;
@@ -148,7 +148,7 @@
virtual ~StopWatcher() {}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {
controller_->StopWatchingFileDescriptor();
if (fd_to_start_watching_ >= 0) {
pump_->WatchFileDescriptor(fd_to_start_watching_,
diff --git a/base/message_loop/message_pump_libevent.h b/base/message_loop/message_pump_libevent.h
index f3a48a9..2f1812f 100644
--- a/base/message_loop/message_pump_libevent.h
+++ b/base/message_loop/message_pump_libevent.h
@@ -122,10 +122,10 @@
void RemoveIOObserver(IOObserver* obs);
// MessagePump methods:
- virtual void Run(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
- virtual void ScheduleWork() OVERRIDE;
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
+ virtual void Run(Delegate* delegate) override;
+ virtual void Quit() override;
+ virtual void ScheduleWork() override;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
private:
friend class MessagePumpLibeventTest;
diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc
index 9298d68..e598d76 100644
--- a/base/message_loop/message_pump_libevent_unittest.cc
+++ b/base/message_loop/message_pump_libevent_unittest.cc
@@ -23,7 +23,7 @@
io_thread_("MessagePumpLibeventTestIOThread") {}
virtual ~MessagePumpLibeventTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
Thread::Options options(MessageLoop::TYPE_IO, 0);
ASSERT_TRUE(io_thread_.StartWithOptions(options));
ASSERT_EQ(MessageLoop::TYPE_IO, io_thread_.message_loop()->type());
@@ -31,7 +31,7 @@
ASSERT_EQ(0, ret);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (IGNORE_EINTR(close(pipefds_[0])) < 0)
PLOG(ERROR) << "close";
if (IGNORE_EINTR(close(pipefds_[1])) < 0)
@@ -65,8 +65,8 @@
virtual ~StupidWatcher() {}
// base:MessagePumpLibevent::Watcher interface
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE {}
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {}
+ virtual void OnFileCanReadWithoutBlocking(int fd) override {}
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {}
};
#if GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
@@ -100,11 +100,11 @@
virtual ~BaseWatcher() {}
// base:MessagePumpLibevent::Watcher interface
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int /* fd */) override {
NOTREACHED();
}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {
NOTREACHED();
}
@@ -122,7 +122,7 @@
DCHECK(!controller_);
}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {
DCHECK(controller_);
delete controller_;
controller_ = NULL;
@@ -149,7 +149,7 @@
virtual ~StopWatcher() {}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {
controller_->StopWatchingFileDescriptor();
}
};
@@ -179,14 +179,14 @@
NestedPumpWatcher() {}
virtual ~NestedPumpWatcher() {}
- virtual void OnFileCanReadWithoutBlocking(int /* fd */) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int /* fd */) override {
RunLoop runloop;
MessageLoop::current()->PostTask(FROM_HERE, Bind(&QuitMessageLoopAndStart,
runloop.QuitClosure()));
runloop.Run();
}
- virtual void OnFileCanWriteWithoutBlocking(int /* fd */) OVERRIDE {}
+ virtual void OnFileCanWriteWithoutBlocking(int /* fd */) override {}
};
TEST_F(MessagePumpLibeventTest, NestedPumpWatcher) {
diff --git a/base/message_loop/message_pump_mac.h b/base/message_loop/message_pump_mac.h
index f52bd76..d16db8c 100644
--- a/base/message_loop/message_pump_mac.h
+++ b/base/message_loop/message_pump_mac.h
@@ -88,12 +88,12 @@
// in the DoRun method. MessagePumpCFRunLoopBase::Run calls DoRun directly.
// This arrangement is used because MessagePumpCFRunLoopBase needs to set
// up and tear down things before and after the "meat" of DoRun.
- virtual void Run(Delegate* delegate) OVERRIDE;
+ virtual void Run(Delegate* delegate) override;
virtual void DoRun(Delegate* delegate) = 0;
- virtual void ScheduleWork() OVERRIDE;
- virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) OVERRIDE;
- virtual void SetTimerSlack(TimerSlack timer_slack) OVERRIDE;
+ virtual void ScheduleWork() override;
+ virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override;
+ virtual void SetTimerSlack(TimerSlack timer_slack) override;
protected:
// Accessors for private data members to be used by subclasses.
@@ -222,11 +222,11 @@
MessagePumpCFRunLoop();
virtual ~MessagePumpCFRunLoop();
- virtual void DoRun(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
+ virtual void DoRun(Delegate* delegate) override;
+ virtual void Quit() override;
private:
- virtual void EnterExitRunLoop(CFRunLoopActivity activity) OVERRIDE;
+ virtual void EnterExitRunLoop(CFRunLoopActivity activity) override;
// True if Quit is called to stop the innermost MessagePump
// (innermost_quittable_) but some other CFRunLoopRun loop (nesting_level_)
@@ -241,8 +241,8 @@
MessagePumpNSRunLoop();
virtual ~MessagePumpNSRunLoop();
- virtual void DoRun(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
+ virtual void DoRun(Delegate* delegate) override;
+ virtual void Quit() override;
private:
// A source that doesn't do anything but provide something signalable
@@ -264,8 +264,8 @@
public:
MessagePumpUIApplication();
virtual ~MessagePumpUIApplication();
- virtual void DoRun(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
+ virtual void DoRun(Delegate* delegate) override;
+ virtual void Quit() override;
// This message pump can not spin the main message loop directly. Instead,
// call |Attach()| to set up a delegate. It is an error to call |Run()|.
@@ -284,8 +284,8 @@
MessagePumpNSApplication();
virtual ~MessagePumpNSApplication();
- virtual void DoRun(Delegate* delegate) OVERRIDE;
- virtual void Quit() OVERRIDE;
+ virtual void DoRun(Delegate* delegate) override;
+ virtual void Quit() override;
private:
// False after Quit is called.
@@ -308,7 +308,7 @@
protected:
// Returns nil if NSApp is currently in the middle of calling
// -sendEvent. Requires NSApp implementing CrAppProtocol.
- virtual AutoreleasePoolType* CreateAutoreleasePool() OVERRIDE;
+ virtual AutoreleasePoolType* CreateAutoreleasePool() override;
private:
DISALLOW_COPY_AND_ASSIGN(MessagePumpCrApplication);
diff --git a/base/message_loop/message_pump_perftest.cc b/base/message_loop/message_pump_perftest.cc
index 7c7b400..40550e1 100644
--- a/base/message_loop/message_pump_perftest.cc
+++ b/base/message_loop/message_pump_perftest.cc
@@ -232,12 +232,12 @@
FakeMessagePump() {}
virtual ~FakeMessagePump() {}
- virtual void Run(Delegate* delegate) OVERRIDE {}
+ virtual void Run(Delegate* delegate) override {}
- virtual void Quit() OVERRIDE {}
- virtual void ScheduleWork() OVERRIDE {}
+ virtual void Quit() override {}
+ virtual void ScheduleWork() override {}
virtual void ScheduleDelayedWork(
- const TimeTicks& delayed_work_time) OVERRIDE {}
+ const TimeTicks& delayed_work_time) override {}
};
class PostTaskTest : public testing::Test {
diff --git a/base/metrics/field_trial_unittest.cc b/base/metrics/field_trial_unittest.cc
index 52ce855..b3a6eb3 100644
--- a/base/metrics/field_trial_unittest.cc
+++ b/base/metrics/field_trial_unittest.cc
@@ -49,7 +49,7 @@
}
virtual void OnFieldTrialGroupFinalized(const std::string& trial,
- const std::string& group) OVERRIDE {
+ const std::string& group) override {
trial_name_ = trial;
group_name_ = group;
}
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 816458d..47cfc79 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -359,7 +359,7 @@
// produce a false-alarm if a race occurred in the reading of the data during
// a SnapShot process, but should otherwise be false at all times (unless we
// have memory over-writes, or DRAM failures).
- virtual int FindCorruption(const HistogramSamples& samples) const OVERRIDE;
+ virtual int FindCorruption(const HistogramSamples& samples) const override;
//----------------------------------------------------------------------------
// Accessors for factory construction, serialization and testing.
@@ -382,17 +382,17 @@
size_t* bucket_count);
// HistogramBase implementation:
- virtual HistogramType GetHistogramType() const OVERRIDE;
+ virtual HistogramType GetHistogramType() const override;
virtual bool HasConstructionArguments(
Sample expected_minimum,
Sample expected_maximum,
- size_t expected_bucket_count) const OVERRIDE;
- virtual void Add(Sample value) OVERRIDE;
- virtual scoped_ptr<HistogramSamples> SnapshotSamples() const OVERRIDE;
- virtual void AddSamples(const HistogramSamples& samples) OVERRIDE;
- virtual bool AddSamplesFromPickle(PickleIterator* iter) OVERRIDE;
- virtual void WriteHTMLGraph(std::string* output) const OVERRIDE;
- virtual void WriteAscii(std::string* output) const OVERRIDE;
+ size_t expected_bucket_count) const override;
+ virtual void Add(Sample value) override;
+ virtual scoped_ptr<HistogramSamples> SnapshotSamples() const override;
+ virtual void AddSamples(const HistogramSamples& samples) override;
+ virtual bool AddSamplesFromPickle(PickleIterator* iter) override;
+ virtual void WriteHTMLGraph(std::string* output) const override;
+ virtual void WriteAscii(std::string* output) const override;
protected:
// |ranges| should contain the underflow and overflow buckets. See top
@@ -405,7 +405,7 @@
virtual ~Histogram();
// HistogramBase implementation:
- virtual bool SerializeInfoImpl(Pickle* pickle) const OVERRIDE;
+ virtual bool SerializeInfoImpl(Pickle* pickle) const override;
// Method to override to skip the display of the i'th bucket if it's empty.
virtual bool PrintEmptyBucket(size_t index) const;
@@ -458,11 +458,11 @@
std::string* output) const;
// WriteJSON calls these.
- virtual void GetParameters(DictionaryValue* params) const OVERRIDE;
+ virtual void GetParameters(DictionaryValue* params) const override;
virtual void GetCountAndBucketData(Count* count,
int64* sum,
- ListValue* buckets) const OVERRIDE;
+ ListValue* buckets) const override;
// Does not own this object. Should get from StatisticsRecorder.
const BucketRanges* bucket_ranges_;
@@ -521,7 +521,7 @@
BucketRanges* ranges);
// Overridden from Histogram:
- virtual HistogramType GetHistogramType() const OVERRIDE;
+ virtual HistogramType GetHistogramType() const override;
protected:
LinearHistogram(const std::string& name,
@@ -529,15 +529,15 @@
Sample maximum,
const BucketRanges* ranges);
- virtual double GetBucketSize(Count current, size_t i) const OVERRIDE;
+ virtual double GetBucketSize(Count current, size_t i) const override;
// If we have a description for a bucket, then return that. Otherwise
// let parent class provide a (numeric) description.
- virtual const std::string GetAsciiBucketRange(size_t i) const OVERRIDE;
+ virtual const std::string GetAsciiBucketRange(size_t i) const override;
// Skip printing of name for numeric range if we have a name (and if this is
// an empty bucket).
- virtual bool PrintEmptyBucket(size_t index) const OVERRIDE;
+ virtual bool PrintEmptyBucket(size_t index) const override;
private:
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
@@ -560,7 +560,7 @@
public:
static HistogramBase* FactoryGet(const std::string& name, int32 flags);
- virtual HistogramType GetHistogramType() const OVERRIDE;
+ virtual HistogramType GetHistogramType() const override;
private:
BooleanHistogram(const std::string& name, const BucketRanges* ranges);
@@ -586,7 +586,7 @@
int32 flags);
// Overridden from Histogram:
- virtual HistogramType GetHistogramType() const OVERRIDE;
+ virtual HistogramType GetHistogramType() const override;
// Helper method for transforming an array of valid enumeration values
// to the std::vector<int> expected by UMA_HISTOGRAM_CUSTOM_ENUMERATION.
@@ -601,9 +601,9 @@
const BucketRanges* ranges);
// HistogramBase implementation:
- virtual bool SerializeInfoImpl(Pickle* pickle) const OVERRIDE;
+ virtual bool SerializeInfoImpl(Pickle* pickle) const override;
- virtual double GetBucketSize(Count current, size_t i) const OVERRIDE;
+ virtual double GetBucketSize(Count current, size_t i) const override;
private:
friend BASE_EXPORT_PRIVATE HistogramBase* DeserializeHistogramInfo(
diff --git a/base/metrics/histogram_delta_serialization.h b/base/metrics/histogram_delta_serialization.h
index ccadb12..037d0b5 100644
--- a/base/metrics/histogram_delta_serialization.h
+++ b/base/metrics/histogram_delta_serialization.h
@@ -39,12 +39,12 @@
private:
// HistogramFlattener implementation.
virtual void RecordDelta(const HistogramBase& histogram,
- const HistogramSamples& snapshot) OVERRIDE;
+ const HistogramSamples& snapshot) override;
virtual void InconsistencyDetected(
- HistogramBase::Inconsistency problem) OVERRIDE;
+ HistogramBase::Inconsistency problem) override;
virtual void UniqueInconsistencyDetected(
- HistogramBase::Inconsistency problem) OVERRIDE;
- virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE;
+ HistogramBase::Inconsistency problem) override;
+ virtual void InconsistencyDetectedInLoggedCount(int amount) override;
// Calculates deltas in histogram counters.
HistogramSnapshotManager histogram_snapshot_manager_;
diff --git a/base/metrics/histogram_samples.cc b/base/metrics/histogram_samples.cc
index 2319ed1..26c2aeb 100644
--- a/base/metrics/histogram_samples.cc
+++ b/base/metrics/histogram_samples.cc
@@ -15,11 +15,11 @@
public:
explicit SampleCountPickleIterator(PickleIterator* iter);
- virtual bool Done() const OVERRIDE;
- virtual void Next() OVERRIDE;
+ virtual bool Done() const override;
+ virtual void Next() override;
virtual void Get(HistogramBase::Sample* min,
HistogramBase::Sample* max,
- HistogramBase::Count* count) const OVERRIDE;
+ HistogramBase::Count* count) const override;
private:
PickleIterator* const iter_;
diff --git a/base/metrics/histogram_snapshot_manager_unittest.cc b/base/metrics/histogram_snapshot_manager_unittest.cc
index e6672ea..2da22be 100644
--- a/base/metrics/histogram_snapshot_manager_unittest.cc
+++ b/base/metrics/histogram_snapshot_manager_unittest.cc
@@ -19,21 +19,21 @@
HistogramFlattenerDeltaRecorder() {}
virtual void RecordDelta(const HistogramBase& histogram,
- const HistogramSamples& snapshot) OVERRIDE {
+ const HistogramSamples& snapshot) override {
recorded_delta_histogram_names_.push_back(histogram.histogram_name());
}
virtual void InconsistencyDetected(
- HistogramBase::Inconsistency problem) OVERRIDE {
+ HistogramBase::Inconsistency problem) override {
ASSERT_TRUE(false);
}
virtual void UniqueInconsistencyDetected(
- HistogramBase::Inconsistency problem) OVERRIDE {
+ HistogramBase::Inconsistency problem) override {
ASSERT_TRUE(false);
}
- virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE {
+ virtual void InconsistencyDetectedInLoggedCount(int amount) override {
ASSERT_TRUE(false);
}
diff --git a/base/metrics/sample_map.h b/base/metrics/sample_map.h
index cdd1138..0972acd 100644
--- a/base/metrics/sample_map.h
+++ b/base/metrics/sample_map.h
@@ -24,16 +24,16 @@
// HistogramSamples implementation:
virtual void Accumulate(HistogramBase::Sample value,
- HistogramBase::Count count) OVERRIDE;
+ HistogramBase::Count count) override;
virtual HistogramBase::Count GetCount(
- HistogramBase::Sample value) const OVERRIDE;
- virtual HistogramBase::Count TotalCount() const OVERRIDE;
- virtual scoped_ptr<SampleCountIterator> Iterator() const OVERRIDE;
+ HistogramBase::Sample value) const override;
+ virtual HistogramBase::Count TotalCount() const override;
+ virtual scoped_ptr<SampleCountIterator> Iterator() const override;
protected:
virtual bool AddSubtractImpl(
SampleCountIterator* iter,
- HistogramSamples::Operator op) OVERRIDE; // |op| is ADD or SUBTRACT.
+ HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT.
private:
std::map<HistogramBase::Sample, HistogramBase::Count> sample_counts_;
@@ -50,11 +50,11 @@
virtual ~SampleMapIterator();
// SampleCountIterator implementation:
- virtual bool Done() const OVERRIDE;
- virtual void Next() OVERRIDE;
+ virtual bool Done() const override;
+ virtual void Next() override;
virtual void Get(HistogramBase::Sample* min,
HistogramBase::Sample* max,
- HistogramBase::Count* count) const OVERRIDE;
+ HistogramBase::Count* count) const override;
private:
SampleToCountMap::const_iterator iter_;
const SampleToCountMap::const_iterator end_;
diff --git a/base/metrics/sample_vector.h b/base/metrics/sample_vector.h
index 6b2adcf..8cc8ce9 100644
--- a/base/metrics/sample_vector.h
+++ b/base/metrics/sample_vector.h
@@ -27,11 +27,11 @@
// HistogramSamples implementation:
virtual void Accumulate(HistogramBase::Sample value,
- HistogramBase::Count count) OVERRIDE;
+ HistogramBase::Count count) override;
virtual HistogramBase::Count GetCount(
- HistogramBase::Sample value) const OVERRIDE;
- virtual HistogramBase::Count TotalCount() const OVERRIDE;
- virtual scoped_ptr<SampleCountIterator> Iterator() const OVERRIDE;
+ HistogramBase::Sample value) const override;
+ virtual HistogramBase::Count TotalCount() const override;
+ virtual scoped_ptr<SampleCountIterator> Iterator() const override;
// Get count of a specific bucket.
HistogramBase::Count GetCountAtIndex(size_t bucket_index) const;
@@ -39,7 +39,7 @@
protected:
virtual bool AddSubtractImpl(
SampleCountIterator* iter,
- HistogramSamples::Operator op) OVERRIDE; // |op| is ADD or SUBTRACT.
+ HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT.
virtual size_t GetBucketIndex(HistogramBase::Sample value) const;
@@ -61,14 +61,14 @@
virtual ~SampleVectorIterator();
// SampleCountIterator implementation:
- virtual bool Done() const OVERRIDE;
- virtual void Next() OVERRIDE;
+ virtual bool Done() const override;
+ virtual void Next() override;
virtual void Get(HistogramBase::Sample* min,
HistogramBase::Sample* max,
- HistogramBase::Count* count) const OVERRIDE;
+ HistogramBase::Count* count) const override;
// SampleVector uses predefined buckets, so iterator can return bucket index.
- virtual bool GetBucketIndex(size_t* index) const OVERRIDE;
+ virtual bool GetBucketIndex(size_t* index) const override;
private:
void SkipEmptyBuckets();
diff --git a/base/metrics/sparse_histogram.h b/base/metrics/sparse_histogram.h
index c114916..321c630 100644
--- a/base/metrics/sparse_histogram.h
+++ b/base/metrics/sparse_histogram.h
@@ -37,21 +37,21 @@
virtual ~SparseHistogram();
// HistogramBase implementation:
- virtual HistogramType GetHistogramType() const OVERRIDE;
+ virtual HistogramType GetHistogramType() const override;
virtual bool HasConstructionArguments(
Sample expected_minimum,
Sample expected_maximum,
- size_t expected_bucket_count) const OVERRIDE;
- virtual void Add(Sample value) OVERRIDE;
- virtual void AddSamples(const HistogramSamples& samples) OVERRIDE;
- virtual bool AddSamplesFromPickle(PickleIterator* iter) OVERRIDE;
- virtual scoped_ptr<HistogramSamples> SnapshotSamples() const OVERRIDE;
- virtual void WriteHTMLGraph(std::string* output) const OVERRIDE;
- virtual void WriteAscii(std::string* output) const OVERRIDE;
+ size_t expected_bucket_count) const override;
+ virtual void Add(Sample value) override;
+ virtual void AddSamples(const HistogramSamples& samples) override;
+ virtual bool AddSamplesFromPickle(PickleIterator* iter) override;
+ virtual scoped_ptr<HistogramSamples> SnapshotSamples() const override;
+ virtual void WriteHTMLGraph(std::string* output) const override;
+ virtual void WriteAscii(std::string* output) const override;
protected:
// HistogramBase implementation:
- virtual bool SerializeInfoImpl(Pickle* pickle) const OVERRIDE;
+ virtual bool SerializeInfoImpl(Pickle* pickle) const override;
private:
// Clients should always use FactoryGet to create SparseHistogram.
@@ -61,10 +61,10 @@
PickleIterator* iter);
static HistogramBase* DeserializeInfoImpl(PickleIterator* iter);
- virtual void GetParameters(DictionaryValue* params) const OVERRIDE;
+ virtual void GetParameters(DictionaryValue* params) const override;
virtual void GetCountAndBucketData(Count* count,
int64* sum,
- ListValue* buckets) const OVERRIDE;
+ ListValue* buckets) const override;
// Helpers for emitting Ascii graphic. Each method appends data to output.
void WriteAsciiImpl(bool graph_it,
diff --git a/base/metrics/stats_counters.h b/base/metrics/stats_counters.h
index d47bab3..a2c7dec 100644
--- a/base/metrics/stats_counters.h
+++ b/base/metrics/stats_counters.h
@@ -164,7 +164,7 @@
explicit StatsRate(const std::string& name);
virtual ~StatsRate();
- virtual void Add(int value) OVERRIDE;
+ virtual void Add(int value) override;
private:
StatsCounter counter_;
diff --git a/base/metrics/stats_table_unittest.cc b/base/metrics/stats_table_unittest.cc
index 840f926..501cbc7 100644
--- a/base/metrics/stats_table_unittest.cc
+++ b/base/metrics/stats_table_unittest.cc
@@ -70,7 +70,7 @@
: SimpleThread(name),
id_(id) {}
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
private:
int id_;
diff --git a/base/move.h b/base/move.h
index 1c67155..06f3f32 100644
--- a/base/move.h
+++ b/base/move.h
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/compiler_specific.h"
+
#ifndef BASE_MOVE_H_
#define BASE_MOVE_H_
@@ -211,7 +213,16 @@
void operator=(type&); \
public: \
operator rvalue_type() { return rvalue_type(this); } \
- type Pass() { return type(rvalue_type(this)); } \
+ type Pass() WARN_UNUSED_RESULT { return type(rvalue_type(this)); } \
+ typedef void MoveOnlyTypeForCPP03; \
+ private:
+
+#define MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(type) \
+ private: \
+ type(type&); \
+ void operator=(type&); \
+ public: \
+ type&& Pass() WARN_UNUSED_RESULT { return static_cast<type&&>(*this); } \
typedef void MoveOnlyTypeForCPP03; \
private:
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index 1bda3dc..3df8db0 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -26,7 +26,7 @@
class Adder : public Foo {
public:
explicit Adder(int scaler) : total(0), scaler_(scaler) {}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
total += x * scaler_;
}
virtual ~Adder() {}
@@ -43,7 +43,7 @@
doomed_(doomed) {
}
virtual ~Disrupter() {}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
list_->RemoveObserver(doomed_);
}
@@ -59,7 +59,7 @@
doomed_(doomed) {
}
virtual ~ThreadSafeDisrupter() {}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
list_->RemoveObserver(doomed_);
}
@@ -77,7 +77,7 @@
adder(1) {
}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
if (!added) {
added = true;
observer_list->AddObserver(&adder);
@@ -112,7 +112,7 @@
virtual ~AddRemoveThread() {
}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
loop_ = new MessageLoop(); // Fire up a message loop.
loop_->PostTask(
FROM_HERE,
@@ -153,7 +153,7 @@
loop_->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
count_observes_++;
// If we're getting called after we removed ourselves from
@@ -329,7 +329,7 @@
foos_.push_back(foo);
}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
std::vector<Foo*> tmp;
tmp.swap(foos_);
for (std::vector<Foo*>::iterator it = tmp.begin();
@@ -481,7 +481,7 @@
explicit AddInClearObserve(ObserverList<Foo>* list)
: list_(list), added_(false), adder_(1) {}
- virtual void Observe(int /* x */) OVERRIDE {
+ virtual void Observe(int /* x */) override {
list_->Clear();
list_->AddObserver(&adder_);
added_ = true;
@@ -526,7 +526,7 @@
explicit ListDestructor(ObserverList<Foo>* list) : list_(list) {}
virtual ~ListDestructor() {}
- virtual void Observe(int x) OVERRIDE {
+ virtual void Observe(int x) override {
delete list_;
}
diff --git a/base/posix/file_descriptor_shuffle.h b/base/posix/file_descriptor_shuffle.h
index 5fa590b..875fdf5 100644
--- a/base/posix/file_descriptor_shuffle.h
+++ b/base/posix/file_descriptor_shuffle.h
@@ -48,9 +48,9 @@
// An implementation of the InjectionDelegate interface using the file
// descriptor table of the current process as the domain.
class BASE_EXPORT FileDescriptorTableInjection : public InjectionDelegate {
- virtual bool Duplicate(int* result, int fd) OVERRIDE;
- virtual bool Move(int src, int dest) OVERRIDE;
- virtual void Close(int fd) OVERRIDE;
+ virtual bool Duplicate(int* result, int fd) override;
+ virtual bool Move(int src, int dest) override;
+ virtual void Close(int fd) override;
};
// A single arc of the directed graph which describes an injective multimapping.
diff --git a/base/posix/file_descriptor_shuffle_unittest.cc b/base/posix/file_descriptor_shuffle_unittest.cc
index 9e1b250..b12c909 100644
--- a/base/posix/file_descriptor_shuffle_unittest.cc
+++ b/base/posix/file_descriptor_shuffle_unittest.cc
@@ -44,18 +44,18 @@
: next_duplicate_(kDuplicateBase) {
}
- virtual bool Duplicate(int* result, int fd) OVERRIDE {
+ virtual bool Duplicate(int* result, int fd) override {
*result = next_duplicate_++;
actions_.push_back(Action(Action::DUPLICATE, *result, fd));
return true;
}
- virtual bool Move(int src, int dest) OVERRIDE {
+ virtual bool Move(int src, int dest) override {
actions_.push_back(Action(Action::MOVE, src, dest));
return true;
}
- virtual void Close(int fd) OVERRIDE {
+ virtual void Close(int fd) override {
actions_.push_back(Action(Action::CLOSE, fd));
}
@@ -250,15 +250,15 @@
class FailingDelegate : public InjectionDelegate {
public:
- virtual bool Duplicate(int* result, int fd) OVERRIDE {
+ virtual bool Duplicate(int* result, int fd) override {
return false;
}
- virtual bool Move(int src, int dest) OVERRIDE {
+ virtual bool Move(int src, int dest) override {
return false;
}
- virtual void Close(int fd) OVERRIDE {}
+ virtual void Close(int fd) override {}
};
TEST(FileDescriptorShuffleTest, EmptyWithFailure) {
diff --git a/base/power_monitor/power_monitor_device_source.h b/base/power_monitor/power_monitor_device_source.h
index 37b065a..3d264b4 100644
--- a/base/power_monitor/power_monitor_device_source.h
+++ b/base/power_monitor/power_monitor_device_source.h
@@ -51,6 +51,16 @@
#endif // OS_IOS
#endif // OS_MACOSX
+#if defined(OS_CHROMEOS)
+ // On Chrome OS, Chrome receives power-related events from powerd, the system
+ // power daemon, via D-Bus signals received on the UI thread. base can't
+ // directly depend on that code, so this class instead exposes static methods
+ // so that events can be passed in.
+ static void SetPowerSource(bool on_battery);
+ static void HandleSystemSuspending();
+ static void HandleSystemResumed();
+#endif
+
private:
#if defined(OS_WIN)
// Represents a message-only window for power message handling on Windows.
@@ -80,7 +90,7 @@
// Platform-specific method to check whether the system is currently
// running on battery power. Returns true if running on batteries,
// false otherwise.
- virtual bool IsOnBatteryPowerImpl() OVERRIDE;
+ virtual bool IsOnBatteryPowerImpl() override;
// Checks the battery status and notifies observers if the battery
// status has changed.
diff --git a/base/power_monitor/power_monitor_device_source_chromeos.cc b/base/power_monitor/power_monitor_device_source_chromeos.cc
new file mode 100644
index 0000000..c3466ee
--- /dev/null
+++ b/base/power_monitor/power_monitor_device_source_chromeos.cc
@@ -0,0 +1,40 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/power_monitor/power_monitor.h"
+#include "base/power_monitor/power_monitor_device_source.h"
+#include "base/power_monitor/power_monitor_source.h"
+
+namespace base {
+
+namespace {
+
+// The most-recently-seen power source.
+bool g_on_battery = false;
+
+} // namespace
+
+// static
+void PowerMonitorDeviceSource::SetPowerSource(bool on_battery) {
+ if (on_battery != g_on_battery) {
+ g_on_battery = on_battery;
+ ProcessPowerEvent(POWER_STATE_EVENT);
+ }
+}
+
+// static
+void PowerMonitorDeviceSource::HandleSystemSuspending() {
+ ProcessPowerEvent(SUSPEND_EVENT);
+}
+
+// static
+void PowerMonitorDeviceSource::HandleSystemResumed() {
+ ProcessPowerEvent(RESUME_EVENT);
+}
+
+bool PowerMonitorDeviceSource::IsOnBatteryPowerImpl() {
+ return g_on_battery;
+}
+
+} // namespace base
diff --git a/base/prefs/default_pref_store.h b/base/prefs/default_pref_store.h
index 23b9096..9939876 100644
--- a/base/prefs/default_pref_store.h
+++ b/base/prefs/default_pref_store.h
@@ -22,10 +22,10 @@
// PrefStore implementation:
virtual bool GetValue(const std::string& key,
- const base::Value** result) const OVERRIDE;
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
+ const base::Value** result) const override;
+ virtual void AddObserver(PrefStore::Observer* observer) override;
+ virtual void RemoveObserver(PrefStore::Observer* observer) override;
+ virtual bool HasObservers() const override;
// Sets a |value| for |key|. Should only be called if a value has not been
// set yet; otherwise call ReplaceDefaultValue().
diff --git a/base/prefs/default_pref_store_unittest.cc b/base/prefs/default_pref_store_unittest.cc
index 7181989..3f28132 100644
--- a/base/prefs/default_pref_store_unittest.cc
+++ b/base/prefs/default_pref_store_unittest.cc
@@ -20,8 +20,8 @@
}
// PrefStore::Observer implementation:
- virtual void OnPrefValueChanged(const std::string& key) OVERRIDE;
- virtual void OnInitializationCompleted(bool succeeded) OVERRIDE {}
+ virtual void OnPrefValueChanged(const std::string& key) override;
+ virtual void OnInitializationCompleted(bool succeeded) override {}
private:
DefaultPrefStore* pref_store_;
diff --git a/base/prefs/json_pref_store.h b/base/prefs/json_pref_store.h
index 7f26c89..b6d0b19 100644
--- a/base/prefs/json_pref_store.h
+++ b/base/prefs/json_pref_store.h
@@ -67,28 +67,28 @@
// PrefStore overrides:
virtual bool GetValue(const std::string& key,
- const base::Value** result) const OVERRIDE;
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
- virtual bool IsInitializationComplete() const OVERRIDE;
+ const base::Value** result) const override;
+ virtual void AddObserver(PrefStore::Observer* observer) override;
+ virtual void RemoveObserver(PrefStore::Observer* observer) override;
+ virtual bool HasObservers() const override;
+ virtual bool IsInitializationComplete() const override;
// PersistentPrefStore overrides:
virtual bool GetMutableValue(const std::string& key,
- base::Value** result) OVERRIDE;
- virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
+ base::Value** result) override;
+ virtual void SetValue(const std::string& key, base::Value* value) override;
virtual void SetValueSilently(const std::string& key,
- base::Value* value) OVERRIDE;
- virtual void RemoveValue(const std::string& key) OVERRIDE;
- virtual bool ReadOnly() const OVERRIDE;
- virtual PrefReadError GetReadError() const OVERRIDE;
+ base::Value* value) override;
+ virtual void RemoveValue(const std::string& key) override;
+ virtual bool ReadOnly() const override;
+ virtual PrefReadError GetReadError() const override;
// Note this method may be asynchronous if this instance has a |pref_filter_|
// in which case it will return PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE.
// See details in pref_filter.h.
- virtual PrefReadError ReadPrefs() OVERRIDE;
- virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE;
- virtual void CommitPendingWrite() OVERRIDE;
- virtual void ReportValueChanged(const std::string& key) OVERRIDE;
+ virtual PrefReadError ReadPrefs() override;
+ virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override;
+ virtual void CommitPendingWrite() override;
+ virtual void ReportValueChanged(const std::string& key) override;
// Just like RemoveValue(), but doesn't notify observers. Used when doing some
// cleanup that shouldn't otherwise alert observers.
@@ -111,7 +111,7 @@
void OnFileRead(scoped_ptr<ReadResult> read_result);
// ImportantFileWriter::DataSerializer overrides:
- virtual bool SerializeData(std::string* output) OVERRIDE;
+ virtual bool SerializeData(std::string* output) override;
// This method is called after the JSON file has been read and the result has
// potentially been intercepted and modified by |pref_filter_|.
diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc
index d09d9d3..437f337 100644
--- a/base/prefs/json_pref_store_unittest.cc
+++ b/base/prefs/json_pref_store_unittest.cc
@@ -37,10 +37,10 @@
// PrefFilter implementation:
virtual void FilterOnLoad(
const PostFilterOnLoadCallback& post_filter_on_load_callback,
- scoped_ptr<base::DictionaryValue> pref_store_contents) OVERRIDE;
- virtual void FilterUpdate(const std::string& path) OVERRIDE {}
+ scoped_ptr<base::DictionaryValue> pref_store_contents) override;
+ virtual void FilterUpdate(const std::string& path) override {}
virtual void FilterSerializeData(
- base::DictionaryValue* pref_store_contents) OVERRIDE {}
+ base::DictionaryValue* pref_store_contents) override {}
bool has_intercepted_prefs() const { return intercepted_prefs_ != NULL; }
@@ -86,7 +86,7 @@
class JsonPrefStoreTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(PathService::Get(base::DIR_TEST_DATA, &data_dir_));
@@ -94,7 +94,7 @@
ASSERT_TRUE(PathExists(data_dir_));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Make sure all pending tasks have been processed (e.g., deleting the
// JsonPrefStore may post write tasks).
message_loop_.PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
diff --git a/base/prefs/overlay_user_pref_store.h b/base/prefs/overlay_user_pref_store.h
index c9993b9..0e78230 100644
--- a/base/prefs/overlay_user_pref_store.h
+++ b/base/prefs/overlay_user_pref_store.h
@@ -30,30 +30,30 @@
virtual bool IsSetInOverlay(const std::string& key) const;
// Methods of PrefStore.
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
- virtual bool IsInitializationComplete() const OVERRIDE;
+ virtual void AddObserver(PrefStore::Observer* observer) override;
+ virtual void RemoveObserver(PrefStore::Observer* observer) override;
+ virtual bool HasObservers() const override;
+ virtual bool IsInitializationComplete() const override;
virtual bool GetValue(const std::string& key,
- const base::Value** result) const OVERRIDE;
+ const base::Value** result) const override;
// Methods of PersistentPrefStore.
virtual bool GetMutableValue(const std::string& key,
- base::Value** result) OVERRIDE;
- virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
+ base::Value** result) override;
+ virtual void SetValue(const std::string& key, base::Value* value) override;
virtual void SetValueSilently(const std::string& key,
- base::Value* value) OVERRIDE;
- virtual void RemoveValue(const std::string& key) OVERRIDE;
- virtual bool ReadOnly() const OVERRIDE;
- virtual PrefReadError GetReadError() const OVERRIDE;
- virtual PrefReadError ReadPrefs() OVERRIDE;
- virtual void ReadPrefsAsync(ReadErrorDelegate* delegate) OVERRIDE;
- virtual void CommitPendingWrite() OVERRIDE;
- virtual void ReportValueChanged(const std::string& key) OVERRIDE;
+ base::Value* value) override;
+ virtual void RemoveValue(const std::string& key) override;
+ virtual bool ReadOnly() const override;
+ virtual PrefReadError GetReadError() const override;
+ virtual PrefReadError ReadPrefs() override;
+ virtual void ReadPrefsAsync(ReadErrorDelegate* delegate) override;
+ virtual void CommitPendingWrite() override;
+ virtual void ReportValueChanged(const std::string& key) override;
// Methods of PrefStore::Observer.
- virtual void OnPrefValueChanged(const std::string& key) OVERRIDE;
- virtual void OnInitializationCompleted(bool succeeded) OVERRIDE;
+ virtual void OnPrefValueChanged(const std::string& key) override;
+ virtual void OnInitializationCompleted(bool succeeded) override;
void RegisterOverlayPref(const std::string& key);
void RegisterOverlayPref(const std::string& overlay_key,
diff --git a/base/prefs/pref_change_registrar.h b/base/prefs/pref_change_registrar.h
index a914bea..693d3e7 100644
--- a/base/prefs/pref_change_registrar.h
+++ b/base/prefs/pref_change_registrar.h
@@ -65,7 +65,7 @@
private:
// PrefObserver:
virtual void OnPreferenceChanged(PrefService* service,
- const std::string& pref_name) OVERRIDE;
+ const std::string& pref_name) override;
static void InvokeUnnamedCallback(const base::Closure& callback,
const std::string& pref_name);
diff --git a/base/prefs/pref_change_registrar_unittest.cc b/base/prefs/pref_change_registrar_unittest.cc
index f353a8f..e9255a0 100644
--- a/base/prefs/pref_change_registrar_unittest.cc
+++ b/base/prefs/pref_change_registrar_unittest.cc
@@ -41,7 +41,7 @@
virtual ~PrefChangeRegistrarTest() {}
protected:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
base::Closure observer() const {
return base::Bind(&base::DoNothing);
diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h
index 2c3445d..fc27793 100644
--- a/base/prefs/pref_member.h
+++ b/base/prefs/pref_member.h
@@ -117,7 +117,7 @@
// PrefObserver
virtual void OnPreferenceChanged(PrefService* service,
- const std::string& pref_name) OVERRIDE;
+ const std::string& pref_name) override;
void VerifyValuePrefName() const {
DCHECK(!pref_name_.empty());
@@ -264,7 +264,7 @@
virtual ~Internal() {}
virtual BASE_PREFS_EXPORT bool UpdateValueInternal(
- const base::Value& value) const OVERRIDE;
+ const base::Value& value) const override;
// We cache the value of the pref so we don't have to keep walking the pref
// tree.
@@ -273,8 +273,8 @@
DISALLOW_COPY_AND_ASSIGN(Internal);
};
- virtual Internal* internal() const OVERRIDE { return internal_.get(); }
- virtual void CreateInternal() const OVERRIDE { internal_ = new Internal(); }
+ virtual Internal* internal() const override { return internal_.get(); }
+ virtual void CreateInternal() const override { internal_ = new Internal(); }
// This method is used to do the actual sync with pref of the specified type.
void BASE_PREFS_EXPORT UpdatePref(const ValueType& value);
diff --git a/base/prefs/pref_notifier_impl.h b/base/prefs/pref_notifier_impl.h
index 655203d..1aa243f 100644
--- a/base/prefs/pref_notifier_impl.h
+++ b/base/prefs/pref_notifier_impl.h
@@ -41,8 +41,8 @@
protected:
// PrefNotifier overrides.
- virtual void OnPreferenceChanged(const std::string& pref_name) OVERRIDE;
- virtual void OnInitializationCompleted(bool succeeded) OVERRIDE;
+ virtual void OnPreferenceChanged(const std::string& pref_name) override;
+ virtual void OnInitializationCompleted(bool succeeded) override;
// A map from pref names to a list of observers. Observers get fired in the
// order they are added. These should only be accessed externally for unit
diff --git a/base/prefs/pref_service.cc b/base/prefs/pref_service.cc
index 65605c5..bc86ac1 100644
--- a/base/prefs/pref_service.cc
+++ b/base/prefs/pref_service.cc
@@ -28,7 +28,7 @@
ReadErrorHandler(base::Callback<void(PersistentPrefStore::PrefReadError)> cb)
: callback_(cb) {}
- virtual void OnError(PersistentPrefStore::PrefReadError error) OVERRIDE {
+ virtual void OnError(PersistentPrefStore::PrefReadError error) override {
callback_.Run(error);
}
diff --git a/base/prefs/pref_store_observer_mock.h b/base/prefs/pref_store_observer_mock.h
index 594807f..de7cc9d 100644
--- a/base/prefs/pref_store_observer_mock.h
+++ b/base/prefs/pref_store_observer_mock.h
@@ -21,8 +21,8 @@
void VerifyAndResetChangedKey(const std::string& expected);
// PrefStore::Observer implementation
- virtual void OnPrefValueChanged(const std::string& key) OVERRIDE;
- virtual void OnInitializationCompleted(bool success) OVERRIDE;
+ virtual void OnPrefValueChanged(const std::string& key) override;
+ virtual void OnInitializationCompleted(bool success) override;
std::vector<std::string> changed_keys;
bool initialized;
diff --git a/base/prefs/pref_value_store.h b/base/prefs/pref_value_store.h
index 1c85ca7..a0409ef 100644
--- a/base/prefs/pref_value_store.h
+++ b/base/prefs/pref_value_store.h
@@ -161,8 +161,8 @@
private:
// PrefStore::Observer implementation.
- virtual void OnPrefValueChanged(const std::string& key) OVERRIDE;
- virtual void OnInitializationCompleted(bool succeeded) OVERRIDE;
+ virtual void OnPrefValueChanged(const std::string& key) override;
+ virtual void OnInitializationCompleted(bool succeeded) override;
// PrefValueStore this keeper is part of.
PrefValueStore* pref_value_store_;
diff --git a/base/prefs/testing_pref_store.h b/base/prefs/testing_pref_store.h
index 785f935..aa2bd80 100644
--- a/base/prefs/testing_pref_store.h
+++ b/base/prefs/testing_pref_store.h
@@ -22,25 +22,25 @@
// Overriden from PrefStore.
virtual bool GetValue(const std::string& key,
- const base::Value** result) const OVERRIDE;
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
- virtual bool IsInitializationComplete() const OVERRIDE;
+ const base::Value** result) const override;
+ virtual void AddObserver(PrefStore::Observer* observer) override;
+ virtual void RemoveObserver(PrefStore::Observer* observer) override;
+ virtual bool HasObservers() const override;
+ virtual bool IsInitializationComplete() const override;
// PersistentPrefStore overrides:
virtual bool GetMutableValue(const std::string& key,
- base::Value** result) OVERRIDE;
- virtual void ReportValueChanged(const std::string& key) OVERRIDE;
- virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
+ base::Value** result) override;
+ virtual void ReportValueChanged(const std::string& key) override;
+ virtual void SetValue(const std::string& key, base::Value* value) override;
virtual void SetValueSilently(const std::string& key,
- base::Value* value) OVERRIDE;
- virtual void RemoveValue(const std::string& key) OVERRIDE;
- virtual bool ReadOnly() const OVERRIDE;
- virtual PrefReadError GetReadError() const OVERRIDE;
- virtual PersistentPrefStore::PrefReadError ReadPrefs() OVERRIDE;
- virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) OVERRIDE;
- virtual void CommitPendingWrite() OVERRIDE;
+ base::Value* value) override;
+ virtual void RemoveValue(const std::string& key) override;
+ virtual bool ReadOnly() const override;
+ virtual PrefReadError GetReadError() const override;
+ virtual PersistentPrefStore::PrefReadError ReadPrefs() override;
+ virtual void ReadPrefsAsync(ReadErrorDelegate* error_delegate) override;
+ virtual void CommitPendingWrite() override;
// Marks the store as having completed initialization.
void SetInitializationCompleted();
diff --git a/base/prefs/value_map_pref_store.h b/base/prefs/value_map_pref_store.h
index d4e41f4..d90d0c0 100644
--- a/base/prefs/value_map_pref_store.h
+++ b/base/prefs/value_map_pref_store.h
@@ -22,19 +22,19 @@
// PrefStore overrides:
virtual bool GetValue(const std::string& key,
- const base::Value** value) const OVERRIDE;
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
+ const base::Value** value) const override;
+ virtual void AddObserver(PrefStore::Observer* observer) override;
+ virtual void RemoveObserver(PrefStore::Observer* observer) override;
+ virtual bool HasObservers() const override;
// WriteablePrefStore overrides:
- virtual void SetValue(const std::string& key, base::Value* value) OVERRIDE;
- virtual void RemoveValue(const std::string& key) OVERRIDE;
+ virtual void SetValue(const std::string& key, base::Value* value) override;
+ virtual void RemoveValue(const std::string& key) override;
virtual bool GetMutableValue(const std::string& key,
- base::Value** value) OVERRIDE;
- virtual void ReportValueChanged(const std::string& key) OVERRIDE;
+ base::Value** value) override;
+ virtual void ReportValueChanged(const std::string& key) override;
virtual void SetValueSilently(const std::string& key,
- base::Value* value) OVERRIDE;
+ base::Value* value) override;
protected:
virtual ~ValueMapPrefStore();
diff --git a/base/process/kill_posix.cc b/base/process/kill_posix.cc
index adc1db3..d4ca726 100644
--- a/base/process/kill_posix.cc
+++ b/base/process/kill_posix.cc
@@ -410,7 +410,7 @@
}
// Overridden from PlatformThread::Delegate:
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
WaitForChildToDie();
delete this;
}
diff --git a/base/process/memory_unittest.cc b/base/process/memory_unittest.cc
index 21b5a5b..afbf5c6 100644
--- a/base/process/memory_unittest.cc
+++ b/base/process/memory_unittest.cc
@@ -182,11 +182,11 @@
}
#if defined(USE_TCMALLOC)
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
tc_set_new_mode(1);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
tc_set_new_mode(0);
}
#endif // defined(USE_TCMALLOC)
diff --git a/base/process/process_iterator.h b/base/process/process_iterator.h
index aa2fc41..185965a 100644
--- a/base/process/process_iterator.h
+++ b/base/process/process_iterator.h
@@ -166,7 +166,7 @@
virtual ~NamedProcessIterator();
protected:
- virtual bool IncludeEntry() OVERRIDE;
+ virtual bool IncludeEntry() override;
private:
FilePath::StringType executable_name_;
diff --git a/base/sequence_checker_unittest.cc b/base/sequence_checker_unittest.cc
index b818640..ad77db0 100644
--- a/base/sequence_checker_unittest.cc
+++ b/base/sequence_checker_unittest.cc
@@ -58,12 +58,12 @@
virtual ~SequenceCheckerTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
other_thread_.Start();
ResetPool();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
other_thread_.Stop();
pool()->Shutdown();
}
diff --git a/base/sync_socket.h b/base/sync_socket.h
index 9923591..b8d947e 100644
--- a/base/sync_socket.h
+++ b/base/sync_socket.h
@@ -124,11 +124,11 @@
// and there isn't a way to cancel a blocking synchronous Read that is
// supported on <Vista. So, for Windows only, we override these
// SyncSocket methods in order to support shutting down the 'socket'.
- virtual bool Close() OVERRIDE;
- virtual size_t Receive(void* buffer, size_t length) OVERRIDE;
+ virtual bool Close() override;
+ virtual size_t Receive(void* buffer, size_t length) override;
virtual size_t ReceiveWithTimeout(void* buffer,
size_t length,
- TimeDelta timeout) OVERRIDE;
+ TimeDelta timeout) override;
#endif
// Send() is overridden to catch cases where the remote end is not responding
@@ -136,7 +136,7 @@
// implementation of Send() will not block indefinitely as
// SyncSocket::Send will, but instead return 0, as no bytes could be sent.
// Note that the socket will not be closed in this case.
- virtual size_t Send(const void* buffer, size_t length) OVERRIDE;
+ virtual size_t Send(const void* buffer, size_t length) override;
private:
#if defined(OS_WIN)
diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc
index 86b3c34..51b38a5 100644
--- a/base/sync_socket_posix.cc
+++ b/base/sync_socket_posix.cc
@@ -36,8 +36,9 @@
DCHECK_LE(length, kMaxMessageLength);
DCHECK_NE(handle, SyncSocket::kInvalidHandle);
const char* charbuffer = static_cast<const char*>(buffer);
- const int len = WriteFileDescriptor(handle, charbuffer, length);
- return len < 0 ? 0 : static_cast<size_t>(len);
+ return WriteFileDescriptor(handle, charbuffer, length)
+ ? static_cast<size_t>(length)
+ : 0;
}
bool CloseHandle(SyncSocket::Handle handle) {
diff --git a/base/sync_socket_unittest.cc b/base/sync_socket_unittest.cc
index 7e4089c..ddd2fcc 100644
--- a/base/sync_socket_unittest.cc
+++ b/base/sync_socket_unittest.cc
@@ -22,7 +22,7 @@
virtual ~HangingReceiveThread() {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
int data = 0;
ASSERT_EQ(socket_->Peek(), 0u);
diff --git a/base/synchronization/condition_variable_unittest.cc b/base/synchronization/condition_variable_unittest.cc
index 5f947a9..4232734 100644
--- a/base/synchronization/condition_variable_unittest.cc
+++ b/base/synchronization/condition_variable_unittest.cc
@@ -67,7 +67,7 @@
virtual ~WorkQueue();
// PlatformThread::Delegate interface.
- virtual void ThreadMain() OVERRIDE;
+ virtual void ThreadMain() override;
//----------------------------------------------------------------------------
// Worker threads only call the following methods.
diff --git a/base/synchronization/condition_variable_win.cc b/base/synchronization/condition_variable_win.cc
index 377fc9d..6dc4831 100644
--- a/base/synchronization/condition_variable_win.cc
+++ b/base/synchronization/condition_variable_win.cc
@@ -74,10 +74,10 @@
WinVistaCondVar(Lock* user_lock);
~WinVistaCondVar() {};
// Overridden from ConditionVarImpl.
- virtual void Wait() OVERRIDE;
- virtual void TimedWait(const TimeDelta& max_time) OVERRIDE;
- virtual void Broadcast() OVERRIDE;
- virtual void Signal() OVERRIDE;
+ virtual void Wait() override;
+ virtual void TimedWait(const TimeDelta& max_time) override;
+ virtual void Broadcast() override;
+ virtual void Signal() override;
private:
base::Lock& user_lock_;
@@ -129,10 +129,10 @@
WinXPCondVar(Lock* user_lock);
~WinXPCondVar();
// Overridden from ConditionVarImpl.
- virtual void Wait() OVERRIDE;
- virtual void TimedWait(const TimeDelta& max_time) OVERRIDE;
- virtual void Broadcast() OVERRIDE;
- virtual void Signal() OVERRIDE;
+ virtual void Wait() override;
+ virtual void TimedWait(const TimeDelta& max_time) override;
+ virtual void Broadcast() override;
+ virtual void Signal() override;
// Define Event class that is used to form circularly linked lists.
// The list container is an element with NULL as its handle_ value.
diff --git a/base/synchronization/lock_unittest.cc b/base/synchronization/lock_unittest.cc
index 1614475..60f4250 100644
--- a/base/synchronization/lock_unittest.cc
+++ b/base/synchronization/lock_unittest.cc
@@ -18,7 +18,7 @@
public:
explicit BasicLockTestThread(Lock* lock) : lock_(lock), acquired_(0) {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
for (int i = 0; i < 10; i++) {
lock_->Acquire();
acquired_++;
@@ -93,7 +93,7 @@
public:
explicit TryLockTestThread(Lock* lock) : lock_(lock), got_lock_(false) {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
got_lock_ = lock_->Try();
if (got_lock_)
lock_->Release();
@@ -162,7 +162,7 @@
}
}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
DoStuff(lock_, value_);
}
diff --git a/base/synchronization/waitable_event_posix.cc b/base/synchronization/waitable_event_posix.cc
index 89f42ff..f34b2a4 100644
--- a/base/synchronization/waitable_event_posix.cc
+++ b/base/synchronization/waitable_event_posix.cc
@@ -91,7 +91,7 @@
cv_(&lock_) {
}
- virtual bool Fire(WaitableEvent* signaling_event) OVERRIDE {
+ virtual bool Fire(WaitableEvent* signaling_event) override {
base::AutoLock locked(lock_);
if (fired_)
@@ -117,7 +117,7 @@
// These waiters are always stack allocated and don't delete themselves. Thus
// there's no problem and the ABA tag is the same as the object pointer.
// ---------------------------------------------------------------------------
- virtual bool Compare(void* tag) OVERRIDE {
+ virtual bool Compare(void* tag) override {
return this == tag;
}
diff --git a/base/synchronization/waitable_event_unittest.cc b/base/synchronization/waitable_event_unittest.cc
index 0b50d81..a8913fd 100644
--- a/base/synchronization/waitable_event_unittest.cc
+++ b/base/synchronization/waitable_event_unittest.cc
@@ -78,7 +78,7 @@
ev_(ev) {
}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
PlatformThread::Sleep(TimeDelta::FromSecondsD(seconds_));
ev_->Signal();
}
diff --git a/base/synchronization/waitable_event_watcher.h b/base/synchronization/waitable_event_watcher.h
index ede2835..4d2f9b5 100644
--- a/base/synchronization/waitable_event_watcher.h
+++ b/base/synchronization/waitable_event_watcher.h
@@ -92,11 +92,11 @@
private:
#if defined(OS_WIN)
- virtual void OnObjectSignaled(HANDLE h) OVERRIDE;
+ virtual void OnObjectSignaled(HANDLE h) override;
win::ObjectWatcher watcher_;
#else
// Implementation of MessageLoop::DestructionObserver
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+ virtual void WillDestroyCurrentMessageLoop() override;
MessageLoop* message_loop_;
scoped_refptr<Flag> cancel_flag_;
diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc
index 54e01f8..e791871 100644
--- a/base/synchronization/waitable_event_watcher_posix.cc
+++ b/base/synchronization/waitable_event_watcher_posix.cc
@@ -65,7 +65,7 @@
callback_(callback),
flag_(flag) { }
- virtual bool Fire(WaitableEvent* event) OVERRIDE {
+ virtual bool Fire(WaitableEvent* event) override {
// Post the callback if we haven't been cancelled.
if (!flag_->value()) {
message_loop_->PostTask(FROM_HERE, callback_);
@@ -81,7 +81,7 @@
}
// See StopWatching for discussion
- virtual bool Compare(void* tag) OVERRIDE {
+ virtual bool Compare(void* tag) override {
return tag == flag_.get();
}
diff --git a/base/task_runner.cc b/base/task_runner.cc
index 5860f28..f2c64f3 100644
--- a/base/task_runner.cc
+++ b/base/task_runner.cc
@@ -21,7 +21,7 @@
private:
virtual bool PostTask(const tracked_objects::Location& from_here,
- const Closure& task) OVERRIDE;
+ const Closure& task) override;
// Non-owning.
TaskRunner* destination_;
diff --git a/base/test/expectations/parser_unittest.cc b/base/test/expectations/parser_unittest.cc
index 1c55a05..a456458 100644
--- a/base/test/expectations/parser_unittest.cc
+++ b/base/test/expectations/parser_unittest.cc
@@ -16,15 +16,15 @@
public Parser::Delegate {
public:
virtual void EmitExpectation(
- const test_expectations::Expectation& expectation) OVERRIDE {
+ const test_expectations::Expectation& expectation) override {
expectations_.push_back(expectation);
}
- virtual void OnSyntaxError(const std::string& message) OVERRIDE {
+ virtual void OnSyntaxError(const std::string& message) override {
syntax_error_ = message;
}
- virtual void OnDataError(const std::string& error) OVERRIDE {
+ virtual void OnDataError(const std::string& error) override {
data_errors_.push_back(error);
}
diff --git a/base/test/gtest_xml_util.h b/base/test/gtest_xml_util.h
index 79527e5..f832cde 100644
--- a/base/test/gtest_xml_util.h
+++ b/base/test/gtest_xml_util.h
@@ -28,10 +28,10 @@
private:
// testing::EmptyTestEventListener:
- virtual void OnTestCaseStart(const testing::TestCase& test_case) OVERRIDE;
- virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE;
- virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE;
- virtual void OnTestCaseEnd(const testing::TestCase& test_case) OVERRIDE;
+ virtual void OnTestCaseStart(const testing::TestCase& test_case) override;
+ virtual void OnTestStart(const testing::TestInfo& test_info) override;
+ virtual void OnTestEnd(const testing::TestInfo& test_info) override;
+ virtual void OnTestCaseEnd(const testing::TestCase& test_case) override;
FILE* output_file_;
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 2a36c69..eab51f4 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -142,7 +142,7 @@
SignalFDWatcher() {
}
- virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanReadWithoutBlocking(int fd) override {
fprintf(stdout, "\nCaught signal. Killing spawned test processes...\n");
fflush(stdout);
@@ -152,7 +152,7 @@
exit(1);
}
- virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE {
+ virtual void OnFileCanWriteWithoutBlocking(int fd) override {
NOTREACHED();
}
diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc
index 0cbae2f..d6aeef8 100644
--- a/base/test/launcher/unit_test_launcher.cc
+++ b/base/test/launcher/unit_test_launcher.cc
@@ -119,7 +119,7 @@
};
virtual bool ShouldRunTest(const testing::TestCase* test_case,
- const testing::TestInfo* test_info) OVERRIDE {
+ const testing::TestInfo* test_info) override {
DCHECK(thread_checker_.CalledOnValidThread());
// There is no additional logic to disable specific tests.
@@ -127,7 +127,7 @@
}
virtual size_t RunTests(TestLauncher* test_launcher,
- const std::vector<std::string>& test_names) OVERRIDE {
+ const std::vector<std::string>& test_names) override {
DCHECK(thread_checker_.CalledOnValidThread());
std::vector<std::string> batch;
@@ -147,7 +147,7 @@
virtual size_t RetryTests(
TestLauncher* test_launcher,
- const std::vector<std::string>& test_names) OVERRIDE {
+ const std::vector<std::string>& test_names) override {
MessageLoop::current()->PostTask(
FROM_HERE,
Bind(&UnitTestLauncherDelegate::RunSerially,
diff --git a/base/test/null_task_runner.h b/base/test/null_task_runner.h
index d6390e5..9515733 100644
--- a/base/test/null_task_runner.h
+++ b/base/test/null_task_runner.h
@@ -17,13 +17,13 @@
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
+ base::TimeDelta delay) override;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
+ base::TimeDelta delay) override;
// Always returns true to avoid triggering DCHECKs.
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ virtual bool RunsTasksOnCurrentThread() const override;
protected:
virtual ~NullTaskRunner();
diff --git a/base/test/perf_test_suite.h b/base/test/perf_test_suite.h
index 85bfc41..df8162b 100644
--- a/base/test/perf_test_suite.h
+++ b/base/test/perf_test_suite.h
@@ -13,8 +13,8 @@
public:
PerfTestSuite(int argc, char** argv);
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void Shutdown() override;
};
} // namespace base
diff --git a/base/test/power_monitor_test_base.h b/base/test/power_monitor_test_base.h
index 6e37f3d..4aaafb9 100644
--- a/base/test/power_monitor_test_base.h
+++ b/base/test/power_monitor_test_base.h
@@ -21,7 +21,7 @@
void GenerateResumeEvent();
protected:
- virtual bool IsOnBatteryPowerImpl() OVERRIDE;
+ virtual bool IsOnBatteryPowerImpl() override;
bool test_on_battery_power_;
MessageLoop message_loop_;
@@ -33,9 +33,9 @@
virtual ~PowerMonitorTestObserver();
// PowerObserver callbacks.
- virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE;
- virtual void OnSuspend() OVERRIDE;
- virtual void OnResume() OVERRIDE;
+ virtual void OnPowerStateChange(bool on_battery_power) override;
+ virtual void OnSuspend() override;
+ virtual void OnResume() override;
// Test status counts.
bool last_power_state() { return last_power_state_; }
diff --git a/base/test/sequenced_worker_pool_owner.h b/base/test/sequenced_worker_pool_owner.h
index 1cc3fd6..f6f0bb2 100644
--- a/base/test/sequenced_worker_pool_owner.h
+++ b/base/test/sequenced_worker_pool_owner.h
@@ -42,9 +42,9 @@
private:
// SequencedWorkerPool::TestingObserver implementation.
- virtual void OnHasWork() OVERRIDE;
- virtual void WillWaitForShutdown() OVERRIDE;
- virtual void OnDestruct() OVERRIDE;
+ virtual void OnHasWork() override;
+ virtual void WillWaitForShutdown() override;
+ virtual void OnDestruct() override;
MessageLoop* const constructor_message_loop_;
scoped_refptr<SequencedWorkerPool> pool_;
diff --git a/base/test/simple_test_clock.h b/base/test/simple_test_clock.h
index 2056aab..a49cc53 100644
--- a/base/test/simple_test_clock.h
+++ b/base/test/simple_test_clock.h
@@ -21,7 +21,7 @@
SimpleTestClock();
virtual ~SimpleTestClock();
- virtual Time Now() OVERRIDE;
+ virtual Time Now() override;
// Advances the clock by |delta|.
void Advance(TimeDelta delta);
diff --git a/base/test/simple_test_tick_clock.h b/base/test/simple_test_tick_clock.h
index 867de80..c67eb55 100644
--- a/base/test/simple_test_tick_clock.h
+++ b/base/test/simple_test_tick_clock.h
@@ -21,7 +21,7 @@
SimpleTestTickClock();
virtual ~SimpleTestTickClock();
- virtual TimeTicks NowTicks() OVERRIDE;
+ virtual TimeTicks NowTicks() override;
// Advances the clock by |delta|, which must not be negative.
void Advance(TimeDelta delta);
diff --git a/base/test/test_simple_task_runner.h b/base/test/test_simple_task_runner.h
index af4f4eb..56a1894 100644
--- a/base/test/test_simple_task_runner.h
+++ b/base/test/test_simple_task_runner.h
@@ -49,13 +49,13 @@
// SingleThreadTaskRunner implementation.
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
+ TimeDelta delay) override;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
+ TimeDelta delay) override;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ virtual bool RunsTasksOnCurrentThread() const override;
const std::deque<TestPendingTask>& GetPendingTasks() const;
bool HasPendingTask() const;
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 45b02f9..23ffa1e 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -49,7 +49,7 @@
class MaybeTestDisabler : public testing::EmptyTestEventListener {
public:
- virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
+ virtual void OnTestStart(const testing::TestInfo& test_info) override {
ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info))
<< "Probably the OS #ifdefs don't include all of the necessary "
"platforms.\nPlease ensure that no tests have the MAYBE_ prefix "
@@ -63,11 +63,11 @@
: old_command_line_(CommandLine::NO_PROGRAM) {
}
- virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE {
+ virtual void OnTestStart(const testing::TestInfo& test_info) override {
old_command_line_ = *CommandLine::ForCurrentProcess();
}
- virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE {
+ virtual void OnTestEnd(const testing::TestInfo& test_info) override {
*CommandLine::ForCurrentProcess() = old_command_line_;
}
diff --git a/base/test/test_support_android.cc b/base/test/test_support_android.cc
index 4ada567..eeab9ee 100644
--- a/base/test/test_support_android.cc
+++ b/base/test/test_support_android.cc
@@ -74,12 +74,12 @@
class MessagePumpForUIStub : public base::MessagePumpForUI {
virtual ~MessagePumpForUIStub() {}
- virtual void Start(base::MessagePump::Delegate* delegate) OVERRIDE {
+ virtual void Start(base::MessagePump::Delegate* delegate) override {
NOTREACHED() << "The Start() method shouldn't be called in test, using"
" Run() method should be used.";
}
- virtual void Run(base::MessagePump::Delegate* delegate) OVERRIDE {
+ virtual void Run(base::MessagePump::Delegate* delegate) override {
// The following was based on message_pump_glib.cc, except we're using a
// WaitableEvent since there are no native message loop to use.
RunState state(delegate, g_state ? g_state->run_depth + 1 : 1);
@@ -119,16 +119,16 @@
g_state = previous_state;
}
- virtual void Quit() OVERRIDE {
+ virtual void Quit() override {
Waitable::GetInstance()->Quit();
}
- virtual void ScheduleWork() OVERRIDE {
+ virtual void ScheduleWork() override {
Waitable::GetInstance()->Signal();
}
virtual void ScheduleDelayedWork(
- const base::TimeTicks& delayed_work_time) OVERRIDE {
+ const base::TimeTicks& delayed_work_time) override {
Waitable::GetInstance()->Signal();
}
};
diff --git a/base/test/trace_to_file.cc b/base/test/trace_to_file.cc
index 6caaf47..423f65c 100644
--- a/base/test/trace_to_file.cc
+++ b/base/test/trace_to_file.cc
@@ -67,8 +67,8 @@
}
void TraceToFile::TraceOutputCallback(const std::string& data) {
- int ret = AppendToFile(path_, data.c_str(), static_cast<int>(data.size()));
- DCHECK_NE(-1, ret);
+ bool ret = AppendToFile(path_, data.c_str(), static_cast<int>(data.size()));
+ DCHECK(ret);
}
static void OnTraceDataCollected(
diff --git a/base/threading/non_thread_safe_unittest.cc b/base/threading/non_thread_safe_unittest.cc
index 8a82a63..2bd7629 100644
--- a/base/threading/non_thread_safe_unittest.cc
+++ b/base/threading/non_thread_safe_unittest.cc
@@ -52,7 +52,7 @@
non_thread_safe_class_(non_thread_safe_class) {
}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
non_thread_safe_class_->DoStuff();
}
@@ -71,7 +71,7 @@
non_thread_safe_class_(non_thread_safe_class) {
}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
non_thread_safe_class_.reset();
}
diff --git a/base/threading/platform_thread_unittest.cc b/base/threading/platform_thread_unittest.cc
index 59f29da..6859692 100644
--- a/base/threading/platform_thread_unittest.cc
+++ b/base/threading/platform_thread_unittest.cc
@@ -15,7 +15,7 @@
public:
TrivialThread() : did_run_(false) {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
did_run_ = true;
}
@@ -57,7 +57,7 @@
public:
FunctionTestThread() : thread_id_(0) {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
thread_id_ = PlatformThread::CurrentId();
PlatformThread::YieldCurrentThread();
PlatformThread::Sleep(TimeDelta::FromMilliseconds(50));
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc
index 38b2998..5304f37 100644
--- a/base/threading/sequenced_worker_pool.cc
+++ b/base/threading/sequenced_worker_pool.cc
@@ -100,8 +100,8 @@
// TaskRunner implementation
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
private:
virtual ~SequencedWorkerPoolTaskRunner();
@@ -153,14 +153,14 @@
// TaskRunner implementation
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
// SequencedTaskRunner implementation
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
+ TimeDelta delay) override;
private:
virtual ~SequencedWorkerPoolSequencedTaskRunner();
@@ -238,7 +238,7 @@
virtual ~Worker();
// SimpleThread implementation. This actually runs the background thread.
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
void set_running_task_info(SequenceToken token,
WorkerShutdown shutdown_behavior) {
diff --git a/base/threading/sequenced_worker_pool.h b/base/threading/sequenced_worker_pool.h
index d3c85e2..4b1c749 100644
--- a/base/threading/sequenced_worker_pool.h
+++ b/base/threading/sequenced_worker_pool.h
@@ -292,8 +292,8 @@
// TaskRunner implementation. Forwards to PostDelayedWorkerTask().
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
// Returns true if the current thread is processing a task with the given
// sequence_token.
@@ -338,7 +338,7 @@
protected:
virtual ~SequencedWorkerPool();
- virtual void OnDestruct() const OVERRIDE;
+ virtual void OnDestruct() const override;
private:
friend class RefCountedThreadSafe<SequencedWorkerPool>;
diff --git a/base/threading/sequenced_worker_pool_unittest.cc b/base/threading/sequenced_worker_pool_unittest.cc
index 10cf28b..b1fe276 100644
--- a/base/threading/sequenced_worker_pool_unittest.cc
+++ b/base/threading/sequenced_worker_pool_unittest.cc
@@ -185,9 +185,9 @@
virtual ~SequencedWorkerPoolTest() {}
- virtual void SetUp() OVERRIDE {}
+ virtual void SetUp() override {}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
pool()->Shutdown();
}
diff --git a/base/threading/simple_thread.h b/base/threading/simple_thread.h
index df03ce1..e734c29 100644
--- a/base/threading/simple_thread.h
+++ b/base/threading/simple_thread.h
@@ -102,7 +102,7 @@
bool HasBeenJoined() { return joined_; }
// Overridden from PlatformThread::Delegate:
- virtual void ThreadMain() OVERRIDE;
+ virtual void ThreadMain() override;
// Only set priorities with a careful understanding of the consequences.
// This is meant for very limited use cases.
@@ -136,7 +136,7 @@
const Options& options);
virtual ~DelegateSimpleThread();
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
private:
Delegate* delegate_;
};
@@ -174,7 +174,7 @@
}
// We implement the Delegate interface, for running our internal threads.
- virtual void Run() OVERRIDE;
+ virtual void Run() override;
private:
const std::string name_prefix_;
diff --git a/base/threading/simple_thread_unittest.cc b/base/threading/simple_thread_unittest.cc
index a744b8d..89ddeba 100644
--- a/base/threading/simple_thread_unittest.cc
+++ b/base/threading/simple_thread_unittest.cc
@@ -17,7 +17,7 @@
SetIntRunner(int* ptr, int val) : ptr_(ptr), val_(val) { }
virtual ~SetIntRunner() { }
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
*ptr_ = val_;
}
@@ -31,7 +31,7 @@
explicit WaitEventRunner(WaitableEvent* event) : event_(event) { }
virtual ~WaitEventRunner() { }
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
EXPECT_FALSE(event_->IsSignaled());
event_->Signal();
EXPECT_TRUE(event_->IsSignaled());
@@ -43,7 +43,7 @@
class SeqRunner : public DelegateSimpleThread::Delegate {
public:
explicit SeqRunner(AtomicSequenceNumber* seq) : seq_(seq) { }
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
seq_->GetNext();
}
@@ -60,7 +60,7 @@
int total, WaitableEvent* event)
: seq_(seq), total_(total), event_(event) { }
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
if (seq_->GetNext() == total_) {
event_->Signal();
} else {
diff --git a/base/threading/thread.h b/base/threading/thread.h
index a0a3005..464a965 100644
--- a/base/threading/thread.h
+++ b/base/threading/thread.h
@@ -201,7 +201,7 @@
#endif
// PlatformThread::Delegate methods:
- virtual void ThreadMain() OVERRIDE;
+ virtual void ThreadMain() override;
#if defined(OS_WIN)
// Whether this thread needs to initialize COM, and if so, in what mode.
diff --git a/base/threading/thread_checker_unittest.cc b/base/threading/thread_checker_unittest.cc
index ae96923..1084dd9 100644
--- a/base/threading/thread_checker_unittest.cc
+++ b/base/threading/thread_checker_unittest.cc
@@ -52,7 +52,7 @@
thread_checker_class_(thread_checker_class) {
}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
thread_checker_class_->DoStuff();
}
@@ -71,7 +71,7 @@
thread_checker_class_(thread_checker_class) {
}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
thread_checker_class_.reset();
}
diff --git a/base/threading/thread_collision_warner.h b/base/threading/thread_collision_warner.h
index 5172b2e..0523c91 100644
--- a/base/threading/thread_collision_warner.h
+++ b/base/threading/thread_collision_warner.h
@@ -139,7 +139,7 @@
struct BASE_EXPORT DCheckAsserter : public AsserterBase {
virtual ~DCheckAsserter() {}
- virtual void warn() OVERRIDE;
+ virtual void warn() override;
};
class BASE_EXPORT ThreadCollisionWarner {
diff --git a/base/threading/thread_collision_warner_unittest.cc b/base/threading/thread_collision_warner_unittest.cc
index 48710a7..c7c7d0a 100644
--- a/base/threading/thread_collision_warner_unittest.cc
+++ b/base/threading/thread_collision_warner_unittest.cc
@@ -41,7 +41,7 @@
AssertReporter()
: failed_(false) {}
- virtual void warn() OVERRIDE {
+ virtual void warn() override {
failed_ = true;
}
@@ -151,7 +151,7 @@
explicit QueueUser(NonThreadSafeQueue& queue)
: queue_(queue) {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
queue_.push(0);
queue_.pop();
}
@@ -209,7 +209,7 @@
explicit QueueUser(NonThreadSafeQueue& queue)
: queue_(queue) {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
queue_.push(0);
queue_.pop();
}
@@ -270,7 +270,7 @@
: queue_(queue),
lock_(lock) {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
{
base::AutoLock auto_lock(lock_);
queue_.push(0);
@@ -344,7 +344,7 @@
: queue_(queue),
lock_(lock) {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
{
base::AutoLock auto_lock(lock_);
queue_.push(0);
diff --git a/base/threading/thread_local_storage_unittest.cc b/base/threading/thread_local_storage_unittest.cc
index 1bf71d1..321a058 100644
--- a/base/threading/thread_local_storage_unittest.cc
+++ b/base/threading/thread_local_storage_unittest.cc
@@ -35,7 +35,7 @@
virtual ~ThreadLocalStorageRunner() {}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
*tls_value_ptr_ = kInitialTlsValue;
tls_slot.Set(tls_value_ptr_);
diff --git a/base/threading/thread_local_unittest.cc b/base/threading/thread_local_unittest.cc
index b125a48..9d0a7c9e 100644
--- a/base/threading/thread_local_unittest.cc
+++ b/base/threading/thread_local_unittest.cc
@@ -37,7 +37,7 @@
void set_value(ThreadLocalTesterBase* val) { val_ = val; }
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
DCHECK(!done_->IsSignaled());
tlp_->Set(val_);
done_->Signal();
@@ -57,7 +57,7 @@
void set_ptr(ThreadLocalTesterBase** ptr) { ptr_ = ptr; }
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
DCHECK(!done_->IsSignaled());
*ptr_ = tlp_->Get();
done_->Signal();
diff --git a/base/threading/thread_perftest.cc b/base/threading/thread_perftest.cc
index 088f629..2c9fabb 100644
--- a/base/threading/thread_perftest.cc
+++ b/base/threading/thread_perftest.cc
@@ -123,7 +123,7 @@
return threads_[count % threads_.size()];
}
- virtual void PingPong(int hops) OVERRIDE {
+ virtual void PingPong(int hops) override {
if (!hops) {
FinishMeasurement();
return;
@@ -149,16 +149,16 @@
// Same as above, but add observers to test their perf impact.
class MessageLoopObserver : public base::MessageLoop::TaskObserver {
public:
- virtual void WillProcessTask(const base::PendingTask& pending_task) OVERRIDE {
+ virtual void WillProcessTask(const base::PendingTask& pending_task) override {
}
- virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE {
+ virtual void DidProcessTask(const base::PendingTask& pending_task) override {
}
};
MessageLoopObserver message_loop_observer;
class TaskObserverPerfTest : public TaskPerfTest {
public:
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
TaskPerfTest::Init();
for (size_t i = 0; i < threads_.size(); i++) {
threads_[i]->message_loop()->AddTaskObserver(&message_loop_observer);
@@ -176,12 +176,12 @@
template <typename WaitableEventType>
class EventPerfTest : public ThreadPerfTest {
public:
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
for (size_t i = 0; i < threads_.size(); i++)
events_.push_back(new WaitableEventType(false, false));
}
- virtual void Reset() OVERRIDE { events_.clear(); }
+ virtual void Reset() override { events_.clear(); }
void WaitAndSignalOnThread(size_t event) {
size_t next_event = (event + 1) % events_.size();
@@ -197,7 +197,7 @@
FinishMeasurement();
}
- virtual void PingPong(int hops) OVERRIDE {
+ virtual void PingPong(int hops) override {
remaining_hops_ = hops;
for (size_t i = 0; i < threads_.size(); i++) {
threads_[i]->message_loop_proxy()->PostTask(
diff --git a/base/threading/thread_unittest.cc b/base/threading/thread_unittest.cc
index 8bd817c..2bac84a 100644
--- a/base/threading/thread_unittest.cc
+++ b/base/threading/thread_unittest.cc
@@ -35,7 +35,7 @@
Stop();
}
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(500));
init_called_ = true;
}
@@ -74,11 +74,11 @@
Stop();
}
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
event_list_->push_back(THREAD_EVENT_INIT);
}
- virtual void CleanUp() OVERRIDE {
+ virtual void CleanUp() override {
event_list_->push_back(THREAD_EVENT_CLEANUP);
}
@@ -97,7 +97,7 @@
}
// DestructionObserver implementation:
- virtual void WillDestroyCurrentMessageLoop() OVERRIDE {
+ virtual void WillDestroyCurrentMessageLoop() override {
event_list_->push_back(THREAD_EVENT_MESSAGE_LOOP_DESTROYED);
event_list_ = NULL;
}
diff --git a/base/threading/watchdog.h b/base/threading/watchdog.h
index abcb4f1..fe43e48 100644
--- a/base/threading/watchdog.h
+++ b/base/threading/watchdog.h
@@ -65,7 +65,7 @@
public:
explicit ThreadDelegate(Watchdog* watchdog) : watchdog_(watchdog) {
}
- virtual void ThreadMain() OVERRIDE;
+ virtual void ThreadMain() override;
private:
void SetThreadName() const;
diff --git a/base/threading/watchdog_unittest.cc b/base/threading/watchdog_unittest.cc
index 7a4be4c..2dbfdbd 100644
--- a/base/threading/watchdog_unittest.cc
+++ b/base/threading/watchdog_unittest.cc
@@ -28,7 +28,7 @@
virtual ~WatchdogCounter() {}
- virtual void Alarm() OVERRIDE {
+ virtual void Alarm() override {
alarm_counter_++;
Watchdog::Alarm();
}
@@ -43,7 +43,7 @@
class WatchdogTest : public testing::Test {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
Watchdog::ResetStaticData();
}
};
diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc
index 9e5e64c..5b57cab 100644
--- a/base/threading/worker_pool.cc
+++ b/base/threading/worker_pool.cc
@@ -24,7 +24,7 @@
private:
virtual bool PostTask(const tracked_objects::Location& from_here,
- const Closure& task) OVERRIDE {
+ const Closure& task) override {
return WorkerPool::PostTask(from_here, task, task_is_slow_);
}
@@ -43,8 +43,8 @@
// TaskRunner implementation
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const Closure& task,
- TimeDelta delay) OVERRIDE;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ TimeDelta delay) override;
+ virtual bool RunsTasksOnCurrentThread() const override;
private:
virtual ~WorkerPoolTaskRunner();
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index 167d20f..fbf4635 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -71,7 +71,7 @@
: name_prefix_(name_prefix),
pool_(pool) {}
- virtual void ThreadMain() OVERRIDE;
+ virtual void ThreadMain() override;
private:
const std::string name_prefix_;
diff --git a/base/threading/worker_pool_posix_unittest.cc b/base/threading/worker_pool_posix_unittest.cc
index 862ffdd..b694155 100644
--- a/base/threading/worker_pool_posix_unittest.cc
+++ b/base/threading/worker_pool_posix_unittest.cc
@@ -97,11 +97,11 @@
num_waiting_to_start_cv_(&num_waiting_to_start_lock_),
start_(true, false) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
peer_.set_num_idle_threads_cv(new ConditionVariable(peer_.lock()));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Wake up the idle threads so they can terminate.
if (pool_.get()) pool_->Terminate();
}
diff --git a/base/time/default_clock.h b/base/time/default_clock.h
index 2022d5c..98bca1a 100644
--- a/base/time/default_clock.h
+++ b/base/time/default_clock.h
@@ -17,7 +17,7 @@
virtual ~DefaultClock();
// Simply returns Time::Now().
- virtual Time Now() OVERRIDE;
+ virtual Time Now() override;
};
} // namespace base
diff --git a/base/time/default_tick_clock.h b/base/time/default_tick_clock.h
index 553a8d2..b3d5a31 100644
--- a/base/time/default_tick_clock.h
+++ b/base/time/default_tick_clock.h
@@ -17,7 +17,7 @@
virtual ~DefaultTickClock();
// Simply returns TimeTicks::Now().
- virtual TimeTicks NowTicks() OVERRIDE;
+ virtual TimeTicks NowTicks() override;
};
} // namespace base
diff --git a/base/time/pr_time_unittest.cc b/base/time/pr_time_unittest.cc
index 105b8e4..2853e964 100644
--- a/base/time/pr_time_unittest.cc
+++ b/base/time/pr_time_unittest.cc
@@ -25,7 +25,7 @@
// tested by comparing them to a known time in the local zone.
class PRTimeTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Use mktime to get a time_t, and turn it into a PRTime by converting
// seconds to microseconds. Use 15th Oct 2007 12:45:00 local. This
// must be a time guaranteed to be outside of a DST fallback hour in
diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc
index 63c3a1a..d8f1e5e 100644
--- a/base/time/time_unittest.cc
+++ b/base/time/time_unittest.cc
@@ -22,7 +22,7 @@
// See also pr_time_unittests.cc
class TimeTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Use mktime to get a time_t, and turn it into a PRTime by converting
// seconds to microseconds. Use 15th Oct 2007 12:45:00 local. This
// must be a time guaranteed to be outside of a DST fallback hour in
diff --git a/base/timer/hi_res_timer_manager.h b/base/timer/hi_res_timer_manager.h
index 7fcdb0d..bfe1f4d 100644
--- a/base/timer/hi_res_timer_manager.h
+++ b/base/timer/hi_res_timer_manager.h
@@ -19,7 +19,7 @@
virtual ~HighResolutionTimerManager();
// base::PowerObserver method.
- virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE;
+ virtual void OnPowerStateChange(bool on_battery_power) override;
// Returns true if the hi resolution clock could be used right now.
bool hi_res_clock_available() const { return hi_res_clock_available_; }
diff --git a/base/timer/mock_timer.h b/base/timer/mock_timer.h
index 456cb5b..c4aa92e 100644
--- a/base/timer/mock_timer.h
+++ b/base/timer/mock_timer.h
@@ -19,13 +19,13 @@
virtual ~MockTimer();
// base::Timer implementation.
- virtual bool IsRunning() const OVERRIDE;
- virtual base::TimeDelta GetCurrentDelay() const OVERRIDE;
+ virtual bool IsRunning() const override;
+ virtual base::TimeDelta GetCurrentDelay() const override;
virtual void Start(const tracked_objects::Location& posted_from,
base::TimeDelta delay,
- const base::Closure& user_task) OVERRIDE;
- virtual void Stop() OVERRIDE;
- virtual void Reset() OVERRIDE;
+ const base::Closure& user_task) override;
+ virtual void Stop() override;
+ virtual void Reset() override;
// Testing methods.
void Fire();
diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc
index 00eecb4..d61d1c2 100644
--- a/base/tools_sanity_unittest.cc
+++ b/base/tools_sanity_unittest.cc
@@ -239,7 +239,7 @@
public:
explicit TOOLS_SANITY_TEST_CONCURRENT_THREAD(bool *value) : value_(value) {}
virtual ~TOOLS_SANITY_TEST_CONCURRENT_THREAD() {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
*value_ = true;
// Sleep for a few milliseconds so the two threads are more likely to live
@@ -255,7 +255,7 @@
public:
explicit ReleaseStoreThread(base::subtle::Atomic32 *value) : value_(value) {}
virtual ~ReleaseStoreThread() {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
base::subtle::Release_Store(value_, kMagicValue);
// Sleep for a few milliseconds so the two threads are more likely to live
@@ -271,7 +271,7 @@
public:
explicit AcquireLoadThread(base::subtle::Atomic32 *value) : value_(value) {}
virtual ~AcquireLoadThread() {}
- virtual void ThreadMain() OVERRIDE {
+ virtual void ThreadMain() override {
// Wait for the other thread to make Release_Store
PlatformThread::Sleep(TimeDelta::FromMilliseconds(100));
base::subtle::Acquire_Load(value_);
diff --git a/base/values.h b/base/values.h
index d5e6313..68dd9c8 100644
--- a/base/values.h
+++ b/base/values.h
@@ -124,13 +124,13 @@
virtual ~FundamentalValue();
// Overridden from Value:
- virtual bool GetAsBoolean(bool* out_value) const OVERRIDE;
- virtual bool GetAsInteger(int* out_value) const OVERRIDE;
+ virtual bool GetAsBoolean(bool* out_value) const override;
+ virtual bool GetAsInteger(int* out_value) const override;
// Values of both type TYPE_INTEGER and TYPE_DOUBLE can be obtained as
// doubles.
- virtual bool GetAsDouble(double* out_value) const OVERRIDE;
- virtual FundamentalValue* DeepCopy() const OVERRIDE;
- virtual bool Equals(const Value* other) const OVERRIDE;
+ virtual bool GetAsDouble(double* out_value) const override;
+ virtual FundamentalValue* DeepCopy() const override;
+ virtual bool Equals(const Value* other) const override;
private:
union {
@@ -155,11 +155,11 @@
const std::string& GetString() const;
// Overridden from Value:
- virtual bool GetAsString(std::string* out_value) const OVERRIDE;
- virtual bool GetAsString(string16* out_value) const OVERRIDE;
- virtual bool GetAsString(const StringValue** out_value) const OVERRIDE;
- virtual StringValue* DeepCopy() const OVERRIDE;
- virtual bool Equals(const Value* other) const OVERRIDE;
+ virtual bool GetAsString(std::string* out_value) const override;
+ virtual bool GetAsString(string16* out_value) const override;
+ virtual bool GetAsString(const StringValue** out_value) const override;
+ virtual StringValue* DeepCopy() const override;
+ virtual bool Equals(const Value* other) const override;
private:
std::string value_;
@@ -188,8 +188,8 @@
const char* GetBuffer() const { return buffer_.get(); }
// Overridden from Value:
- virtual BinaryValue* DeepCopy() const OVERRIDE;
- virtual bool Equals(const Value* other) const OVERRIDE;
+ virtual BinaryValue* DeepCopy() const override;
+ virtual bool Equals(const Value* other) const override;
private:
scoped_ptr<char[]> buffer_;
@@ -207,9 +207,9 @@
virtual ~DictionaryValue();
// Overridden from Value:
- virtual bool GetAsDictionary(DictionaryValue** out_value) OVERRIDE;
+ virtual bool GetAsDictionary(DictionaryValue** out_value) override;
virtual bool GetAsDictionary(
- const DictionaryValue** out_value) const OVERRIDE;
+ const DictionaryValue** out_value) const override;
// Returns true if the current dictionary has a value for the given key.
bool HasKey(const std::string& key) const;
@@ -362,8 +362,8 @@
};
// Overridden from Value:
- virtual DictionaryValue* DeepCopy() const OVERRIDE;
- virtual bool Equals(const Value* other) const OVERRIDE;
+ virtual DictionaryValue* DeepCopy() const override;
+ virtual bool Equals(const Value* other) const override;
private:
ValueMap dictionary_;
@@ -476,10 +476,10 @@
const_iterator end() const { return list_.end(); }
// Overridden from Value:
- virtual bool GetAsList(ListValue** out_value) OVERRIDE;
- virtual bool GetAsList(const ListValue** out_value) const OVERRIDE;
- virtual ListValue* DeepCopy() const OVERRIDE;
- virtual bool Equals(const Value* other) const OVERRIDE;
+ virtual bool GetAsList(ListValue** out_value) override;
+ virtual bool GetAsList(const ListValue** out_value) const override;
+ virtual ListValue* DeepCopy() const override;
+ virtual bool Equals(const Value* other) const override;
private:
ValueVector list_;
diff --git a/base/win/enum_variant.h b/base/win/enum_variant.h
index 82f8750..030f7fd 100644
--- a/base/win/enum_variant.h
+++ b/base/win/enum_variant.h
@@ -26,9 +26,9 @@
VARIANT* ItemAt(unsigned long index);
// IUnknown.
- ULONG STDMETHODCALLTYPE AddRef() OVERRIDE;
- ULONG STDMETHODCALLTYPE Release() OVERRIDE;
- STDMETHODIMP QueryInterface(REFIID riid, void** ppv) OVERRIDE;
+ ULONG STDMETHODCALLTYPE AddRef() override;
+ ULONG STDMETHODCALLTYPE Release() override;
+ STDMETHODIMP QueryInterface(REFIID riid, void** ppv) override;
// IEnumVARIANT.
STDMETHODIMP Next(ULONG requested_count,
diff --git a/base/win/iunknown_impl.h b/base/win/iunknown_impl.h
index ff7e870..4283d02 100644
--- a/base/win/iunknown_impl.h
+++ b/base/win/iunknown_impl.h
@@ -19,11 +19,11 @@
public:
IUnknownImpl();
- virtual ULONG STDMETHODCALLTYPE AddRef() OVERRIDE;
- virtual ULONG STDMETHODCALLTYPE Release() OVERRIDE;
+ virtual ULONG STDMETHODCALLTYPE AddRef() override;
+ virtual ULONG STDMETHODCALLTYPE Release() override;
// Subclasses should extend this to return any interfaces they provide.
- virtual STDMETHODIMP QueryInterface(REFIID riid, void** ppv) OVERRIDE;
+ virtual STDMETHODIMP QueryInterface(REFIID riid, void** ppv) override;
protected:
virtual ~IUnknownImpl();
diff --git a/base/win/registry_unittest.cc b/base/win/registry_unittest.cc
index 84074b3..d2610ef 100644
--- a/base/win/registry_unittest.cc
+++ b/base/win/registry_unittest.cc
@@ -28,7 +28,7 @@
#endif // _WIN64
RegistryTest() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Create a temporary key.
RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
key.DeleteKey(kRootKey);
@@ -39,7 +39,7 @@
foo_software_key_ += L"\\Foo";
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Clean up the temporary key.
RegKey key(HKEY_CURRENT_USER, L"", KEY_SET_VALUE);
ASSERT_EQ(ERROR_SUCCESS, key.DeleteKey(kRootKey));
diff --git a/base/win/shortcut_unittest.cc b/base/win/shortcut_unittest.cc
index 53fbd34..4bb227a 100644
--- a/base/win/shortcut_unittest.cc
+++ b/base/win/shortcut_unittest.cc
@@ -25,7 +25,7 @@
class ShortcutTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
ASSERT_TRUE(temp_dir_2_.CreateUniqueTempDir());
diff --git a/build/all.gyp b/build/all.gyp
index 2dbd4fb..dad0538 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -42,18 +42,18 @@
# NOTE: This list of targets is present because
# mojo_base.gyp:mojo_base cannot be built on iOS, as
# javascript-related targets cause v8 to be built.
+ '../mojo/edk/mojo_edk.gyp:mojo_public_bindings_unittests',
+ '../mojo/edk/mojo_edk.gyp:mojo_public_environment_unittests',
+ '../mojo/edk/mojo_edk.gyp:mojo_public_system_perftests',
+ '../mojo/edk/mojo_edk.gyp:mojo_public_system_unittests',
+ '../mojo/edk/mojo_edk.gyp:mojo_public_utility_unittests',
+ '../mojo/edk/mojo_edk.gyp:mojo_system_impl',
+ '../mojo/edk/mojo_edk.gyp:mojo_system_unittests',
'../mojo/mojo_base.gyp:mojo_common_lib',
'../mojo/mojo_base.gyp:mojo_common_unittests',
- '../mojo/mojo_base.gyp:mojo_cpp_bindings',
- '../mojo/mojo_base.gyp:mojo_public_bindings_unittests',
- '../mojo/mojo_base.gyp:mojo_public_environment_unittests',
- '../mojo/mojo_base.gyp:mojo_public_system_perftests',
- '../mojo/mojo_base.gyp:mojo_public_system_unittests',
- '../mojo/mojo_base.gyp:mojo_public_test_utils',
- '../mojo/mojo_base.gyp:mojo_public_utility_unittests',
- '../mojo/mojo_base.gyp:mojo_system',
- '../mojo/mojo_base.gyp:mojo_system_impl',
- '../mojo/mojo_base.gyp:mojo_system_unittests',
+ '../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
+ '../mojo/public/mojo_public.gyp:mojo_public_test_utils',
+ '../mojo/public/mojo_public.gyp:mojo_system',
'../google_apis/google_apis.gyp:google_apis_unittests',
'../ui/base/ui_base_tests.gyp:ui_base_unittests',
'../ui/base/ui_base_tests.gyp:ui_unittests',
diff --git a/build/android/gyp/pack_arm_relocations.py b/build/android/gyp/pack_arm_relocations.py
index d650927..de131d2 100755
--- a/build/android/gyp/pack_arm_relocations.py
+++ b/build/android/gyp/pack_arm_relocations.py
@@ -7,10 +7,10 @@
"""Pack ARM relative relocations in a library (or copy unchanged).
If --enable-packing and --configuration-name=='Release', invoke the
-relocation_packer tool to pack the .rel.dyn section in the given library
-files. This step is inserted after the libraries are stripped. Packing
-adds a new .android.rel.dyn section to the file and reduces the size of
-.rel.dyn accordingly.
+relocation_packer tool to pack the .rel.dyn or .rela.dyn section in the given
+library files. This step is inserted after the libraries are stripped.
+Packing adds a new .android.rel.dyn or .android.rela.dyn section to the file
+and reduces the size of .rel.dyn or .rela.dyn accordingly.
Currently packing only understands ARM32 shared libraries. For all other
architectures --enable-packing should be set to zero. In this case the
@@ -32,17 +32,24 @@
def PackArmLibraryRelocations(android_pack_relocations,
android_objcopy,
+ has_relocations_with_addends,
library_path,
output_path):
if not build_utils.IsTimeStale(output_path, [library_path]):
return
- # Copy and add a 'NULL' .android.rel.dyn section for the packing tool.
+ # Select an appropriate name for the section we add.
+ if has_relocations_with_addends:
+ new_section = '.android.rela.dyn'
+ else:
+ new_section = '.android.rel.dyn'
+
+ # Copy and add a 'NULL' packed relocations section for the packing tool.
with tempfile.NamedTemporaryFile() as stream:
stream.write('NULL')
stream.flush()
objcopy_command = [android_objcopy,
- '--add-section', '.android.rel.dyn=%s' % stream.name,
+ '--add-section', '%s=%s' % (new_section, stream.name),
library_path, output_path]
build_utils.CheckOutput(objcopy_command)
@@ -69,6 +76,9 @@
choices=['0', '1'],
help=('Pack relocations if 1 and configuration name is \'Release\','
' otherwise plain file copy'))
+ parser.add_option('--has-relocations-with-addends',
+ choices=['0', '1'],
+ help=('Pack into \'.android.rela.dyn\' if 1, else \'.android.rel.dyn\''))
parser.add_option('--exclude-packing-list',
default='',
help='Names of any libraries explicitly not packed')
@@ -87,6 +97,7 @@
options, _ = parser.parse_args(args)
enable_packing = (options.enable_packing == '1' and
options.configuration_name == 'Release')
+ has_relocations_with_addends = (options.has_relocations_with_addends == '1')
exclude_packing_set = set(shlex.split(options.exclude_packing_list))
libraries = build_utils.ParseGypList(options.libraries)
@@ -100,6 +111,7 @@
if enable_packing and library not in exclude_packing_set:
PackArmLibraryRelocations(options.android_pack_relocations,
options.android_objcopy,
+ has_relocations_with_addends,
library_path,
output_path)
else:
diff --git a/build/android/pack_arm_relocations.gypi b/build/android/pack_arm_relocations.gypi
index e982527..5df1d7e 100644
--- a/build/android/pack_arm_relocations.gypi
+++ b/build/android/pack_arm_relocations.gypi
@@ -25,6 +25,13 @@
{
'variables': {
'input_paths': [],
+ 'conditions': [
+ ['target_arch == "arm64"', {
+ 'has_relocations_with_addends': 1,
+ }, {
+ 'has_relocations_with_addends': 0,
+ }],
+ ],
},
'inputs': [
'<(DEPTH)/build/android/gyp/util/build_utils.py',
@@ -48,6 +55,7 @@
'python', '<(DEPTH)/build/android/gyp/pack_arm_relocations.py',
'--configuration-name=<(CONFIGURATION_NAME)',
'--enable-packing=1',
+ '--has-relocations-with-addends=<(has_relocations_with_addends)',
'--exclude-packing-list=<@(exclude_packing_list)',
'--android-pack-relocations=<(PRODUCT_DIR)/relocation_packer',
'--android-objcopy=<(android_objcopy)',
diff --git a/build/common.gypi b/build/common.gypi
index 163abae..132fd7c 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1470,11 +1470,6 @@
'ozone_platform_ozonex%': 0,
'ozone_platform_test%': 0,
- # Chrome OS: whether to build ChromeVox from sources in the Chromium
- # repository rather than using precompiled JavaScript in
- # chrome/third_party/chromevox. This is still experimental.
- 'use_migrated_chromevox%': 1,
-
'conditions': [
# Enable the Syzygy optimization step for the official builds.
['OS=="win" and buildtype=="Official" and syzyasan!=1', {
diff --git a/build/install-chroot.sh b/build/install-chroot.sh
index c060f60..2b523cb 100755
--- a/build/install-chroot.sh
+++ b/build/install-chroot.sh
@@ -639,7 +639,7 @@
# Install a few more commonly used packages
sudo "/usr/local/bin/${target%bit}" apt-get -y install \
autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool \
- strace
+ lsof strace
# If running a 32bit environment on a 64bit machine, install a few binaries
# as 64bit. This is only done automatically if the chroot distro is the same as
diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt
index 354cb50..440f259 100644
--- a/build/ios/grit_whitelist.txt
+++ b/build/ios/grit_whitelist.txt
@@ -478,6 +478,8 @@
IDS_FLAGS_ENABLE_SIMPLE_CACHE_BACKEND_NAME
IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_DESCRIPTION
IDS_FLAGS_ENABLE_SMOOTH_SCROLLING_NAME
+IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_DESCRIPTION
+IDS_FLAGS_ENABLE_STALE_WHILE_REVALIDATE_NAME
IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_DESCRIPTION
IDS_FLAGS_ENABLE_SUGGESTIONS_SERVICE_NAME
IDS_FLAGS_ENABLE_SYNCED_NOTIFICATIONS_DESCRIPTION
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index 1b90a1b..52f4ab5 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -220,9 +220,23 @@
}],
['native_lib_target != ""', {
'variables': {
+ 'conditions': [
+ ['use_chromium_linker == 1', {
+ 'variables': {
+ 'chromium_linker_path': [
+ '<(SHARED_LIB_DIR)/<(libchromium_android_linker)',
+ ],
+ }
+ }, {
+ 'variables': {
+ 'chromium_linker_path': [],
+ },
+ }],
+ ],
'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
'native_libs_paths': [
- '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'
+ '<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)',
+ '<@(chromium_linker_path)'
],
'package_input_paths': [
'<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
@@ -242,23 +256,9 @@
'actions': [
{
'variables': {
- 'conditions': [
- ['use_chromium_linker == 1', {
- 'variables': {
- 'linker_input_libraries': [
- '<(SHARED_LIB_DIR)/<(libchromium_android_linker)',
- ],
- }
- }, {
- 'variables': {
- 'linker_input_libraries': [],
- },
- }],
- ],
'input_libraries': [
'<@(native_libs_paths)',
'<@(extra_native_libs)',
- '<@(linker_input_libraries)',
],
},
'includes': ['../build/android/write_ordered_libraries.gypi'],
diff --git a/build/landmines.py b/build/landmines.py
index 96bc485..a034864 100755
--- a/build/landmines.py
+++ b/build/landmines.py
@@ -15,6 +15,7 @@
import difflib
import errno
+import gyp_environment
import logging
import optparse
import os
@@ -120,6 +121,7 @@
if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'):
return 0
+ gyp_environment.SetEnvironment()
landmines = []
for s in landmine_scripts:
diff --git a/build/secondary/third_party/openmax_dl/dl/BUILD.gn b/build/secondary/third_party/openmax_dl/dl/BUILD.gn
index 067be17..158e3f8 100644
--- a/build/secondary/third_party/openmax_dl/dl/BUILD.gn
+++ b/build/secondary/third_party/openmax_dl/dl/BUILD.gn
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/arm.gni")
+
declare_args() {
# Override this value to build with small float FFT tables
openmax_big_float_fft = true
@@ -9,6 +11,19 @@
config("dl_config") {
include_dirs = [ ".." ]
+ if (cpu_arch == "arm") {
+ if (arm_use_neon) {
+ # Enable build-time NEON selection.
+ defines = [ "DL_ARM_NEON" ]
+ } else if (is_android) {
+ # Enable run-time NEON selection.
+ defines = [ "DL_ARM_NEON_OPTIONAL" ]
+ }
+ }
+ else if (cpu_arch == "arm64") {
+ # Enable build-time NEON selection.
+ defines = [ "DL_ARM_NEON" ]
+ }
}
# GYP: third_party/openmax_dl/dl/dl.gyp:openmax_dl
@@ -47,73 +62,76 @@
}
if (cpu_arch == "arm") {
+ if (arm_use_neon || is_android) {
+ deps += [
+ ":openmax_dl_armv7"
+ ]
+ }
configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
cflags += [
"-mfpu=neon"
]
- deps += [
- ":openmax_dl_armv7"
- ]
+ if (arm_use_neon || is_android) {
+ sources += [
+ # Common files that are used by both the NEON and non-NEON code.
+ "api/armCOMM_s.h",
+ "sp/src/arm/omxSP_FFTGetBufSize_C_SC16.c",
+ "sp/src/arm/omxSP_FFTGetBufSize_R_S16.c",
+ "sp/src/arm/omxSP_FFTGetBufSize_R_S16S32.c",
+ "sp/src/arm/omxSP_FFTInit_C_SC16.c",
+ "sp/src/arm/omxSP_FFTInit_C_SC32.c",
+ "sp/src/arm/omxSP_FFTInit_R_S16.c",
+ "sp/src/arm/omxSP_FFTInit_R_S16S32.c",
+ "sp/src/arm/omxSP_FFTInit_R_S32.c",
- sources += [
- # Common files that are used by both the NEON and non-NEON code.
- "api/armCOMM_s.h",
- "sp/src/arm/omxSP_FFTGetBufSize_C_SC16.c",
- "sp/src/arm/omxSP_FFTGetBufSize_R_S16.c",
- "sp/src/arm/omxSP_FFTGetBufSize_R_S16S32.c",
- "sp/src/arm/omxSP_FFTInit_C_SC16.c",
- "sp/src/arm/omxSP_FFTInit_C_SC32.c",
- "sp/src/arm/omxSP_FFTInit_R_S16.c",
- "sp/src/arm/omxSP_FFTInit_R_S16S32.c",
- "sp/src/arm/omxSP_FFTInit_R_S32.c",
-
- # Complex 32-bit fixed-point FFT.
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_fs_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_ls_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S",
- "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S",
- # Real 32-bit fixed-point FFT
- "sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S",
- "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S",
- # Complex 16-bit fixed-point FFT
- "sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ls_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_fs_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_ls_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S",
- "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S",
- # Real 16-bit fixed-point FFT
- "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S",
- # Complex floating-point FFT
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_ls_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S",
- "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S",
- "sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S",
- # Real floating-point FFT
- "sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S",
- "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
- "sp/src/arm/neon/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
- ]
+ # Complex 32-bit fixed-point FFT.
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_fs_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_ls_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix2_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_fs_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_ls_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix4_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC32_Radix8_fs_unsafe_s.S",
+ "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC32_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CToC_SC32_Sfs_s.S",
+ # Real 32-bit fixed-point FFT
+ "sp/src/arm/neon/armSP_FFTInv_CCSToR_S32_preTwiddleRadix2_unsafe_s.S",
+ "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S32_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32_Sfs_s.S",
+ # Complex 16-bit fixed-point FFT
+ "sp/src/arm/neon/armSP_FFTInv_CCSToR_S16_preTwiddleRadix2_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_fs_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ls_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_ps_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix2_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_fs_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_ls_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix4_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_SC16_Radix8_fs_unsafe_s.S",
+ "sp/src/arm/neon/omxSP_FFTFwd_CToC_SC16_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CToC_SC16_Sfs_s.S",
+ # Real 16-bit fixed-point FFT
+ "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S16_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_S16S32_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CCSToR_S32S16_Sfs_s.S",
+ # Complex floating-point FFT
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_ls_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix2_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_ls_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix4_unsafe_s.S",
+ "sp/src/arm/neon/armSP_FFT_CToC_FC32_Radix8_fs_unsafe_s.S",
+ "sp/src/arm/neon/omxSP_FFTFwd_CToC_FC32_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CToC_FC32_Sfs_s.S",
+ # Real floating-point FFT
+ "sp/src/arm/neon/armSP_FFTInv_CCSToR_F32_preTwiddleRadix2_unsafe_s.S",
+ "sp/src/arm/neon/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
+ "sp/src/arm/neon/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
+ ]
+ }
}
if (cpu_arch == "ia32" || cpu_arch == "x64") {
@@ -203,7 +221,6 @@
# standalone. Applications must link with openmax_dl.
source_set("openmax_dl_armv7") {
configs += [ ":dl_config" ]
- deps = [ "//third_party/android_tools:cpu_features" ]
visibility = [ ":*" ]
#TODO(GYP):
@@ -211,11 +228,7 @@
#'-mfpu=neon',
#],
- libs = [ "log" ]
-
sources = [
- # Detection routine
- "sp/src/arm/detect.c",
# Complex floating-point FFT
"sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix2_fs_unsafe_s.S",
"sp/src/arm/armv7/armSP_FFT_CToC_FC32_Radix4_fs_unsafe_s.S",
@@ -228,5 +241,12 @@
"sp/src/arm/armv7/omxSP_FFTFwd_RToCCS_F32_Sfs_s.S",
"sp/src/arm/armv7/omxSP_FFTInv_CCSToR_F32_Sfs_s.S",
]
+ if (is_android) {
+ # We only do run-time NEON detection on Android.
+ deps = [ "//third_party/android_tools:cpu_features" ]
+ libs = [ "log" ]
+ # Detection routine
+ sources += [ "sp/src/arm/detect.c" ]
+ }
}
}
diff --git a/build/whitespace_file.txt b/build/whitespace_file.txt
index 2d17f0e..3dc66ec 100644
--- a/build/whitespace_file.txt
+++ b/build/whitespace_file.txt
@@ -143,4 +143,4 @@
Cool whitespace change for git-cl land
Oh god the bots are red! I'm blind! Mmmm, donuts.
-*
+**
diff --git a/build/win/compatibility.manifest b/build/win/compatibility.manifest
index f7bc13e..10d10da 100644
--- a/build/win/compatibility.manifest
+++ b/build/win/compatibility.manifest
@@ -10,6 +10,8 @@
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <!--The ID below indicates application support for Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index 5009d58..c43eb3a 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -208,6 +208,13 @@
"layers/ui_resource_layer.h",
"layers/ui_resource_layer_impl.cc",
"layers/ui_resource_layer_impl.h",
+ "layers/video_frame_provider.h",
+ "layers/video_frame_provider_client_impl.cc",
+ "layers/video_frame_provider_client_impl.h",
+ "layers/video_layer.cc",
+ "layers/video_layer.h",
+ "layers/video_layer_impl.cc",
+ "layers/video_layer_impl.h",
"output/begin_frame_args.cc",
"output/begin_frame_args.h",
"output/bsp_tree.cc",
@@ -420,6 +427,8 @@
"resources/ui_resource_client.h",
"resources/ui_resource_request.cc",
"resources/ui_resource_request.h",
+ "resources/video_resource_updater.cc",
+ "resources/video_resource_updater.h",
"resources/zero_copy_raster_worker_pool.cc",
"resources/zero_copy_raster_worker_pool.h",
"scheduler/begin_frame_source.cc",
@@ -480,6 +489,7 @@
"//base/third_party/dynamic_annotations",
"//gpu",
"//gpu/command_buffer/client:gles2_interface",
+ "//media",
"//ui/events:events_base",
"//ui/gfx",
"//ui/gfx/geometry",
@@ -548,6 +558,8 @@
"test/fake_tile_manager_client.h",
"test/fake_ui_resource_layer_tree_host_impl.cc",
"test/fake_ui_resource_layer_tree_host_impl.h",
+ "test/fake_video_frame_provider.cc",
+ "test/fake_video_frame_provider.h",
"test/geometry_test_utils.cc",
"test/geometry_test_utils.h",
"test/test_in_process_context_provider.cc",
@@ -692,6 +704,7 @@
"layers/tiled_layer_unittest.cc",
"layers/ui_resource_layer_impl_unittest.cc",
"layers/ui_resource_layer_unittest.cc",
+ "layers/video_layer_impl_unittest.cc",
"output/begin_frame_args_unittest.cc",
"output/delegating_renderer_unittest.cc",
"output/filter_operations_unittest.cc",
@@ -722,6 +735,7 @@
"resources/texture_uploader_unittest.cc",
"resources/tile_manager_unittest.cc",
"resources/tile_priority_unittest.cc",
+ "resources/video_resource_updater_unittest.cc",
"scheduler/begin_frame_source_unittest.cc",
"scheduler/delay_based_time_source_unittest.cc",
"scheduler/scheduler_state_machine_unittest.cc",
@@ -749,8 +763,10 @@
"trees/layer_tree_host_unittest_picture.cc",
"trees/layer_tree_host_unittest_proxy.cc",
"trees/layer_tree_host_unittest_scroll.cc",
+ "trees/layer_tree_host_unittest_video.cc",
"trees/layer_tree_impl_unittest.cc",
"trees/occlusion_tracker_unittest.cc",
+ "trees/occlusion_unittest.cc",
"trees/tree_synchronizer_unittest.cc",
# Surfaces test files.
@@ -774,6 +790,7 @@
"//gpu:test_support",
"//gpu/command_buffer/client:gles2_interface",
"//gpu/command_buffer/common:gles2_utils",
+ "//media",
"//testing/gmock",
"//testing/gtest",
"//ui/events:events_base",
@@ -805,6 +822,7 @@
"//gpu",
"//gpu:test_support",
"//gpu/command_buffer/common:gles2_utils",
+ "//media",
"//skia",
"//testing/gmock",
"//testing/gtest",
diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py
index f381684..d749aac 100644
--- a/cc/PRESUBMIT.py
+++ b/cc/PRESUBMIT.py
@@ -313,6 +313,42 @@
else:
return []
+def CheckOverrideFinal(input_api, output_api,
+ whitelist=CC_SOURCE_FILES, blacklist=None):
+ """Make sure new lines of code don't use the OVERRIDE or FINAL macros."""
+
+ # TODO(mostynb): remove this check once the macros are removed
+ # from base/compiler_specific.h.
+
+ errors = []
+
+ source_file_filter = lambda x: input_api.FilterSourceFile(
+ x, white_list=CC_SOURCE_FILES, black_list=None)
+
+ override_files = []
+ final_files = []
+
+ for f in input_api.AffectedSourceFiles(source_file_filter):
+ contents = input_api.ReadFile(f, 'rb')
+
+ # "override" and "final" should be used instead of OVERRIDE/FINAL now.
+ if re.search(r"\bOVERRIDE\b", contents):
+ override_files.append(f.LocalPath())
+
+ if re.search(r"\bFINAL\b", contents):
+ final_files.append(f.LocalPath())
+
+ if override_files:
+ return [output_api.PresubmitError(
+ 'These files use OVERRIDE instead of using override:',
+ items=override_files)]
+ if final_files:
+ return [output_api.PresubmitError(
+ 'These files use FINAL instead of using final:',
+ items=final_files)]
+
+ return []
+
def CheckChangeOnUpload(input_api, output_api):
results = []
results += CheckAsserts(input_api, output_api)
@@ -324,6 +360,7 @@
results += CheckNamespace(input_api, output_api)
results += CheckForUseOfWrongClock(input_api, output_api)
results += FindUselessIfdefs(input_api, output_api)
+ results += CheckOverrideFinal(input_api, output_api)
results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
return results
diff --git a/cc/animation/animation_curve.h b/cc/animation/animation_curve.h
index 72aadef..ca53e44 100644
--- a/cc/animation/animation_curve.h
+++ b/cc/animation/animation_curve.h
@@ -50,7 +50,7 @@
virtual SkColor GetValue(double t) const = 0;
// Partial Animation implementation.
- virtual CurveType Type() const OVERRIDE;
+ virtual CurveType Type() const override;
};
class CC_EXPORT FloatAnimationCurve : public AnimationCurve {
@@ -60,7 +60,7 @@
virtual float GetValue(double t) const = 0;
// Partial Animation implementation.
- virtual CurveType Type() const OVERRIDE;
+ virtual CurveType Type() const override;
};
class CC_EXPORT TransformAnimationCurve : public AnimationCurve {
@@ -86,7 +86,7 @@
virtual bool MaximumScale(float* max_scale) const = 0;
// Partial Animation implementation.
- virtual CurveType Type() const OVERRIDE;
+ virtual CurveType Type() const override;
};
class CC_EXPORT FilterAnimationCurve : public AnimationCurve {
@@ -97,7 +97,7 @@
virtual bool HasFilterThatMovesPixels() const = 0;
// Partial Animation implementation.
- virtual CurveType Type() const OVERRIDE;
+ virtual CurveType Type() const override;
};
} // namespace cc
diff --git a/cc/animation/keyframed_animation_curve.h b/cc/animation/keyframed_animation_curve.h
index 2fb1888..d596256 100644
--- a/cc/animation/keyframed_animation_curve.h
+++ b/cc/animation/keyframed_animation_curve.h
@@ -126,11 +126,11 @@
}
// AnimationCurve implementation
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
// BackgrounColorAnimationCurve implementation
- virtual SkColor GetValue(double t) const OVERRIDE;
+ virtual SkColor GetValue(double t) const override;
private:
KeyframedColorAnimationCurve();
@@ -156,11 +156,11 @@
}
// AnimationCurve implementation
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
// FloatAnimationCurve implementation
- virtual float GetValue(double t) const OVERRIDE;
+ virtual float GetValue(double t) const override;
private:
KeyframedFloatAnimationCurve();
@@ -187,16 +187,16 @@
}
// AnimationCurve implementation
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
// TransformAnimationCurve implementation
- virtual gfx::Transform GetValue(double t) const OVERRIDE;
+ virtual gfx::Transform GetValue(double t) const override;
virtual bool AnimatedBoundsForBox(const gfx::BoxF& box,
- gfx::BoxF* bounds) const OVERRIDE;
- virtual bool AffectsScale() const OVERRIDE;
- virtual bool IsTranslation() const OVERRIDE;
- virtual bool MaximumScale(float* max_scale) const OVERRIDE;
+ gfx::BoxF* bounds) const override;
+ virtual bool AffectsScale() const override;
+ virtual bool IsTranslation() const override;
+ virtual bool MaximumScale(float* max_scale) const override;
private:
KeyframedTransformAnimationCurve();
@@ -223,12 +223,12 @@
}
// AnimationCurve implementation
- virtual double Duration() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual double Duration() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
// FilterAnimationCurve implementation
- virtual FilterOperations GetValue(double t) const OVERRIDE;
- virtual bool HasFilterThatMovesPixels() const OVERRIDE;
+ virtual FilterOperations GetValue(double t) const override;
+ virtual bool HasFilterThatMovesPixels() const override;
private:
KeyframedFilterAnimationCurve();
diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc
index d32751b..de21762 100644
--- a/cc/animation/layer_animation_controller_unittest.cc
+++ b/cc/animation/layer_animation_controller_unittest.cc
@@ -867,13 +867,13 @@
virtual void NotifyAnimationStarted(
TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
started_ = true;
}
virtual void NotifyAnimationFinished(
TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
finished_ = true;
}
diff --git a/cc/animation/scroll_offset_animation_curve.h b/cc/animation/scroll_offset_animation_curve.h
index 452da27..197a431 100644
--- a/cc/animation/scroll_offset_animation_curve.h
+++ b/cc/animation/scroll_offset_animation_curve.h
@@ -29,9 +29,9 @@
void UpdateTarget(double t, const gfx::ScrollOffset& new_target);
// AnimationCurve implementation
- virtual double Duration() const OVERRIDE;
- virtual CurveType Type() const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual double Duration() const override;
+ virtual CurveType Type() const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
private:
ScrollOffsetAnimationCurve(const gfx::ScrollOffset& target_value,
diff --git a/cc/animation/scrollbar_animation_controller.cc b/cc/animation/scrollbar_animation_controller.cc
index 910a7d8..ffb2287 100644
--- a/cc/animation/scrollbar_animation_controller.cc
+++ b/cc/animation/scrollbar_animation_controller.cc
@@ -13,9 +13,11 @@
ScrollbarAnimationController::ScrollbarAnimationController(
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration)
: client_(client),
delay_before_starting_(delay_before_starting),
+ resize_delay_before_starting_(resize_delay_before_starting),
duration_(duration),
is_animating_(false),
currently_scrolling_(false),
@@ -53,33 +55,34 @@
currently_scrolling_ = true;
}
-void ScrollbarAnimationController::DidScrollUpdate() {
+void ScrollbarAnimationController::DidScrollUpdate(bool on_resize) {
StopAnimation();
delayed_scrollbar_fade_.Cancel();
// As an optimization, we avoid spamming fade delay tasks during active fast
// scrolls. But if we're not within one, we need to post every scroll update.
if (!currently_scrolling_)
- PostDelayedFade();
+ PostDelayedFade(on_resize);
else
scroll_gesture_has_scrolled_ = true;
}
void ScrollbarAnimationController::DidScrollEnd() {
if (scroll_gesture_has_scrolled_) {
- PostDelayedFade();
+ PostDelayedFade(false);
scroll_gesture_has_scrolled_ = false;
}
currently_scrolling_ = false;
}
-void ScrollbarAnimationController::PostDelayedFade() {
+void ScrollbarAnimationController::PostDelayedFade(bool on_resize) {
+ base::TimeDelta delay =
+ on_resize ? resize_delay_before_starting_ : delay_before_starting_;
delayed_scrollbar_fade_.Reset(
base::Bind(&ScrollbarAnimationController::StartAnimation,
weak_factory_.GetWeakPtr()));
- client_->PostDelayedScrollbarFade(delayed_scrollbar_fade_.callback(),
- delay_before_starting_);
+ client_->PostDelayedScrollbarFade(delayed_scrollbar_fade_.callback(), delay);
}
void ScrollbarAnimationController::StartAnimation() {
diff --git a/cc/animation/scrollbar_animation_controller.h b/cc/animation/scrollbar_animation_controller.h
index ad7f631..8c98c9e 100644
--- a/cc/animation/scrollbar_animation_controller.h
+++ b/cc/animation/scrollbar_animation_controller.h
@@ -32,7 +32,7 @@
void Animate(base::TimeTicks now);
virtual void DidScrollBegin();
- virtual void DidScrollUpdate();
+ virtual void DidScrollUpdate(bool on_resize);
virtual void DidScrollEnd();
virtual void DidMouseMoveOffScrollbar() {}
virtual void DidMouseMoveNear(float distance) {}
@@ -40,6 +40,7 @@
protected:
ScrollbarAnimationController(ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);
virtual void RunAnimationFrame(float progress) = 0;
@@ -52,11 +53,12 @@
// 0 to 1.
float AnimationProgressAtTime(base::TimeTicks now);
- void PostDelayedFade();
+ void PostDelayedFade(bool on_resize);
ScrollbarAnimationControllerClient* client_;
base::TimeTicks last_awaken_time_;
base::TimeDelta delay_before_starting_;
+ base::TimeDelta resize_delay_before_starting_;
base::TimeDelta duration_;
bool is_animating_;
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.cc b/cc/animation/scrollbar_animation_controller_linear_fade.cc
index a7b220c..90437b3 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.cc
@@ -15,17 +15,26 @@
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration) {
- return make_scoped_ptr(new ScrollbarAnimationControllerLinearFade(
- scroll_layer, client, delay_before_starting, duration));
+ return make_scoped_ptr(
+ new ScrollbarAnimationControllerLinearFade(scroll_layer,
+ client,
+ delay_before_starting,
+ resize_delay_before_starting,
+ duration));
}
ScrollbarAnimationControllerLinearFade::ScrollbarAnimationControllerLinearFade(
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration)
- : ScrollbarAnimationController(client, delay_before_starting, duration),
+ : ScrollbarAnimationController(client,
+ delay_before_starting,
+ resize_delay_before_starting,
+ duration),
scroll_layer_(scroll_layer) {
}
@@ -38,8 +47,8 @@
StopAnimation();
}
-void ScrollbarAnimationControllerLinearFade::DidScrollUpdate() {
- ScrollbarAnimationController::DidScrollUpdate();
+void ScrollbarAnimationControllerLinearFade::DidScrollUpdate(bool on_resize) {
+ ScrollbarAnimationController::DidScrollUpdate(on_resize);
ApplyOpacityToScrollbars(1.f);
}
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade.h b/cc/animation/scrollbar_animation_controller_linear_fade.h
index 1070049..86524f2 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade.h
+++ b/cc/animation/scrollbar_animation_controller_linear_fade.h
@@ -19,20 +19,22 @@
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);
virtual ~ScrollbarAnimationControllerLinearFade();
- virtual void DidScrollUpdate() OVERRIDE;
+ virtual void DidScrollUpdate(bool on_resize) override;
protected:
ScrollbarAnimationControllerLinearFade(
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);
- virtual void RunAnimationFrame(float progress) OVERRIDE;
+ virtual void RunAnimationFrame(float progress) override;
private:
float OpacityAtTime(base::TimeTicks now) const;
diff --git a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
index e5801d6..99b45b3 100644
--- a/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
+++ b/cc/animation/scrollbar_animation_controller_linear_fade_unittest.cc
@@ -21,10 +21,11 @@
: host_impl_(&proxy_, &shared_bitmap_manager_), needs_frame_count_(0) {}
virtual void PostDelayedScrollbarFade(const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE {
+ base::TimeDelta delay) override {
start_fade_ = start_fade;
+ delay_ = delay;
}
- virtual void SetNeedsScrollbarAnimationFrame() OVERRIDE {
+ virtual void SetNeedsScrollbarAnimationFrame() override {
needs_frame_count_++;
}
@@ -59,6 +60,7 @@
scroll_layer_ptr,
this,
base::TimeDelta::FromSeconds(2),
+ base::TimeDelta::FromSeconds(5),
base::TimeDelta::FromSeconds(3));
}
@@ -70,9 +72,26 @@
scoped_ptr<SolidColorScrollbarLayerImpl> scrollbar_layer_;
base::Closure start_fade_;
+ base::TimeDelta delay_;
int needs_frame_count_;
};
+TEST_F(ScrollbarAnimationControllerLinearFadeTest, DelayAnimationOnResize) {
+ scrollbar_layer_->SetOpacity(0.0f);
+ scrollbar_controller_->DidScrollBegin();
+ scrollbar_controller_->DidScrollUpdate(true);
+ scrollbar_controller_->DidScrollEnd();
+ // Normal Animation delay of 2 seconds.
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+ EXPECT_EQ(delay_, base::TimeDelta::FromSeconds(2));
+
+ scrollbar_layer_->SetOpacity(0.0f);
+ scrollbar_controller_->DidScrollUpdate(true);
+ // Delay animation on resize to 5 seconds.
+ EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
+ EXPECT_EQ(delay_, base::TimeDelta::FromSeconds(5));
+}
+
TEST_F(ScrollbarAnimationControllerLinearFadeTest, HiddenInBegin) {
scrollbar_layer_->SetOpacity(0.0f);
scrollbar_controller_->Animate(base::TimeTicks());
@@ -105,7 +124,7 @@
time += base::TimeDelta::FromSeconds(1);
scrollbar_controller_->DidScrollBegin();
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
EXPECT_TRUE(start_fade_.Equals(base::Closure()));
@@ -131,7 +150,7 @@
time += base::TimeDelta::FromSeconds(1);
scrollbar_controller_->DidScrollBegin();
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
scrollbar_controller_->DidScrollEnd();
start_fade_.Run();
@@ -157,7 +176,7 @@
TEST_F(ScrollbarAnimationControllerLinearFadeTest, AwakenByProgrammaticScroll) {
base::TimeTicks time;
time += base::TimeDelta::FromSeconds(1);
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
scrollbar_controller_->Animate(time);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
@@ -165,7 +184,7 @@
time += base::TimeDelta::FromSeconds(1);
scrollbar_controller_->Animate(time);
EXPECT_FLOAT_EQ(2.0f / 3.0f, scrollbar_layer_->opacity());
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
time += base::TimeDelta::FromSeconds(1);
@@ -181,7 +200,7 @@
EXPECT_FLOAT_EQ(1.0f / 3.0f, scrollbar_layer_->opacity());
time += base::TimeDelta::FromSeconds(1);
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
time += base::TimeDelta::FromSeconds(1);
scrollbar_controller_->Animate(time);
@@ -206,7 +225,7 @@
AnimationPreservedByNonScrollingGesture) {
base::TimeTicks time;
time += base::TimeDelta::FromSeconds(1);
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
scrollbar_controller_->Animate(time);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
@@ -238,7 +257,7 @@
AnimationOverriddenByScrollingGesture) {
base::TimeTicks time;
time += base::TimeDelta::FromSeconds(1);
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
scrollbar_controller_->Animate(time);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
@@ -255,7 +274,7 @@
EXPECT_FLOAT_EQ(1.0f / 3.0f, scrollbar_layer_->opacity());
time += base::TimeDelta::FromSeconds(1);
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
EXPECT_FLOAT_EQ(1, scrollbar_layer_->opacity());
time += base::TimeDelta::FromSeconds(1);
diff --git a/cc/animation/scrollbar_animation_controller_thinning.cc b/cc/animation/scrollbar_animation_controller_thinning.cc
index 892e307..0c05709 100644
--- a/cc/animation/scrollbar_animation_controller_thinning.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning.cc
@@ -21,17 +21,26 @@
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration) {
- return make_scoped_ptr(new ScrollbarAnimationControllerThinning(
- scroll_layer, client, delay_before_starting, duration));
+ return make_scoped_ptr(
+ new ScrollbarAnimationControllerThinning(scroll_layer,
+ client,
+ delay_before_starting,
+ resize_delay_before_starting,
+ duration));
}
ScrollbarAnimationControllerThinning::ScrollbarAnimationControllerThinning(
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration)
- : ScrollbarAnimationController(client, delay_before_starting, duration),
+ : ScrollbarAnimationController(client,
+ delay_before_starting,
+ resize_delay_before_starting,
+ duration),
scroll_layer_(scroll_layer),
mouse_is_over_scrollbar_(false),
mouse_is_near_scrollbar_(false),
@@ -65,8 +74,8 @@
StartAnimation();
}
-void ScrollbarAnimationControllerThinning::DidScrollUpdate() {
- ScrollbarAnimationController::DidScrollUpdate();
+void ScrollbarAnimationControllerThinning::DidScrollUpdate(bool on_resize) {
+ ScrollbarAnimationController::DidScrollUpdate(on_resize);
ApplyOpacityAndThumbThicknessScale(
1, mouse_is_near_scrollbar_ ? 1.f : kIdleThicknessScale);
diff --git a/cc/animation/scrollbar_animation_controller_thinning.h b/cc/animation/scrollbar_animation_controller_thinning.h
index c0c7a83..6e9f21a 100644
--- a/cc/animation/scrollbar_animation_controller_thinning.h
+++ b/cc/animation/scrollbar_animation_controller_thinning.h
@@ -21,6 +21,7 @@
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);
virtual ~ScrollbarAnimationControllerThinning();
@@ -31,18 +32,19 @@
bool mouse_is_over_scrollbar() const { return mouse_is_over_scrollbar_; }
bool mouse_is_near_scrollbar() const { return mouse_is_near_scrollbar_; }
- virtual void DidScrollUpdate() OVERRIDE;
- virtual void DidMouseMoveOffScrollbar() OVERRIDE;
- virtual void DidMouseMoveNear(float distance) OVERRIDE;
+ virtual void DidScrollUpdate(bool on_resize) override;
+ virtual void DidMouseMoveOffScrollbar() override;
+ virtual void DidMouseMoveNear(float distance) override;
protected:
ScrollbarAnimationControllerThinning(
LayerImpl* scroll_layer,
ScrollbarAnimationControllerClient* client,
base::TimeDelta delay_before_starting,
+ base::TimeDelta resize_delay_before_starting,
base::TimeDelta duration);
- virtual void RunAnimationFrame(float progress) OVERRIDE;
+ virtual void RunAnimationFrame(float progress) override;
private:
// Describes whether the current animation should INCREASE (darken / thicken)
diff --git a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
index 6dad5b0..cb7d33e 100644
--- a/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
+++ b/cc/animation/scrollbar_animation_controller_thinning_unittest.cc
@@ -21,10 +21,10 @@
: host_impl_(&proxy_, &shared_bitmap_manager_) {}
virtual void PostDelayedScrollbarFade(const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE {
+ base::TimeDelta delay) override {
start_fade_ = start_fade;
}
- virtual void SetNeedsScrollbarAnimationFrame() OVERRIDE {}
+ virtual void SetNeedsScrollbarAnimationFrame() override {}
protected:
virtual void SetUp() {
@@ -58,6 +58,7 @@
scroll_layer_ptr,
this,
base::TimeDelta::FromSeconds(2),
+ base::TimeDelta::FromSeconds(5),
base::TimeDelta::FromSeconds(3));
}
@@ -83,7 +84,7 @@
TEST_F(ScrollbarAnimationControllerThinningTest, AwakenByProgrammaticScroll) {
base::TimeTicks time;
time += base::TimeDelta::FromSeconds(1);
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
// Scrollbar doesn't change size if triggered by scroll.
EXPECT_FLOAT_EQ(0.4f, scrollbar_layer_->thumb_thickness_scale_factor());
@@ -96,7 +97,7 @@
EXPECT_FLOAT_EQ(0.4f, scrollbar_layer_->thumb_thickness_scale_factor());
// Subsequent scroll restarts animation.
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
@@ -134,7 +135,7 @@
scrollbar_controller_->Animate(time);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->thumb_thickness_scale_factor());
- scrollbar_controller_->DidScrollUpdate();
+ scrollbar_controller_->DidScrollUpdate(false);
start_fade_.Run();
scrollbar_controller_->Animate(time);
EXPECT_FLOAT_EQ(1.0f, scrollbar_layer_->opacity());
diff --git a/cc/animation/timing_function.h b/cc/animation/timing_function.h
index a6d1aac..9974865 100644
--- a/cc/animation/timing_function.h
+++ b/cc/animation/timing_function.h
@@ -35,10 +35,10 @@
virtual ~CubicBezierTimingFunction();
// TimingFunction implementation.
- virtual float GetValue(double time) const OVERRIDE;
- virtual float Velocity(double time) const OVERRIDE;
- virtual void Range(float* min, float* max) const OVERRIDE;
- virtual scoped_ptr<TimingFunction> Clone() const OVERRIDE;
+ virtual float GetValue(double time) const override;
+ virtual float Velocity(double time) const override;
+ virtual void Range(float* min, float* max) const override;
+ virtual scoped_ptr<TimingFunction> Clone() const override;
protected:
CubicBezierTimingFunction(double x1, double y1, double x2, double y2);
diff --git a/cc/base/delayed_unique_notifier_unittest.cc b/cc/base/delayed_unique_notifier_unittest.cc
index 6c7ae6e..090da33 100644
--- a/cc/base/delayed_unique_notifier_unittest.cc
+++ b/cc/base/delayed_unique_notifier_unittest.cc
@@ -23,7 +23,7 @@
virtual ~TestNotifier() {}
// Overridden from DelayedUniqueNotifier:
- virtual base::TimeTicks Now() const OVERRIDE { return now_; }
+ virtual base::TimeTicks Now() const override { return now_; }
void SetNow(base::TimeTicks now) { now_ = now; }
@@ -35,7 +35,7 @@
public:
DelayedUniqueNotifierTest() : notification_count_(0) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
notification_count_ = 0;
task_runner_ = make_scoped_refptr(new base::TestSimpleTaskRunner);
}
diff --git a/cc/base/latency_info_swap_promise.h b/cc/base/latency_info_swap_promise.h
index a210a3f..b912f24 100644
--- a/cc/base/latency_info_swap_promise.h
+++ b/cc/base/latency_info_swap_promise.h
@@ -16,10 +16,10 @@
explicit LatencyInfoSwapPromise(const ui::LatencyInfo& latency_info);
virtual ~LatencyInfoSwapPromise();
- virtual void DidSwap(CompositorFrameMetadata* metadata) OVERRIDE;
- virtual void DidNotSwap(DidNotSwapReason reason) OVERRIDE;
+ virtual void DidSwap(CompositorFrameMetadata* metadata) override;
+ virtual void DidNotSwap(DidNotSwapReason reason) override;
- virtual int64 TraceId() const OVERRIDE;
+ virtual int64 TraceId() const override;
private:
ui::LatencyInfo latency_;
diff --git a/cc/base/latency_info_swap_promise_monitor.h b/cc/base/latency_info_swap_promise_monitor.h
index 1a114fb..cf1dc1d 100644
--- a/cc/base/latency_info_swap_promise_monitor.h
+++ b/cc/base/latency_info_swap_promise_monitor.h
@@ -24,9 +24,9 @@
LayerTreeHostImpl* layer_tree_host_impl);
virtual ~LatencyInfoSwapPromiseMonitor();
- virtual void OnSetNeedsCommitOnMain() OVERRIDE;
- virtual void OnSetNeedsRedrawOnImpl() OVERRIDE;
- virtual void OnForwardScrollUpdateToMainThreadOnImpl() OVERRIDE;
+ virtual void OnSetNeedsCommitOnMain() override;
+ virtual void OnSetNeedsRedrawOnImpl() override;
+ virtual void OnForwardScrollUpdateToMainThreadOnImpl() override;
private:
ui::LatencyInfo* latency_;
diff --git a/cc/base/unique_notifier_unittest.cc b/cc/base/unique_notifier_unittest.cc
index ec1b83c..0ba9892 100644
--- a/cc/base/unique_notifier_unittest.cc
+++ b/cc/base/unique_notifier_unittest.cc
@@ -17,7 +17,7 @@
public:
UniqueNotifierTest() : notification_count_(0) {}
- virtual void SetUp() OVERRIDE { ResetNotificationCount(); }
+ virtual void SetUp() override { ResetNotificationCount(); }
void Notify() { ++notification_count_; }
diff --git a/cc/blink/scrollbar_impl.h b/cc/blink/scrollbar_impl.h
index fe7bf59..5f0572c 100644
--- a/cc/blink/scrollbar_impl.h
+++ b/cc/blink/scrollbar_impl.h
@@ -25,17 +25,17 @@
virtual ~ScrollbarImpl();
// cc::Scrollbar implementation.
- virtual cc::ScrollbarOrientation Orientation() const OVERRIDE;
- virtual bool IsLeftSideVerticalScrollbar() const OVERRIDE;
- virtual bool HasThumb() const OVERRIDE;
- virtual bool IsOverlay() const OVERRIDE;
- virtual gfx::Point Location() const OVERRIDE;
- virtual int ThumbThickness() const OVERRIDE;
- virtual int ThumbLength() const OVERRIDE;
- virtual gfx::Rect TrackRect() const OVERRIDE;
+ virtual cc::ScrollbarOrientation Orientation() const override;
+ virtual bool IsLeftSideVerticalScrollbar() const override;
+ virtual bool HasThumb() const override;
+ virtual bool IsOverlay() const override;
+ virtual gfx::Point Location() const override;
+ virtual int ThumbThickness() const override;
+ virtual int ThumbLength() const override;
+ virtual gfx::Rect TrackRect() const override;
virtual void PaintPart(SkCanvas* canvas,
cc::ScrollbarPart part,
- const gfx::Rect& content_rect) OVERRIDE;
+ const gfx::Rect& content_rect) override;
private:
scoped_ptr<blink::WebScrollbar> scrollbar_;
diff --git a/cc/blink/web_animation_impl.cc b/cc/blink/web_animation_impl.cc
index f1069c7..4989c07 100644
--- a/cc/blink/web_animation_impl.cc
+++ b/cc/blink/web_animation_impl.cc
@@ -154,7 +154,6 @@
animation_->set_playback_rate(playback_rate);
}
-#if WEB_ANIMATION_SUPPORTS_FILL_MODE
blink::WebCompositorAnimation::FillMode WebCompositorAnimationImpl::fillMode()
const {
switch (animation_->fill_mode()) {
@@ -188,7 +187,7 @@
break;
}
}
-#endif
+
scoped_ptr<cc::Animation> WebCompositorAnimationImpl::PassAnimation() {
animation_->set_needs_synchronized_start_time(true);
return animation_.Pass();
diff --git a/cc/blink/web_animation_impl.h b/cc/blink/web_animation_impl.h
index 74741cc..e3925d6 100644
--- a/cc/blink/web_animation_impl.h
+++ b/cc/blink/web_animation_impl.h
@@ -43,10 +43,8 @@
virtual void setDirection(Direction);
virtual double playbackRate() const;
virtual void setPlaybackRate(double playback_rate);
-#if WEB_ANIMATION_SUPPORTS_FILL_MODE
virtual FillMode fillMode() const;
virtual void setFillMode(blink::WebCompositorAnimation::FillMode fill_mode);
-#endif
scoped_ptr<cc::Animation> PassAnimation();
private:
diff --git a/cc/blink/web_content_layer_impl.h b/cc/blink/web_content_layer_impl.h
index bc23aa0..9dab02d 100644
--- a/cc/blink/web_content_layer_impl.h
+++ b/cc/blink/web_content_layer_impl.h
@@ -39,9 +39,9 @@
virtual void PaintContents(SkCanvas* canvas,
const gfx::Rect& clip,
ContentLayerClient::GraphicsContextStatus
- graphics_context_status) OVERRIDE;
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE;
- virtual bool FillsBoundsCompletely() const OVERRIDE;
+ graphics_context_status) override;
+ virtual void DidChangeLayerCanUseLCDText() override;
+ virtual bool FillsBoundsCompletely() const override;
scoped_ptr<WebLayerImpl> layer_;
blink::WebContentLayerClient* client_;
diff --git a/cc/blink/web_external_bitmap_impl.h b/cc/blink/web_external_bitmap_impl.h
index 905c098..7dbfab3 100644
--- a/cc/blink/web_external_bitmap_impl.h
+++ b/cc/blink/web_external_bitmap_impl.h
@@ -28,9 +28,9 @@
virtual ~WebExternalBitmapImpl();
// blink::WebExternalBitmap implementation.
- virtual blink::WebSize size() OVERRIDE;
- virtual void setSize(blink::WebSize size) OVERRIDE;
- virtual uint8* pixels() OVERRIDE;
+ virtual blink::WebSize size() override;
+ virtual void setSize(blink::WebSize size) override;
+ virtual uint8* pixels() override;
base::SharedMemory* shared_memory() { return shared_memory_.get(); }
diff --git a/cc/blink/web_external_texture_layer_impl.h b/cc/blink/web_external_texture_layer_impl.h
index 044be1a..a657e62 100644
--- a/cc/blink/web_external_texture_layer_impl.h
+++ b/cc/blink/web_external_texture_layer_impl.h
@@ -48,7 +48,7 @@
virtual bool PrepareTextureMailbox(
cc::TextureMailbox* mailbox,
scoped_ptr<cc::SingleReleaseCallback>* release_callback,
- bool use_shared_memory) OVERRIDE;
+ bool use_shared_memory) override;
private:
static void DidReleaseMailbox(
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index 36304a1..dadfd6d 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -443,7 +443,7 @@
// This object takes ownership of the debug_info object.
explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info)
: debug_info_(debug_info) {}
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE {
+ virtual void AppendAsTraceFormat(std::string* out) const override {
DCHECK(thread_checker_.CalledOnValidThread());
blink::WebString web_string;
debug_info_->appendAsTraceFormat(&web_string);
diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h
index 0e3de76..75f8a55 100644
--- a/cc/blink/web_layer_impl.h
+++ b/cc/blink/web_layer_impl.h
@@ -137,7 +137,7 @@
// LayerClient implementation.
virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo()
- OVERRIDE;
+ override;
virtual void setScrollParent(blink::WebLayer* parent);
virtual void setClipParent(blink::WebLayer* parent);
diff --git a/cc/blink/web_to_cc_animation_delegate_adapter.h b/cc/blink/web_to_cc_animation_delegate_adapter.h
index 2f7897b..c7e7c56 100644
--- a/cc/blink/web_to_cc_animation_delegate_adapter.h
+++ b/cc/blink/web_to_cc_animation_delegate_adapter.h
@@ -23,10 +23,10 @@
private:
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- cc::Animation::TargetProperty target_property) OVERRIDE;
+ cc::Animation::TargetProperty target_property) override;
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- cc::Animation::TargetProperty target_property) OVERRIDE;
+ cc::Animation::TargetProperty target_property) override;
blink::WebCompositorAnimationDelegate* delegate_;
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index 18fcf7a..21299c0 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -122,6 +122,7 @@
'trees/layer_tree_host_unittest_video.cc',
'trees/layer_tree_impl_unittest.cc',
'trees/occlusion_tracker_unittest.cc',
+ 'trees/occlusion_unittest.cc',
'trees/tree_synchronizer_unittest.cc',
],
'cc_surfaces_unit_tests_source_files': [
diff --git a/cc/debug/benchmark_instrumentation.cc b/cc/debug/benchmark_instrumentation.cc
index adc969b..74caae8 100644
--- a/cc/debug/benchmark_instrumentation.cc
+++ b/cc/debug/benchmark_instrumentation.cc
@@ -28,5 +28,17 @@
"data", stats.AsTraceableData());
}
+void IssueDisplayRenderingStatsEvent() {
+ scoped_refptr<base::debug::TracedValue> record_data =
+ new base::debug::TracedValue();
+ record_data->SetInteger("frame_count", 1);
+ TRACE_EVENT_INSTANT1(
+ "benchmark",
+ "BenchmarkInstrumentation::DisplayRenderingStats",
+ TRACE_EVENT_SCOPE_THREAD,
+ "data",
+ scoped_refptr<base::debug::ConvertableToTraceFormat>(record_data));
+}
+
} // namespace benchmark_instrumentation
} // namespace cc
diff --git a/cc/debug/benchmark_instrumentation.h b/cc/debug/benchmark_instrumentation.h
index 3a6b03d..bd524b9 100644
--- a/cc/debug/benchmark_instrumentation.h
+++ b/cc/debug/benchmark_instrumentation.h
@@ -5,6 +5,7 @@
#ifndef CC_DEBUG_BENCHMARK_INSTRUMENTATION_H_
#define CC_DEBUG_BENCHMARK_INSTRUMENTATION_H_
+#include "cc/base/cc_export.h"
#include "cc/debug/rendering_stats.h"
namespace cc {
@@ -45,6 +46,7 @@
const RenderingStats::MainThreadRenderingStats& stats);
void IssueImplThreadRenderingStatsEvent(
const RenderingStats::ImplThreadRenderingStats& stats);
+void CC_EXPORT IssueDisplayRenderingStatsEvent();
} // namespace benchmark_instrumentation
} // namespace cc
diff --git a/cc/debug/invalidation_benchmark.h b/cc/debug/invalidation_benchmark.h
index 00481ae..a727104 100644
--- a/cc/debug/invalidation_benchmark.h
+++ b/cc/debug/invalidation_benchmark.h
@@ -24,9 +24,9 @@
virtual ~InvalidationBenchmark();
// Implements MicroBenchmark interface.
- virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE;
- virtual void RunOnLayer(PictureLayer* layer) OVERRIDE;
- virtual bool ProcessMessage(scoped_ptr<base::Value> value) OVERRIDE;
+ virtual void DidUpdateLayers(LayerTreeHost* host) override;
+ virtual void RunOnLayer(PictureLayer* layer) override;
+ virtual bool ProcessMessage(scoped_ptr<base::Value> value) override;
private:
enum Mode { FIXED_SIZE, LAYER, VIEWPORT, RANDOM };
diff --git a/cc/debug/micro_benchmark_controller_unittest.cc b/cc/debug/micro_benchmark_controller_unittest.cc
index 1f2bfd8..527e850 100644
--- a/cc/debug/micro_benchmark_controller_unittest.cc
+++ b/cc/debug/micro_benchmark_controller_unittest.cc
@@ -21,7 +21,7 @@
MicroBenchmarkControllerTest()
: layer_tree_host_client_(FakeLayerTreeHostClient::DIRECT_3D) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
impl_proxy_ = make_scoped_ptr(new FakeImplProxy);
shared_bitmap_manager_.reset(new TestSharedBitmapManager());
layer_tree_host_impl_ = make_scoped_ptr(new FakeLayerTreeHostImpl(
@@ -32,7 +32,7 @@
layer_tree_host_->InitializeForTesting(scoped_ptr<Proxy>(new FakeProxy));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
layer_tree_host_impl_ = nullptr;
layer_tree_host_ = nullptr;
impl_proxy_ = nullptr;
diff --git a/cc/debug/picture_record_benchmark.h b/cc/debug/picture_record_benchmark.h
index 89f2bc0..42404b1 100644
--- a/cc/debug/picture_record_benchmark.h
+++ b/cc/debug/picture_record_benchmark.h
@@ -23,8 +23,8 @@
virtual ~PictureRecordBenchmark();
// Implements MicroBenchmark interface.
- virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE;
- virtual void RunOnLayer(PictureLayer* layer) OVERRIDE;
+ virtual void DidUpdateLayers(LayerTreeHost* host) override;
+ virtual void RunOnLayer(PictureLayer* layer) override;
private:
void Run(Layer* layer);
diff --git a/cc/debug/rasterize_and_record_benchmark.h b/cc/debug/rasterize_and_record_benchmark.h
index e2942d4..921a7e9 100644
--- a/cc/debug/rasterize_and_record_benchmark.h
+++ b/cc/debug/rasterize_and_record_benchmark.h
@@ -30,11 +30,11 @@
virtual ~RasterizeAndRecordBenchmark();
// Implements MicroBenchmark interface.
- virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE;
- virtual void RunOnLayer(PictureLayer* layer) OVERRIDE;
+ virtual void DidUpdateLayers(LayerTreeHost* host) override;
+ virtual void RunOnLayer(PictureLayer* layer) override;
virtual scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl(
- scoped_refptr<base::MessageLoopProxy> origin_loop) OVERRIDE;
+ scoped_refptr<base::MessageLoopProxy> origin_loop) override;
private:
void Run(Layer* layer);
diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc
index dbf74a4..48bdf8a 100644
--- a/cc/debug/rasterize_and_record_benchmark_impl.cc
+++ b/cc/debug/rasterize_and_record_benchmark_impl.cc
@@ -37,7 +37,7 @@
best_time_(base::TimeDelta::Max()) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
// Parameters for LapTimer.
const int kTimeLimitMillis = 1;
const int kWarmupRuns = 0;
@@ -96,46 +96,46 @@
virtual scoped_refptr<Tile> CreateTile(
PictureLayerTiling* tiling,
- const gfx::Rect& content_rect) OVERRIDE {
+ const gfx::Rect& content_rect) override {
return base_client_->CreateTile(tiling, content_rect);
}
- virtual PicturePileImpl* GetPile() OVERRIDE {
+ virtual PicturePileImpl* GetPile() override {
return base_client_->GetPile();
}
virtual gfx::Size CalculateTileSize(
- const gfx::Size& content_bounds) const OVERRIDE {
+ const gfx::Size& content_bounds) const override {
return base_client_->CalculateTileSize(content_bounds);
}
// This is the only function that returns something different from the base
// client.
- virtual const Region* GetInvalidation() OVERRIDE { return &invalidation_; }
+ virtual const Region* GetInvalidation() override { return &invalidation_; }
virtual const PictureLayerTiling* GetTwinTiling(
- const PictureLayerTiling* tiling) const OVERRIDE {
+ const PictureLayerTiling* tiling) const override {
return base_client_->GetTwinTiling(tiling);
}
virtual PictureLayerTiling* GetRecycledTwinTiling(
- const PictureLayerTiling* tiling) OVERRIDE {
+ const PictureLayerTiling* tiling) override {
return base_client_->GetRecycledTwinTiling(tiling);
}
- virtual size_t GetMaxTilesForInterestArea() const OVERRIDE {
+ virtual size_t GetMaxTilesForInterestArea() const override {
return base_client_->GetMaxTilesForInterestArea();
}
- virtual float GetSkewportTargetTimeInSeconds() const OVERRIDE {
+ virtual float GetSkewportTargetTimeInSeconds() const override {
return base_client_->GetSkewportTargetTimeInSeconds();
}
- virtual int GetSkewportExtrapolationLimitInContentPixels() const OVERRIDE {
+ virtual int GetSkewportExtrapolationLimitInContentPixels() const override {
return base_client_->GetSkewportExtrapolationLimitInContentPixels();
}
- virtual WhichTree GetTree() const OVERRIDE { return base_client_->GetTree(); }
+ virtual WhichTree GetTree() const override { return base_client_->GetTree(); }
private:
PictureLayerTilingClient* base_client_;
diff --git a/cc/debug/rasterize_and_record_benchmark_impl.h b/cc/debug/rasterize_and_record_benchmark_impl.h
index cceef05..4508d5e 100644
--- a/cc/debug/rasterize_and_record_benchmark_impl.h
+++ b/cc/debug/rasterize_and_record_benchmark_impl.h
@@ -27,8 +27,8 @@
virtual ~RasterizeAndRecordBenchmarkImpl();
// Implements MicroBenchmark interface.
- virtual void DidCompleteCommit(LayerTreeHostImpl* host) OVERRIDE;
- virtual void RunOnLayer(PictureLayerImpl* layer) OVERRIDE;
+ virtual void DidCompleteCommit(LayerTreeHostImpl* host) override;
+ virtual void RunOnLayer(PictureLayerImpl* layer) override;
private:
void Run(LayerImpl* layer);
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc
index b5989fc..d0668da 100644
--- a/cc/debug/rendering_stats.cc
+++ b/cc/debug/rendering_stats.cc
@@ -29,7 +29,7 @@
}
RenderingStats::MainThreadRenderingStats::MainThreadRenderingStats()
- : frame_count(0), painted_pixel_count(0), recorded_pixel_count(0) {
+ : painted_pixel_count(0), recorded_pixel_count(0) {
}
RenderingStats::MainThreadRenderingStats::~MainThreadRenderingStats() {
@@ -39,7 +39,6 @@
RenderingStats::MainThreadRenderingStats::AsTraceableData() const {
scoped_refptr<base::debug::TracedValue> record_data =
new base::debug::TracedValue();
- record_data->SetInteger("frame_count", frame_count);
record_data->SetDouble("paint_time", paint_time.InSecondsF());
record_data->SetInteger("painted_pixel_count", painted_pixel_count);
record_data->SetDouble("record_time", record_time.InSecondsF());
@@ -49,7 +48,6 @@
void RenderingStats::MainThreadRenderingStats::Add(
const MainThreadRenderingStats& other) {
- frame_count += other.frame_count;
paint_time += other.paint_time;
painted_pixel_count += other.painted_pixel_count;
record_time += other.record_time;
diff --git a/cc/debug/rendering_stats.h b/cc/debug/rendering_stats.h
index 73ca9c4..52560e2 100644
--- a/cc/debug/rendering_stats.h
+++ b/cc/debug/rendering_stats.h
@@ -36,7 +36,6 @@
// Note: when adding new members, please remember to update Add in
// rendering_stats.cc.
- int64 frame_count;
base::TimeDelta paint_time;
int64 painted_pixel_count;
base::TimeDelta record_time;
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc
index 01499d2..fb7ec52 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -71,16 +71,12 @@
return base::TimeDelta();
}
-void RenderingStatsInstrumentation::IncrementFrameCount(int64 count,
- bool main_thread) {
+void RenderingStatsInstrumentation::IncrementFrameCount(int64 count) {
if (!record_rendering_stats_)
return;
base::AutoLock scoped_lock(lock_);
- if (main_thread)
- main_thread_rendering_stats_.frame_count += count;
- else
- impl_thread_rendering_stats_.frame_count += count;
+ impl_thread_rendering_stats_.frame_count += count;
}
void RenderingStatsInstrumentation::AddPaint(base::TimeDelta duration,
diff --git a/cc/debug/rendering_stats_instrumentation.h b/cc/debug/rendering_stats_instrumentation.h
index 208c1a3..fd7f5c9 100644
--- a/cc/debug/rendering_stats_instrumentation.h
+++ b/cc/debug/rendering_stats_instrumentation.h
@@ -47,7 +47,7 @@
base::TimeTicks StartRecording() const;
base::TimeDelta EndRecording(base::TimeTicks start_time) const;
- void IncrementFrameCount(int64 count, bool main_thread);
+ void IncrementFrameCount(int64 count);
void AddPaint(base::TimeDelta duration, int64 pixels);
void AddRecord(base::TimeDelta duration, int64 pixels);
void AddRaster(base::TimeDelta duration, int64 pixels);
diff --git a/cc/debug/traced_picture.h b/cc/debug/traced_picture.h
index 638f00b..1d31694 100644
--- a/cc/debug/traced_picture.h
+++ b/cc/debug/traced_picture.h
@@ -23,7 +23,7 @@
static scoped_refptr<base::debug::ConvertableToTraceFormat>
AsTraceablePictureAlias(const Picture* original);
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE;
+ virtual void AppendAsTraceFormat(std::string* out) const override;
private:
virtual ~TracedPicture();
diff --git a/cc/debug/unittest_only_benchmark.h b/cc/debug/unittest_only_benchmark.h
index 8b2c815..277d85f 100644
--- a/cc/debug/unittest_only_benchmark.h
+++ b/cc/debug/unittest_only_benchmark.h
@@ -16,12 +16,12 @@
const DoneCallback& callback);
virtual ~UnittestOnlyBenchmark();
- virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE;
- virtual bool ProcessMessage(scoped_ptr<base::Value> value) OVERRIDE;
+ virtual void DidUpdateLayers(LayerTreeHost* host) override;
+ virtual bool ProcessMessage(scoped_ptr<base::Value> value) override;
protected:
virtual scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl(
- scoped_refptr<base::MessageLoopProxy> origin_loop) OVERRIDE;
+ scoped_refptr<base::MessageLoopProxy> origin_loop) override;
private:
void RecordImplResults(scoped_ptr<base::Value> results);
diff --git a/cc/debug/unittest_only_benchmark_impl.h b/cc/debug/unittest_only_benchmark_impl.h
index b9e9bc9..48953de 100644
--- a/cc/debug/unittest_only_benchmark_impl.h
+++ b/cc/debug/unittest_only_benchmark_impl.h
@@ -23,7 +23,7 @@
const DoneCallback& callback);
virtual ~UnittestOnlyBenchmarkImpl();
- virtual void DidCompleteCommit(LayerTreeHostImpl* host) OVERRIDE;
+ virtual void DidCompleteCommit(LayerTreeHostImpl* host) override;
};
} // namespace cc
diff --git a/cc/input/top_controls_manager_unittest.cc b/cc/input/top_controls_manager_unittest.cc
index 91577c8..177904c 100644
--- a/cc/input/top_controls_manager_unittest.cc
+++ b/cc/input/top_controls_manager_unittest.cc
@@ -37,20 +37,20 @@
virtual ~MockTopControlsManagerClient() {}
- virtual void DidChangeTopControlsPosition() OVERRIDE {
+ virtual void DidChangeTopControlsPosition() override {
redraw_needed_ = true;
update_draw_properties_needed_ = true;
}
- virtual bool HaveRootScrollLayer() const OVERRIDE {
+ virtual bool HaveRootScrollLayer() const override {
return true;
}
- virtual void SetControlsTopOffset(float offset) OVERRIDE {
+ virtual void SetControlsTopOffset(float offset) override {
top_controls_top_offset_ = offset;
}
- virtual float ControlsTopOffset() const OVERRIDE {
+ virtual float ControlsTopOffset() const override {
return top_controls_top_offset_;
}
diff --git a/cc/layers/content_layer.h b/cc/layers/content_layer.h
index 4bc414c..4b8c346 100644
--- a/cc/layers/content_layer.h
+++ b/cc/layers/content_layer.h
@@ -21,7 +21,7 @@
public:
static scoped_ptr<ContentLayerPainter> Create(ContentLayerClient* client);
- virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) OVERRIDE;
+ virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override;
private:
explicit ContentLayerPainter(ContentLayerClient* client);
@@ -38,33 +38,33 @@
void ClearClient();
- virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE;
+ virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
- OVERRIDE;
+ override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
- virtual bool NeedMoreUpdates() OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
+ virtual bool NeedMoreUpdates() override;
- virtual void SetContentsOpaque(bool contents_opaque) OVERRIDE;
+ virtual void SetContentsOpaque(bool contents_opaque) override;
- virtual bool SupportsLCDText() const OVERRIDE;
+ virtual bool SupportsLCDText() const override;
- virtual skia::RefPtr<SkPicture> GetPicture() const OVERRIDE;
+ virtual skia::RefPtr<SkPicture> GetPicture() const override;
- virtual void OnOutputSurfaceCreated() OVERRIDE;
+ virtual void OnOutputSurfaceCreated() override;
protected:
explicit ContentLayer(ContentLayerClient* client);
virtual ~ContentLayer();
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
// TiledLayer implementation.
- virtual LayerUpdater* Updater() const OVERRIDE;
+ virtual LayerUpdater* Updater() const override;
private:
// TiledLayer implementation.
- virtual void CreateUpdaterIfNeeded() OVERRIDE;
+ virtual void CreateUpdaterIfNeeded() override;
void UpdateCanUseLCDText();
diff --git a/cc/layers/contents_scaling_layer.h b/cc/layers/contents_scaling_layer.h
index 84780d2..3b1f828 100644
--- a/cc/layers/contents_scaling_layer.h
+++ b/cc/layers/contents_scaling_layer.h
@@ -17,10 +17,10 @@
virtual void CalculateContentsScale(float ideal_contents_scale,
float* contents_scale_x,
float* contents_scale_y,
- gfx::Size* content_bounds) OVERRIDE;
+ gfx::Size* content_bounds) override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
protected:
ContentsScalingLayer();
diff --git a/cc/layers/contents_scaling_layer_unittest.cc b/cc/layers/contents_scaling_layer_unittest.cc
index 70f66f5..8cbd517 100644
--- a/cc/layers/contents_scaling_layer_unittest.cc
+++ b/cc/layers/contents_scaling_layer_unittest.cc
@@ -18,7 +18,7 @@
MockContentsScalingLayer()
: ContentsScalingLayer() {}
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE {
+ virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override {
last_needs_display_rect_ = dirty_rect;
ContentsScalingLayer::SetNeedsDisplayRect(dirty_rect);
}
diff --git a/cc/layers/delegated_frame_provider_unittest.cc b/cc/layers/delegated_frame_provider_unittest.cc
index 8462595..4a3f77e 100644
--- a/cc/layers/delegated_frame_provider_unittest.cc
+++ b/cc/layers/delegated_frame_provider_unittest.cc
@@ -62,14 +62,14 @@
false);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
resource_collection_ = new DelegatedFrameResourceCollection;
resource_collection_->SetClient(this);
}
- virtual void TearDown() OVERRIDE { resource_collection_->SetClient(NULL); }
+ virtual void TearDown() override { resource_collection_->SetClient(NULL); }
- virtual void UnusedResourcesAreAvailable() OVERRIDE {
+ virtual void UnusedResourcesAreAvailable() override {
resources_available_ = true;
resource_collection_->TakeUnusedResourcesForChildCompositor(&resources_);
}
diff --git a/cc/layers/delegated_frame_resource_collection_unittest.cc b/cc/layers/delegated_frame_resource_collection_unittest.cc
index 9bfd59c..99c181e 100644
--- a/cc/layers/delegated_frame_resource_collection_unittest.cc
+++ b/cc/layers/delegated_frame_resource_collection_unittest.cc
@@ -21,9 +21,9 @@
protected:
DelegatedFrameResourceCollectionTest() : resources_available_(false) {}
- virtual void SetUp() OVERRIDE { CreateResourceCollection(); }
+ virtual void SetUp() override { CreateResourceCollection(); }
- virtual void TearDown() OVERRIDE { DestroyResourceCollection(); }
+ virtual void TearDown() override { DestroyResourceCollection(); }
void CreateResourceCollection() {
DCHECK(!resource_collection_.get());
@@ -46,7 +46,7 @@
return resources;
}
- virtual void UnusedResourcesAreAvailable() OVERRIDE {
+ virtual void UnusedResourcesAreAvailable() override {
resources_available_ = true;
resource_collection_->TakeUnusedResourcesForChildCompositor(
&returned_resources_);
diff --git a/cc/layers/delegated_renderer_layer.h b/cc/layers/delegated_renderer_layer.h
index 49b41d9..8f31b17 100644
--- a/cc/layers/delegated_renderer_layer.h
+++ b/cc/layers/delegated_renderer_layer.h
@@ -22,16 +22,16 @@
const scoped_refptr<DelegatedFrameProvider>& frame_provider);
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
+ override;
+ virtual void SetLayerTreeHost(LayerTreeHost* host) override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
+ virtual void PushPropertiesTo(LayerImpl* impl) override;
// Called by the DelegatedFrameProvider when a new frame is available to be
// picked up.
void ProviderHasNewFrame();
- virtual bool HasDelegatedContent() const OVERRIDE;
+ virtual bool HasDelegatedContent() const override;
protected:
DelegatedRendererLayer(
diff --git a/cc/layers/delegated_renderer_layer_impl.cc b/cc/layers/delegated_renderer_layer_impl.cc
index c8af1fa..86d493a 100644
--- a/cc/layers/delegated_renderer_layer_impl.cc
+++ b/cc/layers/delegated_renderer_layer_impl.cc
@@ -16,7 +16,7 @@
#include "cc/quads/render_pass_draw_quad.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
namespace cc {
@@ -126,11 +126,8 @@
&resources_in_frame);
for (size_t i = 0; i < render_pass_list.size(); ++i) {
RenderPass* pass = render_pass_list[i];
- for (QuadList::Iterator iter = pass->quad_list.begin();
- iter != pass->quad_list.end();
- ++iter) {
- iter->IterateResources(remap_resources_to_parent_callback);
- }
+ for (auto& quad : pass->quad_list)
+ quad.IterateResources(remap_resources_to_parent_callback);
}
if (invalid_frame) {
@@ -257,7 +254,7 @@
void DelegatedRendererLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
AppendRainbowDebugBorder(render_pass, append_quads_data);
@@ -284,7 +281,7 @@
DCHECK(target_render_pass_id.layer_id == render_target()->id());
AppendRenderPassQuads(render_pass,
- occlusion_tracker,
+ occlusion_in_content_space,
append_quads_data,
root_delegated_render_pass,
frame_size);
@@ -296,7 +293,7 @@
const RenderPass* delegated_render_pass =
render_passes_in_draw_order_[render_pass_index];
AppendRenderPassQuads(render_pass,
- occlusion_tracker,
+ occlusion_in_content_space,
append_quads_data,
delegated_render_pass,
frame_size);
@@ -386,23 +383,19 @@
void DelegatedRendererLayerImpl::AppendRenderPassQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data,
const RenderPass* delegated_render_pass,
const gfx::Size& frame_size) const {
const SharedQuadState* delegated_shared_quad_state = NULL;
SharedQuadState* output_shared_quad_state = NULL;
- for (QuadList::ConstIterator iter = delegated_render_pass->quad_list.begin();
- iter != delegated_render_pass->quad_list.end();
- ++iter) {
- const DrawQuad* delegated_quad = &*iter;
-
+ for (const auto& delegated_quad : delegated_render_pass->quad_list) {
bool is_root_delegated_render_pass =
delegated_render_pass == render_passes_in_draw_order_.back();
- if (delegated_quad->shared_quad_state != delegated_shared_quad_state) {
- delegated_shared_quad_state = delegated_quad->shared_quad_state;
+ if (delegated_quad.shared_quad_state != delegated_shared_quad_state) {
+ delegated_shared_quad_state = delegated_quad.shared_quad_state;
output_shared_quad_state = render_pass->CreateAndAppendSharedQuadState();
output_shared_quad_state->CopyFrom(delegated_shared_quad_state);
@@ -446,21 +439,24 @@
quad_content_to_delegated_target_space.ConcatTransform(draw_transform());
}
+ Occlusion occlusion_in_quad_space =
+ occlusion_in_content_space.GetOcclusionWithGivenDrawTransform(
+ quad_content_to_delegated_target_space);
+
gfx::Rect quad_visible_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(
- quad_content_to_delegated_target_space)
- .GetUnoccludedContentRect(delegated_quad->visible_rect);
+ occlusion_in_quad_space.GetUnoccludedContentRect(
+ delegated_quad.visible_rect);
if (quad_visible_rect.IsEmpty())
continue;
- if (delegated_quad->material != DrawQuad::RENDER_PASS) {
+ if (delegated_quad.material != DrawQuad::RENDER_PASS) {
DrawQuad* output_quad = render_pass->CopyFromAndAppendDrawQuad(
- delegated_quad, output_shared_quad_state);
+ &delegated_quad, output_shared_quad_state);
output_quad->visible_rect = quad_visible_rect;
} else {
RenderPassId delegated_contributing_render_pass_id =
- RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id;
+ RenderPassDrawQuad::MaterialCast(&delegated_quad)->render_pass_id;
RenderPassId output_contributing_render_pass_id(-1, -1);
bool present =
@@ -475,7 +471,7 @@
RenderPassDrawQuad* output_quad =
render_pass->CopyFromAndAppendRenderPassDrawQuad(
- RenderPassDrawQuad::MaterialCast(delegated_quad),
+ RenderPassDrawQuad::MaterialCast(&delegated_quad),
output_shared_quad_state,
output_contributing_render_pass_id);
output_quad->visible_rect = quad_visible_rect;
diff --git a/cc/layers/delegated_renderer_layer_impl.h b/cc/layers/delegated_renderer_layer_impl.h
index 1f3c881..53f2f8a 100644
--- a/cc/layers/delegated_renderer_layer_impl.h
+++ b/cc/layers/delegated_renderer_layer_impl.h
@@ -25,19 +25,19 @@
// LayerImpl overrides.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual bool HasDelegatedContent() const OVERRIDE;
- virtual bool HasContributingDelegatedRenderPasses() const OVERRIDE;
- virtual RenderPassId FirstContributingRenderPassId() const OVERRIDE;
+ override;
+ virtual bool HasDelegatedContent() const override;
+ virtual bool HasContributingDelegatedRenderPasses() const override;
+ virtual RenderPassId FirstContributingRenderPassId() const override;
virtual RenderPassId NextContributingRenderPassId(
- RenderPassId previous) const OVERRIDE;
- virtual void ReleaseResources() OVERRIDE;
+ RenderPassId previous) const override;
+ virtual void ReleaseResources() override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
+ ResourceProvider* resource_provider) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
void AppendContributingRenderPasses(RenderPassSink* render_pass_sink);
@@ -78,15 +78,14 @@
bool ConvertDelegatedRenderPassId(RenderPassId delegated_render_pass_id,
RenderPassId* output_render_pass_id) const;
- void AppendRenderPassQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data,
- const RenderPass* delegated_render_pass,
- const gfx::Size& frame_size) const;
+ void AppendRenderPassQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data,
+ const RenderPass* delegated_render_pass,
+ const gfx::Size& frame_size) const;
// LayerImpl overrides.
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
bool have_render_passes_to_push_;
float inverse_device_scale_factor_;
diff --git a/cc/layers/heads_up_display_layer.h b/cc/layers/heads_up_display_layer.h
index 12d6aef..22dcec8 100644
--- a/cc/layers/heads_up_display_layer.h
+++ b/cc/layers/heads_up_display_layer.h
@@ -22,11 +22,11 @@
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
protected:
HeadsUpDisplayLayer();
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
private:
virtual ~HeadsUpDisplayLayer();
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index ab9e8a4..85bb2f1 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -131,7 +131,7 @@
void HeadsUpDisplayLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
if (!resources_.back()->id())
return;
diff --git a/cc/layers/heads_up_display_layer_impl.h b/cc/layers/heads_up_display_layer_impl.h
index 3cba4f5..388dfcd 100644
--- a/cc/layers/heads_up_display_layer_impl.h
+++ b/cc/layers/heads_up_display_layer_impl.h
@@ -35,17 +35,17 @@
virtual ~HeadsUpDisplayLayerImpl();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
+ ResourceProvider* resource_provider) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
void UpdateHudTexture(DrawMode draw_mode,
ResourceProvider* resource_provider);
- virtual void ReleaseResources() OVERRIDE;
+ virtual void ReleaseResources() override;
bool IsAnimatingHUDContents() const { return fade_step_ > 0; }
@@ -70,9 +70,9 @@
HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl, int id);
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
void UpdateHudContents();
void DrawHudContents(SkCanvas* canvas);
diff --git a/cc/layers/heads_up_display_layer_impl_unittest.cc b/cc/layers/heads_up_display_layer_impl_unittest.cc
index 828a93a..d342d4f 100644
--- a/cc/layers/heads_up_display_layer_impl_unittest.cc
+++ b/cc/layers/heads_up_display_layer_impl_unittest.cc
@@ -7,7 +7,6 @@
#include "cc/test/fake_impl_proxy.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
-#include "cc/test/mock_occlusion_tracker.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -17,12 +16,11 @@
void CheckDrawLayer(HeadsUpDisplayLayerImpl* layer,
ResourceProvider* resource_provider,
DrawMode draw_mode) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
bool will_draw = layer->WillDraw(draw_mode, resource_provider);
if (will_draw)
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
layer->UpdateHudTexture(draw_mode, resource_provider);
if (will_draw)
layer->DidDraw(resource_provider);
diff --git a/cc/layers/heads_up_display_unittest.cc b/cc/layers/heads_up_display_unittest.cc
index b9bd5db..686338e 100644
--- a/cc/layers/heads_up_display_unittest.cc
+++ b/cc/layers/heads_up_display_unittest.cc
@@ -12,7 +12,7 @@
class HeadsUpDisplayTest : public LayerTreeTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// Enable the HUD without requiring text.
settings->initial_debug_state.show_property_changed_rects = true;
}
@@ -23,7 +23,7 @@
static scoped_refptr<DrawsContentLayer> Create() {
return make_scoped_refptr(new DrawsContentLayer());
}
- virtual bool DrawsContent() const OVERRIDE { return true; }
+ virtual bool DrawsContent() const override { return true; }
private:
DrawsContentLayer() : Layer() {}
@@ -37,14 +37,14 @@
root_layer2_(DrawsContentLayer::Create()),
num_commits_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
root_layer1_->SetBounds(gfx::Size(30, 30));
root_layer2_->SetBounds(gfx::Size(30, 30));
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
++num_commits_;
ASSERT_TRUE(layer_tree_host()->hud_layer());
@@ -86,7 +86,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
scoped_refptr<DrawsContentLayer> root_layer1_;
diff --git a/cc/layers/image_layer.h b/cc/layers/image_layer.h
index 63d467a..53d1f69 100644
--- a/cc/layers/image_layer.h
+++ b/cc/layers/image_layer.h
@@ -20,27 +20,27 @@
// Layer implementation.
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
- OVERRIDE;
+ override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
virtual void CalculateContentsScale(float ideal_contents_scale,
float* contents_scale_x,
float* contents_scale_y,
- gfx::Size* content_bounds) OVERRIDE;
- virtual void OnOutputSurfaceCreated() OVERRIDE;
+ gfx::Size* content_bounds) override;
+ virtual void OnOutputSurfaceCreated() override;
void SetBitmap(const SkBitmap& image);
protected:
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
private:
ImageLayer();
virtual ~ImageLayer();
// TiledLayer Implementation.
- virtual LayerUpdater* Updater() const OVERRIDE;
- virtual void CreateUpdaterIfNeeded() OVERRIDE;
+ virtual LayerUpdater* Updater() const override;
+ virtual void CreateUpdaterIfNeeded() override;
float ImageContentsScaleX() const;
float ImageContentsScaleY() const;
diff --git a/cc/layers/io_surface_layer.h b/cc/layers/io_surface_layer.h
index ad06e7f..681f1a1 100644
--- a/cc/layers/io_surface_layer.h
+++ b/cc/layers/io_surface_layer.h
@@ -17,13 +17,13 @@
void SetIOSurfaceProperties(uint32_t io_surface_id, const gfx::Size& size);
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
protected:
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
IOSurfaceLayer();
private:
diff --git a/cc/layers/io_surface_layer_impl.cc b/cc/layers/io_surface_layer_impl.cc
index 7cb86ce..8d22195 100644
--- a/cc/layers/io_surface_layer_impl.cc
+++ b/cc/layers/io_surface_layer_impl.cc
@@ -9,7 +9,7 @@
#include "cc/output/output_surface.h"
#include "cc/quads/io_surface_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
@@ -66,7 +66,7 @@
void IOSurfaceLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
@@ -78,9 +78,7 @@
gfx::Rect quad_rect(content_bounds());
gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect());
gfx::Rect visible_quad_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(
- draw_properties().target_space_transform)
- .GetUnoccludedContentRect(quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty())
return;
diff --git a/cc/layers/io_surface_layer_impl.h b/cc/layers/io_surface_layer_impl.h
index ac8142d..d6b6625 100644
--- a/cc/layers/io_surface_layer_impl.h
+++ b/cc/layers/io_surface_layer_impl.h
@@ -24,23 +24,23 @@
void SetIOSurfaceProperties(unsigned io_surface_id, const gfx::Size& size);
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer_tree_impl) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer_tree_impl) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
- virtual void ReleaseResources() OVERRIDE;
+ ResourceProvider* resource_provider) override;
+ virtual void ReleaseResources() override;
private:
IOSurfaceLayerImpl(LayerTreeImpl* tree_impl, int id);
void DestroyResource();
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
unsigned io_surface_id_;
gfx::Size io_surface_size_;
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index a627140..3e83e8f 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -552,16 +552,16 @@
void RemoveChildOrDependent(Layer* child);
// LayerAnimationValueProvider implementation.
- virtual gfx::ScrollOffset ScrollOffsetForAnimation() const OVERRIDE;
+ virtual gfx::ScrollOffset ScrollOffsetForAnimation() const override;
// LayerAnimationValueObserver implementation.
- virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE;
- virtual void OnOpacityAnimated(float opacity) OVERRIDE;
- virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE;
+ virtual void OnFilterAnimated(const FilterOperations& filters) override;
+ virtual void OnOpacityAnimated(float opacity) override;
+ virtual void OnTransformAnimated(const gfx::Transform& transform) override;
virtual void OnScrollOffsetAnimated(
- const gfx::ScrollOffset& scroll_offset) OVERRIDE;
- virtual void OnAnimationWaitingForDeletion() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
+ const gfx::ScrollOffset& scroll_offset) override;
+ virtual void OnAnimationWaitingForDeletion() override;
+ virtual bool IsActive() const override;
// If this layer has a scroll parent, it removes |this| from its list of
// scroll children.
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 3e0e009..6dfec0e 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -783,7 +783,7 @@
bounds_ = bounds;
- ScrollbarParametersDidChange();
+ ScrollbarParametersDidChange(true);
if (masks_to_bounds())
NoteLayerPropertyChangedForSubtree();
else
@@ -796,7 +796,7 @@
bounds_delta_ = bounds_delta;
- ScrollbarParametersDidChange();
+ ScrollbarParametersDidChange(true);
if (masks_to_bounds())
NoteLayerPropertyChangedForSubtree();
else
@@ -1123,7 +1123,7 @@
if (changed) {
NoteLayerPropertyChangedForSubtree();
- ScrollbarParametersDidChange();
+ ScrollbarParametersDidChange(false);
}
}
@@ -1229,7 +1229,8 @@
}
void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
- LayerImpl* scrollbar_clip_layer) const {
+ LayerImpl* scrollbar_clip_layer,
+ bool on_resize) const {
DCHECK(scrollbar_layer);
LayerImpl* page_scale_layer = layer_tree_impl()->page_scale_layer();
@@ -1314,7 +1315,7 @@
layer_tree_impl()->min_page_scale_factor()) ||
!layer_tree_impl()->settings().use_pinch_zoom_scrollbars);
if (is_animatable_scrollbar)
- scrollbar_animation_controller_->DidScrollUpdate();
+ scrollbar_animation_controller_->DidScrollUpdate(on_resize);
}
}
}
@@ -1377,14 +1378,17 @@
return false;
}
-void LayerImpl::ScrollbarParametersDidChange() {
+void LayerImpl::ScrollbarParametersDidChange(bool on_resize) {
if (!scrollbars_)
return;
for (ScrollbarSet::iterator it = scrollbars_->begin();
it != scrollbars_->end();
- ++it)
- (*it)->ScrollbarParametersDidChange();
+ ++it) {
+ bool is_scroll_layer = (*it)->ScrollLayerId() == layer_id_;
+ bool scroll_layer_resized = is_scroll_layer && on_resize;
+ (*it)->ScrollbarParametersDidChange(scroll_layer_resized);
+ }
}
void LayerImpl::SetNeedsPushProperties() {
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index fc7f1c6..1e8fa63 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -98,24 +98,24 @@
int id() const { return layer_id_; }
// LayerAnimationValueProvider implementation.
- virtual gfx::ScrollOffset ScrollOffsetForAnimation() const OVERRIDE;
+ virtual gfx::ScrollOffset ScrollOffsetForAnimation() const override;
// LayerAnimationValueObserver implementation.
- virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE;
- virtual void OnOpacityAnimated(float opacity) OVERRIDE;
- virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE;
+ virtual void OnFilterAnimated(const FilterOperations& filters) override;
+ virtual void OnOpacityAnimated(float opacity) override;
+ virtual void OnTransformAnimated(const gfx::Transform& transform) override;
virtual void OnScrollOffsetAnimated(
- const gfx::ScrollOffset& scroll_offset) OVERRIDE;
- virtual void OnAnimationWaitingForDeletion() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
+ const gfx::ScrollOffset& scroll_offset) override;
+ virtual void OnAnimationWaitingForDeletion() override;
+ virtual bool IsActive() const override;
// AnimationDelegate implementation.
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE{};
+ Animation::TargetProperty target_property) override{};
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE;
+ Animation::TargetProperty target_property) override;
// Tree structure.
LayerImpl* parent() { return parent_; }
@@ -195,7 +195,7 @@
virtual bool WillDraw(DrawMode draw_mode,
ResourceProvider* resource_provider);
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {}
virtual void DidDraw(ResourceProvider* resource_provider);
@@ -386,7 +386,8 @@
gfx::ScrollOffset MaxScrollOffset() const;
gfx::Vector2dF ClampScrollToMaxScrollOffset();
void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
- LayerImpl* scrollbar_clip_layer) const;
+ LayerImpl* scrollbar_clip_layer,
+ bool on_resize) const;
void SetScrollDelta(const gfx::Vector2dF& scroll_delta);
gfx::Vector2dF ScrollDelta() const;
@@ -513,7 +514,7 @@
void AddScrollbar(ScrollbarLayerImplBase* layer);
void RemoveScrollbar(ScrollbarLayerImplBase* layer);
bool HasScrollbar(ScrollbarOrientation orientation) const;
- void ScrollbarParametersDidChange();
+ void ScrollbarParametersDidChange(bool on_resize);
int clip_height() {
return scroll_clip_layer_ ? scroll_clip_layer_->bounds().height() : 0;
}
diff --git a/cc/layers/layer_impl_unittest.cc b/cc/layers/layer_impl_unittest.cc
index dc046a0..1d8289f 100644
--- a/cc/layers/layer_impl_unittest.cc
+++ b/cc/layers/layer_impl_unittest.cc
@@ -492,11 +492,11 @@
class ScrollDelegateIgnore : public LayerImpl::ScrollOffsetDelegate {
public:
virtual void SetTotalScrollOffset(
- const gfx::ScrollOffset& new_value) OVERRIDE {}
- virtual gfx::ScrollOffset GetTotalScrollOffset() OVERRIDE {
+ const gfx::ScrollOffset& new_value) override {}
+ virtual gfx::ScrollOffset GetTotalScrollOffset() override {
return gfx::ScrollOffset(fixed_offset_);
}
- virtual bool IsExternalFlingActive() const OVERRIDE { return false; }
+ virtual bool IsExternalFlingActive() const override { return false; }
void set_fixed_offset(const gfx::Vector2dF& fixed_offset) {
fixed_offset_ = fixed_offset;
@@ -542,13 +542,13 @@
class ScrollDelegateAccept : public LayerImpl::ScrollOffsetDelegate {
public:
virtual void SetTotalScrollOffset(
- const gfx::ScrollOffset& new_value) OVERRIDE {
+ const gfx::ScrollOffset& new_value) override {
current_offset_ = new_value;
}
- virtual gfx::ScrollOffset GetTotalScrollOffset() OVERRIDE {
+ virtual gfx::ScrollOffset GetTotalScrollOffset() override {
return current_offset_;
}
- virtual bool IsExternalFlingActive() const OVERRIDE { return false; }
+ virtual bool IsExternalFlingActive() const override { return false; }
private:
gfx::ScrollOffset current_offset_;
diff --git a/cc/layers/layer_iterator_unittest.cc b/cc/layers/layer_iterator_unittest.cc
index 1daa923..3aa98d2 100644
--- a/cc/layers/layer_iterator_unittest.cc
+++ b/cc/layers/layer_iterator_unittest.cc
@@ -31,7 +31,7 @@
int count_representing_contributing_surface_;
int count_representing_itself_;
- virtual bool DrawsContent() const OVERRIDE { return draws_content_; }
+ virtual bool DrawsContent() const override { return draws_content_; }
void set_draws_content(bool draws_content) { draws_content_ = draws_content; }
private:
diff --git a/cc/layers/layer_perftest.cc b/cc/layers/layer_perftest.cc
index 18b4355..14afcbf 100644
--- a/cc/layers/layer_perftest.cc
+++ b/cc/layers/layer_perftest.cc
@@ -23,7 +23,7 @@
class MockLayerPainter : public LayerPainter {
public:
- virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) OVERRIDE {
+ virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {
}
};
@@ -38,13 +38,13 @@
kTimeCheckInterval) {}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
layer_tree_host_ = FakeLayerTreeHost::Create(&fake_client_);
layer_tree_host_->InitializeSingleThreaded(
&fake_client_, base::MessageLoopProxy::current());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
layer_tree_host_->SetRootLayer(NULL);
layer_tree_host_ = nullptr;
}
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 0ea8f3d..32b4b4c 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -51,7 +51,7 @@
class MockLayerPainter : public LayerPainter {
public:
- virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) OVERRIDE {
+ virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {
}
};
@@ -62,11 +62,11 @@
fake_client_(FakeLayerTreeHostClient::DIRECT_3D) {}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
layer_tree_host_.reset(new StrictMock<MockLayerTreeHost>(&fake_client_));
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsFullTreeSync()).Times(AnyNumber());
parent_ = NULL;
@@ -1211,12 +1211,12 @@
return make_scoped_refptr(new DrawsContentChangeLayer());
}
- virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE {
+ virtual void SetLayerTreeHost(LayerTreeHost* host) override {
Layer::SetLayerTreeHost(host);
SetFakeDrawsContent(!fake_draws_content_);
}
- virtual bool HasDrawableContent() const OVERRIDE {
+ virtual bool HasDrawableContent() const override {
return fake_draws_content_ && Layer::HasDrawableContent();
}
@@ -1227,7 +1227,7 @@
private:
DrawsContentChangeLayer() : Layer(), fake_draws_content_(false) {}
- virtual ~DrawsContentChangeLayer() OVERRIDE {}
+ virtual ~DrawsContentChangeLayer() override {}
bool fake_draws_content_;
};
diff --git a/cc/layers/nine_patch_layer.h b/cc/layers/nine_patch_layer.h
index 61d3e01..c1891bc 100644
--- a/cc/layers/nine_patch_layer.h
+++ b/cc/layers/nine_patch_layer.h
@@ -21,7 +21,7 @@
public:
static scoped_refptr<NinePatchLayer> Create();
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
// |border| is the space around the center rectangular region in layer space
// (known as aperture in image space). |border.x()| and |border.y()| are the
@@ -43,7 +43,7 @@
NinePatchLayer();
virtual ~NinePatchLayer();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
gfx::Rect border_;
bool fill_center_;
diff --git a/cc/layers/nine_patch_layer_impl.cc b/cc/layers/nine_patch_layer_impl.cc
index ba3f30c..b350ba9 100644
--- a/cc/layers/nine_patch_layer_impl.cc
+++ b/cc/layers/nine_patch_layer_impl.cc
@@ -9,7 +9,7 @@
#include "cc/base/math_util.h"
#include "cc/quads/texture_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "ui/gfx/rect_f.h"
namespace cc {
@@ -82,7 +82,7 @@
void NinePatchLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
CheckGeometryLimitations();
SharedQuadState* shared_quad_state =
@@ -213,10 +213,8 @@
gfx::Rect visible_rect;
const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
- Occlusion occlusion =
- occlusion_tracker.GetCurrentOcclusionForLayer(draw_transform());
-
- visible_rect = occlusion.GetUnoccludedContentRect(layer_top_left);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_top_left);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -233,7 +231,8 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_top_right);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_top_right);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -250,7 +249,8 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_bottom_left);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_bottom_left);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -267,7 +267,8 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_bottom_right);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_bottom_right);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -284,7 +285,7 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_top);
+ visible_rect = occlusion_in_content_space.GetUnoccludedContentRect(layer_top);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -301,7 +302,8 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_left);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_left);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -318,7 +320,8 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_right);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_right);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -335,7 +338,8 @@
flipped);
}
- visible_rect = occlusion.GetUnoccludedContentRect(layer_bottom);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_bottom);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
@@ -353,7 +357,8 @@
}
if (fill_center_) {
- visible_rect = occlusion.GetUnoccludedContentRect(layer_center);
+ visible_rect =
+ occlusion_in_content_space.GetUnoccludedContentRect(layer_center);
if (!visible_rect.IsEmpty()) {
TextureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
diff --git a/cc/layers/nine_patch_layer_impl.h b/cc/layers/nine_patch_layer_impl.h
index 235b182..0674ecb 100644
--- a/cc/layers/nine_patch_layer_impl.h
+++ b/cc/layers/nine_patch_layer_impl.h
@@ -58,20 +58,20 @@
bool fill_center);
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
- virtual base::DictionaryValue* LayerTreeAsJson() const OVERRIDE;
+ virtual base::DictionaryValue* LayerTreeAsJson() const override;
protected:
NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id);
private:
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
void CheckGeometryLimitations();
diff --git a/cc/layers/nine_patch_layer_impl_unittest.cc b/cc/layers/nine_patch_layer_impl_unittest.cc
index 9d1d870..2b82d48 100644
--- a/cc/layers/nine_patch_layer_impl_unittest.cc
+++ b/cc/layers/nine_patch_layer_impl_unittest.cc
@@ -35,7 +35,6 @@
const gfx::Rect& border,
bool fill_center,
size_t expected_quad_size) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
gfx::Rect visible_content_rect(layer_size);
gfx::Rect expected_remaining(border.x(),
@@ -63,15 +62,14 @@
layer->SetImageBounds(bitmap_size);
layer->SetLayout(aperture_rect, border, fill_center);
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
// Verify quad rects
const QuadList& quads = render_pass->quad_list;
EXPECT_EQ(expected_quad_size, quads.size());
Region remaining(visible_content_rect);
- for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
- ++iter) {
+ for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) {
gfx::Rect quad_rect = iter->rect;
EXPECT_TRUE(visible_content_rect.Contains(quad_rect)) << iter.index();
@@ -90,9 +88,8 @@
// Verify UV rects
gfx::Rect bitmap_rect(bitmap_size);
Region tex_remaining(bitmap_rect);
- for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
- ++iter) {
- const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(&*iter);
+ for (const auto& quad : quads) {
+ const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(&quad);
gfx::RectF tex_rect =
gfx::BoundingRect(tex_quad->uv_top_left, tex_quad->uv_bottom_right);
tex_rect.Scale(bitmap_size.width(), bitmap_size.height());
diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h
index cd6a046..8a621e3 100644
--- a/cc/layers/painted_scrollbar_layer.h
+++ b/cc/layers/painted_scrollbar_layer.h
@@ -20,32 +20,32 @@
public ContentsScalingLayer {
public:
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
static scoped_refptr<PaintedScrollbarLayer> Create(
scoped_ptr<Scrollbar> scrollbar,
int scroll_layer_id);
- virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE;
- virtual ScrollbarLayerInterface* ToScrollbarLayer() OVERRIDE;
+ virtual bool OpacityCanAnimateOnImplThread() const override;
+ virtual ScrollbarLayerInterface* ToScrollbarLayer() override;
// ScrollbarLayerInterface
- virtual int ScrollLayerId() const OVERRIDE;
- virtual void SetScrollLayer(int layer_id) OVERRIDE;
- virtual void SetClipLayer(int layer_id) OVERRIDE;
+ virtual int ScrollLayerId() const override;
+ virtual void SetScrollLayer(int layer_id) override;
+ virtual void SetClipLayer(int layer_id) override;
- virtual ScrollbarOrientation orientation() const OVERRIDE;
+ virtual ScrollbarOrientation orientation() const override;
// Layer interface
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
- virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
- virtual void PushScrollClipPropertiesTo(LayerImpl* layer) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
+ virtual void SetLayerTreeHost(LayerTreeHost* host) override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual void PushScrollClipPropertiesTo(LayerImpl* layer) override;
virtual void CalculateContentsScale(float ideal_contents_scale,
float* contents_scale_x,
float* contents_scale_y,
- gfx::Size* content_bounds) OVERRIDE;
+ gfx::Size* content_bounds) override;
protected:
PaintedScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, int scroll_layer_id);
diff --git a/cc/layers/painted_scrollbar_layer_impl.cc b/cc/layers/painted_scrollbar_layer_impl.cc
index 16196dd..dcb1e82 100644
--- a/cc/layers/painted_scrollbar_layer_impl.cc
+++ b/cc/layers/painted_scrollbar_layer_impl.cc
@@ -12,7 +12,7 @@
#include "cc/quads/texture_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/layer_tree_settings.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "ui/gfx/rect_conversions.h"
namespace cc {
@@ -69,7 +69,7 @@
void PaintedScrollbarLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
bool premultipled_alpha = true;
bool flipped = false;
@@ -86,10 +86,8 @@
render_pass, content_bounds(), shared_quad_state, append_quads_data);
gfx::Rect thumb_quad_rect = ComputeThumbQuadRect();
- Occlusion occlusion =
- occlusion_tracker.GetCurrentOcclusionForLayer(draw_transform());
gfx::Rect visible_thumb_quad_rect =
- occlusion.GetUnoccludedContentRect(thumb_quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(thumb_quad_rect);
ResourceProvider::ResourceId thumb_resource_id =
layer_tree_impl()->ResourceIdForUIResource(thumb_ui_resource_id_);
@@ -116,7 +114,7 @@
gfx::Rect track_quad_rect = content_bounds_rect;
gfx::Rect visible_track_quad_rect =
- occlusion.GetUnoccludedContentRect(track_quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(track_quad_rect);
if (track_resource_id && !visible_track_quad_rect.IsEmpty()) {
gfx::Rect opaque_rect(contents_opaque() ? track_quad_rect : gfx::Rect());
const float opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};
diff --git a/cc/layers/painted_scrollbar_layer_impl.h b/cc/layers/painted_scrollbar_layer_impl.h
index 4ebefb6..1c67e73 100644
--- a/cc/layers/painted_scrollbar_layer_impl.h
+++ b/cc/layers/painted_scrollbar_layer_impl.h
@@ -25,14 +25,14 @@
// LayerImpl implementation.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
+ ResourceProvider* resource_provider) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
void SetThumbThickness(int thumb_thickness);
void SetThumbLength(int thumb_length);
@@ -52,14 +52,14 @@
ScrollbarOrientation orientation);
// ScrollbarLayerImplBase implementation.
- virtual int ThumbThickness() const OVERRIDE;
- virtual int ThumbLength() const OVERRIDE;
- virtual float TrackLength() const OVERRIDE;
- virtual int TrackStart() const OVERRIDE;
- virtual bool IsThumbResizable() const OVERRIDE;
+ virtual int ThumbThickness() const override;
+ virtual int ThumbLength() const override;
+ virtual float TrackLength() const override;
+ virtual int TrackStart() const override;
+ virtual bool IsThumbResizable() const override;
private:
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
UIResourceId track_ui_resource_id_;
UIResourceId thumb_ui_resource_id_;
diff --git a/cc/layers/picture_image_layer.h b/cc/layers/picture_image_layer.h
index c0c0c84..6f73b42 100644
--- a/cc/layers/picture_image_layer.h
+++ b/cc/layers/picture_image_layer.h
@@ -21,18 +21,18 @@
// Layer implementation.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(
- LayerTreeImpl* tree_impl) OVERRIDE;
+ LayerTreeImpl* tree_impl) override;
// ContentLayerClient implementation.
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE;
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
- virtual bool FillsBoundsCompletely() const OVERRIDE;
+ ContentLayerClient::GraphicsContextStatus gc_status) override;
+ virtual void DidChangeLayerCanUseLCDText() override {}
+ virtual bool FillsBoundsCompletely() const override;
protected:
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
private:
PictureImageLayer();
diff --git a/cc/layers/picture_image_layer_impl.h b/cc/layers/picture_image_layer_impl.h
index cb48cf5..db36a13 100644
--- a/cc/layers/picture_image_layer_impl.h
+++ b/cc/layers/picture_image_layer_impl.h
@@ -18,19 +18,19 @@
virtual ~PictureImageLayerImpl();
// LayerImpl overrides.
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
virtual scoped_ptr<LayerImpl> CreateLayerImpl(
- LayerTreeImpl* tree_impl) OVERRIDE;
+ LayerTreeImpl* tree_impl) override;
protected:
PictureImageLayerImpl(LayerTreeImpl* tree_impl, int id);
- virtual bool ShouldAdjustRasterScale() const OVERRIDE;
- virtual void RecalculateRasterScales() OVERRIDE;
+ virtual bool ShouldAdjustRasterScale() const override;
+ virtual void RecalculateRasterScales() override;
virtual void GetDebugBorderProperties(
- SkColor* color, float* width) const OVERRIDE;
+ SkColor* color, float* width) const override;
- virtual void UpdateIdealScales() OVERRIDE;
+ virtual void UpdateIdealScales() override;
private:
DISALLOW_COPY_AND_ASSIGN(PictureImageLayerImpl);
diff --git a/cc/layers/picture_image_layer_impl_unittest.cc b/cc/layers/picture_image_layer_impl_unittest.cc
index 831e3b0..5c2ef4e 100644
--- a/cc/layers/picture_image_layer_impl_unittest.cc
+++ b/cc/layers/picture_image_layer_impl_unittest.cc
@@ -12,7 +12,6 @@
#include "cc/test/fake_output_surface.h"
#include "cc/test/fake_picture_layer_tiling_client.h"
#include "cc/test/impl_side_painting_settings.h"
-#include "cc/test/mock_occlusion_tracker.h"
#include "cc/test/test_shared_bitmap_manager.h"
#include "cc/trees/layer_tree_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -147,11 +146,10 @@
// Draw.
active_layer->draw_properties().visible_content_rect =
gfx::Rect(active_layer->bounds());
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer->WillDraw(DRAW_MODE_SOFTWARE, NULL);
- active_layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer->DidDraw(NULL);
EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material);
diff --git a/cc/layers/picture_layer.h b/cc/layers/picture_layer.h
index 80bb4d8..978ec40 100644
--- a/cc/layers/picture_layer.h
+++ b/cc/layers/picture_layer.h
@@ -25,18 +25,18 @@
// Layer interface.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(
- LayerTreeImpl* tree_impl) OVERRIDE;
- virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
- virtual void SetNeedsDisplayRect(const gfx::RectF& layer_rect) OVERRIDE;
+ LayerTreeImpl* tree_impl) override;
+ virtual void SetLayerTreeHost(LayerTreeHost* host) override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual void SetNeedsDisplayRect(const gfx::RectF& layer_rect) override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
- virtual void SetIsMask(bool is_mask) OVERRIDE;
- virtual bool SupportsLCDText() const OVERRIDE;
- virtual skia::RefPtr<SkPicture> GetPicture() const OVERRIDE;
- virtual bool IsSuitableForGpuRasterization() const OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
+ virtual void SetIsMask(bool is_mask) override;
+ virtual bool SupportsLCDText() const override;
+ virtual skia::RefPtr<SkPicture> GetPicture() const override;
+ virtual bool IsSuitableForGpuRasterization() const override;
- virtual void RunMicroBenchmark(MicroBenchmark* benchmark) OVERRIDE;
+ virtual void RunMicroBenchmark(MicroBenchmark* benchmark) override;
ContentLayerClient* client() { return client_; }
@@ -48,7 +48,7 @@
explicit PictureLayer(ContentLayerClient* client);
virtual ~PictureLayer();
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
void UpdateCanUseLCDText();
private:
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 8a78bb1..de176c3 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -25,7 +25,7 @@
#include "cc/quads/tile_draw_quad.h"
#include "cc/resources/tile_manager.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "ui/gfx/quad_f.h"
#include "ui/gfx/rect_conversions.h"
#include "ui/gfx/size_conversions.h"
@@ -150,10 +150,9 @@
needs_push_properties_ = true;
}
-void PictureLayerImpl::AppendQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) {
+void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) {
DCHECK(!needs_post_commit_initialization_);
SharedQuadState* shared_quad_state =
@@ -165,14 +164,12 @@
AppendDebugBorderQuad(
render_pass, content_bounds(), shared_quad_state, append_quads_data);
- SolidColorLayerImpl::AppendSolidQuads(
- render_pass,
- occlusion_tracker,
- shared_quad_state,
- content_bounds(),
- draw_properties().target_space_transform,
- pile_->solid_color(),
- append_quads_data);
+ SolidColorLayerImpl::AppendSolidQuads(render_pass,
+ occlusion_in_content_space,
+ shared_quad_state,
+ content_bounds(),
+ pile_->solid_color(),
+ append_quads_data);
return;
}
@@ -182,13 +179,12 @@
SK_MScalar1 / max_contents_scale);
gfx::Size scaled_content_bounds =
gfx::ToCeiledSize(gfx::ScaleSize(content_bounds(), max_contents_scale));
-
gfx::Rect scaled_visible_content_rect =
gfx::ScaleToEnclosingRect(visible_content_rect(), max_contents_scale);
scaled_visible_content_rect.Intersect(gfx::Rect(scaled_content_bounds));
-
- Occlusion occlusion =
- occlusion_tracker.GetCurrentOcclusionForLayer(scaled_draw_transform);
+ Occlusion scaled_occlusion =
+ occlusion_in_content_space.GetOcclusionWithGivenDrawTransform(
+ scaled_draw_transform);
shared_quad_state->SetAll(scaled_draw_transform,
scaled_content_bounds,
@@ -211,7 +207,7 @@
gfx::Rect geometry_rect = scaled_visible_content_rect;
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
gfx::Rect visible_geometry_rect =
- occlusion.GetUnoccludedContentRect(geometry_rect);
+ scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
if (visible_geometry_rect.IsEmpty())
return;
@@ -306,7 +302,7 @@
gfx::Rect geometry_rect = iter.geometry_rect();
gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect();
gfx::Rect visible_geometry_rect =
- occlusion.GetUnoccludedContentRect(geometry_rect);
+ scaled_occlusion.GetUnoccludedContentRect(geometry_rect);
if (visible_geometry_rect.IsEmpty())
continue;
@@ -449,17 +445,9 @@
DoPostCommitInitializationIfNeeded();
- // Any draw properties derived from |transform|, |viewport|, and |clip|
- // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid
- // for prioritizing tiles during resourceless software draws. This is because
- // resourceless software draws can have wildly different transforms/viewports
- // from regular draws.
if (!resourceless_software_draw) {
visible_rect_for_tile_priority_ = visible_content_rect();
}
- viewport_rect_for_tile_priority_ =
- layer_tree_impl()->ViewportRectForTilePriority();
- screen_space_transform_for_tile_priority_ = screen_space_transform();
if (!CanHaveTilings()) {
ideal_page_scale_ = 0.f;
@@ -537,20 +525,21 @@
gfx::Rect PictureLayerImpl::GetViewportForTilePriorityInContentSpace() const {
// If visible_rect_for_tile_priority_ is empty or
- // viewport_rect_for_tile_priority_ is set to be different from the device
+ // viewport_rect_for_tile_priority is set to be different from the device
// viewport, try to inverse project the viewport into layer space and use
// that. Otherwise just use visible_rect_for_tile_priority_
gfx::Rect visible_rect_in_content_space = visible_rect_for_tile_priority_;
+ gfx::Rect viewport_rect_for_tile_priority =
+ layer_tree_impl()->ViewportRectForTilePriority();
if (visible_rect_in_content_space.IsEmpty() ||
- layer_tree_impl()->DeviceViewport() != viewport_rect_for_tile_priority_) {
+ layer_tree_impl()->DeviceViewport() != viewport_rect_for_tile_priority) {
gfx::Transform view_to_layer(gfx::Transform::kSkipInitialization);
-
- if (screen_space_transform_for_tile_priority_.GetInverse(&view_to_layer)) {
+ if (screen_space_transform().GetInverse(&view_to_layer)) {
// Transform from view space to content space.
visible_rect_in_content_space =
gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
- view_to_layer, viewport_rect_for_tile_priority_));
+ view_to_layer, viewport_rect_for_tile_priority));
}
}
return visible_rect_in_content_space;
diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h
index a0cc434..98b0a6e 100644
--- a/cc/layers/picture_layer_impl.h
+++ b/cc/layers/picture_layer_impl.h
@@ -102,47 +102,47 @@
virtual ~PictureLayerImpl();
// LayerImpl overrides.
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
virtual void UpdateTiles(const Occlusion& occlusion_in_content_space,
- bool resourceless_software_draw) OVERRIDE;
- virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE;
- virtual void DidBecomeActive() OVERRIDE;
- virtual void DidBeginTracing() OVERRIDE;
- virtual void ReleaseResources() OVERRIDE;
- virtual skia::RefPtr<SkPicture> GetPicture() OVERRIDE;
+ bool resourceless_software_draw) override;
+ virtual void NotifyTileStateChanged(const Tile* tile) override;
+ virtual void DidBecomeActive() override;
+ virtual void DidBeginTracing() override;
+ virtual void ReleaseResources() override;
+ virtual skia::RefPtr<SkPicture> GetPicture() override;
// PictureLayerTilingClient overrides.
virtual scoped_refptr<Tile> CreateTile(
PictureLayerTiling* tiling,
- const gfx::Rect& content_rect) OVERRIDE;
- virtual PicturePileImpl* GetPile() OVERRIDE;
+ const gfx::Rect& content_rect) override;
+ virtual PicturePileImpl* GetPile() override;
virtual gfx::Size CalculateTileSize(
- const gfx::Size& content_bounds) const OVERRIDE;
- virtual const Region* GetInvalidation() OVERRIDE;
+ const gfx::Size& content_bounds) const override;
+ virtual const Region* GetInvalidation() override;
virtual const PictureLayerTiling* GetTwinTiling(
- const PictureLayerTiling* tiling) const OVERRIDE;
+ const PictureLayerTiling* tiling) const override;
virtual PictureLayerTiling* GetRecycledTwinTiling(
- const PictureLayerTiling* tiling) OVERRIDE;
- virtual size_t GetMaxTilesForInterestArea() const OVERRIDE;
- virtual float GetSkewportTargetTimeInSeconds() const OVERRIDE;
- virtual int GetSkewportExtrapolationLimitInContentPixels() const OVERRIDE;
- virtual WhichTree GetTree() const OVERRIDE;
+ const PictureLayerTiling* tiling) override;
+ virtual size_t GetMaxTilesForInterestArea() const override;
+ virtual float GetSkewportTargetTimeInSeconds() const override;
+ virtual int GetSkewportExtrapolationLimitInContentPixels() const override;
+ virtual WhichTree GetTree() const override;
// PushPropertiesTo active tree => pending tree.
void SyncTiling(const PictureLayerTiling* tiling);
// Mask-related functions.
- virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE;
+ virtual ResourceProvider::ResourceId ContentsResourceId() const override;
- virtual size_t GPUMemoryUsageInBytes() const OVERRIDE;
+ virtual size_t GPUMemoryUsageInBytes() const override;
- virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE;
+ virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override;
// Functions used by tile manager.
PictureLayerImpl* GetTwinLayer() { return twin_layer_; }
@@ -190,10 +190,10 @@
bool ShouldAdjustRasterScaleDuringScaleAnimations() const;
virtual void GetDebugBorderProperties(
- SkColor* color, float* width) const OVERRIDE;
+ SkColor* color, float* width) const override;
virtual void GetAllTilesForTracing(
- std::set<const Tile*>* tiles) const OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ std::set<const Tile*>* tiles) const override;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
virtual void UpdateIdealScales();
float MaximumTilingContentsScale() const;
@@ -222,11 +222,13 @@
// after a CalculateContentsScale/ManageTilings.
bool should_update_tile_priorities_;
- // Save a copy of the visible rect and viewport size of the last frame that
- // has a valid viewport for prioritizing tiles.
+ // Any draw properties derived from |transform|, |viewport|, and |clip|
+ // parameters in LayerTreeHostImpl::SetExternalDrawConstraints are not valid
+ // for prioritizing tiles during resourceless software draws. This is because
+ // resourceless software draws can have wildly different transforms/viewports
+ // from regular draws. Save a copy of the required draw properties of the last
+ // frame that has a valid viewport for prioritizing tiles.
gfx::Rect visible_rect_for_tile_priority_;
- gfx::Rect viewport_rect_for_tile_priority_;
- gfx::Transform screen_space_transform_for_tile_priority_;
friend class PictureLayer;
DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
diff --git a/cc/layers/picture_layer_impl_perftest.cc b/cc/layers/picture_layer_impl_perftest.cc
index c26b07d..7d87424 100644
--- a/cc/layers/picture_layer_impl_perftest.cc
+++ b/cc/layers/picture_layer_impl_perftest.cc
@@ -45,7 +45,7 @@
base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
kTimeCheckInterval) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
host_impl_.InitializeRenderer(FakeOutputSurface::Create3d());
}
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc
index 20e61dc..72794b3 100644
--- a/cc/layers/picture_layer_impl_unittest.cc
+++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -38,7 +38,7 @@
public:
explicit MockCanvas(int w, int h) : SkCanvas(w, h) {}
- virtual void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE {
+ virtual void drawRect(const SkRect& rect, const SkPaint& paint) override {
// Capture calls before SkCanvas quickReject() kicks in.
rects_.push_back(rect);
}
@@ -71,7 +71,7 @@
virtual ~PictureLayerImplTest() {
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
InitializeRenderer();
}
@@ -353,18 +353,14 @@
viewport_rect_for_tile_priority,
transform_for_tile_priority,
resourceless_software_draw);
- active_layer_->draw_properties().visible_content_rect = viewport;
- active_layer_->draw_properties().screen_space_transform = transform;
- active_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
+ host_impl_.active_tree()->UpdateDrawProperties();
gfx::Rect viewport_rect_for_tile_priority_in_view_space =
viewport_rect_for_tile_priority;
- // Verify the viewport rect for tile priority is used in picture layer impl.
- EXPECT_EQ(active_layer_->viewport_rect_for_tile_priority(),
- viewport_rect_for_tile_priority_in_view_space);
-
// Verify the viewport rect for tile priority is used in picture layer tiling.
+ EXPECT_EQ(viewport_rect_for_tile_priority_in_view_space,
+ active_layer_->GetViewportForTilePriorityInContentSpace());
PictureLayerTilingSet* tilings = active_layer_->tilings();
for (size_t i = 0; i < tilings->num_tilings(); i++) {
PictureLayerTiling* tiling = tilings->tiling_at(i);
@@ -391,9 +387,7 @@
viewport_rect_for_tile_priority,
transform_for_tile_priority,
resourceless_software_draw);
- active_layer_->draw_properties().visible_content_rect = viewport;
- active_layer_->draw_properties().screen_space_transform = transform;
- active_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
+ host_impl_.active_tree()->UpdateDrawProperties();
gfx::Transform screen_to_view(gfx::Transform::kSkipInitialization);
bool success = transform_for_tile_priority.GetInverse(&screen_to_view);
@@ -407,10 +401,8 @@
gfx::ToEnclosingRect(MathUtil::ProjectClippedRect(
screen_to_view, viewport_rect_for_tile_priority));
- // Verify the viewport rect for tile priority is used in PictureLayerImpl.
- EXPECT_EQ(active_layer_->viewport_rect_for_tile_priority(),
- viewport_rect_for_tile_priority_in_view_space);
-
+ EXPECT_EQ(viewport_rect_for_tile_priority_in_view_space,
+ active_layer_->GetViewportForTilePriorityInContentSpace());
tilings = active_layer_->tilings();
for (size_t i = 0; i < tilings->num_tilings(); i++) {
PictureLayerTiling* tiling = tilings->tiling_at(i);
@@ -460,11 +452,8 @@
gfx::Rect visible_rect_for_tile_priority =
active_layer_->visible_rect_for_tile_priority();
EXPECT_FALSE(visible_rect_for_tile_priority.IsEmpty());
- gfx::Rect viewport_rect_for_tile_priority =
- active_layer_->viewport_rect_for_tile_priority();
- EXPECT_FALSE(viewport_rect_for_tile_priority.IsEmpty());
gfx::Transform screen_space_transform_for_tile_priority =
- active_layer_->screen_space_transform_for_tile_priority();
+ active_layer_->screen_space_transform();
// Expand viewport and set it as invalid for prioritizing tiles.
// Should update viewport and transform, but not update visible rect.
@@ -484,10 +473,9 @@
resourceless_software_draw);
active_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
- // Viewport and transform for tile priority are updated.
- EXPECT_EQ(viewport, active_layer_->viewport_rect_for_tile_priority());
- EXPECT_TRANSFORMATION_MATRIX_EQ(
- transform, active_layer_->screen_space_transform_for_tile_priority());
+ // Transform for tile priority is updated.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(transform,
+ active_layer_->screen_space_transform());
// Visible rect for tile priority retains old value.
EXPECT_EQ(visible_rect_for_tile_priority,
active_layer_->visible_rect_for_tile_priority());
@@ -505,13 +493,9 @@
resourceless_software_draw);
active_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
- EXPECT_TRANSFORMATION_MATRIX_EQ(
- transform, active_layer_->screen_space_transform_for_tile_priority());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(transform,
+ active_layer_->screen_space_transform());
EXPECT_EQ(viewport, active_layer_->visible_rect_for_tile_priority());
-
- // Match the reverse translate in |transform|.
- EXPECT_EQ(viewport - gfx::Vector2d(1, 1),
- active_layer_->viewport_rect_for_tile_priority());
}
TEST_F(PictureLayerImplTest, ClonePartialInvalidation) {
@@ -1377,7 +1361,6 @@
}
TEST_F(PictureLayerImplTest, DisallowTileDrawQuads) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
gfx::Size tile_size(400, 400);
@@ -1399,7 +1382,7 @@
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_RESOURCELESS_SOFTWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
ASSERT_EQ(1U, render_pass->quad_list.size());
@@ -1580,11 +1563,10 @@
host_impl_.active_tree()->UpdateDrawProperties();
active_layer_->draw_properties().visible_content_rect = visible_content_rect;
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
// All tiles in activation rect is ready to draw.
@@ -1615,11 +1597,10 @@
active_layer_->tilings()->tiling_at(0)->AllTilesForTesting();
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(tiles);
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
// All high res tiles drew, nothing was incomplete.
@@ -1657,11 +1638,10 @@
active_layer_->tilings()->tiling_at(1)->AllTilesForTesting();
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(low_tiles);
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
// The missing high res tile was replaced by a low res tile.
@@ -1719,11 +1699,10 @@
active_layer_->HighResTiling()->AllTilesForTesting();
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(high_tiles);
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
// All high res tiles drew, and the one ideal res tile drew.
@@ -2237,14 +2216,14 @@
class DeferredInitPictureLayerImplTest : public PictureLayerImplTest {
public:
- virtual void InitializeRenderer() OVERRIDE {
+ virtual void InitializeRenderer() override {
bool delegated_rendering = false;
host_impl_.InitializeRenderer(FakeOutputSurface::CreateDeferredGL(
scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice),
delegated_rendering));
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
PictureLayerImplTest::SetUp();
// Create some default active and pending trees.
@@ -3197,11 +3176,8 @@
gfx::Rect visible_rect_for_tile_priority =
active_layer_->visible_rect_for_tile_priority();
EXPECT_FALSE(visible_rect_for_tile_priority.IsEmpty());
- gfx::Rect viewport_rect_for_tile_priority =
- active_layer_->viewport_rect_for_tile_priority();
- EXPECT_FALSE(viewport_rect_for_tile_priority.IsEmpty());
gfx::Transform screen_space_transform_for_tile_priority =
- active_layer_->screen_space_transform_for_tile_priority();
+ active_layer_->screen_space_transform();
// Expand viewport and set it as invalid for prioritizing tiles.
// Should update viewport and transform, but not update visible rect.
@@ -3221,10 +3197,9 @@
resourceless_software_draw);
active_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
- // Viewport and transform for tile priority are updated.
- EXPECT_EQ(viewport, active_layer_->viewport_rect_for_tile_priority());
- EXPECT_TRANSFORMATION_MATRIX_EQ(
- transform, active_layer_->screen_space_transform_for_tile_priority());
+ // Transform for tile priority is updated.
+ EXPECT_TRANSFORMATION_MATRIX_EQ(transform,
+ active_layer_->screen_space_transform());
// Visible rect for tile priority retains old value.
EXPECT_EQ(visible_rect_for_tile_priority,
active_layer_->visible_rect_for_tile_priority());
@@ -3242,13 +3217,9 @@
resourceless_software_draw);
active_layer_->UpdateTiles(Occlusion(), resourceless_software_draw);
- EXPECT_TRANSFORMATION_MATRIX_EQ(
- transform, active_layer_->screen_space_transform_for_tile_priority());
+ EXPECT_TRANSFORMATION_MATRIX_EQ(transform,
+ active_layer_->screen_space_transform());
EXPECT_EQ(viewport, active_layer_->visible_rect_for_tile_priority());
-
- // Match the reverse translate in |transform|.
- EXPECT_EQ(viewport - gfx::Vector2d(1, 1),
- active_layer_->viewport_rect_for_tile_priority());
}
TEST_F(NoLowResPictureLayerImplTest, CleanUpTilings) {
@@ -3468,7 +3439,6 @@
}
TEST_F(PictureLayerImplTest, SharedQuadStateContainsMaxTilingScale) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
gfx::Size tile_size(400, 400);
@@ -3494,7 +3464,7 @@
SK_MScalar1 / max_contents_scale);
AppendQuadsData data;
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
// SharedQuadState should have be of size 1, as we are doing AppenQuad once.
EXPECT_EQ(1u, render_pass->shared_quad_state_list.size());
@@ -3564,7 +3534,7 @@
public:
PictureLayerImplTestWithDelegatingRenderer() : PictureLayerImplTest() {}
- virtual void InitializeRenderer() OVERRIDE {
+ virtual void InitializeRenderer() override {
host_impl_.InitializeRenderer(FakeOutputSurface::CreateDelegating3d());
}
};
@@ -3603,11 +3573,10 @@
host_impl_.SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
host_impl_.ManageTiles();
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_HARDWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
// Even when OOM, quads should be produced, and should be different material
@@ -4314,11 +4283,10 @@
host_impl_.tile_manager()->InitializeTilesWithResourcesForTesting(tiles);
}
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
active_layer_->WillDraw(DRAW_MODE_SOFTWARE, NULL);
- active_layer_->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ active_layer_->AppendQuads(render_pass.get(), Occlusion(), &data);
active_layer_->DidDraw(NULL);
DrawQuad::Material expected = test_for_solid
diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc
index 331193f..0e3d8fa 100644
--- a/cc/layers/picture_layer_unittest.cc
+++ b/cc/layers/picture_layer_unittest.cc
@@ -23,9 +23,9 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
- virtual bool FillsBoundsCompletely() const OVERRIDE {
+ ContentLayerClient::GraphicsContextStatus gc_status) override {}
+ virtual void DidChangeLayerCanUseLCDText() override {}
+ virtual bool FillsBoundsCompletely() const override {
return false;
};
};
diff --git a/cc/layers/render_surface_unittest.cc b/cc/layers/render_surface_unittest.cc
index f9ac05b..b57152a 100644
--- a/cc/layers/render_surface_unittest.cc
+++ b/cc/layers/render_surface_unittest.cc
@@ -135,7 +135,7 @@
class TestRenderPassSink : public RenderPassSink {
public:
- virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE {
+ virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override {
render_passes_.push_back(render_pass.Pass());
}
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index c1878b9..204b491 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -92,7 +92,7 @@
RegisterScrollbarWithLayers(
this, clip_layer_, scroll_layer_, &LayerImpl::AddScrollbar);
- ScrollbarParametersDidChange();
+ ScrollbarParametersDidChange(false);
}
gfx::Rect ScrollbarLayerImplBase::ScrollbarLayerRectToContentRect(
@@ -247,11 +247,11 @@
return ScrollbarLayerRectToContentRect(thumb_rect);
}
-void ScrollbarLayerImplBase::ScrollbarParametersDidChange() {
+void ScrollbarLayerImplBase::ScrollbarParametersDidChange(bool on_resize) {
if (!clip_layer_ || !scroll_layer_)
return;
- scroll_layer_->SetScrollbarPosition(this, clip_layer_);
+ scroll_layer_->SetScrollbarPosition(this, clip_layer_, on_resize);
}
} // namespace cc
diff --git a/cc/layers/scrollbar_layer_impl_base.h b/cc/layers/scrollbar_layer_impl_base.h
index 7017ba2..7d37acc 100644
--- a/cc/layers/scrollbar_layer_impl_base.h
+++ b/cc/layers/scrollbar_layer_impl_base.h
@@ -44,8 +44,8 @@
return is_left_side_vertical_scrollbar_;
}
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
- virtual ScrollbarLayerImplBase* ToScrollbarLayer() OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual ScrollbarLayerImplBase* ToScrollbarLayer() override;
void PushScrollClipPropertiesTo(LayerImpl* layer);
bool SetVisibleToTotalLengthRatio(float ratio);
@@ -56,7 +56,7 @@
}
bool SetThumbThicknessScaleFactor(float thumb_thickness_scale_factor);
- void ScrollbarParametersDidChange();
+ void ScrollbarParametersDidChange(bool on_resize);
protected:
ScrollbarLayerImplBase(LayerTreeImpl* tree_impl,
diff --git a/cc/layers/scrollbar_layer_unittest.cc b/cc/layers/scrollbar_layer_unittest.cc
index 44158d5..9db5d3b 100644
--- a/cc/layers/scrollbar_layer_unittest.cc
+++ b/cc/layers/scrollbar_layer_unittest.cc
@@ -193,7 +193,7 @@
root_layer_impl = root_clip_layer_impl->children()[0]; \
scrollbar_layer_impl = static_cast<PaintedScrollbarLayerImpl*>( \
root_layer_impl->children()[1]); \
- scrollbar_layer_impl->ScrollbarParametersDidChange(); \
+ scrollbar_layer_impl->ScrollbarParametersDidChange(false); \
} while (false)
TEST(ScrollbarLayerTest, UpdatePropertiesOfScrollBarWhenThumbRemoved) {
@@ -345,11 +345,9 @@
// Thickness should be overridden to 3.
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- scrollbar_layer_impl->AppendQuads(
- render_pass.get(), occlusion_tracker, &data);
+ scrollbar_layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
const QuadList& quads = render_pass->quad_list;
ASSERT_EQ(1u, quads.size());
@@ -361,11 +359,9 @@
scrollbar_layer_impl->draw_properties().contents_scale_x = 2.f;
scrollbar_layer_impl->draw_properties().contents_scale_y = 2.f;
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- scrollbar_layer_impl->AppendQuads(
- render_pass.get(), occlusion_tracker, &data);
+ scrollbar_layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
const QuadList& quads = render_pass->quad_list;
ASSERT_EQ(1u, quads.size());
@@ -379,11 +375,9 @@
// current viewport state.
scrollbar_layer_impl->SetVisibleToTotalLengthRatio(0.2f);
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- scrollbar_layer_impl->AppendQuads(
- render_pass.get(), occlusion_tracker, &data);
+ scrollbar_layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
const QuadList& quads = render_pass->quad_list;
ASSERT_EQ(1u, quads.size());
@@ -395,11 +389,9 @@
scrollbar_layer_impl->SetCurrentPos(0.f);
scrollbar_layer_impl->SetMaximum(0);
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- scrollbar_layer_impl->AppendQuads(
- render_pass.get(), occlusion_tracker, &data);
+ scrollbar_layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
const QuadList& quads = render_pass->quad_list;
ASSERT_EQ(1u, quads.size());
@@ -455,12 +447,10 @@
scrollbar_layer_impl->SetMaximum(8);
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- scrollbar_layer_impl->AppendQuads(
- render_pass.get(), occlusion_tracker, &data);
+ scrollbar_layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
const QuadList& quads = render_pass->quad_list;
ASSERT_EQ(1u, quads.size());
@@ -578,7 +568,7 @@
void SetScrollbarBounds(const gfx::Size& bounds) { bounds_ = bounds; }
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
scroll_layer_ = Layer::Create();
layer_tree_host()->root_layer()->AddChild(scroll_layer_);
@@ -593,7 +583,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
const int kMaxTextureSize =
layer_tree_host()->GetRendererCapabilities().max_texture_size;
@@ -608,7 +598,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
scoped_refptr<PaintedScrollbarLayer> scrollbar_layer_;
@@ -645,7 +635,7 @@
InitializeSingleThreaded(client, base::MessageLoopProxy::current());
}
- virtual UIResourceId CreateUIResource(UIResourceClient* content) OVERRIDE {
+ virtual UIResourceId CreateUIResource(UIResourceClient* content) override {
total_ui_resource_created_++;
UIResourceId nid = next_id_++;
ui_resource_bitmap_map_.insert(
@@ -654,7 +644,7 @@
}
// Deletes a UI resource. May safely be called more than once.
- virtual void DeleteUIResource(UIResourceId id) OVERRIDE {
+ virtual void DeleteUIResource(UIResourceId id) override {
UIResourceBitmapMap::iterator iter = ui_resource_bitmap_map_.find(id);
if (iter != ui_resource_bitmap_map_.end()) {
ui_resource_bitmap_map_.erase(iter);
diff --git a/cc/layers/solid_color_layer.h b/cc/layers/solid_color_layer.h
index d391070..987c005 100644
--- a/cc/layers/solid_color_layer.h
+++ b/cc/layers/solid_color_layer.h
@@ -18,9 +18,9 @@
static scoped_refptr<SolidColorLayer> Create();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
- virtual void SetBackgroundColor(SkColor color) OVERRIDE;
+ virtual void SetBackgroundColor(SkColor color) override;
protected:
SolidColorLayer();
diff --git a/cc/layers/solid_color_layer_impl.cc b/cc/layers/solid_color_layer_impl.cc
index 618ea53..c8ddc7d 100644
--- a/cc/layers/solid_color_layer_impl.cc
+++ b/cc/layers/solid_color_layer_impl.cc
@@ -8,7 +8,7 @@
#include "cc/layers/append_quads_data.h"
#include "cc/quads/solid_color_draw_quad.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
namespace cc {
@@ -29,15 +29,11 @@
void SolidColorLayerImpl::AppendSolidQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
SharedQuadState* shared_quad_state,
const gfx::Size& content_bounds,
- const gfx::Transform& target_space_transform,
SkColor color,
AppendQuadsData* append_quads_data) {
- Occlusion occlusion =
- occlusion_tracker.GetCurrentOcclusionForLayer(target_space_transform);
-
// We create a series of smaller quads instead of just one large one so that
// the culler can reduce the total pixels drawn.
int width = content_bounds.width();
@@ -49,7 +45,7 @@
std::min(width - x, kSolidQuadTileSize),
std::min(height - y, kSolidQuadTileSize));
gfx::Rect visible_quad_rect =
- occlusion.GetUnoccludedContentRect(quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty())
continue;
@@ -66,7 +62,7 @@
void SolidColorLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
@@ -76,10 +72,9 @@
render_pass, content_bounds(), shared_quad_state, append_quads_data);
AppendSolidQuads(render_pass,
- occlusion_tracker,
+ occlusion_in_content_space,
shared_quad_state,
content_bounds(),
- draw_properties().target_space_transform,
background_color(),
append_quads_data);
}
diff --git a/cc/layers/solid_color_layer_impl.h b/cc/layers/solid_color_layer_impl.h
index e59db0f..0116479 100644
--- a/cc/layers/solid_color_layer_impl.h
+++ b/cc/layers/solid_color_layer_impl.h
@@ -18,29 +18,27 @@
return make_scoped_ptr(new SolidColorLayerImpl(tree_impl, id));
}
- static void AppendSolidQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- SharedQuadState* shared_quad_state,
- const gfx::Size& content_bounds,
- const gfx::Transform& target_space_transform,
- SkColor color,
- AppendQuadsData* append_quads_data);
+ static void AppendSolidQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ SharedQuadState* shared_quad_state,
+ const gfx::Size& content_bounds,
+ SkColor color,
+ AppendQuadsData* append_quads_data);
virtual ~SolidColorLayerImpl();
// LayerImpl overrides.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
protected:
SolidColorLayerImpl(LayerTreeImpl* tree_impl, int id);
private:
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
DISALLOW_COPY_AND_ASSIGN(SolidColorLayerImpl);
};
diff --git a/cc/layers/solid_color_layer_impl_unittest.cc b/cc/layers/solid_color_layer_impl_unittest.cc
index 3e5f453..768fae4 100644
--- a/cc/layers/solid_color_layer_impl_unittest.cc
+++ b/cc/layers/solid_color_layer_impl_unittest.cc
@@ -21,7 +21,6 @@
namespace {
TEST(SolidColorLayerImplTest, VerifyTilingCompleteAndNoOverlap) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
gfx::Size layer_size = gfx::Size(800, 600);
@@ -39,7 +38,7 @@
layer->draw_properties().render_target = layer.get();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
LayerTestCommon::VerifyQuadsExactlyCoverRect(render_pass->quad_list,
visible_content_rect);
@@ -48,7 +47,6 @@
TEST(SolidColorLayerImplTest, VerifyCorrectBackgroundColorInQuad) {
SkColor test_color = 0xFFA55AFF;
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
gfx::Size layer_size = gfx::Size(100, 100);
@@ -67,7 +65,7 @@
layer->draw_properties().render_target = layer.get();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
ASSERT_EQ(render_pass->quad_list.size(), 1U);
EXPECT_EQ(
@@ -78,7 +76,6 @@
TEST(SolidColorLayerImplTest, VerifyCorrectOpacityInQuad) {
const float opacity = 0.5f;
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
gfx::Size layer_size = gfx::Size(100, 100);
@@ -97,7 +94,7 @@
layer->draw_properties().render_target = layer.get();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
ASSERT_EQ(render_pass->quad_list.size(), 1U);
EXPECT_EQ(opacity,
@@ -141,11 +138,10 @@
// should be the full tile.
layer_impl->draw_properties().opacity = 1;
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer_impl->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
ASSERT_EQ(render_pass->quad_list.size(), 1U);
EXPECT_EQ(visible_content_rect.ToString(),
@@ -168,11 +164,10 @@
// should be empty.
layer_impl->draw_properties().opacity = 1;
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer_impl->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer_impl->AppendQuads(render_pass.get(), Occlusion(), &data);
ASSERT_EQ(render_pass->quad_list.size(), 1U);
EXPECT_EQ(gfx::Rect().ToString(),
diff --git a/cc/layers/solid_color_scrollbar_layer.h b/cc/layers/solid_color_scrollbar_layer.h
index 654a6a6..de46c54 100644
--- a/cc/layers/solid_color_scrollbar_layer.h
+++ b/cc/layers/solid_color_scrollbar_layer.h
@@ -15,7 +15,7 @@
public Layer {
public:
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
static scoped_refptr<SolidColorScrollbarLayer> Create(
ScrollbarOrientation orientation,
@@ -25,20 +25,20 @@
int scroll_layer_id);
// Layer overrides.
- virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE;
- virtual ScrollbarLayerInterface* ToScrollbarLayer() OVERRIDE;
+ virtual bool OpacityCanAnimateOnImplThread() const override;
+ virtual ScrollbarLayerInterface* ToScrollbarLayer() override;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
- virtual void PushScrollClipPropertiesTo(LayerImpl* layer) OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual void PushScrollClipPropertiesTo(LayerImpl* layer) override;
- virtual void SetNeedsDisplayRect(const gfx::RectF&) OVERRIDE;
+ virtual void SetNeedsDisplayRect(const gfx::RectF&) override;
// ScrollbarLayerInterface
- virtual int ScrollLayerId() const OVERRIDE;
- virtual void SetScrollLayer(int layer_id) OVERRIDE;
- virtual void SetClipLayer(int layer_id) OVERRIDE;
+ virtual int ScrollLayerId() const override;
+ virtual void SetScrollLayer(int layer_id) override;
+ virtual void SetClipLayer(int layer_id) override;
- virtual ScrollbarOrientation orientation() const OVERRIDE;
+ virtual ScrollbarOrientation orientation() const override;
protected:
SolidColorScrollbarLayer(ScrollbarOrientation orientation,
diff --git a/cc/layers/solid_color_scrollbar_layer_impl.cc b/cc/layers/solid_color_scrollbar_layer_impl.cc
index a0c9609..db6a502 100644
--- a/cc/layers/solid_color_scrollbar_layer_impl.cc
+++ b/cc/layers/solid_color_scrollbar_layer_impl.cc
@@ -6,7 +6,7 @@
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/layer_tree_settings.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
namespace cc {
@@ -95,7 +95,7 @@
void SolidColorScrollbarLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
@@ -106,9 +106,7 @@
gfx::Rect thumb_quad_rect(ComputeThumbQuadRect());
gfx::Rect visible_quad_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(
- draw_properties().target_space_transform)
- .GetUnoccludedContentRect(thumb_quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(thumb_quad_rect);
if (visible_quad_rect.IsEmpty())
return;
diff --git a/cc/layers/solid_color_scrollbar_layer_impl.h b/cc/layers/solid_color_scrollbar_layer_impl.h
index 91f1ac3..32695d0 100644
--- a/cc/layers/solid_color_scrollbar_layer_impl.h
+++ b/cc/layers/solid_color_scrollbar_layer_impl.h
@@ -24,12 +24,12 @@
// LayerImpl overrides.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
protected:
SolidColorScrollbarLayerImpl(LayerTreeImpl* tree_impl,
@@ -41,11 +41,11 @@
bool is_overlay);
// ScrollbarLayerImplBase implementation.
- virtual int ThumbThickness() const OVERRIDE;
- virtual int ThumbLength() const OVERRIDE;
- virtual float TrackLength() const OVERRIDE;
- virtual int TrackStart() const OVERRIDE;
- virtual bool IsThumbResizable() const OVERRIDE;
+ virtual int ThumbThickness() const override;
+ virtual int ThumbLength() const override;
+ virtual float TrackLength() const override;
+ virtual int TrackStart() const override;
+ virtual bool IsThumbResizable() const override;
private:
int thumb_thickness_;
diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h
index d58d47d..eace365 100644
--- a/cc/layers/surface_layer.h
+++ b/cc/layers/surface_layer.h
@@ -21,12 +21,12 @@
// Layer overrides.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
protected:
SurfaceLayer();
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
private:
virtual ~SurfaceLayer();
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc
index 352aca6..4fb9d95 100644
--- a/cc/layers/surface_layer_impl.cc
+++ b/cc/layers/surface_layer_impl.cc
@@ -7,7 +7,7 @@
#include "base/debug/trace_event_argument.h"
#include "cc/debug/debug_colors.h"
#include "cc/quads/surface_draw_quad.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
namespace cc {
@@ -37,10 +37,9 @@
layer_impl->SetSurfaceId(surface_id_);
}
-void SurfaceLayerImpl::AppendQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) {
+void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
PopulateSharedQuadState(shared_quad_state);
@@ -53,9 +52,7 @@
gfx::Rect quad_rect(content_bounds());
gfx::Rect visible_quad_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(
- draw_properties().target_space_transform)
- .GetUnoccludedContentRect(quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty())
return;
SurfaceDrawQuad* quad =
diff --git a/cc/layers/surface_layer_impl.h b/cc/layers/surface_layer_impl.h
index 712ea14..5353a21 100644
--- a/cc/layers/surface_layer_impl.h
+++ b/cc/layers/surface_layer_impl.h
@@ -23,20 +23,20 @@
// LayerImpl overrides.
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
protected:
SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id);
private:
virtual void GetDebugBorderProperties(SkColor* color,
- float* width) const OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ float* width) const override;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
+ virtual const char* LayerTypeAsString() const override;
SurfaceId surface_id_;
diff --git a/cc/layers/texture_layer.h b/cc/layers/texture_layer.h
index 22dcb4d..735fed9 100644
--- a/cc/layers/texture_layer.h
+++ b/cc/layers/texture_layer.h
@@ -95,7 +95,7 @@
void ClearTexture();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
// Sets whether this texture should be Y-flipped at draw time. Defaults to
// true.
@@ -134,18 +134,18 @@
// TODO(danakj): Remove this when pepper doesn't need it. crbug.com/350204
void SetTextureMailboxWithoutReleaseCallback(const TextureMailbox& mailbox);
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE;
+ virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override;
- virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE;
+ virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
- virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
protected:
explicit TextureLayer(TextureLayerClient* client);
virtual ~TextureLayer();
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
private:
void SetTextureMailboxInternal(
diff --git a/cc/layers/texture_layer_impl.cc b/cc/layers/texture_layer_impl.cc
index 206d8db..bcde7cd 100644
--- a/cc/layers/texture_layer_impl.cc
+++ b/cc/layers/texture_layer_impl.cc
@@ -13,7 +13,7 @@
#include "cc/resources/scoped_resource.h"
#include "cc/resources/single_release_callback_impl.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
namespace cc {
@@ -139,10 +139,9 @@
LayerImpl::WillDraw(draw_mode, resource_provider);
}
-void TextureLayerImpl::AppendQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) {
+void TextureLayerImpl::AppendQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) {
DCHECK(external_texture_resource_ || valid_texture_copy_);
SharedQuadState* shared_quad_state =
@@ -159,9 +158,7 @@
gfx::Rect quad_rect(content_bounds());
gfx::Rect opaque_rect = opaque ? quad_rect : gfx::Rect();
gfx::Rect visible_quad_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(
- draw_properties().target_space_transform)
- .GetUnoccludedContentRect(quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty())
return;
diff --git a/cc/layers/texture_layer_impl.h b/cc/layers/texture_layer_impl.h
index 9edf099..bbf0817 100644
--- a/cc/layers/texture_layer_impl.h
+++ b/cc/layers/texture_layer_impl.h
@@ -23,16 +23,16 @@
virtual ~TextureLayerImpl();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* layer_tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
+ ResourceProvider* resource_provider) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
- virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE;
- virtual void ReleaseResources() OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
+ virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
+ virtual void ReleaseResources() override;
// These setter methods don't cause any implicit damage, so the texture client
// must explicitly invalidate if they intend to cause a visible change in the
@@ -56,7 +56,7 @@
private:
TextureLayerImpl(LayerTreeImpl* tree_impl, int id);
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
void FreeTextureMailbox();
ResourceProvider::ResourceId external_texture_resource_;
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index b3c48fb..8846152 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -68,7 +68,7 @@
virtual bool PrepareTextureMailbox(
TextureMailbox* mailbox,
scoped_ptr<SingleReleaseCallback>* release_callback,
- bool use_shared_memory) OVERRIDE {
+ bool use_shared_memory) override {
if (!mailbox_changed_)
return false;
@@ -721,7 +721,7 @@
callback.Pass());
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
EXPECT_EQ(true, main_thread_.CalledOnValidThread());
gfx::Size bounds(100, 100);
@@ -745,7 +745,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
++commit_count_;
switch (commit_count_) {
case 1:
@@ -817,7 +817,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
base::ThreadChecker main_thread_;
@@ -846,7 +846,7 @@
callback.Pass());
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
root_->SetBounds(bounds);
@@ -863,11 +863,11 @@
PostSetNeedsCommitToMainThread();
}
- virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override {
++activate_count_;
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// The first mailbox has been activated. Set a new mailbox, and
@@ -886,7 +886,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
switch (host_impl->active_tree()->source_frame_number()) {
case 0: {
// The activate for the 1st mailbox should have happened before now.
@@ -911,7 +911,7 @@
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int activate_count_;
scoped_refptr<Layer> root_;
@@ -1133,7 +1133,7 @@
virtual bool PrepareTextureMailbox(
TextureMailbox* texture_mailbox,
scoped_ptr<SingleReleaseCallback>* release_callback,
- bool use_shared_memory) OVERRIDE {
+ bool use_shared_memory) override {
if (layer_tree_host()->source_frame_number() == 1) {
// Once this has been committed, the mailbox will be released.
*texture_mailbox = TextureMailbox();
@@ -1154,7 +1154,7 @@
EndTest();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
@@ -1168,11 +1168,11 @@
LayerTreeTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
EXPECT_FALSE(proxy()->MainFrameWillHappenForTesting());
@@ -1189,7 +1189,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ASSERT_TRUE(result);
DelegatedFrameData* delegated_frame_data =
output_surface()->last_sent_frame().delegated_frame_data.get();
@@ -1206,7 +1206,7 @@
host_impl->ReclaimResources(&ack);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
scoped_refptr<TextureLayer> texture_layer_;
@@ -1233,7 +1233,7 @@
virtual bool PrepareTextureMailbox(
TextureMailbox* mailbox,
scoped_ptr<SingleReleaseCallback>* release_callback,
- bool use_shared_memory) OVERRIDE {
+ bool use_shared_memory) override {
++prepare_called_;
if (!mailbox_changed_)
return false;
@@ -1252,7 +1252,7 @@
++mailbox_returned_;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
@@ -1277,11 +1277,11 @@
LayerTreeTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
++commit_count_;
switch (commit_count_) {
case 1:
@@ -1326,7 +1326,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ASSERT_TRUE(result);
DelegatedFrameData* delegated_frame_data =
output_surface()->last_sent_frame().delegated_frame_data.get();
@@ -1343,7 +1343,7 @@
host_impl->ReclaimResources(&ack);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
scoped_refptr<SolidColorLayer> solid_layer_;
@@ -1370,7 +1370,7 @@
virtual bool PrepareTextureMailbox(
TextureMailbox* mailbox,
scoped_ptr<SingleReleaseCallback>* release_callback,
- bool use_shared_memory) OVERRIDE {
+ bool use_shared_memory) override {
*mailbox = TextureMailbox(MailboxFromChar('1'), GL_TEXTURE_2D, 0);
*release_callback = SingleReleaseCallback::Create(
base::Bind(&TextureLayerReleaseResourcesBase::MailboxReleased,
@@ -1382,7 +1382,7 @@
mailbox_released_ = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeTest::SetupTree();
scoped_refptr<TextureLayer> texture_layer =
@@ -1393,16 +1393,16 @@
layer_tree_host()->root_layer()->AddChild(texture_layer);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
mailbox_released_ = false;
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_TRUE(mailbox_released_);
}
@@ -1413,7 +1413,7 @@
class TextureLayerReleaseResourcesAfterCommit
: public TextureLayerReleaseResourcesBase {
public:
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeImpl* tree = NULL;
if (host_impl->settings().impl_side_painting)
tree = host_impl->pending_tree();
@@ -1428,7 +1428,7 @@
class TextureLayerReleaseResourcesAfterActivate
: public TextureLayerReleaseResourcesBase {
public:
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
host_impl->active_tree()->root_layer()->children()[0]->ReleaseResources();
}
};
@@ -1455,7 +1455,7 @@
callback.Pass());
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
root_->SetBounds(bounds);
@@ -1469,7 +1469,7 @@
layer_tree_host()->SetViewportSize(bounds);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
EXPECT_EQ(true, main_thread_.CalledOnValidThread());
callback_count_ = 0;
@@ -1481,7 +1481,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// Delete the TextureLayer on the main thread while the mailbox is in
@@ -1492,7 +1492,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(1, callback_count_);
}
@@ -1526,7 +1526,7 @@
callback.Pass());
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
gfx::Size bounds(100, 100);
root_ = Layer::Create();
root_->SetBounds(bounds);
@@ -1540,7 +1540,7 @@
layer_tree_host()->SetViewportSize(bounds);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
EXPECT_EQ(true, main_thread_.CalledOnValidThread());
callback_count_ = 0;
@@ -1552,7 +1552,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// Remove the TextureLayer on the main thread while the mailbox is in
@@ -1566,7 +1566,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(1, callback_count_);
}
diff --git a/cc/layers/tiled_layer.h b/cc/layers/tiled_layer.h
index 9f482c8..e8ac89b 100644
--- a/cc/layers/tiled_layer.h
+++ b/cc/layers/tiled_layer.h
@@ -25,17 +25,17 @@
};
// Layer implementation.
- virtual void SetIsMask(bool is_mask) OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
- virtual void ReduceMemoryUsage() OVERRIDE;
- virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) OVERRIDE;
- virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) OVERRIDE;
+ virtual void SetIsMask(bool is_mask) override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual void ReduceMemoryUsage() override;
+ virtual void SetNeedsDisplayRect(const gfx::RectF& dirty_rect) override;
+ virtual void SetLayerTreeHost(LayerTreeHost* layer_tree_host) override;
virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
- OVERRIDE;
- virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE;
+ override;
+ virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
- virtual void OnOutputSurfaceCreated() OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
+ virtual void OnOutputSurfaceCreated() override;
protected:
TiledLayer();
@@ -67,7 +67,7 @@
bool SkipsDraw() const { return skips_draw_; }
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
// Virtual for testing
virtual PrioritizedResourceManager* ResourceManager();
@@ -76,7 +76,7 @@
private:
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
void CreateTilerIfNeeded();
void set_tiling_option(TilingOption tiling_option) {
diff --git a/cc/layers/tiled_layer_impl.cc b/cc/layers/tiled_layer_impl.cc
index 18d9d1e..5a0e81d 100644
--- a/cc/layers/tiled_layer_impl.cc
+++ b/cc/layers/tiled_layer_impl.cc
@@ -16,7 +16,7 @@
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/quads/tile_draw_quad.h"
#include "cc/resources/layer_tiling_data.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/quad_f.h"
@@ -155,10 +155,9 @@
return LayerImpl::WillDraw(draw_mode, resource_provider);
}
-void TiledLayerImpl::AppendQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) {
+void TiledLayerImpl::AppendQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) {
DCHECK(tiler_);
DCHECK(!tiler_->has_empty_bounds());
DCHECK(!visible_content_rect().IsEmpty());
@@ -204,8 +203,6 @@
if (skips_draw_)
return;
- Occlusion occlusion =
- occlusion_tracker.GetCurrentOcclusionForLayer(draw_transform());
for (int j = top; j <= bottom; ++j) {
for (int i = left; i <= right; ++i) {
DrawableTile* tile = TileAt(i, j);
@@ -218,7 +215,7 @@
continue;
gfx::Rect visible_tile_rect =
- occlusion.GetUnoccludedContentRect(tile_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(tile_rect);
if (visible_tile_rect.IsEmpty())
continue;
diff --git a/cc/layers/tiled_layer_impl.h b/cc/layers/tiled_layer_impl.h
index 4c1459e..0a65a96 100644
--- a/cc/layers/tiled_layer_impl.h
+++ b/cc/layers/tiled_layer_impl.h
@@ -23,16 +23,16 @@
virtual ~TiledLayerImpl();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
+ ResourceProvider* resource_provider) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
- virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE;
+ virtual ResourceProvider::ResourceId ContentsResourceId() const override;
void set_skips_draw(bool skips_draw) { skips_draw_ = skips_draw; }
void SetTilingData(const LayerTilingData& tiler);
@@ -42,12 +42,12 @@
bool contents_swizzled);
void PushInvalidTile(int i, int j);
- virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE;
- virtual void ReleaseResources() OVERRIDE;
+ virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
+ virtual void ReleaseResources() override;
const LayerTilingData* TilingForTesting() const { return tiler_.get(); }
- virtual size_t GPUMemoryUsageInBytes() const OVERRIDE;
+ virtual size_t GPUMemoryUsageInBytes() const override;
protected:
TiledLayerImpl(LayerTreeImpl* tree_impl, int id);
@@ -56,11 +56,11 @@
bool HasResourceIdForTileAt(int i, int j) const;
virtual void GetDebugBorderProperties(SkColor* color, float* width) const
- OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ override;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
private:
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
DrawableTile* TileAt(int i, int j) const;
DrawableTile* CreateTile(int i, int j);
diff --git a/cc/layers/tiled_layer_impl_unittest.cc b/cc/layers/tiled_layer_impl_unittest.cc
index 7609ade..ffc89c8 100644
--- a/cc/layers/tiled_layer_impl_unittest.cc
+++ b/cc/layers/tiled_layer_impl_unittest.cc
@@ -70,9 +70,8 @@
layer->draw_properties().visible_content_rect = visible_content_rect;
layer->SetBounds(layer_size);
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
AppendQuadsData data;
- layer->AppendQuads(render_pass, occlusion_tracker, &data);
+ layer->AppendQuads(render_pass, Occlusion(), &data);
}
protected:
@@ -92,12 +91,11 @@
{
scoped_ptr<TiledLayerImpl> layer =
CreateLayer(tile_size, layer_size, LayerTilingData::NO_BORDER_TEXELS);
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
EXPECT_TRUE(layer->WillDraw(DRAW_MODE_HARDWARE, NULL));
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
layer->DidDraw(NULL);
unsigned num_tiles = num_tiles_x * num_tiles_y;
EXPECT_EQ(render_pass->quad_list.size(), num_tiles);
@@ -109,7 +107,6 @@
CreateLayer(tile_size, layer_size, LayerTilingData::NO_BORDER_TEXELS);
layer->draw_properties().visible_content_rect = gfx::Rect();
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
EXPECT_FALSE(layer->WillDraw(DRAW_MODE_HARDWARE, NULL));
@@ -123,12 +120,11 @@
gfx::Rect outside_bounds(-100, -100, 50, 50);
layer->draw_properties().visible_content_rect = outside_bounds;
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
EXPECT_TRUE(layer->WillDraw(DRAW_MODE_HARDWARE, NULL));
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
layer->DidDraw(NULL);
EXPECT_EQ(render_pass->quad_list.size(), 0u);
}
@@ -139,11 +135,10 @@
CreateLayer(tile_size, layer_size, LayerTilingData::NO_BORDER_TEXELS);
layer->set_skips_draw(true);
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
EXPECT_EQ(render_pass->quad_list.size(), 0u);
}
}
@@ -160,18 +155,15 @@
// No checkerboarding
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
EXPECT_EQ(render_pass->quad_list.size(), 4u);
EXPECT_EQ(0u, data.num_missing_tiles);
- for (QuadList::Iterator iter = render_pass->quad_list.begin();
- iter != render_pass->quad_list.end();
- ++iter)
- EXPECT_EQ(iter->material, DrawQuad::TILED_CONTENT);
+ for (const auto& quad : render_pass->quad_list)
+ EXPECT_EQ(quad.material, DrawQuad::TILED_CONTENT);
}
for (int i = 0; i < num_tiles_x; ++i)
@@ -180,17 +172,14 @@
// All checkerboarding
{
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
EXPECT_LT(0u, data.num_missing_tiles);
EXPECT_EQ(render_pass->quad_list.size(), 4u);
- for (QuadList::Iterator iter = render_pass->quad_list.begin();
- iter != render_pass->quad_list.end();
- ++iter)
- EXPECT_NE(iter->material, DrawQuad::TILED_CONTENT);
+ for (const auto& quad : render_pass->quad_list)
+ EXPECT_NE(quad.material, DrawQuad::TILED_CONTENT);
}
}
@@ -266,8 +255,8 @@
LayerTilingData::NO_BORDER_TEXELS,
gfx::Rect(layer_size));
- for (QuadList::Iterator iter = render_pass->quad_list.begin();
- iter != render_pass->quad_list.end();
+ for (auto iter = render_pass->quad_list.cbegin();
+ iter != render_pass->quad_list.cend();
++iter) {
const TileDrawQuad* quad = TileDrawQuad::MaterialCast(&*iter);
diff --git a/cc/layers/tiled_layer_unittest.cc b/cc/layers/tiled_layer_unittest.cc
index d2bc0a9..3af0e3f 100644
--- a/cc/layers/tiled_layer_unittest.cc
+++ b/cc/layers/tiled_layer_unittest.cc
@@ -69,7 +69,7 @@
}
virtual void OnCreateAndInitializeOutputSurfaceAttempted(
- bool success) OVERRIDE {
+ bool success) override {
LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(success);
output_surface_created_ = success;
run_loop_.Quit();
@@ -1648,7 +1648,7 @@
return make_scoped_ptr(new TrackingLayerPainter());
}
- virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) OVERRIDE {
+ virtual void Paint(SkCanvas* canvas, const gfx::Rect& content_rect) override {
painted_rect_ = content_rect;
}
@@ -1674,7 +1674,7 @@
}
private:
- virtual LayerUpdater* Updater() const OVERRIDE {
+ virtual LayerUpdater* Updater() const override {
return layer_updater_.get();
}
virtual ~UpdateTrackingTiledLayer() {}
diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc
index 498ba33..4293b09 100644
--- a/cc/layers/ui_resource_layer.cc
+++ b/cc/layers/ui_resource_layer.cc
@@ -23,7 +23,7 @@
const SkBitmap& skbitmap) {
return make_scoped_ptr(new ScopedUIResourceHolder(host, skbitmap));
}
- virtual UIResourceId id() OVERRIDE { return resource_->id(); }
+ virtual UIResourceId id() override { return resource_->id(); }
private:
ScopedUIResourceHolder(LayerTreeHost* host, const SkBitmap& skbitmap) {
@@ -39,7 +39,7 @@
return make_scoped_ptr(new SharedUIResourceHolder(id));
}
- virtual UIResourceId id() OVERRIDE { return id_; }
+ virtual UIResourceId id() override { return id_; }
private:
explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {}
diff --git a/cc/layers/ui_resource_layer.h b/cc/layers/ui_resource_layer.h
index 8e278a9..f79389b 100644
--- a/cc/layers/ui_resource_layer.h
+++ b/cc/layers/ui_resource_layer.h
@@ -20,9 +20,9 @@
public:
static scoped_refptr<UIResourceLayer> Create();
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
- virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
+ virtual void SetLayerTreeHost(LayerTreeHost* host) override;
void SetBitmap(const SkBitmap& skbitmap);
@@ -49,7 +49,7 @@
UIResourceLayer();
virtual ~UIResourceLayer();
- virtual bool HasDrawableContent() const OVERRIDE;
+ virtual bool HasDrawableContent() const override;
scoped_ptr<UIResourceHolder> ui_resource_holder_;
SkBitmap bitmap_;
@@ -60,7 +60,7 @@
private:
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
void RecreateUIResourceHolder();
diff --git a/cc/layers/ui_resource_layer_impl.cc b/cc/layers/ui_resource_layer_impl.cc
index 8a7d3df..dc08a90 100644
--- a/cc/layers/ui_resource_layer_impl.cc
+++ b/cc/layers/ui_resource_layer_impl.cc
@@ -9,7 +9,7 @@
#include "cc/base/math_util.h"
#include "cc/quads/texture_draw_quad.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "ui/gfx/rect_f.h"
namespace cc {
@@ -93,7 +93,7 @@
void UIResourceLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
@@ -122,9 +122,7 @@
gfx::Rect quad_rect(bounds());
gfx::Rect opaque_rect(opaque ? quad_rect : gfx::Rect());
gfx::Rect visible_quad_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(
- draw_properties().target_space_transform)
- .GetUnoccludedContentRect(quad_rect);
+ occlusion_in_content_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty())
return;
diff --git a/cc/layers/ui_resource_layer_impl.h b/cc/layers/ui_resource_layer_impl.h
index 2bdf818..a0cb6ec 100644
--- a/cc/layers/ui_resource_layer_impl.h
+++ b/cc/layers/ui_resource_layer_impl.h
@@ -40,16 +40,16 @@
void SetVertexOpacity(const float vertex_opacity[4]);
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
virtual bool WillDraw(DrawMode draw_mode,
- ResourceProvider* resource_provider) OVERRIDE;
+ ResourceProvider* resource_provider) override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
- virtual base::DictionaryValue* LayerTreeAsJson() const OVERRIDE;
+ virtual base::DictionaryValue* LayerTreeAsJson() const override;
protected:
UIResourceLayerImpl(LayerTreeImpl* tree_impl, int id);
@@ -64,7 +64,7 @@
float vertex_opacity_[4];
private:
- virtual const char* LayerTypeAsString() const OVERRIDE;
+ virtual const char* LayerTypeAsString() const override;
DISALLOW_COPY_AND_ASSIGN(UIResourceLayerImpl);
};
diff --git a/cc/layers/ui_resource_layer_impl_unittest.cc b/cc/layers/ui_resource_layer_impl_unittest.cc
index 66db321..dc24e1d 100644
--- a/cc/layers/ui_resource_layer_impl_unittest.cc
+++ b/cc/layers/ui_resource_layer_impl_unittest.cc
@@ -45,11 +45,10 @@
void QuadSizeTest(scoped_ptr<UIResourceLayerImpl> layer,
size_t expected_quad_size) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
// Verify quad rects
const QuadList& quads = render_pass->quad_list;
@@ -86,11 +85,10 @@
void OpaqueBoundsTest(scoped_ptr<UIResourceLayerImpl> layer,
const gfx::Rect& expected_opaque_bounds) {
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ layer->AppendQuads(render_pass.get(), Occlusion(), &data);
// Verify quad rects
const QuadList& quads = render_pass->quad_list;
diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.h
new file mode 100644
index 0000000..784d951
--- /dev/null
+++ b/cc/layers/video_frame_provider.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
+#define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace media {
+class VideoFrame;
+}
+
+namespace cc {
+
+// Threading notes: This class may be used in a multi threaded manner.
+// Specifically, the implementation may call GetCurrentFrame() or
+// PutCurrentFrame() from the compositor thread. If so, the caller is
+// responsible for making sure Client::DidReceiveFrame() and
+// Client::DidUpdateMatrix() are only called from this same thread.
+class VideoFrameProvider {
+ public:
+ virtual ~VideoFrameProvider() {}
+
+ class Client {
+ public:
+ // Provider will call this method to tell the client to stop using it.
+ // StopUsingProvider() may be called from any thread. The client should
+ // block until it has PutCurrentFrame() any outstanding frames.
+ virtual void StopUsingProvider() = 0;
+
+ // Notifies the provider's client that a call to GetCurrentFrame() will
+ // return new data.
+ virtual void DidReceiveFrame() = 0;
+
+ // Notifies the provider's client of a new UV transform matrix to be used.
+ virtual void DidUpdateMatrix(const float* matrix) = 0;
+
+ protected:
+ virtual ~Client() {}
+ };
+
+ // May be called from any thread, but there must be some external guarantee
+ // that the provider is not destroyed before this call returns.
+ virtual void SetVideoFrameProviderClient(Client* client) = 0;
+
+ // This function places a lock on the current frame and returns a pointer to
+ // it. Calls to this method should always be followed with a call to
+ // PutCurrentFrame().
+ // Only the current provider client should call this function.
+ virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0;
+
+ // This function releases the lock on the video frame. It should always be
+ // called after GetCurrentFrame(). Frames passed into this method
+ // should no longer be referenced after the call is made. Only the current
+ // provider client should call this function.
+ virtual void PutCurrentFrame(
+ const scoped_refptr<media::VideoFrame>& frame) = 0;
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_
diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_frame_provider_client_impl.cc
new file mode 100644
index 0000000..cf78413
--- /dev/null
+++ b/cc/layers/video_frame_provider_client_impl.cc
@@ -0,0 +1,95 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/layers/video_frame_provider_client_impl.h"
+
+#include "base/debug/trace_event.h"
+#include "cc/base/math_util.h"
+#include "cc/layers/video_layer_impl.h"
+#include "media/base/video_frame.h"
+
+namespace cc {
+
+// static
+scoped_refptr<VideoFrameProviderClientImpl>
+ VideoFrameProviderClientImpl::Create(
+ VideoFrameProvider* provider) {
+ return make_scoped_refptr(
+ new VideoFrameProviderClientImpl(provider));
+}
+
+VideoFrameProviderClientImpl::~VideoFrameProviderClientImpl() {}
+
+VideoFrameProviderClientImpl::VideoFrameProviderClientImpl(
+ VideoFrameProvider* provider)
+ : active_video_layer_(NULL), provider_(provider) {
+ // This only happens during a commit on the compositor thread while the main
+ // thread is blocked. That makes this a thread-safe call to set the video
+ // frame provider client that does not require a lock. The same is true of
+ // the call to Stop().
+ provider_->SetVideoFrameProviderClient(this);
+
+ // This matrix is the default transformation for stream textures, and flips
+ // on the Y axis.
+ stream_texture_matrix_ = gfx::Transform(
+ 1.0, 0.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0, 1.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0);
+}
+
+void VideoFrameProviderClientImpl::Stop() {
+ if (!provider_)
+ return;
+ provider_->SetVideoFrameProviderClient(NULL);
+ provider_ = NULL;
+}
+
+scoped_refptr<media::VideoFrame>
+VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() {
+ provider_lock_.Acquire(); // Balanced by call to ReleaseLock().
+ if (!provider_)
+ return NULL;
+
+ return provider_->GetCurrentFrame();
+}
+
+void VideoFrameProviderClientImpl::PutCurrentFrame(
+ const scoped_refptr<media::VideoFrame>& frame) {
+ provider_lock_.AssertAcquired();
+ provider_->PutCurrentFrame(frame);
+}
+
+void VideoFrameProviderClientImpl::ReleaseLock() {
+ provider_lock_.AssertAcquired();
+ provider_lock_.Release();
+}
+
+void VideoFrameProviderClientImpl::StopUsingProvider() {
+ // Block the provider from shutting down until this client is done
+ // using the frame.
+ base::AutoLock locker(provider_lock_);
+ provider_ = NULL;
+}
+
+void VideoFrameProviderClientImpl::DidReceiveFrame() {
+ TRACE_EVENT1("cc",
+ "VideoFrameProviderClientImpl::DidReceiveFrame",
+ "active_video_layer",
+ !!active_video_layer_);
+ if (active_video_layer_)
+ active_video_layer_->SetNeedsRedraw();
+}
+
+void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) {
+ stream_texture_matrix_ = gfx::Transform(
+ matrix[0], matrix[4], matrix[8], matrix[12],
+ matrix[1], matrix[5], matrix[9], matrix[13],
+ matrix[2], matrix[6], matrix[10], matrix[14],
+ matrix[3], matrix[7], matrix[11], matrix[15]);
+ if (active_video_layer_)
+ active_video_layer_->SetNeedsRedraw();
+}
+
+} // namespace cc
diff --git a/cc/layers/video_frame_provider_client_impl.h b/cc/layers/video_frame_provider_client_impl.h
new file mode 100644
index 0000000..c2d6599
--- /dev/null
+++ b/cc/layers/video_frame_provider_client_impl.h
@@ -0,0 +1,64 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
+#define CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/lock.h"
+#include "cc/layers/video_frame_provider.h"
+#include "ui/gfx/transform.h"
+
+namespace media { class VideoFrame; }
+
+namespace cc {
+class VideoLayerImpl;
+
+class VideoFrameProviderClientImpl
+ : public VideoFrameProvider::Client,
+ public base::RefCounted<VideoFrameProviderClientImpl> {
+ public:
+ static scoped_refptr<VideoFrameProviderClientImpl> Create(
+ VideoFrameProvider* provider);
+
+ VideoLayerImpl* active_video_layer() { return active_video_layer_; }
+ void set_active_video_layer(VideoLayerImpl* video_layer) {
+ active_video_layer_ = video_layer;
+ }
+
+ void Stop();
+ bool Stopped() const { return !provider_; }
+
+ scoped_refptr<media::VideoFrame> AcquireLockAndCurrentFrame();
+ void PutCurrentFrame(const scoped_refptr<media::VideoFrame>& frame);
+ void ReleaseLock();
+ const gfx::Transform& stream_texture_matrix() const {
+ return stream_texture_matrix_;
+ }
+
+ // VideoFrameProvider::Client implementation. These methods are all callable
+ // on any thread.
+ virtual void StopUsingProvider() override;
+ virtual void DidReceiveFrame() override;
+ virtual void DidUpdateMatrix(const float* matrix) override;
+
+ private:
+ explicit VideoFrameProviderClientImpl(VideoFrameProvider* provider);
+ friend class base::RefCounted<VideoFrameProviderClientImpl>;
+ virtual ~VideoFrameProviderClientImpl();
+
+ VideoLayerImpl* active_video_layer_;
+
+ // Guards the destruction of provider_ and the frame that it provides
+ base::Lock provider_lock_;
+ VideoFrameProvider* provider_;
+
+ gfx::Transform stream_texture_matrix_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoFrameProviderClientImpl);
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_CLIENT_IMPL_H_
diff --git a/cc/layers/video_layer.h b/cc/layers/video_layer.h
new file mode 100644
index 0000000..c7ca647
--- /dev/null
+++ b/cc/layers/video_layer.h
@@ -0,0 +1,47 @@
+// Copyright 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_VIDEO_LAYER_H_
+#define CC_LAYERS_VIDEO_LAYER_H_
+
+#include "base/callback.h"
+#include "cc/base/cc_export.h"
+#include "cc/layers/layer.h"
+#include "media/base/video_rotation.h"
+
+namespace media { class VideoFrame; }
+
+namespace cc {
+
+class VideoFrameProvider;
+class VideoLayerImpl;
+
+// A Layer that contains a Video element.
+class CC_EXPORT VideoLayer : public Layer {
+ public:
+ static scoped_refptr<VideoLayer> Create(VideoFrameProvider* provider,
+ media::VideoRotation video_rotation);
+
+ virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
+ override;
+
+ virtual bool Update(ResourceUpdateQueue* queue,
+ const OcclusionTracker<Layer>* occlusion) override;
+
+ private:
+ VideoLayer(VideoFrameProvider* provider, media::VideoRotation video_rotation);
+ virtual ~VideoLayer();
+
+ // This pointer is only for passing to VideoLayerImpl's constructor. It should
+ // never be dereferenced by this class.
+ VideoFrameProvider* provider_;
+
+ media::VideoRotation video_rotation_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoLayer);
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_VIDEO_LAYER_H_
diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc
index 2edea94..5e37397 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -14,7 +14,7 @@
#include "cc/resources/resource_provider.h"
#include "cc/resources/single_release_callback_impl.h"
#include "cc/trees/layer_tree_impl.h"
-#include "cc/trees/occlusion_tracker.h"
+#include "cc/trees/occlusion.h"
#include "cc/trees/proxy.h"
#include "media/base/video_frame.h"
@@ -129,10 +129,9 @@
return true;
}
-void VideoLayerImpl::AppendQuads(
- RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) {
+void VideoLayerImpl::AppendQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) {
DCHECK(frame_.get());
gfx::Transform transform = draw_transform();
@@ -175,9 +174,10 @@
gfx::Rect visible_rect = frame_->visible_rect();
gfx::Size coded_size = frame_->coded_size();
+ Occlusion occlusion_in_video_space =
+ occlusion_in_content_space.GetOcclusionWithGivenDrawTransform(transform);
gfx::Rect visible_quad_rect =
- occlusion_tracker.GetCurrentOcclusionForLayer(transform)
- .GetUnoccludedContentRect(quad_rect);
+ occlusion_in_video_space.GetUnoccludedContentRect(quad_rect);
if (visible_quad_rect.IsEmpty())
return;
diff --git a/cc/layers/video_layer_impl.h b/cc/layers/video_layer_impl.h
new file mode 100644
index 0000000..232a1c7
--- /dev/null
+++ b/cc/layers/video_layer_impl.h
@@ -0,0 +1,80 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_LAYERS_VIDEO_LAYER_IMPL_H_
+#define CC_LAYERS_VIDEO_LAYER_IMPL_H_
+
+#include <vector>
+
+#include "cc/base/cc_export.h"
+#include "cc/layers/layer_impl.h"
+#include "cc/resources/release_callback_impl.h"
+#include "cc/resources/video_resource_updater.h"
+#include "media/base/video_rotation.h"
+
+namespace media {
+class VideoFrame;
+}
+
+namespace cc {
+class VideoFrameProvider;
+class VideoFrameProviderClientImpl;
+
+class CC_EXPORT VideoLayerImpl : public LayerImpl {
+ public:
+ static scoped_ptr<VideoLayerImpl> Create(LayerTreeImpl* tree_impl,
+ int id,
+ VideoFrameProvider* provider,
+ media::VideoRotation video_rotation);
+ virtual ~VideoLayerImpl();
+
+ // LayerImpl implementation.
+ virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
+ override;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
+ virtual bool WillDraw(DrawMode draw_mode,
+ ResourceProvider* resource_provider) override;
+ virtual void AppendQuads(RenderPass* render_pass,
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
+ virtual void DidDraw(ResourceProvider* resource_provider) override;
+ virtual void DidBecomeActive() override;
+ virtual void ReleaseResources() override;
+
+ void SetNeedsRedraw();
+
+ void SetProviderClientImpl(
+ scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl);
+
+ media::VideoRotation video_rotation() const { return video_rotation_; }
+
+ private:
+ VideoLayerImpl(LayerTreeImpl* tree_impl,
+ int id,
+ media::VideoRotation video_rotation);
+
+ virtual const char* LayerTypeAsString() const override;
+
+ scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl_;
+
+ scoped_refptr<media::VideoFrame> frame_;
+
+ media::VideoRotation video_rotation_;
+
+ scoped_ptr<VideoResourceUpdater> updater_;
+ VideoFrameExternalResources::ResourceType frame_resource_type_;
+ std::vector<ResourceProvider::ResourceId> frame_resources_;
+
+ // TODO(danakj): Remove these, hide software path inside ResourceProvider and
+ // ExternalResource (aka TextureMailbox) classes.
+ std::vector<unsigned> software_resources_;
+ // Called once for each software resource.
+ ReleaseCallbackImpl software_release_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(VideoLayerImpl);
+};
+
+} // namespace cc
+
+#endif // CC_LAYERS_VIDEO_LAYER_IMPL_H_
diff --git a/cc/output/bsp_walk_action.h b/cc/output/bsp_walk_action.h
index bb31865..342e635 100644
--- a/cc/output/bsp_walk_action.h
+++ b/cc/output/bsp_walk_action.h
@@ -23,7 +23,7 @@
class CC_EXPORT BspWalkActionToVector : public BspWalkAction {
public:
explicit BspWalkActionToVector(std::vector<DrawPolygon*>* in_list);
- virtual void operator()(DrawPolygon* item) OVERRIDE;
+ virtual void operator()(DrawPolygon* item) override;
private:
std::vector<DrawPolygon*>* list_;
diff --git a/cc/output/delegating_renderer.cc b/cc/output/delegating_renderer.cc
index d21ab66..c4dc9fe 100644
--- a/cc/output/delegating_renderer.cc
+++ b/cc/output/delegating_renderer.cc
@@ -92,11 +92,8 @@
base::Bind(&AppendToArray, &resources);
for (size_t i = 0; i < out_data.render_pass_list.size(); ++i) {
RenderPass* render_pass = out_data.render_pass_list.at(i);
- for (QuadList::Iterator iter = render_pass->quad_list.begin();
- iter != render_pass->quad_list.end();
- ++iter) {
- iter->IterateResources(append_to_array);
- }
+ for (auto& quad : render_pass->quad_list)
+ quad.IterateResources(append_to_array);
}
resource_provider_->PrepareSendToParent(resources, &out_data.resource_list);
}
diff --git a/cc/output/delegating_renderer.h b/cc/output/delegating_renderer.h
index 52dbe01..1acebc5 100644
--- a/cc/output/delegating_renderer.h
+++ b/cc/output/delegating_renderer.h
@@ -24,18 +24,18 @@
ResourceProvider* resource_provider);
virtual ~DelegatingRenderer();
- virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE;
+ virtual const RendererCapabilitiesImpl& Capabilities() const override;
virtual void DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::Rect& device_viewport_rect,
const gfx::Rect& device_clip_rect,
- bool disable_picture_quad_image_filtering) OVERRIDE;
+ bool disable_picture_quad_image_filtering) override;
- virtual void Finish() OVERRIDE {}
+ virtual void Finish() override {}
- virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE;
- virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) OVERRIDE;
+ virtual void SwapBuffers(const CompositorFrameMetadata& metadata) override;
+ virtual void ReceiveSwapBuffersAck(const CompositorFrameAck&) override;
private:
DelegatingRenderer(RendererClient* client,
@@ -43,7 +43,7 @@
OutputSurface* output_surface,
ResourceProvider* resource_provider);
- virtual void DidChangeVisibility() OVERRIDE;
+ virtual void DidChangeVisibility() override;
OutputSurface* output_surface_;
ResourceProvider* resource_provider_;
diff --git a/cc/output/delegating_renderer_unittest.cc b/cc/output/delegating_renderer_unittest.cc
index 48bacd5..4c9deb2 100644
--- a/cc/output/delegating_renderer_unittest.cc
+++ b/cc/output/delegating_renderer_unittest.cc
@@ -18,7 +18,7 @@
virtual ~DelegatingRendererTest() {}
virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
- OVERRIDE {
+ override {
scoped_ptr<FakeOutputSurface> output_surface =
FakeOutputSurface::CreateDelegating3d();
output_surface_ = output_surface.get();
@@ -32,17 +32,17 @@
class DelegatingRendererTestDraw : public DelegatingRendererTest {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
PostSetNeedsCommitToMainThread();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(0u, output_surface_->num_sent_frames());
const CompositorFrame& last_frame = output_surface_->last_sent_frame();
@@ -53,12 +53,12 @@
return DRAW_SUCCESS;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_EQ(0u, output_surface_->num_sent_frames());
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
EXPECT_TRUE(result);
EXPECT_EQ(1u, output_surface_->num_sent_frames());
@@ -83,15 +83,15 @@
class DelegatingRendererTestResources : public DelegatingRendererTest {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
frame->render_passes.clear();
frame->render_passes_by_id.clear();
@@ -111,12 +111,12 @@
return draw_result;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_EQ(0u, output_surface_->num_sent_frames());
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
EXPECT_TRUE(result);
EXPECT_EQ(1u, output_surface_->num_sent_frames());
diff --git a/cc/output/direct_renderer.h b/cc/output/direct_renderer.h
index f13ed37..d4c4ba6 100644
--- a/cc/output/direct_renderer.h
+++ b/cc/output/direct_renderer.h
@@ -26,13 +26,13 @@
virtual ~DirectRenderer();
virtual void DecideRenderPassAllocationsForFrame(
- const RenderPassList& render_passes_in_draw_order) OVERRIDE;
- virtual bool HasAllocatedResourcesForTesting(RenderPassId id) const OVERRIDE;
+ const RenderPassList& render_passes_in_draw_order) override;
+ virtual bool HasAllocatedResourcesForTesting(RenderPassId id) const override;
virtual void DrawFrame(RenderPassList* render_passes_in_draw_order,
float device_scale_factor,
const gfx::Rect& device_viewport_rect,
const gfx::Rect& device_clip_rect,
- bool disable_picture_quad_image_filtering) OVERRIDE;
+ bool disable_picture_quad_image_filtering) override;
struct CC_EXPORT DrawingFrame {
DrawingFrame();
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 0c43e02..b2d5153 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -13,6 +13,7 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "cc/base/math_util.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_metadata.h"
#include "cc/output/context_provider.h"
@@ -55,8 +56,8 @@
: gl_(gl), has_passed_(true) {}
// Overridden from ResourceProvider::Fence:
- virtual void Set() OVERRIDE { has_passed_ = false; }
- virtual bool HasPassed() OVERRIDE {
+ virtual void Set() override { has_passed_ = false; }
+ virtual bool HasPassed() override {
if (!has_passed_) {
has_passed_ = true;
Synchronize();
@@ -250,11 +251,11 @@
: query_(query) {}
// Overridden from ResourceProvider::Fence:
- virtual void Set() OVERRIDE {
+ virtual void Set() override {
DCHECK(query_);
query_->Set();
}
- virtual bool HasPassed() OVERRIDE {
+ virtual bool HasPassed() override {
return !query_ || !query_->IsPending();
}
@@ -466,11 +467,8 @@
for (size_t i = 0; i < frame->render_passes_in_draw_order->size(); ++i) {
RenderPass* pass = frame->render_passes_in_draw_order->at(i);
- for (QuadList::Iterator iter = pass->quad_list.begin();
- iter != pass->quad_list.end();
- ++iter) {
- iter->IterateResources(wait_on_resource_syncpoints_callback);
- }
+ for (auto& quad : pass->quad_list)
+ quad.IterateResources(wait_on_resource_syncpoints_callback);
}
// TODO(enne): Do we need to reinitialize all of this state per frame?
@@ -852,20 +850,93 @@
return image;
}
-scoped_ptr<ScopedResource> GLRenderer::GetBackgroundWithFilters(
+bool GLRenderer::ShouldApplyBackgroundFilters(DrawingFrame* frame,
+ const RenderPassDrawQuad* quad) {
+ if (quad->background_filters.IsEmpty())
+ return false;
+
+ // TODO(danakj): We only allow background filters on an opaque render surface
+ // because other surfaces may contain translucent pixels, and the contents
+ // behind those translucent pixels wouldn't have the filter applied.
+ if (frame->current_render_pass->has_transparent_background)
+ return false;
+
+ // TODO(ajuma): Add support for reference filters once
+ // FilterOperations::GetOutsets supports reference filters.
+ if (quad->background_filters.HasReferenceFilter())
+ return false;
+ return true;
+}
+
+gfx::Rect GLRenderer::GetBackdropBoundingBoxForRenderPassQuad(
DrawingFrame* frame,
const RenderPassDrawQuad* quad,
- const gfx::Transform& contents_device_transform,
+ const gfx::Transform& contents_device_transform) {
+ gfx::Rect backdrop_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect(
+ contents_device_transform, SharedGeometryQuad().BoundingBox()));
+
+ if (ShouldApplyBackgroundFilters(frame, quad)) {
+ int top, right, bottom, left;
+ quad->background_filters.GetOutsets(&top, &right, &bottom, &left);
+ backdrop_rect.Inset(-left, -top, -right, -bottom);
+ }
+
+ backdrop_rect.Intersect(
+ MoveFromDrawToWindowSpace(frame->current_render_pass->output_rect));
+ return backdrop_rect;
+}
+
+scoped_ptr<ScopedResource> GLRenderer::GetBackdropTexture(
+ const gfx::Rect& bounding_rect) {
+ scoped_ptr<ScopedResource> device_background_texture =
+ ScopedResource::Create(resource_provider_);
+ // CopyTexImage2D fails when called on a texture having immutable storage.
+ device_background_texture->Allocate(
+ bounding_rect.size(), ResourceProvider::TextureHintDefault, RGBA_8888);
+ {
+ ResourceProvider::ScopedWriteLockGL lock(resource_provider_,
+ device_background_texture->id());
+ GetFramebufferTexture(
+ lock.texture_id(), device_background_texture->format(), bounding_rect);
+ }
+ return device_background_texture.Pass();
+}
+
+skia::RefPtr<SkImage> GLRenderer::ApplyBackgroundFilters(
+ DrawingFrame* frame,
+ const RenderPassDrawQuad* quad,
+ ScopedResource* background_texture) {
+ DCHECK(ShouldApplyBackgroundFilters(frame, quad));
+ skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
+ quad->background_filters, background_texture->size());
+
+ skia::RefPtr<SkImage> background_with_filters =
+ ApplyImageFilter(ScopedUseGrContext::Create(this, frame),
+ resource_provider_,
+ quad->rect.origin(),
+ quad->filters_scale,
+ filter.get(),
+ background_texture);
+ return background_with_filters;
+}
+
+scoped_ptr<ScopedResource>
+GLRenderer::ApplyInverseTransformForBackgroundFilters(
+ DrawingFrame* frame,
+ const RenderPassDrawQuad* quad,
const gfx::Transform& contents_device_transform_inverse,
- bool* background_changed) {
+ ScopedResource* device_background_texture,
+ skia::RefPtr<SkImage> filtered_device_background,
+ const gfx::Rect& backdrop_bounding_rect) {
// This method draws a background filter, which applies a filter to any pixels
// behind the quad and seen through its background. The algorithm works as
// follows:
- // 1. Compute a bounding box around the pixels that will be visible through
- // the quad.
+ // 1. Read the pixels in the bounding box into a buffer.
+ // Moved to GLRenderer::GetBackdropBoundingBoxForRenderPassQuad().
// 2. Read the pixels in the bounding box into a buffer R.
+ // Moved to GLRenderer::GetBackdropTexture().
// 3. Apply the background filter to R, so that it is applied in the pixels'
- // coordinate space.
+ // coordinate space. Moved to GLRenderer::ApplyBackgroundFilters().
// 4. Apply the quad's inverse transform to map the pixels in R into the
// quad's content space. This implicitly clips R by the content bounds of the
// quad since the destination texture has bounds matching the quad's content.
@@ -881,56 +952,7 @@
// TODO(danakj): When this algorithm changes, update
// LayerTreeHost::PrioritizeTextures() accordingly.
- // TODO(danakj): We only allow background filters on an opaque render surface
- // because other surfaces may contain translucent pixels, and the contents
- // behind those translucent pixels wouldn't have the filter applied.
- bool apply_background_filters =
- !frame->current_render_pass->has_transparent_background;
- DCHECK(!frame->current_texture);
-
- // TODO(ajuma): Add support for reference filters once
- // FilterOperations::GetOutsets supports reference filters.
- if (apply_background_filters && quad->background_filters.HasReferenceFilter())
- apply_background_filters = false;
-
- // TODO(danakj): Do a single readback for both the surface and replica and
- // cache the filtered results (once filter textures are not reused).
- gfx::Rect window_rect = gfx::ToEnclosingRect(MathUtil::MapClippedRect(
- contents_device_transform, SharedGeometryQuad().BoundingBox()));
-
- int top, right, bottom, left;
- quad->background_filters.GetOutsets(&top, &right, &bottom, &left);
- window_rect.Inset(-left, -top, -right, -bottom);
-
- window_rect.Intersect(
- MoveFromDrawToWindowSpace(frame->current_render_pass->output_rect));
-
- scoped_ptr<ScopedResource> device_background_texture =
- ScopedResource::Create(resource_provider_);
- // CopyTexImage2D fails when called on a texture having immutable storage.
- device_background_texture->Allocate(
- window_rect.size(), ResourceProvider::TextureHintDefault, RGBA_8888);
- {
- ResourceProvider::ScopedWriteLockGL lock(resource_provider_,
- device_background_texture->id());
- GetFramebufferTexture(
- lock.texture_id(), device_background_texture->format(), window_rect);
- }
-
- skia::RefPtr<SkImageFilter> filter = RenderSurfaceFilters::BuildImageFilter(
- quad->background_filters, device_background_texture->size());
-
- skia::RefPtr<SkImage> filtered_device_background;
- if (apply_background_filters) {
- filtered_device_background =
- ApplyImageFilter(ScopedUseGrContext::Create(this, frame),
- resource_provider_,
- quad->rect.origin(),
- quad->filters_scale,
- filter.get(),
- device_background_texture.get());
- }
- *background_changed = (filtered_device_background != NULL);
+ DCHECK(device_background_texture);
int filtered_device_background_texture_id = 0;
scoped_ptr<ResourceProvider::ScopedReadLockGL> lock;
@@ -968,15 +990,15 @@
gl_->Clear(GL_COLOR_BUFFER_BIT);
#endif
- // The filtered_deveice_background_texture is oriented the same as the frame
- // buffer. The transform we are copying with has a vertical flip, as well as
+ // The background_texture is oriented the same as the frame buffer.
+ // The transform we are copying with has a vertical flip, as well as
// the |device_to_framebuffer_transform|, which cancel each other out. So do
// not flip the contents in the shader to maintain orientation.
bool flip_vertically = false;
CopyTextureToFramebuffer(frame,
filtered_device_background_texture_id,
- window_rect,
+ backdrop_bounding_rect,
device_to_framebuffer_transform,
flip_vertically);
}
@@ -1011,8 +1033,8 @@
return;
bool need_background_texture = !ShouldApplyBlendModeUsingBlendFunc(quad) ||
- !quad->background_filters.IsEmpty();
- bool background_changed = false;
+ ShouldApplyBackgroundFilters(frame, quad);
+
scoped_ptr<ScopedResource> background_texture;
if (need_background_texture) {
// The pixels from the filtered background should completely replace the
@@ -1021,12 +1043,33 @@
if (disable_blending)
SetBlendEnabled(false);
- background_texture =
- GetBackgroundWithFilters(frame,
- quad,
- contents_device_transform,
- contents_device_transform_inverse,
- &background_changed);
+ // Compute a bounding box around the pixels that will be visible through
+ // the quad.
+ gfx::Rect backdrop_rect = GetBackdropBoundingBoxForRenderPassQuad(
+ frame, quad, contents_device_transform);
+
+ // Read the pixels in the bounding box into a buffer R.
+ scoped_ptr<ScopedResource> scoped_background_texture =
+ GetBackdropTexture(backdrop_rect);
+
+ skia::RefPtr<SkImage> background_with_filters;
+ if (ShouldApplyBackgroundFilters(frame, quad)) {
+ // Apply the background filters to R, so that it is applied in the pixels'
+ // coordinate space.
+ background_with_filters =
+ ApplyBackgroundFilters(frame, quad, scoped_background_texture.get());
+ }
+ // Apply the quad's inverse transform to map the pixels in R into the
+ // quad's content space. This implicitly clips R by the content bounds of
+ // the quad since the destination texture has bounds matching the quad's
+ // content.
+ background_texture = ApplyInverseTransformForBackgroundFilters(
+ frame,
+ quad,
+ contents_device_transform_inverse,
+ scoped_background_texture.get(),
+ background_with_filters,
+ backdrop_rect);
if (disable_blending)
SetBlendEnabled(true);
@@ -1065,6 +1108,9 @@
}
}
+ // If blending is applied using shaders, the background texture with
+ // filters will be used as backdrop for blending operation, so we don't
+ // need to copy it to the frame buffer.
if (background_texture && !ShouldApplyBlendModeUsingBlendFunc(quad)) {
filter_bitmap =
ApplyBlendModeWithBackdrop(ScopedUseGrContext::Create(this, frame),
@@ -1073,10 +1119,9 @@
contents_texture,
background_texture.get(),
quad->shared_quad_state->blend_mode);
- }
-
- // Draw the background texture if it has some filters applied.
- if (background_texture && background_changed) {
+ } else if (background_texture) {
+ // Draw the background texture if it has some filters applied.
+ DCHECK(ShouldApplyBackgroundFilters(frame, quad));
DCHECK(background_texture->size() == quad->rect.size());
ResourceProvider::ScopedReadLockGL lock(resource_provider_,
background_texture->id());
diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h
index 87739da..2cfc47f 100644
--- a/cc/output/gl_renderer.h
+++ b/cc/output/gl_renderer.h
@@ -57,13 +57,13 @@
virtual ~GLRenderer();
- virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE;
+ virtual const RendererCapabilitiesImpl& Capabilities() const override;
// Waits for rendering to finish.
- virtual void Finish() OVERRIDE;
+ virtual void Finish() override;
- virtual void DoNoOp() OVERRIDE;
- virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE;
+ virtual void DoNoOp() override;
+ virtual void SwapBuffers(const CompositorFrameMetadata& metadata) override;
virtual bool IsContextLost();
@@ -80,7 +80,7 @@
TextureMailboxDeleter* texture_mailbox_deleter,
int highp_threshold_min);
- virtual void DidChangeVisibility() OVERRIDE;
+ virtual void DidChangeVisibility() override;
bool IsBackbufferDiscarded() const { return is_backbuffer_discarded_; }
@@ -101,26 +101,26 @@
void SetBlendEnabled(bool enabled);
bool blend_enabled() const { return blend_shadow_; }
- virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) OVERRIDE;
+ virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) override;
virtual bool BindFramebufferToTexture(DrawingFrame* frame,
const ScopedResource* resource,
- const gfx::Rect& target_rect) OVERRIDE;
- virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) OVERRIDE;
- virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) OVERRIDE;
+ const gfx::Rect& target_rect) override;
+ virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) override;
+ virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) override;
virtual void DiscardPixels(bool has_external_stencil_test,
- bool draw_rect_covers_full_surface) OVERRIDE;
+ bool draw_rect_covers_full_surface) override;
virtual void ClearFramebuffer(DrawingFrame* frame,
- bool has_external_stencil_test) OVERRIDE;
- virtual void DoDrawQuad(DrawingFrame* frame, const class DrawQuad*) OVERRIDE;
- virtual void BeginDrawingFrame(DrawingFrame* frame) OVERRIDE;
- virtual void FinishDrawingFrame(DrawingFrame* frame) OVERRIDE;
- virtual bool FlippedFramebuffer() const OVERRIDE;
- virtual void EnsureScissorTestEnabled() OVERRIDE;
- virtual void EnsureScissorTestDisabled() OVERRIDE;
+ bool has_external_stencil_test) override;
+ virtual void DoDrawQuad(DrawingFrame* frame, const class DrawQuad*) override;
+ virtual void BeginDrawingFrame(DrawingFrame* frame) override;
+ virtual void FinishDrawingFrame(DrawingFrame* frame) override;
+ virtual bool FlippedFramebuffer() const override;
+ virtual void EnsureScissorTestEnabled() override;
+ virtual void EnsureScissorTestDisabled() override;
virtual void CopyCurrentRenderPassToBitmap(
DrawingFrame* frame,
- scoped_ptr<CopyOutputRequest> request) OVERRIDE;
- virtual void FinishDrawingQuadList() OVERRIDE;
+ scoped_ptr<CopyOutputRequest> request) override;
+ virtual void FinishDrawingQuadList() override;
// Check if quad needs antialiasing and if so, inflate the quad and
// fill edge array for fragment shader. local_quad is set to
@@ -146,12 +146,27 @@
static bool ShouldApplyBlendModeUsingBlendFunc(const DrawQuad* quad);
void ApplyBlendModeUsingBlendFunc(const DrawQuad* quad);
void RestoreBlendFuncToDefault();
- scoped_ptr<ScopedResource> GetBackgroundWithFilters(
+
+ gfx::Rect GetBackdropBoundingBoxForRenderPassQuad(
DrawingFrame* frame,
const RenderPassDrawQuad* quad,
- const gfx::Transform& contents_device_transform,
- const gfx::Transform& contents_device_transformInverse,
- bool* background_changed);
+ const gfx::Transform& contents_device_transform);
+ scoped_ptr<ScopedResource> GetBackdropTexture(const gfx::Rect& bounding_rect);
+
+ static bool ShouldApplyBackgroundFilters(DrawingFrame* frame,
+ const RenderPassDrawQuad* quad);
+ skia::RefPtr<SkImage> ApplyBackgroundFilters(
+ DrawingFrame* frame,
+ const RenderPassDrawQuad* quad,
+ ScopedResource* background_texture);
+ scoped_ptr<ScopedResource> ApplyInverseTransformForBackgroundFilters(
+ DrawingFrame* frame,
+ const RenderPassDrawQuad* quad,
+ const gfx::Transform& contents_device_transform_inverse,
+ ScopedResource* background_texture,
+ skia::RefPtr<SkImage> backdrop_bitmap,
+ const gfx::Rect& backdrop_bounding_rect);
+
void DrawRenderPassQuad(DrawingFrame* frame, const RenderPassDrawQuad* quad);
void DrawSolidColorQuad(const DrawingFrame* frame,
const SolidColorDrawQuad* quad);
@@ -205,8 +220,8 @@
void RestoreGLState();
void RestoreFramebuffer(DrawingFrame* frame);
- virtual void DiscardBackbuffer() OVERRIDE;
- virtual void EnsureBackbuffer() OVERRIDE;
+ virtual void DiscardBackbuffer() override;
+ virtual void EnsureBackbuffer() override;
void EnforceMemoryPolicy();
void ScheduleOverlays(DrawingFrame* frame);
diff --git a/cc/output/gl_renderer_unittest.cc b/cc/output/gl_renderer_unittest.cc
index c98652c..45b6d2a 100644
--- a/cc/output/gl_renderer_unittest.cc
+++ b/cc/output/gl_renderer_unittest.cc
@@ -363,35 +363,35 @@
virtual void getAttachedShaders(GLuint program,
GLsizei max_count,
GLsizei* count,
- GLuint* shaders) OVERRIDE {
+ GLuint* shaders) override {
ADD_FAILURE();
}
- virtual GLint getAttribLocation(GLuint program, const GLchar* name) OVERRIDE {
+ virtual GLint getAttribLocation(GLuint program, const GLchar* name) override {
ADD_FAILURE();
return 0;
}
- virtual void getBooleanv(GLenum pname, GLboolean* value) OVERRIDE {
+ virtual void getBooleanv(GLenum pname, GLboolean* value) override {
ADD_FAILURE();
}
virtual void getBufferParameteriv(GLenum target,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
ADD_FAILURE();
}
- virtual GLenum getError() OVERRIDE {
+ virtual GLenum getError() override {
ADD_FAILURE();
return GL_NO_ERROR;
}
- virtual void getFloatv(GLenum pname, GLfloat* value) OVERRIDE {
+ virtual void getFloatv(GLenum pname, GLfloat* value) override {
ADD_FAILURE();
}
virtual void getFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
ADD_FAILURE();
}
- virtual void getIntegerv(GLenum pname, GLint* value) OVERRIDE {
+ virtual void getIntegerv(GLenum pname, GLint* value) override {
if (pname == GL_MAX_TEXTURE_SIZE) {
// MAX_TEXTURE_SIZE is cached client side, so it's OK to query.
*value = 1024;
@@ -404,7 +404,7 @@
// mode, but not release.
virtual void getProgramiv(GLuint program,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
#ifndef NDEBUG
*value = 1;
#else
@@ -412,7 +412,7 @@
#endif
}
- virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) OVERRIDE {
+ virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) override {
#ifndef NDEBUG
*value = 1;
#else
@@ -422,53 +422,53 @@
virtual void getRenderbufferParameteriv(GLenum target,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
ADD_FAILURE();
}
virtual void getShaderPrecisionFormat(GLenum shadertype,
GLenum precisiontype,
GLint* range,
- GLint* precision) OVERRIDE {
+ GLint* precision) override {
ADD_FAILURE();
}
virtual void getTexParameterfv(GLenum target,
GLenum pname,
- GLfloat* value) OVERRIDE {
+ GLfloat* value) override {
ADD_FAILURE();
}
virtual void getTexParameteriv(GLenum target,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
ADD_FAILURE();
}
virtual void getUniformfv(GLuint program,
GLint location,
- GLfloat* value) OVERRIDE {
+ GLfloat* value) override {
ADD_FAILURE();
}
virtual void getUniformiv(GLuint program,
GLint location,
- GLint* value) OVERRIDE {
+ GLint* value) override {
ADD_FAILURE();
}
virtual GLint getUniformLocation(GLuint program,
- const GLchar* name) OVERRIDE {
+ const GLchar* name) override {
ADD_FAILURE();
return 0;
}
virtual void getVertexAttribfv(GLuint index,
GLenum pname,
- GLfloat* value) OVERRIDE {
+ GLfloat* value) override {
ADD_FAILURE();
}
virtual void getVertexAttribiv(GLuint index,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
ADD_FAILURE();
}
virtual GLsizeiptr getVertexAttribOffset(GLuint index,
- GLenum pname) OVERRIDE {
+ GLenum pname) override {
ADD_FAILURE();
return 0;
}
@@ -504,12 +504,12 @@
virtual void getProgramiv(GLuint program,
GLenum pname,
- GLint* value) OVERRIDE {
+ GLint* value) override {
context_lost_ = true;
*value = 0;
}
- virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) OVERRIDE {
+ virtual void getShaderiv(GLuint shader, GLenum pname, GLint* value) override {
context_lost_ = true;
*value = 0;
}
@@ -700,17 +700,17 @@
: last_call_was_set_visibility_(false) {}
// TestWebGraphicsContext3D methods.
- virtual void flush() OVERRIDE { last_call_was_set_visibility_ = false; }
- virtual void deleteTexture(GLuint) OVERRIDE {
+ virtual void flush() override { last_call_was_set_visibility_ = false; }
+ virtual void deleteTexture(GLuint) override {
last_call_was_set_visibility_ = false;
}
- virtual void deleteFramebuffer(GLuint) OVERRIDE {
+ virtual void deleteFramebuffer(GLuint) override {
last_call_was_set_visibility_ = false;
}
- virtual void deleteQueryEXT(GLuint) OVERRIDE {
+ virtual void deleteQueryEXT(GLuint) override {
last_call_was_set_visibility_ = false;
}
- virtual void deleteRenderbuffer(GLuint) OVERRIDE {
+ virtual void deleteRenderbuffer(GLuint) override {
last_call_was_set_visibility_ = false;
}
@@ -979,14 +979,14 @@
public:
ScissorTestOnClearCheckingContext() : scissor_enabled_(false) {}
- virtual void clear(GLbitfield) OVERRIDE { EXPECT_FALSE(scissor_enabled_); }
+ virtual void clear(GLbitfield) override { EXPECT_FALSE(scissor_enabled_); }
- virtual void enable(GLenum cap) OVERRIDE {
+ virtual void enable(GLenum cap) override {
if (cap == GL_SCISSOR_TEST)
scissor_enabled_ = true;
}
- virtual void disable(GLenum cap) OVERRIDE {
+ virtual void disable(GLenum cap) override {
if (cap == GL_SCISSOR_TEST)
scissor_enabled_ = false;
}
@@ -1069,7 +1069,7 @@
virtual void discardFramebufferEXT(GLenum target,
GLsizei numAttachments,
- const GLenum* attachments) OVERRIDE {
+ const GLenum* attachments) override {
++discarded_;
}
@@ -1088,7 +1088,7 @@
false) {
surface_size_ = gfx::Size(500, 500);
}
- virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE {}
+ virtual void Reshape(const gfx::Size& size, float scale_factor) override {}
void set_fixed_size(const gfx::Size& size) { surface_size_ = size; }
};
@@ -1258,7 +1258,7 @@
}
virtual void viewport(GLint x, GLint y, GLsizei width, GLsizei height)
- OVERRIDE {
+ override {
EXPECT_EQ(10, x);
EXPECT_EQ(390, y);
EXPECT_EQ(100, width);
@@ -1267,7 +1267,7 @@
}
virtual void scissor(GLint x, GLint y, GLsizei width, GLsizei height)
- OVERRIDE {
+ override {
EXPECT_EQ(30, x);
EXPECT_EQ(450, y);
EXPECT_EQ(20, width);
diff --git a/cc/output/output_surface_unittest.cc b/cc/output/output_surface_unittest.cc
index 4c51e1a..aca1d27 100644
--- a/cc/output/output_surface_unittest.cc
+++ b/cc/output/output_surface_unittest.cc
@@ -61,8 +61,8 @@
virtual ~TestSoftwareOutputDevice();
// Overriden from cc:SoftwareOutputDevice
- virtual void DiscardBackbuffer() OVERRIDE;
- virtual void EnsureBackbuffer() OVERRIDE;
+ virtual void DiscardBackbuffer() override;
+ virtual void EnsureBackbuffer() override;
int discard_backbuffer_count() { return discard_backbuffer_count_; }
int ensure_backbuffer_count() { return ensure_backbuffer_count_; }
diff --git a/cc/output/overlay_strategy_single_on_top.cc b/cc/output/overlay_strategy_single_on_top.cc
index 6ac96b2..94d35c4 100644
--- a/cc/output/overlay_strategy_single_on_top.cc
+++ b/cc/output/overlay_strategy_single_on_top.cc
@@ -28,8 +28,8 @@
DCHECK(root_render_pass);
QuadList& quad_list = root_render_pass->quad_list;
- QuadList::Iterator candidate_iterator = quad_list.end();
- for (QuadList::Iterator it = quad_list.begin(); it != quad_list.end(); ++it) {
+ auto candidate_iterator = quad_list.end();
+ for (auto it = quad_list.begin(); it != quad_list.end(); ++it) {
const DrawQuad* draw_quad = &*it;
if (draw_quad->material == DrawQuad::TEXTURE_CONTENT) {
const TextureDrawQuad& quad = *TextureDrawQuad::MaterialCast(draw_quad);
@@ -40,8 +40,7 @@
bool intersects = false;
gfx::RectF rect = draw_quad->rect;
draw_quad->quadTransform().TransformRect(&rect);
- for (QuadList::Iterator overlap_iter = quad_list.begin();
- overlap_iter != it;
+ for (auto overlap_iter = quad_list.cbegin(); overlap_iter != it;
++overlap_iter) {
gfx::RectF overlap_rect = overlap_iter->rect;
overlap_iter->quadTransform().TransformRect(&overlap_rect);
diff --git a/cc/output/overlay_strategy_single_on_top.h b/cc/output/overlay_strategy_single_on_top.h
index d984d3d..1bf6bd8 100644
--- a/cc/output/overlay_strategy_single_on_top.h
+++ b/cc/output/overlay_strategy_single_on_top.h
@@ -20,7 +20,7 @@
OverlayStrategySingleOnTop(OverlayCandidateValidator* capability_checker,
ResourceProvider* resource_provider);
virtual bool Attempt(RenderPassList* render_passes_in_draw_order,
- OverlayCandidateList* candidate_list) OVERRIDE;
+ OverlayCandidateList* candidate_list) override;
private:
OverlayCandidateValidator* capability_checker_;
diff --git a/cc/output/overlay_unittest.cc b/cc/output/overlay_unittest.cc
index 71f1ddc..698b42b 100644
--- a/cc/output/overlay_unittest.cc
+++ b/cc/output/overlay_unittest.cc
@@ -40,7 +40,7 @@
class SingleOverlayValidator : public OverlayCandidateValidator {
public:
- virtual void CheckOverlaySupport(OverlayCandidateList* surfaces) OVERRIDE;
+ virtual void CheckOverlaySupport(OverlayCandidateList* surfaces) override;
};
void SingleOverlayValidator::CheckOverlaySupport(
@@ -62,7 +62,7 @@
SingleOverlayProcessor(OutputSurface* surface,
ResourceProvider* resource_provider);
// Virtual to allow testing different strategies.
- virtual void Initialize() OVERRIDE;
+ virtual void Initialize() override;
};
SingleOverlayProcessor::SingleOverlayProcessor(
@@ -206,9 +206,9 @@
actual->shared_quad_state_list.size());
EXPECT_EQ(expected->quad_list.size(), actual->quad_list.size());
- for (QuadList::Iterator exp_iter = expected->quad_list.begin(),
- act_iter = actual->quad_list.begin();
- exp_iter != expected->quad_list.end();
+ for (auto exp_iter = expected->quad_list.cbegin(),
+ act_iter = actual->quad_list.cbegin();
+ exp_iter != expected->quad_list.cend();
++exp_iter, ++act_iter) {
EXPECT_EQ(exp_iter->rect.ToString(), act_iter->rect.ToString());
EXPECT_EQ(exp_iter->shared_quad_state->content_bounds.ToString(),
@@ -529,7 +529,7 @@
MOCK_METHOD2(DoDrawQuad, void(DrawingFrame* frame, const DrawQuad* quad));
- virtual void FinishDrawingFrame(DrawingFrame* frame) OVERRIDE {
+ virtual void FinishDrawingFrame(DrawingFrame* frame) override {
GLRenderer::FinishDrawingFrame(frame);
if (!expect_overlays_) {
@@ -552,7 +552,7 @@
class FakeRendererClient : public RendererClient {
public:
// RendererClient methods.
- virtual void SetFullRootLayerDamage() OVERRIDE {}
+ virtual void SetFullRootLayerDamage() override {}
};
class MockOverlayScheduler {
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index 6d5af36..00c9100 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -12,6 +12,7 @@
#include "cc/test/fake_picture_pile_impl.h"
#include "cc/test/pixel_test.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "media/base/video_frame.h"
#include "third_party/skia/include/core/SkColorPriv.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "third_party/skia/include/core/SkMatrix.h"
@@ -383,6 +384,346 @@
FuzzyPixelOffByOneComparator(true)));
}
+class VideoGLRendererPixelTest : public GLRendererPixelTest {
+ protected:
+ void CreateTestYUVVideoDrawQuad_Striped(const SharedQuadState* shared_state,
+ media::VideoFrame::Format format,
+ bool is_transparent,
+ const gfx::RectF& tex_coord_rect,
+ RenderPass* render_pass) {
+ const gfx::Rect rect(this->device_viewport_size_);
+
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::CreateFrame(
+ format, rect.size(), rect, rect.size(), base::TimeDelta());
+
+ // YUV values representing a striped pattern, for validating texture
+ // coordinates for sampling.
+ uint8_t y_value = 0;
+ uint8_t u_value = 0;
+ uint8_t v_value = 0;
+ for (int i = 0; i < video_frame->rows(media::VideoFrame::kYPlane); ++i) {
+ uint8_t* y_row = video_frame->data(media::VideoFrame::kYPlane) +
+ video_frame->stride(media::VideoFrame::kYPlane) * i;
+ for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kYPlane);
+ ++j) {
+ y_row[j] = (y_value += 1);
+ }
+ }
+ for (int i = 0; i < video_frame->rows(media::VideoFrame::kUPlane); ++i) {
+ uint8_t* u_row = video_frame->data(media::VideoFrame::kUPlane) +
+ video_frame->stride(media::VideoFrame::kUPlane) * i;
+ uint8_t* v_row = video_frame->data(media::VideoFrame::kVPlane) +
+ video_frame->stride(media::VideoFrame::kVPlane) * i;
+ for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kUPlane);
+ ++j) {
+ u_row[j] = (u_value += 3);
+ v_row[j] = (v_value += 5);
+ }
+ }
+ CreateTestYUVVideoDrawQuad_FromVideoFrame(
+ shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
+ }
+
+ void CreateTestYUVVideoDrawQuad_Solid(const SharedQuadState* shared_state,
+ media::VideoFrame::Format format,
+ bool is_transparent,
+ const gfx::RectF& tex_coord_rect,
+ uint8 y,
+ uint8 u,
+ uint8 v,
+ RenderPass* render_pass) {
+ const gfx::Rect rect(this->device_viewport_size_);
+
+ scoped_refptr<media::VideoFrame> video_frame =
+ media::VideoFrame::CreateFrame(
+ format, rect.size(), rect, rect.size(), base::TimeDelta());
+
+ // YUV values of a solid, constant, color. Useful for testing that color
+ // space/color range are being handled properly.
+ memset(video_frame->data(media::VideoFrame::kYPlane),
+ y,
+ video_frame->stride(media::VideoFrame::kYPlane) *
+ video_frame->rows(media::VideoFrame::kYPlane));
+ memset(video_frame->data(media::VideoFrame::kUPlane),
+ u,
+ video_frame->stride(media::VideoFrame::kUPlane) *
+ video_frame->rows(media::VideoFrame::kUPlane));
+ memset(video_frame->data(media::VideoFrame::kVPlane),
+ v,
+ video_frame->stride(media::VideoFrame::kVPlane) *
+ video_frame->rows(media::VideoFrame::kVPlane));
+
+ CreateTestYUVVideoDrawQuad_FromVideoFrame(
+ shared_state, video_frame, is_transparent, tex_coord_rect, render_pass);
+ }
+
+ void CreateTestYUVVideoDrawQuad_FromVideoFrame(
+ const SharedQuadState* shared_state,
+ scoped_refptr<media::VideoFrame> video_frame,
+ bool is_transparent,
+ const gfx::RectF& tex_coord_rect,
+ RenderPass* render_pass) {
+ const bool with_alpha = (video_frame->format() == media::VideoFrame::YV12A);
+ const YUVVideoDrawQuad::ColorSpace color_space =
+ (video_frame->format() == media::VideoFrame::YV12J
+ ? YUVVideoDrawQuad::REC_601_JPEG
+ : YUVVideoDrawQuad::REC_601);
+ const gfx::Rect rect(this->device_viewport_size_);
+ const gfx::Rect opaque_rect(0, 0, 0, 0);
+
+ if (with_alpha)
+ memset(video_frame->data(media::VideoFrame::kAPlane),
+ is_transparent ? 0 : 128,
+ video_frame->stride(media::VideoFrame::kAPlane) *
+ video_frame->rows(media::VideoFrame::kAPlane));
+
+ VideoFrameExternalResources resources =
+ video_resource_updater_->CreateExternalResourcesFromVideoFrame(
+ video_frame);
+
+ EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type);
+ EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()),
+ resources.mailboxes.size());
+ EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()),
+ resources.release_callbacks.size());
+
+ ResourceProvider::ResourceId y_resource =
+ resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kYPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kYPlane]));
+ ResourceProvider::ResourceId u_resource =
+ resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kUPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kUPlane]));
+ ResourceProvider::ResourceId v_resource =
+ resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kVPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kVPlane]));
+ ResourceProvider::ResourceId a_resource = 0;
+ if (with_alpha) {
+ a_resource = resource_provider_->CreateResourceFromTextureMailbox(
+ resources.mailboxes[media::VideoFrame::kAPlane],
+ SingleReleaseCallbackImpl::Create(
+ resources.release_callbacks[media::VideoFrame::kAPlane]));
+ }
+
+ YUVVideoDrawQuad* yuv_quad =
+ render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
+ yuv_quad->SetNew(shared_state,
+ rect,
+ opaque_rect,
+ rect,
+ tex_coord_rect,
+ y_resource,
+ u_resource,
+ v_resource,
+ a_resource,
+ color_space);
+ }
+
+ virtual void SetUp() override {
+ GLRendererPixelTest::SetUp();
+ video_resource_updater_.reset(new VideoResourceUpdater(
+ output_surface_->context_provider(), resource_provider_.get()));
+ }
+
+ private:
+ scoped_ptr<VideoResourceUpdater> video_resource_updater_;
+};
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::YV12,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(
+ this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // Intentionally sets frame format to I420 for testing coverage.
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::I420,
+ false,
+ gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f),
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // In MPEG color range YUV values of (15,128,128) should produce black.
+ CreateTestYUVVideoDrawQuad_Solid(shared_state,
+ media::VideoFrame::YV12,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ 15,
+ 128,
+ 128,
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ // If we didn't get black out of the YUV values above, then we probably have a
+ // color range issue.
+ EXPECT_TRUE(this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("black.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // YUV of (149,43,21) should be green (0,255,0) in RGB.
+ CreateTestYUVVideoDrawQuad_Solid(shared_state,
+ media::VideoFrame::YV12J,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ 149,
+ 43,
+ 21,
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("green.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ // Dark grey in JPEG color range (in MPEG, this is black).
+ CreateTestYUVVideoDrawQuad_Solid(shared_state,
+ media::VideoFrame::YV12J,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ 15,
+ 128,
+ 128,
+ pass.get());
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(
+ this->RunPixelTest(&pass_list,
+ base::FilePath(FILE_PATH_LITERAL("dark_grey.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::YV12A,
+ false,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get());
+
+ SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
+ color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false);
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("yuv_stripes_alpha.png")),
+ FuzzyPixelOffByOneComparator(true)));
+}
+
+TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) {
+ gfx::Rect rect(this->device_viewport_size_);
+
+ RenderPassId id(1, 1);
+ scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect);
+
+ SharedQuadState* shared_state =
+ CreateTestSharedQuadState(gfx::Transform(), rect, pass.get());
+
+ CreateTestYUVVideoDrawQuad_Striped(shared_state,
+ media::VideoFrame::YV12A,
+ true,
+ gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f),
+ pass.get());
+
+ SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
+ color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false);
+
+ RenderPassList pass_list;
+ pass_list.push_back(pass.Pass());
+
+ EXPECT_TRUE(this->RunPixelTest(
+ &pass_list,
+ base::FilePath(FILE_PATH_LITERAL("black.png")),
+ ExactPixelComparator(true)));
+}
+
TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) {
gfx::Rect viewport_rect(this->device_viewport_size_);
diff --git a/cc/output/software_renderer.h b/cc/output/software_renderer.h
index 5c9fef0..deac838 100644
--- a/cc/output/software_renderer.h
+++ b/cc/output/software_renderer.h
@@ -34,42 +34,42 @@
ResourceProvider* resource_provider);
virtual ~SoftwareRenderer();
- virtual const RendererCapabilitiesImpl& Capabilities() const OVERRIDE;
- virtual void Finish() OVERRIDE;
- virtual void SwapBuffers(const CompositorFrameMetadata& metadata) OVERRIDE;
+ virtual const RendererCapabilitiesImpl& Capabilities() const override;
+ virtual void Finish() override;
+ virtual void SwapBuffers(const CompositorFrameMetadata& metadata) override;
virtual void ReceiveSwapBuffersAck(
- const CompositorFrameAck& ack) OVERRIDE;
- virtual void DiscardBackbuffer() OVERRIDE;
- virtual void EnsureBackbuffer() OVERRIDE;
+ const CompositorFrameAck& ack) override;
+ virtual void DiscardBackbuffer() override;
+ virtual void EnsureBackbuffer() override;
protected:
- virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) OVERRIDE;
+ virtual void BindFramebufferToOutputSurface(DrawingFrame* frame) override;
virtual bool BindFramebufferToTexture(
DrawingFrame* frame,
const ScopedResource* texture,
- const gfx::Rect& target_rect) OVERRIDE;
- virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) OVERRIDE;
- virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) OVERRIDE;
+ const gfx::Rect& target_rect) override;
+ virtual void SetDrawViewport(const gfx::Rect& window_space_viewport) override;
+ virtual void SetScissorTestRect(const gfx::Rect& scissor_rect) override;
virtual void DiscardPixels(bool has_external_stencil_test,
- bool draw_rect_covers_full_surface) OVERRIDE;
+ bool draw_rect_covers_full_surface) override;
virtual void ClearFramebuffer(DrawingFrame* frame,
- bool has_external_stencil_test) OVERRIDE;
- virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) OVERRIDE;
- virtual void BeginDrawingFrame(DrawingFrame* frame) OVERRIDE;
- virtual void FinishDrawingFrame(DrawingFrame* frame) OVERRIDE;
- virtual bool FlippedFramebuffer() const OVERRIDE;
- virtual void EnsureScissorTestEnabled() OVERRIDE;
- virtual void EnsureScissorTestDisabled() OVERRIDE;
+ bool has_external_stencil_test) override;
+ virtual void DoDrawQuad(DrawingFrame* frame, const DrawQuad* quad) override;
+ virtual void BeginDrawingFrame(DrawingFrame* frame) override;
+ virtual void FinishDrawingFrame(DrawingFrame* frame) override;
+ virtual bool FlippedFramebuffer() const override;
+ virtual void EnsureScissorTestEnabled() override;
+ virtual void EnsureScissorTestDisabled() override;
virtual void CopyCurrentRenderPassToBitmap(
DrawingFrame* frame,
- scoped_ptr<CopyOutputRequest> request) OVERRIDE;
+ scoped_ptr<CopyOutputRequest> request) override;
SoftwareRenderer(RendererClient* client,
const LayerTreeSettings* settings,
OutputSurface* output_surface,
ResourceProvider* resource_provider);
- virtual void DidChangeVisibility() OVERRIDE;
+ virtual void DidChangeVisibility() override;
private:
void ClearCanvas(SkColor color);
diff --git a/cc/output/software_renderer_unittest.cc b/cc/output/software_renderer_unittest.cc
index 2818ab6..5dfc158 100644
--- a/cc/output/software_renderer_unittest.cc
+++ b/cc/output/software_renderer_unittest.cc
@@ -54,7 +54,7 @@
SoftwareRenderer* renderer() const { return renderer_.get(); }
// RendererClient implementation.
- virtual void SetFullRootLayerDamage() OVERRIDE {}
+ virtual void SetFullRootLayerDamage() override {}
scoped_ptr<SkBitmap> DrawAndCopyOutput(RenderPassList* list,
float device_scale_factor,
diff --git a/cc/quads/checkerboard_draw_quad.h b/cc/quads/checkerboard_draw_quad.h
index f99531d..71253e3 100644
--- a/cc/quads/checkerboard_draw_quad.h
+++ b/cc/quads/checkerboard_draw_quad.h
@@ -31,12 +31,12 @@
SkColor color;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const CheckerboardDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/content_draw_quad_base.h b/cc/quads/content_draw_quad_base.h
index 5173d6c..d6b1995 100644
--- a/cc/quads/content_draw_quad_base.h
+++ b/cc/quads/content_draw_quad_base.h
@@ -42,7 +42,7 @@
protected:
ContentDrawQuadBase();
virtual ~ContentDrawQuadBase();
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/debug_border_draw_quad.h b/cc/quads/debug_border_draw_quad.h
index 828d4e0..e2b6f70 100644
--- a/cc/quads/debug_border_draw_quad.h
+++ b/cc/quads/debug_border_draw_quad.h
@@ -34,12 +34,12 @@
int width;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const DebugBorderDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/io_surface_draw_quad.h b/cc/quads/io_surface_draw_quad.h
index 86b4d52..3829156 100644
--- a/cc/quads/io_surface_draw_quad.h
+++ b/cc/quads/io_surface_draw_quad.h
@@ -44,12 +44,12 @@
Orientation orientation;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const IOSurfaceDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/list_container.cc b/cc/quads/list_container.cc
index fd4e2f4..cc09a22 100644
--- a/cc/quads/list_container.cc
+++ b/cc/quads/list_container.cc
@@ -279,7 +279,7 @@
template <typename BaseElementType>
typename ListContainer<BaseElementType>::ConstReverseIterator
-ListContainer<BaseElementType>::rbegin() const {
+ListContainer<BaseElementType>::crbegin() const {
if (data_->IsEmpty())
return ConstReverseIterator(data_.get(), 0, NULL, 0);
@@ -290,11 +290,23 @@
template <typename BaseElementType>
typename ListContainer<BaseElementType>::ConstReverseIterator
-ListContainer<BaseElementType>::rend() const {
+ListContainer<BaseElementType>::crend() const {
return ConstReverseIterator(data_.get(), 0, NULL, size());
}
template <typename BaseElementType>
+typename ListContainer<BaseElementType>::ConstReverseIterator
+ListContainer<BaseElementType>::rbegin() const {
+ return crbegin();
+}
+
+template <typename BaseElementType>
+typename ListContainer<BaseElementType>::ConstReverseIterator
+ListContainer<BaseElementType>::rend() const {
+ return crend();
+}
+
+template <typename BaseElementType>
typename ListContainer<BaseElementType>::ReverseIterator
ListContainer<BaseElementType>::rbegin() {
if (data_->IsEmpty())
@@ -313,7 +325,7 @@
template <typename BaseElementType>
typename ListContainer<BaseElementType>::ConstIterator
-ListContainer<BaseElementType>::begin() const {
+ListContainer<BaseElementType>::cbegin() const {
if (data_->IsEmpty())
return ConstIterator(data_.get(), 0, NULL, 0);
@@ -322,7 +334,7 @@
template <typename BaseElementType>
typename ListContainer<BaseElementType>::ConstIterator
-ListContainer<BaseElementType>::end() const {
+ListContainer<BaseElementType>::cend() const {
if (data_->IsEmpty())
return ConstIterator(data_.get(), 0, NULL, size());
@@ -331,6 +343,18 @@
}
template <typename BaseElementType>
+typename ListContainer<BaseElementType>::ConstIterator
+ListContainer<BaseElementType>::begin() const {
+ return cbegin();
+}
+
+template <typename BaseElementType>
+typename ListContainer<BaseElementType>::ConstIterator
+ListContainer<BaseElementType>::end() const {
+ return cend();
+}
+
+template <typename BaseElementType>
typename ListContainer<BaseElementType>::Iterator
ListContainer<BaseElementType>::begin() {
if (data_->IsEmpty())
diff --git a/cc/quads/list_container.h b/cc/quads/list_container.h
index c3c19b0..24c24ac 100644
--- a/cc/quads/list_container.h
+++ b/cc/quads/list_container.h
@@ -173,15 +173,21 @@
// This function does not deallocate memory.
void EraseAndInvalidateAllPointers(Iterator position);
+ ConstReverseIterator crbegin() const;
+ ConstReverseIterator crend() const;
ConstReverseIterator rbegin() const;
ConstReverseIterator rend() const;
ReverseIterator rbegin();
ReverseIterator rend();
+ ConstIterator cbegin() const;
+ ConstIterator cend() const;
ConstIterator begin() const;
ConstIterator end() const;
Iterator begin();
Iterator end();
+ // TODO(weiliangc): front(), back() and ElementAt() function should return
+ // reference, consistent with container-of-object.
BaseElementType* front();
BaseElementType* back();
const BaseElementType* front() const;
diff --git a/cc/quads/list_container_unittest.cc b/cc/quads/list_container_unittest.cc
index cb79f7a..8b68852 100644
--- a/cc/quads/list_container_unittest.cc
+++ b/cc/quads/list_container_unittest.cc
@@ -31,11 +31,11 @@
public:
virtual ~SimpleDrawQuad() {}
virtual void IterateResources(
- const ResourceIteratorCallback& callback) OVERRIDE {}
+ const ResourceIteratorCallback& callback) override {}
void set_value(int val) { value = val; }
int get_value() { return value; }
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE {}
+ virtual void ExtendValue(base::debug::TracedValue* value) const override {}
private:
int value;
@@ -59,8 +59,8 @@
public:
virtual ~MockDrawQuad() { Destruct(); }
virtual void IterateResources(
- const ResourceIteratorCallback& callback) OVERRIDE {}
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE {}
+ const ResourceIteratorCallback& callback) override {}
+ virtual void ExtendValue(base::debug::TracedValue* value) const override {}
MOCK_METHOD0(Destruct, void());
};
diff --git a/cc/quads/picture_draw_quad.h b/cc/quads/picture_draw_quad.h
index 4fb6b4b..5d75e05 100644
--- a/cc/quads/picture_draw_quad.h
+++ b/cc/quads/picture_draw_quad.h
@@ -51,12 +51,12 @@
ResourceFormat texture_format;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const PictureDrawQuad* MaterialCast(const DrawQuad* quad);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/render_pass_draw_quad.h b/cc/quads/render_pass_draw_quad.h
index 40540d2..587c7ec 100644
--- a/cc/quads/render_pass_draw_quad.h
+++ b/cc/quads/render_pass_draw_quad.h
@@ -60,12 +60,12 @@
FilterOperations background_filters;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const RenderPassDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/render_pass_unittest.cc b/cc/quads/render_pass_unittest.cc
index 36e57d0..81a3d31 100644
--- a/cc/quads/render_pass_unittest.cc
+++ b/cc/quads/render_pass_unittest.cc
@@ -52,9 +52,9 @@
actual->shared_quad_state_list.size());
EXPECT_EQ(expected->quad_list.size(), actual->quad_list.size());
- for (QuadList::Iterator exp_iter = expected->quad_list.begin(),
- act_iter = actual->quad_list.begin();
- exp_iter != expected->quad_list.end();
+ for (auto exp_iter = expected->quad_list.cbegin(),
+ act_iter = actual->quad_list.cbegin();
+ exp_iter != expected->quad_list.cend();
++exp_iter, ++act_iter) {
EXPECT_EQ(exp_iter->rect.ToString(), act_iter->rect.ToString());
EXPECT_EQ(exp_iter->shared_quad_state->content_bounds.ToString(),
diff --git a/cc/quads/solid_color_draw_quad.h b/cc/quads/solid_color_draw_quad.h
index bfb6022..256cc52 100644
--- a/cc/quads/solid_color_draw_quad.h
+++ b/cc/quads/solid_color_draw_quad.h
@@ -34,12 +34,12 @@
bool force_anti_aliasing_off;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const SolidColorDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/stream_video_draw_quad.h b/cc/quads/stream_video_draw_quad.h
index 5db7c3b..f4cb0f5 100644
--- a/cc/quads/stream_video_draw_quad.h
+++ b/cc/quads/stream_video_draw_quad.h
@@ -35,12 +35,12 @@
gfx::Transform matrix;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/surface_draw_quad.h b/cc/quads/surface_draw_quad.h
index 91e5668..2fa35f1 100644
--- a/cc/quads/surface_draw_quad.h
+++ b/cc/quads/surface_draw_quad.h
@@ -31,12 +31,12 @@
SurfaceId surface_id;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const SurfaceDrawQuad* MaterialCast(const DrawQuad* quad);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/texture_draw_quad.h b/cc/quads/texture_draw_quad.h
index ef8090c..3a3bb54 100644
--- a/cc/quads/texture_draw_quad.h
+++ b/cc/quads/texture_draw_quad.h
@@ -50,12 +50,12 @@
bool flipped;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const TextureDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/tile_draw_quad.h b/cc/quads/tile_draw_quad.h
index 72e6bba..e8941d5 100644
--- a/cc/quads/tile_draw_quad.h
+++ b/cc/quads/tile_draw_quad.h
@@ -36,12 +36,12 @@
unsigned resource_id;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const TileDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h
index fa77562..e0fc758 100644
--- a/cc/quads/yuv_video_draw_quad.h
+++ b/cc/quads/yuv_video_draw_quad.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "cc/base/cc_export.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/quads/draw_quad.h"
namespace cc {
@@ -55,12 +56,12 @@
ColorSpace color_space;
virtual void IterateResources(const ResourceIteratorCallback& callback)
- OVERRIDE;
+ override;
static const YUVVideoDrawQuad* MaterialCast(const DrawQuad*);
private:
- virtual void ExtendValue(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void ExtendValue(base::debug::TracedValue* value) const override;
};
} // namespace cc
diff --git a/cc/resources/bitmap_content_layer_updater.h b/cc/resources/bitmap_content_layer_updater.h
index ca3f445..0010c41 100644
--- a/cc/resources/bitmap_content_layer_updater.h
+++ b/cc/resources/bitmap_content_layer_updater.h
@@ -32,7 +32,7 @@
virtual void Update(ResourceUpdateQueue* queue,
const gfx::Rect& source_rect,
const gfx::Vector2d& dest_offset,
- bool partial_update) OVERRIDE;
+ bool partial_update) override;
private:
BitmapContentLayerUpdater* updater_;
@@ -46,19 +46,19 @@
int layer_id);
virtual scoped_ptr<LayerUpdater::Resource> CreateResource(
- PrioritizedResourceManager* manager) OVERRIDE;
+ PrioritizedResourceManager* manager) override;
virtual void PrepareToUpdate(const gfx::Size& content_size,
const gfx::Rect& paint_rect,
const gfx::Size& tile_size,
float contents_width_scale,
- float contents_height_scale) OVERRIDE;
+ float contents_height_scale) override;
void UpdateTexture(ResourceUpdateQueue* queue,
PrioritizedResource* resource,
const gfx::Rect& source_rect,
const gfx::Vector2d& dest_offset,
bool partial_update);
- virtual void SetOpaque(bool opaque) OVERRIDE;
- virtual void ReduceMemoryUsage() OVERRIDE;
+ virtual void SetOpaque(bool opaque) override;
+ virtual void ReduceMemoryUsage() override;
protected:
BitmapContentLayerUpdater(
diff --git a/cc/resources/bitmap_raster_worker_pool.cc b/cc/resources/bitmap_raster_worker_pool.cc
index 959a0f3..404f67f 100644
--- a/cc/resources/bitmap_raster_worker_pool.cc
+++ b/cc/resources/bitmap_raster_worker_pool.cc
@@ -23,10 +23,10 @@
: lock_(resource_provider, resource->id()) {}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() OVERRIDE {
+ virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
return skia::SharePtr(lock_.sk_canvas());
}
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) OVERRIDE {}
+ virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {}
private:
ResourceProvider::ScopedWriteLockSoftware lock_;
diff --git a/cc/resources/bitmap_raster_worker_pool.h b/cc/resources/bitmap_raster_worker_pool.h
index 39c4237..876bf36 100644
--- a/cc/resources/bitmap_raster_worker_pool.h
+++ b/cc/resources/bitmap_raster_worker_pool.h
@@ -31,18 +31,18 @@
ResourceProvider* resource_provider);
// Overridden from RasterWorkerPool:
- virtual Rasterizer* AsRasterizer() OVERRIDE;
+ virtual Rasterizer* AsRasterizer() override;
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE;
- virtual void CheckForCompletedTasks() OVERRIDE;
+ virtual void SetClient(RasterizerClient* client) override;
+ virtual void Shutdown() override;
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override;
+ virtual void CheckForCompletedTasks() override;
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE;
- virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) OVERRIDE;
+ const Resource* resource) override;
+ virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
protected:
BitmapRasterWorkerPool(base::SequencedTaskRunner* task_runner,
diff --git a/cc/resources/bitmap_skpicture_content_layer_updater.h b/cc/resources/bitmap_skpicture_content_layer_updater.h
index e20e3c3..030db6e 100644
--- a/cc/resources/bitmap_skpicture_content_layer_updater.h
+++ b/cc/resources/bitmap_skpicture_content_layer_updater.h
@@ -23,7 +23,7 @@
virtual void Update(ResourceUpdateQueue* queue,
const gfx::Rect& source_rect,
const gfx::Vector2d& dest_offset,
- bool partial_update) OVERRIDE;
+ bool partial_update) override;
private:
SkBitmap bitmap_;
@@ -38,7 +38,7 @@
int layer_id);
virtual scoped_ptr<LayerUpdater::Resource> CreateResource(
- PrioritizedResourceManager* manager) OVERRIDE;
+ PrioritizedResourceManager* manager) override;
void PaintContentsRect(SkCanvas* canvas,
const gfx::Rect& source_rect);
diff --git a/cc/resources/content_layer_updater.h b/cc/resources/content_layer_updater.h
index b11281e..33d3ee5 100644
--- a/cc/resources/content_layer_updater.h
+++ b/cc/resources/content_layer_updater.h
@@ -22,9 +22,9 @@
class CC_EXPORT ContentLayerUpdater : public LayerUpdater {
public:
void set_rendering_stats_instrumentation(RenderingStatsInstrumentation* rsi);
- virtual void SetOpaque(bool opaque) OVERRIDE;
- virtual void SetFillsBoundsCompletely(bool fills_bounds) OVERRIDE;
- virtual void SetBackgroundColor(SkColor background_color) OVERRIDE;
+ virtual void SetOpaque(bool opaque) override;
+ virtual void SetFillsBoundsCompletely(bool fills_bounds) override;
+ virtual void SetBackgroundColor(SkColor background_color) override;
protected:
ContentLayerUpdater(scoped_ptr<LayerPainter> painter,
diff --git a/cc/resources/gpu_raster_worker_pool.cc b/cc/resources/gpu_raster_worker_pool.cc
index cee01fe..229a3f7 100644
--- a/cc/resources/gpu_raster_worker_pool.cc
+++ b/cc/resources/gpu_raster_worker_pool.cc
@@ -27,17 +27,13 @@
RasterBufferImpl(ResourceProvider* resource_provider,
const Resource* resource,
SkMultiPictureDraw* multi_picture_draw)
- : resource_provider_(resource_provider),
+ : lock_(resource_provider, resource->id()),
resource_(resource),
- surface_(resource_provider->LockForWriteToSkSurface(resource->id())),
multi_picture_draw_(multi_picture_draw) {}
- virtual ~RasterBufferImpl() {
- resource_provider_->UnlockForWriteToSkSurface(resource_->id());
- }
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() OVERRIDE {
- if (!surface_)
+ virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
+ if (!lock_.sk_surface())
return skia::AdoptRef(SkCreateNullCanvas());
skia::RefPtr<SkCanvas> canvas = skia::SharePtr(recorder_.beginRecording(
@@ -48,8 +44,8 @@
canvas->save();
return canvas;
}
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) OVERRIDE {
- if (!surface_)
+ virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
+ if (!lock_.sk_surface())
return;
// Balanced with save() call in AcquireSkCanvas.
@@ -57,13 +53,12 @@
// Add the canvas and recorded picture to |multi_picture_draw_|.
skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder_.endRecording());
- multi_picture_draw_->add(surface_->getCanvas(), picture.get());
+ multi_picture_draw_->add(lock_.sk_surface()->getCanvas(), picture.get());
}
private:
- ResourceProvider* resource_provider_;
+ ResourceProvider::ScopedWriteLockGr lock_;
const Resource* resource_;
- SkSurface* surface_;
SkMultiPictureDraw* multi_picture_draw_;
SkPictureRecorder recorder_;
@@ -198,10 +193,6 @@
scoped_ptr<RasterBuffer> GpuRasterWorkerPool::AcquireBufferForRaster(
const Resource* resource) {
- // RasterBuffer implementation depends on a SkSurface having been acquired for
- // the resource.
- resource_provider_->AcquireSkSurface(resource->id());
-
return make_scoped_ptr<RasterBuffer>(
new RasterBufferImpl(resource_provider_, resource, &multi_picture_draw_));
}
diff --git a/cc/resources/gpu_raster_worker_pool.h b/cc/resources/gpu_raster_worker_pool.h
index 2149400..48c17b1 100644
--- a/cc/resources/gpu_raster_worker_pool.h
+++ b/cc/resources/gpu_raster_worker_pool.h
@@ -26,18 +26,18 @@
ResourceProvider* resource_provider);
// Overridden from RasterWorkerPool:
- virtual Rasterizer* AsRasterizer() OVERRIDE;
+ virtual Rasterizer* AsRasterizer() override;
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE;
- virtual void CheckForCompletedTasks() OVERRIDE;
+ virtual void SetClient(RasterizerClient* client) override;
+ virtual void Shutdown() override;
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override;
+ virtual void CheckForCompletedTasks() override;
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE;
- virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) OVERRIDE;
+ const Resource* resource) override;
+ virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
private:
GpuRasterWorkerPool(base::SequencedTaskRunner* task_runner,
diff --git a/cc/resources/image_layer_updater.h b/cc/resources/image_layer_updater.h
index b2235b1..55fdfe5 100644
--- a/cc/resources/image_layer_updater.h
+++ b/cc/resources/image_layer_updater.h
@@ -24,7 +24,7 @@
virtual void Update(ResourceUpdateQueue* queue,
const gfx::Rect& source_rect,
const gfx::Vector2d& dest_offset,
- bool partial_update) OVERRIDE;
+ bool partial_update) override;
private:
ImageLayerUpdater* updater_;
@@ -35,7 +35,7 @@
static scoped_refptr<ImageLayerUpdater> Create();
virtual scoped_ptr<LayerUpdater::Resource> CreateResource(
- PrioritizedResourceManager*) OVERRIDE;
+ PrioritizedResourceManager*) override;
void UpdateTexture(ResourceUpdateQueue* queue,
PrioritizedResource* texture,
diff --git a/cc/resources/one_copy_raster_worker_pool.cc b/cc/resources/one_copy_raster_worker_pool.cc
index a86d498..fba320f 100644
--- a/cc/resources/one_copy_raster_worker_pool.cc
+++ b/cc/resources/one_copy_raster_worker_pool.cc
@@ -28,40 +28,37 @@
resource_pool_(resource_pool),
resource_(resource),
raster_resource_(resource_pool->AcquireResource(resource->size())),
- buffer_(NULL),
- stride_(0) {
- // Acquire and map image for raster resource.
- resource_provider_->AcquireImage(raster_resource_->id());
- buffer_ = resource_provider_->MapImage(raster_resource_->id(), &stride_);
- }
+ lock_(new ResourceProvider::ScopedWriteLockGpuMemoryBuffer(
+ resource_provider_,
+ raster_resource_->id())),
+ buffer_(NULL) {}
virtual ~RasterBufferImpl() {
- // First unmap image for raster resource.
- resource_provider_->UnmapImage(raster_resource_->id());
+ // First unlock raster resource.
+ lock_.reset();
// Copy contents of raster resource to |resource_|.
resource_provider_->CopyResource(raster_resource_->id(), resource_->id());
- // This RasterBuffer implementation provides direct access to the memory
- // used by the GPU. Read lock fences are required to ensure that we're not
- // trying to map a resource that is currently in-use by the GPU.
- resource_provider_->EnableReadLockFences(raster_resource_->id());
-
// Return raster resource to pool so it can be used by another RasterBuffer
// instance.
resource_pool_->ReleaseResource(raster_resource_.Pass());
}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() OVERRIDE {
+ virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
+ buffer_ = lock_->gpu_memory_buffer();
if (!buffer_)
return skia::AdoptRef(SkCreateNullCanvas());
- RasterWorkerPool::AcquireBitmapForBuffer(
- &bitmap_, buffer_, resource_->format(), resource_->size(), stride_);
+ RasterWorkerPool::AcquireBitmapForBuffer(&bitmap_,
+ buffer_,
+ resource_->format(),
+ resource_->size(),
+ lock_->stride());
return skia::AdoptRef(new SkCanvas(bitmap_));
}
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) OVERRIDE {
+ virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
if (!buffer_)
return;
@@ -74,8 +71,8 @@
ResourcePool* resource_pool_;
const Resource* resource_;
scoped_ptr<ScopedResource> raster_resource_;
- uint8_t* buffer_;
- int stride_;
+ scoped_ptr<ResourceProvider::ScopedWriteLockGpuMemoryBuffer> lock_;
+ void* buffer_;
SkBitmap bitmap_;
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
diff --git a/cc/resources/one_copy_raster_worker_pool.h b/cc/resources/one_copy_raster_worker_pool.h
index 1943868..c240999 100644
--- a/cc/resources/one_copy_raster_worker_pool.h
+++ b/cc/resources/one_copy_raster_worker_pool.h
@@ -37,18 +37,18 @@
ResourcePool* resource_pool);
// Overridden from RasterWorkerPool:
- virtual Rasterizer* AsRasterizer() OVERRIDE;
+ virtual Rasterizer* AsRasterizer() override;
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE;
- virtual void CheckForCompletedTasks() OVERRIDE;
+ virtual void SetClient(RasterizerClient* client) override;
+ virtual void Shutdown() override;
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override;
+ virtual void CheckForCompletedTasks() override;
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE;
- virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) OVERRIDE;
+ const Resource* resource) override;
+ virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
protected:
OneCopyRasterWorkerPool(base::SequencedTaskRunner* task_runner,
diff --git a/cc/resources/picture_layer_tiling_perftest.cc b/cc/resources/picture_layer_tiling_perftest.cc
index 78a6a08..32cc9bb 100644
--- a/cc/resources/picture_layer_tiling_perftest.cc
+++ b/cc/resources/picture_layer_tiling_perftest.cc
@@ -43,7 +43,7 @@
false).Pass();
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
picture_layer_tiling_client_.SetTileSize(gfx::Size(256, 256));
picture_layer_tiling_client_.set_max_tiles_for_interest_area(250);
picture_layer_tiling_client_.set_tree(PENDING_TREE);
@@ -52,7 +52,7 @@
picture_layer_tiling_->CreateAllTilesForTesting();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
picture_layer_tiling_.reset(NULL);
}
diff --git a/cc/resources/picture_pile_unittest.cc b/cc/resources/picture_pile_unittest.cc
index 87938fa..15cb3d3 100644
--- a/cc/resources/picture_pile_unittest.cc
+++ b/cc/resources/picture_pile_unittest.cc
@@ -96,7 +96,7 @@
class PicturePileTest : public PicturePileTestBase, public testing::Test {
public:
- virtual void SetUp() OVERRIDE { InitializeData(); }
+ virtual void SetUp() override { InitializeData(); }
};
TEST_F(PicturePileTest, SmallInvalidateInflated) {
@@ -402,7 +402,7 @@
class PicturePileResizeCornerTest : public PicturePileTestBase,
public testing::TestWithParam<Corner> {
protected:
- virtual void SetUp() OVERRIDE { InitializeData(); }
+ virtual void SetUp() override { InitializeData(); }
static gfx::Rect CornerSinglePixelRect(Corner corner, const gfx::Size& s) {
switch (corner) {
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index b1011fc..693f643 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -36,7 +36,7 @@
}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() OVERRIDE {
+ virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
if (!buffer_)
return skia::AdoptRef(SkCreateNullCanvas());
@@ -44,7 +44,7 @@
&bitmap_, buffer_, resource_->format(), resource_->size(), stride_);
return skia::AdoptRef(new SkCanvas(bitmap_));
}
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) OVERRIDE {
+ virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
if (!buffer_)
return;
@@ -449,11 +449,6 @@
task->CompleteOnOriginThread(this);
task->DidComplete();
- // Async set pixels commands are not necessarily processed in-sequence with
- // drawing commands. Read lock fences are required to ensure that async
- // commands don't access the resource while used for drawing.
- resource_provider_->EnableReadLockFences(task->resource()->id());
-
DCHECK(std::find(completed_raster_tasks_.begin(),
completed_raster_tasks_.end(),
task) == completed_raster_tasks_.end());
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.h b/cc/resources/pixel_buffer_raster_worker_pool.h
index a2bed33..65fcdad 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.h
+++ b/cc/resources/pixel_buffer_raster_worker_pool.h
@@ -39,18 +39,18 @@
size_t max_transfer_buffer_usage_bytes);
// Overridden from RasterWorkerPool:
- virtual Rasterizer* AsRasterizer() OVERRIDE;
+ virtual Rasterizer* AsRasterizer() override;
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE;
- virtual void CheckForCompletedTasks() OVERRIDE;
+ virtual void SetClient(RasterizerClient* client) override;
+ virtual void Shutdown() override;
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override;
+ virtual void CheckForCompletedTasks() override;
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE;
- virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) OVERRIDE;
+ const Resource* resource) override;
+ virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
private:
struct RasterTaskState {
diff --git a/cc/resources/raster_worker_pool.cc b/cc/resources/raster_worker_pool.cc
index a720543..65b3767 100644
--- a/cc/resources/raster_worker_pool.cc
+++ b/cc/resources/raster_worker_pool.cc
@@ -39,7 +39,7 @@
private:
// Overridden from base::DelegateSimpleThread::Delegate:
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
TaskGraphRunner::Run();
}
@@ -62,15 +62,15 @@
on_raster_finished_callback_(on_raster_finished_callback) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
TRACE_EVENT0("cc", "RasterFinishedTaskImpl::RunOnWorkerThread");
RasterFinished();
}
// Overridden from RasterizerTask:
- virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) OVERRIDE {}
- virtual void CompleteOnOriginThread(RasterizerTaskClient* client) OVERRIDE {}
- virtual void RunReplyOnOriginThread() OVERRIDE {}
+ virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {}
+ virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {}
+ virtual void RunReplyOnOriginThread() override {}
protected:
virtual ~RasterFinishedTaskImpl() {}
@@ -196,7 +196,7 @@
// static
void RasterWorkerPool::AcquireBitmapForBuffer(SkBitmap* bitmap,
- uint8_t* buffer,
+ void* buffer,
ResourceFormat buffer_format,
const gfx::Size& size,
int stride) {
@@ -224,7 +224,7 @@
// static
void RasterWorkerPool::ReleaseBitmapForBuffer(SkBitmap* bitmap,
- uint8_t* buffer,
+ void* buffer,
ResourceFormat buffer_format) {
SkColorType buffer_color_type = ResourceFormatToSkColorType(buffer_format);
if (buffer_color_type != bitmap->colorType()) {
diff --git a/cc/resources/raster_worker_pool.h b/cc/resources/raster_worker_pool.h
index e57fe06..1863ce4 100644
--- a/cc/resources/raster_worker_pool.h
+++ b/cc/resources/raster_worker_pool.h
@@ -64,12 +64,12 @@
// Utility functions that transparently create a temporary bitmap and copy
// pixels to buffer when necessary.
static void AcquireBitmapForBuffer(SkBitmap* bitmap,
- uint8_t* buffer,
+ void* buffer,
ResourceFormat format,
const gfx::Size& size,
int stride);
static void ReleaseBitmapForBuffer(SkBitmap* bitmap,
- uint8_t* buffer,
+ void* buffer,
ResourceFormat format);
// Type-checking downcast routine.
diff --git a/cc/resources/raster_worker_pool_perftest.cc b/cc/resources/raster_worker_pool_perftest.cc
index 3ae1c20..e84e8af 100644
--- a/cc/resources/raster_worker_pool_perftest.cc
+++ b/cc/resources/raster_worker_pool_perftest.cc
@@ -35,28 +35,28 @@
virtual GLuint CreateImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE {
+ GLenum usage) override {
return 1u;
}
- virtual void GenBuffers(GLsizei n, GLuint* buffers) OVERRIDE {
+ virtual void GenBuffers(GLsizei n, GLuint* buffers) override {
for (GLsizei i = 0; i < n; ++i)
buffers[i] = 1u;
}
- virtual void GenTextures(GLsizei n, GLuint* textures) OVERRIDE {
+ virtual void GenTextures(GLsizei n, GLuint* textures) override {
for (GLsizei i = 0; i < n; ++i)
textures[i] = 1u;
}
- virtual void GetIntegerv(GLenum pname, GLint* params) OVERRIDE {
+ virtual void GetIntegerv(GLenum pname, GLint* params) override {
if (pname == GL_MAX_TEXTURE_SIZE)
*params = INT_MAX;
}
- virtual void GenQueriesEXT(GLsizei n, GLuint* queries) OVERRIDE {
+ virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override {
for (GLsizei i = 0; i < n; ++i)
queries[i] = 1u;
}
virtual void GetQueryObjectuivEXT(GLuint query,
GLenum pname,
- GLuint* params) OVERRIDE {
+ GLuint* params) override {
if (pname == GL_QUERY_RESULT_AVAILABLE_EXT)
*params = 1;
}
@@ -66,25 +66,25 @@
public:
PerfContextProvider() : context_gl_(new PerfGLES2Interface) {}
- virtual bool BindToCurrentThread() OVERRIDE { return true; }
- virtual Capabilities ContextCapabilities() OVERRIDE {
+ virtual bool BindToCurrentThread() override { return true; }
+ virtual Capabilities ContextCapabilities() override {
Capabilities capabilities;
capabilities.gpu.image = true;
capabilities.gpu.sync_query = true;
return capabilities;
}
- virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE {
+ virtual gpu::gles2::GLES2Interface* ContextGL() override {
return context_gl_.get();
}
- virtual gpu::ContextSupport* ContextSupport() OVERRIDE { return &support_; }
- virtual class GrContext* GrContext() OVERRIDE { return NULL; }
- virtual bool IsContextLost() OVERRIDE { return false; }
- virtual void VerifyContexts() OVERRIDE {}
- virtual void DeleteCachedResources() OVERRIDE {}
- virtual bool DestroyedOnMainThread() OVERRIDE { return false; }
- virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE {}
+ virtual gpu::ContextSupport* ContextSupport() override { return &support_; }
+ virtual class GrContext* GrContext() override { return NULL; }
+ virtual bool IsContextLost() override { return false; }
+ virtual void VerifyContexts() override {}
+ virtual void DeleteCachedResources() override {}
+ virtual bool DestroyedOnMainThread() override { return false; }
+ virtual void SetLostContextCallback(const LostContextCallback& cb) override {}
virtual void SetMemoryPolicyChangedCallback(
- const MemoryPolicyChangedCallback& cb) OVERRIDE {}
+ const MemoryPolicyChangedCallback& cb) override {}
private:
virtual ~PerfContextProvider() {}
@@ -110,12 +110,12 @@
PerfImageDecodeTaskImpl() {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {}
+ virtual void RunOnWorkerThread() override {}
// Overridden from RasterizerTask:
- virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) OVERRIDE {}
- virtual void CompleteOnOriginThread(RasterizerTaskClient* client) OVERRIDE {}
- virtual void RunReplyOnOriginThread() OVERRIDE { Reset(); }
+ virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {}
+ virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {}
+ virtual void RunReplyOnOriginThread() override { Reset(); }
void Reset() {
did_run_ = false;
@@ -136,16 +136,16 @@
: RasterTask(resource.get(), dependencies), resource_(resource.Pass()) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {}
+ virtual void RunOnWorkerThread() override {}
// Overridden from RasterizerTask:
- virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) OVERRIDE {
+ virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {
raster_buffer_ = client->AcquireBufferForRaster(resource());
}
- virtual void CompleteOnOriginThread(RasterizerTaskClient* client) OVERRIDE {
+ virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {
client->ReleaseBufferForRaster(raster_buffer_.Pass());
}
- virtual void RunReplyOnOriginThread() OVERRIDE { Reset(); }
+ virtual void RunReplyOnOriginThread() override { Reset(); }
void Reset() {
did_run_ = false;
@@ -227,7 +227,7 @@
public RasterizerClient {
public:
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
switch (GetParam()) {
case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER:
Create3dOutputSurfaceAndResourceProvider();
@@ -275,16 +275,16 @@
DCHECK(raster_worker_pool_);
raster_worker_pool_->AsRasterizer()->SetClient(this);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
raster_worker_pool_->AsRasterizer()->Shutdown();
raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks();
}
// Overriden from RasterizerClient:
- virtual void DidFinishRunningTasks(TaskSet task_set) OVERRIDE {
+ virtual void DidFinishRunningTasks(TaskSet task_set) override {
raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks();
}
- virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const OVERRIDE {
+ virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const override {
return TaskSetCollection();
}
@@ -478,7 +478,7 @@
public testing::Test {
public:
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
output_surface_ = FakeOutputSurface::Create3d(context_provider_).Pass();
CHECK(output_surface_->BindToClient(&output_surface_client_));
resource_provider_ =
diff --git a/cc/resources/raster_worker_pool_unittest.cc b/cc/resources/raster_worker_pool_unittest.cc
index 86755f8..3c39c05 100644
--- a/cc/resources/raster_worker_pool_unittest.cc
+++ b/cc/resources/raster_worker_pool_unittest.cc
@@ -53,7 +53,7 @@
: RasterTask(resource, dependencies), reply_(reply) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
skia::RefPtr<SkCanvas> canvas = raster_buffer_->AcquireSkCanvas();
DCHECK(canvas);
canvas->drawColor(SK_ColorWHITE);
@@ -61,13 +61,13 @@
}
// Overridden from RasterizerTask:
- virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) OVERRIDE {
+ virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {
raster_buffer_ = client->AcquireBufferForRaster(resource());
}
- virtual void CompleteOnOriginThread(RasterizerTaskClient* client) OVERRIDE {
+ virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {
client->ReleaseBufferForRaster(raster_buffer_.Pass());
}
- virtual void RunReplyOnOriginThread() OVERRIDE {
+ virtual void RunReplyOnOriginThread() override {
reply_.Run(PicturePileImpl::Analysis(), !HasFinishedRunning());
}
@@ -90,13 +90,13 @@
: TestRasterTaskImpl(resource, reply, dependencies), lock_(lock) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
base::AutoLock lock(*lock_);
TestRasterTaskImpl::RunOnWorkerThread();
}
// Overridden from RasterizerTask:
- virtual void RunReplyOnOriginThread() OVERRIDE {}
+ virtual void RunReplyOnOriginThread() override {}
protected:
virtual ~BlockingTestRasterTaskImpl() {}
@@ -126,7 +126,7 @@
timed_out_(false) {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
switch (GetParam()) {
case RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER:
Create3dOutputSurfaceAndResourceProvider();
@@ -175,19 +175,19 @@
raster_worker_pool_->AsRasterizer()->SetClient(this);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
raster_worker_pool_->AsRasterizer()->Shutdown();
raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks();
}
// Overriden from RasterWorkerPoolClient:
- virtual void DidFinishRunningTasks(TaskSet task_set) OVERRIDE {
+ virtual void DidFinishRunningTasks(TaskSet task_set) override {
if (task_set == ALL) {
raster_worker_pool_->AsRasterizer()->CheckForCompletedTasks();
base::MessageLoop::current()->Quit();
}
}
- virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const OVERRIDE {
+ virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const override {
return TaskSetCollection();
}
diff --git a/cc/resources/rasterizer.h b/cc/resources/rasterizer.h
index 72b50f2..5d2eeee 100644
--- a/cc/resources/rasterizer.h
+++ b/cc/resources/rasterizer.h
@@ -61,7 +61,7 @@
typedef std::vector<scoped_refptr<ImageDecodeTask> > Vector;
// Overridden from RasterizerTask:
- virtual ImageDecodeTask* AsImageDecodeTask() OVERRIDE;
+ virtual ImageDecodeTask* AsImageDecodeTask() override;
protected:
ImageDecodeTask();
@@ -73,7 +73,7 @@
typedef std::vector<scoped_refptr<RasterTask> > Vector;
// Overridden from RasterizerTask:
- virtual RasterTask* AsRasterTask() OVERRIDE;
+ virtual RasterTask* AsRasterTask() override;
const Resource* resource() const { return resource_; }
const ImageDecodeTask::Vector& dependencies() const { return dependencies_; }
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
index 0e7c938..abb8541 100644
--- a/cc/resources/resource_provider.cc
+++ b/cc/resources/resource_provider.cc
@@ -143,7 +143,7 @@
}
// Overridden from IdAllocator:
- virtual GLuint NextId() OVERRIDE {
+ virtual GLuint NextId() override {
if (next_id_index_ == id_allocation_chunk_size_) {
gl_->GenTextures(id_allocation_chunk_size_, ids_.get());
next_id_index_ = 0;
@@ -166,7 +166,7 @@
}
// Overridden from IdAllocator:
- virtual GLuint NextId() OVERRIDE {
+ virtual GLuint NextId() override {
if (next_id_index_ == id_allocation_chunk_size_) {
gl_->GenBuffers(id_allocation_chunk_size_, ids_.get());
next_id_index_ = 0;
@@ -187,8 +187,8 @@
: gl_(gl), query_id_(query_id) {}
// Overridden from ResourceProvider::Fence:
- virtual void Set() OVERRIDE {}
- virtual bool HasPassed() OVERRIDE {
+ virtual void Set() override {}
+ virtual bool HasPassed() override {
unsigned available = 1;
gl_->GetQueryObjectuivEXT(
query_id_, GL_QUERY_RESULT_AVAILABLE_EXT, &available);
@@ -896,12 +896,7 @@
const ResourceProvider::Resource* ResourceProvider::LockForWrite(
ResourceId id) {
Resource* resource = GetResource(id);
- DCHECK(!resource->locked_for_write);
- DCHECK(!resource->lock_for_read_count);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK(!resource->lost);
- DCHECK(ReadLockFenceHasPassed(resource));
+ DCHECK(CanLockForWrite(id));
LazyAllocate(resource);
resource->locked_for_write = true;
@@ -923,6 +918,87 @@
resource->locked_for_write = false;
}
+const ResourceProvider::Resource*
+ResourceProvider::LockForWriteToGpuMemoryBuffer(ResourceId id) {
+ Resource* resource = GetResource(id);
+ DCHECK_EQ(GLTexture, resource->type);
+ DCHECK(CanLockForWrite(id));
+
+ if (!resource->image_id) {
+ resource->allocated = true;
+ GLES2Interface* gl = ContextGL();
+ DCHECK(gl);
+ resource->image_id =
+ gl->CreateImageCHROMIUM(resource->size.width(),
+ resource->size.height(),
+ TextureToStorageFormat(resource->format),
+ GL_IMAGE_MAP_CHROMIUM);
+ DCHECK(resource->image_id);
+ }
+
+ resource->locked_for_write = true;
+ return resource;
+}
+
+void ResourceProvider::UnlockForWriteToGpuMemoryBuffer(ResourceId id) {
+ Resource* resource = GetResource(id);
+ DCHECK(resource->locked_for_write);
+ DCHECK_EQ(resource->exported_count, 0);
+ DCHECK(resource->origin == Resource::Internal);
+ DCHECK_EQ(GLTexture, resource->type);
+
+ resource->locked_for_write = false;
+ resource->dirty_image = true;
+
+ // GpuMemoryBuffer provides direct access to the memory used by the GPU.
+ // Read lock fences are required to ensure that we're not trying to map a
+ // buffer that is currently in-use by the GPU.
+ resource->read_lock_fences_enabled = true;
+}
+
+const ResourceProvider::Resource* ResourceProvider::LockForWriteToSkSurface(
+ ResourceId id) {
+ Resource* resource = GetResource(id);
+ DCHECK_EQ(GLTexture, resource->type);
+ DCHECK(CanLockForWrite(id));
+
+ resource->locked_for_write = true;
+ if (!resource->sk_surface) {
+ class GrContext* gr_context = GrContext();
+ // TODO(alokp): Implement TestContextProvider::GrContext().
+ if (!gr_context)
+ return resource;
+
+ LazyAllocate(resource);
+
+ GrBackendTextureDesc desc;
+ desc.fFlags = kRenderTarget_GrBackendTextureFlag;
+ desc.fWidth = resource->size.width();
+ desc.fHeight = resource->size.height();
+ desc.fConfig = ToGrPixelConfig(resource->format);
+ desc.fOrigin = kTopLeft_GrSurfaceOrigin;
+ desc.fTextureHandle = resource->gl_id;
+ skia::RefPtr<GrTexture> gr_texture =
+ skia::AdoptRef(gr_context->wrapBackendTexture(desc));
+ SkSurface::TextRenderMode text_render_mode =
+ use_distance_field_text_ ? SkSurface::kDistanceField_TextRenderMode
+ : SkSurface::kStandard_TextRenderMode;
+ resource->sk_surface = skia::AdoptRef(SkSurface::NewRenderTargetDirect(
+ gr_texture->asRenderTarget(), text_render_mode));
+ }
+
+ return resource;
+}
+
+void ResourceProvider::UnlockForWriteToSkSurface(ResourceId id) {
+ Resource* resource = GetResource(id);
+ DCHECK(resource->locked_for_write);
+ DCHECK_EQ(resource->exported_count, 0);
+ DCHECK(resource->origin == Resource::Internal);
+ DCHECK_EQ(GLTexture, resource->type);
+ resource->locked_for_write = false;
+}
+
ResourceProvider::ScopedReadLockGL::ScopedReadLockGL(
ResourceProvider* resource_provider,
ResourceProvider::ResourceId resource_id)
@@ -1008,6 +1084,38 @@
resource_provider_->UnlockForWrite(resource_id_);
}
+ResourceProvider::ScopedWriteLockGpuMemoryBuffer::
+ ScopedWriteLockGpuMemoryBuffer(ResourceProvider* resource_provider,
+ ResourceProvider::ResourceId resource_id)
+ : resource_provider_(resource_provider),
+ resource_id_(resource_id),
+ image_id_(resource_provider->LockForWriteToGpuMemoryBuffer(resource_id)
+ ->image_id),
+ gpu_memory_buffer_(
+ resource_provider->ContextGL()->MapImageCHROMIUM(image_id_)) {
+ resource_provider->ContextGL()->GetImageParameterivCHROMIUM(
+ image_id_, GL_IMAGE_ROWBYTES_CHROMIUM, &stride_);
+}
+
+ResourceProvider::ScopedWriteLockGpuMemoryBuffer::
+ ~ScopedWriteLockGpuMemoryBuffer() {
+ resource_provider_->ContextGL()->UnmapImageCHROMIUM(image_id_);
+ resource_provider_->UnlockForWriteToGpuMemoryBuffer(resource_id_);
+}
+
+ResourceProvider::ScopedWriteLockGr::ScopedWriteLockGr(
+ ResourceProvider* resource_provider,
+ ResourceProvider::ResourceId resource_id)
+ : resource_provider_(resource_provider),
+ resource_id_(resource_id),
+ sk_surface_(resource_provider->LockForWriteToSkSurface(resource_id)
+ ->sk_surface.get()) {
+}
+
+ResourceProvider::ScopedWriteLockGr::~ScopedWriteLockGr() {
+ resource_provider_->UnlockForWriteToSkSurface(resource_id_);
+}
+
ResourceProvider::ResourceProvider(
OutputSurface* output_surface,
SharedBitmapManager* shared_bitmap_manager,
@@ -1761,6 +1869,11 @@
resource->pending_set_pixels = false;
UnlockForWrite(id);
+ // Async set pixels commands are not necessarily processed in-sequence with
+ // drawing commands. Read lock fences are required to ensure that async
+ // commands don't access the resource while used for drawing.
+ resource->read_lock_fences_enabled = true;
+
return true;
}
@@ -1867,138 +1980,6 @@
resource->dirty_image = false;
}
-void ResourceProvider::EnableReadLockFences(ResourceId id) {
- Resource* resource = GetResource(id);
- resource->read_lock_fences_enabled = true;
-}
-
-void ResourceProvider::AcquireImage(ResourceId id) {
- Resource* resource = GetResource(id);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK_EQ(GLTexture, resource->type);
-
- if (resource->image_id)
- return;
-
- resource->allocated = true;
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
- resource->image_id =
- gl->CreateImageCHROMIUM(resource->size.width(),
- resource->size.height(),
- TextureToStorageFormat(resource->format),
- GL_IMAGE_MAP_CHROMIUM);
- DCHECK(resource->image_id);
-}
-
-void ResourceProvider::ReleaseImage(ResourceId id) {
- Resource* resource = GetResource(id);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK_EQ(GLTexture, resource->type);
-
- if (!resource->image_id)
- return;
-
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
- gl->DestroyImageCHROMIUM(resource->image_id);
- resource->image_id = 0;
- resource->bound_image_id = 0;
- resource->dirty_image = false;
- resource->allocated = false;
-}
-
-uint8_t* ResourceProvider::MapImage(ResourceId id, int* stride) {
- Resource* resource = GetResource(id);
- DCHECK(ReadLockFenceHasPassed(resource));
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK(resource->image_id);
-
- LockForWrite(id);
-
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
- // MapImageCHROMIUM should be called prior to GetImageParameterivCHROMIUM.
- uint8_t* pixels =
- static_cast<uint8_t*>(gl->MapImageCHROMIUM(resource->image_id));
- gl->GetImageParameterivCHROMIUM(
- resource->image_id, GL_IMAGE_ROWBYTES_CHROMIUM, stride);
- return pixels;
-}
-
-void ResourceProvider::UnmapImage(ResourceId id) {
- Resource* resource = GetResource(id);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK(resource->image_id);
- DCHECK(resource->locked_for_write);
-
- GLES2Interface* gl = ContextGL();
- DCHECK(gl);
- gl->UnmapImageCHROMIUM(resource->image_id);
- resource->dirty_image = true;
-
- UnlockForWrite(id);
-}
-
-void ResourceProvider::AcquireSkSurface(ResourceId id) {
- Resource* resource = GetResource(id);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK_EQ(GLTexture, resource->type);
-
- if (resource->sk_surface)
- return;
-
- class GrContext* gr_context = GrContext();
- // TODO(alokp): Implement TestContextProvider::GrContext().
- if (!gr_context)
- return;
-
- LazyAllocate(resource);
-
- GrBackendTextureDesc desc;
- desc.fFlags = kRenderTarget_GrBackendTextureFlag;
- desc.fWidth = resource->size.width();
- desc.fHeight = resource->size.height();
- desc.fConfig = ToGrPixelConfig(resource->format);
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
- desc.fTextureHandle = resource->gl_id;
- skia::RefPtr<GrTexture> gr_texture =
- skia::AdoptRef(gr_context->wrapBackendTexture(desc));
- SkSurface::TextRenderMode text_render_mode =
- use_distance_field_text_ ? SkSurface::kDistanceField_TextRenderMode
- : SkSurface::kStandard_TextRenderMode;
- resource->sk_surface = skia::AdoptRef(SkSurface::NewRenderTargetDirect(
- gr_texture->asRenderTarget(), text_render_mode));
-}
-
-void ResourceProvider::ReleaseSkSurface(ResourceId id) {
- Resource* resource = GetResource(id);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK_EQ(GLTexture, resource->type);
-
- resource->sk_surface.clear();
-}
-
-SkSurface* ResourceProvider::LockForWriteToSkSurface(ResourceId id) {
- Resource* resource = GetResource(id);
- DCHECK(resource->origin == Resource::Internal);
- DCHECK_EQ(resource->exported_count, 0);
- DCHECK_EQ(GLTexture, resource->type);
-
- LockForWrite(id);
- return resource->sk_surface.get();
-}
-
-void ResourceProvider::UnlockForWriteToSkSurface(ResourceId id) {
- UnlockForWrite(id);
-}
-
void ResourceProvider::CopyResource(ResourceId source_id, ResourceId dest_id) {
TRACE_EVENT0("cc", "ResourceProvider::CopyResource");
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index fc2fc5a..c548866 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -303,6 +303,41 @@
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware);
};
+ class CC_EXPORT ScopedWriteLockGpuMemoryBuffer {
+ public:
+ ScopedWriteLockGpuMemoryBuffer(ResourceProvider* resource_provider,
+ ResourceProvider::ResourceId resource_id);
+ ~ScopedWriteLockGpuMemoryBuffer();
+
+ void* gpu_memory_buffer() { return gpu_memory_buffer_; }
+ int stride() const { return stride_; }
+
+ private:
+ ResourceProvider* resource_provider_;
+ ResourceProvider::ResourceId resource_id_;
+ unsigned image_id_;
+ void* gpu_memory_buffer_;
+ int stride_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer);
+ };
+
+ class CC_EXPORT ScopedWriteLockGr {
+ public:
+ ScopedWriteLockGr(ResourceProvider* resource_provider,
+ ResourceProvider::ResourceId resource_id);
+ ~ScopedWriteLockGr();
+
+ SkSurface* sk_surface() { return sk_surface_; }
+
+ private:
+ ResourceProvider* resource_provider_;
+ ResourceProvider::ResourceId resource_id_;
+ SkSurface* sk_surface_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr);
+ };
+
class Fence : public base::RefCounted<Fence> {
public:
Fence() {}
@@ -330,22 +365,6 @@
void ForceSetPixelsToComplete(ResourceId id);
bool DidSetPixelsComplete(ResourceId id);
- // Acquire and release an image. The image allows direct
- // manipulation of texture memory.
- void AcquireImage(ResourceId id);
- void ReleaseImage(ResourceId id);
- // Maps the acquired image so that its pixels could be modified.
- // Unmap is called when all pixels are set.
- uint8_t* MapImage(ResourceId id, int* stride);
- void UnmapImage(ResourceId id);
-
- // Acquire and release a SkSurface.
- void AcquireSkSurface(ResourceId id);
- void ReleaseSkSurface(ResourceId id);
- // Lock/unlock resource for writing to SkSurface.
- SkSurface* LockForWriteToSkSurface(ResourceId id);
- void UnlockForWriteToSkSurface(ResourceId id);
-
// For tests only! This prevents detecting uninitialized reads.
// Use SetPixels or LockForWrite to allocate implicitly.
void AllocateForTesting(ResourceId id);
@@ -360,9 +379,6 @@
// until this fence has passed.
void SetReadLockFence(Fence* fence) { current_read_lock_fence_ = fence; }
- // Enable read lock fences for a specific resource.
- void EnableReadLockFences(ResourceId id);
-
// Indicates if we can currently lock this resource for write.
bool CanLockForWrite(ResourceId id);
@@ -480,6 +496,11 @@
void UnlockForRead(ResourceId id);
const Resource* LockForWrite(ResourceId id);
void UnlockForWrite(ResourceId id);
+ const Resource* LockForWriteToGpuMemoryBuffer(ResourceId id);
+ void UnlockForWriteToGpuMemoryBuffer(ResourceId id);
+ const Resource* LockForWriteToSkSurface(ResourceId id);
+ void UnlockForWriteToSkSurface(ResourceId id);
+
static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap,
const Resource* resource);
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
index 04d88c6..6dac574 100644
--- a/cc/resources/resource_provider_unittest.cc
+++ b/cc/resources/resource_provider_unittest.cc
@@ -101,11 +101,11 @@
// Force all textures to be consecutive numbers starting at "1",
// so we easily can test for them.
- virtual GLuint NextTextureId() OVERRIDE {
+ virtual GLuint NextTextureId() override {
base::AutoLock lock(namespace_->lock);
return namespace_->next_texture_id++;
}
- virtual void RetireTextureId(GLuint) OVERRIDE {}
+ virtual void RetireTextureId(GLuint) override {}
};
// Shared data between multiple ResourceProviderContext. This contains mailbox
@@ -168,7 +168,7 @@
return make_scoped_ptr(new ResourceProviderContext(shared_data));
}
- virtual GLuint insertSyncPoint() OVERRIDE {
+ virtual GLuint insertSyncPoint() override {
uint32 sync_point = shared_data_->InsertSyncPoint();
// Commit the produceTextureCHROMIUM calls at this point, so that
// they're associated with the sync point.
@@ -183,7 +183,7 @@
return sync_point;
}
- virtual void waitSyncPoint(GLuint sync_point) OVERRIDE {
+ virtual void waitSyncPoint(GLuint sync_point) override {
last_waited_sync_point_ = std::max(sync_point, last_waited_sync_point_);
}
@@ -193,7 +193,7 @@
GLint levels,
GLuint internalformat,
GLint width,
- GLint height) OVERRIDE {
+ GLint height) override {
CheckTextureIsBound(target);
ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target);
ASSERT_EQ(1, levels);
@@ -218,7 +218,7 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE {
+ const void* pixels) override {
CheckTextureIsBound(target);
ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target);
ASSERT_FALSE(level);
@@ -238,7 +238,7 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE {
+ const void* pixels) override {
CheckTextureIsBound(target);
ASSERT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target);
ASSERT_FALSE(level);
@@ -251,12 +251,12 @@
SetPixels(xoffset, yoffset, width, height, pixels);
}
- virtual void genMailboxCHROMIUM(GLbyte* mailbox) OVERRIDE {
+ virtual void genMailboxCHROMIUM(GLbyte* mailbox) override {
return shared_data_->GenMailbox(mailbox);
}
virtual void produceTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE {
+ const GLbyte* mailbox) override {
CheckTextureIsBound(target);
// Delay moving the texture into the mailbox until the next
@@ -270,7 +270,7 @@
}
virtual void consumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE {
+ const GLbyte* mailbox) override {
CheckTextureIsBound(target);
base::AutoLock lock_for_texture_access(namespace_->lock);
scoped_refptr<TestTexture> texture =
@@ -632,10 +632,11 @@
ResourceProvider::ResourceId id3 = child_resource_provider_->CreateResource(
size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format);
- child_resource_provider_->AcquireImage(id3);
- int stride;
- child_resource_provider_->MapImage(id3, &stride);
- child_resource_provider_->UnmapImage(id3);
+ {
+ ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
+ child_resource_provider_.get(), id3);
+ EXPECT_TRUE(!!lock.gpu_memory_buffer());
+ }
GLuint external_texture_id = child_context_->createExternalTexture();
child_context_->bindTexture(GL_TEXTURE_EXTERNAL_OES, external_texture_id);
@@ -3311,30 +3312,29 @@
id = resource_provider->CreateResource(
size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format);
- const int kStride = 4;
- void* dummy_mapped_buffer_address = NULL;
+ const int kStride = 8;
+ uint8 buffer_data[kStride * kHeight];
EXPECT_CALL(
*context,
createImageCHROMIUM(kWidth, kHeight, GL_RGBA8_OES, GL_IMAGE_MAP_CHROMIUM))
.WillOnce(Return(kImageId))
.RetiresOnSaturation();
- resource_provider->AcquireImage(id);
-
+ EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
+ .WillOnce(Return(buffer_data))
+ .RetiresOnSaturation();
EXPECT_CALL(*context, getImageParameterivCHROMIUM(kImageId,
GL_IMAGE_ROWBYTES_CHROMIUM,
_))
.WillOnce(SetArgPointee<2>(kStride))
.RetiresOnSaturation();
- EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
- .WillOnce(Return(dummy_mapped_buffer_address))
- .RetiresOnSaturation();
- int stride;
- resource_provider->MapImage(id, &stride);
-
EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId))
.Times(1)
.RetiresOnSaturation();
- resource_provider->UnmapImage(id);
+ {
+ ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
+ resource_provider.get(), id);
+ EXPECT_TRUE(!!lock.gpu_memory_buffer());
+ }
EXPECT_CALL(*context, NextTextureId())
.WillOnce(Return(kTextureId))
@@ -3351,20 +3351,22 @@
EXPECT_EQ(kTextureId, lock_gl.texture_id());
}
+ EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
+ .WillOnce(Return(buffer_data))
+ .RetiresOnSaturation();
EXPECT_CALL(
*context,
getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _))
.WillOnce(SetArgPointee<2>(kStride))
.RetiresOnSaturation();
- EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
- .WillOnce(Return(dummy_mapped_buffer_address))
- .RetiresOnSaturation();
- resource_provider->MapImage(id, &stride);
-
EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId))
.Times(1)
.RetiresOnSaturation();
- resource_provider->UnmapImage(id);
+ {
+ ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
+ resource_provider.get(), id);
+ EXPECT_TRUE(!!lock.gpu_memory_buffer());
+ }
EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)).Times(1)
.RetiresOnSaturation();
@@ -3423,28 +3425,29 @@
source_id = resource_provider->CreateResource(
size, GL_CLAMP_TO_EDGE, ResourceProvider::TextureHintImmutable, format);
- const int kStride = 4;
- void* dummy_mapped_buffer_address = NULL;
+ const int kStride = 8;
+ uint8 buffer_data[kStride * kHeight];
EXPECT_CALL(
*context,
createImageCHROMIUM(kWidth, kHeight, GL_RGBA8_OES, GL_IMAGE_MAP_CHROMIUM))
.WillOnce(Return(kImageId))
.RetiresOnSaturation();
+ EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
+ .WillOnce(Return(buffer_data))
+ .RetiresOnSaturation();
EXPECT_CALL(
*context,
getImageParameterivCHROMIUM(kImageId, GL_IMAGE_ROWBYTES_CHROMIUM, _))
.WillOnce(SetArgPointee<2>(kStride))
.RetiresOnSaturation();
- EXPECT_CALL(*context, mapImageCHROMIUM(kImageId))
- .WillOnce(Return(dummy_mapped_buffer_address))
- .RetiresOnSaturation();
- resource_provider->AcquireImage(source_id);
- int stride;
- resource_provider->MapImage(source_id, &stride);
EXPECT_CALL(*context, unmapImageCHROMIUM(kImageId))
.Times(1)
.RetiresOnSaturation();
- resource_provider->UnmapImage(source_id);
+ {
+ ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
+ resource_provider.get(), source_id);
+ EXPECT_TRUE(!!lock.gpu_memory_buffer());
+ }
Mock::VerifyAndClearExpectations(context);
dest_id = resource_provider->CreateResource(
@@ -3615,11 +3618,11 @@
class TextureIdAllocationTrackingContext : public TestWebGraphicsContext3D {
public:
- virtual GLuint NextTextureId() OVERRIDE {
+ virtual GLuint NextTextureId() override {
base::AutoLock lock(namespace_->lock);
return namespace_->next_texture_id++;
}
- virtual void RetireTextureId(GLuint) OVERRIDE {}
+ virtual void RetireTextureId(GLuint) override {}
GLuint PeekTextureId() {
base::AutoLock lock(namespace_->lock);
return namespace_->next_texture_id;
diff --git a/cc/resources/resource_update_controller_unittest.cc b/cc/resources/resource_update_controller_unittest.cc
index 58df016..18ad507 100644
--- a/cc/resources/resource_update_controller_unittest.cc
+++ b/cc/resources/resource_update_controller_unittest.cc
@@ -32,8 +32,8 @@
explicit WebGraphicsContext3DForUploadTest(ResourceUpdateControllerTest* test)
: test_(test) {}
- virtual void flush() OVERRIDE;
- virtual void shallowFlushCHROMIUM() OVERRIDE;
+ virtual void flush() override;
+ virtual void shallowFlushCHROMIUM() override;
virtual void texSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -42,10 +42,10 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
virtual void getQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* value)
- OVERRIDE;
+ override;
private:
ResourceUpdateControllerTest* test_;
@@ -328,7 +328,7 @@
void Reset() { ready_to_finalize_called_ = false; }
bool ReadyToFinalizeCalled() const { return ready_to_finalize_called_; }
- virtual void ReadyToFinalizeTextureUpdates() OVERRIDE {
+ virtual void ReadyToFinalizeTextureUpdates() override {
ready_to_finalize_called_ = true;
}
@@ -352,7 +352,7 @@
void SetUpdateTextureTime(base::TimeDelta time) {
update_textures_time_ = time;
}
- virtual base::TimeTicks UpdateMoreTexturesCompletionTime() OVERRIDE {
+ virtual base::TimeTicks UpdateMoreTexturesCompletionTime() override {
size_t total_updates =
resource_provider_->NumBlockingUploads() + update_more_textures_size_;
return now_ + total_updates * update_textures_time_;
@@ -360,7 +360,7 @@
void SetUpdateMoreTexturesSize(size_t size) {
update_more_textures_size_ = size;
}
- virtual size_t UpdateMoreTexturesSize() const OVERRIDE {
+ virtual size_t UpdateMoreTexturesSize() const override {
return update_more_textures_size_;
}
diff --git a/cc/resources/scoped_ui_resource.h b/cc/resources/scoped_ui_resource.h
index c257e1e..9d4b937 100644
--- a/cc/resources/scoped_ui_resource.h
+++ b/cc/resources/scoped_ui_resource.h
@@ -29,7 +29,7 @@
// UIResourceClient implementation.
virtual UIResourceBitmap GetBitmap(UIResourceId uid,
- bool resource_lost) OVERRIDE;
+ bool resource_lost) override;
UIResourceId id() { return id_; }
protected:
diff --git a/cc/resources/skpicture_content_layer_updater.h b/cc/resources/skpicture_content_layer_updater.h
index 9c79c74..55edade 100644
--- a/cc/resources/skpicture_content_layer_updater.h
+++ b/cc/resources/skpicture_content_layer_updater.h
@@ -29,7 +29,7 @@
const gfx::Rect& paint_rect,
const gfx::Size& tile_size,
float contents_width_scale,
- float contents_height_scale) OVERRIDE;
+ float contents_height_scale) override;
void DrawPicture(SkCanvas* canvas);
private:
diff --git a/cc/resources/task_graph_runner_perftest.cc b/cc/resources/task_graph_runner_perftest.cc
index 533ea4b..999043f 100644
--- a/cc/resources/task_graph_runner_perftest.cc
+++ b/cc/resources/task_graph_runner_perftest.cc
@@ -27,7 +27,7 @@
PerfTaskImpl() {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {}
+ virtual void RunOnWorkerThread() override {}
void Reset() { did_run_ = false; }
@@ -45,11 +45,11 @@
kTimeCheckInterval) {}
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
task_graph_runner_ = make_scoped_ptr(new TaskGraphRunner);
namespace_token_ = task_graph_runner_->GetNamespaceToken();
}
- virtual void TearDown() OVERRIDE { task_graph_runner_ = nullptr; }
+ virtual void TearDown() override { task_graph_runner_ = nullptr; }
void AfterTest(const std::string& test_name) {
// Format matches chrome/test/perf/perf_test.h:PrintResult
diff --git a/cc/resources/task_graph_runner_unittest.cc b/cc/resources/task_graph_runner_unittest.cc
index 1a6256c..6e5a785 100644
--- a/cc/resources/task_graph_runner_unittest.cc
+++ b/cc/resources/task_graph_runner_unittest.cc
@@ -118,7 +118,7 @@
: test_(test), namespace_index_(namespace_index), id_(id) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
test_->RunTaskOnWorkerThread(namespace_index_, id_);
}
@@ -145,7 +145,7 @@
: FakeTaskImpl(test, namespace_index, id) {}
// Overridden from FakeTaskImpl:
- virtual void CompleteOnOriginThread() OVERRIDE {}
+ virtual void CompleteOnOriginThread() override {}
private:
virtual ~FakeDependentTaskImpl() {}
@@ -167,7 +167,7 @@
public base::DelegateSimpleThread::Delegate {
public:
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
const size_t num_threads = GetParam();
while (workers_.size() < num_threads) {
scoped_ptr<base::DelegateSimpleThread> worker =
@@ -179,7 +179,7 @@
for (int i = 0; i < kNamespaceCount; ++i)
namespace_token_[i] = task_graph_runner_->GetNamespaceToken();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
task_graph_runner_->Shutdown();
while (workers_.size()) {
scoped_ptr<base::DelegateSimpleThread> worker = workers_.take_front();
@@ -189,7 +189,7 @@
private:
// Overridden from base::DelegateSimpleThread::Delegate:
- virtual void Run() OVERRIDE { task_graph_runner_->Run(); }
+ virtual void Run() override { task_graph_runner_->Run(); }
ScopedPtrDeque<base::DelegateSimpleThread> workers_;
};
@@ -285,21 +285,21 @@
public base::DelegateSimpleThread::Delegate {
public:
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
worker_.reset(new base::DelegateSimpleThread(this, "TestWorker"));
worker_->Start();
for (int i = 0; i < kNamespaceCount; ++i)
namespace_token_[i] = task_graph_runner_->GetNamespaceToken();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
task_graph_runner_->Shutdown();
worker_->Join();
}
private:
// Overridden from base::DelegateSimpleThread::Delegate:
- virtual void Run() OVERRIDE { task_graph_runner_->Run(); }
+ virtual void Run() override { task_graph_runner_->Run(); }
scoped_ptr<base::DelegateSimpleThread> worker_;
};
diff --git a/cc/resources/texture_uploader_unittest.cc b/cc/resources/texture_uploader_unittest.cc
index bf94065..335908d 100644
--- a/cc/resources/texture_uploader_unittest.cc
+++ b/cc/resources/texture_uploader_unittest.cc
@@ -19,7 +19,7 @@
public:
TextureUploadTestContext() : result_available_(0), unpack_alignment_(4) {}
- virtual void PixelStorei(GLenum pname, GLint param) OVERRIDE {
+ virtual void PixelStorei(GLenum pname, GLint param) override {
switch (pname) {
case GL_UNPACK_ALIGNMENT:
// Param should be a power of two <= 8.
@@ -43,7 +43,7 @@
virtual void GetQueryObjectuivEXT(GLuint,
GLenum type,
- GLuint* value) OVERRIDE {
+ GLuint* value) override {
switch (type) {
case GL_QUERY_RESULT_AVAILABLE_EXT:
*value = result_available_;
@@ -62,7 +62,7 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE {
+ const void* pixels) override {
EXPECT_EQ(static_cast<unsigned>(GL_TEXTURE_2D), target);
EXPECT_EQ(0, level);
EXPECT_LE(0, width);
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index 218faca..d121840 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -59,7 +59,7 @@
reply_(reply) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
TRACE_EVENT0("cc", "RasterizerTaskImpl::RunOnWorkerThread");
DCHECK(picture_pile_.get());
@@ -75,14 +75,14 @@
}
// Overridden from RasterizerTask:
- virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) OVERRIDE {
+ virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {
DCHECK(!raster_buffer_);
raster_buffer_ = client->AcquireBufferForRaster(resource());
}
- virtual void CompleteOnOriginThread(RasterizerTaskClient* client) OVERRIDE {
+ virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {
client->ReleaseBufferForRaster(raster_buffer_.Pass());
}
- virtual void RunReplyOnOriginThread() OVERRIDE {
+ virtual void RunReplyOnOriginThread() override {
DCHECK(!raster_buffer_);
reply_.Run(analysis_, !HasFinishedRunning());
}
@@ -172,7 +172,7 @@
reply_(reply) {}
// Overridden from Task:
- virtual void RunOnWorkerThread() OVERRIDE {
+ virtual void RunOnWorkerThread() override {
TRACE_EVENT0("cc", "ImageDecodeTaskImpl::RunOnWorkerThread");
devtools_instrumentation::ScopedImageDecodeTask image_decode_task(
@@ -183,9 +183,9 @@
}
// Overridden from RasterizerTask:
- virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) OVERRIDE {}
- virtual void CompleteOnOriginThread(RasterizerTaskClient* client) OVERRIDE {}
- virtual void RunReplyOnOriginThread() OVERRIDE {
+ virtual void ScheduleOnOriginThread(RasterizerTaskClient* client) override {}
+ virtual void CompleteOnOriginThread(RasterizerTaskClient* client) override {}
+ virtual void RunReplyOnOriginThread() override {
reply_.Run(!HasFinishedRunning());
}
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index a9118a7..d8d219b 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -183,11 +183,11 @@
void CleanUpReleasedTiles();
// Overriden from RefCountedManager<Tile>:
- virtual void Release(Tile* tile) OVERRIDE;
+ virtual void Release(Tile* tile) override;
// Overriden from RasterizerClient:
- virtual void DidFinishRunningTasks(TaskSet task_set) OVERRIDE;
- virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const OVERRIDE;
+ virtual void DidFinishRunningTasks(TaskSet task_set) override;
+ virtual TaskSetCollection TasksThatShouldBeForcedToComplete() const override;
typedef std::vector<Tile*> TileVector;
typedef std::set<Tile*> TileSet;
diff --git a/cc/resources/tile_manager_perftest.cc b/cc/resources/tile_manager_perftest.cc
index 5ff4fa2..9766df6 100644
--- a/cc/resources/tile_manager_perftest.cc
+++ b/cc/resources/tile_manager_perftest.cc
@@ -37,9 +37,9 @@
class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient {
public:
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE {}
- virtual void Shutdown() OVERRIDE {}
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE {
+ virtual void SetClient(RasterizerClient* client) override {}
+ virtual void Shutdown() override {}
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override {
for (RasterTaskQueue::Item::Vector::const_iterator it =
queue->items.begin();
it != queue->items.end();
@@ -53,7 +53,7 @@
completed_tasks_.push_back(task);
}
}
- virtual void CheckForCompletedTasks() OVERRIDE {
+ virtual void CheckForCompletedTasks() override {
for (RasterTask::Vector::iterator it = completed_tasks_.begin();
it != completed_tasks_.end();
++it) {
@@ -70,11 +70,11 @@
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE {
+ const Resource* resource) override {
return nullptr;
}
virtual void ReleaseBufferForRaster(
- scoped_ptr<RasterBuffer> buffer) OVERRIDE {}
+ scoped_ptr<RasterBuffer> buffer) override {}
private:
RasterTask::Vector completed_tasks_;
@@ -112,7 +112,7 @@
host_impl_.tile_manager()->SetGlobalStateForTesting(state);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
picture_pile_ = FakePicturePileImpl::CreateInfiniteFilledPile();
InitializeRenderer();
SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
diff --git a/cc/resources/tile_manager_unittest.cc b/cc/resources/tile_manager_unittest.cc
index 3fb5b13..b0d57e6 100644
--- a/cc/resources/tile_manager_unittest.cc
+++ b/cc/resources/tile_manager_unittest.cc
@@ -81,7 +81,7 @@
tile_manager_->SetGlobalStateForTesting(state);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
tile_manager_.reset(NULL);
picture_pile_ = NULL;
@@ -90,15 +90,15 @@
// TileManagerClient implementation.
virtual const std::vector<PictureLayerImpl*>& GetPictureLayers()
- const OVERRIDE {
+ const override {
return picture_layers_;
}
- virtual void NotifyReadyToActivate() OVERRIDE { ready_to_activate_ = true; }
- virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE {}
+ virtual void NotifyReadyToActivate() override { ready_to_activate_ = true; }
+ virtual void NotifyTileStateChanged(const Tile* tile) override {}
virtual void BuildRasterQueue(RasterTilePriorityQueue* queue,
- TreePriority priority) OVERRIDE {}
+ TreePriority priority) override {}
virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue,
- TreePriority priority) OVERRIDE {}
+ TreePriority priority) override {}
TileVector CreateTilesWithSize(int count,
TilePriority active_priority,
@@ -514,7 +514,7 @@
host_impl_.tile_manager()->SetGlobalStateForTesting(state);
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
InitializeRenderer();
SetTreePriority(SAME_PRIORITY_FOR_BOTH_TREES);
}
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index 75edccb..f62b6e6 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -27,10 +27,10 @@
public:
explicit SyncPointClientImpl(gpu::gles2::GLES2Interface* gl) : gl_(gl) {}
virtual ~SyncPointClientImpl() {}
- virtual uint32 InsertSyncPoint() OVERRIDE {
+ virtual uint32 InsertSyncPoint() override {
return GLC(gl_, gl_->InsertSyncPointCHROMIUM());
}
- virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE {
+ virtual void WaitSyncPoint(uint32 sync_point) override {
GLC(gl_, gl_->WaitSyncPointCHROMIUM(sync_point));
}
diff --git a/cc/resources/zero_copy_raster_worker_pool.cc b/cc/resources/zero_copy_raster_worker_pool.cc
index f463406..0d9c21a 100644
--- a/cc/resources/zero_copy_raster_worker_pool.cc
+++ b/cc/resources/zero_copy_raster_worker_pool.cc
@@ -21,30 +21,24 @@
public:
RasterBufferImpl(ResourceProvider* resource_provider,
const Resource* resource)
- : resource_provider_(resource_provider),
+ : lock_(resource_provider, resource->id()),
resource_(resource),
- stride_(0),
- buffer_(resource_provider->MapImage(resource->id(), &stride_)) {}
-
- virtual ~RasterBufferImpl() {
- resource_provider_->UnmapImage(resource_->id());
-
- // This RasterBuffer implementation provides direct access to the memory
- // used by the GPU. Read lock fences are required to ensure that we're not
- // trying to map a resource that is currently in-use by the GPU.
- resource_provider_->EnableReadLockFences(resource_->id());
- }
+ buffer_(NULL) {}
// Overridden from RasterBuffer:
- virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() OVERRIDE {
+ virtual skia::RefPtr<SkCanvas> AcquireSkCanvas() override {
+ buffer_ = lock_.gpu_memory_buffer();
if (!buffer_)
return skia::AdoptRef(SkCreateNullCanvas());
- RasterWorkerPool::AcquireBitmapForBuffer(
- &bitmap_, buffer_, resource_->format(), resource_->size(), stride_);
+ RasterWorkerPool::AcquireBitmapForBuffer(&bitmap_,
+ buffer_,
+ resource_->format(),
+ resource_->size(),
+ lock_.stride());
return skia::AdoptRef(new SkCanvas(bitmap_));
}
- virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) OVERRIDE {
+ virtual void ReleaseSkCanvas(const skia::RefPtr<SkCanvas>& canvas) override {
if (!buffer_)
return;
@@ -53,10 +47,9 @@
}
private:
- ResourceProvider* resource_provider_;
+ ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock_;
const Resource* resource_;
- int stride_;
- uint8_t* buffer_;
+ void* buffer_;
SkBitmap bitmap_;
DISALLOW_COPY_AND_ASSIGN(RasterBufferImpl);
@@ -190,10 +183,6 @@
scoped_ptr<RasterBuffer> ZeroCopyRasterWorkerPool::AcquireBufferForRaster(
const Resource* resource) {
- // RasterBuffer implementation depends on an image having been acquired for
- // the resource.
- resource_provider_->AcquireImage(resource->id());
-
return make_scoped_ptr<RasterBuffer>(
new RasterBufferImpl(resource_provider_, resource));
}
diff --git a/cc/resources/zero_copy_raster_worker_pool.h b/cc/resources/zero_copy_raster_worker_pool.h
index 4e4280e..b94713d 100644
--- a/cc/resources/zero_copy_raster_worker_pool.h
+++ b/cc/resources/zero_copy_raster_worker_pool.h
@@ -31,18 +31,18 @@
ResourceProvider* resource_provider);
// Overridden from RasterWorkerPool:
- virtual Rasterizer* AsRasterizer() OVERRIDE;
+ virtual Rasterizer* AsRasterizer() override;
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE;
- virtual void CheckForCompletedTasks() OVERRIDE;
+ virtual void SetClient(RasterizerClient* client) override;
+ virtual void Shutdown() override;
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override;
+ virtual void CheckForCompletedTasks() override;
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE;
- virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) OVERRIDE;
+ const Resource* resource) override;
+ virtual void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
protected:
ZeroCopyRasterWorkerPool(base::SequencedTaskRunner* task_runner,
diff --git a/cc/scheduler/begin_frame_source.h b/cc/scheduler/begin_frame_source.h
index e0c78be..3b8a576 100644
--- a/cc/scheduler/begin_frame_source.h
+++ b/cc/scheduler/begin_frame_source.h
@@ -71,11 +71,11 @@
// Traces |args| and DCHECK |args| satisfies pre-conditions then calls
// OnBeginFrameMixInDelegate and updates the last_begin_frame_args_ value on
// true.
- virtual void OnBeginFrame(const BeginFrameArgs& args) OVERRIDE;
- virtual const BeginFrameArgs LastUsedBeginFrameArgs() const OVERRIDE;
+ virtual void OnBeginFrame(const BeginFrameArgs& args) override;
+ virtual const BeginFrameArgs LastUsedBeginFrameArgs() const override;
// Outputs last_begin_frame_args_
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
protected:
// Subclasses should override this method!
@@ -134,15 +134,15 @@
virtual ~BeginFrameSourceMixIn() {}
// BeginFrameSource
- virtual bool NeedsBeginFrames() const OVERRIDE;
- virtual void SetNeedsBeginFrames(bool needs_begin_frames) OVERRIDE;
- virtual void DidFinishFrame(size_t remaining_frames) OVERRIDE {}
- virtual void AddObserver(BeginFrameObserver* obs) OVERRIDE;
- virtual void RemoveObserver(BeginFrameObserver* obs) OVERRIDE;
+ virtual bool NeedsBeginFrames() const override;
+ virtual void SetNeedsBeginFrames(bool needs_begin_frames) override;
+ virtual void DidFinishFrame(size_t remaining_frames) override {}
+ virtual void AddObserver(BeginFrameObserver* obs) override;
+ virtual void RemoveObserver(BeginFrameObserver* obs) override;
// Tracing support - Recommend (but not required) to call this implementation
// in any override.
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
protected:
BeginFrameSourceMixIn();
@@ -171,10 +171,10 @@
virtual ~BackToBackBeginFrameSource();
// BeginFrameSource
- virtual void DidFinishFrame(size_t remaining_frames) OVERRIDE;
+ virtual void DidFinishFrame(size_t remaining_frames) override;
// Tracing
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
protected:
explicit BackToBackBeginFrameSource(
@@ -187,7 +187,7 @@
bool send_begin_frame_posted_;
// BeginFrameSourceMixIn
- virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) OVERRIDE;
+ virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override;
void BeginFrame();
};
@@ -205,18 +205,18 @@
virtual ~SyntheticBeginFrameSource();
// BeginFrameSource
- virtual bool NeedsBeginFrames() const OVERRIDE;
+ virtual bool NeedsBeginFrames() const override;
// Tracing
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
// VSyncParameterObserver
virtual void OnUpdateVSyncParameters(
base::TimeTicks new_vsync_timebase,
- base::TimeDelta new_vsync_interval) OVERRIDE;
+ base::TimeDelta new_vsync_interval) override;
// TimeSourceClient
- virtual void OnTimerTick() OVERRIDE;
+ virtual void OnTimerTick() override;
protected:
explicit SyntheticBeginFrameSource(
@@ -226,7 +226,7 @@
BeginFrameArgs::BeginFrameArgsType type);
// BeginFrameSourceMixIn
- virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) OVERRIDE;
+ virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override;
scoped_refptr<DelayBasedTimeSource> time_source_;
};
@@ -251,16 +251,16 @@
// The mux is an BeginFrameObserver as it needs to proxy the OnBeginFrame
// calls to preserve the monotonicity of the BeginFrameArgs when switching
// sources.
- virtual void OnBeginFrame(const BeginFrameArgs& args) OVERRIDE;
- virtual const BeginFrameArgs LastUsedBeginFrameArgs() const OVERRIDE;
+ virtual void OnBeginFrame(const BeginFrameArgs& args) override;
+ virtual const BeginFrameArgs LastUsedBeginFrameArgs() const override;
// BeginFrameSource
- virtual bool NeedsBeginFrames() const OVERRIDE;
- virtual void SetNeedsBeginFrames(bool needs_begin_frames) OVERRIDE;
- virtual void DidFinishFrame(size_t remaining_frames) OVERRIDE;
+ virtual bool NeedsBeginFrames() const override;
+ virtual void SetNeedsBeginFrames(bool needs_begin_frames) override;
+ virtual void DidFinishFrame(size_t remaining_frames) override;
// Tracing
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
protected:
BeginFrameSourceMultiplexer();
diff --git a/cc/scheduler/begin_frame_source_unittest.cc b/cc/scheduler/begin_frame_source_unittest.cc
index 20a4878..8abf1a9 100644
--- a/cc/scheduler/begin_frame_source_unittest.cc
+++ b/cc/scheduler/begin_frame_source_unittest.cc
@@ -256,7 +256,7 @@
public:
BeginFrameSource* source_;
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE {
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override {
dict->SetString("type", "LoopingBeginFrameObserver");
dict->BeginDictionary("source");
source_->AsValueInto(dict);
@@ -265,7 +265,7 @@
protected:
// BeginFrameObserverMixIn
- virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) OVERRIDE {
+ virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override {
return true;
}
};
@@ -297,7 +297,7 @@
base::SingleThreadTaskRunner* task_runner)
: BackToBackBeginFrameSource(task_runner), now_src_(now_src) {}
- virtual base::TimeTicks Now() OVERRIDE { return now_src_->Now(); }
+ virtual base::TimeTicks Now() override { return now_src_->Now(); }
scoped_refptr<TestNowSource> now_src_;
};
@@ -312,7 +312,7 @@
scoped_ptr<TestBackToBackBeginFrameSource> source_;
scoped_ptr<MockBeginFrameObserver> obs_;
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
now_src_ = TestNowSource::Create(1000);
task_runner_ =
make_scoped_refptr(new OrderedSimpleTaskRunner(now_src_, false));
@@ -323,7 +323,7 @@
source_->AddObserver(obs_.get());
}
- virtual void TearDown() OVERRIDE { obs_.reset(); }
+ virtual void TearDown() override { obs_.reset(); }
};
const int64_t BackToBackBeginFrameSourceTest::kDeadline =
@@ -478,7 +478,7 @@
scoped_ptr<TestSyntheticBeginFrameSource> source_;
scoped_ptr<MockBeginFrameObserver> obs_;
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
now_src_ = TestNowSource::Create(1000);
task_runner_ =
make_scoped_refptr(new OrderedSimpleTaskRunner(now_src_, false));
@@ -488,7 +488,7 @@
source_->AddObserver(obs_.get());
}
- virtual void TearDown() OVERRIDE { obs_.reset(); }
+ virtual void TearDown() override { obs_.reset(); }
};
TEST_F(SyntheticBeginFrameSourceTest,
@@ -547,7 +547,7 @@
// BeginFrameSourceMultiplexer testing -----------------------------------
class BeginFrameSourceMultiplexerTest : public ::testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
mux_ = BeginFrameSourceMultiplexer::Create();
source1_store_ = make_scoped_ptr(new FakeBeginFrameSource());
@@ -559,7 +559,7 @@
source3_ = source3_store_.get();
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
// Make sure the mux is torn down before the sources.
mux_.reset();
}
diff --git a/cc/scheduler/delay_based_time_source.h b/cc/scheduler/delay_based_time_source.h
index c5cc47d..270102b 100644
--- a/cc/scheduler/delay_based_time_source.h
+++ b/cc/scheduler/delay_based_time_source.h
@@ -101,14 +101,14 @@
static scoped_refptr<DelayBasedTimeSourceHighRes> Create(
base::TimeDelta interval, base::SingleThreadTaskRunner* task_runner);
- virtual base::TimeTicks Now() const OVERRIDE;
+ virtual base::TimeTicks Now() const override;
protected:
DelayBasedTimeSourceHighRes(base::TimeDelta interval,
base::SingleThreadTaskRunner* task_runner);
virtual ~DelayBasedTimeSourceHighRes();
- virtual std::string TypeString() const OVERRIDE;
+ virtual std::string TypeString() const override;
private:
DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSourceHighRes);
diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h
index 3f00421..2ef10a4 100644
--- a/cc/scheduler/scheduler.h
+++ b/cc/scheduler/scheduler.h
@@ -150,14 +150,14 @@
base::TimeTicks LastBeginImplFrameTime();
scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
- virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* value) const override;
void SetContinuousPainting(bool continuous_painting) {
state_machine_.SetContinuousPainting(continuous_painting);
}
// BeginFrameObserverMixin
- virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) OVERRIDE;
+ virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override;
protected:
Scheduler(SchedulerClient* client,
diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc
index a6904ae..74a4f06 100644
--- a/cc/scheduler/scheduler_state_machine.cc
+++ b/cc/scheduler/scheduler_state_machine.cc
@@ -43,6 +43,7 @@
has_pending_tree_(false),
pending_tree_is_ready_for_activation_(false),
active_tree_needs_first_draw_(false),
+ did_commit_after_animating_(false),
did_create_and_initialize_first_output_surface_(false),
impl_latency_takes_priority_(false),
skip_next_begin_main_frame_to_reduce_latency_(false),
@@ -225,6 +226,7 @@
pending_tree_is_ready_for_activation_);
state->SetBoolean("active_tree_needs_first_draw",
active_tree_needs_first_draw_);
+ state->SetBoolean("did_commit_after_animating", did_commit_after_animating_);
state->SetBoolean("did_create_and_initialize_first_output_surface",
did_create_and_initialize_first_output_surface_);
state->SetBoolean("impl_latency_takes_priority",
@@ -251,6 +253,10 @@
skip_next_begin_main_frame_to_reduce_latency_ = false;
}
+bool SchedulerStateMachine::HasAnimatedThisFrame() const {
+ return last_frame_number_animate_performed_ == current_frame_number_;
+}
+
bool SchedulerStateMachine::HasSentBeginMainFrameThisFrame() const {
return current_frame_number_ ==
last_frame_number_begin_main_frame_sent_;
@@ -320,7 +326,7 @@
if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_IDLE)
return false;
- // We want to clear the pipline of any pending draws and activations
+ // We want to clear the pipeline of any pending draws and activations
// before starting output surface initialization. This allows us to avoid
// weird corner cases where we abort draws or force activation while we
// are initializing the output surface.
@@ -335,12 +341,17 @@
bool SchedulerStateMachine::ShouldDraw() const {
// If we need to abort draws, we should do so ASAP since the draw could
// be blocking other important actions (like output surface initialization),
- // from occuring. If we are waiting for the first draw, then perfom the
+ // from occurring. If we are waiting for the first draw, then perform the
// aborted draw to keep things moving. If we are not waiting for the first
// draw however, we don't want to abort for no reason.
if (PendingDrawsShouldBeAborted())
return active_tree_needs_first_draw_;
+ // If a commit has occurred after the animate call, we need to call animate
+ // again before we should draw.
+ if (did_commit_after_animating_)
+ return false;
+
// After this line, we only want to send a swap request once per frame.
if (HasRequestedSwapThisFrame())
return false;
@@ -412,7 +423,8 @@
if (!can_draw_)
return false;
- if (last_frame_number_animate_performed_ == current_frame_number_)
+ // If a commit occurred after our last call, we need to do animation again.
+ if (HasAnimatedThisFrame() && !did_commit_after_animating_)
return false;
if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_BEGIN_FRAME_STARTING &&
@@ -474,14 +486,6 @@
if (!HasInitializedOutputSurface())
return false;
- // SwapAck throttle the BeginMainFrames unless we just swapped.
- // TODO(brianderson): Remove this restriction to improve throughput.
- bool just_swapped_in_deadline =
- begin_impl_frame_state_ == BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE &&
- HasSwappedThisFrame();
- if (pending_swaps_ >= max_pending_swaps_ && !just_swapped_in_deadline)
- return false;
-
if (skip_begin_main_frame_to_reduce_latency_)
return false;
@@ -564,6 +568,7 @@
case ACTION_ANIMATE:
last_frame_number_animate_performed_ = current_frame_number_;
needs_animate_ = false;
+ did_commit_after_animating_ = false;
// TODO(skyostil): Instead of assuming this, require the client to tell
// us.
SetNeedsRedraw();
@@ -619,6 +624,9 @@
void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) {
commit_count_++;
+ if (!commit_was_aborted && HasAnimatedThisFrame())
+ did_commit_after_animating_ = true;
+
if (commit_was_aborted || settings_.main_frame_before_activation_enabled) {
commit_state_ = COMMIT_STATE_IDLE;
} else {
diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
index 018f10e..887e4c7 100644
--- a/cc/scheduler/scheduler_state_machine.h
+++ b/cc/scheduler/scheduler_state_machine.h
@@ -260,6 +260,7 @@
bool ShouldManageTiles() const;
void AdvanceCurrentFrameNumber();
+ bool HasAnimatedThisFrame() const;
bool HasSentBeginMainFrameThisFrame() const;
bool HasUpdatedVisibleTilesThisFrame() const;
bool HasRequestedSwapThisFrame() const;
@@ -307,6 +308,7 @@
bool has_pending_tree_;
bool pending_tree_is_ready_for_activation_;
bool active_tree_needs_first_draw_;
+ bool did_commit_after_animating_;
bool did_create_and_initialize_first_output_surface_;
bool impl_latency_takes_priority_;
bool skip_next_begin_main_frame_to_reduce_latency_;
diff --git a/cc/scheduler/scheduler_state_machine_unittest.cc b/cc/scheduler/scheduler_state_machine_unittest.cc
index 0f66a73..e19678d 100644
--- a/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -1671,16 +1671,9 @@
// Finish the previous commit and draw it.
FinishPreviousCommitAndDrawWithoutExitingDeadline(&state);
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
-
- // Verify we do not send another BeginMainFrame if was are swap throttled
- // and did not just swap.
state.SetNeedsCommit();
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
- EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
- EXPECT_FALSE(state.ShouldTriggerBeginImplFrameDeadlineEarly());
- state.OnBeginImplFrameDeadline();
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
}
@@ -1759,6 +1752,39 @@
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
}
+TEST(SchedulerStateMachineTest, TestAnimateAfterCommitBeforeDraw) {
+ SchedulerSettings settings;
+ settings.impl_side_painting = true;
+ StateMachine state(settings);
+ state.SetCanStart();
+ state.UpdateState(state.NextAction());
+ state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
+ state.SetVisible(true);
+ state.SetCanDraw(true);
+
+ // Check that animations are updated before we start a commit.
+ state.SetNeedsAnimate();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ state.SetNeedsCommit();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ EXPECT_TRUE(state.BeginFrameNeeded());
+
+ state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
+
+ state.NotifyBeginMainFrameStarted();
+ state.NotifyReadyToCommit();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
+
+ state.OnBeginImplFrameDeadlinePending();
+ state.OnBeginImplFrameDeadline();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
+}
+
TEST(SchedulerStateMachineTest, TestSetNeedsAnimateAfterAnimate) {
SchedulerSettings settings;
settings.impl_side_painting = true;
@@ -1786,5 +1812,46 @@
SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
}
+TEST(SchedulerStateMachineTest, TestBeginMainFrameNotSwapThrottled) {
+ SchedulerSettings settings;
+ settings.impl_side_painting = true;
+ StateMachine state(settings);
+ state.SetCanStart();
+ state.UpdateState(state.NextAction());
+ state.CreateAndInitializeOutputSurfaceWithActivatedCommit();
+ state.SetVisible(true);
+ state.SetCanDraw(true);
+ state.SetNeedsCommit();
+
+ // Begin frame and finish without interruption;
+ state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ state.NotifyBeginMainFrameStarted();
+ state.NotifyReadyToCommit();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_COMMIT);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ state.NotifyReadyToActivate();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+ state.OnBeginImplFrameDeadline();
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_ANIMATE);
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_DRAW_AND_SWAP_IF_POSSIBLE);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+
+ // Make sure we're not swap throttled
+ state.DidSwapBuffers();
+ state.DidSwapBuffersComplete();
+
+ // Verify we send another begin frame
+ state.SetNeedsCommit();
+ state.OnBeginImplFrame(CreateBeginFrameArgsForTesting());
+ EXPECT_ACTION_UPDATE_STATE(
+ SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME);
+ EXPECT_ACTION_UPDATE_STATE(SchedulerStateMachine::ACTION_NONE);
+}
+
} // namespace
} // namespace cc
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc
index 514899b..9c459b5 100644
--- a/cc/scheduler/scheduler_unittest.cc
+++ b/cc/scheduler/scheduler_unittest.cc
@@ -53,7 +53,7 @@
FakeSchedulerClient* client)
: client_(client) {}
- virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) OVERRIDE {
+ virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override {
if (needs_begin_frames) {
client_->actions_.push_back("SetNeedsBeginFrames(true)");
} else {
@@ -107,7 +107,7 @@
return scheduler_->settings().begin_frame_scheduling_enabled &&
scheduler_->settings().throttle_frame_production;
}
- virtual FakeBeginFrameSource* ExternalBeginFrameSource() OVERRIDE {
+ virtual FakeBeginFrameSource* ExternalBeginFrameSource() override {
return &fake_frame_source_;
}
@@ -159,19 +159,19 @@
redraw_will_happen_if_update_visible_tiles_happens_ = redraw;
}
// SchedulerClient implementation.
- virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void WillBeginImplFrame(const BeginFrameArgs& args) override {
actions_.push_back("WillBeginImplFrame");
states_.push_back(scheduler_->AsValue());
}
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {
+ virtual void ScheduledActionSendBeginMainFrame() override {
actions_.push_back("ScheduledActionSendBeginMainFrame");
states_.push_back(scheduler_->AsValue());
}
- virtual void ScheduledActionAnimate() OVERRIDE {
+ virtual void ScheduledActionAnimate() override {
actions_.push_back("ScheduledActionAnimate");
states_.push_back(scheduler_->AsValue());
}
- virtual DrawResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE {
+ virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override {
actions_.push_back("ScheduledActionDrawAndSwapIfPossible");
states_.push_back(scheduler_->AsValue());
num_draws_++;
@@ -193,48 +193,48 @@
}
return result;
}
- virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE {
+ virtual DrawResult ScheduledActionDrawAndSwapForced() override {
actions_.push_back("ScheduledActionDrawAndSwapForced");
states_.push_back(scheduler_->AsValue());
return DRAW_SUCCESS;
}
- virtual void ScheduledActionCommit() OVERRIDE {
+ virtual void ScheduledActionCommit() override {
actions_.push_back("ScheduledActionCommit");
states_.push_back(scheduler_->AsValue());
}
- virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE {
+ virtual void ScheduledActionUpdateVisibleTiles() override {
actions_.push_back("ScheduledActionUpdateVisibleTiles");
states_.push_back(scheduler_->AsValue());
if (redraw_will_happen_if_update_visible_tiles_happens_)
scheduler_->SetNeedsRedraw();
}
- virtual void ScheduledActionActivateSyncTree() OVERRIDE {
+ virtual void ScheduledActionActivateSyncTree() override {
actions_.push_back("ScheduledActionActivateSyncTree");
states_.push_back(scheduler_->AsValue());
}
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override {
actions_.push_back("ScheduledActionBeginOutputSurfaceCreation");
states_.push_back(scheduler_->AsValue());
}
- virtual void ScheduledActionManageTiles() OVERRIDE {
+ virtual void ScheduledActionManageTiles() override {
actions_.push_back("ScheduledActionManageTiles");
states_.push_back(scheduler_->AsValue());
}
- virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {
+ virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {
if (log_anticipated_draw_time_change_)
actions_.push_back("DidAnticipatedDrawTimeChange");
}
- virtual base::TimeDelta DrawDurationEstimate() OVERRIDE {
+ virtual base::TimeDelta DrawDurationEstimate() override {
return base::TimeDelta();
}
- virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE {
+ virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override {
return base::TimeDelta();
}
- virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE {
+ virtual base::TimeDelta CommitToActivateDurationEstimate() override {
return base::TimeDelta();
}
- virtual void DidBeginImplFrameDeadline() OVERRIDE {}
+ virtual void DidBeginImplFrameDeadline() override {}
base::Callback<bool(void)> ImplFrameDeadlinePending(bool state) {
return base::Bind(&FakeSchedulerClient::ImplFrameDeadlinePendingCallback,
@@ -455,23 +455,23 @@
class SchedulerClientThatsetNeedsDrawInsideDraw : public FakeSchedulerClient {
public:
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {}
+ virtual void ScheduledActionSendBeginMainFrame() override {}
virtual DrawResult ScheduledActionDrawAndSwapIfPossible()
- OVERRIDE {
+ override {
// Only SetNeedsRedraw the first time this is called
if (!num_draws_)
scheduler_->SetNeedsRedraw();
return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible();
}
- virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE {
+ virtual DrawResult ScheduledActionDrawAndSwapForced() override {
NOTREACHED();
return DRAW_SUCCESS;
}
- virtual void ScheduledActionCommit() OVERRIDE {}
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {}
- virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {}
+ virtual void ScheduledActionCommit() override {}
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override {}
+ virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {}
};
// Tests for two different situations:
@@ -566,9 +566,9 @@
SchedulerClientThatSetNeedsCommitInsideDraw()
: set_needs_commit_on_next_draw_(false) {}
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {}
+ virtual void ScheduledActionSendBeginMainFrame() override {}
virtual DrawResult ScheduledActionDrawAndSwapIfPossible()
- OVERRIDE {
+ override {
// Only SetNeedsCommit the first time this is called
if (set_needs_commit_on_next_draw_) {
scheduler_->SetNeedsCommit();
@@ -577,14 +577,14 @@
return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible();
}
- virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE {
+ virtual DrawResult ScheduledActionDrawAndSwapForced() override {
NOTREACHED();
return DRAW_SUCCESS;
}
- virtual void ScheduledActionCommit() OVERRIDE {}
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {}
- virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) OVERRIDE {}
+ virtual void ScheduledActionCommit() override {}
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override {}
+ virtual void DidAnticipatedDrawTimeChange(base::TimeTicks) override {}
void SetNeedsCommitOnNextDraw() { set_needs_commit_on_next_draw_ = true; }
@@ -722,7 +722,7 @@
class SchedulerClientNeedsManageTilesInDraw : public FakeSchedulerClient {
public:
virtual DrawResult ScheduledActionDrawAndSwapIfPossible()
- OVERRIDE {
+ override {
scheduler_->SetNeedsManageTiles();
return FakeSchedulerClient::ScheduledActionDrawAndSwapIfPossible();
}
@@ -1043,13 +1043,13 @@
begin_main_frame_to_commit_duration),
commit_to_activate_duration_(commit_to_activate_duration) {}
- virtual base::TimeDelta DrawDurationEstimate() OVERRIDE {
+ virtual base::TimeDelta DrawDurationEstimate() override {
return draw_duration_;
}
- virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE {
+ virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override {
return begin_main_frame_to_commit_duration_;
}
- virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE {
+ virtual base::TimeDelta CommitToActivateDurationEstimate() override {
return commit_to_activate_duration_;
}
@@ -1331,11 +1331,12 @@
EXPECT_TRUE(client.needs_begin_frames());
client.Reset();
- // While swap throttled, BeginRetroFrames should trigger BeginImplFrames
- // but not a BeginMainFrame or draw.
+ // While swap throttled, BeginRetroFrames should trigger BeginImplFrames and
+ // BeginMainFrame, but not draw.
scheduler->SetNeedsCommit();
client.task_runner().RunPendingTasks(); // Run posted BeginRetroFrame.
- EXPECT_ACTION("WillBeginImplFrame", client, 0, 1);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frames());
client.Reset();
@@ -1350,7 +1351,7 @@
// Take us out of a swap throttled state.
scheduler->DidSwapBuffersComplete();
- EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 0, 1);
+ EXPECT_EQ(0, client.num_actions_());
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_TRUE(client.needs_begin_frames());
client.Reset();
@@ -1510,18 +1511,19 @@
EXPECT_FALSE(client.needs_begin_frames());
client.Reset();
- // While swap throttled, BeginFrames should trigger BeginImplFrames,
- // but not a BeginMainFrame or draw.
+ // While swap throttled, BeginFrames should trigger BeginImplFrames and
+ // BeginMainFrame, but not draw.
scheduler->SetNeedsCommit();
client.task_runner().RunPendingTasks(); // Run posted BeginFrame.
- EXPECT_ACTION("WillBeginImplFrame", client, 0, 1);
+ EXPECT_ACTION("WillBeginImplFrame", client, 0, 2);
+ EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 1, 2);
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frames());
client.Reset();
// Take us out of a swap throttled state.
scheduler->DidSwapBuffersComplete();
- EXPECT_ACTION("ScheduledActionSendBeginMainFrame", client, 0, 1);
+ EXPECT_EQ(0, client.num_actions_());
EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending());
EXPECT_FALSE(client.needs_begin_frames());
client.Reset();
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index e206eb8..cf317b4 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -6,6 +6,7 @@
#include "base/debug/trace_event.h"
#include "base/message_loop/message_loop.h"
+#include "cc/debug/benchmark_instrumentation.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/direct_renderer.h"
@@ -110,6 +111,7 @@
return false;
TRACE_EVENT0("cc", "Display::Draw");
+ benchmark_instrumentation::IssueDisplayRenderingStatsEvent();
DelegatedFrameData* frame_data = frame->delegated_frame_data.get();
// Only reshape when we know we are going to draw. Otherwise, the reshape
diff --git a/cc/surfaces/display.h b/cc/surfaces/display.h
index d12d956..16bdd98 100644
--- a/cc/surfaces/display.h
+++ b/cc/surfaces/display.h
@@ -52,32 +52,32 @@
int GetMaxFramesPending();
// OutputSurfaceClient implementation.
- virtual void DeferredInitialize() OVERRIDE {}
- virtual void ReleaseGL() OVERRIDE {}
+ virtual void DeferredInitialize() override {}
+ virtual void ReleaseGL() override {}
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE;
- virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) OVERRIDE {}
- virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE {}
- virtual void DidSwapBuffers() OVERRIDE;
- virtual void DidSwapBuffersComplete() OVERRIDE;
- virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE {}
- virtual void DidLoseOutputSurface() OVERRIDE;
+ base::TimeDelta interval) override;
+ virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {}
+ virtual void BeginFrame(const BeginFrameArgs& args) override {}
+ virtual void DidSwapBuffers() override;
+ virtual void DidSwapBuffersComplete() override;
+ virtual void ReclaimResources(const CompositorFrameAck* ack) override {}
+ virtual void DidLoseOutputSurface() override;
virtual void SetExternalDrawConstraints(
const gfx::Transform& transform,
const gfx::Rect& viewport,
const gfx::Rect& clip,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority,
- bool resourceless_software_draw) OVERRIDE {}
- virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE;
+ bool resourceless_software_draw) override {}
+ virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
virtual void SetTreeActivationCallback(
- const base::Closure& callback) OVERRIDE {}
+ const base::Closure& callback) override {}
// RendererClient implementation.
- virtual void SetFullRootLayerDamage() OVERRIDE {}
+ virtual void SetFullRootLayerDamage() override {}
// SurfaceDamageObserver implementation.
- virtual void OnSurfaceDamaged(SurfaceId surface) OVERRIDE;
+ virtual void OnSurfaceDamaged(SurfaceId surface) override;
private:
void InitializeRenderer();
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index ea547a0..620ada7 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -124,16 +124,11 @@
&invalid_frame,
provider_->GetChildToParentMap(child_id),
&referenced_resources);
- for (RenderPassList::iterator it = render_pass_list->begin();
- it != render_pass_list->end();
- ++it) {
- QuadList& quad_list = (*it)->quad_list;
- for (QuadList::Iterator quad_it = quad_list.begin();
- quad_it != quad_list.end();
- ++quad_it) {
- quad_it->IterateResources(remap);
- }
+ for (auto* render_pass : *render_pass_list) {
+ for (auto& quad : render_pass->quad_list)
+ quad.IterateResources(remap);
}
+
if (!invalid_frame)
provider_->DeclareUsedResourcesFromChild(child_id, referenced_resources);
diff --git a/cc/surfaces/surface_aggregator_test_helpers.cc b/cc/surfaces/surface_aggregator_test_helpers.cc
index 8afead1..c6a7aa0 100644
--- a/cc/surfaces/surface_aggregator_test_helpers.cc
+++ b/cc/surfaces/surface_aggregator_test_helpers.cc
@@ -134,8 +134,7 @@
void TestPassMatchesExpectations(Pass expected_pass, const RenderPass* pass) {
ASSERT_EQ(expected_pass.quad_count, pass->quad_list.size());
- for (QuadList::ConstIterator iter = pass->quad_list.begin();
- iter != pass->quad_list.end();
+ for (auto iter = pass->quad_list.cbegin(); iter != pass->quad_list.cend();
++iter) {
SCOPED_TRACE(base::StringPrintf("Quad number %" PRIuS, iter.index()));
TestQuadMatchesExpectations(expected_pass.quads[iter.index()], &*iter);
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index cde8b8f..ff1aeba 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -43,7 +43,7 @@
class EmptySurfaceFactoryClient : public SurfaceFactoryClient {
public:
virtual void ReturnResources(
- const ReturnedResourceArray& resources) OVERRIDE {}
+ const ReturnedResourceArray& resources) override {}
};
class SurfaceAggregatorTest : public testing::Test {
@@ -698,8 +698,8 @@
ASSERT_EQ(7u, aggregated_quad_list.size());
- for (QuadList::ConstIterator iter = aggregated_quad_list.begin();
- iter != aggregated_quad_list.end();
+ for (auto iter = aggregated_quad_list.cbegin();
+ iter != aggregated_quad_list.cend();
++iter) {
EXPECT_EQ(blend_modes[iter.index()], iter->shared_quad_state->blend_mode)
<< iter.index();
@@ -837,8 +837,8 @@
// and the child surface draw quad's translation (8, 0).
expected_root_pass_quad_transforms[1].Translate(8, 10);
- for (QuadList::Iterator iter = aggregated_pass_list[1]->quad_list.begin();
- iter != aggregated_pass_list[1]->quad_list.end();
+ for (auto iter = aggregated_pass_list[1]->quad_list.cbegin();
+ iter != aggregated_pass_list[1]->quad_list.cend();
++iter) {
EXPECT_EQ(expected_root_pass_quad_transforms[iter.index()].ToString(),
iter->quadTransform().ToString())
@@ -1061,7 +1061,7 @@
virtual ~ResourceTrackingSurfaceFactoryClient() {}
virtual void ReturnResources(
- const ReturnedResourceArray& resources) OVERRIDE {
+ const ReturnedResourceArray& resources) override {
returned_resources_ = resources;
}
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index a4aecf8..5cb83fe 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -20,7 +20,7 @@
virtual ~TestSurfaceFactoryClient() {}
virtual void ReturnResources(
- const ReturnedResourceArray& resources) OVERRIDE {
+ const ReturnedResourceArray& resources) override {
returned_resources_.insert(
returned_resources_.end(), resources.begin(), resources.end());
}
diff --git a/cc/surfaces/surface_id_allocator.h b/cc/surfaces/surface_id_allocator.h
index 57deffa..d410f06 100644
--- a/cc/surfaces/surface_id_allocator.h
+++ b/cc/surfaces/surface_id_allocator.h
@@ -22,7 +22,7 @@
static uint32_t NamespaceForId(SurfaceId id);
private:
- uint32_t id_namespace_;
+ const uint32_t id_namespace_;
uint32_t next_id_;
DISALLOW_COPY_AND_ASSIGN(SurfaceIdAllocator);
diff --git a/cc/surfaces/surfaces_pixeltest.cc b/cc/surfaces/surfaces_pixeltest.cc
index 1e8166f..171d74e 100644
--- a/cc/surfaces/surfaces_pixeltest.cc
+++ b/cc/surfaces/surfaces_pixeltest.cc
@@ -24,7 +24,7 @@
class EmptySurfaceFactoryClient : public SurfaceFactoryClient {
public:
virtual void ReturnResources(
- const ReturnedResourceArray& resources) OVERRIDE {}
+ const ReturnedResourceArray& resources) override {}
};
class SurfacesPixelTest : public RendererPixelTest<GLRenderer> {
diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h
index bd680d6..1ee89da 100644
--- a/cc/test/animation_test_common.h
+++ b/cc/test/animation_test_common.h
@@ -26,9 +26,9 @@
explicit FakeFloatAnimationCurve(double duration);
virtual ~FakeFloatAnimationCurve();
- virtual double Duration() const OVERRIDE;
- virtual float GetValue(double now) const OVERRIDE;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual double Duration() const override;
+ virtual float GetValue(double now) const override;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
private:
double duration_;
@@ -39,15 +39,15 @@
explicit FakeTransformTransition(double duration);
virtual ~FakeTransformTransition();
- virtual double Duration() const OVERRIDE;
- virtual gfx::Transform GetValue(double time) const OVERRIDE;
+ virtual double Duration() const override;
+ virtual gfx::Transform GetValue(double time) const override;
virtual bool AnimatedBoundsForBox(const gfx::BoxF& box,
- gfx::BoxF* bounds) const OVERRIDE;
- virtual bool AffectsScale() const OVERRIDE;
- virtual bool IsTranslation() const OVERRIDE;
- virtual bool MaximumScale(float* max_scale) const OVERRIDE;
+ gfx::BoxF* bounds) const override;
+ virtual bool AffectsScale() const override;
+ virtual bool IsTranslation() const override;
+ virtual bool MaximumScale(float* max_scale) const override;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
private:
double duration_;
@@ -58,10 +58,10 @@
FakeFloatTransition(double duration, float from, float to);
virtual ~FakeFloatTransition();
- virtual double Duration() const OVERRIDE;
- virtual float GetValue(double time) const OVERRIDE;
+ virtual double Duration() const override;
+ virtual float GetValue(double time) const override;
- virtual scoped_ptr<AnimationCurve> Clone() const OVERRIDE;
+ virtual scoped_ptr<AnimationCurve> Clone() const override;
private:
double duration_;
@@ -75,13 +75,13 @@
virtual ~FakeLayerAnimationValueObserver();
// LayerAnimationValueObserver implementation
- virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE;
- virtual void OnOpacityAnimated(float opacity) OVERRIDE;
- virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE;
+ virtual void OnFilterAnimated(const FilterOperations& filters) override;
+ virtual void OnOpacityAnimated(float opacity) override;
+ virtual void OnTransformAnimated(const gfx::Transform& transform) override;
virtual void OnScrollOffsetAnimated(
- const gfx::ScrollOffset& scroll_offset) OVERRIDE;
- virtual void OnAnimationWaitingForDeletion() OVERRIDE;
- virtual bool IsActive() const OVERRIDE;
+ const gfx::ScrollOffset& scroll_offset) override;
+ virtual void OnAnimationWaitingForDeletion() override;
+ virtual bool IsActive() const override;
const FilterOperations& filters() const { return filters_; }
float opacity() const { return opacity_; }
@@ -103,12 +103,12 @@
class FakeInactiveLayerAnimationValueObserver
: public FakeLayerAnimationValueObserver {
public:
- virtual bool IsActive() const OVERRIDE;
+ virtual bool IsActive() const override;
};
class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider {
public:
- virtual gfx::ScrollOffset ScrollOffsetForAnimation() const OVERRIDE;
+ virtual gfx::ScrollOffset ScrollOffsetForAnimation() const override;
void set_scroll_offset(const gfx::ScrollOffset& scroll_offset) {
scroll_offset_ = scroll_offset;
diff --git a/cc/test/cc_test_suite.h b/cc/test/cc_test_suite.h
index 5f749e7..6edcd6a 100644
--- a/cc/test/cc_test_suite.h
+++ b/cc/test/cc_test_suite.h
@@ -22,8 +22,8 @@
protected:
// Overridden from base::TestSuite:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
+ virtual void Initialize() override;
+ virtual void Shutdown() override;
private:
scoped_ptr<base::MessageLoop> message_loop_;
diff --git a/cc/test/fake_content_layer.h b/cc/test/fake_content_layer.h
index ee6cfb4..1debe85 100644
--- a/cc/test/fake_content_layer.h
+++ b/cc/test/fake_content_layer.h
@@ -17,7 +17,7 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
size_t update_count() const { return update_count_; }
void reset_update_count() { update_count_ = 0; }
@@ -26,7 +26,7 @@
void reset_push_properties_count() { push_properties_count_ = 0; }
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
gfx::Rect LastPaintRect() const;
@@ -34,9 +34,9 @@
always_update_resources_ = always_update_resources;
}
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
- virtual void OnOutputSurfaceCreated() OVERRIDE;
+ virtual void OnOutputSurfaceCreated() override;
size_t output_surface_created_count() const {
return output_surface_created_count_;
}
diff --git a/cc/test/fake_content_layer_client.h b/cc/test/fake_content_layer_client.h
index ae0ebdd..3ae031a 100644
--- a/cc/test/fake_content_layer_client.h
+++ b/cc/test/fake_content_layer_client.h
@@ -30,9 +30,9 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& rect,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE;
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
- virtual bool FillsBoundsCompletely() const OVERRIDE;
+ ContentLayerClient::GraphicsContextStatus gc_status) override;
+ virtual void DidChangeLayerCanUseLCDText() override {}
+ virtual bool FillsBoundsCompletely() const override;
void set_fill_with_nonsolid_color(bool nonsolid) {
fill_with_nonsolid_color_ = nonsolid;
diff --git a/cc/test/fake_content_layer_impl.h b/cc/test/fake_content_layer_impl.h
index 4313cad..f4c8f54 100644
--- a/cc/test/fake_content_layer_impl.h
+++ b/cc/test/fake_content_layer_impl.h
@@ -19,7 +19,7 @@
virtual ~FakeContentLayerImpl();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
bool HaveResourceForTileAt(int i, int j);
@@ -28,7 +28,7 @@
}
void reset_lost_output_surface_count() { lost_output_surface_count_ = 0; }
- virtual void ReleaseResources() OVERRIDE;
+ virtual void ReleaseResources() override;
private:
explicit FakeContentLayerImpl(LayerTreeImpl* tree_impl, int id);
diff --git a/cc/test/fake_delegated_renderer_layer.h b/cc/test/fake_delegated_renderer_layer.h
index f162473..a5fca87 100644
--- a/cc/test/fake_delegated_renderer_layer.h
+++ b/cc/test/fake_delegated_renderer_layer.h
@@ -18,7 +18,7 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
protected:
explicit FakeDelegatedRendererLayer(DelegatedFrameProvider* frame_provider);
diff --git a/cc/test/fake_delegated_renderer_layer_impl.cc b/cc/test/fake_delegated_renderer_layer_impl.cc
index 8925bdb..8548843 100644
--- a/cc/test/fake_delegated_renderer_layer_impl.cc
+++ b/cc/test/fake_delegated_renderer_layer_impl.cc
@@ -62,13 +62,9 @@
DrawQuad::ResourceIteratorCallback add_resource_to_frame_callback =
base::Bind(&AddResourceToFrame, resource_provider, delegated_frame.get());
- for (size_t i = 0; i < delegated_frame->render_pass_list.size(); ++i) {
- RenderPass* pass = delegated_frame->render_pass_list[i];
- for (QuadList::Iterator iter = pass->quad_list.begin();
- iter != pass->quad_list.end();
- ++iter) {
- iter->IterateResources(add_resource_to_frame_callback);
- }
+ for (auto* pass : delegated_frame->render_pass_list) {
+ for (auto& quad : pass->quad_list)
+ quad.IterateResources(add_resource_to_frame_callback);
}
CreateChildIdIfNeeded(base::Bind(&NoopReturnCallback));
diff --git a/cc/test/fake_delegated_renderer_layer_impl.h b/cc/test/fake_delegated_renderer_layer_impl.h
index f909d24..dc3fee7 100644
--- a/cc/test/fake_delegated_renderer_layer_impl.h
+++ b/cc/test/fake_delegated_renderer_layer_impl.h
@@ -18,7 +18,7 @@
virtual ~FakeDelegatedRendererLayerImpl();
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
int ChildId() const { return ChildIdForTesting(); }
const RenderPassList& RenderPassesInDrawOrder() const {
diff --git a/cc/test/fake_layer_tree_host.h b/cc/test/fake_layer_tree_host.h
index c99edb3..c288046 100644
--- a/cc/test/fake_layer_tree_host.h
+++ b/cc/test/fake_layer_tree_host.h
@@ -25,8 +25,8 @@
virtual ~FakeLayerTreeHost();
- virtual void SetNeedsCommit() OVERRIDE;
- virtual void SetNeedsFullTreeSync() OVERRIDE {}
+ virtual void SetNeedsCommit() override;
+ virtual void SetNeedsFullTreeSync() override {}
using LayerTreeHost::SetRootLayer;
using LayerTreeHost::root_layer;
diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h
index 6ad53d6..9371e32 100644
--- a/cc/test/fake_layer_tree_host_client.h
+++ b/cc/test/fake_layer_tree_host_client.h
@@ -30,28 +30,28 @@
void SetLayerTreeHost(LayerTreeHost* host) { host_ = host; }
// LayerTreeHostClient implementation.
- virtual void WillBeginMainFrame(int frame_id) OVERRIDE {}
- virtual void DidBeginMainFrame() OVERRIDE {}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {}
- virtual void Layout() OVERRIDE {}
+ virtual void WillBeginMainFrame(int frame_id) override {}
+ virtual void DidBeginMainFrame() override {}
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {}
+ virtual void Layout() override {}
virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta,
const gfx::Vector2d& outer_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {}
+ float top_controls_delta) override {}
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {}
+ float top_controls_delta) override {}
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE;
- virtual void DidInitializeOutputSurface() OVERRIDE {}
- virtual void WillCommit() OVERRIDE {}
- virtual void DidCommit() OVERRIDE {}
- virtual void DidCommitAndDrawFrame() OVERRIDE {}
- virtual void DidCompleteSwapBuffers() OVERRIDE {}
+ virtual void RequestNewOutputSurface(bool fallback) override;
+ virtual void DidInitializeOutputSurface() override {}
+ virtual void WillCommit() override {}
+ virtual void DidCommit() override {}
+ virtual void DidCommitAndDrawFrame() override {}
+ virtual void DidCompleteSwapBuffers() override {}
// LayerTreeHostSingleThreadClient implementation.
- virtual void DidPostSwapBuffers() OVERRIDE {}
- virtual void DidAbortSwapBuffers() OVERRIDE {}
+ virtual void DidPostSwapBuffers() override {}
+ virtual void DidAbortSwapBuffers() override {}
private:
bool use_software_rendering_;
diff --git a/cc/test/fake_layer_tree_host_impl.h b/cc/test/fake_layer_tree_host_impl.h
index 6d31c51..558007e 100644
--- a/cc/test/fake_layer_tree_host_impl.h
+++ b/cc/test/fake_layer_tree_host_impl.h
@@ -26,9 +26,9 @@
DidDrawAllLayers(frame_data);
}
- virtual void CreatePendingTree() OVERRIDE;
+ virtual void CreatePendingTree() override;
- virtual BeginFrameArgs CurrentBeginFrameArgs() const OVERRIDE;
+ virtual BeginFrameArgs CurrentBeginFrameArgs() const override;
void SetCurrentBeginFrameArgs(const BeginFrameArgs& args);
void UpdateNumChildrenAndDrawPropertiesForActiveTree();
static void UpdateNumChildrenAndDrawProperties(LayerTreeImpl* layerTree);
diff --git a/cc/test/fake_layer_tree_host_impl_client.h b/cc/test/fake_layer_tree_host_impl_client.h
index ec86f7b..c73e023 100644
--- a/cc/test/fake_layer_tree_host_impl_client.h
+++ b/cc/test/fake_layer_tree_host_impl_client.h
@@ -13,35 +13,35 @@
class FakeLayerTreeHostImplClient : public LayerTreeHostImplClient {
public:
// LayerTreeHostImplClient implementation.
- virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE {}
- virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {}
+ virtual void UpdateRendererCapabilitiesOnImplThread() override {}
+ virtual void DidLoseOutputSurfaceOnImplThread() override {}
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE {}
- virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) OVERRIDE {}
- virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE {}
- virtual void DidSwapBuffersOnImplThread() OVERRIDE {}
- virtual void DidSwapBuffersCompleteOnImplThread() OVERRIDE {}
- virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE {}
- virtual void NotifyReadyToActivate() OVERRIDE {}
- virtual void SetNeedsRedrawOnImplThread() OVERRIDE {}
+ base::TimeDelta interval) override {}
+ virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {}
+ virtual void SetMaxSwapsPendingOnImplThread(int max) override {}
+ virtual void DidSwapBuffersOnImplThread() override {}
+ virtual void DidSwapBuffersCompleteOnImplThread() override {}
+ virtual void OnCanDrawStateChanged(bool can_draw) override {}
+ virtual void NotifyReadyToActivate() override {}
+ virtual void SetNeedsRedrawOnImplThread() override {}
virtual void SetNeedsRedrawRectOnImplThread(
- const gfx::Rect& damage_rect) OVERRIDE {}
- virtual void SetNeedsAnimateOnImplThread() OVERRIDE {}
- virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE {}
- virtual void SetNeedsCommitOnImplThread() OVERRIDE {}
- virtual void SetNeedsManageTilesOnImplThread() OVERRIDE {}
+ const gfx::Rect& damage_rect) override {}
+ virtual void SetNeedsAnimateOnImplThread() override {}
+ virtual void DidInitializeVisibleTileOnImplThread() override {}
+ virtual void SetNeedsCommitOnImplThread() override {}
+ virtual void SetNeedsManageTilesOnImplThread() override {}
virtual void PostAnimationEventsToMainThreadOnImplThread(
- scoped_ptr<AnimationEventsVector> events) OVERRIDE {}
+ scoped_ptr<AnimationEventsVector> events) override {}
virtual bool ReduceContentsTextureMemoryOnImplThread(
size_t limit_bytes,
- int priority_cutoff) OVERRIDE;
- virtual bool IsInsideDraw() OVERRIDE;
- virtual void RenewTreePriority() OVERRIDE {}
+ int priority_cutoff) override;
+ virtual bool IsInsideDraw() override;
+ virtual void RenewTreePriority() override {}
virtual void PostDelayedScrollbarFadeOnImplThread(
const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE {}
- virtual void DidActivateSyncTree() OVERRIDE {}
- virtual void DidManageTiles() OVERRIDE {}
+ base::TimeDelta delay) override {}
+ virtual void DidActivateSyncTree() override {}
+ virtual void DidManageTiles() override {}
};
} // namespace cc
diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h
index 193d03c..306879b 100644
--- a/cc/test/fake_output_surface.h
+++ b/cc/test/fake_output_surface.h
@@ -92,12 +92,12 @@
CompositorFrame& last_sent_frame() { return last_sent_frame_; }
size_t num_sent_frames() { return num_sent_frames_; }
- virtual void SwapBuffers(CompositorFrame* frame) OVERRIDE;
+ virtual void SwapBuffers(CompositorFrame* frame) override;
- virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
+ virtual void SetNeedsBeginFrame(bool enable) override;
bool needs_begin_frame() const { return needs_begin_frame_; }
- virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE;
+ virtual bool BindToClient(OutputSurfaceClient* client) override;
using OutputSurface::ReleaseGL;
using OutputSurface::InitializeAndSetContext3d;
@@ -110,7 +110,7 @@
void ReturnResource(unsigned id, CompositorFrameAck* ack);
- virtual bool HasExternalStencilTest() const OVERRIDE;
+ virtual bool HasExternalStencilTest() const override;
void set_has_external_stencil_test(bool has_test) {
has_external_stencil_test_ = has_test;
diff --git a/cc/test/fake_output_surface_client.h b/cc/test/fake_output_surface_client.h
index 7ecb6cf..258ad87 100644
--- a/cc/test/fake_output_surface_client.h
+++ b/cc/test/fake_output_surface_client.h
@@ -28,25 +28,25 @@
did_lose_output_surface_called_(false),
memory_policy_(0) {}
- virtual void DeferredInitialize() OVERRIDE;
- virtual void ReleaseGL() OVERRIDE;
+ virtual void DeferredInitialize() override;
+ virtual void ReleaseGL() override;
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE {}
- virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) OVERRIDE {}
- virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE;
- virtual void DidSwapBuffers() OVERRIDE {}
- virtual void DidSwapBuffersComplete() OVERRIDE {}
- virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE {}
- virtual void DidLoseOutputSurface() OVERRIDE;
+ base::TimeDelta interval) override {}
+ virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override {}
+ virtual void BeginFrame(const BeginFrameArgs& args) override;
+ virtual void DidSwapBuffers() override {}
+ virtual void DidSwapBuffersComplete() override {}
+ virtual void ReclaimResources(const CompositorFrameAck* ack) override {}
+ virtual void DidLoseOutputSurface() override;
virtual void SetExternalDrawConstraints(
const gfx::Transform& transform,
const gfx::Rect& viewport,
const gfx::Rect& clip,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority,
- bool resourceless_software_draw) OVERRIDE {}
- virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE;
- virtual void SetTreeActivationCallback(const base::Closure&) OVERRIDE {}
+ bool resourceless_software_draw) override {}
+ virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
+ virtual void SetTreeActivationCallback(const base::Closure&) override {}
int begin_frame_count() { return begin_frame_count_; }
diff --git a/cc/test/fake_painted_scrollbar_layer.h b/cc/test/fake_painted_scrollbar_layer.h
index 5e2fa18..f531299 100644
--- a/cc/test/fake_painted_scrollbar_layer.h
+++ b/cc/test/fake_painted_scrollbar_layer.h
@@ -21,9 +21,9 @@
void reset_update_count() { update_count_ = 0; }
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
scoped_ptr<base::AutoReset<bool> > IgnoreSetNeedsCommit();
diff --git a/cc/test/fake_picture_layer.h b/cc/test/fake_picture_layer.h
index 10f9a9c..332e63f 100644
--- a/cc/test/fake_picture_layer.h
+++ b/cc/test/fake_picture_layer.h
@@ -18,7 +18,7 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
size_t update_count() const { return update_count_; }
void reset_update_count() { update_count_ = 0; }
@@ -31,11 +31,11 @@
}
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE;
+ const OcclusionTracker<Layer>* occlusion) override;
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
+ virtual void PushPropertiesTo(LayerImpl* layer) override;
- virtual void OnOutputSurfaceCreated() OVERRIDE;
+ virtual void OnOutputSurfaceCreated() override;
size_t output_surface_created_count() const {
return output_surface_created_count_;
}
diff --git a/cc/test/fake_picture_layer_impl.cc b/cc/test/fake_picture_layer_impl.cc
index ce0a813..8082685 100644
--- a/cc/test/fake_picture_layer_impl.cc
+++ b/cc/test/fake_picture_layer_impl.cc
@@ -55,10 +55,10 @@
void FakePictureLayerImpl::AppendQuads(
RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
+ const Occlusion& occlusion_in_content_space,
AppendQuadsData* append_quads_data) {
PictureLayerImpl::AppendQuads(
- render_pass, occlusion_tracker, append_quads_data);
+ render_pass, occlusion_in_content_space, append_quads_data);
++append_quads_count_;
}
diff --git a/cc/test/fake_picture_layer_impl.h b/cc/test/fake_picture_layer_impl.h
index a06805c..cbdba24 100644
--- a/cc/test/fake_picture_layer_impl.h
+++ b/cc/test/fake_picture_layer_impl.h
@@ -34,19 +34,19 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
+ override;
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE;
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override;
virtual gfx::Size CalculateTileSize(
- const gfx::Size& content_bounds) const OVERRIDE;
+ const gfx::Size& content_bounds) const override;
- virtual void DidBecomeActive() OVERRIDE;
+ virtual void DidBecomeActive() override;
size_t did_become_active_call_count() {
return did_become_active_call_count_;
}
- virtual bool HasValidTilePriorities() const OVERRIDE;
+ virtual bool HasValidTilePriorities() const override;
void set_has_valid_tile_priorities(bool has_valid_priorities) {
has_valid_tile_priorities_ = has_valid_priorities;
use_set_valid_tile_priorities_flag_ = true;
@@ -95,12 +95,6 @@
gfx::Rect visible_rect_for_tile_priority() {
return visible_rect_for_tile_priority_;
}
- gfx::Rect viewport_rect_for_tile_priority() {
- return viewport_rect_for_tile_priority_;
- }
- gfx::Transform screen_space_transform_for_tile_priority() {
- return screen_space_transform_for_tile_priority_;
- }
void set_fixed_tile_size(const gfx::Size& size) { fixed_tile_size_ = size; }
@@ -115,7 +109,7 @@
size_t release_resources_count() const { return release_resources_count_; }
void reset_release_resources_count() { release_resources_count_ = 0; }
- virtual void ReleaseResources() OVERRIDE;
+ virtual void ReleaseResources() override;
protected:
FakePictureLayerImpl(
diff --git a/cc/test/fake_picture_layer_tiling_client.h b/cc/test/fake_picture_layer_tiling_client.h
index edd2a61..e3b2659 100644
--- a/cc/test/fake_picture_layer_tiling_client.h
+++ b/cc/test/fake_picture_layer_tiling_client.h
@@ -22,23 +22,23 @@
// PictureLayerTilingClient implementation.
virtual scoped_refptr<Tile> CreateTile(
- PictureLayerTiling* tiling, const gfx::Rect& rect) OVERRIDE;
- virtual PicturePileImpl* GetPile() OVERRIDE;
+ PictureLayerTiling* tiling, const gfx::Rect& rect) override;
+ virtual PicturePileImpl* GetPile() override;
virtual gfx::Size CalculateTileSize(
- const gfx::Size& content_bounds) const OVERRIDE;
- virtual size_t GetMaxTilesForInterestArea() const OVERRIDE;
- virtual float GetSkewportTargetTimeInSeconds() const OVERRIDE;
- virtual int GetSkewportExtrapolationLimitInContentPixels() const OVERRIDE;
+ const gfx::Size& content_bounds) const override;
+ virtual size_t GetMaxTilesForInterestArea() const override;
+ virtual float GetSkewportTargetTimeInSeconds() const override;
+ virtual int GetSkewportExtrapolationLimitInContentPixels() const override;
void SetTileSize(const gfx::Size& tile_size);
gfx::Size TileSize() const { return tile_size_; }
- virtual const Region* GetInvalidation() OVERRIDE;
+ virtual const Region* GetInvalidation() override;
virtual const PictureLayerTiling* GetTwinTiling(
- const PictureLayerTiling* tiling) const OVERRIDE;
+ const PictureLayerTiling* tiling) const override;
virtual PictureLayerTiling* GetRecycledTwinTiling(
- const PictureLayerTiling* tiling) OVERRIDE;
- virtual WhichTree GetTree() const OVERRIDE;
+ const PictureLayerTiling* tiling) override;
+ virtual WhichTree GetTree() const override;
void set_twin_tiling(PictureLayerTiling* tiling) { twin_tiling_ = tiling; }
void set_recycled_twin_tiling(PictureLayerTiling* tiling) {
diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h
index 03eafb1..21324c1 100644
--- a/cc/test/fake_proxy.h
+++ b/cc/test/fake_proxy.h
@@ -21,30 +21,30 @@
void SetLayerTreeHost(LayerTreeHost* host);
- virtual void FinishAllRendering() OVERRIDE {}
- virtual bool IsStarted() const OVERRIDE;
- virtual void SetOutputSurface(scoped_ptr<OutputSurface>) OVERRIDE {}
- virtual void SetLayerTreeHostClientReady() OVERRIDE {}
- virtual void SetVisible(bool visible) OVERRIDE {}
- virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
- virtual void SetNeedsAnimate() OVERRIDE {}
- virtual void SetNeedsUpdateLayers() OVERRIDE {}
- virtual void SetNeedsCommit() OVERRIDE {}
- virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) OVERRIDE {}
- virtual void SetNextCommitWaitsForActivation() OVERRIDE {}
- virtual void NotifyInputThrottledUntilCommit() OVERRIDE {}
- virtual void SetDeferCommits(bool defer_commits) OVERRIDE {}
- virtual void MainThreadHasStoppedFlinging() OVERRIDE {}
- virtual bool BeginMainFrameRequested() const OVERRIDE;
- virtual bool CommitRequested() const OVERRIDE;
- virtual void Start() OVERRIDE {}
- virtual void Stop() OVERRIDE {}
- virtual void ForceSerializeOnSwapBuffers() OVERRIDE {}
- virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
- virtual bool SupportsImplScrolling() const OVERRIDE;
- virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE {}
- virtual bool MainFrameWillHappenForTesting() OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* state) const OVERRIDE;
+ virtual void FinishAllRendering() override {}
+ virtual bool IsStarted() const override;
+ virtual void SetOutputSurface(scoped_ptr<OutputSurface>) override {}
+ virtual void SetLayerTreeHostClientReady() override {}
+ virtual void SetVisible(bool visible) override {}
+ virtual const RendererCapabilities& GetRendererCapabilities() const override;
+ virtual void SetNeedsAnimate() override {}
+ virtual void SetNeedsUpdateLayers() override {}
+ virtual void SetNeedsCommit() override {}
+ virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) override {}
+ virtual void SetNextCommitWaitsForActivation() override {}
+ virtual void NotifyInputThrottledUntilCommit() override {}
+ virtual void SetDeferCommits(bool defer_commits) override {}
+ virtual void MainThreadHasStoppedFlinging() override {}
+ virtual bool BeginMainFrameRequested() const override;
+ virtual bool CommitRequested() const override;
+ virtual void Start() override {}
+ virtual void Stop() override {}
+ virtual void ForceSerializeOnSwapBuffers() override {}
+ virtual size_t MaxPartialTextureUpdates() const override;
+ virtual bool SupportsImplScrolling() const override;
+ virtual void SetDebugState(const LayerTreeDebugState& debug_state) override {}
+ virtual bool MainFrameWillHappenForTesting() override;
+ virtual void AsValueInto(base::debug::TracedValue* state) const override;
virtual RendererCapabilities& GetRendererCapabilities();
void SetMaxPartialTextureUpdates(size_t max);
diff --git a/cc/test/fake_renderer_client.h b/cc/test/fake_renderer_client.h
index 9854b01..0248249 100644
--- a/cc/test/fake_renderer_client.h
+++ b/cc/test/fake_renderer_client.h
@@ -14,7 +14,7 @@
FakeRendererClient();
// RendererClient methods.
- virtual void SetFullRootLayerDamage() OVERRIDE;
+ virtual void SetFullRootLayerDamage() override;
// Methods added for test.
int set_full_root_layer_damage_count() const {
diff --git a/cc/test/fake_scoped_ui_resource.h b/cc/test/fake_scoped_ui_resource.h
index 970d7b0..3de9af2 100644
--- a/cc/test/fake_scoped_ui_resource.h
+++ b/cc/test/fake_scoped_ui_resource.h
@@ -17,7 +17,7 @@
static scoped_ptr<FakeScopedUIResource> Create(LayerTreeHost* host);
virtual UIResourceBitmap GetBitmap(UIResourceId uid,
- bool resource_lost) OVERRIDE;
+ bool resource_lost) override;
void ResetCounters();
int resource_create_count;
diff --git a/cc/test/fake_scrollbar.h b/cc/test/fake_scrollbar.h
index 8e6d454..638735d 100644
--- a/cc/test/fake_scrollbar.h
+++ b/cc/test/fake_scrollbar.h
@@ -18,17 +18,17 @@
virtual ~FakeScrollbar();
// Scrollbar implementation.
- virtual ScrollbarOrientation Orientation() const OVERRIDE;
- virtual bool IsLeftSideVerticalScrollbar() const OVERRIDE;
- virtual gfx::Point Location() const OVERRIDE;
- virtual bool IsOverlay() const OVERRIDE;
- virtual bool HasThumb() const OVERRIDE;
- virtual int ThumbThickness() const OVERRIDE;
- virtual int ThumbLength() const OVERRIDE;
- virtual gfx::Rect TrackRect() const OVERRIDE;
+ virtual ScrollbarOrientation Orientation() const override;
+ virtual bool IsLeftSideVerticalScrollbar() const override;
+ virtual gfx::Point Location() const override;
+ virtual bool IsOverlay() const override;
+ virtual bool HasThumb() const override;
+ virtual int ThumbThickness() const override;
+ virtual int ThumbLength() const override;
+ virtual gfx::Rect TrackRect() const override;
virtual void PaintPart(SkCanvas* canvas,
ScrollbarPart part,
- const gfx::Rect& content_rect) OVERRIDE;
+ const gfx::Rect& content_rect) override;
void set_location(const gfx::Point& location) { location_ = location; }
void set_track_rect(const gfx::Rect& track_rect) { track_rect_ = track_rect; }
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc
index 6243ae2..6767c9f 100644
--- a/cc/test/fake_tile_manager.cc
+++ b/cc/test/fake_tile_manager.cc
@@ -17,9 +17,9 @@
class FakeRasterizerImpl : public Rasterizer, public RasterizerTaskClient {
public:
// Overridden from Rasterizer:
- virtual void SetClient(RasterizerClient* client) OVERRIDE {}
- virtual void Shutdown() OVERRIDE {}
- virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE {
+ virtual void SetClient(RasterizerClient* client) override {}
+ virtual void Shutdown() override {}
+ virtual void ScheduleTasks(RasterTaskQueue* queue) override {
for (RasterTaskQueue::Item::Vector::const_iterator it =
queue->items.begin();
it != queue->items.end();
@@ -33,7 +33,7 @@
completed_tasks_.push_back(task);
}
}
- virtual void CheckForCompletedTasks() OVERRIDE {
+ virtual void CheckForCompletedTasks() override {
for (RasterTask::Vector::iterator it = completed_tasks_.begin();
it != completed_tasks_.end();
++it) {
@@ -50,11 +50,11 @@
// Overridden from RasterizerTaskClient:
virtual scoped_ptr<RasterBuffer> AcquireBufferForRaster(
- const Resource* resource) OVERRIDE {
+ const Resource* resource) override {
return nullptr;
}
virtual void ReleaseBufferForRaster(
- scoped_ptr<RasterBuffer> buffer) OVERRIDE {}
+ scoped_ptr<RasterBuffer> buffer) override {}
private:
RasterTask::Vector completed_tasks_;
diff --git a/cc/test/fake_tile_manager.h b/cc/test/fake_tile_manager.h
index 9fdf7a7..36a0530 100644
--- a/cc/test/fake_tile_manager.h
+++ b/cc/test/fake_tile_manager.h
@@ -22,7 +22,7 @@
void AssignMemoryToTiles(
const GlobalStateThatImpactsTilePriority& state);
- virtual void Release(Tile* tile) OVERRIDE;
+ virtual void Release(Tile* tile) override;
std::vector<Tile*> tiles_for_raster;
PrioritizedTileSet all_tiles;
diff --git a/cc/test/fake_tile_manager_client.h b/cc/test/fake_tile_manager_client.h
index 9b5bf5d..fde6c52 100644
--- a/cc/test/fake_tile_manager_client.h
+++ b/cc/test/fake_tile_manager_client.h
@@ -18,13 +18,13 @@
// TileManagerClient implementation.
virtual const std::vector<PictureLayerImpl*>& GetPictureLayers()
- const OVERRIDE;
- virtual void NotifyReadyToActivate() OVERRIDE {}
- virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE {}
+ const override;
+ virtual void NotifyReadyToActivate() override {}
+ virtual void NotifyTileStateChanged(const Tile* tile) override {}
virtual void BuildRasterQueue(RasterTilePriorityQueue* queue,
- TreePriority tree_priority) OVERRIDE {}
+ TreePriority tree_priority) override {}
virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue,
- TreePriority tree_priority) OVERRIDE {}
+ TreePriority tree_priority) override {}
private:
std::vector<PictureLayerImpl*> picture_layers_;
diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.h b/cc/test/fake_ui_resource_layer_tree_host_impl.h
index e6cfafb..9d6eac4 100644
--- a/cc/test/fake_ui_resource_layer_tree_host_impl.h
+++ b/cc/test/fake_ui_resource_layer_tree_host_impl.h
@@ -17,14 +17,14 @@
virtual ~FakeUIResourceLayerTreeHostImpl();
virtual void CreateUIResource(UIResourceId uid,
- const UIResourceBitmap& bitmap) OVERRIDE;
+ const UIResourceBitmap& bitmap) override;
- virtual void DeleteUIResource(UIResourceId uid) OVERRIDE;
+ virtual void DeleteUIResource(UIResourceId uid) override;
virtual ResourceProvider::ResourceId ResourceIdForUIResource(
- UIResourceId uid) const OVERRIDE;
+ UIResourceId uid) const override;
- virtual bool IsUIResourceOpaque(UIResourceId uid) const OVERRIDE;
+ virtual bool IsUIResourceOpaque(UIResourceId uid) const override;
private:
ResourceProvider::ResourceId fake_next_resource_id_;
diff --git a/cc/test/fake_video_frame_provider.h b/cc/test/fake_video_frame_provider.h
index fc462e4..f586adb 100644
--- a/cc/test/fake_video_frame_provider.h
+++ b/cc/test/fake_video_frame_provider.h
@@ -16,10 +16,10 @@
FakeVideoFrameProvider();
virtual ~FakeVideoFrameProvider();
- virtual void SetVideoFrameProviderClient(Client* client) OVERRIDE;
- virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() OVERRIDE;
+ virtual void SetVideoFrameProviderClient(Client* client) override;
+ virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() override;
virtual void PutCurrentFrame(const scoped_refptr<media::VideoFrame>&)
- OVERRIDE {}
+ override {}
Client* client() { return client_; }
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index 9ca2aa2..4ad0aec 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -40,11 +40,9 @@
const gfx::Rect& rect) {
Region remaining = rect;
- for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
- ++iter) {
- const DrawQuad* quad = &*iter;
+ for (auto iter = quads.cbegin(); iter != quads.cend(); ++iter) {
gfx::RectF quad_rectf =
- MathUtil::MapClippedRect(quad->quadTransform(), gfx::RectF(quad->rect));
+ MathUtil::MapClippedRect(iter->quadTransform(), gfx::RectF(iter->rect));
// Before testing for exact coverage in the integer world, assert that
// rounding will not round the rect incorrectly.
@@ -69,22 +67,19 @@
const gfx::Rect& occluded,
size_t* partially_occluded_count) {
// No quad should exist if it's fully occluded.
- for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
- ++iter) {
+ for (const auto& quad : quads) {
gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect(
- iter->quadTransform(), iter->visible_rect);
+ quad.quadTransform(), quad.visible_rect);
EXPECT_FALSE(occluded.Contains(target_visible_rect));
}
// Quads that are fully occluded on one axis only should be shrunken.
- for (QuadList::ConstIterator iter = quads.begin(); iter != quads.end();
- ++iter) {
- const DrawQuad* quad = &*iter;
- DCHECK(quad->quadTransform().IsIdentityOrIntegerTranslation());
+ for (const auto& quad : quads) {
+ DCHECK(quad.quadTransform().IsIdentityOrIntegerTranslation());
gfx::Rect target_rect =
- MathUtil::MapEnclosingClippedRect(quad->quadTransform(), quad->rect);
+ MathUtil::MapEnclosingClippedRect(quad.quadTransform(), quad.rect);
gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect(
- quad->quadTransform(), quad->visible_rect);
+ quad.quadTransform(), quad.visible_rect);
bool fully_occluded_horizontal = target_rect.x() >= occluded.x() &&
target_rect.right() <= occluded.right();
@@ -94,10 +89,10 @@
target_rect.Intersects(occluded) &&
(fully_occluded_vertical || fully_occluded_horizontal);
if (!should_be_occluded) {
- EXPECT_EQ(quad->rect.ToString(), quad->visible_rect.ToString());
+ EXPECT_EQ(quad.rect.ToString(), quad.visible_rect.ToString());
} else {
- EXPECT_NE(quad->rect.ToString(), quad->visible_rect.ToString());
- EXPECT_TRUE(quad->rect.Contains(quad->visible_rect));
+ EXPECT_NE(quad.rect.ToString(), quad.visible_rect.ToString());
+ EXPECT_TRUE(quad.rect.Contains(quad.visible_rect));
++(*partially_occluded_count);
}
}
@@ -129,9 +124,13 @@
render_pass_->quad_list.clear();
render_pass_->shared_quad_state_list.clear();
- occlusion_tracker_.set_occluded_target_rect(occluded);
+
+ Occlusion occlusion(layer_impl->draw_transform(),
+ SimpleEnclosedRegion(occluded),
+ SimpleEnclosedRegion());
+
layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
- layer_impl->AppendQuads(render_pass_.get(), occlusion_tracker_, &data);
+ layer_impl->AppendQuads(render_pass_.get(), occlusion, &data);
layer_impl->DidDraw(resource_provider());
}
@@ -143,9 +142,13 @@
render_pass_->quad_list.clear();
render_pass_->shared_quad_state_list.clear();
- occlusion_tracker_.set_occluded_target_rect(occluded);
+
+ Occlusion occlusion(layer_impl->draw_transform(),
+ SimpleEnclosedRegion(occluded),
+ SimpleEnclosedRegion());
+
layer_impl->WillDraw(DRAW_MODE_HARDWARE, resource_provider());
- layer_impl->AppendQuads(render_pass_.get(), occlusion_tracker_, &data);
+ layer_impl->AppendQuads(render_pass_.get(), occlusion, &data);
layer_impl->DidDraw(resource_provider());
}
diff --git a/cc/test/layer_tree_pixel_test.h b/cc/test/layer_tree_pixel_test.h
index 5a3685f..a29e0f1 100644
--- a/cc/test/layer_tree_pixel_test.h
+++ b/cc/test/layer_tree_pixel_test.h
@@ -34,17 +34,17 @@
LayerTreePixelTest();
virtual ~LayerTreePixelTest();
- virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE;
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE;
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override;
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override;
virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest();
void ReadbackResult(scoped_ptr<CopyOutputResult> result);
- virtual void BeginTest() OVERRIDE;
- virtual void SetupTree() OVERRIDE;
- virtual void AfterTest() OVERRIDE;
- virtual void EndTest() OVERRIDE;
+ virtual void BeginTest() override;
+ virtual void SetupTree() override;
+ virtual void AfterTest() override;
+ virtual void EndTest() override;
void TryEndTest();
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc
index 9296040..9b9bae6 100644
--- a/cc/test/layer_tree_test.cc
+++ b/cc/test/layer_tree_test.cc
@@ -68,29 +68,29 @@
private:
TestHooks* test_hooks_;
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {
+ virtual void ScheduledActionSendBeginMainFrame() override {
test_hooks_->ScheduledActionWillSendBeginMainFrame();
ThreadProxy::ScheduledActionSendBeginMainFrame();
test_hooks_->ScheduledActionSendBeginMainFrame();
}
- virtual DrawResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE {
+ virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override {
DrawResult result = ThreadProxy::ScheduledActionDrawAndSwapIfPossible();
test_hooks_->ScheduledActionDrawAndSwapIfPossible();
return result;
}
- virtual void ScheduledActionAnimate() OVERRIDE {
+ virtual void ScheduledActionAnimate() override {
ThreadProxy::ScheduledActionAnimate();
test_hooks_->ScheduledActionAnimate();
}
- virtual void ScheduledActionCommit() OVERRIDE {
+ virtual void ScheduledActionCommit() override {
ThreadProxy::ScheduledActionCommit();
test_hooks_->ScheduledActionCommit();
}
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override {
ThreadProxy::ScheduledActionBeginOutputSurfaceCreation();
test_hooks_->ScheduledActionBeginOutputSurfaceCreation();
}
@@ -141,65 +141,65 @@
block_notify_ready_to_activate_for_testing_(false),
notify_ready_to_activate_was_blocked_(false) {}
- virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void WillBeginImplFrame(const BeginFrameArgs& args) override {
LayerTreeHostImpl::WillBeginImplFrame(args);
test_hooks_->WillBeginImplFrameOnThread(this, args);
}
- virtual void BeginMainFrameAborted(bool did_handle) OVERRIDE {
+ virtual void BeginMainFrameAborted(bool did_handle) override {
LayerTreeHostImpl::BeginMainFrameAborted(did_handle);
test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle);
}
- virtual void BeginCommit() OVERRIDE {
+ virtual void BeginCommit() override {
LayerTreeHostImpl::BeginCommit();
test_hooks_->BeginCommitOnThread(this);
}
- virtual void CommitComplete() OVERRIDE {
+ virtual void CommitComplete() override {
LayerTreeHostImpl::CommitComplete();
test_hooks_->CommitCompleteOnThread(this);
}
- virtual DrawResult PrepareToDraw(FrameData* frame) OVERRIDE {
+ virtual DrawResult PrepareToDraw(FrameData* frame) override {
DrawResult draw_result = LayerTreeHostImpl::PrepareToDraw(frame);
return test_hooks_->PrepareToDrawOnThread(this, frame, draw_result);
}
virtual void DrawLayers(FrameData* frame,
- base::TimeTicks frame_begin_time) OVERRIDE {
+ base::TimeTicks frame_begin_time) override {
LayerTreeHostImpl::DrawLayers(frame, frame_begin_time);
test_hooks_->DrawLayersOnThread(this);
}
- virtual bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) OVERRIDE {
+ virtual bool SwapBuffers(const LayerTreeHostImpl::FrameData& frame) override {
bool result = LayerTreeHostImpl::SwapBuffers(frame);
test_hooks_->SwapBuffersOnThread(this, result);
return result;
}
- virtual void DidSwapBuffersComplete() OVERRIDE {
+ virtual void DidSwapBuffersComplete() override {
LayerTreeHostImpl::DidSwapBuffersComplete();
test_hooks_->SwapBuffersCompleteOnThread(this);
}
- virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE {
+ virtual void ReclaimResources(const CompositorFrameAck* ack) override {
LayerTreeHostImpl::ReclaimResources(ack);
}
- virtual void UpdateVisibleTiles() OVERRIDE {
+ virtual void UpdateVisibleTiles() override {
LayerTreeHostImpl::UpdateVisibleTiles();
test_hooks_->UpdateVisibleTilesOnThread(this);
}
- virtual void NotifyReadyToActivate() OVERRIDE {
+ virtual void NotifyReadyToActivate() override {
if (block_notify_ready_to_activate_for_testing_)
notify_ready_to_activate_was_blocked_ = true;
else
client_->NotifyReadyToActivate();
}
- virtual void BlockNotifyReadyToActivateForTesting(bool block) OVERRIDE {
+ virtual void BlockNotifyReadyToActivateForTesting(bool block) override {
block_notify_ready_to_activate_for_testing_ = block;
if (!block && notify_ready_to_activate_was_blocked_) {
NotifyReadyToActivate();
@@ -207,7 +207,7 @@
}
}
- virtual void ActivateSyncTree() OVERRIDE {
+ virtual void ActivateSyncTree() override {
test_hooks_->WillActivateTreeOnThread(this);
LayerTreeHostImpl::ActivateSyncTree();
DCHECK(!pending_tree());
@@ -215,24 +215,24 @@
}
virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface)
- OVERRIDE {
+ override {
bool success = LayerTreeHostImpl::InitializeRenderer(output_surface.Pass());
test_hooks_->InitializedRendererOnThread(this, success);
return success;
}
- virtual void SetVisible(bool visible) OVERRIDE {
+ virtual void SetVisible(bool visible) override {
LayerTreeHostImpl::SetVisible(visible);
test_hooks_->DidSetVisibleOnImplTree(this, visible);
}
- virtual void AnimateLayers(base::TimeTicks monotonic_time) OVERRIDE {
+ virtual void AnimateLayers(base::TimeTicks monotonic_time) override {
test_hooks_->WillAnimateLayers(this, monotonic_time);
LayerTreeHostImpl::AnimateLayers(monotonic_time);
test_hooks_->AnimateLayers(this, monotonic_time);
}
- virtual void UpdateAnimationState(bool start_ready_animations) OVERRIDE {
+ virtual void UpdateAnimationState(bool start_ready_animations) override {
LayerTreeHostImpl::UpdateAnimationState(start_ready_animations);
bool has_unfinished_animation = false;
AnimationRegistrar::AnimationControllerMap::const_iterator iter =
@@ -246,7 +246,7 @@
test_hooks_->UpdateAnimationState(this, has_unfinished_animation);
}
- virtual base::TimeDelta LowFrequencyAnimationInterval() const OVERRIDE {
+ virtual base::TimeDelta LowFrequencyAnimationInterval() const override {
return test_hooks_->LowFrequencyAnimationInterval();
}
@@ -266,24 +266,24 @@
}
virtual ~LayerTreeHostClientForTesting() {}
- virtual void WillBeginMainFrame(int frame_id) OVERRIDE {
+ virtual void WillBeginMainFrame(int frame_id) override {
test_hooks_->WillBeginMainFrame();
}
- virtual void DidBeginMainFrame() OVERRIDE {
+ virtual void DidBeginMainFrame() override {
test_hooks_->DidBeginMainFrame();
}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
test_hooks_->BeginMainFrame(args);
}
- virtual void Layout() OVERRIDE { test_hooks_->Layout(); }
+ virtual void Layout() override { test_hooks_->Layout(); }
virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta,
const gfx::Vector2d& outer_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
test_hooks_->ApplyViewportDeltas(inner_delta,
outer_delta,
page_scale,
@@ -291,38 +291,38 @@
}
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
test_hooks_->ApplyViewportDeltas(scroll_delta,
scale,
top_controls_delta);
}
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE {
+ virtual void RequestNewOutputSurface(bool fallback) override {
test_hooks_->RequestNewOutputSurface(fallback);
}
- virtual void DidInitializeOutputSurface() OVERRIDE {
+ virtual void DidInitializeOutputSurface() override {
test_hooks_->DidInitializeOutputSurface();
}
- virtual void DidFailToInitializeOutputSurface() OVERRIDE {
+ virtual void DidFailToInitializeOutputSurface() override {
test_hooks_->DidFailToInitializeOutputSurface();
}
- virtual void WillCommit() OVERRIDE { test_hooks_->WillCommit(); }
+ virtual void WillCommit() override { test_hooks_->WillCommit(); }
- virtual void DidCommit() OVERRIDE { test_hooks_->DidCommit(); }
+ virtual void DidCommit() override { test_hooks_->DidCommit(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
test_hooks_->DidCommitAndDrawFrame();
}
- virtual void DidCompleteSwapBuffers() OVERRIDE {
+ virtual void DidCompleteSwapBuffers() override {
test_hooks_->DidCompleteSwapBuffers();
}
- virtual void DidPostSwapBuffers() OVERRIDE {}
- virtual void DidAbortSwapBuffers() OVERRIDE {}
+ virtual void DidPostSwapBuffers() override {}
+ virtual void DidAbortSwapBuffers() override {}
private:
explicit LayerTreeHostClientForTesting(TestHooks* test_hooks)
@@ -356,7 +356,7 @@
}
virtual scoped_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl(
- LayerTreeHostImplClient* host_impl_client) OVERRIDE {
+ LayerTreeHostImplClient* host_impl_client) override {
return LayerTreeHostImplForTesting::Create(
test_hooks_,
settings(),
@@ -366,7 +366,7 @@
rendering_stats_instrumentation());
}
- virtual void SetNeedsCommit() OVERRIDE {
+ virtual void SetNeedsCommit() override {
if (!test_started_)
return;
LayerTreeHost::SetNeedsCommit();
@@ -374,7 +374,7 @@
void set_test_started(bool started) { test_started_ = started; }
- virtual void DidDeferCommit() OVERRIDE { test_hooks_->DidDeferCommit(); }
+ virtual void DidDeferCommit() override { test_hooks_->DidDeferCommit(); }
private:
LayerTreeHostForTesting(TestHooks* test_hooks,
diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h
index 36f37ef..af0c554 100644
--- a/cc/test/layer_tree_test.h
+++ b/cc/test/layer_tree_test.h
@@ -92,10 +92,10 @@
// Implementation of AnimationDelegate:
virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time,
Animation::TargetProperty target_property)
- OVERRIDE {}
+ override {}
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {}
+ Animation::TargetProperty target_property) override {}
virtual void RequestNewOutputSurface(bool fallback) = 0;
};
@@ -187,7 +187,7 @@
void DestroyLayerTreeHost();
// By default, output surface recreation is synchronous.
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE;
+ virtual void RequestNewOutputSurface(bool fallback) override;
// Override this for pixel tests, where you need a real output surface.
virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback);
// Override this for unit tests, which should not produce pixel output.
diff --git a/cc/test/ordered_simple_task_runner.h b/cc/test/ordered_simple_task_runner.h
index 54a2c27..68c9587 100644
--- a/cc/test/ordered_simple_task_runner.h
+++ b/cc/test/ordered_simple_task_runner.h
@@ -55,13 +55,13 @@
// base::TestSimpleTaskRunner implementation:
virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
+ base::TimeDelta delay) override;
virtual bool PostNonNestableDelayedTask(
const tracked_objects::Location& from_here,
const base::Closure& task,
- base::TimeDelta delay) OVERRIDE;
+ base::TimeDelta delay) override;
- virtual bool RunsTasksOnCurrentThread() const OVERRIDE;
+ virtual bool RunsTasksOnCurrentThread() const override;
// Set a maximum number of tasks to run at once. Useful as a timeout to
// prevent infinite task loops.
diff --git a/cc/test/pixel_comparator.h b/cc/test/pixel_comparator.h
index 0f24da0..0d418e8 100644
--- a/cc/test/pixel_comparator.h
+++ b/cc/test/pixel_comparator.h
@@ -29,7 +29,7 @@
// and report the number of pixels with an error on LOG(ERROR). Differences
// in the alpha channel are ignored.
virtual bool Compare(const SkBitmap& actual_bmp,
- const SkBitmap& expected_bmp) const OVERRIDE;
+ const SkBitmap& expected_bmp) const override;
private:
// Exclude alpha channel from comparison?
@@ -52,7 +52,7 @@
// specified limits. Otherwise, returns false and reports the error metrics on
// LOG(ERROR). Differences in the alpha channel are ignored.
virtual bool Compare(const SkBitmap& actual_bmp,
- const SkBitmap& expected_bmp) const OVERRIDE;
+ const SkBitmap& expected_bmp) const override;
private:
// Exclude alpha channel from comparison?
diff --git a/cc/test/pixel_test.h b/cc/test/pixel_test.h
index 94c6fa9..17ecffb 100644
--- a/cc/test/pixel_test.h
+++ b/cc/test/pixel_test.h
@@ -62,7 +62,7 @@
void EnableExternalStencilTest();
// RendererClient implementation.
- virtual void SetFullRootLayerDamage() OVERRIDE {}
+ virtual void SetFullRootLayerDamage() override {}
private:
void ReadbackResult(base::Closure quit_run_loop,
@@ -85,7 +85,7 @@
bool ExpandedViewport() const;
protected:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
};
// Wrappers to differentiate renderers where the the output surface and viewport
diff --git a/cc/test/pixel_test_output_surface.h b/cc/test/pixel_test_output_surface.h
index d3ec612..ce9d79c 100644
--- a/cc/test/pixel_test_output_surface.h
+++ b/cc/test/pixel_test_output_surface.h
@@ -16,8 +16,8 @@
explicit PixelTestOutputSurface(
scoped_ptr<SoftwareOutputDevice> software_device);
- virtual void Reshape(const gfx::Size& size, float scale_factor) OVERRIDE;
- virtual bool HasExternalStencilTest() const OVERRIDE;
+ virtual void Reshape(const gfx::Size& size, float scale_factor) override;
+ virtual bool HasExternalStencilTest() const override;
void set_surface_expansion_size(const gfx::Size& surface_expansion_size) {
surface_expansion_size_ = surface_expansion_size;
diff --git a/cc/test/pixel_test_software_output_device.h b/cc/test/pixel_test_software_output_device.h
index fd8f4b0..1315b4a 100644
--- a/cc/test/pixel_test_software_output_device.h
+++ b/cc/test/pixel_test_software_output_device.h
@@ -11,7 +11,7 @@
class PixelTestSoftwareOutputDevice : public SoftwareOutputDevice {
public:
- virtual void Resize(const gfx::Size& pixel_size, float scale_factor) OVERRIDE;
+ virtual void Resize(const gfx::Size& pixel_size, float scale_factor) override;
void set_surface_expansion_size(const gfx::Size& surface_expansion_size) {
surface_expansion_size_ = surface_expansion_size;
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h
index 2c6a8be..2cb878a 100644
--- a/cc/test/scheduler_test_common.h
+++ b/cc/test/scheduler_test_common.h
@@ -24,7 +24,7 @@
bool TickCalled() const { return tick_called_; }
// TimeSourceClient implementation.
- virtual void OnTimerTick() OVERRIDE;
+ virtual void OnTimerTick() override;
protected:
bool tick_called_;
@@ -39,7 +39,7 @@
}
void SetNow(base::TimeTicks time) { now_ = time; }
- virtual base::TimeTicks Now() const OVERRIDE;
+ virtual base::TimeTicks Now() const override;
protected:
FakeDelayBasedTimeSource(base::TimeDelta interval,
@@ -67,8 +67,8 @@
// Overridden from DelayBasedTimeSource
virtual ~TestDelayBasedTimeSource();
- virtual base::TimeTicks Now() const OVERRIDE;
- virtual std::string TypeString() const OVERRIDE;
+ virtual base::TimeTicks Now() const override;
+ virtual std::string TypeString() const override;
scoped_refptr<TestNowSource> now_src_;
};
@@ -89,8 +89,8 @@
}
// BeginFrameSource
- virtual void DidFinishFrame(size_t remaining_frames) OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
+ virtual void DidFinishFrame(size_t remaining_frames) override;
+ virtual void AsValueInto(base::debug::TracedValue* dict) const override;
virtual ~FakeBeginFrameSource() {}
};
@@ -110,7 +110,7 @@
TestBackToBackBeginFrameSource(scoped_refptr<TestNowSource> now_src,
base::SingleThreadTaskRunner* task_runner);
- virtual base::TimeTicks Now() OVERRIDE;
+ virtual base::TimeTicks Now() override;
scoped_refptr<TestNowSource> now_src_;
};
@@ -141,9 +141,9 @@
protected:
virtual BeginFrameSource* ConstructPrimaryFrameSource(
- Scheduler* scheduler) OVERRIDE;
+ Scheduler* scheduler) override;
virtual BeginFrameSource* ConstructBackgroundFrameSource(
- Scheduler* scheduler) OVERRIDE;
+ Scheduler* scheduler) override;
OrderedSimpleTaskRunner* test_task_runner_;
TestNowSource* now_src_;
@@ -189,7 +189,7 @@
protected:
// Overridden from Scheduler.
- virtual base::TimeTicks Now() const OVERRIDE;
+ virtual base::TimeTicks Now() const override;
private:
TestScheduler(
diff --git a/cc/test/solid_color_content_layer_client.h b/cc/test/solid_color_content_layer_client.h
index 6d4ea47..7e6ceb6 100644
--- a/cc/test/solid_color_content_layer_client.h
+++ b/cc/test/solid_color_content_layer_client.h
@@ -16,12 +16,12 @@
explicit SolidColorContentLayerClient(SkColor color) : color_(color) {}
// ContentLayerClient implementation.
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
+ virtual void DidChangeLayerCanUseLCDText() override {}
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& rect,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE;
- virtual bool FillsBoundsCompletely() const OVERRIDE;
+ ContentLayerClient::GraphicsContextStatus gc_status) override;
+ virtual bool FillsBoundsCompletely() const override;
private:
SkColor color_;
diff --git a/cc/test/test_context_provider.h b/cc/test/test_context_provider.h
index 75c7663..cf0292d 100644
--- a/cc/test/test_context_provider.h
+++ b/cc/test/test_context_provider.h
@@ -27,18 +27,18 @@
static scoped_refptr<TestContextProvider> Create(
scoped_ptr<TestWebGraphicsContext3D> context);
- virtual bool BindToCurrentThread() OVERRIDE;
- virtual Capabilities ContextCapabilities() OVERRIDE;
- virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE;
- virtual gpu::ContextSupport* ContextSupport() OVERRIDE;
- virtual class GrContext* GrContext() OVERRIDE;
- virtual bool IsContextLost() OVERRIDE;
- virtual void VerifyContexts() OVERRIDE;
- virtual void DeleteCachedResources() OVERRIDE;
- virtual bool DestroyedOnMainThread() OVERRIDE;
- virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE;
+ virtual bool BindToCurrentThread() override;
+ virtual Capabilities ContextCapabilities() override;
+ virtual gpu::gles2::GLES2Interface* ContextGL() override;
+ virtual gpu::ContextSupport* ContextSupport() override;
+ virtual class GrContext* GrContext() override;
+ virtual bool IsContextLost() override;
+ virtual void VerifyContexts() override;
+ virtual void DeleteCachedResources() override;
+ virtual bool DestroyedOnMainThread() override;
+ virtual void SetLostContextCallback(const LostContextCallback& cb) override;
virtual void SetMemoryPolicyChangedCallback(
- const MemoryPolicyChangedCallback& cb) OVERRIDE;
+ const MemoryPolicyChangedCallback& cb) override;
TestWebGraphicsContext3D* TestContext3d();
diff --git a/cc/test/test_context_support.h b/cc/test/test_context_support.h
index 0ffc683..c9b0d14 100644
--- a/cc/test/test_context_support.h
+++ b/cc/test/test_context_support.h
@@ -19,19 +19,19 @@
// gpu::ContextSupport implementation.
virtual void SignalSyncPoint(uint32 sync_point,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void SignalQuery(uint32 query,
- const base::Closure& callback) OVERRIDE;
- virtual void SetSurfaceVisible(bool visible) OVERRIDE;
- virtual void Swap() OVERRIDE;
- virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) OVERRIDE;
- virtual uint32 InsertFutureSyncPointCHROMIUM() OVERRIDE;
- virtual void RetireSyncPointCHROMIUM(uint32 sync_point) OVERRIDE;
+ const base::Closure& callback) override;
+ virtual void SetSurfaceVisible(bool visible) override;
+ virtual void Swap() override;
+ virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) override;
+ virtual uint32 InsertFutureSyncPointCHROMIUM() override;
+ virtual void RetireSyncPointCHROMIUM(uint32 sync_point) override;
virtual void ScheduleOverlayPlane(int plane_z_order,
gfx::OverlayTransform plane_transform,
unsigned overlay_texture_id,
const gfx::Rect& display_bounds,
- const gfx::RectF& uv_rect) OVERRIDE;
+ const gfx::RectF& uv_rect) override;
void CallAllSyncPointCallbacks();
diff --git a/cc/test/test_gles2_interface.h b/cc/test/test_gles2_interface.h
index ad53c04..e720022 100644
--- a/cc/test/test_gles2_interface.h
+++ b/cc/test/test_gles2_interface.h
@@ -15,59 +15,59 @@
explicit TestGLES2Interface(TestWebGraphicsContext3D* test_context);
virtual ~TestGLES2Interface();
- virtual void GenTextures(GLsizei n, GLuint* textures) OVERRIDE;
- virtual void GenBuffers(GLsizei n, GLuint* buffers) OVERRIDE;
- virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) OVERRIDE;
- virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) OVERRIDE;
- virtual void GenQueriesEXT(GLsizei n, GLuint* queries) OVERRIDE;
+ virtual void GenTextures(GLsizei n, GLuint* textures) override;
+ virtual void GenBuffers(GLsizei n, GLuint* buffers) override;
+ virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) override;
+ virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override;
+ virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override;
- virtual void DeleteTextures(GLsizei n, const GLuint* textures) OVERRIDE;
- virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) OVERRIDE;
+ virtual void DeleteTextures(GLsizei n, const GLuint* textures) override;
+ virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) override;
virtual void DeleteFramebuffers(GLsizei n,
- const GLuint* framebuffers) OVERRIDE;
- virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) OVERRIDE;
+ const GLuint* framebuffers) override;
+ virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
- virtual GLuint CreateShader(GLenum type) OVERRIDE;
- virtual GLuint CreateProgram() OVERRIDE;
+ virtual GLuint CreateShader(GLenum type) override;
+ virtual GLuint CreateProgram() override;
- virtual void BindTexture(GLenum target, GLuint texture) OVERRIDE;
+ virtual void BindTexture(GLenum target, GLuint texture) override;
- virtual void GetIntegerv(GLenum pname, GLint* params) OVERRIDE;
- virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) OVERRIDE;
+ virtual void GetIntegerv(GLenum pname, GLint* params) override;
+ virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override;
virtual void GetProgramiv(GLuint program,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual void GetShaderPrecisionFormat(GLenum shadertype,
GLenum precisiontype,
GLint* range,
- GLint* precision) OVERRIDE;
- virtual GLenum CheckFramebufferStatus(GLenum target) OVERRIDE;
+ GLint* precision) override;
+ virtual GLenum CheckFramebufferStatus(GLenum target) override;
- virtual void ActiveTexture(GLenum target) OVERRIDE;
+ virtual void ActiveTexture(GLenum target) override;
virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
- OVERRIDE;
- virtual void UseProgram(GLuint program) OVERRIDE;
+ override;
+ virtual void UseProgram(GLuint program) override;
virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
- OVERRIDE;
+ override;
virtual void DrawElements(GLenum mode,
GLsizei count,
GLenum type,
- const void* indices) OVERRIDE;
+ const void* indices) override;
virtual void ClearColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
- virtual void ClearStencil(GLint s) OVERRIDE;
- virtual void Clear(GLbitfield mask) OVERRIDE;
- virtual void Flush() OVERRIDE;
- virtual void Finish() OVERRIDE;
- virtual void ShallowFlushCHROMIUM() OVERRIDE;
- virtual void Enable(GLenum cap) OVERRIDE;
- virtual void Disable(GLenum cap) OVERRIDE;
+ GLclampf alpha) override;
+ virtual void ClearStencil(GLint s) override;
+ virtual void Clear(GLbitfield mask) override;
+ virtual void Flush() override;
+ virtual void Finish() override;
+ virtual void ShallowFlushCHROMIUM() override;
+ virtual void Enable(GLenum cap) override;
+ virtual void Disable(GLenum cap) override;
- virtual void BindBuffer(GLenum target, GLuint buffer) OVERRIDE;
- virtual void BindRenderbuffer(GLenum target, GLuint buffer) OVERRIDE;
- virtual void BindFramebuffer(GLenum target, GLuint buffer) OVERRIDE;
+ virtual void BindBuffer(GLenum target, GLuint buffer) override;
+ virtual void BindRenderbuffer(GLenum target, GLuint buffer) override;
+ virtual void BindFramebuffer(GLenum target, GLuint buffer) override;
virtual void TexImage2D(GLenum target,
GLint level,
@@ -77,7 +77,7 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
virtual void TexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -86,18 +86,18 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
virtual void TexStorage2DEXT(GLenum target,
GLsizei levels,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
GLsizei width,
GLsizei height,
GLuint io_surface_id,
- GLuint plane) OVERRIDE;
- virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;
+ GLuint plane) override;
+ virtual void TexParameteri(GLenum target, GLenum pname, GLint param) override;
virtual void AsyncTexImage2DCHROMIUM(GLenum target,
GLint level,
@@ -107,7 +107,7 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
GLint level,
GLint xoffset,
@@ -116,7 +116,7 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
virtual void CompressedTexImage2D(GLenum target,
GLint level,
GLenum internalformat,
@@ -124,74 +124,74 @@
GLsizei height,
GLint border,
GLsizei image_size,
- const void* data) OVERRIDE;
- virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE;
+ const void* data) override;
+ virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
virtual GLuint CreateImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
- virtual void DestroyImageCHROMIUM(GLuint image_id) OVERRIDE;
- virtual void* MapImageCHROMIUM(GLuint image_id) OVERRIDE;
+ GLenum usage) override;
+ virtual void DestroyImageCHROMIUM(GLuint image_id) override;
+ virtual void* MapImageCHROMIUM(GLuint image_id) override;
virtual void GetImageParameterivCHROMIUM(GLuint image_id,
GLenum pname,
- GLint* params) OVERRIDE;
- virtual void UnmapImageCHROMIUM(GLuint image_id) OVERRIDE;
+ GLint* params) override;
+ virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
- virtual void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) OVERRIDE;
+ GLenum usage) override;
+ virtual void BindTexImage2DCHROMIUM(GLenum target, GLint image_id) override;
virtual void ReleaseTexImage2DCHROMIUM(GLenum target,
- GLint image_id) OVERRIDE;
+ GLint image_id) override;
virtual void FramebufferRenderbuffer(GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
- GLuint renderbuffer) OVERRIDE;
+ GLuint renderbuffer) override;
virtual void FramebufferTexture2D(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
- GLint level) OVERRIDE;
+ GLint level) override;
virtual void RenderbufferStorage(GLenum target,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
- virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) OVERRIDE;
- virtual GLboolean UnmapBufferCHROMIUM(GLuint target) OVERRIDE;
+ virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
+ virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
virtual void BufferData(GLenum target,
GLsizeiptr size,
const void* data,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
- virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
- virtual GLuint InsertSyncPointCHROMIUM() OVERRIDE;
+ virtual void WaitSyncPointCHROMIUM(GLuint sync_point) override;
+ virtual GLuint InsertSyncPointCHROMIUM() override;
- virtual void BeginQueryEXT(GLenum target, GLuint id) OVERRIDE;
- virtual void EndQueryEXT(GLenum target) OVERRIDE;
+ virtual void BeginQueryEXT(GLenum target, GLuint id) override;
+ virtual void EndQueryEXT(GLenum target) override;
virtual void GetQueryObjectuivEXT(GLuint id,
GLenum pname,
- GLuint* params) OVERRIDE;
+ GLuint* params) override;
virtual void DiscardFramebufferEXT(GLenum target,
GLsizei count,
- const GLenum* attachments) OVERRIDE;
- virtual void GenMailboxCHROMIUM(GLbyte* mailbox) OVERRIDE;
+ const GLenum* attachments) override;
+ virtual void GenMailboxCHROMIUM(GLbyte* mailbox) override;
virtual void ProduceTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ProduceTextureDirectCHROMIUM(GLuint texture,
GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual GLuint CreateAndConsumeTextureCHROMIUM(
GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ResizeCHROMIUM(GLuint width,
GLuint height,
- float device_scale) OVERRIDE;
- virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
+ float device_scale) override;
+ virtual void LoseContextCHROMIUM(GLenum current, GLenum other) override;
private:
TestWebGraphicsContext3D* test_context_;
diff --git a/cc/test/test_in_process_context_provider.h b/cc/test/test_in_process_context_provider.h
index 721caba..5e6a978 100644
--- a/cc/test/test_in_process_context_provider.h
+++ b/cc/test/test_in_process_context_provider.h
@@ -22,20 +22,20 @@
public:
TestInProcessContextProvider();
- virtual bool BindToCurrentThread() OVERRIDE;
- virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE;
- virtual gpu::ContextSupport* ContextSupport() OVERRIDE;
- virtual class GrContext* GrContext() OVERRIDE;
- virtual Capabilities ContextCapabilities() OVERRIDE;
- virtual bool IsContextLost() OVERRIDE;
- virtual void VerifyContexts() OVERRIDE;
- virtual void DeleteCachedResources() OVERRIDE;
- virtual bool DestroyedOnMainThread() OVERRIDE;
+ virtual bool BindToCurrentThread() override;
+ virtual gpu::gles2::GLES2Interface* ContextGL() override;
+ virtual gpu::ContextSupport* ContextSupport() override;
+ virtual class GrContext* GrContext() override;
+ virtual Capabilities ContextCapabilities() override;
+ virtual bool IsContextLost() override;
+ virtual void VerifyContexts() override;
+ virtual void DeleteCachedResources() override;
+ virtual bool DestroyedOnMainThread() override;
virtual void SetLostContextCallback(
- const LostContextCallback& lost_context_callback) OVERRIDE;
+ const LostContextCallback& lost_context_callback) override;
virtual void SetMemoryPolicyChangedCallback(
const MemoryPolicyChangedCallback& memory_policy_changed_callback)
- OVERRIDE;
+ override;
protected:
friend class base::RefCountedThreadSafe<TestInProcessContextProvider>;
diff --git a/cc/test/test_shared_bitmap_manager.h b/cc/test/test_shared_bitmap_manager.h
index 2952940..ccda52c 100644
--- a/cc/test/test_shared_bitmap_manager.h
+++ b/cc/test/test_shared_bitmap_manager.h
@@ -18,14 +18,14 @@
virtual ~TestSharedBitmapManager();
virtual scoped_ptr<SharedBitmap> AllocateSharedBitmap(const gfx::Size& size)
- OVERRIDE;
+ override;
virtual scoped_ptr<SharedBitmap> GetSharedBitmapFromId(
const gfx::Size&,
- const SharedBitmapId& id) OVERRIDE;
+ const SharedBitmapId& id) override;
virtual scoped_ptr<SharedBitmap> GetBitmapForSharedMemory(
- base::SharedMemory* memory) OVERRIDE;
+ base::SharedMemory* memory) override;
private:
base::Lock lock_;
diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h
index 2634621..29f06a7 100644
--- a/cc/test/tiled_layer_test_common.h
+++ b/cc/test/tiled_layer_test_common.h
@@ -30,7 +30,7 @@
virtual void Update(ResourceUpdateQueue* queue,
const gfx::Rect& source_rect,
const gfx::Vector2d& dest_offset,
- bool partial_update) OVERRIDE;
+ bool partial_update) override;
private:
FakeLayerUpdater* layer_;
@@ -42,13 +42,13 @@
FakeLayerUpdater();
virtual scoped_ptr<LayerUpdater::Resource> CreateResource(
- PrioritizedResourceManager* resource) OVERRIDE;
+ PrioritizedResourceManager* resource) override;
virtual void PrepareToUpdate(const gfx::Size& content_size,
const gfx::Rect& paint_rect,
const gfx::Size& tile_size,
float contents_width_scale,
- float contents_height_scale) OVERRIDE;
+ float contents_height_scale) override;
// Sets the rect to invalidate during the next call to PrepareToUpdate().
// After the next call to PrepareToUpdate() the rect is reset.
void SetRectToInvalidate(const gfx::Rect& rect, FakeTiledLayer* layer);
@@ -102,15 +102,15 @@
using TiledLayer::NumPaintedTiles;
using TiledLayer::IdlePaintRect;
- virtual void SetNeedsDisplayRect(const gfx::RectF& rect) OVERRIDE;
+ virtual void SetNeedsDisplayRect(const gfx::RectF& rect) override;
const gfx::RectF& last_needs_display_rect() const {
return last_needs_display_rect_;
}
virtual void SetTexturePriorities(
- const PriorityCalculator& priority_calculator) OVERRIDE;
+ const PriorityCalculator& priority_calculator) override;
- virtual PrioritizedResourceManager* ResourceManager() OVERRIDE;
+ virtual PrioritizedResourceManager* ResourceManager() override;
FakeLayerUpdater* fake_layer_updater() { return fake_updater_.get(); }
gfx::RectF update_rect() { return update_rect_; }
@@ -120,8 +120,8 @@
void ResetNumDependentsNeedPushProperties();
protected:
- virtual LayerUpdater* Updater() const OVERRIDE;
- virtual void CreateUpdaterIfNeeded() OVERRIDE {}
+ virtual LayerUpdater* Updater() const override;
+ virtual void CreateUpdaterIfNeeded() override {}
virtual ~FakeTiledLayer();
private:
@@ -141,7 +141,7 @@
virtual void CalculateContentsScale(float ideal_contents_scale,
float* contents_scale_x,
float* contents_scale_y,
- gfx::Size* content_bounds) OVERRIDE;
+ gfx::Size* content_bounds) override;
protected:
virtual ~FakeTiledLayerWithScaledBounds();
diff --git a/cc/trees/layer_tree_host_common_perftest.cc b/cc/trees/layer_tree_host_common_perftest.cc
index d334e96..e378561 100644
--- a/cc/trees/layer_tree_host_common_perftest.cc
+++ b/cc/trees/layer_tree_host_common_perftest.cc
@@ -50,7 +50,7 @@
ASSERT_TRUE(base::ReadFileToString(json_file, &json_));
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
gfx::Size viewport = gfx::Size(720, 1038);
layer_tree_host()->SetViewportSize(viewport);
scoped_refptr<Layer> root =
@@ -61,7 +61,7 @@
void SetTestName(const std::string& name) { test_name_ = name; }
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
CHECK(!test_name_.empty()) << "Must SetTestName() before TearDown().";
perf_test::PrintResult("calc_draw_props_time",
"",
@@ -84,7 +84,7 @@
RunTest(false, false, false);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
timer_.Reset();
do {
@@ -121,11 +121,11 @@
RunTestWithImplSidePainting();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
timer_.Reset();
LayerTreeImpl* active_tree = host_impl->active_tree();
@@ -169,9 +169,9 @@
public:
void RunSortLayers() { RunTest(false, false, false); }
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeImpl* active_tree = host_impl->active_tree();
// First build the tree and then we'll start running tests on layersorter
// itself
@@ -221,9 +221,9 @@
num_duplicates_ = num_duplicates;
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeImpl* active_tree = host_impl->active_tree();
// First build the tree and then we'll start running tests on layersorter
// itself
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index 7278b33..9efcaea 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -40,7 +40,7 @@
public:
LayerWithForcedDrawsContent() {}
- virtual bool DrawsContent() const OVERRIDE;
+ virtual bool DrawsContent() const override;
private:
virtual ~LayerWithForcedDrawsContent() {}
@@ -55,9 +55,9 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
- virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+ ContentLayerClient::GraphicsContextStatus gc_status) override {}
+ virtual void DidChangeLayerCanUseLCDText() override {}
+ virtual bool FillsBoundsCompletely() const override { return false; }
};
scoped_refptr<ContentLayer> CreateDrawableContentLayer(
@@ -4018,7 +4018,7 @@
virtual void CalculateContentsScale(float ideal_contents_scale,
float* contents_scale_x,
float* contents_scale_y,
- gfx::Size* content_bounds) OVERRIDE {
+ gfx::Size* content_bounds) override {
// Skip over the ContentLayer to the base Layer class.
Layer::CalculateContentsScale(ideal_contents_scale,
contents_scale_x,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index dd000d6..4d2f5a7 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -145,7 +145,7 @@
time_source_->SetActive(false);
}
- virtual void OnTimerTick() OVERRIDE {
+ virtual void OnTimerTick() override {
// In single threaded mode we attempt to simulate changing the current
// thread by maintaining a fake thread id. When we switch from one
// thread to another, we construct DebugScopedSetXXXThread objects that
@@ -336,6 +336,10 @@
void LayerTreeHostImpl::CommitComplete() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete");
+ // Ask to be animated if there are animations
+ if (needs_animate_layers())
+ SetNeedsAnimate();
+
if (pending_tree_)
pending_tree_->ApplyScrollDeltasSinceBeginMainFrame();
sync_tree()->set_needs_update_draw_properties();
@@ -546,7 +550,10 @@
LayerImpl* layer,
const OcclusionTracker<LayerImpl>& occlusion_tracker,
AppendQuadsData* append_quads_data) {
- layer->AppendQuads(target_render_pass, occlusion_tracker, append_quads_data);
+ layer->AppendQuads(
+ target_render_pass,
+ occlusion_tracker.GetCurrentOcclusionForLayer(layer->draw_transform()),
+ append_quads_data);
}
static void AppendQuadsForRenderSurfaceLayer(
@@ -861,13 +868,11 @@
draw_result = DRAW_SUCCESS;
#if DCHECK_IS_ON
- for (size_t i = 0; i < frame->render_passes.size(); ++i) {
- for (QuadList::Iterator iter = frame->render_passes[i]->quad_list.begin();
- iter != frame->render_passes[i]->quad_list.end();
- ++iter)
- DCHECK(iter->shared_quad_state);
- DCHECK(frame->render_passes_by_id.find(frame->render_passes[i]->id)
- != frame->render_passes_by_id.end());
+ for (auto* render_pass : frame->render_passes) {
+ for (auto& quad : render_pass->quad_list)
+ DCHECK(quad.shared_quad_state);
+ DCHECK(frame->render_passes_by_id.find(render_pass->id) !=
+ frame->render_passes_by_id.end());
}
#endif
DCHECK(frame->render_passes.back()->output_rect.origin().IsOrigin());
@@ -1478,9 +1483,7 @@
fps_counter_->SaveTimeStamp(frame_begin_time,
!output_surface_->context_provider());
- bool on_main_thread = false;
- rendering_stats_instrumentation_->IncrementFrameCount(
- 1, on_main_thread);
+ rendering_stats_instrumentation_->IncrementFrameCount(1);
if (tile_manager_) {
memory_history_->SaveEntry(
@@ -2536,7 +2539,7 @@
// Force updating of vertical adjust values if needed.
if (applied_delta.y() != 0) {
did_scroll_top_controls = true;
- layer_impl->ScrollbarParametersDidChange();
+ layer_impl->ScrollbarParametersDidChange(false);
}
}
// Track root layer deltas for reporting overscroll.
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index fad9f08..a987d46 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -125,44 +125,44 @@
virtual ~LayerTreeHostImpl();
// BeginFrameSourceMixIn implementation
- virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) OVERRIDE;
+ virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override;
// InputHandler implementation
- virtual void BindToClient(InputHandlerClient* client) OVERRIDE;
+ virtual void BindToClient(InputHandlerClient* client) override;
virtual InputHandler::ScrollStatus ScrollBegin(
const gfx::Point& viewport_point,
- InputHandler::ScrollInputType type) OVERRIDE;
+ InputHandler::ScrollInputType type) override;
virtual InputHandler::ScrollStatus ScrollAnimated(
const gfx::Point& viewport_point,
- const gfx::Vector2dF& scroll_delta) OVERRIDE;
+ const gfx::Vector2dF& scroll_delta) override;
virtual bool ScrollBy(const gfx::Point& viewport_point,
- const gfx::Vector2dF& scroll_delta) OVERRIDE;
+ const gfx::Vector2dF& scroll_delta) override;
virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point,
- ScrollDirection direction) OVERRIDE;
+ ScrollDirection direction) override;
virtual void SetRootLayerScrollOffsetDelegate(
- LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) OVERRIDE;
- virtual void OnRootLayerDelegatedScrollOffsetChanged() OVERRIDE;
- virtual void ScrollEnd() OVERRIDE;
- virtual InputHandler::ScrollStatus FlingScrollBegin() OVERRIDE;
- virtual void MouseMoveAt(const gfx::Point& viewport_point) OVERRIDE;
- virtual void PinchGestureBegin() OVERRIDE;
+ LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override;
+ virtual void OnRootLayerDelegatedScrollOffsetChanged() override;
+ virtual void ScrollEnd() override;
+ virtual InputHandler::ScrollStatus FlingScrollBegin() override;
+ virtual void MouseMoveAt(const gfx::Point& viewport_point) override;
+ virtual void PinchGestureBegin() override;
virtual void PinchGestureUpdate(float magnify_delta,
- const gfx::Point& anchor) OVERRIDE;
- virtual void PinchGestureEnd() OVERRIDE;
- virtual void SetNeedsAnimate() OVERRIDE;
+ const gfx::Point& anchor) override;
+ virtual void PinchGestureEnd() override;
+ virtual void SetNeedsAnimate() override;
virtual bool IsCurrentlyScrollingLayerAt(
const gfx::Point& viewport_point,
- InputHandler::ScrollInputType type) OVERRIDE;
+ InputHandler::ScrollInputType type) override;
virtual bool HaveTouchEventHandlersAt(
- const gfx::Point& viewport_port) OVERRIDE;
+ const gfx::Point& viewport_port) override;
virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor(
- ui::LatencyInfo* latency) OVERRIDE;
+ ui::LatencyInfo* latency) override;
// TopControlsManagerClient implementation.
- virtual void SetControlsTopOffset(float offset) OVERRIDE;
- virtual float ControlsTopOffset() const OVERRIDE;
- virtual void DidChangeTopControlsPosition() OVERRIDE;
- virtual bool HaveRootScrollLayer() const OVERRIDE;
+ virtual void SetControlsTopOffset(float offset) override;
+ virtual float ControlsTopOffset() const override;
+ virtual void DidChangeTopControlsPosition() override;
+ virtual bool HaveRootScrollLayer() const override;
struct CC_EXPORT FrameData : public RenderPassSink {
FrameData();
@@ -179,7 +179,7 @@
bool has_no_damage;
// RenderPassSink implementation.
- virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE;
+ virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override;
};
virtual void BeginMainFrameAborted(bool did_handle);
@@ -231,30 +231,30 @@
const gfx::Rect ViewportRectForTilePriority() const;
// RendererClient implementation.
- virtual void SetFullRootLayerDamage() OVERRIDE;
+ virtual void SetFullRootLayerDamage() override;
// TileManagerClient implementation.
virtual const std::vector<PictureLayerImpl*>& GetPictureLayers()
- const OVERRIDE;
- virtual void NotifyReadyToActivate() OVERRIDE;
- virtual void NotifyTileStateChanged(const Tile* tile) OVERRIDE;
+ const override;
+ virtual void NotifyReadyToActivate() override;
+ virtual void NotifyTileStateChanged(const Tile* tile) override;
virtual void BuildRasterQueue(RasterTilePriorityQueue* queue,
- TreePriority tree_priority) OVERRIDE;
+ TreePriority tree_priority) override;
virtual void BuildEvictionQueue(EvictionTilePriorityQueue* queue,
- TreePriority tree_priority) OVERRIDE;
+ TreePriority tree_priority) override;
// ScrollbarAnimationControllerClient implementation.
virtual void PostDelayedScrollbarFade(const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE;
- virtual void SetNeedsScrollbarAnimationFrame() OVERRIDE;
+ base::TimeDelta delay) override;
+ virtual void SetNeedsScrollbarAnimationFrame() override;
// OutputSurfaceClient implementation.
- virtual void DeferredInitialize() OVERRIDE;
- virtual void ReleaseGL() OVERRIDE;
+ virtual void DeferredInitialize() override;
+ virtual void ReleaseGL() override;
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE;
- virtual void SetNeedsRedrawRect(const gfx::Rect& rect) OVERRIDE;
- virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE;
+ base::TimeDelta interval) override;
+ virtual void SetNeedsRedrawRect(const gfx::Rect& rect) override;
+ virtual void BeginFrame(const BeginFrameArgs& args) override;
virtual void SetExternalDrawConstraints(
const gfx::Transform& transform,
@@ -262,14 +262,14 @@
const gfx::Rect& clip,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority,
- bool resourceless_software_draw) OVERRIDE;
- virtual void DidLoseOutputSurface() OVERRIDE;
- virtual void DidSwapBuffers() OVERRIDE;
- virtual void DidSwapBuffersComplete() OVERRIDE;
- virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE;
- virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE;
+ bool resourceless_software_draw) override;
+ virtual void DidLoseOutputSurface() override;
+ virtual void DidSwapBuffers() override;
+ virtual void DidSwapBuffersComplete() override;
+ virtual void ReclaimResources(const CompositorFrameAck* ack) override;
+ virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
virtual void SetTreeActivationCallback(const base::Closure& callback)
- OVERRIDE;
+ override;
// Called from LayerTreeImpl.
void OnCanDrawStateChangedForTree();
@@ -427,7 +427,7 @@
return begin_impl_frame_interval_;
}
- virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE;
+ virtual void AsValueInto(base::debug::TracedValue* value) const override;
void AsValueWithFrameInto(FrameData* frame,
base::debug::TracedValue* value) const;
scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 981e670..2972a7c 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -26,6 +26,7 @@
#include "cc/layers/solid_color_scrollbar_layer_impl.h"
#include "cc/layers/texture_layer_impl.h"
#include "cc/layers/tiled_layer_impl.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/compositor_frame_metadata.h"
@@ -46,6 +47,7 @@
#include "cc/test/fake_picture_pile_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/fake_rendering_stats_instrumentation.h"
+#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/render_pass_test_common.h"
@@ -53,6 +55,7 @@
#include "cc/test/test_web_graphics_context_3d.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
+#include "media/base/media.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkMallocPixelRef.h"
@@ -66,6 +69,7 @@
using ::testing::AnyNumber;
using ::testing::AtLeast;
using ::testing::_;
+using media::VideoFrame;
namespace cc {
namespace {
@@ -89,6 +93,7 @@
reduce_memory_result_(true),
current_limit_bytes_(0),
current_priority_cutoff_value_(0) {
+ media::InitializeMediaLibraryForTesting();
}
LayerTreeSettings DefaultSettings() {
@@ -100,64 +105,64 @@
return settings;
}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
CreateHostImpl(DefaultSettings(), CreateOutputSurface());
}
- virtual void TearDown() OVERRIDE {}
+ virtual void TearDown() override {}
- virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE {}
- virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {}
+ virtual void UpdateRendererCapabilitiesOnImplThread() override {}
+ virtual void DidLoseOutputSurfaceOnImplThread() override {}
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE {}
- virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) OVERRIDE {}
- virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE {}
- virtual void DidSwapBuffersOnImplThread() OVERRIDE {}
- virtual void DidSwapBuffersCompleteOnImplThread() OVERRIDE {}
- virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE {
+ base::TimeDelta interval) override {}
+ virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {}
+ virtual void SetMaxSwapsPendingOnImplThread(int max) override {}
+ virtual void DidSwapBuffersOnImplThread() override {}
+ virtual void DidSwapBuffersCompleteOnImplThread() override {}
+ virtual void OnCanDrawStateChanged(bool can_draw) override {
on_can_draw_state_changed_called_ = true;
}
- virtual void NotifyReadyToActivate() OVERRIDE {
+ virtual void NotifyReadyToActivate() override {
did_notify_ready_to_activate_ = true;
host_impl_->ActivateSyncTree();
}
- virtual void SetNeedsRedrawOnImplThread() OVERRIDE {
+ virtual void SetNeedsRedrawOnImplThread() override {
did_request_redraw_ = true;
}
virtual void SetNeedsRedrawRectOnImplThread(
- const gfx::Rect& damage_rect) OVERRIDE {
+ const gfx::Rect& damage_rect) override {
did_request_redraw_ = true;
}
- virtual void SetNeedsAnimateOnImplThread() OVERRIDE {
+ virtual void SetNeedsAnimateOnImplThread() override {
did_request_animate_ = true;
}
- virtual void SetNeedsManageTilesOnImplThread() OVERRIDE {
+ virtual void SetNeedsManageTilesOnImplThread() override {
did_request_manage_tiles_ = true;
}
- virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE {
+ virtual void DidInitializeVisibleTileOnImplThread() override {
did_upload_visible_tile_ = true;
}
- virtual void SetNeedsCommitOnImplThread() OVERRIDE {
+ virtual void SetNeedsCommitOnImplThread() override {
did_request_commit_ = true;
}
virtual void PostAnimationEventsToMainThreadOnImplThread(
- scoped_ptr<AnimationEventsVector> events) OVERRIDE {}
+ scoped_ptr<AnimationEventsVector> events) override {}
virtual bool ReduceContentsTextureMemoryOnImplThread(
- size_t limit_bytes, int priority_cutoff) OVERRIDE {
+ size_t limit_bytes, int priority_cutoff) override {
current_limit_bytes_ = limit_bytes;
current_priority_cutoff_value_ = priority_cutoff;
return reduce_memory_result_;
}
- virtual bool IsInsideDraw() OVERRIDE { return false; }
- virtual void RenewTreePriority() OVERRIDE {}
+ virtual bool IsInsideDraw() override { return false; }
+ virtual void RenewTreePriority() override {}
virtual void PostDelayedScrollbarFadeOnImplThread(
const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE {
+ base::TimeDelta delay) override {
scrollbar_fade_start_ = start_fade;
requested_scrollbar_animation_delay_ = delay;
}
- virtual void DidActivateSyncTree() OVERRIDE {}
- virtual void DidManageTiles() OVERRIDE {}
+ virtual void DidActivateSyncTree() override {}
+ virtual void DidManageTiles() override {}
void set_reduce_memory_result(bool reduce_memory_result) {
reduce_memory_result_ = reduce_memory_result;
@@ -1363,7 +1368,7 @@
manager,
0) {}
- virtual BeginFrameArgs CurrentBeginFrameArgs() const OVERRIDE {
+ virtual BeginFrameArgs CurrentBeginFrameArgs() const override {
return CreateBeginFrameArgsForTesting(fake_current_physical_time_);
}
@@ -1703,7 +1708,7 @@
}
virtual bool WillDraw(DrawMode draw_mode, ResourceProvider* provider)
- OVERRIDE {
+ override {
will_draw_called_ = true;
if (will_draw_returns_false_)
return false;
@@ -1711,13 +1716,14 @@
}
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE {
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override {
append_quads_called_ = true;
- LayerImpl::AppendQuads(render_pass, occlusion_tracker, append_quads_data);
+ LayerImpl::AppendQuads(
+ render_pass, occlusion_in_content_space, append_quads_data);
}
- virtual void DidDraw(ResourceProvider* provider) OVERRIDE {
+ virtual void DidDraw(ResourceProvider* provider) override {
did_draw_called_ = true;
LayerImpl::DidDraw(provider);
}
@@ -1934,9 +1940,10 @@
}
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE {
- LayerImpl::AppendQuads(render_pass, occlusion_tracker, append_quads_data);
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override {
+ LayerImpl::AppendQuads(
+ render_pass, occlusion_in_content_space, append_quads_data);
if (had_incomplete_tile_)
append_quads_data->num_incomplete_tiles++;
if (tile_missing_)
@@ -3278,11 +3285,11 @@
virtual ~TestScrollOffsetDelegate() {}
- virtual gfx::ScrollOffset GetTotalScrollOffset() OVERRIDE {
+ virtual gfx::ScrollOffset GetTotalScrollOffset() override {
return getter_return_value_;
}
- virtual bool IsExternalFlingActive() const OVERRIDE { return false; }
+ virtual bool IsExternalFlingActive() const override { return false; }
virtual void UpdateRootLayerState(
const gfx::ScrollOffset& total_scroll_offset,
@@ -3290,7 +3297,7 @@
const gfx::SizeF& scrollable_size,
float page_scale_factor,
float min_page_scale_factor,
- float max_page_scale_factor) OVERRIDE {
+ float max_page_scale_factor) override {
DCHECK(total_scroll_offset.x() <= max_scroll_offset.x());
DCHECK(total_scroll_offset.y() <= max_scroll_offset.y());
last_set_scroll_offset_ = total_scroll_offset;
@@ -3733,8 +3740,8 @@
}
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE {
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override {
quads_appended_ = true;
gfx::Rect opaque_rect;
@@ -4144,7 +4151,7 @@
host_impl_->DidDrawAllLayers(frame);
}
- virtual void DidActivateSyncTree() OVERRIDE {
+ virtual void DidActivateSyncTree() override {
did_activate_pending_tree_ = true;
}
@@ -4158,10 +4165,8 @@
protected:
size_t CountGutterQuads(const QuadList& quad_list) {
size_t num_gutter_quads = 0;
- for (QuadList::ConstIterator iter = quad_list.begin();
- iter != quad_list.end();
- ++iter) {
- num_gutter_quads += (iter->material == gutter_quad_material_) ? 1 : 0;
+ for (const auto& quad : quad_list) {
+ num_gutter_quads += (quad.material == gutter_quad_material_) ? 1 : 0;
}
return num_gutter_quads;
}
@@ -4173,22 +4178,23 @@
// Make sure that the texture coordinates match their expectations.
void ValidateTextureDrawQuads(const QuadList& quad_list) {
- for (QuadList::ConstIterator iter = quad_list.begin();
- iter != quad_list.end();
- ++iter) {
- if (iter->material != DrawQuad::TEXTURE_CONTENT)
+ for (const auto& quad : quad_list) {
+ if (quad.material != DrawQuad::TEXTURE_CONTENT)
continue;
- const TextureDrawQuad* quad = TextureDrawQuad::MaterialCast(&*iter);
+ const TextureDrawQuad* texture_quad =
+ TextureDrawQuad::MaterialCast(&quad);
gfx::SizeF gutter_texture_size_pixels = gfx::ScaleSize(
gutter_texture_size_, host_impl_->device_scale_factor());
- EXPECT_EQ(quad->uv_top_left.x(),
- quad->rect.x() / gutter_texture_size_pixels.width());
- EXPECT_EQ(quad->uv_top_left.y(),
- quad->rect.y() / gutter_texture_size_pixels.height());
- EXPECT_EQ(quad->uv_bottom_right.x(),
- quad->rect.right() / gutter_texture_size_pixels.width());
- EXPECT_EQ(quad->uv_bottom_right.y(),
- quad->rect.bottom() / gutter_texture_size_pixels.height());
+ EXPECT_EQ(texture_quad->uv_top_left.x(),
+ texture_quad->rect.x() / gutter_texture_size_pixels.width());
+ EXPECT_EQ(texture_quad->uv_top_left.y(),
+ texture_quad->rect.y() / gutter_texture_size_pixels.height());
+ EXPECT_EQ(
+ texture_quad->uv_bottom_right.x(),
+ texture_quad->rect.right() / gutter_texture_size_pixels.width());
+ EXPECT_EQ(
+ texture_quad->uv_bottom_right.y(),
+ texture_quad->rect.bottom() / gutter_texture_size_pixels.height());
}
}
@@ -4497,8 +4503,8 @@
}
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE {
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
PopulateSharedQuadState(shared_quad_state);
@@ -4821,6 +4827,18 @@
LayerImpl::Create(host_impl_->active_tree(), 1);
root_layer->SetBounds(gfx::Size(10, 10));
+ scoped_refptr<VideoFrame> softwareFrame =
+ media::VideoFrame::CreateColorFrame(
+ gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
+ FakeVideoFrameProvider provider;
+ provider.set_frame(softwareFrame);
+ scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create(
+ host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0);
+ video_layer->SetBounds(gfx::Size(10, 10));
+ video_layer->SetContentBounds(gfx::Size(10, 10));
+ video_layer->SetDrawsContent(true);
+ root_layer->AddChild(video_layer.Pass());
+
scoped_ptr<IOSurfaceLayerImpl> io_surface_layer =
IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5);
io_surface_layer->SetBounds(gfx::Size(10, 10));
@@ -4934,7 +4952,7 @@
class LayerTreeHostImplTestWithDelegatingRenderer
: public LayerTreeHostImplTest {
protected:
- virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE {
+ virtual scoped_ptr<OutputSurface> CreateOutputSurface() override {
return FakeOutputSurface::CreateDelegating3d();
}
@@ -5024,7 +5042,7 @@
return make_scoped_ptr(new FakeMaskLayerImpl(tree_impl, id));
}
- virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE {
+ virtual ResourceProvider::ResourceId ContentsResourceId() const override {
return 0;
}
@@ -5754,7 +5772,7 @@
CompositorFrameMetadataTest()
: swap_buffers_complete_(0) {}
- virtual void DidSwapBuffersCompleteOnImplThread() OVERRIDE {
+ virtual void DidSwapBuffersCompleteOnImplThread() override {
swap_buffers_complete_++;
}
@@ -5779,11 +5797,11 @@
public:
CountingSoftwareDevice() : frames_began_(0), frames_ended_(0) {}
- virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) OVERRIDE {
+ virtual SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override {
++frames_began_;
return SoftwareOutputDevice::BeginPaint(damage_rect);
}
- virtual void EndPaint(SoftwareFrameData* frame_data) OVERRIDE {
+ virtual void EndPaint(SoftwareFrameData* frame_data) override {
++frames_ended_;
SoftwareOutputDevice::EndPaint(frame_data);
}
@@ -5856,6 +5874,16 @@
scoped_ptr<SolidColorLayerImpl> root_layer =
SolidColorLayerImpl::Create(host_impl_->active_tree(), 1);
+ // VideoLayerImpl will not be drawn.
+ FakeVideoFrameProvider provider;
+ scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create(
+ host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0);
+ video_layer->SetBounds(gfx::Size(10, 10));
+ video_layer->SetContentBounds(gfx::Size(10, 10));
+ video_layer->SetDrawsContent(true);
+ root_layer->AddChild(video_layer.Pass());
+ SetupRootLayerImpl(root_layer.Pass());
+
LayerTreeHostImpl::FrameData frame;
EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame));
host_impl_->DrawLayers(&frame, gfx::FrameTime::Now());
@@ -5867,7 +5895,7 @@
class LayerTreeHostImplTestDeferredInitialize : public LayerTreeHostImplTest {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
LayerTreeHostImplTest::SetUp();
set_reduce_memory_result(false);
@@ -5888,7 +5916,7 @@
onscreen_context_provider_ = TestContextProvider::Create();
}
- virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE {
+ virtual void UpdateRendererCapabilitiesOnImplThread() override {
did_update_renderer_capabilities_ = true;
}
@@ -6055,7 +6083,7 @@
class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
LayerTreeSettings settings;
settings.impl_side_painting = true;
@@ -6607,15 +6635,15 @@
virtual ~SimpleSwapPromiseMonitor() {}
- virtual void OnSetNeedsCommitOnMain() OVERRIDE {
+ virtual void OnSetNeedsCommitOnMain() override {
(*set_needs_commit_count_)++;
}
- virtual void OnSetNeedsRedrawOnImpl() OVERRIDE {
+ virtual void OnSetNeedsRedrawOnImpl() override {
(*set_needs_redraw_count_)++;
}
- virtual void OnForwardScrollUpdateToMainThreadOnImpl() OVERRIDE {
+ virtual void OnForwardScrollUpdateToMainThreadOnImpl() override {
(*forward_to_main_count_)++;
}
@@ -6715,7 +6743,7 @@
class LayerTreeHostImplWithTopControlsTest : public LayerTreeHostImplTest {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
LayerTreeSettings settings = DefaultSettings();
settings.calculate_top_controls_position = true;
settings.top_controls_height = top_controls_height_;
@@ -7034,7 +7062,7 @@
class LayerTreeHostImplWithImplicitLimitsTest : public LayerTreeHostImplTest {
public:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
LayerTreeSettings settings = DefaultSettings();
settings.max_memory_for_prepaint_percentage = 50;
CreateHostImpl(settings, CreateOutputSurface());
@@ -7225,7 +7253,7 @@
class LayerTreeHostImplCountingLostSurfaces : public LayerTreeHostImplTest {
public:
LayerTreeHostImplCountingLostSurfaces() : num_lost_surfaces_(0) {}
- virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {
+ virtual void DidLoseOutputSurfaceOnImplThread() override {
num_lost_surfaces_++;
}
diff --git a/cc/trees/layer_tree_host_perftest.cc b/cc/trees/layer_tree_host_perftest.cc
index 6e43ddf..a516a50 100644
--- a/cc/trees/layer_tree_host_perftest.cc
+++ b/cc/trees/layer_tree_host_perftest.cc
@@ -44,34 +44,34 @@
measure_commit_cost_(false) {
}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->throttle_frame_production = false;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
BuildTree();
PostSetNeedsCommitToMainThread();
}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
if (begin_frame_driven_drawing_ && !TestEnded()) {
layer_tree_host()->SetNeedsAnimate();
layer_tree_host()->SetNextCommitForcesRedraw();
}
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
if (measure_commit_cost_)
commit_timer_.Start();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
if (measure_commit_cost_ && draw_timer_.IsWarmedUp()) {
commit_timer_.NextLap();
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (TestEnded() || CleanUpStarted())
return;
draw_timer_.NextLap();
@@ -91,7 +91,7 @@
virtual void BuildTree() {}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
CHECK(!test_name_.empty()) << "Must SetTestName() before AfterTest().";
perf_test::PrintResult("layer_tree_host_frame_time", "", test_name_,
1000 * draw_timer_.MsPerLap(), "us", true);
@@ -131,7 +131,7 @@
ASSERT_TRUE(base::ReadFileToString(json_file, &json_));
}
- virtual void BuildTree() OVERRIDE {
+ virtual void BuildTree() override {
gfx::Size viewport = gfx::Size(720, 1038);
layer_tree_host()->SetViewportSize(viewport);
scoped_refptr<Layer> root = ParseTreeFromJson(json_,
@@ -178,7 +178,7 @@
class LayerTreeHostPerfTestLeafInvalidates
: public LayerTreeHostPerfTestJsonReader {
public:
- virtual void BuildTree() OVERRIDE {
+ virtual void BuildTree() override {
LayerTreeHostPerfTestJsonReader::BuildTree();
// Find a leaf layer.
@@ -188,7 +188,7 @@
}
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
if (TestEnded())
return;
@@ -221,13 +221,13 @@
: LayerTreeHostPerfTestJsonReader() {
}
- virtual void BuildTree() OVERRIDE {
+ virtual void BuildTree() override {
LayerTreeHostPerfTestJsonReader::BuildTree();
scrollable_ = layer_tree_host()->root_layer()->children()[1];
ASSERT_TRUE(scrollable_.get());
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
if (TestEnded())
return;
static const gfx::Vector2d delta = gfx::Vector2d(0, 10);
@@ -262,7 +262,7 @@
next_sync_point_(1),
clean_up_started_(false) {}
- virtual void BuildTree() OVERRIDE {
+ virtual void BuildTree() override {
LayerTreeHostPerfTestJsonReader::BuildTree();
tab_contents_ =
static_cast<TextureLayer*>(
@@ -273,7 +273,7 @@
ASSERT_TRUE(tab_contents_.get());
}
- virtual void WillCommit() OVERRIDE {
+ virtual void WillCommit() override {
if (CleanUpStarted())
return;
gpu::Mailbox gpu_mailbox;
@@ -289,13 +289,13 @@
tab_contents_->SetTextureMailbox(mailbox, callback.Pass());
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (CleanUpStarted())
return;
layer_tree_host()->SetNeedsCommit();
}
- virtual void CleanUpAndEndTest(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CleanUpAndEndTest(LayerTreeHostImpl* host_impl) override {
clean_up_started_ = true;
MainThreadTaskRunner()->PostTask(
FROM_HERE,
@@ -310,7 +310,7 @@
EndTest();
}
- virtual bool CleanUpStarted() OVERRIDE { return clean_up_started_; }
+ virtual bool CleanUpStarted() override { return clean_up_started_; }
private:
scoped_refptr<TextureLayer> tab_contents_;
diff --git a/cc/trees/layer_tree_host_pixeltest_filters.cc b/cc/trees/layer_tree_host_pixeltest_filters.cc
index 5303ed1..4afc4ec 100644
--- a/cc/trees/layer_tree_host_pixeltest_filters.cc
+++ b/cc/trees/layer_tree_host_pixeltest_filters.cc
@@ -159,12 +159,12 @@
class LayerTreeHostFiltersScaledPixelTest
: public LayerTreeHostFiltersPixelTest {
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// Required so that device scale is inherited by content scale.
settings->layer_transforms_should_scale_layer_contents = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_);
LayerTreePixelTest::SetupTree();
}
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index 5d5022f..bd32119 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -22,14 +22,14 @@
MaskContentLayerClient() {}
virtual ~MaskContentLayerClient() {}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
+ virtual void DidChangeLayerCanUseLCDText() override {}
- virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+ virtual bool FillsBoundsCompletely() const override { return false; }
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& rect,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+ ContentLayerClient::GraphicsContextStatus gc_status) override {
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
paint.setStrokeWidth(SkIntToScalar(2));
diff --git a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
index 64b8bc3..fa94b0e 100644
--- a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
+++ b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
@@ -8,7 +8,6 @@
#include "cc/layers/picture_layer_impl.h"
#include "cc/quads/draw_quad.h"
#include "cc/test/layer_tree_pixel_test.h"
-#include "cc/test/mock_occlusion_tracker.h"
#include "cc/trees/layer_tree_impl.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
@@ -22,11 +21,11 @@
class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
// Not enough memory available. Enforce on-demand rasterization.
impl->SetMemoryPolicy(
ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
@@ -34,23 +33,20 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
// Find the PictureLayerImpl ask it to append quads to check their material.
// The PictureLayerImpl is assumed to be the first child of the root layer
// in the active tree.
PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>(
host_impl->active_tree()->root_layer()->child_at(0));
- MockOcclusionTracker<LayerImpl> occlusion_tracker;
scoped_ptr<RenderPass> render_pass = RenderPass::Create();
AppendQuadsData data;
- picture_layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
+ picture_layer->AppendQuads(render_pass.get(), Occlusion(), &data);
- for (QuadList::Iterator iter = render_pass->quad_list.begin();
- iter != render_pass->quad_list.end();
- ++iter)
- EXPECT_EQ(iter->material, DrawQuad::PICTURE_CONTENT);
+ for (const auto& quad : render_pass->quad_list)
+ EXPECT_EQ(quad.material, DrawQuad::PICTURE_CONTENT);
// Triggers pixel readback and ends the test.
LayerTreePixelTest::SwapBuffersOnThread(host_impl, result);
@@ -64,14 +60,14 @@
explicit BlueYellowLayerClient(gfx::Rect layer_rect)
: layer_rect_(layer_rect) {}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE { }
+ virtual void DidChangeLayerCanUseLCDText() override { }
- virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+ virtual bool FillsBoundsCompletely() const override { return false; }
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+ ContentLayerClient::GraphicsContextStatus gc_status) override {
SkPaint paint;
paint.setColor(SK_ColorBLUE);
canvas->drawRect(SkRect::MakeWH(layer_rect_.width(),
@@ -113,7 +109,7 @@
class LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced
: public LayerTreeHostOnDemandRasterPixelTest {
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
LayerTreeHostOnDemandRasterPixelTest::InitializeSettings(settings);
settings->gpu_rasterization_forced = true;
}
diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc
index bbf9668..1b7679b 100644
--- a/cc/trees/layer_tree_host_pixeltest_readback.cc
+++ b/cc/trees/layer_tree_host_pixeltest_readback.cc
@@ -24,7 +24,7 @@
LayerTreeHostReadbackPixelTest()
: insert_copy_request_after_frame_count_(0) {}
- virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest() OVERRIDE {
+ virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest() override {
scoped_ptr<CopyOutputRequest> request;
switch (test_type_) {
@@ -51,7 +51,7 @@
return request.Pass();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
if (insert_copy_request_after_frame_count_ == 0) {
Layer* const target =
readback_target_ ? readback_target_ : layer_tree_host()->root_layer();
@@ -60,7 +60,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
if (insert_copy_request_after_frame_count_ ==
layer_tree_host()->source_frame_number()) {
Layer* const target =
@@ -920,17 +920,17 @@
green_client_(SK_ColorGREEN),
blue_client_(SK_ColorBLUE) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// Cause the device scale factor to be inherited by contents scales.
settings->layer_transforms_should_scale_layer_contents = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_);
LayerTreePixelTest::SetupTree();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_EQ(device_scale_factor_,
host_impl->active_tree()->device_scale_factor());
}
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 054449f..be5967c 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -18,6 +18,7 @@
#include "cc/layers/painted_scrollbar_layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/layers/solid_color_layer.h"
+#include "cc/layers/video_layer.h"
#include "cc/output/begin_frame_args.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/copy_output_request.h"
@@ -38,6 +39,7 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_proxy.h"
#include "cc/test/fake_scoped_ui_resource.h"
+#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/test_shared_bitmap_manager.h"
@@ -73,22 +75,22 @@
public:
LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
PostSetNeedsCommitToMainThread();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
num_draws_++;
if (!impl->active_tree()->source_frame_number())
EndTest();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
num_commits_++;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_LE(1, num_commits_);
EXPECT_LE(1, num_draws_);
}
@@ -106,13 +108,13 @@
public:
LayerTreeHostTestSetNeedsCommit2() : num_commits_(0), num_draws_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
++num_draws_;
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
++num_commits_;
switch (num_commits_) {
case 1:
@@ -126,7 +128,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(2, num_commits_);
EXPECT_LE(1, num_draws_);
}
@@ -141,7 +143,7 @@
// Verify that we pass property values in PushPropertiesTo.
class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
layer_tree_host()->SetRootLayer(root);
@@ -156,16 +158,16 @@
DONE,
};
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
index_ = STARTUP;
PostSetNeedsCommitToMainThread();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
VerifyAfterValues(impl->active_tree()->root_layer());
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
SetBeforeValues(layer_tree_host()->root_layer());
VerifyBeforeValues(layer_tree_host()->root_layer());
@@ -178,7 +180,7 @@
SetAfterValues(layer_tree_host()->root_layer());
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
void VerifyBeforeValues(Layer* layer) {
EXPECT_EQ(gfx::Size(10, 10).ToString(), layer->bounds().ToString());
@@ -237,9 +239,9 @@
public:
LayerTreeHostTestSetNeedsRedraw() : num_commits_(0), num_draws_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
EXPECT_EQ(0, impl->active_tree()->source_frame_number());
if (!num_draws_) {
// Redraw again to verify that the second redraw doesn't commit.
@@ -250,12 +252,12 @@
num_draws_++;
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
EXPECT_EQ(0, num_draws_);
num_commits_++;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_GE(2, num_draws_);
EXPECT_EQ(1, num_commits_);
}
@@ -277,7 +279,7 @@
invalid_rect_(10, 10, 20, 20),
root_layer_(ContentLayer::Create(&client_)) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(bounds_);
layer_tree_host()->SetRootLayer(root_layer_);
@@ -288,7 +290,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
gfx::RectF root_damage_rect;
@@ -306,7 +308,7 @@
return draw_result;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (!num_draws_) {
PostSetNeedsRedrawRectToMainThread(invalid_rect_);
} else {
@@ -315,7 +317,7 @@
num_draws_++;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(2, num_draws_); }
+ virtual void AfterTest() override { EXPECT_EQ(2, num_draws_); }
private:
int num_draws_;
@@ -329,11 +331,11 @@
class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->layer_transforms_should_scale_layer_contents = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_ = Layer::Create();
root_layer_->SetBounds(gfx::Size(10, 20));
@@ -345,14 +347,14 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() == 1)
EndTest();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// Changing the device scale factor causes a commit. It also changes
@@ -366,7 +368,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(gfx::Size(4, 4).ToString(),
scaled_layer_->content_bounds().ToString());
}
@@ -382,11 +384,11 @@
class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
: public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->layer_transforms_should_scale_layer_contents = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_ = Layer::Create();
root_layer_->SetBounds(gfx::Size(10, 20));
@@ -403,14 +405,14 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() == 1)
EndTest();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// Changing the device scale factor causes a commit. It also changes
@@ -424,7 +426,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(gfx::Size(40, 40).ToString(),
scrollbar_->content_bounds().ToString());
}
@@ -446,7 +448,7 @@
invalid_rect_(10, 10, 20, 20),
root_layer_(ContentLayer::Create(&client_)) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(bounds_);
layer_tree_host()->SetRootLayer(root_layer_);
@@ -454,7 +456,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
if (num_draws_ == 3 && host_impl->settings().impl_side_painting)
host_impl->SetNeedsRedrawRect(invalid_rect_);
}
@@ -462,7 +464,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
gfx::RectF root_damage_rect;
@@ -490,7 +492,7 @@
return draw_result;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
switch (num_draws_) {
case 0:
case 1:
@@ -517,7 +519,7 @@
num_draws_++;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(5, num_draws_); }
+ virtual void AfterTest() override { EXPECT_EQ(5, num_draws_); }
private:
int num_draws_;
@@ -536,7 +538,7 @@
LayerTreeHostTestUndrawnLayersDamageLater()
: root_layer_(ContentLayer::Create(&client_)) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(gfx::Size(50, 50));
layer_tree_host()->SetRootLayer(root_layer_);
@@ -555,12 +557,12 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
gfx::RectF root_damage_rect;
@@ -588,7 +590,7 @@
return draw_result;
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// Test not owning the surface.
@@ -610,7 +612,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -630,7 +632,7 @@
LayerTreeHostTestUndrawnLayersPushContentBoundsLater()
: root_layer_(Layer::Create()) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_->SetIsDrawable(true);
root_layer_->SetBounds(gfx::Size(20, 20));
layer_tree_host()->SetRootLayer(root_layer_);
@@ -647,9 +649,9 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
LayerImpl* root = host_impl->active_tree()->root_layer();
LayerImpl* parent = root->children()[0];
LayerImpl* child = parent->children()[0];
@@ -669,7 +671,7 @@
}
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
parent_layer_->SetOpacity(1.0f);
@@ -681,7 +683,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
scoped_refptr<Layer> root_layer_;
@@ -698,21 +700,21 @@
public:
LayerTreeHostTestCommit() {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
layer_tree_host()->set_background_color(SK_ColorGRAY);
PostSetNeedsCommitToMainThread();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize());
EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color());
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
};
MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
@@ -726,20 +728,20 @@
LayerTreeHostTestFrameTimeUpdatesAfterActivationFails()
: frame_count_with_pending_tree_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
layer_tree_host()->set_background_color(SK_ColorGRAY);
PostSetNeedsCommitToMainThread();
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
EXPECT_EQ(frame_count_with_pending_tree_, 0);
impl->BlockNotifyReadyToActivateForTesting(true);
}
virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
- const BeginFrameArgs& args) OVERRIDE {
+ const BeginFrameArgs& args) override {
if (impl->pending_tree())
frame_count_with_pending_tree_++;
@@ -751,7 +753,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (frame_count_with_pending_tree_ > 1) {
EXPECT_NE(first_frame_time_.ToInternalValue(), 0);
EXPECT_NE(first_frame_time_.ToInternalValue(),
@@ -763,12 +765,12 @@
EXPECT_FALSE(impl->settings().impl_side_painting);
EndTest();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
if (impl->settings().impl_side_painting)
EXPECT_NE(frame_count_with_pending_tree_, 1);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int frame_count_with_pending_tree_;
@@ -784,14 +786,14 @@
public:
LayerTreeHostTestFrameTimeUpdatesAfterDraw() : frame_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
layer_tree_host()->set_background_color(SK_ColorGRAY);
PostSetNeedsCommitToMainThread();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
frame_++;
if (frame_ == 1) {
first_frame_time_ = impl->CurrentBeginFrameArgs().frame_time;
@@ -809,7 +811,7 @@
EndTest();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
// Ensure there isn't a commit between the two draws, to ensure that a
// commit isn't required for updating the current frame time. We can
// only check for this in the multi-threaded case, since in the single-
@@ -818,7 +820,7 @@
EXPECT_EQ(0, frame_);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int frame_;
@@ -833,7 +835,7 @@
public:
LayerTreeHostTestStartPageScaleAnimation() {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
if (layer_tree_host()->settings().impl_side_painting) {
@@ -859,18 +861,18 @@
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float) OVERRIDE {
+ float) override {
gfx::ScrollOffset offset = scroll_layer_->scroll_offset();
scroll_layer_->SetScrollOffset(ScrollOffsetWithDelta(offset,
scroll_delta));
layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
// We get one commit before the first draw, and the animation doesn't happen
// until the second draw.
switch (impl->active_tree()->source_frame_number()) {
@@ -890,7 +892,7 @@
}
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
layer_tree_host()->StartPageScaleAnimation(
@@ -899,7 +901,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_refptr<Layer> scroll_layer_;
@@ -911,7 +913,7 @@
public:
LayerTreeHostTestSetVisible() : num_draws_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
PostSetVisibleToMainThread(false);
// This is suppressed while we're invisible.
@@ -920,13 +922,13 @@
PostSetVisibleToMainThread(true);
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
EXPECT_TRUE(impl->visible());
++num_draws_;
EndTest();
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(1, num_draws_); }
+ virtual void AfterTest() override { EXPECT_EQ(1, num_draws_); }
private:
int num_draws_;
@@ -943,13 +945,13 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+ ContentLayerClient::GraphicsContextStatus gc_status) override {
// Set layer opacity to 0.
if (test_layer_)
test_layer_->SetOpacity(0.f);
}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
- virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+ virtual void DidChangeLayerCanUseLCDText() override {}
+ virtual bool FillsBoundsCompletely() const override { return false; }
private:
Layer* test_layer_;
@@ -966,7 +968,7 @@
void ResetPaintContentsCount() { paint_contents_count_ = 0; }
virtual bool Update(ResourceUpdateQueue* queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE {
+ const OcclusionTracker<Layer>* occlusion) override {
bool updated = ContentLayer::Update(queue, occlusion);
paint_contents_count_++;
return updated;
@@ -994,18 +996,18 @@
test_opacity_change_delegate_.SetTestLayer(update_check_layer_.get());
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
layer_tree_host()->root_layer()->AddChild(update_check_layer_);
PostSetNeedsCommitToMainThread();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Update() should have been called once.
EXPECT_EQ(1, update_check_layer_->PaintContentsCount());
}
@@ -1026,7 +1028,7 @@
virtual void CalculateContentsScale(float ideal_contents_scale,
float* contents_scale_x,
float* contents_scale_y,
- gfx::Size* contentBounds) OVERRIDE {
+ gfx::Size* contentBounds) override {
// Skip over the ContentLayer's method to the base Layer class.
Layer::CalculateContentsScale(ideal_contents_scale,
contents_scale_x,
@@ -1047,7 +1049,7 @@
: root_layer_(NoScaleContentLayer::Create(&client_)),
child_layer_(ContentLayer::Create(&client_)) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(60, 60));
layer_tree_host()->SetDeviceScaleFactor(1.5);
EXPECT_EQ(gfx::Size(60, 60), layer_tree_host()->device_viewport_size());
@@ -1066,7 +1068,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
// Should only do one commit.
EXPECT_EQ(0, impl->active_tree()->source_frame_number());
// Device scale factor should come over to impl.
@@ -1132,7 +1134,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -1145,7 +1147,7 @@
// Verify atomicity of commits and reuse of textures.
class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->texture_id_allocation_chunk_size = 1;
// Make sure partial texture updates are turned off.
settings->max_partial_texture_updates = 0;
@@ -1153,7 +1155,7 @@
settings->scrollbar_animator = LayerTreeSettings::NoAnimator;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
layer_ = FakeContentLayer::Create(&client_);
layer_->SetBounds(gfx::Size(10, 20));
@@ -1170,12 +1172,12 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
drew_frame_ = -1;
PostSetNeedsCommitToMainThread();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
ASSERT_EQ(0u, layer_tree_host()->settings().max_partial_texture_updates);
TestWebGraphicsContext3D* context = TestContext();
@@ -1216,7 +1218,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
TestWebGraphicsContext3D* context = TestContext();
if (drew_frame_ == impl->active_tree()->source_frame_number()) {
@@ -1233,12 +1235,12 @@
PostSetNeedsCommitToMainThread();
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
layer_->SetNeedsDisplay();
scrollbar_->SetNeedsDisplay();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
protected:
FakeContentLayerClient client_;
@@ -1253,7 +1255,7 @@
class LayerTreeHostTestDelegatingRendererAtomicCommit
: public LayerTreeHostTestDirectRendererAtomicCommit {
public:
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
ASSERT_EQ(0u, layer_tree_host()->settings().max_partial_texture_updates);
TestWebGraphicsContext3D* context = TestContext();
@@ -1320,7 +1322,7 @@
class LayerTreeHostTestAtomicCommitWithPartialUpdate
: public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->texture_id_allocation_chunk_size = 1;
// Allow one partial texture update.
settings->max_partial_texture_updates = 1;
@@ -1328,7 +1330,7 @@
settings->impl_side_painting = false;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
parent_ = FakeContentLayer::Create(&client_);
parent_->SetBounds(gfx::Size(10, 20));
@@ -1342,9 +1344,9 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
parent_->SetNeedsDisplay();
@@ -1371,7 +1373,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
ASSERT_EQ(1u, layer_tree_host()->settings().max_partial_texture_updates);
TestWebGraphicsContext3D* context = TestContext();
@@ -1461,7 +1463,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
EXPECT_LT(impl->active_tree()->source_frame_number(), 5);
TestWebGraphicsContext3D* context = TestContext();
@@ -1478,7 +1480,7 @@
context->ResetUsedTextures();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -1493,7 +1495,7 @@
class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
: public LayerTreeHostTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_ = FakeContentLayer::Create(&client_);
root_layer_->SetBounds(gfx::Size(100, 100));
@@ -1519,9 +1521,9 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
Renderer* renderer = host_impl->renderer();
RenderPassId surface1_render_pass_id = host_impl->active_tree()
->root_layer()
@@ -1558,12 +1560,12 @@
}
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
if (layer_tree_host()->source_frame_number() < 2)
root_layer_->SetNeedsDisplay();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_LE(2u, root_layer_->update_count());
EXPECT_LE(2u, surface_layer1_->update_count());
EXPECT_LE(2u, surface_layer2_->update_count());
@@ -1588,13 +1590,13 @@
}
virtual bool Update(ResourceUpdateQueue*,
- const OcclusionTracker<Layer>*) OVERRIDE;
- virtual bool DrawsContent() const OVERRIDE { return true; }
+ const OcclusionTracker<Layer>*) override;
+ virtual bool DrawsContent() const override { return true; }
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE;
- virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE;
- virtual void SetTexturePriorities(const PriorityCalculator&) OVERRIDE;
+ override;
+ virtual void PushPropertiesTo(LayerImpl* impl) override;
+ virtual void SetTexturePriorities(const PriorityCalculator&) override;
bool HaveBackingTexture() const {
return texture_.get() ? texture_->have_backing_texture() : false;
@@ -1626,8 +1628,8 @@
virtual ~EvictionTestLayerImpl() {}
virtual void AppendQuads(RenderPass* render_pass,
- const OcclusionTracker<LayerImpl>& occlusion_tracker,
- AppendQuadsData* append_quads_data) OVERRIDE {
+ const Occlusion& occlusion_in_content_space,
+ AppendQuadsData* append_quads_data) override {
ASSERT_TRUE(has_texture_);
ASSERT_NE(0u, layer_tree_impl()->resource_provider()->num_resources());
}
@@ -1681,7 +1683,7 @@
impl_for_evict_textures_(0),
num_commits_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetRootLayer(layer_);
layer_tree_host()->SetViewportSize(gfx::Size(10, 20));
@@ -1731,7 +1733,7 @@
// the beginFrame/commit pair.
// Commits 5+6 test the path where an eviction happens during the eviction
// recovery path.
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (num_commits_) {
case 1:
EXPECT_TRUE(layer_->HaveBackingTexture());
@@ -1759,11 +1761,11 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
impl_for_evict_textures_ = impl;
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
++num_commits_;
switch (num_commits_) {
case 1:
@@ -1792,7 +1794,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -1808,7 +1810,7 @@
LayerTreeHostTestContinuousInvalidate()
: num_commit_complete_(0), num_draw_layers_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10));
@@ -1821,24 +1823,24 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
if (num_draw_layers_ == 2)
return;
content_layer_->SetNeedsDisplay();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
if (num_draw_layers_ == 1)
num_commit_complete_++;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
num_draw_layers_++;
if (num_draw_layers_ == 2)
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Check that we didn't commit twice between first and second draw.
EXPECT_EQ(1, num_commit_complete_);
}
@@ -1857,14 +1859,14 @@
LayerTreeHostTestDeferCommits()
: num_commits_deferred_(0), num_complete_commits_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidDeferCommit() OVERRIDE {
+ virtual void DidDeferCommit() override {
num_commits_deferred_++;
layer_tree_host()->SetDeferCommits(false);
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
num_complete_commits_++;
switch (num_complete_commits_) {
case 1:
@@ -1881,7 +1883,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(1, num_commits_deferred_);
EXPECT_EQ(2, num_complete_commits_);
}
@@ -2054,7 +2056,7 @@
child_layer2_(FakeContentLayer::Create(&client_)),
num_commits_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size(100, 100));
root_layer_->SetBounds(gfx::Size(100, 100));
child_layer1_->SetBounds(gfx::Size(100, 100));
@@ -2066,7 +2068,7 @@
}
virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
- bool visible) OVERRIDE {
+ bool visible) override {
if (visible) {
// One backing should remain unevicted.
EXPECT_EQ(
@@ -2084,7 +2086,7 @@
EndTest();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
++num_commits_;
switch (num_commits_) {
case 1:
@@ -2116,7 +2118,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -2143,14 +2145,14 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+ ContentLayerClient::GraphicsContextStatus gc_status) override {
++paint_count_;
}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {
+ virtual void DidChangeLayerCanUseLCDText() override {
++lcd_notification_count_;
layer_->SetNeedsDisplay();
}
- virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+ virtual bool FillsBoundsCompletely() const override { return false; }
private:
Layer* layer_;
@@ -2158,7 +2160,7 @@
int lcd_notification_count_;
};
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root_layer;
if (layer_tree_host()->settings().impl_side_painting)
root_layer = PictureLayer::Create(&client_);
@@ -2178,10 +2180,10 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
- virtual void AfterTest() OVERRIDE {}
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+ virtual void AfterTest() override {}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// The first update consists of one LCD notification and one paint.
@@ -2226,11 +2228,11 @@
// Verify that the BeginFrame notification is used to initiate rendering.
class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->begin_frame_scheduling_enabled = true;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
// This will trigger a SetNeedsBeginFrame which will trigger a
// BeginFrame.
PostSetNeedsCommitToMainThread();
@@ -2239,12 +2241,12 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EndTest();
return DRAW_SUCCESS;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
base::TimeTicks frame_time_;
@@ -2255,14 +2257,14 @@
class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
: public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->begin_frame_scheduling_enabled = true;
settings->using_synchronous_renderer_compositor = true;
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
// The BeginFrame notification is turned off now but will get enabled
// once we return. End test while it's enabled.
ImplThreadTaskRunner()->PostTask(
@@ -2271,7 +2273,7 @@
base::Unretained(this)));
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
};
MULTI_THREAD_TEST_F(
@@ -2282,13 +2284,13 @@
LayerTreeHostTestAbortedCommitDoesntStall()
: commit_count_(0), commit_abort_count_(0), commit_complete_count_(0) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->begin_frame_scheduling_enabled = true;
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
commit_count_++;
if (commit_count_ == 4) {
// After two aborted commits, request a real commit now to make sure a
@@ -2299,13 +2301,13 @@
}
virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
- bool did_handle) OVERRIDE {
+ bool did_handle) override {
commit_abort_count_++;
// Initiate another abortable commit.
host_impl->SetNeedsCommit();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
commit_complete_count_++;
if (commit_complete_count_ == 1) {
// Initiate an abortable commit after the first commit.
@@ -2315,7 +2317,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(commit_count_, 5);
EXPECT_EQ(commit_abort_count_, 3);
EXPECT_EQ(commit_complete_count_, 2);
@@ -2328,7 +2330,7 @@
class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor
: public LayerTreeHostTestAbortedCommitDoesntStall {
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings);
settings->using_synchronous_renderer_compositor = true;
}
@@ -2339,7 +2341,7 @@
class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync
: public LayerTreeHostTestAbortedCommitDoesntStall {
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings);
settings->throttle_frame_production = false;
}
@@ -2350,11 +2352,11 @@
class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
: public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
scoped_refptr<Layer> layer = PictureLayer::Create(&client_);
@@ -2363,13 +2365,13 @@
layer_tree_host()->root_layer()->AddChild(layer);
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
};
@@ -2389,13 +2391,13 @@
virtual void PaintContents(
SkCanvas* canvas,
const gfx::Rect& clip,
- ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+ ContentLayerClient::GraphicsContextStatus gc_status) override {
layer_->SetBounds(gfx::Size(2, 2));
}
- virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
+ virtual void DidChangeLayerCanUseLCDText() override {}
- virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+ virtual bool FillsBoundsCompletely() const override { return false; }
private:
Layer* layer_;
@@ -2403,7 +2405,7 @@
LayerTreeHostTestChangeLayerPropertiesInPaintContents() : num_commits_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
root_layer->SetIsDrawable(true);
root_layer->SetBounds(gfx::Size(1, 1));
@@ -2414,10 +2416,10 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
- virtual void AfterTest() OVERRIDE {}
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+ virtual void AfterTest() override {}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
num_commits_++;
if (num_commits_ == 1) {
LayerImpl* root_layer = host_impl->active_tree()->root_layer();
@@ -2443,7 +2445,7 @@
test_capabilities_.gpu.texture_rectangle = true;
}
- virtual GLuint createTexture() OVERRIDE {
+ virtual GLuint createTexture() override {
return 1;
}
MOCK_METHOD1(activeTexture, void(GLenum texture));
@@ -2469,7 +2471,7 @@
class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
protected:
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
scoped_ptr<MockIOSurfaceWebGraphicsContext3D> mock_context_owned(
new MockIOSurfaceWebGraphicsContext3D);
mock_context_ = mock_context_owned.get();
@@ -2480,7 +2482,7 @@
return FakeOutputSurface::Create3d(mock_context_owned.Pass());
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
layer_tree_host()->root_layer()->SetIsDrawable(false);
@@ -2496,9 +2498,9 @@
layer_tree_host()->root_layer()->AddChild(io_surface_layer);
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_EQ(0u, host_impl->resource_provider()->num_resources());
// In WillDraw, the IOSurfaceLayer sets up the io surface texture.
@@ -2539,7 +2541,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
Mock::VerifyAndClearExpectations(&mock_context_);
ResourceProvider* resource_provider = host_impl->resource_provider();
EXPECT_EQ(1u, resource_provider->num_resources());
@@ -2571,14 +2573,14 @@
return draw_result;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
Mock::VerifyAndClearExpectations(&mock_context_);
EXPECT_CALL(*mock_context_, deleteTexture(1)).Times(AtLeast(1));
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int io_surface_id_;
MockIOSurfaceWebGraphicsContext3D* mock_context_;
@@ -2589,7 +2591,7 @@
class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
frame_ = 0;
PostSetNeedsCommitToMainThread();
}
@@ -2598,7 +2600,7 @@
// Round 2: commit only (no draw/swap)
// Round 3: draw only (no commit)
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
int commit = layer_tree_host()->source_frame_number();
switch (commit) {
case 2:
@@ -2609,7 +2611,7 @@
}
}
- virtual void DidCompleteSwapBuffers() OVERRIDE {
+ virtual void DidCompleteSwapBuffers() override {
int commit = layer_tree_host()->source_frame_number();
++frame_;
switch (frame_) {
@@ -2626,7 +2628,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
protected:
int frame_;
@@ -2643,12 +2645,12 @@
class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// PictureLayer can only be used with impl side painting enabled.
settings->impl_side_painting = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
layer_ = FakePictureLayer::Create(&client_);
// Force commits to not be aborted so new frames get drawn, otherwise
// the renderer gets deferred initialized but nothing new needs drawing.
@@ -2657,7 +2659,7 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
did_initialize_gl_ = false;
did_release_gl_ = false;
last_source_frame_number_drawn_ = -1; // Never drawn.
@@ -2665,7 +2667,7 @@
}
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
scoped_ptr<TestWebGraphicsContext3D> context3d(
TestWebGraphicsContext3D::Create());
@@ -2674,7 +2676,7 @@
delegating_renderer());
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
ASSERT_TRUE(host_impl->RootLayer());
FakePictureLayerImpl* layer_impl =
static_cast<FakePictureLayerImpl*>(host_impl->RootLayer());
@@ -2731,7 +2733,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ASSERT_TRUE(result);
DelegatedFrameData* delegated_frame_data =
output_surface()->last_sent_frame().delegated_frame_data.get();
@@ -2748,7 +2750,7 @@
host_impl->ReclaimResources(&ack);
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_TRUE(did_initialize_gl_);
EXPECT_TRUE(did_release_gl_);
}
@@ -2765,7 +2767,7 @@
class LayerTreeHostTestDeferredInitializeWithGpuRasterization
: public LayerTreeHostTestDeferredInitialize {
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// PictureLayer can only be used with impl side painting enabled.
settings->impl_side_painting = true;
settings->gpu_rasterization_enabled = true;
@@ -2780,13 +2782,13 @@
public:
LayerTreeHostTestUIResource() : num_ui_resources_(0) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->texture_id_allocation_chunk_size = 1;
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
int frame = layer_tree_host()->source_frame_number();
switch (frame) {
case 1:
@@ -2847,17 +2849,17 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
if (!layer_tree_host()->settings().impl_side_painting)
PerformTest(impl);
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
if (layer_tree_host()->settings().impl_side_painting)
PerformTest(impl);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
// Must clear all resources before exiting.
@@ -2886,7 +2888,7 @@
virtual ~PushPropertiesCountingLayerImpl() {}
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE {
+ virtual void PushPropertiesTo(LayerImpl* layer) override {
LayerImpl::PushPropertiesTo(layer);
push_properties_count_++;
// Push state to the active tree because we can only access it from there.
@@ -2895,7 +2897,7 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE {
+ override {
return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
}
@@ -2918,7 +2920,7 @@
return new PushPropertiesCountingLayer();
}
- virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE {
+ virtual void PushPropertiesTo(LayerImpl* layer) override {
Layer::PushPropertiesTo(layer);
push_properties_count_++;
if (persist_needs_push_properties_)
@@ -2926,7 +2928,7 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE {
+ override {
return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
}
@@ -2952,7 +2954,7 @@
class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
protected:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
num_commits_ = 0;
expected_push_properties_root_ = 0;
expected_push_properties_child_ = 0;
@@ -2963,7 +2965,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = PushPropertiesCountingLayer::Create();
child_ = PushPropertiesCountingLayer::Create();
child2_ = PushPropertiesCountingLayer::Create();
@@ -2982,7 +2984,7 @@
LayerTreeHostTest::SetupTree();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
++num_commits_;
EXPECT_EQ(expected_push_properties_root_, root_->push_properties_count());
@@ -3122,7 +3124,7 @@
++expected_push_properties_leaf_layer_;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int num_commits_;
FakeContentLayerClient client_;
@@ -3145,7 +3147,7 @@
class LayerTreeHostTestImplLayersPushProperties
: public LayerTreeHostTestLayersPushProperties {
protected:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
expected_push_properties_root_impl_ = 0;
expected_push_properties_child_impl_ = 0;
expected_push_properties_grandchild_impl_ = 0;
@@ -3154,7 +3156,7 @@
LayerTreeHostTestLayersPushProperties::BeginTest();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
// These commits are in response to the changes made in
// LayerTreeHostTestLayersPushProperties::DidCommitAndDrawFrame()
switch (num_commits_) {
@@ -3345,9 +3347,9 @@
class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
: public LayerTreeHostTest {
protected:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = Layer::Create();
root_->SetBounds(gfx::Size(1, 1));
@@ -3362,7 +3364,7 @@
LayerTreeHostTest::SetupTree();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 0:
break;
@@ -3391,7 +3393,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
scoped_refptr<Layer> root_;
scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer_;
@@ -3401,9 +3403,9 @@
class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
protected:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = PushPropertiesCountingLayer::Create();
child_ = PushPropertiesCountingLayer::Create();
root_->AddChild(child_);
@@ -3412,7 +3414,7 @@
LayerTreeHostTest::SetupTree();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 0:
break;
@@ -3444,7 +3446,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
scoped_refptr<PushPropertiesCountingLayer> root_;
scoped_refptr<PushPropertiesCountingLayer> child_;
@@ -3455,7 +3457,7 @@
class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
: public LayerTreeHostTest {
protected:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
expected_push_properties_root_ = 0;
expected_push_properties_child_ = 0;
expected_push_properties_grandchild1_ = 0;
@@ -3464,7 +3466,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = PushPropertiesCountingLayer::Create();
child_ = PushPropertiesCountingLayer::Create();
grandchild1_ = PushPropertiesCountingLayer::Create();
@@ -3480,7 +3482,7 @@
LayerTreeHostTest::SetupTree();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_refptr<PushPropertiesCountingLayer> root_;
@@ -3498,7 +3500,7 @@
class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
protected:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
@@ -3538,7 +3540,7 @@
class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
protected:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
@@ -3621,7 +3623,7 @@
class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
protected:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
@@ -3669,7 +3671,7 @@
class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
protected:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
@@ -3737,7 +3739,7 @@
class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
protected:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
@@ -3801,7 +3803,7 @@
class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent
: public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
protected:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
switch (last_source_frame_number) {
case 0:
@@ -3868,7 +3870,7 @@
LayerTreeHostTestTreeActivationCallback()
: num_commits_(0), callback_count_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
EXPECT_TRUE(HasImplThread());
PostSetNeedsCommitToMainThread();
}
@@ -3876,7 +3878,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
++num_commits_;
switch (num_commits_) {
case 1:
@@ -3905,7 +3907,7 @@
host_impl, frame_data, draw_result);
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(3, num_commits_); }
+ virtual void AfterTest() override { EXPECT_EQ(3, num_commits_); }
void SetCallback(bool enable) {
output_surface()->SetTreeActivationCallback(
@@ -3934,7 +3936,7 @@
public:
LayerInvalidateCausesDraw() : num_commits_(0), num_draws_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
ASSERT_TRUE(!!invalidate_layer_.get())
<< "Derived tests must set this in SetupTree";
@@ -3942,23 +3944,23 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
// After commit, invalidate the layer. This should cause a commit.
if (layer_tree_host()->source_frame_number() == 1)
invalidate_layer_->SetNeedsDisplay();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
num_draws_++;
if (impl->active_tree()->source_frame_number() == 1)
EndTest();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
num_commits_++;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_GE(2, num_commits_);
EXPECT_GE(2, num_draws_);
}
@@ -3971,13 +3973,35 @@
int num_draws_;
};
+// VideoLayer must support being invalidated and then passing that along
+// to the compositor thread, even though no resources are updated in
+// response to that invalidation.
+class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw {
+ public:
+ virtual void SetupTree() override {
+ LayerTreeHostTest::SetupTree();
+ scoped_refptr<VideoLayer> video_layer =
+ VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0);
+ video_layer->SetBounds(gfx::Size(10, 10));
+ video_layer->SetIsDrawable(true);
+ layer_tree_host()->root_layer()->AddChild(video_layer);
+
+ invalidate_layer_ = video_layer;
+ }
+
+ private:
+ FakeVideoFrameProvider provider_;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
+
// IOSurfaceLayer must support being invalidated and then passing that along
// to the compositor thread, even though no resources are updated in
// response to that invalidation.
class LayerTreeHostTestIOSurfaceLayerInvalidate
: public LayerInvalidateCausesDraw {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
scoped_refptr<IOSurfaceLayer> layer = IOSurfaceLayer::Create();
layer->SetBounds(gfx::Size(10, 10));
@@ -3996,7 +4020,7 @@
class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_ = Layer::Create();
root_layer_->SetPosition(gfx::Point());
root_layer_->SetBounds(gfx::Size(10, 10));
@@ -4017,9 +4041,9 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// The layer type used does not need to push properties every frame.
@@ -4039,7 +4063,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root = impl->active_tree()->root_layer();
LayerImpl* parent = root->children()[0];
LayerImpl* child = parent->children()[0];
@@ -4051,7 +4075,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
scoped_refptr<Layer> root_layer_;
scoped_refptr<SolidColorLayer> parent_layer_;
@@ -4062,11 +4086,11 @@
class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_layer_ = FakePictureLayer::Create(&client_);
root_layer_->SetBounds(gfx::Size(10, 10));
@@ -4074,21 +4098,21 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
// The viewport is empty, but we still need to update layers on the main
// thread.
layer_tree_host()->SetViewportSize(gfx::Size(0, 0));
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
// The layer should be updated even though the viewport is empty, so we
// are capable of drawing it on the impl tree.
EXPECT_GT(root_layer_->update_count(), 0u);
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_refptr<FakePictureLayer> root_layer_;
@@ -4102,7 +4126,7 @@
: num_will_begin_main_frames_(0), num_impl_commits_(0) {}
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<SolidColorLayer> root_layer = SolidColorLayer::Create();
root_layer->SetBounds(gfx::Size(200, 200));
root_layer->SetIsDrawable(true);
@@ -4111,9 +4135,9 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void WillBeginMainFrame() OVERRIDE {
+ virtual void WillBeginMainFrame() override {
num_will_begin_main_frames_++;
switch (num_will_begin_main_frames_) {
case 2:
@@ -4124,11 +4148,11 @@
}
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
num_impl_commits_++;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
switch (impl->SourceAnimationFrameNumber()) {
case 1:
// Prevent draws until commit.
@@ -4143,7 +4167,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Ensure that the commit was truly aborted.
EXPECT_EQ(2, num_will_begin_main_frames_);
EXPECT_EQ(1, num_impl_commits_);
@@ -4159,12 +4183,12 @@
class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
scoped_refptr<TestContextProvider> context_provider =
TestContextProvider::Create();
context_provider->SetMaxTransferBufferUsageBytes(1024 * 1024);
@@ -4174,7 +4198,7 @@
return FakeOutputSurface::Create3d(context_provider);
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
client_.set_fill_with_nonsolid_color(true);
scoped_refptr<FakePictureLayer> root_layer =
FakePictureLayer::Create(&client_);
@@ -4185,9 +4209,9 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
TestWebGraphicsContext3D* context = TestContext();
// Expect that the transfer buffer memory used is equal to the
@@ -4196,7 +4220,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -4211,14 +4235,14 @@
public:
LayerTreeHostTestMemoryLimits() : num_commits_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void WillCommit() OVERRIDE {
+ virtual void WillCommit() override {
// Some commits are aborted, so increment number of attempted commits here.
num_commits_++;
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (num_commits_) {
case 1:
// Verify default values.
@@ -4263,7 +4287,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
switch (num_commits_) {
case 1:
break;
@@ -4288,7 +4312,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int num_commits_;
@@ -4306,7 +4330,7 @@
second_output_surface_memory_limit_(1234321) {}
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
if (!first_context_provider_.get()) {
first_context_provider_ = TestContextProvider::Create();
} else {
@@ -4331,16 +4355,16 @@
return output_surface.Pass();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
layer_tree_host()->SetRootLayer(root_);
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
// Lost context sometimes takes two frames to recreate. The third frame
// is sometimes aborted, so wait until the fourth frame to verify that
// the memory has been set, and the fifth frame to end the test.
@@ -4352,7 +4376,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl,
- bool result) OVERRIDE {
+ bool result) override {
switch (impl->active_tree()->source_frame_number()) {
case 1:
EXPECT_EQ(first_output_surface_memory_limit_,
@@ -4368,7 +4392,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
scoped_refptr<TestContextProvider> first_context_provider_;
scoped_refptr<TestContextProvider> second_context_provider_;
@@ -4405,14 +4429,14 @@
result_->dtor_called = true;
}
- virtual void DidSwap(CompositorFrameMetadata* metadata) OVERRIDE {
+ virtual void DidSwap(CompositorFrameMetadata* metadata) override {
base::AutoLock lock(result_->lock);
EXPECT_FALSE(result_->did_swap_called);
EXPECT_FALSE(result_->did_not_swap_called);
result_->did_swap_called = true;
}
- virtual void DidNotSwap(DidNotSwapReason reason) OVERRIDE {
+ virtual void DidNotSwap(DidNotSwapReason reason) override {
base::AutoLock lock(result_->lock);
EXPECT_FALSE(result_->did_swap_called);
EXPECT_FALSE(result_->did_not_swap_called);
@@ -4420,7 +4444,7 @@
result_->reason = reason;
}
- virtual int64 TraceId() const OVERRIDE { return 0; }
+ virtual int64 TraceId() const override { return 0; }
private:
// Not owned.
@@ -4432,16 +4456,16 @@
LayerTreeHostTestBreakSwapPromise()
: commit_count_(0), commit_complete_count_(0) {}
- virtual void WillBeginMainFrame() OVERRIDE {
+ virtual void WillBeginMainFrame() override {
ASSERT_LE(commit_count_, 2);
scoped_ptr<SwapPromise> swap_promise(
new TestSwapPromise(&swap_promise_result_[commit_count_]));
layer_tree_host()->QueueSwapPromise(swap_promise.Pass());
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
commit_count_++;
if (commit_count_ == 2) {
// This commit will finish.
@@ -4449,7 +4473,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
commit_complete_count_++;
if (commit_complete_count_ == 1) {
// This commit will be aborted because no actual update.
@@ -4459,7 +4483,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// 3 commits are scheduled. 2 completes. 1 is aborted.
EXPECT_EQ(commit_count_, 3);
EXPECT_EQ(commit_complete_count_, 2);
@@ -4503,14 +4527,14 @@
class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit
: public LayerTreeHostTest {
protected:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
layer_tree_host()->SetDeferCommits(true);
layer_tree_host()->SetNeedsCommit();
}
- virtual void DidDeferCommit() OVERRIDE {
+ virtual void DidDeferCommit() override {
layer_tree_host()->SetVisible(false);
scoped_ptr<SwapPromise> swap_promise(
new TestSwapPromise(&swap_promise_result_));
@@ -4519,11 +4543,11 @@
}
virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
- bool did_handle) OVERRIDE {
+ bool did_handle) override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
{
base::AutoLock lock(swap_promise_result_.lock);
EXPECT_FALSE(swap_promise_result_.did_swap_called);
@@ -4542,16 +4566,16 @@
class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit
: public LayerTreeHostTest {
protected:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (TestEnded())
return;
layer_tree_host()->SetDeferCommits(true);
layer_tree_host()->SetNeedsCommit();
}
- virtual void DidDeferCommit() OVERRIDE {
+ virtual void DidDeferCommit() override {
layer_tree_host()->DidLoseOutputSurface();
scoped_ptr<SwapPromise> swap_promise(
new TestSwapPromise(&swap_promise_result_));
@@ -4560,7 +4584,7 @@
}
virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
- bool did_handle) OVERRIDE {
+ bool did_handle) override {
EndTest();
// This lets the test finally commit and exit.
MainThreadTaskRunner()->PostTask(
@@ -4574,7 +4598,7 @@
layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(true);
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
{
base::AutoLock lock(swap_promise_result_.lock);
EXPECT_FALSE(swap_promise_result_.did_swap_called);
@@ -4601,15 +4625,15 @@
virtual ~SimpleSwapPromiseMonitor() {}
- virtual void OnSetNeedsCommitOnMain() OVERRIDE {
+ virtual void OnSetNeedsCommitOnMain() override {
(*set_needs_commit_count_)++;
}
- virtual void OnSetNeedsRedrawOnImpl() OVERRIDE {
+ virtual void OnSetNeedsRedrawOnImpl() override {
ADD_FAILURE() << "Should not get called on main thread.";
}
- virtual void OnForwardScrollUpdateToMainThreadOnImpl() OVERRIDE {
+ virtual void OnForwardScrollUpdateToMainThreadOnImpl() override {
ADD_FAILURE() << "Should not get called on main thread.";
}
@@ -4619,9 +4643,9 @@
class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest {
public:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void WillBeginMainFrame() OVERRIDE {
+ virtual void WillBeginMainFrame() override {
if (TestEnded())
return;
@@ -4670,7 +4694,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
};
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
@@ -4678,18 +4702,18 @@
class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
: public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
ui_resource_ = FakeScopedUIResource::Create(layer_tree_host());
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
host_impl->EvictAllUIResources();
// Existence of evicted UI resources will trigger NEW_CONTENT_TAKES_PRIORITY
// mode. Active tree should require high-res to draw after entering this
@@ -4698,7 +4722,7 @@
EXPECT_TRUE(host_impl->active_tree()->RequiresHighResToDraw());
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
int frame = layer_tree_host()->source_frame_number();
switch (frame) {
case 1:
@@ -4711,7 +4735,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_ptr<FakeScopedUIResource> ui_resource_;
@@ -4722,14 +4746,14 @@
class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
EXPECT_FALSE(settings->gpu_rasterization_enabled);
EXPECT_FALSE(settings->gpu_rasterization_forced);
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_);
@@ -4738,7 +4762,7 @@
layer_tree_host()->root_layer()->AddChild(layer);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
Layer* root = layer_tree_host()->root_layer();
PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
PicturePile* pile = layer->GetPicturePileForTesting();
@@ -4758,18 +4782,18 @@
PostSetNeedsCommitToMainThread();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_FALSE(host_impl->pending_tree()->use_gpu_rasterization());
EXPECT_FALSE(host_impl->use_gpu_rasterization());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_FALSE(host_impl->active_tree()->use_gpu_rasterization());
EXPECT_FALSE(host_impl->use_gpu_rasterization());
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient layer_client_;
};
@@ -4778,14 +4802,14 @@
class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
EXPECT_FALSE(settings->gpu_rasterization_enabled);
settings->gpu_rasterization_enabled = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_);
@@ -4794,7 +4818,7 @@
layer_tree_host()->root_layer()->AddChild(layer);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
Layer* root = layer_tree_host()->root_layer();
PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
PicturePile* pile = layer->GetPicturePileForTesting();
@@ -4823,18 +4847,18 @@
PostSetNeedsCommitToMainThread();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_FALSE(host_impl->pending_tree()->use_gpu_rasterization());
EXPECT_FALSE(host_impl->use_gpu_rasterization());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_FALSE(host_impl->active_tree()->use_gpu_rasterization());
EXPECT_FALSE(host_impl->use_gpu_rasterization());
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient layer_client_;
};
@@ -4843,14 +4867,14 @@
class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
EXPECT_FALSE(settings->gpu_rasterization_forced);
settings->gpu_rasterization_forced = true;
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostTest::SetupTree();
scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_);
@@ -4859,7 +4883,7 @@
layer_tree_host()->root_layer()->AddChild(layer);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
Layer* root = layer_tree_host()->root_layer();
PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
PicturePile* pile = layer->GetPicturePileForTesting();
@@ -4888,18 +4912,18 @@
PostSetNeedsCommitToMainThread();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_TRUE(host_impl->pending_tree()->use_gpu_rasterization());
EXPECT_TRUE(host_impl->use_gpu_rasterization());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_TRUE(host_impl->active_tree()->use_gpu_rasterization());
EXPECT_TRUE(host_impl->use_gpu_rasterization());
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient layer_client_;
};
@@ -4914,7 +4938,7 @@
protected:
enum { kExpectedNumCommits = 10 };
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root_layer = Layer::Create();
root_layer->SetBounds(bounds_);
@@ -4934,7 +4958,7 @@
LayerTreeHostTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(
@@ -4952,11 +4976,11 @@
milliseconds_per_frame));
}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
child_layer_->SetNeedsDisplay();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_LE(kExpectedNumCommits, num_commits_);
EXPECT_LE(kExpectedNumCommits, num_draws_);
int update_count = content_layer_.get()
@@ -4965,12 +4989,12 @@
EXPECT_LE(kExpectedNumCommits, update_count);
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (++num_draws_ == kExpectedNumCommits)
EndTest();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
++num_commits_;
}
@@ -5004,24 +5028,24 @@
LayerTreeHostTestActivateOnInvisible()
: activation_count_(0), visible_(true) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
// Kick off the test with a commit.
PostSetNeedsCommitToMainThread();
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
// Make sure we don't activate using the notify signal from tile manager.
host_impl->BlockNotifyReadyToActivateForTesting(true);
}
- virtual void DidCommit() OVERRIDE { layer_tree_host()->SetVisible(false); }
+ virtual void DidCommit() override { layer_tree_host()->SetVisible(false); }
virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
- bool visible) OVERRIDE {
+ bool visible) override {
visible_ = visible;
// Once invisible, we can go visible again.
@@ -5033,12 +5057,12 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
++activation_count_;
EXPECT_FALSE(visible_);
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Ensure we activated even though the signal was blocked.
EXPECT_EQ(1, activation_count_);
EXPECT_TRUE(visible_);
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc
index da4acb9..593c5c7 100644
--- a/cc/trees/layer_tree_host_unittest_animation.cc
+++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -21,7 +21,7 @@
class LayerTreeHostAnimationTest : public LayerTreeTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeTest::SetupTree();
layer_tree_host()->root_layer()->set_layer_animation_delegate(this);
}
@@ -35,11 +35,11 @@
LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested()
: num_commits_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
// We skip the first commit because its the commit that populates the
// impl thread with a tree. After the second commit, the test is done.
if (num_commits_ != 1)
@@ -52,7 +52,7 @@
// verify that CommitRequested has gone back to false.
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (!num_commits_) {
EXPECT_FALSE(layer_tree_host()->CommitRequested());
layer_tree_host()->SetNeedsAnimate();
@@ -66,7 +66,7 @@
num_commits_++;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int num_commits_;
@@ -86,11 +86,11 @@
LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback()
: num_begin_frames_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
if (!num_begin_frames_) {
layer_tree_host()->SetNeedsAnimate();
num_begin_frames_++;
@@ -99,7 +99,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int num_begin_frames_;
@@ -117,13 +117,13 @@
LayerTreeHostAnimationTestAddAnimation()
: num_begin_frames_(0), received_animation_started_notification_(false) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddInstantAnimationToMainThread(layer_tree_host()->root_layer());
}
virtual void UpdateAnimationState(
LayerTreeHostImpl* host_impl,
- bool has_unfinished_animation) OVERRIDE {
+ bool has_unfinished_animation) override {
if (!num_begin_frames_) {
// The animation had zero duration so LayerTreeHostImpl should no
// longer need to animate its layers.
@@ -148,7 +148,7 @@
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
received_animation_started_notification_ = true;
start_time_ = monotonic_time;
if (num_begin_frames_) {
@@ -165,7 +165,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int num_begin_frames_;
@@ -183,17 +183,17 @@
LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws()
: started_animating_(false) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(layer_tree_host()->root_layer());
}
virtual void AnimateLayers(
LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
started_animating_ = true;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
if (started_animating_)
EndTest();
}
@@ -201,11 +201,11 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS;
}
- virtual void AfterTest() OVERRIDE { }
+ virtual void AfterTest() override { }
private:
bool started_animating_;
@@ -221,13 +221,13 @@
LayerTreeHostAnimationTestAnimationsGetDeleted()
: started_animating_(false) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(layer_tree_host()->root_layer());
}
virtual void AnimateLayers(
LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
bool have_animations = !host_impl->animation_registrar()->
active_animation_controllers().empty();
if (!started_animating_ && have_animations) {
@@ -241,13 +241,13 @@
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
// Animations on the impl-side controller only get deleted during a commit,
// so we need to schedule a commit.
layer_tree_host()->SetNeedsCommit();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
bool started_animating_;
@@ -262,7 +262,7 @@
LayerTreeHostAnimationTestTickAnimationWhileBackgrounded()
: num_begin_frames_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddLongAnimationToMainThread(layer_tree_host()->root_layer());
}
@@ -271,7 +271,7 @@
// mode.
virtual void WillAnimateLayers(
LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
// Verify that the host can draw, it's just not visible.
EXPECT_TRUE(host_impl->CanDraw());
if (num_begin_frames_ < 2) {
@@ -286,7 +286,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int num_begin_frames_;
@@ -304,18 +304,18 @@
LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic()
: has_background_ticked_(false), num_foreground_animates_(0) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// Make sure that drawing many times doesn't cause a checkerboarded
// animation to start so we avoid flake in this test.
settings->timeout_and_draw_when_animation_checkerboards = false;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddLongAnimationToMainThread(layer_tree_host()->root_layer());
}
virtual void AnimateLayers(LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
EXPECT_GE(monotonic_time, last_tick_time_);
last_tick_time_ = monotonic_time;
if (host_impl->visible()) {
@@ -333,13 +333,13 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
if (TestEnded())
return draw_result;
return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
bool has_background_ticked_;
@@ -358,22 +358,22 @@
LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree()
: active_tree_was_animated_(false) {}
- virtual base::TimeDelta LowFrequencyAnimationInterval() const OVERRIDE {
+ virtual base::TimeDelta LowFrequencyAnimationInterval() const override {
return base::TimeDelta::FromMilliseconds(4);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(layer_tree_host()->root_layer());
}
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
// Replace animated commits with an empty tree.
layer_tree_host()->SetRootLayer(make_scoped_refptr<Layer>(NULL));
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
// This alternates setting an empty tree and a non-empty tree with an
// animation.
switch (layer_tree_host()->source_frame_number()) {
@@ -394,14 +394,14 @@
}
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
// At the start of every commit, block activations and make sure
// we are backgrounded.
host_impl->BlockNotifyReadyToActivateForTesting(true);
PostSetVisibleToMainThread(false);
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
if (!host_impl->settings().impl_side_painting) {
// There are no activations to block if we're not impl-side-painting,
// so just advance the test immediately.
@@ -429,7 +429,7 @@
host_impl->BlockNotifyReadyToActivateForTesting(false);
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
active_tree_was_animated_ = false;
// Verify that commits are actually alternating with empty / non-empty
@@ -463,7 +463,7 @@
}
virtual void WillAnimateLayers(LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
EXPECT_TRUE(host_impl->active_tree()->root_layer());
active_tree_was_animated_ = true;
}
@@ -477,7 +477,7 @@
PostSetVisibleToMainThread(true);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
bool active_tree_was_animated_;
};
@@ -491,20 +491,20 @@
public:
LayerTreeHostAnimationTestAddAnimationWithTimingFunction() {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
content_ = FakeContentLayer::Create(&client_);
content_->SetBounds(gfx::Size(4, 4));
layer_tree_host()->root_layer()->AddChild(content_);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(content_.get());
}
virtual void AnimateLayers(
LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
LayerAnimationController* controller_impl =
host_impl->active_tree()->root_layer()->children()[0]->
layer_animation_controller();
@@ -528,7 +528,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> content_;
@@ -546,7 +546,7 @@
: main_start_time_(-1.0),
impl_start_time_(-1.0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
content_ = FakeContentLayer::Create(&client_);
content_->SetBounds(gfx::Size(4, 4));
@@ -554,13 +554,13 @@
layer_tree_host()->root_layer()->AddChild(content_);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(content_.get());
}
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
LayerAnimationController* controller =
layer_tree_host()->root_layer()->children()[0]->
layer_animation_controller();
@@ -576,7 +576,7 @@
virtual void UpdateAnimationState(
LayerTreeHostImpl* impl_host,
- bool has_unfinished_animation) OVERRIDE {
+ bool has_unfinished_animation) override {
LayerAnimationController* controller =
impl_host->active_tree()->root_layer()->children()[0]->
layer_animation_controller();
@@ -593,7 +593,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_FLOAT_EQ(impl_start_time_, main_start_time_);
}
@@ -613,13 +613,13 @@
public:
LayerTreeHostAnimationTestAnimationFinishedEvents() {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddInstantAnimationToMainThread(layer_tree_host()->root_layer());
}
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
LayerAnimationController* controller =
layer_tree_host()->root_layer()->layer_animation_controller();
Animation* animation =
@@ -629,7 +629,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
};
SINGLE_AND_MULTI_THREAD_TEST_F(
@@ -644,17 +644,17 @@
: update_check_layer_(FakeContentLayer::Create(&client_)) {
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
update_check_layer_->SetOpacity(0.f);
layer_tree_host()->SetRootLayer(update_check_layer_);
LayerTreeHostAnimationTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(update_check_layer_.get());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
LayerAnimationController* controller_impl =
host_impl->active_tree()->root_layer()->layer_animation_controller();
Animation* animation_impl =
@@ -663,7 +663,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Update() should have been called once, proving that the layer was not
// skipped.
EXPECT_EQ(1u, update_check_layer_->update_count());
@@ -687,11 +687,11 @@
public:
LayerTreeHostAnimationTestLayerAddedWithAnimation() {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (layer_tree_host()->source_frame_number() == 1) {
scoped_refptr<Layer> layer = Layer::Create();
layer->set_layer_animation_delegate(this);
@@ -710,11 +710,11 @@
virtual void AnimateLayers(
LayerTreeHostImpl* impl_host,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
};
SINGLE_AND_MULTI_THREAD_TEST_F(
@@ -726,9 +726,9 @@
LayerTreeHostAnimationTestCancelAnimateCommit()
: num_begin_frames_(0), num_commit_calls_(0), num_draw_calls_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
num_begin_frames_++;
// No-op animate will cancel the commit.
if (layer_tree_host()->source_frame_number() == 1) {
@@ -738,19 +738,19 @@
layer_tree_host()->SetNeedsAnimate();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
num_commit_calls_++;
if (impl->active_tree()->source_frame_number() > 1)
FAIL() << "Commit should have been canceled.";
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
num_draw_calls_++;
if (impl->active_tree()->source_frame_number() > 1)
FAIL() << "Draw should have been canceled.";
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(2, num_begin_frames_);
EXPECT_EQ(1, num_commit_calls_);
EXPECT_EQ(1, num_draw_calls_);
@@ -772,23 +772,23 @@
LayerTreeHostAnimationTestForceRedraw()
: num_animate_(0), num_draw_layers_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
if (++num_animate_ < 2)
layer_tree_host()->SetNeedsAnimate();
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
layer_tree_host()->SetNextCommitForcesRedraw();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (++num_draw_layers_ == 2)
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// The first commit will always draw; make sure the second draw triggered
// by the animation was not cancelled.
EXPECT_EQ(2, num_draw_layers_);
@@ -808,21 +808,21 @@
LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit()
: num_animate_(0), num_draw_layers_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
if (++num_animate_ <= 2) {
layer_tree_host()->SetNeedsCommit();
layer_tree_host()->SetNeedsAnimate();
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (++num_draw_layers_ == 2)
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// The first commit will always draw; make sure the second draw triggered
// by the SetNeedsCommit was not cancelled.
EXPECT_EQ(2, num_draw_layers_);
@@ -843,7 +843,7 @@
public:
LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw() : started_times_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
content_ = FakeContentLayer::Create(&client_);
content_->SetBounds(gfx::Size(4, 4));
@@ -851,24 +851,24 @@
layer_tree_host()->root_layer()->AddChild(content_);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
layer_tree_host()->SetViewportSize(gfx::Size());
PostAddAnimationToMainThread(content_.get());
}
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
started_times_++;
}
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(1, started_times_);
}
@@ -888,7 +888,7 @@
public:
LayerTreeHostAnimationTestRunAnimationWhenNotVisible() : started_times_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
content_ = FakeContentLayer::Create(&client_);
content_->SetBounds(gfx::Size(4, 4));
@@ -896,32 +896,32 @@
layer_tree_host()->root_layer()->AddChild(content_);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
visible_ = true;
PostAddAnimationToMainThread(content_.get());
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
visible_ = false;
layer_tree_host()->SetVisible(false);
}
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
EXPECT_FALSE(visible_);
started_times_++;
}
virtual void NotifyAnimationFinished(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
EXPECT_FALSE(visible_);
EXPECT_EQ(1, started_times_);
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
bool visible_;
@@ -937,7 +937,7 @@
// checkerboard.
class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations
: public LayerTreeHostAnimationTest {
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
content_ = FakeContentLayer::Create(&client_);
content_->SetBounds(gfx::Size(4, 4));
@@ -945,13 +945,13 @@
layer_tree_host()->root_layer()->AddChild(content_);
}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// Make sure that drawing many times doesn't cause a checkerboarded
// animation to start so we avoid flake in this test.
settings->timeout_and_draw_when_animation_checkerboards = false;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
prevented_draw_ = 0;
added_animations_ = 0;
started_times_ = 0;
@@ -962,7 +962,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
if (added_animations_ < 2)
return draw_result;
if (TestEnded())
@@ -974,7 +974,7 @@
return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS;
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// The animation is longer than 1 BeginFrame interval.
@@ -991,13 +991,13 @@
virtual void NotifyAnimationStarted(
base::TimeTicks monotonic_time,
- Animation::TargetProperty target_property) OVERRIDE {
+ Animation::TargetProperty target_property) override {
if (TestEnded())
return;
started_times_++;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Make sure we tried to draw the second animation but failed.
EXPECT_LT(0, prevented_draw_);
// The first animation should be started, but the second should not because
@@ -1023,7 +1023,7 @@
public:
LayerTreeHostAnimationTestScrollOffsetChangesArePropagated() {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
scroll_layer_ = FakeContentLayer::Create(&client_);
@@ -1033,11 +1033,11 @@
layer_tree_host()->root_layer()->AddChild(scroll_layer_);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1: {
scoped_ptr<ScrollOffsetAnimationCurve> curve(
@@ -1062,7 +1062,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
FakeContentLayerClient client_;
@@ -1080,22 +1080,22 @@
LayerTreeHostAnimationTestFrozenAnimationTickTime()
: started_animating_(false), num_commits_(0), num_draw_attempts_(2) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// Make sure that drawing many times doesn't cause a checkerboarded
// animation to start so we avoid flake in this test.
settings->timeout_and_draw_when_animation_checkerboards = false;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostAddAnimationToMainThread(layer_tree_host()->root_layer());
}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {
last_main_thread_tick_time_ = args.frame_time;
}
virtual void AnimateLayers(LayerTreeHostImpl* host_impl,
- base::TimeTicks monotonic_time) OVERRIDE {
+ base::TimeTicks monotonic_time) override {
if (TestEnded())
return;
if (!started_animating_) {
@@ -1110,7 +1110,7 @@
virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
if (TestEnded())
return draw_result;
num_draw_attempts_++;
@@ -1121,7 +1121,7 @@
return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS;
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
if (!started_animating_)
return;
expected_impl_tick_time_ =
@@ -1129,7 +1129,7 @@
num_commits_++;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
bool started_animating_;
@@ -1151,9 +1151,9 @@
LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers()
: frame_count_with_pending_tree_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (layer_tree_host()->source_frame_number() == 1) {
AddAnimatedTransformToLayer(layer_tree_host()->root_layer(), 4, 1, 1);
} else if (layer_tree_host()->source_frame_number() == 2) {
@@ -1168,11 +1168,11 @@
}
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
host_impl->BlockNotifyReadyToActivateForTesting(true);
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
// For the commit that added animations to new and existing layers, keep
// blocking activation. We want to verify that even with activation blocked,
// the animation on the layer that's already in the active tree won't get a
@@ -1183,7 +1183,7 @@
}
virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl,
- const BeginFrameArgs& args) OVERRIDE {
+ const BeginFrameArgs& args) override {
if (!host_impl->pending_tree() ||
host_impl->pending_tree()->source_frame_number() != 2)
return;
@@ -1194,7 +1194,7 @@
}
virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl,
- bool has_unfinished_animation) OVERRIDE {
+ bool has_unfinished_animation) override {
LayerAnimationController* root_controller_impl =
host_impl->active_tree()->root_layer()->layer_animation_controller();
Animation* root_animation =
@@ -1215,7 +1215,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int frame_count_with_pending_tree_;
@@ -1230,16 +1230,16 @@
LayerTreeHostAnimationTestAddAnimationAfterAnimating()
: num_swap_buffers_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostAnimationTest::SetupTree();
content_ = Layer::Create();
content_->SetBounds(gfx::Size(4, 4));
layer_tree_host()->root_layer()->AddChild(content_);
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// First frame: add an animation to the root layer.
@@ -1254,7 +1254,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
// After both animations have started, verify that they have valid
// start times.
num_swap_buffers_++;
@@ -1279,7 +1279,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
scoped_refptr<Layer> content_;
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index 8bfb08a..0f6bcaf 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -15,6 +15,8 @@
#include "cc/layers/picture_layer.h"
#include "cc/layers/texture_layer.h"
#include "cc/layers/texture_layer_impl.h"
+#include "cc/layers/video_layer.h"
+#include "cc/layers/video_layer_impl.h"
#include "cc/output/filter_operations.h"
#include "cc/resources/single_release_callback.h"
#include "cc/test/fake_content_layer.h"
@@ -30,6 +32,7 @@
#include "cc/test/fake_picture_layer_impl.h"
#include "cc/test/fake_scoped_ui_resource.h"
#include "cc/test/fake_scrollbar.h"
+#include "cc/test/fake_video_frame_provider.h"
#include "cc/test/layer_tree_test.h"
#include "cc/test/render_pass_test_common.h"
#include "cc/test/test_context_provider.h"
@@ -39,6 +42,9 @@
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/single_thread_proxy.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "media/base/media.h"
+
+using media::VideoFrame;
namespace cc {
namespace {
@@ -59,6 +65,7 @@
context_should_support_io_surface_(false),
fallback_context_works_(false),
async_output_surface_creation_(false) {
+ media::InitializeMediaLibraryForTesting();
}
void LoseContext() {
@@ -75,7 +82,7 @@
}
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
if (times_to_fail_create_) {
--times_to_fail_create_;
ExpectCreateToFail();
@@ -99,7 +106,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
if (!times_to_lose_during_draw_)
return draw_result;
@@ -113,7 +120,7 @@
return draw_result;
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
committed_at_least_once_ = true;
if (!times_to_lose_during_commit_)
@@ -125,11 +132,11 @@
times_to_fail_recreate_ = 0;
}
- virtual void DidFailToInitializeOutputSurface() OVERRIDE {
+ virtual void DidFailToInitializeOutputSurface() override {
++times_create_failed_;
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
LayerTreeTest::TearDown();
EXPECT_EQ(times_to_expect_create_failed_, times_create_failed_);
}
@@ -161,9 +168,9 @@
recovered_context_(true),
first_initialized_(false) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE {
+ virtual void RequestNewOutputSurface(bool fallback) override {
if (async_output_surface_creation_) {
MainThreadTaskRunner()->PostTask(
FROM_HERE,
@@ -181,7 +188,7 @@
LayerTreeHostContextTest::CreateOutputSurface(fallback));
}
- virtual void DidInitializeOutputSurface() OVERRIDE {
+ virtual void DidInitializeOutputSurface() override {
if (first_initialized_)
++num_losses_;
else
@@ -190,9 +197,9 @@
recovered_context_ = true;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(11u, test_case_); }
+ virtual void AfterTest() override { EXPECT_EQ(11u, test_case_); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
// If the last frame had a context loss, then we'll commit again to
// recover.
if (!recovered_context_)
@@ -344,24 +351,24 @@
LayerTreeHostClientNotReadyDoesNotCreateOutputSurface()
: LayerTreeHostContextTest() {}
- virtual void WillBeginTest() OVERRIDE {
+ virtual void WillBeginTest() override {
// Override and do not signal SetLayerTreeHostClientReady.
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
EndTest();
}
virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback)
- OVERRIDE {
+ override {
EXPECT_TRUE(false);
return nullptr;
}
- virtual void DidInitializeOutputSurface() OVERRIDE { EXPECT_TRUE(false); }
+ virtual void DidInitializeOutputSurface() override { EXPECT_TRUE(false); }
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
}
};
@@ -371,7 +378,7 @@
class LayerTreeHostContextTestLostContextSucceedsWithContent
: public LayerTreeHostContextTestLostContextSucceeds {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = Layer::Create();
root_->SetBounds(gfx::Size(10, 10));
root_->SetIsDrawable(true);
@@ -394,7 +401,7 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void InvalidateAndSetNeedsCommit() OVERRIDE {
+ virtual void InvalidateAndSetNeedsCommit() override {
// Invalidate the render surface so we don't try to use a cached copy of the
// surface. We want to make sure to test the drawing paths for drawing to
// a child surface.
@@ -402,7 +409,7 @@
LayerTreeHostContextTestLostContextSucceeds::InvalidateAndSetNeedsCommit();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
if (!host_impl->settings().impl_side_painting) {
FakeContentLayerImpl* content_impl = static_cast<FakeContentLayerImpl*>(
host_impl->active_tree()->root_layer()->children()[0]);
@@ -442,12 +449,12 @@
times_to_fail_create_ = times_to_fail_;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
scoped_ptr<FakeOutputSurface> surface =
LayerTreeHostContextTest::CreateFakeOutputSurface(fallback);
@@ -458,13 +465,13 @@
return surface.Pass();
}
- virtual void DidInitializeOutputSurface() OVERRIDE { times_initialized_++; }
+ virtual void DidInitializeOutputSurface() override { times_initialized_++; }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(times_to_fail_, times_create_failed_);
EXPECT_NE(0, times_initialized_);
EXPECT_EQ(expect_fallback_attempt_, did_attempt_fallback_);
@@ -508,7 +515,7 @@
num_commits_(0),
lost_context_(false) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// Paint non-solid color.
SkPaint paint;
paint.setColor(SkColorSetARGB(100, 80, 200, 200));
@@ -527,7 +534,7 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void PostEvictTextures() {
if (HasImplThread()) {
@@ -551,7 +558,7 @@
}
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
if (num_commits_ > 1)
return;
if (!layer_tree_host()->settings().impl_side_painting) {
@@ -560,7 +567,7 @@
PostEvictTextures();
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
if (num_commits_ > 1)
return;
@@ -571,7 +578,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (impl->settings().impl_side_painting) {
FakePictureLayerImpl* picture_impl =
static_cast<FakePictureLayerImpl*>(impl->active_tree()->root_layer());
@@ -587,9 +594,9 @@
EndTest();
}
- virtual void DidInitializeOutputSurface() OVERRIDE {}
+ virtual void DidInitializeOutputSurface() override {}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
protected:
bool lose_after_evict_;
@@ -674,7 +681,7 @@
LayerTreeHostContextTestLostContextWhileUpdatingResources()
: num_children_(50), times_to_lose_on_end_query_(3) {}
- virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() OVERRIDE {
+ virtual scoped_ptr<TestWebGraphicsContext3D> CreateContext3d() override {
scoped_ptr<TestWebGraphicsContext3D> context =
LayerTreeHostContextTest::CreateContext3d();
if (times_to_lose_on_end_query_) {
@@ -684,7 +691,7 @@
return context.Pass();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
if (layer_tree_host()->settings().impl_side_painting)
parent_ = FakePictureLayer::Create(&client_);
else
@@ -707,14 +714,14 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
EXPECT_EQ(0, times_to_lose_on_end_query_);
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(0, times_to_lose_on_end_query_);
}
@@ -733,7 +740,7 @@
LayerTreeHostContextTestLayersNotified()
: LayerTreeHostContextTest(), num_commits_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
if (layer_tree_host()->settings().impl_side_painting) {
root_ = FakePictureLayer::Create(&client_);
child_ = FakePictureLayer::Create(&client_);
@@ -751,9 +758,9 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeHostContextTest::DidActivateTreeOnThread(host_impl);
FakePictureLayerImpl* root_picture = NULL;
@@ -815,7 +822,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
int num_commits_;
@@ -849,7 +856,7 @@
static void EmptyReleaseCallback(unsigned sync_point, bool lost) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
gpu::gles2::GLES2Interface* gl =
child_output_surface_->context_provider()->ContextGL();
@@ -937,6 +944,49 @@
layer_with_mask->SetMaskLayer(mask.get());
root->AddChild(layer_with_mask);
+ scoped_refptr<VideoLayer> video_color =
+ VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0);
+ video_color->SetBounds(gfx::Size(10, 10));
+ video_color->SetIsDrawable(true);
+ root->AddChild(video_color);
+
+ scoped_refptr<VideoLayer> video_hw =
+ VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0);
+ video_hw->SetBounds(gfx::Size(10, 10));
+ video_hw->SetIsDrawable(true);
+ root->AddChild(video_hw);
+
+ scoped_refptr<VideoLayer> video_scaled_hw =
+ VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0);
+ video_scaled_hw->SetBounds(gfx::Size(10, 10));
+ video_scaled_hw->SetIsDrawable(true);
+ root->AddChild(video_scaled_hw);
+
+ color_video_frame_ = VideoFrame::CreateColorFrame(
+ gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta());
+ hw_video_frame_ =
+ VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder(
+ mailbox, GL_TEXTURE_2D, sync_point)),
+ media::VideoFrame::ReleaseMailboxCB(),
+ gfx::Size(4, 4),
+ gfx::Rect(0, 0, 4, 4),
+ gfx::Size(4, 4),
+ base::TimeDelta(),
+ VideoFrame::ReadPixelsCB());
+ scaled_hw_video_frame_ =
+ VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder(
+ mailbox, GL_TEXTURE_2D, sync_point)),
+ media::VideoFrame::ReleaseMailboxCB(),
+ gfx::Size(4, 4),
+ gfx::Rect(0, 0, 3, 2),
+ gfx::Size(4, 4),
+ base::TimeDelta(),
+ VideoFrame::ReadPixelsCB());
+
+ color_frame_provider_.set_frame(color_video_frame_);
+ hw_frame_provider_.set_frame(hw_video_frame_);
+ scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_);
+
if (!delegating_renderer()) {
// TODO(danakj): IOSurface layer can not be transported. crbug.com/239335
scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create();
@@ -962,16 +1012,24 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(host_impl);
+
+ if (host_impl->active_tree()->source_frame_number() == 3) {
+ // On the third commit we're recovering from context loss. Hardware
+ // video frames should not be reused by the VideoFrameProvider, but
+ // software frames can be.
+ hw_frame_provider_.set_frame(NULL);
+ scaled_hw_frame_provider_.set_frame(NULL);
+ }
}
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
if (host_impl->active_tree()->source_frame_number() == 2) {
// Lose the context during draw on the second commit. This will cause
// a third commit to recover.
@@ -981,7 +1039,7 @@
}
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
// This will get called twice:
// First when we create the initial output surface...
if (layer_tree_host()->source_frame_number() > 0) {
@@ -991,7 +1049,7 @@
return LayerTreeHostContextTest::CreateFakeOutputSurface(fallback);
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
ASSERT_TRUE(layer_tree_host()->hud_layer());
// End the test once we know the 3nd frame drew.
if (layer_tree_host()->source_frame_number() < 5) {
@@ -1002,7 +1060,7 @@
}
}
- virtual void AfterTest() OVERRIDE { EXPECT_TRUE(lost_context_); }
+ virtual void AfterTest() override { EXPECT_TRUE(lost_context_); }
private:
FakeContentLayerClient client_;
@@ -1016,6 +1074,14 @@
scoped_refptr<DelegatedFrameResourceCollection>
delegated_resource_collection_;
scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_;
+
+ scoped_refptr<VideoFrame> color_video_frame_;
+ scoped_refptr<VideoFrame> hw_video_frame_;
+ scoped_refptr<VideoFrame> scaled_hw_video_frame_;
+
+ FakeVideoFrameProvider color_frame_provider_;
+ FakeVideoFrameProvider hw_frame_provider_;
+ FakeVideoFrameProvider scaled_hw_frame_provider_;
};
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources);
@@ -1023,7 +1089,7 @@
class ImplSidePaintingLayerTreeHostContextTest
: public LayerTreeHostContextTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
};
@@ -1031,7 +1097,7 @@
class LayerTreeHostContextTestImplSidePainting
: public ImplSidePaintingLayerTreeHostContextTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
@@ -1045,14 +1111,14 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
times_to_lose_during_commit_ = 1;
PostSetNeedsCommitToMainThread();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
- virtual void DidInitializeOutputSurface() OVERRIDE { EndTest(); }
+ virtual void DidInitializeOutputSurface() override { EndTest(); }
private:
FakeContentLayerClient client_;
@@ -1064,7 +1130,7 @@
public:
ScrollbarLayerLostContext() : commits_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
scoped_refptr<Layer> scroll_layer = Layer::Create();
scrollbar_layer_ =
FakePaintedScrollbarLayer::Create(false, true, scroll_layer->id());
@@ -1074,9 +1140,9 @@
PostSetNeedsCommitToMainThread();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
++commits_;
@@ -1108,11 +1174,11 @@
class UIResourceLostTest : public LayerTreeHostContextTest {
public:
UIResourceLostTest() : time_step_(0) {}
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->texture_id_allocation_chunk_size = 1;
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
- virtual void AfterTest() OVERRIDE {}
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+ virtual void AfterTest() override {}
// This is called on the main thread after each commit and
// DidActivateTreeOnThread, with the value of time_step_ at the time
@@ -1159,7 +1225,7 @@
// activated.
virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) = 0;
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
if (!layer_tree_host()->settings().impl_side_painting) {
StepCompleteOnImplThread(impl);
PostStepCompleteToMainThread();
@@ -1167,7 +1233,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
if (layer_tree_host()->settings().impl_side_painting) {
StepCompleteOnImplThread(impl);
PostStepCompleteToMainThread();
@@ -1179,7 +1245,7 @@
// Losing context after an UI resource has been created.
class UIResourceLostAfterCommit : public UIResourceLostTestSimple {
public:
- virtual void StepCompleteOnMainThread(int step) OVERRIDE {
+ virtual void StepCompleteOnMainThread(int step) override {
EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread());
switch (step) {
case 0:
@@ -1199,7 +1265,7 @@
}
}
- virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
switch (time_step_) {
case 1:
@@ -1238,7 +1304,7 @@
public:
UIResourceLostBeforeCommit() : test_id0_(0), test_id1_(0) {}
- virtual void StepCompleteOnMainThread(int step) OVERRIDE {
+ virtual void StepCompleteOnMainThread(int step) override {
switch (step) {
case 0:
ui_resource_ = FakeScopedUIResource::Create(layer_tree_host());
@@ -1288,7 +1354,7 @@
}
}
- virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
switch (time_step_) {
case 1:
@@ -1334,7 +1400,7 @@
// Losing UI resource before the pending trees is activated but after the
// commit. Impl-side-painting only.
class UIResourceLostBeforeActivateTree : public UIResourceLostTest {
- virtual void StepCompleteOnMainThread(int step) OVERRIDE {
+ virtual void StepCompleteOnMainThread(int step) override {
EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread());
switch (step) {
case 0:
@@ -1357,7 +1423,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
switch (time_step_) {
case 2:
@@ -1369,7 +1435,7 @@
}
}
- virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override {
switch (time_step_) {
case 1:
// The resource creation callback has been called.
@@ -1386,7 +1452,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::DidActivateTreeOnThread(impl);
switch (time_step_) {
case 1:
@@ -1425,7 +1491,7 @@
// Resources evicted explicitly and by visibility changes.
class UIResourceLostEviction : public UIResourceLostTestSimple {
public:
- virtual void StepCompleteOnMainThread(int step) OVERRIDE {
+ virtual void StepCompleteOnMainThread(int step) override {
EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread());
switch (step) {
case 0:
@@ -1448,7 +1514,7 @@
}
virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* impl,
- bool visible) OVERRIDE {
+ bool visible) override {
TestWebGraphicsContext3D* context = TestContext();
if (!visible) {
// All resources should have been evicted.
@@ -1464,7 +1530,7 @@
}
}
- virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void StepCompleteOnImplThread(LayerTreeHostImpl* impl) override {
TestWebGraphicsContext3D* context = TestContext();
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
switch (time_step_) {
@@ -1512,7 +1578,7 @@
LayerTreeHostContextTestSurfaceCreateCallback()
: LayerTreeHostContextTest() {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
if (layer_tree_host()->settings().impl_side_painting) {
picture_layer_ = FakePictureLayer::Create(&client_);
picture_layer_->SetBounds(gfx::Size(10, 20));
@@ -1526,9 +1592,9 @@
LayerTreeHostContextTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
if (layer_tree_host()->settings().impl_side_painting)
@@ -1560,7 +1626,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
LayerTreeHostContextTest::CommitCompleteOnThread(impl);
switch (LastCommittedSourceFrameNumber(impl)) {
case 0:
@@ -1576,7 +1642,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
protected:
FakeContentLayerClient client_;
@@ -1589,12 +1655,12 @@
class LayerTreeHostContextTestLoseAfterSendingBeginMainFrame
: public LayerTreeHostContextTest {
protected:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
deferred_ = false;
PostSetNeedsCommitToMainThread();
}
- virtual void ScheduledActionWillSendBeginMainFrame() OVERRIDE {
+ virtual void ScheduledActionWillSendBeginMainFrame() override {
if (deferred_)
return;
deferred_ = true;
@@ -1630,14 +1696,14 @@
layer_tree_host()->SetDeferCommits(defer_commits);
}
- virtual void WillBeginMainFrame() OVERRIDE {
+ virtual void WillBeginMainFrame() override {
// Don't begin a frame with a lost surface.
EXPECT_FALSE(layer_tree_host()->output_surface_lost());
}
- virtual void DidCommitAndDrawFrame() OVERRIDE { EndTest(); }
+ virtual void DidCommitAndDrawFrame() override { EndTest(); }
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
bool deferred_;
};
diff --git a/cc/trees/layer_tree_host_unittest_copyrequest.cc b/cc/trees/layer_tree_host_unittest_copyrequest.cc
index 6af1756..860f283 100644
--- a/cc/trees/layer_tree_host_unittest_copyrequest.cc
+++ b/cc/trees/layer_tree_host_unittest_copyrequest.cc
@@ -21,7 +21,7 @@
class LayerTreeHostCopyRequestTestMultipleRequests
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root = FakeContentLayer::Create(&client_);
root->SetBounds(gfx::Size(20, 20));
@@ -33,9 +33,9 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE { WaitForCallback(); }
+ virtual void DidCommitAndDrawFrame() override { WaitForCallback(); }
void WaitForCallback() {
base::MessageLoop::current()->PostTask(
@@ -101,10 +101,10 @@
callbacks_.push_back(result->size());
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(4u, callbacks_.size()); }
+ virtual void AfterTest() override { EXPECT_EQ(4u, callbacks_.size()); }
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
if (use_gl_renderer_)
return FakeOutputSurface::Create3d();
return FakeOutputSurface::CreateSoftware(
@@ -146,7 +146,7 @@
class LayerTreeHostCopyRequestTestLayerDestroyed
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -162,12 +162,12 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
callback_count_ = 0;
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
int frame = layer_tree_host()->source_frame_number();
switch (frame) {
case 1:
@@ -224,7 +224,7 @@
++callback_count_;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int callback_count_;
FakeContentLayerClient client_;
@@ -238,7 +238,7 @@
class LayerTreeHostCopyRequestTestInHiddenSubtree
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -267,7 +267,7 @@
base::Unretained(this))));
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
callback_count_ = 0;
PostSetNeedsCommitToMainThread();
@@ -321,7 +321,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int callback_count_;
FakeContentLayerClient client_;
@@ -337,7 +337,7 @@
class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -360,7 +360,7 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
did_draw_ = false;
PostSetNeedsCommitToMainThread();
@@ -377,7 +377,7 @@
EndTest();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
Renderer* renderer = host_impl->renderer();
LayerImpl* root = host_impl->active_tree()->root_layer();
@@ -398,7 +398,7 @@
did_draw_ = true;
}
- virtual void AfterTest() OVERRIDE { EXPECT_TRUE(did_draw_); }
+ virtual void AfterTest() override { EXPECT_TRUE(did_draw_); }
FakeContentLayerClient client_;
bool did_draw_;
@@ -415,7 +415,7 @@
class LayerTreeHostCopyRequestTestClippedOut
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -433,7 +433,7 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
copy_layer_->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest(
@@ -449,7 +449,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> root_;
@@ -463,7 +463,7 @@
class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -482,7 +482,7 @@
base::Unretained(this))));
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
saw_copy_request_ = false;
callback_count_ = 0;
PostSetNeedsCommitToMainThread();
@@ -493,7 +493,7 @@
AddCopyRequest(copy_layer_.get());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
if (impl->active_tree()->source_frame_number() == 0) {
LayerImpl* root = impl->active_tree()->root_layer();
EXPECT_TRUE(root->children()[0]->HasCopyRequest());
@@ -501,7 +501,7 @@
}
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (layer_tree_host()->source_frame_number() == 1) {
// Allow drawing.
layer_tree_host()->SetViewportSize(gfx::Size(root_->bounds()));
@@ -519,7 +519,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE { EXPECT_TRUE(saw_copy_request_); }
+ virtual void AfterTest() override { EXPECT_TRUE(saw_copy_request_); }
bool saw_copy_request_;
int callback_count_;
@@ -535,7 +535,7 @@
: public LayerTreeHostCopyRequestTest {
protected:
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
if (!first_context_provider_.get()) {
first_context_provider_ = TestContextProvider::Create();
return FakeOutputSurface::Create3d(first_context_provider_);
@@ -546,7 +546,7 @@
return FakeOutputSurface::Create3d(second_context_provider_);
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -558,7 +558,7 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
void CopyOutputCallback(scoped_ptr<CopyOutputResult> result) {
EXPECT_TRUE(layer_tree_host()->proxy()->IsMainThread());
@@ -573,7 +573,7 @@
layer_tree_host()->SetNeedsCommit();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// The layers have been pushed to the impl side. The layer textures have
@@ -606,7 +606,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl,
- bool result) OVERRIDE {
+ bool result) override {
switch (impl->active_tree()->source_frame_number()) {
case 0:
// The layers have been drawn, so their textures have been allocated.
@@ -646,7 +646,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
scoped_refptr<TestContextProvider> first_context_provider_;
scoped_refptr<TestContextProvider> second_context_provider_;
@@ -665,12 +665,12 @@
: public LayerTreeHostCopyRequestTest {
protected:
virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
- OVERRIDE {
+ override {
context_provider_ = TestContextProvider::Create();
return FakeOutputSurface::Create3d(context_provider_);
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -682,7 +682,7 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
num_textures_without_readback_ = 0;
num_textures_with_readback_ = 0;
waited_sync_point_after_readback_ = 0;
@@ -691,7 +691,7 @@
virtual void RequestCopy(Layer* layer) = 0;
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
// The layers have been pushed to the impl side. The layer textures have
@@ -702,7 +702,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl,
- bool result) OVERRIDE {
+ bool result) override {
switch (impl->active_tree()->source_frame_number()) {
case 0:
// The layers have been drawn, so their textures have been allocated.
@@ -738,7 +738,7 @@
class LayerTreeHostCopyRequestTestCreatesTexture
: public LayerTreeHostCopyRequestTestCountTextures {
protected:
- virtual void RequestCopy(Layer* layer) OVERRIDE {
+ virtual void RequestCopy(Layer* layer) override {
// Request a normal texture copy. This should create a new texture.
copy_layer_->RequestCopyOfOutput(
CopyOutputRequest::CreateRequest(base::Bind(
@@ -758,7 +758,7 @@
release->Run(0, false);
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// No sync point was needed.
EXPECT_EQ(0u, waited_sync_point_after_readback_);
// Except the copy to have made another texture.
@@ -772,7 +772,7 @@
class LayerTreeHostCopyRequestTestProvideTexture
: public LayerTreeHostCopyRequestTestCountTextures {
protected:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
external_context_provider_ = TestContextProvider::Create();
EXPECT_TRUE(external_context_provider_->BindToCurrentThread());
LayerTreeHostCopyRequestTestCountTextures::BeginTest();
@@ -788,7 +788,7 @@
EXPECT_FALSE(release);
}
- virtual void RequestCopy(Layer* layer) OVERRIDE {
+ virtual void RequestCopy(Layer* layer) override {
// Request a copy to a provided texture. This should not create a new
// texture.
scoped_ptr<CopyOutputRequest> request =
@@ -807,7 +807,7 @@
copy_layer_->RequestCopyOfOutput(request.Pass());
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// Expect the compositor to have waited for the sync point in the provided
// TextureMailbox.
EXPECT_EQ(sync_point_, waited_sync_point_after_readback_);
@@ -825,7 +825,7 @@
class LayerTreeHostCopyRequestTestDestroyBeforeCopy
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -837,7 +837,7 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
callback_count_ = 0;
PostSetNeedsCommitToMainThread();
}
@@ -847,7 +847,7 @@
++callback_count_;
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&LayerTreeHostCopyRequestTestDestroyBeforeCopy::DidActivate,
@@ -888,7 +888,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int callback_count_;
FakeContentLayerClient client_;
@@ -902,7 +902,7 @@
class LayerTreeHostCopyRequestTestShutdownBeforeCopy
: public LayerTreeHostCopyRequestTest {
protected:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
root_->SetBounds(gfx::Size(20, 20));
@@ -914,7 +914,7 @@
LayerTreeHostCopyRequestTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
callback_count_ = 0;
PostSetNeedsCommitToMainThread();
}
@@ -924,7 +924,7 @@
++callback_count_;
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&LayerTreeHostCopyRequestTestShutdownBeforeCopy::DidActivate,
@@ -959,7 +959,7 @@
}
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(1, callback_count_); }
+ virtual void AfterTest() override { EXPECT_EQ(1, callback_count_); }
int callback_count_;
FakeContentLayerClient client_;
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc
index 7d8535e..f8e44d5 100644
--- a/cc/trees/layer_tree_host_unittest_damage.cc
+++ b/cc/trees/layer_tree_host_unittest_damage.cc
@@ -26,7 +26,7 @@
// LayerTreeHost::SetNeedsRedraw should damage the whole viewport.
class LayerTreeHostDamageTestSetNeedsRedraw
: public LayerTreeHostDamageTest {
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// Viewport is 10x10.
scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_);
root->SetBounds(gfx::Size(10, 10));
@@ -35,12 +35,12 @@
LayerTreeHostDamageTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
draw_count_ = 0;
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
layer_tree_host()->SetNeedsRedraw();
@@ -51,7 +51,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
@@ -77,7 +77,7 @@
return draw_result;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int draw_count_;
FakeContentLayerClient client_;
@@ -88,7 +88,7 @@
// LayerTreeHost::SetViewportSize should damage the whole viewport.
class LayerTreeHostDamageTestSetViewportSize
: public LayerTreeHostDamageTest {
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// Viewport is 10x10.
scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_);
root->SetBounds(gfx::Size(10, 10));
@@ -97,12 +97,12 @@
LayerTreeHostDamageTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
draw_count_ = 0;
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
switch (layer_tree_host()->source_frame_number()) {
case 1:
layer_tree_host()->SetViewportSize(gfx::Size(15, 15));
@@ -113,7 +113,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
@@ -139,7 +139,7 @@
return draw_result;
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
int draw_count_;
FakeContentLayerClient client_;
@@ -149,14 +149,14 @@
class LayerTreeHostDamageTestNoDamageDoesNotSwap
: public LayerTreeHostDamageTest {
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
expect_swap_and_succeed_ = 0;
did_swaps_ = 0;
did_swap_and_succeed_ = 0;
PostSetNeedsCommitToMainThread();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<FakeContentLayer> root = FakeContentLayer::Create(&client_);
root->SetBounds(gfx::Size(10, 10));
@@ -172,7 +172,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
int source_frame = host_impl->active_tree()->source_frame_number();
@@ -198,14 +198,14 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
++did_swaps_;
if (result)
++did_swap_and_succeed_;
EXPECT_EQ(expect_swap_and_succeed_, did_swap_and_succeed_);
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
int next_frame = layer_tree_host()->source_frame_number();
switch (next_frame) {
case 1:
@@ -224,7 +224,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(4, did_swaps_);
EXPECT_EQ(2, expect_swap_and_succeed_);
EXPECT_EQ(expect_swap_and_succeed_, did_swap_and_succeed_);
@@ -241,11 +241,11 @@
LayerTreeHostDamageTestNoDamageDoesNotSwap);
class LayerTreeHostDamageTestForcedFullDamage : public LayerTreeHostDamageTest {
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = FakeContentLayer::Create(&client_);
child_ = FakeContentLayer::Create(&client_);
@@ -261,7 +261,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
@@ -334,7 +334,7 @@
return draw_result;
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
if (!TestEnded())
layer_tree_host()->SetNeedsCommit();
@@ -344,7 +344,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
scoped_refptr<FakeContentLayer> root_;
@@ -355,7 +355,7 @@
SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(LayerTreeHostDamageTestForcedFullDamage);
class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest {
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root_layer = Layer::Create();
root_layer->SetBounds(gfx::Size(400, 400));
root_layer->SetMasksToBounds(true);
@@ -395,7 +395,7 @@
class LayerTreeHostDamageTestScrollbarDoesDamage
: public LayerTreeHostScrollbarDamageTest {
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
did_swaps_ = 0;
PostSetNeedsCommitToMainThread();
}
@@ -403,7 +403,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
host_impl->active_tree()->root_layer()->render_surface();
@@ -432,7 +432,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
++did_swaps_;
EXPECT_TRUE(result);
LayerImpl* root = host_impl->active_tree()->root_layer();
@@ -458,7 +458,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(4, did_swaps_);
}
@@ -469,7 +469,7 @@
class LayerTreeHostDamageTestScrollbarCommitDoesNoDamage
: public LayerTreeHostScrollbarDamageTest {
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
did_swaps_ = 0;
PostSetNeedsCommitToMainThread();
}
@@ -477,7 +477,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
RenderSurfaceImpl* root_surface =
host_impl->active_tree()->root_layer()->render_surface();
@@ -508,7 +508,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
++did_swaps_;
EXPECT_TRUE(result);
LayerImpl* root = host_impl->active_tree()->root_layer();
@@ -535,7 +535,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(3, did_swaps_);
}
@@ -547,15 +547,15 @@
class LayerTreeHostDamageTestVisibleTilesStillTriggerDraws
: public LayerTreeHostDamageTest {
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_);
root->SetBounds(gfx::Size(500, 500));
layer_tree_host()->SetRootLayer(root);
@@ -569,7 +569,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame_data,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
prepare_to_draw_count_++;
switch (prepare_to_draw_count_) {
@@ -600,7 +600,7 @@
}
virtual void UpdateVisibleTilesOnThread(
- LayerTreeHostImpl* host_impl) OVERRIDE {
+ LayerTreeHostImpl* host_impl) override {
// Simulate creating some visible tiles (that trigger prepare-to-draws).
// The first we make into a no-damage-frame during prepare-to-draw (see
// above). This is to ensure we still get UpdateVisibleTiles calls after
@@ -618,13 +618,13 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool didSwap) OVERRIDE {
+ bool didSwap) override {
if (!didSwap)
return;
++swap_count_;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
// We should keep getting update-visible-tiles calls
// until we report there are no more incomplete-tiles.
EXPECT_EQ(update_visible_tile_count_, 6);
diff --git a/cc/trees/layer_tree_host_unittest_delegated.cc b/cc/trees/layer_tree_host_unittest_delegated.cc
index 247d94e..095513b 100644
--- a/cc/trees/layer_tree_host_unittest_delegated.cc
+++ b/cc/trees/layer_tree_host_unittest_delegated.cc
@@ -251,7 +251,7 @@
resource_collection_->SetClient(this);
}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
root_ = Layer::Create();
root_->SetBounds(gfx::Size(15, 15));
@@ -259,7 +259,7 @@
LayerTreeHostDelegatedTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
resource_collection_->SetClient(this);
PostSetNeedsCommitToMainThread();
}
@@ -296,10 +296,10 @@
return delegated;
}
- virtual void AfterTest() OVERRIDE { resource_collection_->SetClient(NULL); }
+ virtual void AfterTest() override { resource_collection_->SetClient(NULL); }
// DelegatedFrameProviderClient implementation.
- virtual void UnusedResourcesAreAvailable() OVERRIDE { available_ = true; }
+ virtual void UnusedResourcesAreAvailable() override { available_ = true; }
bool TestAndResetAvailable() {
bool available = available_;
@@ -323,13 +323,13 @@
num_activates_(0),
did_reset_child_id_(false) {}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (TestEnded())
return;
SetFrameData(CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1)));
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() < 1)
return;
@@ -360,7 +360,7 @@
}
virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl,
- bool success) OVERRIDE {
+ bool success) override {
EXPECT_TRUE(success);
if (num_activates_ < 2)
@@ -391,7 +391,7 @@
LayerTreeHostDelegatedTestInvalidFrameAfterContextLost()
: num_activates_(0), num_output_surfaces_initialized_(0) {}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
if (TestEnded())
return;
scoped_ptr<DelegatedFrameData> frame1 =
@@ -401,7 +401,7 @@
SetFrameData(frame1.Pass());
}
- virtual void DidInitializeOutputSurface() OVERRIDE {
+ virtual void DidInitializeOutputSurface() override {
if (!num_output_surfaces_initialized_++)
return;
@@ -414,7 +414,7 @@
DCHECK(delegated_.get() == old_delegated.get());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() < 1)
return;
@@ -435,7 +435,7 @@
}
virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl,
- bool success) OVERRIDE {
+ bool success) override {
EXPECT_TRUE(success);
if (num_activates_ < 2)
@@ -450,7 +450,7 @@
EXPECT_EQ(0U, delegated_impl->Resources().size());
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
LayerTreeHostDelegatedTestCaseSingleDelegatedLayer::AfterTest();
EXPECT_EQ(2, num_output_surfaces_initialized_);
}
@@ -470,7 +470,7 @@
: LayerTreeHostDelegatedTestCaseSingleDelegatedLayer(),
first_draw_for_source_frame_(true) {}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
int next_source_frame_number = layer_tree_host()->source_frame_number();
switch (next_source_frame_number) {
case 1:
@@ -583,7 +583,7 @@
virtual DrawResult PrepareToDrawOnThread(
LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
EXPECT_EQ(DRAW_SUCCESS, draw_result);
if (!first_draw_for_source_frame_)
@@ -674,7 +674,7 @@
class LayerTreeHostDelegatedTestMergeResources
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
// Push two frames to the delegated renderer layer with no commit between.
// The first frame has resource 999.
@@ -707,7 +707,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
LayerImpl* root_impl = host_impl->active_tree()->root_layer();
FakeDelegatedRendererLayerImpl* delegated_impl =
static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]);
@@ -734,7 +734,7 @@
class LayerTreeHostDelegatedTestRemapResourcesInQuads
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
// Generate a frame with two resources in it.
scoped_ptr<DelegatedFrameData> frame =
CreateFrameData(gfx::Rect(0, 0, 1, 1), gfx::Rect(0, 0, 1, 1));
@@ -747,7 +747,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
LayerImpl* root_impl = host_impl->active_tree()->root_layer();
FakeDelegatedRendererLayerImpl* delegated_impl =
static_cast<FakeDelegatedRendererLayerImpl*>(root_impl->children()[0]);
@@ -783,11 +783,11 @@
class LayerTreeHostDelegatedTestReturnUnusedResources
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -856,7 +856,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -867,11 +867,11 @@
class LayerTreeHostDelegatedTestReusedResources
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -928,7 +928,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -938,11 +938,11 @@
class LayerTreeHostDelegatedTestFrameBeforeAck
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -997,7 +997,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() != 3)
return;
@@ -1028,7 +1028,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -1038,11 +1038,11 @@
class LayerTreeHostDelegatedTestFrameBeforeTakeResources
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1109,7 +1109,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() != 3)
return;
@@ -1147,7 +1147,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -1158,11 +1158,11 @@
class LayerTreeHostDelegatedTestBadFrame
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1230,7 +1230,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
if (host_impl->active_tree()->source_frame_number() < 1)
return;
@@ -1312,11 +1312,11 @@
class LayerTreeHostDelegatedTestUnnamedResource
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1352,7 +1352,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() != 1)
return;
@@ -1378,11 +1378,11 @@
class LayerTreeHostDelegatedTestDontLeakResource
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1430,7 +1430,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() != 1)
return;
@@ -1451,7 +1451,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -1461,7 +1461,7 @@
class LayerTreeHostDelegatedTestResourceSentToParent
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1516,7 +1516,7 @@
host_impl->ReclaimResources(&ack);
}
- virtual void UnusedResourcesAreAvailable() OVERRIDE {
+ virtual void UnusedResourcesAreAvailable() override {
EXPECT_EQ(3, layer_tree_host()->source_frame_number());
ReturnedResourceArray resources;
@@ -1531,7 +1531,7 @@
EndTest();
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() < 1)
return;
@@ -1592,13 +1592,13 @@
class LayerTreeHostDelegatedTestCommitWithoutTake
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
// Prevent drawing with resources that are sent to the grandparent.
layer_tree_host()->SetViewportSize(gfx::Size());
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1664,7 +1664,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
if (host_impl->active_tree()->source_frame_number() < 1)
return;
@@ -1714,7 +1714,7 @@
protected:
DelegatedFrameIsActivatedDuringCommit() : returned_resource_count_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
activate_count_ = 0;
scoped_ptr<DelegatedFrameData> frame =
@@ -1726,11 +1726,11 @@
PostSetNeedsCommitToMainThread();
}
- virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override {
++activate_count_;
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 1: {
// The first frame has been activated. Set a new frame, and
@@ -1757,7 +1757,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
switch (host_impl->active_tree()->source_frame_number()) {
case 0: {
// The activate for the 1st frame should have happened before now.
@@ -1782,11 +1782,11 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
- virtual void UnusedResourcesAreAvailable() OVERRIDE {
+ virtual void UnusedResourcesAreAvailable() override {
LayerTreeHostDelegatedTestCaseSingleDelegatedLayer::
UnusedResourcesAreAvailable();
ReturnedResourceArray resources;
@@ -1807,9 +1807,9 @@
class LayerTreeHostDelegatedTestTwoImplLayers
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1857,7 +1857,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -1867,9 +1867,9 @@
class LayerTreeHostDelegatedTestTwoImplLayersTwoFrames
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -1926,7 +1926,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
};
@@ -1937,9 +1937,9 @@
class LayerTreeHostDelegatedTestTwoLayers
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -2013,7 +2013,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
@@ -2025,9 +2025,9 @@
class LayerTreeHostDelegatedTestRemoveAndAddToTree
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -2105,7 +2105,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
@@ -2117,9 +2117,9 @@
class LayerTreeHostDelegatedTestRemoveAndChangeResources
: public LayerTreeHostDelegatedTestCaseSingleDelegatedLayer {
public:
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void DidCommitAndDrawFrame() override {
scoped_ptr<DelegatedFrameData> frame;
ReturnedResourceArray resources;
@@ -2187,7 +2187,7 @@
}
virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
- bool result) OVERRIDE {
+ bool result) override {
ReturnUnusedResourcesFromParent(host_impl);
}
diff --git a/cc/trees/layer_tree_host_unittest_no_message_loop.cc b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
index a48156b..fb0e2be 100644
--- a/cc/trees/layer_tree_host_unittest_no_message_loop.cc
+++ b/cc/trees/layer_tree_host_unittest_no_message_loop.cc
@@ -31,7 +31,7 @@
virtual ~NoMessageLoopOutputSurface() {}
// OutputSurface overrides.
- virtual void SwapBuffers(CompositorFrame* frame) OVERRIDE {
+ virtual void SwapBuffers(CompositorFrame* frame) override {
DCHECK(client_);
client_->DidSwapBuffers();
client_->DidSwapBuffersComplete();
@@ -53,34 +53,34 @@
virtual ~LayerTreeHostNoMessageLoopTest() {}
// LayerTreeHostClient overrides.
- virtual void WillBeginMainFrame(int frame_id) OVERRIDE {}
- virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {}
- virtual void DidBeginMainFrame() OVERRIDE {}
- virtual void Layout() OVERRIDE {}
+ virtual void WillBeginMainFrame(int frame_id) override {}
+ virtual void BeginMainFrame(const BeginFrameArgs& args) override {}
+ virtual void DidBeginMainFrame() override {}
+ virtual void Layout() override {}
virtual void ApplyViewportDeltas(const gfx::Vector2d& inner_delta,
const gfx::Vector2d& outer_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {}
+ float top_controls_delta) override {}
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float page_scale,
- float top_controls_delta) OVERRIDE {}
- virtual void RequestNewOutputSurface(bool fallback) OVERRIDE {
+ float top_controls_delta) override {}
+ virtual void RequestNewOutputSurface(bool fallback) override {
layer_tree_host_->SetOutputSurface(
make_scoped_ptr<OutputSurface>(new NoMessageLoopOutputSurface));
}
- virtual void DidInitializeOutputSurface() OVERRIDE {
+ virtual void DidInitializeOutputSurface() override {
did_initialize_output_surface_ = true;
}
- virtual void WillCommit() OVERRIDE {}
- virtual void DidCommit() OVERRIDE { did_commit_ = true; }
- virtual void DidCommitAndDrawFrame() OVERRIDE {
+ virtual void WillCommit() override {}
+ virtual void DidCommit() override { did_commit_ = true; }
+ virtual void DidCommitAndDrawFrame() override {
did_commit_and_draw_frame_ = true;
}
- virtual void DidCompleteSwapBuffers() OVERRIDE {}
+ virtual void DidCompleteSwapBuffers() override {}
// LayerTreeHostSingleThreadClient overrides.
- virtual void DidPostSwapBuffers() OVERRIDE {}
- virtual void DidAbortSwapBuffers() OVERRIDE {}
+ virtual void DidPostSwapBuffers() override {}
+ virtual void DidAbortSwapBuffers() override {}
void RunTest() {
no_loop_thread_.Start();
@@ -88,7 +88,7 @@
}
// base::DelegateSimpleThread::Delegate override.
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
ASSERT_FALSE(base::MessageLoopProxy::current().get());
RunTestWithoutMessageLoop();
EXPECT_FALSE(base::MessageLoopProxy::current().get());
@@ -137,7 +137,7 @@
class LayerTreeHostNoMessageLoopSmokeTest
: public LayerTreeHostNoMessageLoopTest {
protected:
- virtual void RunTestWithoutMessageLoop() OVERRIDE {
+ virtual void RunTestWithoutMessageLoop() override {
gfx::Size size(100, 100);
// Set up root layer.
@@ -164,7 +164,7 @@
: public LayerTreeHostNoMessageLoopTest,
public DelegatedFrameResourceCollectionClient {
protected:
- virtual void RunTestWithoutMessageLoop() OVERRIDE {
+ virtual void RunTestWithoutMessageLoop() override {
resource_collection_ = new DelegatedFrameResourceCollection;
frame_provider_ = new DelegatedFrameProvider(
resource_collection_.get(), CreateFrameDataWithResource(998));
@@ -198,7 +198,7 @@
}
// DelegatedFrameResourceCollectionClient overrides.
- virtual void UnusedResourcesAreAvailable() OVERRIDE {}
+ virtual void UnusedResourcesAreAvailable() override {}
private:
scoped_ptr<DelegatedFrameData> CreateFrameDataWithResource(
diff --git a/cc/trees/layer_tree_host_unittest_occlusion.cc b/cc/trees/layer_tree_host_unittest_occlusion.cc
index 3a572d3..943299d 100644
--- a/cc/trees/layer_tree_host_unittest_occlusion.cc
+++ b/cc/trees/layer_tree_host_unittest_occlusion.cc
@@ -20,7 +20,7 @@
}
virtual bool Update(ResourceUpdateQueue* update_queue,
- const OcclusionTracker<Layer>* occlusion) OVERRIDE {
+ const OcclusionTracker<Layer>* occlusion) override {
if (!occlusion)
return false;
@@ -60,18 +60,18 @@
mask_(TestLayer::Create()) {
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
TestLayer* root = static_cast<TestLayer*>(layer_tree_host()->root_layer());
VerifyOcclusion(root);
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
void VerifyOcclusion(TestLayer* layer) const {
EXPECT_EQ(layer->expected_occlusion().ToString(),
@@ -99,7 +99,7 @@
}
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->minimum_occlusion_tracking_size = gfx::Size();
}
@@ -116,7 +116,7 @@
class LayerTreeHostOcclusionTestOcclusionSurfaceClipping
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// The child layer is a surface and the grand_child is opaque, but clipped
// to the child and root
SetLayerPropertiesForTesting(
@@ -146,7 +146,7 @@
class LayerTreeHostOcclusionTestOcclusionSurfaceClippingOpaque
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer is opaque, then it adds to the occlusion seen by the
// root_.
SetLayerPropertiesForTesting(
@@ -176,7 +176,7 @@
class LayerTreeHostOcclusionTestOcclusionTwoChildren
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// Add a second child to the root layer and the regions should merge
SetLayerPropertiesForTesting(
root_.get(), NULL, identity_matrix_,
@@ -209,7 +209,7 @@
class LayerTreeHostOcclusionTestOcclusionMask
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer has a mask on it, then it shouldn't contribute to
// occlusion on stuff below it.
SetLayerPropertiesForTesting(
@@ -242,7 +242,7 @@
class LayerTreeHostOcclusionTestOcclusionMaskBelowOcclusion
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer with a mask is below child2, then child2 should
// contribute to occlusion on everything, and child shouldn't contribute
// to the root_.
@@ -278,7 +278,7 @@
class LayerTreeHostOcclusionTestOcclusionOpacity
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer has a non-opaque opacity, then it shouldn't
// contribute to occlusion on stuff below it
SetLayerPropertiesForTesting(
@@ -311,7 +311,7 @@
class LayerTreeHostOcclusionTestOcclusionOpacityBelowOcclusion
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer with non-opaque opacity is below child2, then
// child2 should contribute to occlusion on everything, and child shouldn't
// contribute to the root_.
@@ -347,7 +347,7 @@
class LayerTreeHostOcclusionTestOcclusionBlending
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer has a blend mode, then it shouldn't
// contribute to occlusion on stuff below it
SetLayerPropertiesForTesting(
@@ -380,7 +380,7 @@
class LayerTreeHostOcclusionTestOcclusionBlendingBelowOcclusion
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer with a blend mode is below child2, then
// child2 should contribute to occlusion on everything, and child shouldn't
// contribute to the root_.
@@ -415,7 +415,7 @@
class LayerTreeHostOcclusionTestOcclusionOpacityFilter
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
FilterOperations filters;
filters.Append(FilterOperation::CreateOpacityFilter(0.5f));
@@ -467,7 +467,7 @@
class LayerTreeHostOcclusionTestOcclusionBlurFilter
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
gfx::Transform child_transform;
child_transform.Translate(250.0, 250.0);
child_transform.Rotate(90.0);
@@ -511,7 +511,7 @@
public:
static void CopyOutputCallback(scoped_ptr<CopyOutputResult> result) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer has copy request, and is below child2,
// then child should not inherit occlusion from outside its subtree.
// The child layer will still receive occlusion from inside, and
@@ -546,7 +546,7 @@
class LayerTreeHostOcclusionTestOcclusionReplica
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// If the child layer has copy request, and is below child2,
// then child should not inherit occlusion from outside its subtree.
// The child layer will still receive occlusion from inside, and
@@ -581,7 +581,7 @@
class LayerTreeHostOcclusionTestManySurfaces
: public LayerTreeHostOcclusionTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
// We create enough RenderSurfaces that it will trigger Vector reallocation
// while computing occlusion.
std::vector<scoped_refptr<TestLayer> > layers;
diff --git a/cc/trees/layer_tree_host_unittest_picture.cc b/cc/trees/layer_tree_host_unittest_picture.cc
index 731f692..a79d075 100644
--- a/cc/trees/layer_tree_host_unittest_picture.cc
+++ b/cc/trees/layer_tree_host_unittest_picture.cc
@@ -16,7 +16,7 @@
// These tests deal with picture layers.
class LayerTreeHostPictureTest : public LayerTreeTest {
protected:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
// PictureLayer can only be used with impl side painting enabled.
settings->impl_side_painting = true;
}
@@ -24,7 +24,7 @@
class LayerTreeHostPictureTestTwinLayer
: public LayerTreeHostPictureTest {
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostPictureTest::SetupTree();
scoped_refptr<FakePictureLayer> picture =
@@ -32,12 +32,12 @@
layer_tree_host()->root_layer()->AddChild(picture);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
activates_ = 0;
PostSetNeedsCommitToMainThread();
}
- virtual void DidCommit() OVERRIDE {
+ virtual void DidCommit() override {
switch (layer_tree_host()->source_frame_number()) {
case 2:
// Drop the picture layer from the tree.
@@ -52,7 +52,7 @@
}
}
- virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void WillActivateTreeOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* pending_root_impl = impl->pending_tree()->root_layer();
LayerImpl* active_root_impl = impl->active_tree()->root_layer();
@@ -88,7 +88,7 @@
EXPECT_EQ(active_picture_impl, pending_picture_impl->twin_layer());
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* active_root_impl = impl->active_tree()->root_layer();
if (active_root_impl->children().empty()) {
@@ -107,7 +107,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
FakeContentLayerClient client_;
int activates_;
diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc
index 4f79311..5993479 100644
--- a/cc/trees/layer_tree_host_unittest_proxy.cc
+++ b/cc/trees/layer_tree_host_unittest_proxy.cc
@@ -37,8 +37,8 @@
RunTest(threaded, delegating_renderer, impl_side_painting);
}
- virtual void BeginTest() OVERRIDE {}
- virtual void AfterTest() OVERRIDE {}
+ virtual void BeginTest() override {}
+ virtual void AfterTest() override {}
private:
DISALLOW_COPY_AND_ASSIGN(ProxyTest);
@@ -46,28 +46,28 @@
class ProxyTestScheduledActionsBasic : public ProxyTest {
protected:
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
proxy()->SetNeedsCommit();
}
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE {
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override {
EXPECT_EQ(0, action_phase_++);
}
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE {
+ virtual void ScheduledActionSendBeginMainFrame() override {
EXPECT_EQ(1, action_phase_++);
}
- virtual void ScheduledActionCommit() OVERRIDE {
+ virtual void ScheduledActionCommit() override {
EXPECT_EQ(2, action_phase_++);
}
- virtual void ScheduledActionDrawAndSwapIfPossible() OVERRIDE {
+ virtual void ScheduledActionDrawAndSwapIfPossible() override {
EXPECT_EQ(3, action_phase_++);
EndTest();
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(4, action_phase_);
}
@@ -109,7 +109,7 @@
ThreadProxyTestSetNeedsCommit() {}
virtual ~ThreadProxyTestSetNeedsCommit() {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
EXPECT_FALSE(ThreadProxyMainOnly().commit_requested);
EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread);
@@ -119,7 +119,7 @@
EXPECT_TRUE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread);
}
- virtual void DidBeginMainFrame() OVERRIDE {
+ virtual void DidBeginMainFrame() override {
EXPECT_FALSE(ThreadProxyMainOnly().commit_requested);
EXPECT_FALSE(ThreadProxyMainOnly().commit_request_sent_to_impl_thread);
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 4f18d00..82cee89 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -33,7 +33,7 @@
scroll_amount_(2, -1),
num_scrolls_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
Layer* root_layer = layer_tree_host()->root_layer();
scoped_refptr<Layer> scroll_layer = Layer::Create();
root_layer->AddChild(scroll_layer);
@@ -48,7 +48,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
Layer* root = layer_tree_host()->root_layer();
Layer* scroll_layer = root->children()[0].get();
if (!layer_tree_host()->source_frame_number()) {
@@ -63,7 +63,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root = impl->active_tree()->root_layer();
LayerImpl* scroll_layer = root->children()[0];
EXPECT_VECTOR_EQ(gfx::Vector2d(), scroll_layer->ScrollDelta());
@@ -89,11 +89,11 @@
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
num_scrolls_++;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(1, num_scrolls_); }
+ virtual void AfterTest() override { EXPECT_EQ(1, num_scrolls_); }
private:
gfx::ScrollOffset initial_scroll_;
@@ -110,7 +110,7 @@
LayerTreeHostScrollTestScrollMultipleRedraw()
: initial_scroll_(40, 10), scroll_amount_(-3, 17), num_scrolls_(0) {}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
Layer* root_layer = layer_tree_host()->root_layer();
scroll_layer_ = Layer::Create();
root_layer->AddChild(scroll_layer_);
@@ -125,7 +125,7 @@
PostSetNeedsCommitToMainThread();
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
switch (layer_tree_host()->source_frame_number()) {
case 0:
EXPECT_VECTOR_EQ(scroll_layer_->scroll_offset(), initial_scroll_);
@@ -144,7 +144,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* scroll_layer =
impl->active_tree()->LayerById(scroll_layer_->id());
if (impl->active_tree()->source_frame_number() == 0 &&
@@ -180,11 +180,11 @@
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
num_scrolls_++;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(1, num_scrolls_); }
+ virtual void AfterTest() override { EXPECT_EQ(1, num_scrolls_); }
private:
gfx::ScrollOffset initial_scroll_;
@@ -210,9 +210,9 @@
num_impl_commits_(0),
num_impl_scrolls_(0) {}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostScrollTest::SetupTree();
Layer* root_layer = layer_tree_host()->root_layer();
scoped_refptr<Layer> root_scroll_layer = Layer::Create();
@@ -228,7 +228,7 @@
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f);
}
- virtual void WillBeginMainFrame() OVERRIDE {
+ virtual void WillBeginMainFrame() override {
num_will_begin_main_frames_++;
Layer* root_scroll_layer =
layer_tree_host()->root_layer()->children()[0].get();
@@ -280,17 +280,17 @@
}
}
- virtual void DidBeginMainFrame() OVERRIDE { num_did_begin_main_frames_++; }
+ virtual void DidBeginMainFrame() override { num_did_begin_main_frames_++; }
- virtual void WillCommit() OVERRIDE { num_will_commits_++; }
+ virtual void WillCommit() override { num_will_commits_++; }
- virtual void DidCommit() OVERRIDE { num_did_commits_++; }
+ virtual void DidCommit() override { num_did_commits_++; }
- virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
num_impl_commits_++;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root_scroll_layer =
impl->active_tree()->root_layer()->children()[0];
@@ -360,11 +360,11 @@
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
num_impl_scrolls_++;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(3, num_impl_scrolls_);
// Verify that the embedder sees aborted commits as real commits.
EXPECT_EQ(4, num_will_begin_main_frames_);
@@ -394,7 +394,7 @@
public:
LayerTreeHostScrollTestFractionalScroll() : scroll_amount_(1.75, 0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostScrollTest::SetupTree();
Layer* root_layer = layer_tree_host()->root_layer();
scoped_refptr<Layer> root_scroll_layer = Layer::Create();
@@ -411,11 +411,11 @@
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root = impl->active_tree()->root_layer();
LayerImpl* scroll_layer = root->children()[0];
@@ -447,7 +447,7 @@
scroll_layer->ScrollBy(scroll_amount_);
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
gfx::Vector2dF scroll_amount_;
@@ -463,7 +463,7 @@
scroll_amount_(2, -1),
num_scrolls_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
layer_tree_host()->SetDeviceScaleFactor(device_scale_factor_);
scoped_refptr<Layer> root_layer = Layer::Create();
@@ -516,9 +516,9 @@
LayerTreeHostScrollTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void WillCommit() OVERRIDE {
+ virtual void WillCommit() override {
// Keep the test committing (otherwise the early out for no update
// will stall the test).
if (layer_tree_host()->source_frame_number() < 2) {
@@ -532,11 +532,11 @@
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
num_scrolls_++;
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
EXPECT_VECTOR_EQ(gfx::Vector2d(),
expected_no_scroll_layer_->scroll_offset());
@@ -561,7 +561,7 @@
}
}
- virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root_impl = impl->active_tree()->root_layer();
FakePictureLayerImpl* root_scroll_layer_impl =
static_cast<FakePictureLayerImpl*>(root_impl->children()[0]);
@@ -632,7 +632,7 @@
}
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
if (scroll_child_layer_) {
EXPECT_EQ(0, num_scrolls_);
EXPECT_VECTOR_EQ(gfx::ScrollOffsetWithDelta(javascript_scroll_,
@@ -748,11 +748,11 @@
class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest {
public:
- virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+ virtual void InitializeSettings(LayerTreeSettings* settings) override {
settings->impl_side_painting = true;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
if (impl->pending_tree())
impl->SetNeedsRedraw();
}
@@ -767,7 +767,7 @@
impl_thread_scroll2_(-3, 10),
num_scrolls_(0) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostScrollTest::SetupTree();
Layer* root_layer = layer_tree_host()->root_layer();
scoped_refptr<Layer> root_scroll_layer = Layer::Create();
@@ -785,11 +785,11 @@
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void Layout() OVERRIDE {
+ virtual void Layout() override {
Layer* root = layer_tree_host()->root_layer();
Layer* scroll_layer = root->children()[0].get();
if (!layer_tree_host()->source_frame_number()) {
@@ -807,14 +807,14 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
// We force a second draw here of the first commit before activating
// the second commit.
if (impl->active_tree()->source_frame_number() == 0)
impl->SetNeedsRedraw();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
ImplSidePaintingScrollTest::DrawLayersOnThread(impl);
LayerImpl* root = impl->active_tree()->root_layer();
@@ -874,11 +874,11 @@
virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
float scale,
- float top_controls_delta) OVERRIDE {
+ float top_controls_delta) override {
num_scrolls_++;
}
- virtual void AfterTest() OVERRIDE { EXPECT_EQ(1, num_scrolls_); }
+ virtual void AfterTest() override { EXPECT_EQ(1, num_scrolls_); }
private:
gfx::ScrollOffset initial_scroll_;
@@ -900,7 +900,7 @@
ImplSidePaintingScrollTestImplOnlyScroll()
: initial_scroll_(20, 10), impl_thread_scroll_(-2, 3) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeHostScrollTest::SetupTree();
Layer* root_layer = layer_tree_host()->root_layer();
scoped_refptr<Layer> root_scroll_layer = Layer::Create();
@@ -918,11 +918,11 @@
layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.01f, 100.f);
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void WillCommit() OVERRIDE {
+ virtual void WillCommit() override {
Layer* root = layer_tree_host()->root_layer();
Layer* scroll_layer = root->children()[0].get();
switch (layer_tree_host()->source_frame_number()) {
@@ -938,7 +938,7 @@
}
}
- virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
// Scroll after the 2nd commit has started.
if (impl->active_tree()->source_frame_number() == 0) {
LayerImpl* active_root = impl->active_tree()->root_layer();
@@ -949,7 +949,7 @@
}
}
- virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
// We force a second draw here of the first commit before activating
// the second commit.
LayerImpl* active_root = impl->active_tree()->root_layer();
@@ -998,7 +998,7 @@
}
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
ImplSidePaintingScrollTest::DrawLayersOnThread(impl);
LayerImpl* root = impl->active_tree()->root_layer();
@@ -1020,7 +1020,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
private:
gfx::ScrollOffset initial_scroll_;
@@ -1034,15 +1034,15 @@
public:
LayerTreeHostScrollTestScrollZeroMaxScrollOffset() {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
LayerTreeTest::SetupTree();
scoped_refptr<Layer> scroll_layer = Layer::Create();
layer_tree_host()->root_layer()->AddChild(scroll_layer);
}
- virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+ virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); }
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root = impl->active_tree()->root_layer();
LayerImpl* scroll_layer = root->children()[0];
scroll_layer->SetScrollClipLayer(root->id());
@@ -1069,7 +1069,7 @@
EndTest();
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
};
SINGLE_AND_MULTI_THREAD_TEST_F(
@@ -1081,17 +1081,17 @@
bool* received_stop_flinging)
: task_runner_(runner), received_stop_flinging_(received_stop_flinging) {}
- virtual void WillShutdown() OVERRIDE {
+ virtual void WillShutdown() override {
if (!received_stop_flinging_)
ADD_FAILURE() << "WillShutdown() called before fling stopped";
}
- virtual void Animate(base::TimeTicks time) OVERRIDE {
+ virtual void Animate(base::TimeTicks time) override {
if (!task_runner_->BelongsToCurrentThread())
ADD_FAILURE() << "Animate called on wrong thread";
}
- virtual void MainThreadHasStoppedFlinging() OVERRIDE {
+ virtual void MainThreadHasStoppedFlinging() override {
if (!task_runner_->BelongsToCurrentThread())
ADD_FAILURE() << "MainThreadHasStoppedFlinging called on wrong thread";
*received_stop_flinging_ = true;
@@ -1100,7 +1100,7 @@
virtual void DidOverscroll(
const gfx::PointF& causal_event_viewport_point,
const gfx::Vector2dF& accumulated_overscroll,
- const gfx::Vector2dF& latest_overscroll_delta) OVERRIDE {
+ const gfx::Vector2dF& latest_overscroll_delta) override {
if (!task_runner_->BelongsToCurrentThread())
ADD_FAILURE() << "DidOverscroll called on wrong thread";
}
@@ -1155,7 +1155,7 @@
LayerTreeHostScrollTestLayerStructureChange()
: scroll_destroy_whole_tree_(false) {}
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root_layer = Layer::Create();
root_layer->SetBounds(gfx::Size(10, 10));
@@ -1168,11 +1168,11 @@
LayerTreeHostScrollTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
PostSetNeedsCommitToMainThread();
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
LayerImpl* root = impl->active_tree()->root_layer();
switch (impl->active_tree()->source_frame_number()) {
case 0:
@@ -1187,7 +1187,7 @@
}
}
- virtual void AfterTest() OVERRIDE {}
+ virtual void AfterTest() override {}
virtual void DidScroll(Layer* layer) {
if (scroll_destroy_whole_tree_) {
diff --git a/cc/trees/layer_tree_host_unittest_video.cc b/cc/trees/layer_tree_host_unittest_video.cc
index 7d0bb41..8d8b130 100644
--- a/cc/trees/layer_tree_host_unittest_video.cc
+++ b/cc/trees/layer_tree_host_unittest_video.cc
@@ -22,7 +22,7 @@
class LayerTreeHostVideoTestSetNeedsDisplay
: public LayerTreeHostVideoTest {
public:
- virtual void SetupTree() OVERRIDE {
+ virtual void SetupTree() override {
scoped_refptr<Layer> root = Layer::Create();
root->SetBounds(gfx::Size(10, 10));
root->SetIsDrawable(true);
@@ -39,14 +39,14 @@
LayerTreeHostVideoTest::SetupTree();
}
- virtual void BeginTest() OVERRIDE {
+ virtual void BeginTest() override {
num_draws_ = 0;
PostSetNeedsCommitToMainThread();
}
virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
LayerTreeHostImpl::FrameData* frame,
- DrawResult draw_result) OVERRIDE {
+ DrawResult draw_result) override {
LayerImpl* root_layer = host_impl->active_tree()->root_layer();
RenderSurfaceImpl* root_surface = root_layer->render_surface();
gfx::RectF damage_rect =
@@ -70,7 +70,7 @@
return draw_result;
}
- virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+ virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
VideoLayerImpl* video = static_cast<VideoLayerImpl*>(
host_impl->active_tree()->root_layer()->children()[0]);
@@ -82,7 +82,7 @@
++num_draws_;
}
- virtual void AfterTest() OVERRIDE {
+ virtual void AfterTest() override {
EXPECT_EQ(2, num_draws_);
}
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 948c2ba..f5dda6e 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -50,16 +50,16 @@
// LayerScrollOffsetDelegate implementation.
virtual void SetTotalScrollOffset(
- const gfx::ScrollOffset& new_offset) OVERRIDE {
+ const gfx::ScrollOffset& new_offset) override {
last_set_scroll_offset_ = new_offset;
layer_tree_impl_->UpdateScrollOffsetDelegate();
}
- virtual gfx::ScrollOffset GetTotalScrollOffset() OVERRIDE {
+ virtual gfx::ScrollOffset GetTotalScrollOffset() override {
return layer_tree_impl_->GetDelegatedScrollOffset(layer_);
}
- virtual bool IsExternalFlingActive() const OVERRIDE {
+ virtual bool IsExternalFlingActive() const override {
return delegate_->IsExternalFlingActive();
}
@@ -296,7 +296,7 @@
return;
while (current_layer) {
- current_layer->ScrollbarParametersDidChange();
+ current_layer->ScrollbarParametersDidChange(false);
current_layer = current_layer->parent();
}
}
@@ -792,16 +792,25 @@
DCHECK(settings().scrollbar_fade_duration_ms);
base::TimeDelta delay =
base::TimeDelta::FromMilliseconds(settings().scrollbar_fade_delay_ms);
+ base::TimeDelta resize_delay = base::TimeDelta::FromMilliseconds(
+ settings().scrollbar_fade_resize_delay_ms);
base::TimeDelta duration =
base::TimeDelta::FromMilliseconds(settings().scrollbar_fade_duration_ms);
switch (settings().scrollbar_animator) {
case LayerTreeSettings::LinearFade: {
return ScrollbarAnimationControllerLinearFade::Create(
- scrolling_layer, layer_tree_host_impl_, delay, duration);
+ scrolling_layer,
+ layer_tree_host_impl_,
+ delay,
+ resize_delay,
+ duration);
}
case LayerTreeSettings::Thinning: {
- return ScrollbarAnimationControllerThinning::Create(
- scrolling_layer, layer_tree_host_impl_, delay, duration);
+ return ScrollbarAnimationControllerThinning::Create(scrolling_layer,
+ layer_tree_host_impl_,
+ delay,
+ resize_delay,
+ duration);
}
case LayerTreeSettings::NoAnimator:
NOTREACHED();
diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc
index b28272d..a304cba 100644
--- a/cc/trees/layer_tree_settings.cc
+++ b/cc/trees/layer_tree_settings.cc
@@ -33,6 +33,7 @@
create_low_res_tiling(false),
scrollbar_animator(NoAnimator),
scrollbar_fade_delay_ms(0),
+ scrollbar_fade_resize_delay_ms(0),
scrollbar_fade_duration_ms(0),
solid_color_scrollbar_color(SK_ColorWHITE),
calculate_top_controls_position(false),
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index a8ef483..cd3eb42 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -48,6 +48,7 @@
};
ScrollbarAnimator scrollbar_animator;
int scrollbar_fade_delay_ms;
+ int scrollbar_fade_resize_delay_ms;
int scrollbar_fade_duration_ms;
SkColor solid_color_scrollbar_color;
bool calculate_top_controls_position;
diff --git a/cc/trees/occlusion.cc b/cc/trees/occlusion.cc
index d9da938..70ee32c 100644
--- a/cc/trees/occlusion.cc
+++ b/cc/trees/occlusion.cc
@@ -20,14 +20,23 @@
occlusion_from_inside_target_(occlusion_from_inside_target) {
}
+Occlusion Occlusion::GetOcclusionWithGivenDrawTransform(
+ const gfx::Transform& transform) const {
+ return Occlusion(
+ transform, occlusion_from_outside_target_, occlusion_from_inside_target_);
+}
+
+bool Occlusion::HasOcclusion() const {
+ return !occlusion_from_inside_target_.IsEmpty() ||
+ !occlusion_from_outside_target_.IsEmpty();
+}
+
bool Occlusion::IsOccluded(const gfx::Rect& content_rect) const {
if (content_rect.IsEmpty())
return true;
- if (occlusion_from_inside_target_.IsEmpty() &&
- occlusion_from_outside_target_.IsEmpty()) {
+ if (!HasOcclusion())
return false;
- }
gfx::Rect unoccluded_rect_in_target_surface =
GetUnoccludedRectInTargetSurface(content_rect);
@@ -39,10 +48,8 @@
if (content_rect.IsEmpty())
return content_rect;
- if (occlusion_from_inside_target_.IsEmpty() &&
- occlusion_from_outside_target_.IsEmpty()) {
+ if (!HasOcclusion())
return content_rect;
- }
gfx::Rect unoccluded_rect_in_target_surface =
GetUnoccludedRectInTargetSurface(content_rect);
diff --git a/cc/trees/occlusion.h b/cc/trees/occlusion.h
index 60493cc..6d1e5b1 100644
--- a/cc/trees/occlusion.h
+++ b/cc/trees/occlusion.h
@@ -19,7 +19,10 @@
Occlusion(const gfx::Transform& draw_transform,
const SimpleEnclosedRegion& occlusion_from_outside_target,
const SimpleEnclosedRegion& occlusion_from_inside_target);
+ Occlusion GetOcclusionWithGivenDrawTransform(
+ const gfx::Transform& transform) const;
+ bool HasOcclusion() const;
bool IsOccluded(const gfx::Rect& content_rect) const;
gfx::Rect GetUnoccludedContentRect(const gfx::Rect& content_rect) const;
diff --git a/cc/trees/occlusion_tracker_unittest.cc b/cc/trees/occlusion_tracker_unittest.cc
index 3c6c440..6ab3397 100644
--- a/cc/trees/occlusion_tracker_unittest.cc
+++ b/cc/trees/occlusion_tracker_unittest.cc
@@ -33,7 +33,7 @@
SetIsDrawable(true);
}
- virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE {
+ virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override {
if (override_opaque_contents_rect_) {
return SimpleEnclosedRegion(
gfx::IntersectRects(opaque_contents_rect_, visible_content_rect()));
@@ -59,7 +59,7 @@
SetDrawsContent(true);
}
- virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const OVERRIDE {
+ virtual SimpleEnclosedRegion VisibleContentOpaqueRegion() const override {
if (override_opaque_contents_rect_) {
return SimpleEnclosedRegion(
gfx::IntersectRects(opaque_contents_rect_, visible_content_rect()));
diff --git a/cc/trees/occlusion_unittest.cc b/cc/trees/occlusion_unittest.cc
new file mode 100644
index 0000000..becc7a3
--- /dev/null
+++ b/cc/trees/occlusion_unittest.cc
@@ -0,0 +1,272 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/trees/occlusion.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace cc {
+namespace {
+
+TEST(OcclusionTest, HasOcclusion) {
+ Occlusion empty;
+ EXPECT_FALSE(empty.HasOcclusion());
+
+ empty = Occlusion(
+ gfx::Transform(), SimpleEnclosedRegion(), SimpleEnclosedRegion());
+ EXPECT_FALSE(empty.HasOcclusion());
+
+ Occlusion outside_nonempty(
+ gfx::Transform(), SimpleEnclosedRegion(10, 10), SimpleEnclosedRegion());
+ EXPECT_TRUE(outside_nonempty.HasOcclusion());
+
+ Occlusion inside_nonempty(
+ gfx::Transform(), SimpleEnclosedRegion(), SimpleEnclosedRegion(10, 10));
+ EXPECT_TRUE(inside_nonempty.HasOcclusion());
+
+ Occlusion both_nonempty(gfx::Transform(),
+ SimpleEnclosedRegion(10, 10),
+ SimpleEnclosedRegion(10, 10));
+ EXPECT_TRUE(both_nonempty.HasOcclusion());
+}
+
+#define EXPECT_OCCLUSION(occlusion, rects, ...) \
+ { \
+ bool expected[] = {__VA_ARGS__}; \
+ ASSERT_EQ(arraysize(rects), arraysize(expected)); \
+ for (size_t i = 0; i < arraysize(rects); ++i) \
+ EXPECT_EQ(expected[i], occlusion.IsOccluded(rects[i])) \
+ << "Test failed for index " << i << "."; \
+ }
+
+TEST(OcclusionTest, IsOccludedNoTransform) {
+ gfx::Rect rects[] = {gfx::Rect(10, 10),
+ gfx::Rect(10, 0, 10, 10),
+ gfx::Rect(0, 10, 10, 10),
+ gfx::Rect(10, 10, 10, 10)};
+
+ Occlusion no_occlusion;
+ EXPECT_OCCLUSION(no_occlusion, rects, false, false, false, false);
+
+ Occlusion all_occluded_outside(
+ gfx::Transform(), SimpleEnclosedRegion(20, 20), SimpleEnclosedRegion());
+ EXPECT_OCCLUSION(all_occluded_outside, rects, true, true, true, true);
+
+ Occlusion all_occluded_inside(
+ gfx::Transform(), SimpleEnclosedRegion(), SimpleEnclosedRegion(20, 20));
+ EXPECT_OCCLUSION(all_occluded_inside, rects, true, true, true, true);
+
+ Occlusion all_occluded_mixed(gfx::Transform(),
+ SimpleEnclosedRegion(10, 20),
+ SimpleEnclosedRegion(10, 0, 10, 20));
+ EXPECT_OCCLUSION(all_occluded_mixed, rects, true, true, true, true);
+
+ Occlusion some_occluded(gfx::Transform(),
+ SimpleEnclosedRegion(10, 10),
+ SimpleEnclosedRegion(10, 10, 10, 10));
+ EXPECT_OCCLUSION(some_occluded, rects, true, false, false, true);
+}
+
+TEST(OcclusionTest, IsOccludedScaled) {
+ gfx::Rect rects[] = {gfx::Rect(10, 10),
+ gfx::Rect(10, 0, 10, 10),
+ gfx::Rect(0, 10, 10, 10),
+ gfx::Rect(10, 10, 10, 10)};
+
+ gfx::Transform half_scale;
+ half_scale.Scale(0.5, 0.5);
+
+ gfx::Transform double_scale;
+ double_scale.Scale(2, 2);
+
+ Occlusion all_occluded_outside_half(
+ half_scale, SimpleEnclosedRegion(10, 10), SimpleEnclosedRegion());
+ Occlusion all_occluded_outside_double(
+ double_scale, SimpleEnclosedRegion(40, 40), SimpleEnclosedRegion());
+ EXPECT_OCCLUSION(all_occluded_outside_half, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_outside_double, rects, true, true, true, true);
+
+ Occlusion all_occluded_inside_half(
+ half_scale, SimpleEnclosedRegion(), SimpleEnclosedRegion(10, 10));
+ Occlusion all_occluded_inside_double(
+ double_scale, SimpleEnclosedRegion(), SimpleEnclosedRegion(40, 40));
+ EXPECT_OCCLUSION(all_occluded_inside_half, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_inside_double, rects, true, true, true, true);
+
+ Occlusion all_occluded_mixed_half(half_scale,
+ SimpleEnclosedRegion(5, 10),
+ SimpleEnclosedRegion(5, 0, 5, 10));
+ Occlusion all_occluded_mixed_double(double_scale,
+ SimpleEnclosedRegion(20, 40),
+ SimpleEnclosedRegion(20, 0, 20, 40));
+ EXPECT_OCCLUSION(all_occluded_mixed_half, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_mixed_double, rects, true, true, true, true);
+
+ Occlusion some_occluded_half(
+ half_scale, SimpleEnclosedRegion(5, 5), SimpleEnclosedRegion(5, 5, 5, 5));
+ Occlusion some_occluded_double(double_scale,
+ SimpleEnclosedRegion(20, 20),
+ SimpleEnclosedRegion(20, 20, 20, 20));
+ EXPECT_OCCLUSION(some_occluded_half, rects, true, false, false, true);
+ EXPECT_OCCLUSION(some_occluded_double, rects, true, false, false, true);
+}
+
+TEST(OcclusionTest, IsOccludedTranslated) {
+ gfx::Rect rects[] = {gfx::Rect(10, 10),
+ gfx::Rect(10, 0, 10, 10),
+ gfx::Rect(0, 10, 10, 10),
+ gfx::Rect(10, 10, 10, 10)};
+
+ gfx::Transform move_left;
+ move_left.Translate(-100, 0);
+
+ gfx::Transform move_down;
+ move_down.Translate(0, 100);
+
+ Occlusion all_occluded_outside_left(
+ move_left, SimpleEnclosedRegion(-100, 0, 20, 20), SimpleEnclosedRegion());
+ Occlusion all_occluded_outside_down(
+ move_down, SimpleEnclosedRegion(0, 100, 20, 20), SimpleEnclosedRegion());
+ EXPECT_OCCLUSION(all_occluded_outside_left, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_outside_down, rects, true, true, true, true);
+
+ Occlusion all_occluded_inside_left(
+ move_left, SimpleEnclosedRegion(), SimpleEnclosedRegion(-100, 0, 20, 20));
+ Occlusion all_occluded_inside_down(
+ move_down, SimpleEnclosedRegion(), SimpleEnclosedRegion(0, 100, 20, 20));
+ EXPECT_OCCLUSION(all_occluded_inside_left, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_inside_down, rects, true, true, true, true);
+
+ Occlusion all_occluded_mixed_left(move_left,
+ SimpleEnclosedRegion(-100, 0, 10, 20),
+ SimpleEnclosedRegion(-90, 0, 10, 20));
+ Occlusion all_occluded_mixed_down(move_down,
+ SimpleEnclosedRegion(0, 100, 10, 20),
+ SimpleEnclosedRegion(10, 100, 10, 20));
+ EXPECT_OCCLUSION(all_occluded_mixed_left, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_mixed_down, rects, true, true, true, true);
+
+ Occlusion some_occluded_left(move_left,
+ SimpleEnclosedRegion(-100, 0, 10, 10),
+ SimpleEnclosedRegion(-90, 10, 10, 10));
+ Occlusion some_occluded_down(move_down,
+ SimpleEnclosedRegion(0, 100, 10, 10),
+ SimpleEnclosedRegion(10, 110, 10, 10));
+ EXPECT_OCCLUSION(some_occluded_left, rects, true, false, false, true);
+ EXPECT_OCCLUSION(some_occluded_down, rects, true, false, false, true);
+}
+
+TEST(OcclusionTest, IsOccludedScaledAfterConstruction) {
+ gfx::Rect rects[] = {gfx::Rect(10, 10),
+ gfx::Rect(10, 0, 10, 10),
+ gfx::Rect(0, 10, 10, 10),
+ gfx::Rect(10, 10, 10, 10)};
+
+ gfx::Transform half_transform;
+ half_transform.Scale(0.5, 0.5);
+
+ gfx::Transform double_transform;
+ double_transform.Scale(2, 2);
+
+ Occlusion all_occluded_outside(
+ gfx::Transform(), SimpleEnclosedRegion(10, 10), SimpleEnclosedRegion());
+ Occlusion all_occluded_outside_half =
+ all_occluded_outside.GetOcclusionWithGivenDrawTransform(half_transform);
+
+ all_occluded_outside = Occlusion(
+ gfx::Transform(), SimpleEnclosedRegion(40, 40), SimpleEnclosedRegion());
+ Occlusion all_occluded_outside_double =
+ all_occluded_outside.GetOcclusionWithGivenDrawTransform(double_transform);
+
+ EXPECT_OCCLUSION(all_occluded_outside_half, rects, true, true, true, true);
+ EXPECT_OCCLUSION(all_occluded_outside_double, rects, true, true, true, true);
+
+ Occlusion some_occluded(gfx::Transform(),
+ SimpleEnclosedRegion(5, 5),
+ SimpleEnclosedRegion(5, 5, 5, 5));
+ Occlusion some_occluded_half =
+ some_occluded.GetOcclusionWithGivenDrawTransform(half_transform);
+
+ some_occluded = Occlusion(gfx::Transform(),
+ SimpleEnclosedRegion(20, 20),
+ SimpleEnclosedRegion(20, 20, 20, 20));
+ Occlusion some_occluded_double =
+ some_occluded.GetOcclusionWithGivenDrawTransform(double_transform);
+
+ EXPECT_OCCLUSION(some_occluded_half, rects, true, false, false, true);
+ EXPECT_OCCLUSION(some_occluded_double, rects, true, false, false, true);
+}
+
+TEST(OcclusionTest, GetUnoccludedContentRectNoTransform) {
+ Occlusion some_occluded(gfx::Transform(),
+ SimpleEnclosedRegion(10, 10),
+ SimpleEnclosedRegion(10, 10, 10, 10));
+
+ gfx::Rect full_query_result =
+ some_occluded.GetUnoccludedContentRect(gfx::Rect(20, 20));
+ EXPECT_EQ(gfx::Rect(20, 20), full_query_result);
+
+ gfx::Rect half_query_result =
+ some_occluded.GetUnoccludedContentRect(gfx::Rect(10, 0, 10, 20));
+ EXPECT_EQ(gfx::Rect(10, 0, 10, 10), half_query_result);
+}
+
+TEST(OcclusionTest, GetUnoccludedContentRectScaled) {
+ gfx::Transform half_scale;
+ half_scale.Scale(0.5, 0.5);
+
+ gfx::Transform double_scale;
+ double_scale.Scale(2, 2);
+
+ Occlusion some_occluded_half(
+ half_scale, SimpleEnclosedRegion(5, 5), SimpleEnclosedRegion(5, 5, 5, 5));
+ Occlusion some_occluded_double(double_scale,
+ SimpleEnclosedRegion(20, 20),
+ SimpleEnclosedRegion(20, 20, 20, 20));
+ gfx::Rect full_query_result_half =
+ some_occluded_half.GetUnoccludedContentRect(gfx::Rect(20, 20));
+ gfx::Rect full_query_result_double =
+ some_occluded_double.GetUnoccludedContentRect(gfx::Rect(20, 20));
+ EXPECT_EQ(gfx::Rect(20, 20), full_query_result_half);
+ EXPECT_EQ(gfx::Rect(20, 20), full_query_result_double);
+
+ gfx::Rect half_query_result_half =
+ some_occluded_half.GetUnoccludedContentRect(gfx::Rect(10, 0, 10, 20));
+ gfx::Rect half_query_result_double =
+ some_occluded_half.GetUnoccludedContentRect(gfx::Rect(10, 0, 10, 20));
+ EXPECT_EQ(gfx::Rect(10, 0, 10, 10), half_query_result_half);
+ EXPECT_EQ(gfx::Rect(10, 0, 10, 10), half_query_result_double);
+}
+
+TEST(OcclusionTest, GetUnoccludedContentRectTranslated) {
+ gfx::Transform move_left;
+ move_left.Translate(-100, 0);
+
+ gfx::Transform move_down;
+ move_down.Translate(0, 100);
+
+ Occlusion some_occluded_left(move_left,
+ SimpleEnclosedRegion(-100, 0, 10, 10),
+ SimpleEnclosedRegion(-90, 10, 10, 10));
+ Occlusion some_occluded_down(move_down,
+ SimpleEnclosedRegion(0, 100, 0, 10),
+ SimpleEnclosedRegion(10, 110, 10, 10));
+
+ gfx::Rect full_query_result_left =
+ some_occluded_left.GetUnoccludedContentRect(gfx::Rect(20, 20));
+ gfx::Rect full_query_result_down =
+ some_occluded_down.GetUnoccludedContentRect(gfx::Rect(20, 20));
+ EXPECT_EQ(gfx::Rect(20, 20), full_query_result_left);
+ EXPECT_EQ(gfx::Rect(20, 20), full_query_result_down);
+
+ gfx::Rect half_query_result_left =
+ some_occluded_left.GetUnoccludedContentRect(gfx::Rect(10, 0, 10, 20));
+ gfx::Rect half_query_result_down =
+ some_occluded_down.GetUnoccludedContentRect(gfx::Rect(10, 0, 10, 20));
+ EXPECT_EQ(gfx::Rect(10, 0, 10, 10), half_query_result_left);
+ EXPECT_EQ(gfx::Rect(10, 0, 10, 10), half_query_result_down);
+}
+
+} // namespace
+} // namespace cc
diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
index 17aec8e..21b9f88 100644
--- a/cc/trees/single_thread_proxy.h
+++ b/cc/trees/single_thread_proxy.h
@@ -32,79 +32,79 @@
virtual ~SingleThreadProxy();
// Proxy implementation
- virtual void FinishAllRendering() OVERRIDE;
- virtual bool IsStarted() const OVERRIDE;
- virtual void SetOutputSurface(scoped_ptr<OutputSurface>) OVERRIDE;
- virtual void SetLayerTreeHostClientReady() OVERRIDE;
- virtual void SetVisible(bool visible) OVERRIDE;
- virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
- virtual void SetNeedsAnimate() OVERRIDE;
- virtual void SetNeedsUpdateLayers() OVERRIDE;
- virtual void SetNeedsCommit() OVERRIDE;
- virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) OVERRIDE;
- virtual void SetNextCommitWaitsForActivation() OVERRIDE;
- virtual void NotifyInputThrottledUntilCommit() OVERRIDE {}
- virtual void SetDeferCommits(bool defer_commits) OVERRIDE;
- virtual bool CommitRequested() const OVERRIDE;
- virtual bool BeginMainFrameRequested() const OVERRIDE;
- virtual void MainThreadHasStoppedFlinging() OVERRIDE {}
- virtual void Start() OVERRIDE;
- virtual void Stop() OVERRIDE;
- virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
- virtual void ForceSerializeOnSwapBuffers() OVERRIDE;
- virtual bool SupportsImplScrolling() const OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* state) const OVERRIDE;
- virtual bool MainFrameWillHappenForTesting() OVERRIDE;
+ virtual void FinishAllRendering() override;
+ virtual bool IsStarted() const override;
+ virtual void SetOutputSurface(scoped_ptr<OutputSurface>) override;
+ virtual void SetLayerTreeHostClientReady() override;
+ virtual void SetVisible(bool visible) override;
+ virtual const RendererCapabilities& GetRendererCapabilities() const override;
+ virtual void SetNeedsAnimate() override;
+ virtual void SetNeedsUpdateLayers() override;
+ virtual void SetNeedsCommit() override;
+ virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) override;
+ virtual void SetNextCommitWaitsForActivation() override;
+ virtual void NotifyInputThrottledUntilCommit() override {}
+ virtual void SetDeferCommits(bool defer_commits) override;
+ virtual bool CommitRequested() const override;
+ virtual bool BeginMainFrameRequested() const override;
+ virtual void MainThreadHasStoppedFlinging() override {}
+ virtual void Start() override;
+ virtual void Stop() override;
+ virtual size_t MaxPartialTextureUpdates() const override;
+ virtual void ForceSerializeOnSwapBuffers() override;
+ virtual bool SupportsImplScrolling() const override;
+ virtual void AsValueInto(base::debug::TracedValue* state) const override;
+ virtual bool MainFrameWillHappenForTesting() override;
// SchedulerClient implementation
- virtual BeginFrameSource* ExternalBeginFrameSource() OVERRIDE;
- virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE;
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE;
- virtual DrawResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE;
- virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE;
- virtual void ScheduledActionCommit() OVERRIDE;
- virtual void ScheduledActionAnimate() OVERRIDE;
- virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE;
- virtual void ScheduledActionActivateSyncTree() OVERRIDE;
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE;
- virtual void ScheduledActionManageTiles() OVERRIDE;
- virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE;
- virtual base::TimeDelta DrawDurationEstimate() OVERRIDE;
- virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE;
- virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE;
- virtual void DidBeginImplFrameDeadline() OVERRIDE;
+ virtual BeginFrameSource* ExternalBeginFrameSource() override;
+ virtual void WillBeginImplFrame(const BeginFrameArgs& args) override;
+ virtual void ScheduledActionSendBeginMainFrame() override;
+ virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override;
+ virtual DrawResult ScheduledActionDrawAndSwapForced() override;
+ virtual void ScheduledActionCommit() override;
+ virtual void ScheduledActionAnimate() override;
+ virtual void ScheduledActionUpdateVisibleTiles() override;
+ virtual void ScheduledActionActivateSyncTree() override;
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override;
+ virtual void ScheduledActionManageTiles() override;
+ virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) override;
+ virtual base::TimeDelta DrawDurationEstimate() override;
+ virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override;
+ virtual base::TimeDelta CommitToActivateDurationEstimate() override;
+ virtual void DidBeginImplFrameDeadline() override;
// LayerTreeHostImplClient implementation
- virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE;
- virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE;
+ virtual void UpdateRendererCapabilitiesOnImplThread() override;
+ virtual void DidLoseOutputSurfaceOnImplThread() override;
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE {}
- virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) OVERRIDE {}
- virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE {}
- virtual void DidSwapBuffersOnImplThread() OVERRIDE;
- virtual void DidSwapBuffersCompleteOnImplThread() OVERRIDE;
- virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE;
- virtual void NotifyReadyToActivate() OVERRIDE;
- virtual void SetNeedsRedrawOnImplThread() OVERRIDE;
+ base::TimeDelta interval) override {}
+ virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override {}
+ virtual void SetMaxSwapsPendingOnImplThread(int max) override {}
+ virtual void DidSwapBuffersOnImplThread() override;
+ virtual void DidSwapBuffersCompleteOnImplThread() override;
+ virtual void OnCanDrawStateChanged(bool can_draw) override;
+ virtual void NotifyReadyToActivate() override;
+ virtual void SetNeedsRedrawOnImplThread() override;
virtual void SetNeedsRedrawRectOnImplThread(
- const gfx::Rect& dirty_rect) OVERRIDE;
- virtual void SetNeedsAnimateOnImplThread() OVERRIDE;
- virtual void SetNeedsManageTilesOnImplThread() OVERRIDE;
- virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE;
- virtual void SetNeedsCommitOnImplThread() OVERRIDE;
+ const gfx::Rect& dirty_rect) override;
+ virtual void SetNeedsAnimateOnImplThread() override;
+ virtual void SetNeedsManageTilesOnImplThread() override;
+ virtual void DidInitializeVisibleTileOnImplThread() override;
+ virtual void SetNeedsCommitOnImplThread() override;
virtual void PostAnimationEventsToMainThreadOnImplThread(
- scoped_ptr<AnimationEventsVector> events) OVERRIDE;
+ scoped_ptr<AnimationEventsVector> events) override;
virtual bool ReduceContentsTextureMemoryOnImplThread(
size_t limit_bytes,
- int priority_cutoff) OVERRIDE;
- virtual bool IsInsideDraw() OVERRIDE;
- virtual void RenewTreePriority() OVERRIDE {}
+ int priority_cutoff) override;
+ virtual bool IsInsideDraw() override;
+ virtual void RenewTreePriority() override {}
virtual void PostDelayedScrollbarFadeOnImplThread(
const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE {}
- virtual void DidActivateSyncTree() OVERRIDE {}
- virtual void DidManageTiles() OVERRIDE;
- virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE {}
+ base::TimeDelta delay) override {}
+ virtual void DidActivateSyncTree() override {}
+ virtual void DidManageTiles() override;
+ virtual void SetDebugState(const LayerTreeDebugState& debug_state) override {}
void RequestNewOutputSurface();
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 5783709..93b4c65 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -108,7 +108,6 @@
inside_draw(false),
input_throttled_until_commit(false),
animations_frozen_until_next_draw(false),
- did_commit_after_animating(false),
smoothness_priority_expiration_notifier(
proxy->ImplThreadTaskRunner(),
base::Bind(&ThreadProxy::RenewTreePriority, base::Unretained(proxy)),
@@ -944,7 +943,6 @@
impl().layer_tree_host_impl->CurrentBeginFrameArgs().frame_time;
}
impl().layer_tree_host_impl->Animate(impl().animation_time);
- impl().did_commit_after_animating = false;
}
void ThreadProxy::ScheduledActionCommit() {
@@ -962,7 +960,6 @@
impl().animation_time = std::max(
impl().animation_time, blocked_main().last_monotonic_frame_begin_time);
}
- impl().did_commit_after_animating = true;
blocked_main().main_thread_inside_commit = true;
impl().layer_tree_host_impl->BeginCommit();
@@ -1031,11 +1028,6 @@
impl().timing_history.DidStartDrawing();
base::AutoReset<bool> mark_inside(&impl().inside_draw, true);
- if (impl().did_commit_after_animating) {
- impl().layer_tree_host_impl->Animate(impl().animation_time);
- impl().did_commit_after_animating = false;
- }
-
if (impl().layer_tree_host_impl->pending_tree())
impl().layer_tree_host_impl->pending_tree()->UpdateDrawProperties();
diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h
index ed5c269..817b36d 100644
--- a/cc/trees/thread_proxy.h
+++ b/cc/trees/thread_proxy.h
@@ -150,85 +150,85 @@
const CompositorThreadOnly& impl() const;
// Proxy implementation
- virtual void FinishAllRendering() OVERRIDE;
- virtual bool IsStarted() const OVERRIDE;
- virtual void SetOutputSurface(scoped_ptr<OutputSurface>) OVERRIDE;
- virtual void SetLayerTreeHostClientReady() OVERRIDE;
- virtual void SetVisible(bool visible) OVERRIDE;
- virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
- virtual void SetNeedsAnimate() OVERRIDE;
- virtual void SetNeedsUpdateLayers() OVERRIDE;
- virtual void SetNeedsCommit() OVERRIDE;
- virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) OVERRIDE;
- virtual void SetNextCommitWaitsForActivation() OVERRIDE;
- virtual void NotifyInputThrottledUntilCommit() OVERRIDE;
- virtual void SetDeferCommits(bool defer_commits) OVERRIDE;
- virtual bool CommitRequested() const OVERRIDE;
- virtual bool BeginMainFrameRequested() const OVERRIDE;
- virtual void MainThreadHasStoppedFlinging() OVERRIDE;
- virtual void Start() OVERRIDE;
- virtual void Stop() OVERRIDE;
- virtual size_t MaxPartialTextureUpdates() const OVERRIDE;
- virtual void ForceSerializeOnSwapBuffers() OVERRIDE;
- virtual bool SupportsImplScrolling() const OVERRIDE;
- virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE;
- virtual void AsValueInto(base::debug::TracedValue* value) const OVERRIDE;
- virtual bool MainFrameWillHappenForTesting() OVERRIDE;
+ virtual void FinishAllRendering() override;
+ virtual bool IsStarted() const override;
+ virtual void SetOutputSurface(scoped_ptr<OutputSurface>) override;
+ virtual void SetLayerTreeHostClientReady() override;
+ virtual void SetVisible(bool visible) override;
+ virtual const RendererCapabilities& GetRendererCapabilities() const override;
+ virtual void SetNeedsAnimate() override;
+ virtual void SetNeedsUpdateLayers() override;
+ virtual void SetNeedsCommit() override;
+ virtual void SetNeedsRedraw(const gfx::Rect& damage_rect) override;
+ virtual void SetNextCommitWaitsForActivation() override;
+ virtual void NotifyInputThrottledUntilCommit() override;
+ virtual void SetDeferCommits(bool defer_commits) override;
+ virtual bool CommitRequested() const override;
+ virtual bool BeginMainFrameRequested() const override;
+ virtual void MainThreadHasStoppedFlinging() override;
+ virtual void Start() override;
+ virtual void Stop() override;
+ virtual size_t MaxPartialTextureUpdates() const override;
+ virtual void ForceSerializeOnSwapBuffers() override;
+ virtual bool SupportsImplScrolling() const override;
+ virtual void SetDebugState(const LayerTreeDebugState& debug_state) override;
+ virtual void AsValueInto(base::debug::TracedValue* value) const override;
+ virtual bool MainFrameWillHappenForTesting() override;
// LayerTreeHostImplClient implementation
- virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE;
- virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE;
+ virtual void UpdateRendererCapabilitiesOnImplThread() override;
+ virtual void DidLoseOutputSurfaceOnImplThread() override;
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE;
- virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) OVERRIDE;
- virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE;
- virtual void DidSwapBuffersOnImplThread() OVERRIDE;
- virtual void DidSwapBuffersCompleteOnImplThread() OVERRIDE;
- virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE;
- virtual void NotifyReadyToActivate() OVERRIDE;
+ base::TimeDelta interval) override;
+ virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) override;
+ virtual void SetMaxSwapsPendingOnImplThread(int max) override;
+ virtual void DidSwapBuffersOnImplThread() override;
+ virtual void DidSwapBuffersCompleteOnImplThread() override;
+ virtual void OnCanDrawStateChanged(bool can_draw) override;
+ virtual void NotifyReadyToActivate() override;
// Please call these 3 functions through
// LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and
// SetNeedsAnimate().
- virtual void SetNeedsRedrawOnImplThread() OVERRIDE;
+ virtual void SetNeedsRedrawOnImplThread() override;
virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& dirty_rect)
- OVERRIDE;
- virtual void SetNeedsAnimateOnImplThread() OVERRIDE;
- virtual void SetNeedsManageTilesOnImplThread() OVERRIDE;
- virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE;
- virtual void SetNeedsCommitOnImplThread() OVERRIDE;
+ override;
+ virtual void SetNeedsAnimateOnImplThread() override;
+ virtual void SetNeedsManageTilesOnImplThread() override;
+ virtual void DidInitializeVisibleTileOnImplThread() override;
+ virtual void SetNeedsCommitOnImplThread() override;
virtual void PostAnimationEventsToMainThreadOnImplThread(
- scoped_ptr<AnimationEventsVector> queue) OVERRIDE;
+ scoped_ptr<AnimationEventsVector> queue) override;
virtual bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes,
int priority_cutoff)
- OVERRIDE;
- virtual bool IsInsideDraw() OVERRIDE;
- virtual void RenewTreePriority() OVERRIDE;
+ override;
+ virtual bool IsInsideDraw() override;
+ virtual void RenewTreePriority() override;
virtual void PostDelayedScrollbarFadeOnImplThread(
const base::Closure& start_fade,
- base::TimeDelta delay) OVERRIDE;
- virtual void DidActivateSyncTree() OVERRIDE;
- virtual void DidManageTiles() OVERRIDE;
+ base::TimeDelta delay) override;
+ virtual void DidActivateSyncTree() override;
+ virtual void DidManageTiles() override;
// SchedulerClient implementation
- virtual BeginFrameSource* ExternalBeginFrameSource() OVERRIDE;
- virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE;
- virtual void ScheduledActionSendBeginMainFrame() OVERRIDE;
- virtual DrawResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE;
- virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE;
- virtual void ScheduledActionAnimate() OVERRIDE;
- virtual void ScheduledActionCommit() OVERRIDE;
- virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE;
- virtual void ScheduledActionActivateSyncTree() OVERRIDE;
- virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE;
- virtual void ScheduledActionManageTiles() OVERRIDE;
- virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE;
- virtual base::TimeDelta DrawDurationEstimate() OVERRIDE;
- virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE;
- virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE;
- virtual void DidBeginImplFrameDeadline() OVERRIDE;
+ virtual BeginFrameSource* ExternalBeginFrameSource() override;
+ virtual void WillBeginImplFrame(const BeginFrameArgs& args) override;
+ virtual void ScheduledActionSendBeginMainFrame() override;
+ virtual DrawResult ScheduledActionDrawAndSwapIfPossible() override;
+ virtual DrawResult ScheduledActionDrawAndSwapForced() override;
+ virtual void ScheduledActionAnimate() override;
+ virtual void ScheduledActionCommit() override;
+ virtual void ScheduledActionUpdateVisibleTiles() override;
+ virtual void ScheduledActionActivateSyncTree() override;
+ virtual void ScheduledActionBeginOutputSurfaceCreation() override;
+ virtual void ScheduledActionManageTiles() override;
+ virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) override;
+ virtual base::TimeDelta DrawDurationEstimate() override;
+ virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() override;
+ virtual base::TimeDelta CommitToActivateDurationEstimate() override;
+ virtual void DidBeginImplFrameDeadline() override;
// ResourceUpdateControllerClient implementation
- virtual void ReadyToFinalizeTextureUpdates() OVERRIDE;
+ virtual void ReadyToFinalizeTextureUpdates() override;
protected:
ThreadProxy(LayerTreeHost* layer_tree_host,
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc
index 007c857..faa86ce 100644
--- a/cc/trees/tree_synchronizer_unittest.cc
+++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -55,11 +55,11 @@
}
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
- OVERRIDE {
+ override {
return MockLayerImpl::Create(tree_impl, layer_id_);
}
- virtual void PushPropertiesTo(LayerImpl* layer_impl) OVERRIDE {
+ virtual void PushPropertiesTo(LayerImpl* layer_impl) override {
Layer::PushPropertiesTo(layer_impl);
MockLayerImpl* mock_layer_impl = static_cast<MockLayerImpl*>(layer_impl);
@@ -91,7 +91,7 @@
virtual ~FakeLayerAnimationController() {}
virtual void PushAnimationUpdatesTo(LayerAnimationController* controller_impl)
- OVERRIDE {
+ override {
LayerAnimationController::PushAnimationUpdatesTo(controller_impl);
synchronized_animations_ = true;
}
diff --git a/crypto/ec_signature_creator_impl.h b/crypto/ec_signature_creator_impl.h
index 8ef67cd..f2ef9d6 100644
--- a/crypto/ec_signature_creator_impl.h
+++ b/crypto/ec_signature_creator_impl.h
@@ -17,10 +17,10 @@
virtual bool Sign(const uint8* data,
int data_len,
- std::vector<uint8>* signature) OVERRIDE;
+ std::vector<uint8>* signature) override;
virtual bool DecodeSignature(const std::vector<uint8>& der_sig,
- std::vector<uint8>* out_raw_sig) OVERRIDE;
+ std::vector<uint8>* out_raw_sig) override;
private:
ECPrivateKey* key_;
diff --git a/crypto/mock_apple_keychain.h b/crypto/mock_apple_keychain.h
index 73beb09..d957316 100644
--- a/crypto/mock_apple_keychain.h
+++ b/crypto/mock_apple_keychain.h
@@ -40,9 +40,9 @@
const char* accountName,
UInt32* passwordLength,
void** passwordData,
- SecKeychainItemRef* itemRef) const OVERRIDE;
+ SecKeychainItemRef* itemRef) const override;
virtual OSStatus ItemFreeContent(SecKeychainAttributeList* attrList,
- void* data) const OVERRIDE;
+ void* data) const override;
virtual OSStatus AddGenericPassword(
SecKeychainRef keychain,
UInt32 serviceNameLength,
@@ -51,7 +51,7 @@
const char* accountName,
UInt32 passwordLength,
const void* passwordData,
- SecKeychainItemRef* itemRef) const OVERRIDE;
+ SecKeychainItemRef* itemRef) const override;
#if !defined(OS_IOS)
virtual OSStatus ItemCopyAttributesAndData(
@@ -60,23 +60,23 @@
SecItemClass* itemClass,
SecKeychainAttributeList** attrList,
UInt32* length,
- void** outData) const OVERRIDE;
+ void** outData) const override;
// Pass "fail_me" as the data to get errSecAuthFailed.
virtual OSStatus ItemModifyAttributesAndData(
SecKeychainItemRef itemRef,
const SecKeychainAttributeList* attrList,
UInt32 length,
- const void* data) const OVERRIDE;
+ const void* data) const override;
virtual OSStatus ItemFreeAttributesAndData(SecKeychainAttributeList* attrList,
- void* data) const OVERRIDE;
- virtual OSStatus ItemDelete(SecKeychainItemRef itemRef) const OVERRIDE;
+ void* data) const override;
+ virtual OSStatus ItemDelete(SecKeychainItemRef itemRef) const override;
virtual OSStatus SearchCreateFromAttributes(
CFTypeRef keychainOrArray,
SecItemClass itemClass,
const SecKeychainAttributeList* attrList,
- SecKeychainSearchRef* searchRef) const OVERRIDE;
+ SecKeychainSearchRef* searchRef) const override;
virtual OSStatus SearchCopyNext(SecKeychainSearchRef searchRef,
- SecKeychainItemRef* itemRef) const OVERRIDE;
+ SecKeychainItemRef* itemRef) const override;
// Pass "some.domain.com" as the serverName to get errSecDuplicateItem.
virtual OSStatus AddInternetPassword(
SecKeychainRef keychain,
@@ -91,8 +91,8 @@
SecAuthenticationType authenticationType,
UInt32 passwordLength,
const void* passwordData,
- SecKeychainItemRef* itemRef) const OVERRIDE;
- virtual void Free(CFTypeRef ref) const OVERRIDE;
+ SecKeychainItemRef* itemRef) const override;
+ virtual void Free(CFTypeRef ref) const override;
// Return the counts of objects returned by Create/Copy functions but never
// Free'd as they should have been.
diff --git a/crypto/secure_hash_default.cc b/crypto/secure_hash_default.cc
index 7b912e1..1f5e59b 100644
--- a/crypto/secure_hash_default.cc
+++ b/crypto/secure_hash_default.cc
@@ -28,17 +28,17 @@
}
// SecureHash implementation:
- virtual void Update(const void* input, size_t len) OVERRIDE {
+ virtual void Update(const void* input, size_t len) override {
SHA256_Update(&ctx_, static_cast<const unsigned char*>(input), len);
}
- virtual void Finish(void* output, size_t len) OVERRIDE {
+ virtual void Finish(void* output, size_t len) override {
SHA256_End(&ctx_, static_cast<unsigned char*>(output), NULL,
static_cast<unsigned int>(len));
}
- virtual bool Serialize(Pickle* pickle) OVERRIDE;
- virtual bool Deserialize(PickleIterator* data_iterator) OVERRIDE;
+ virtual bool Serialize(Pickle* pickle) override;
+ virtual bool Deserialize(PickleIterator* data_iterator) override;
private:
SHA256Context ctx_;
diff --git a/crypto/secure_hash_openssl.cc b/crypto/secure_hash_openssl.cc
index 84d28a5..61946a8 100644
--- a/crypto/secure_hash_openssl.cc
+++ b/crypto/secure_hash_openssl.cc
@@ -30,18 +30,18 @@
OPENSSL_cleanse(&ctx_, sizeof(ctx_));
}
- virtual void Update(const void* input, size_t len) OVERRIDE {
+ virtual void Update(const void* input, size_t len) override {
SHA256_Update(&ctx_, static_cast<const unsigned char*>(input), len);
}
- virtual void Finish(void* output, size_t len) OVERRIDE {
+ virtual void Finish(void* output, size_t len) override {
ScopedOpenSSLSafeSizeBuffer<SHA256_DIGEST_LENGTH> result(
static_cast<unsigned char*>(output), len);
SHA256_Final(result.safe_buffer(), &ctx_);
}
- virtual bool Serialize(Pickle* pickle) OVERRIDE;
- virtual bool Deserialize(PickleIterator* data_iterator) OVERRIDE;
+ virtual bool Serialize(Pickle* pickle) override;
+ virtual bool Deserialize(PickleIterator* data_iterator) override;
private:
SHA256_CTX ctx_;
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
index 2df0f84..f085b58 100644
--- a/gin/public/v8_platform.h
+++ b/gin/public/v8_platform.h
@@ -24,6 +24,7 @@
v8::Platform::ExpectedRuntime expected_runtime) OVERRIDE;
virtual void CallOnForegroundThread(v8::Isolate* isolate,
v8::Task* task) OVERRIDE;
+ virtual double MonotonicallyIncreasingTime() OVERRIDE;
private:
friend struct base::DefaultLazyInstanceTraits<V8Platform>;
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
index d50ff24..ec163de 100644
--- a/gin/v8_platform.cc
+++ b/gin/v8_platform.cc
@@ -39,4 +39,9 @@
FROM_HERE, base::Bind(&v8::Task::Run, base::Owned(task)));
}
+double V8Platform::MonotonicallyIncreasingTime() {
+ return base::TimeTicks::Now().ToInternalValue() /
+ static_cast<double>(base::Time::kMicrosecondsPerSecond);
+}
+
} // namespace gin
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index b77dfca..8239940 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -43,6 +43,7 @@
"//gpu/command_buffer/common",
"//gpu/command_buffer/service",
"//gpu/config",
+ "//gpu/ipc",
]
}
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 5c9e127..a6a6323 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -3158,7 +3158,7 @@
"""Writes the GLES2 Implemention declaration."""
impl_decl = func.GetInfo('impl_decl')
if impl_decl == None or impl_decl == True:
- file.Write("virtual %s %s(%s) OVERRIDE;\n" %
+ file.Write("virtual %s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
file.Write("\n")
@@ -3199,7 +3199,7 @@
def WriteGLES2TraceImplementationHeader(self, func, file):
"""Writes the GLES2 Trace Implemention header."""
- file.Write("virtual %s %s(%s) OVERRIDE;\n" %
+ file.Write("virtual %s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
@@ -3250,7 +3250,7 @@
def WriteGLES2InterfaceStub(self, func, file):
"""Writes the GLES2 Interface stub declaration."""
- file.Write("virtual %s %s(%s) OVERRIDE;\n" %
+ file.Write("virtual %s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
@@ -3847,7 +3847,7 @@
def WriteGLES2ImplementationHeader(self, func, file):
"""Overrriden from TypeHandler."""
- file.Write("virtual %s %s(%s) OVERRIDE;\n" %
+ file.Write("virtual %s %s(%s) override;\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
file.Write("\n")
diff --git a/gpu/command_buffer/client/buffer_tracker_unittest.cc b/gpu/command_buffer/client/buffer_tracker_unittest.cc
index f6174c0..39ff633 100644
--- a/gpu/command_buffer/client/buffer_tracker_unittest.cc
+++ b/gpu/command_buffer/client/buffer_tracker_unittest.cc
@@ -26,7 +26,7 @@
virtual ~MockClientCommandBufferImpl() {}
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
- int32* id) OVERRIDE {
+ int32* id) override {
if (context_lost_) {
*id = -1;
return NULL;
diff --git a/gpu/command_buffer/client/client_test_helper.h b/gpu/command_buffer/client/client_test_helper.h
index a0363a9..d545045 100644
--- a/gpu/command_buffer/client/client_test_helper.h
+++ b/gpu/command_buffer/client/client_test_helper.h
@@ -28,19 +28,19 @@
MockCommandBufferBase();
virtual ~MockCommandBufferBase();
- virtual bool Initialize() OVERRIDE;
- virtual State GetLastState() OVERRIDE;
- virtual int32 GetLastToken() OVERRIDE;
- virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE;
- virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE;
- virtual void SetGetBuffer(int transfer_buffer_id) OVERRIDE;
- virtual void SetGetOffset(int32 get_offset) OVERRIDE;
+ virtual bool Initialize() override;
+ virtual State GetLastState() override;
+ virtual int32 GetLastToken() override;
+ virtual void WaitForTokenInRange(int32 start, int32 end) override;
+ virtual void WaitForGetOffsetInRange(int32 start, int32 end) override;
+ virtual void SetGetBuffer(int transfer_buffer_id) override;
+ virtual void SetGetOffset(int32 get_offset) override;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
- int32* id) OVERRIDE;
- virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) OVERRIDE;
- virtual void SetToken(int32 token) OVERRIDE;
- virtual void SetParseError(error::Error error) OVERRIDE;
- virtual void SetContextLostReason(error::ContextLostReason reason) OVERRIDE;
+ int32* id) override;
+ virtual scoped_refptr<gpu::Buffer> GetTransferBuffer(int32 id) override;
+ virtual void SetToken(int32 token) override;
+ virtual void SetParseError(error::Error error) override;
+ virtual void SetContextLostReason(error::ContextLostReason reason) override;
// Get's the Id of the next transfer buffer that will be returned
// by CreateTransferBuffer. This is useful for testing expected ids.
@@ -67,7 +67,7 @@
MOCK_METHOD0(OnFlush, void());
MOCK_METHOD1(DestroyTransferBuffer, void(int32 id));
- virtual void Flush(int32 put_offset) OVERRIDE;
+ virtual void Flush(int32 put_offset) override;
void DelegateToFake();
};
diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
index 6250074..2d367ac 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc
@@ -48,7 +48,7 @@
flush_count_(0) {}
virtual ~CommandBufferServiceLocked() {}
- virtual void Flush(int32 put_offset) OVERRIDE {
+ virtual void Flush(int32 put_offset) override {
flush_count_++;
if (!flush_locked_) {
last_flush_ = -1;
@@ -64,7 +64,7 @@
int FlushCount() { return flush_count_; }
- virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE {
+ virtual void WaitForGetOffsetInRange(int32 start, int32 end) override {
if (last_flush_ != -1) {
CommandBufferService::Flush(last_flush_);
last_flush_ = -1;
diff --git a/gpu/command_buffer/client/gl_in_process_context.cc b/gpu/command_buffer/client/gl_in_process_context.cc
index 1441d03..e877119 100644
--- a/gpu/command_buffer/client/gl_in_process_context.cc
+++ b/gpu/command_buffer/client/gl_in_process_context.cc
@@ -62,13 +62,13 @@
const scoped_refptr<InProcessCommandBuffer::Service>& service);
// GLInProcessContext implementation:
- virtual void SetContextLostCallback(const base::Closure& callback) OVERRIDE;
- virtual gles2::GLES2Implementation* GetImplementation() OVERRIDE;
- virtual size_t GetMappedMemoryLimit() OVERRIDE;
+ virtual void SetContextLostCallback(const base::Closure& callback) override;
+ virtual gles2::GLES2Implementation* GetImplementation() override;
+ virtual size_t GetMappedMemoryLimit() override;
#if defined(OS_ANDROID)
virtual scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture(
- uint32 stream_id) OVERRIDE;
+ uint32 stream_id) override;
#endif
private:
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 84cda7e..e3d8fd9 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -212,23 +212,23 @@
// this file instead of having to edit some template or the code generator.
#include "gpu/command_buffer/client/gles2_implementation_autogen.h"
- virtual void DisableVertexAttribArray(GLuint index) OVERRIDE;
- virtual void EnableVertexAttribArray(GLuint index) OVERRIDE;
+ virtual void DisableVertexAttribArray(GLuint index) override;
+ virtual void EnableVertexAttribArray(GLuint index) override;
virtual void GetVertexAttribfv(
- GLuint index, GLenum pname, GLfloat* params) OVERRIDE;
+ GLuint index, GLenum pname, GLfloat* params) override;
virtual void GetVertexAttribiv(
- GLuint index, GLenum pname, GLint* params) OVERRIDE;
+ GLuint index, GLenum pname, GLint* params) override;
// ContextSupport implementation.
- virtual void Swap() OVERRIDE;
- virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) OVERRIDE;
+ virtual void Swap() override;
+ virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) override;
virtual void ScheduleOverlayPlane(int plane_z_order,
gfx::OverlayTransform plane_transform,
unsigned overlay_texture_id,
const gfx::Rect& display_bounds,
- const gfx::RectF& uv_rect) OVERRIDE;
- virtual GLuint InsertFutureSyncPointCHROMIUM() OVERRIDE;
- virtual void RetireSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
+ const gfx::RectF& uv_rect) override;
+ virtual GLuint InsertFutureSyncPointCHROMIUM() override;
+ virtual void RetireSyncPointCHROMIUM(GLuint sync_point) override;
void GetProgramInfoCHROMIUMHelper(GLuint program, std::vector<int8>* result);
GLint GetAttribLocationHelper(GLuint program, const char* name);
@@ -245,10 +245,10 @@
// ContextSupport implementation.
virtual void SignalSyncPoint(uint32 sync_point,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void SignalQuery(uint32 query,
- const base::Closure& callback) OVERRIDE;
- virtual void SetSurfaceVisible(bool visible) OVERRIDE;
+ const base::Closure& callback) override;
+ virtual void SetSurfaceVisible(bool visible) override;
void SetErrorMessageCallback(
GLES2ImplementationErrorMessageCallback* callback) {
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index 0a53a86..1a36943 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -13,67 +13,67 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_
-virtual void ActiveTexture(GLenum texture) OVERRIDE;
+virtual void ActiveTexture(GLenum texture) override;
-virtual void AttachShader(GLuint program, GLuint shader) OVERRIDE;
+virtual void AttachShader(GLuint program, GLuint shader) override;
virtual void BindAttribLocation(GLuint program,
GLuint index,
- const char* name) OVERRIDE;
+ const char* name) override;
-virtual void BindBuffer(GLenum target, GLuint buffer) OVERRIDE;
+virtual void BindBuffer(GLenum target, GLuint buffer) override;
-virtual void BindFramebuffer(GLenum target, GLuint framebuffer) OVERRIDE;
+virtual void BindFramebuffer(GLenum target, GLuint framebuffer) override;
-virtual void BindRenderbuffer(GLenum target, GLuint renderbuffer) OVERRIDE;
+virtual void BindRenderbuffer(GLenum target, GLuint renderbuffer) override;
-virtual void BindTexture(GLenum target, GLuint texture) OVERRIDE;
+virtual void BindTexture(GLenum target, GLuint texture) override;
virtual void BlendColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
+ GLclampf alpha) override;
-virtual void BlendEquation(GLenum mode) OVERRIDE;
+virtual void BlendEquation(GLenum mode) override;
-virtual void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) OVERRIDE;
+virtual void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) override;
-virtual void BlendFunc(GLenum sfactor, GLenum dfactor) OVERRIDE;
+virtual void BlendFunc(GLenum sfactor, GLenum dfactor) override;
virtual void BlendFuncSeparate(GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
- GLenum dstAlpha) OVERRIDE;
+ GLenum dstAlpha) override;
virtual void BufferData(GLenum target,
GLsizeiptr size,
const void* data,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
virtual void BufferSubData(GLenum target,
GLintptr offset,
GLsizeiptr size,
- const void* data) OVERRIDE;
+ const void* data) override;
-virtual GLenum CheckFramebufferStatus(GLenum target) OVERRIDE;
+virtual GLenum CheckFramebufferStatus(GLenum target) override;
-virtual void Clear(GLbitfield mask) OVERRIDE;
+virtual void Clear(GLbitfield mask) override;
virtual void ClearColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
+ GLclampf alpha) override;
-virtual void ClearDepthf(GLclampf depth) OVERRIDE;
+virtual void ClearDepthf(GLclampf depth) override;
-virtual void ClearStencil(GLint s) OVERRIDE;
+virtual void ClearStencil(GLint s) override;
virtual void ColorMask(GLboolean red,
GLboolean green,
GLboolean blue,
- GLboolean alpha) OVERRIDE;
+ GLboolean alpha) override;
-virtual void CompileShader(GLuint shader) OVERRIDE;
+virtual void CompileShader(GLuint shader) override;
virtual void CompressedTexImage2D(GLenum target,
GLint level,
@@ -82,7 +82,7 @@
GLsizei height,
GLint border,
GLsizei imageSize,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void CompressedTexSubImage2D(GLenum target,
GLint level,
@@ -92,7 +92,7 @@
GLsizei height,
GLenum format,
GLsizei imageSize,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void CopyTexImage2D(GLenum target,
GLint level,
@@ -101,7 +101,7 @@
GLint y,
GLsizei width,
GLsizei height,
- GLint border) OVERRIDE;
+ GLint border) override;
virtual void CopyTexSubImage2D(GLenum target,
GLint level,
@@ -110,72 +110,72 @@
GLint x,
GLint y,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
-virtual GLuint CreateProgram() OVERRIDE;
+virtual GLuint CreateProgram() override;
-virtual GLuint CreateShader(GLenum type) OVERRIDE;
+virtual GLuint CreateShader(GLenum type) override;
-virtual void CullFace(GLenum mode) OVERRIDE;
+virtual void CullFace(GLenum mode) override;
-virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) OVERRIDE;
+virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) override;
-virtual void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) OVERRIDE;
+virtual void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) override;
-virtual void DeleteProgram(GLuint program) OVERRIDE;
+virtual void DeleteProgram(GLuint program) override;
virtual void DeleteRenderbuffers(GLsizei n,
- const GLuint* renderbuffers) OVERRIDE;
+ const GLuint* renderbuffers) override;
-virtual void DeleteShader(GLuint shader) OVERRIDE;
+virtual void DeleteShader(GLuint shader) override;
-virtual void DeleteTextures(GLsizei n, const GLuint* textures) OVERRIDE;
+virtual void DeleteTextures(GLsizei n, const GLuint* textures) override;
-virtual void DepthFunc(GLenum func) OVERRIDE;
+virtual void DepthFunc(GLenum func) override;
-virtual void DepthMask(GLboolean flag) OVERRIDE;
+virtual void DepthMask(GLboolean flag) override;
-virtual void DepthRangef(GLclampf zNear, GLclampf zFar) OVERRIDE;
+virtual void DepthRangef(GLclampf zNear, GLclampf zFar) override;
-virtual void DetachShader(GLuint program, GLuint shader) OVERRIDE;
+virtual void DetachShader(GLuint program, GLuint shader) override;
-virtual void Disable(GLenum cap) OVERRIDE;
+virtual void Disable(GLenum cap) override;
-virtual void DrawArrays(GLenum mode, GLint first, GLsizei count) OVERRIDE;
+virtual void DrawArrays(GLenum mode, GLint first, GLsizei count) override;
virtual void DrawElements(GLenum mode,
GLsizei count,
GLenum type,
- const void* indices) OVERRIDE;
+ const void* indices) override;
-virtual void Enable(GLenum cap) OVERRIDE;
+virtual void Enable(GLenum cap) override;
-virtual void Finish() OVERRIDE;
+virtual void Finish() override;
-virtual void Flush() OVERRIDE;
+virtual void Flush() override;
virtual void FramebufferRenderbuffer(GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
- GLuint renderbuffer) OVERRIDE;
+ GLuint renderbuffer) override;
virtual void FramebufferTexture2D(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
- GLint level) OVERRIDE;
+ GLint level) override;
-virtual void FrontFace(GLenum mode) OVERRIDE;
+virtual void FrontFace(GLenum mode) override;
-virtual void GenBuffers(GLsizei n, GLuint* buffers) OVERRIDE;
+virtual void GenBuffers(GLsizei n, GLuint* buffers) override;
-virtual void GenerateMipmap(GLenum target) OVERRIDE;
+virtual void GenerateMipmap(GLenum target) override;
-virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) OVERRIDE;
+virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) override;
-virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) OVERRIDE;
+virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override;
-virtual void GenTextures(GLsizei n, GLuint* textures) OVERRIDE;
+virtual void GenTextures(GLsizei n, GLuint* textures) override;
virtual void GetActiveAttrib(GLuint program,
GLuint index,
@@ -183,7 +183,7 @@
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual void GetActiveUniform(GLuint program,
GLuint index,
@@ -191,107 +191,107 @@
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual void GetAttachedShaders(GLuint program,
GLsizei maxcount,
GLsizei* count,
- GLuint* shaders) OVERRIDE;
+ GLuint* shaders) override;
-virtual GLint GetAttribLocation(GLuint program, const char* name) OVERRIDE;
+virtual GLint GetAttribLocation(GLuint program, const char* name) override;
-virtual void GetBooleanv(GLenum pname, GLboolean* params) OVERRIDE;
+virtual void GetBooleanv(GLenum pname, GLboolean* params) override;
virtual void GetBufferParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
-virtual GLenum GetError() OVERRIDE;
+virtual GLenum GetError() override;
-virtual void GetFloatv(GLenum pname, GLfloat* params) OVERRIDE;
+virtual void GetFloatv(GLenum pname, GLfloat* params) override;
virtual void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
-virtual void GetIntegerv(GLenum pname, GLint* params) OVERRIDE;
+virtual void GetIntegerv(GLenum pname, GLint* params) override;
-virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) OVERRIDE;
+virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) override;
virtual void GetProgramInfoLog(GLuint program,
GLsizei bufsize,
GLsizei* length,
- char* infolog) OVERRIDE;
+ char* infolog) override;
virtual void GetRenderbufferParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
-virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) OVERRIDE;
+virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override;
virtual void GetShaderInfoLog(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* infolog) OVERRIDE;
+ char* infolog) override;
virtual void GetShaderPrecisionFormat(GLenum shadertype,
GLenum precisiontype,
GLint* range,
- GLint* precision) OVERRIDE;
+ GLint* precision) override;
virtual void GetShaderSource(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* source) OVERRIDE;
+ char* source) override;
-virtual const GLubyte* GetString(GLenum name) OVERRIDE;
+virtual const GLubyte* GetString(GLenum name) override;
virtual void GetTexParameterfv(GLenum target,
GLenum pname,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetTexParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual void GetUniformfv(GLuint program,
GLint location,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetUniformiv(GLuint program,
GLint location,
- GLint* params) OVERRIDE;
+ GLint* params) override;
-virtual GLint GetUniformLocation(GLuint program, const char* name) OVERRIDE;
+virtual GLint GetUniformLocation(GLuint program, const char* name) override;
virtual void GetVertexAttribPointerv(GLuint index,
GLenum pname,
- void** pointer) OVERRIDE;
+ void** pointer) override;
-virtual void Hint(GLenum target, GLenum mode) OVERRIDE;
+virtual void Hint(GLenum target, GLenum mode) override;
-virtual GLboolean IsBuffer(GLuint buffer) OVERRIDE;
+virtual GLboolean IsBuffer(GLuint buffer) override;
-virtual GLboolean IsEnabled(GLenum cap) OVERRIDE;
+virtual GLboolean IsEnabled(GLenum cap) override;
-virtual GLboolean IsFramebuffer(GLuint framebuffer) OVERRIDE;
+virtual GLboolean IsFramebuffer(GLuint framebuffer) override;
-virtual GLboolean IsProgram(GLuint program) OVERRIDE;
+virtual GLboolean IsProgram(GLuint program) override;
-virtual GLboolean IsRenderbuffer(GLuint renderbuffer) OVERRIDE;
+virtual GLboolean IsRenderbuffer(GLuint renderbuffer) override;
-virtual GLboolean IsShader(GLuint shader) OVERRIDE;
+virtual GLboolean IsShader(GLuint shader) override;
-virtual GLboolean IsTexture(GLuint texture) OVERRIDE;
+virtual GLboolean IsTexture(GLuint texture) override;
-virtual void LineWidth(GLfloat width) OVERRIDE;
+virtual void LineWidth(GLfloat width) override;
-virtual void LinkProgram(GLuint program) OVERRIDE;
+virtual void LinkProgram(GLuint program) override;
-virtual void PixelStorei(GLenum pname, GLint param) OVERRIDE;
+virtual void PixelStorei(GLenum pname, GLint param) override;
-virtual void PolygonOffset(GLfloat factor, GLfloat units) OVERRIDE;
+virtual void PolygonOffset(GLfloat factor, GLfloat units) override;
virtual void ReadPixels(GLint x,
GLint y,
@@ -299,51 +299,51 @@
GLsizei height,
GLenum format,
GLenum type,
- void* pixels) OVERRIDE;
+ void* pixels) override;
-virtual void ReleaseShaderCompiler() OVERRIDE;
+virtual void ReleaseShaderCompiler() override;
virtual void RenderbufferStorage(GLenum target,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
-virtual void SampleCoverage(GLclampf value, GLboolean invert) OVERRIDE;
+virtual void SampleCoverage(GLclampf value, GLboolean invert) override;
-virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) OVERRIDE;
+virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override;
virtual void ShaderBinary(GLsizei n,
const GLuint* shaders,
GLenum binaryformat,
const void* binary,
- GLsizei length) OVERRIDE;
+ GLsizei length) override;
virtual void ShaderSource(GLuint shader,
GLsizei count,
const GLchar* const* str,
- const GLint* length) OVERRIDE;
+ const GLint* length) override;
-virtual void ShallowFinishCHROMIUM() OVERRIDE;
+virtual void ShallowFinishCHROMIUM() override;
-virtual void ShallowFlushCHROMIUM() OVERRIDE;
+virtual void ShallowFlushCHROMIUM() override;
-virtual void StencilFunc(GLenum func, GLint ref, GLuint mask) OVERRIDE;
+virtual void StencilFunc(GLenum func, GLint ref, GLuint mask) override;
virtual void StencilFuncSeparate(GLenum face,
GLenum func,
GLint ref,
- GLuint mask) OVERRIDE;
+ GLuint mask) override;
-virtual void StencilMask(GLuint mask) OVERRIDE;
+virtual void StencilMask(GLuint mask) override;
-virtual void StencilMaskSeparate(GLenum face, GLuint mask) OVERRIDE;
+virtual void StencilMaskSeparate(GLenum face, GLuint mask) override;
-virtual void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) OVERRIDE;
+virtual void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) override;
virtual void StencilOpSeparate(GLenum face,
GLenum fail,
GLenum zfail,
- GLenum zpass) OVERRIDE;
+ GLenum zpass) override;
virtual void TexImage2D(GLenum target,
GLint level,
@@ -353,19 +353,19 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
-virtual void TexParameterf(GLenum target, GLenum pname, GLfloat param) OVERRIDE;
+virtual void TexParameterf(GLenum target, GLenum pname, GLfloat param) override;
virtual void TexParameterfv(GLenum target,
GLenum pname,
- const GLfloat* params) OVERRIDE;
+ const GLfloat* params) override;
-virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;
+virtual void TexParameteri(GLenum target, GLenum pname, GLint param) override;
virtual void TexParameteriv(GLenum target,
GLenum pname,
- const GLint* params) OVERRIDE;
+ const GLint* params) override;
virtual void TexSubImage2D(GLenum target,
GLint level,
@@ -375,109 +375,109 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
-virtual void Uniform1f(GLint location, GLfloat x) OVERRIDE;
+virtual void Uniform1f(GLint location, GLfloat x) override;
virtual void Uniform1fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
+ const GLfloat* v) override;
-virtual void Uniform1i(GLint location, GLint x) OVERRIDE;
+virtual void Uniform1i(GLint location, GLint x) override;
-virtual void Uniform1iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+virtual void Uniform1iv(GLint location, GLsizei count, const GLint* v) override;
-virtual void Uniform2f(GLint location, GLfloat x, GLfloat y) OVERRIDE;
+virtual void Uniform2f(GLint location, GLfloat x, GLfloat y) override;
virtual void Uniform2fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
+ const GLfloat* v) override;
-virtual void Uniform2i(GLint location, GLint x, GLint y) OVERRIDE;
+virtual void Uniform2i(GLint location, GLint x, GLint y) override;
-virtual void Uniform2iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+virtual void Uniform2iv(GLint location, GLsizei count, const GLint* v) override;
virtual void Uniform3f(GLint location,
GLfloat x,
GLfloat y,
- GLfloat z) OVERRIDE;
+ GLfloat z) override;
virtual void Uniform3fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
+ const GLfloat* v) override;
-virtual void Uniform3i(GLint location, GLint x, GLint y, GLint z) OVERRIDE;
+virtual void Uniform3i(GLint location, GLint x, GLint y, GLint z) override;
-virtual void Uniform3iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+virtual void Uniform3iv(GLint location, GLsizei count, const GLint* v) override;
virtual void Uniform4f(GLint location,
GLfloat x,
GLfloat y,
GLfloat z,
- GLfloat w) OVERRIDE;
+ GLfloat w) override;
virtual void Uniform4fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
+ const GLfloat* v) override;
virtual void Uniform4i(GLint location,
GLint x,
GLint y,
GLint z,
- GLint w) OVERRIDE;
+ GLint w) override;
-virtual void Uniform4iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+virtual void Uniform4iv(GLint location, GLsizei count, const GLint* v) override;
virtual void UniformMatrix2fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
virtual void UniformMatrix3fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
virtual void UniformMatrix4fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
-virtual void UseProgram(GLuint program) OVERRIDE;
+virtual void UseProgram(GLuint program) override;
-virtual void ValidateProgram(GLuint program) OVERRIDE;
+virtual void ValidateProgram(GLuint program) override;
-virtual void VertexAttrib1f(GLuint indx, GLfloat x) OVERRIDE;
+virtual void VertexAttrib1f(GLuint indx, GLfloat x) override;
-virtual void VertexAttrib1fv(GLuint indx, const GLfloat* values) OVERRIDE;
+virtual void VertexAttrib1fv(GLuint indx, const GLfloat* values) override;
-virtual void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) OVERRIDE;
+virtual void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) override;
-virtual void VertexAttrib2fv(GLuint indx, const GLfloat* values) OVERRIDE;
+virtual void VertexAttrib2fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttrib3f(GLuint indx,
GLfloat x,
GLfloat y,
- GLfloat z) OVERRIDE;
+ GLfloat z) override;
-virtual void VertexAttrib3fv(GLuint indx, const GLfloat* values) OVERRIDE;
+virtual void VertexAttrib3fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttrib4f(GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z,
- GLfloat w) OVERRIDE;
+ GLfloat w) override;
-virtual void VertexAttrib4fv(GLuint indx, const GLfloat* values) OVERRIDE;
+virtual void VertexAttrib4fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttribPointer(GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
- const void* ptr) OVERRIDE;
+ const void* ptr) override;
-virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) OVERRIDE;
+virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override;
virtual void BlitFramebufferCHROMIUM(GLint srcX0,
GLint srcY0,
@@ -488,87 +488,87 @@
GLint dstX1,
GLint dstY1,
GLbitfield mask,
- GLenum filter) OVERRIDE;
+ GLenum filter) override;
virtual void RenderbufferStorageMultisampleCHROMIUM(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void RenderbufferStorageMultisampleEXT(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void FramebufferTexture2DMultisampleEXT(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level,
- GLsizei samples) OVERRIDE;
+ GLsizei samples) override;
virtual void TexStorage2DEXT(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
-virtual void GenQueriesEXT(GLsizei n, GLuint* queries) OVERRIDE;
+virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override;
-virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) OVERRIDE;
+virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
-virtual GLboolean IsQueryEXT(GLuint id) OVERRIDE;
+virtual GLboolean IsQueryEXT(GLuint id) override;
-virtual void BeginQueryEXT(GLenum target, GLuint id) OVERRIDE;
+virtual void BeginQueryEXT(GLenum target, GLuint id) override;
-virtual void EndQueryEXT(GLenum target) OVERRIDE;
+virtual void EndQueryEXT(GLenum target) override;
-virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) OVERRIDE;
+virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) override;
virtual void GetQueryObjectuivEXT(GLuint id,
GLenum pname,
- GLuint* params) OVERRIDE;
+ GLuint* params) override;
virtual void InsertEventMarkerEXT(GLsizei length,
- const GLchar* marker) OVERRIDE;
+ const GLchar* marker) override;
-virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) OVERRIDE;
+virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) override;
-virtual void PopGroupMarkerEXT() OVERRIDE;
+virtual void PopGroupMarkerEXT() override;
-virtual void GenVertexArraysOES(GLsizei n, GLuint* arrays) OVERRIDE;
+virtual void GenVertexArraysOES(GLsizei n, GLuint* arrays) override;
-virtual void DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) OVERRIDE;
+virtual void DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) override;
-virtual GLboolean IsVertexArrayOES(GLuint array) OVERRIDE;
+virtual GLboolean IsVertexArrayOES(GLuint array) override;
-virtual void BindVertexArrayOES(GLuint array) OVERRIDE;
+virtual void BindVertexArrayOES(GLuint array) override;
-virtual void SwapBuffers() OVERRIDE;
+virtual void SwapBuffers() override;
virtual GLuint GetMaxValueInBufferCHROMIUM(GLuint buffer_id,
GLsizei count,
GLenum type,
- GLuint offset) OVERRIDE;
+ GLuint offset) override;
-virtual GLboolean EnableFeatureCHROMIUM(const char* feature) OVERRIDE;
+virtual GLboolean EnableFeatureCHROMIUM(const char* feature) override;
-virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) OVERRIDE;
+virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
-virtual GLboolean UnmapBufferCHROMIUM(GLuint target) OVERRIDE;
+virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
-virtual void* MapImageCHROMIUM(GLuint image_id) OVERRIDE;
+virtual void* MapImageCHROMIUM(GLuint image_id) override;
-virtual void UnmapImageCHROMIUM(GLuint image_id) OVERRIDE;
+virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
- GLenum access) OVERRIDE;
+ GLenum access) override;
-virtual void UnmapBufferSubDataCHROMIUM(const void* mem) OVERRIDE;
+virtual void UnmapBufferSubDataCHROMIUM(const void* mem) override;
virtual void* MapTexSubImage2DCHROMIUM(GLenum target,
GLint level,
@@ -578,110 +578,110 @@
GLsizei height,
GLenum format,
GLenum type,
- GLenum access) OVERRIDE;
+ GLenum access) override;
-virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) OVERRIDE;
+virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) override;
virtual void ResizeCHROMIUM(GLuint width,
GLuint height,
- GLfloat scale_factor) OVERRIDE;
+ GLfloat scale_factor) override;
-virtual const GLchar* GetRequestableExtensionsCHROMIUM() OVERRIDE;
+virtual const GLchar* GetRequestableExtensionsCHROMIUM() override;
-virtual void RequestExtensionCHROMIUM(const char* extension) OVERRIDE;
+virtual void RequestExtensionCHROMIUM(const char* extension) override;
-virtual void RateLimitOffscreenContextCHROMIUM() OVERRIDE;
+virtual void RateLimitOffscreenContextCHROMIUM() override;
virtual void GetMultipleIntegervCHROMIUM(const GLenum* pnames,
GLuint count,
GLint* results,
- GLsizeiptr size) OVERRIDE;
+ GLsizeiptr size) override;
virtual void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
- void* info) OVERRIDE;
+ void* info) override;
-virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) OVERRIDE;
+virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) override;
virtual GLuint CreateImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
-virtual void DestroyImageCHROMIUM(GLuint image_id) OVERRIDE;
+virtual void DestroyImageCHROMIUM(GLuint image_id) override;
virtual void GetImageParameterivCHROMIUM(GLuint image_id,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
virtual void GetTranslatedShaderSourceANGLE(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* source) OVERRIDE;
+ char* source) override;
virtual void PostSubBufferCHROMIUM(GLint x,
GLint y,
GLint width,
- GLint height) OVERRIDE;
+ GLint height) override;
virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
GLsizei width,
GLsizei height,
GLuint ioSurfaceId,
- GLuint plane) OVERRIDE;
+ GLuint plane) override;
virtual void CopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id,
GLint level,
GLint internalformat,
- GLenum dest_type) OVERRIDE;
+ GLenum dest_type) override;
virtual void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
- GLsizei primcount) OVERRIDE;
+ GLsizei primcount) override;
virtual void DrawElementsInstancedANGLE(GLenum mode,
GLsizei count,
GLenum type,
const void* indices,
- GLsizei primcount) OVERRIDE;
+ GLsizei primcount) override;
-virtual void VertexAttribDivisorANGLE(GLuint index, GLuint divisor) OVERRIDE;
+virtual void VertexAttribDivisorANGLE(GLuint index, GLuint divisor) override;
-virtual void GenMailboxCHROMIUM(GLbyte* mailbox) OVERRIDE;
+virtual void GenMailboxCHROMIUM(GLbyte* mailbox) override;
virtual void ProduceTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ProduceTextureDirectCHROMIUM(GLuint texture,
GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual GLuint CreateAndConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void BindUniformLocationCHROMIUM(GLuint program,
GLint location,
- const char* name) OVERRIDE;
+ const char* name) override;
-virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE;
+virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
-virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE;
+virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
-virtual void TraceBeginCHROMIUM(const char* name) OVERRIDE;
+virtual void TraceBeginCHROMIUM(const char* name) override;
-virtual void TraceEndCHROMIUM() OVERRIDE;
+virtual void TraceEndCHROMIUM() override;
virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
GLint level,
@@ -691,7 +691,7 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void AsyncTexImage2DCHROMIUM(GLenum target,
GLint level,
@@ -701,25 +701,25 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
+ const void* pixels) override;
-virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE;
+virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
-virtual void WaitAllAsyncTexImage2DCHROMIUM() OVERRIDE;
+virtual void WaitAllAsyncTexImage2DCHROMIUM() override;
virtual void DiscardFramebufferEXT(GLenum target,
GLsizei count,
- const GLenum* attachments) OVERRIDE;
+ const GLenum* attachments) override;
-virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
+virtual void LoseContextCHROMIUM(GLenum current, GLenum other) override;
-virtual GLuint InsertSyncPointCHROMIUM() OVERRIDE;
+virtual GLuint InsertSyncPointCHROMIUM() override;
-virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) override;
-virtual void DrawBuffersEXT(GLsizei count, const GLenum* bufs) OVERRIDE;
+virtual void DrawBuffersEXT(GLsizei count, const GLenum* bufs) override;
-virtual void DiscardBackbufferCHROMIUM() OVERRIDE;
+virtual void DiscardBackbufferCHROMIUM() override;
virtual void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
GLenum plane_transform,
@@ -731,10 +731,10 @@
GLfloat uv_x,
GLfloat uv_y,
GLfloat uv_width,
- GLfloat uv_height) OVERRIDE;
+ GLfloat uv_height) override;
-virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) OVERRIDE;
+virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
-virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) OVERRIDE;
+virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 80a2e41..658b7e2 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -122,17 +122,17 @@
unsigned int /* min_buffer_size */,
unsigned int /* max_buffer_size */,
unsigned int alignment,
- unsigned int size_to_flush) OVERRIDE;
- virtual int GetShmId() OVERRIDE;
- virtual void* GetResultBuffer() OVERRIDE;
- virtual int GetResultOffset() OVERRIDE;
- virtual void Free() OVERRIDE;
- virtual bool HaveBuffer() const OVERRIDE;
+ unsigned int size_to_flush) override;
+ virtual int GetShmId() override;
+ virtual void* GetResultBuffer() override;
+ virtual int GetResultOffset() override;
+ virtual void Free() override;
+ virtual bool HaveBuffer() const override;
virtual void* AllocUpTo(
- unsigned int size, unsigned int* size_allocated) OVERRIDE;
- virtual void* Alloc(unsigned int size) OVERRIDE;
- virtual RingBuffer::Offset GetOffset(void* pointer) const OVERRIDE;
- virtual void FreePendingToken(void* p, unsigned int /* token */) OVERRIDE;
+ unsigned int size, unsigned int* size_allocated) override;
+ virtual void* Alloc(unsigned int size) override;
+ virtual RingBuffer::Offset GetOffset(void* pointer) const override;
+ virtual void FreePendingToken(void* p, unsigned int /* token */) override;
size_t MaxTransferBufferSize() {
return size_ - result_size_;
@@ -506,8 +506,8 @@
GLES2ImplementationTest() : commands_(NULL) {}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
bool NoCommandsWritten() {
scoped_refptr<Buffer> ring_buffer = helper_->get_ring_buffer();
@@ -630,12 +630,12 @@
class GLES2ImplementationManualInitTest : public GLES2ImplementationTest {
protected:
- virtual void SetUp() OVERRIDE {}
+ virtual void SetUp() override {}
};
class GLES2ImplementationStrictSharedTest : public GLES2ImplementationTest {
protected:
- virtual void SetUp() OVERRIDE;
+ virtual void SetUp() override;
template <class ResApi>
void FlushGenerationTest() {
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
index 67fc2da..f059cad 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -12,47 +12,47 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_
-virtual void ActiveTexture(GLenum texture) OVERRIDE;
-virtual void AttachShader(GLuint program, GLuint shader) OVERRIDE;
+virtual void ActiveTexture(GLenum texture) override;
+virtual void AttachShader(GLuint program, GLuint shader) override;
virtual void BindAttribLocation(GLuint program,
GLuint index,
- const char* name) OVERRIDE;
-virtual void BindBuffer(GLenum target, GLuint buffer) OVERRIDE;
-virtual void BindFramebuffer(GLenum target, GLuint framebuffer) OVERRIDE;
-virtual void BindRenderbuffer(GLenum target, GLuint renderbuffer) OVERRIDE;
-virtual void BindTexture(GLenum target, GLuint texture) OVERRIDE;
+ const char* name) override;
+virtual void BindBuffer(GLenum target, GLuint buffer) override;
+virtual void BindFramebuffer(GLenum target, GLuint framebuffer) override;
+virtual void BindRenderbuffer(GLenum target, GLuint renderbuffer) override;
+virtual void BindTexture(GLenum target, GLuint texture) override;
virtual void BlendColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
-virtual void BlendEquation(GLenum mode) OVERRIDE;
-virtual void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) OVERRIDE;
-virtual void BlendFunc(GLenum sfactor, GLenum dfactor) OVERRIDE;
+ GLclampf alpha) override;
+virtual void BlendEquation(GLenum mode) override;
+virtual void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) override;
+virtual void BlendFunc(GLenum sfactor, GLenum dfactor) override;
virtual void BlendFuncSeparate(GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
- GLenum dstAlpha) OVERRIDE;
+ GLenum dstAlpha) override;
virtual void BufferData(GLenum target,
GLsizeiptr size,
const void* data,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
virtual void BufferSubData(GLenum target,
GLintptr offset,
GLsizeiptr size,
- const void* data) OVERRIDE;
-virtual GLenum CheckFramebufferStatus(GLenum target) OVERRIDE;
-virtual void Clear(GLbitfield mask) OVERRIDE;
+ const void* data) override;
+virtual GLenum CheckFramebufferStatus(GLenum target) override;
+virtual void Clear(GLbitfield mask) override;
virtual void ClearColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
-virtual void ClearDepthf(GLclampf depth) OVERRIDE;
-virtual void ClearStencil(GLint s) OVERRIDE;
+ GLclampf alpha) override;
+virtual void ClearDepthf(GLclampf depth) override;
+virtual void ClearStencil(GLint s) override;
virtual void ColorMask(GLboolean red,
GLboolean green,
GLboolean blue,
- GLboolean alpha) OVERRIDE;
-virtual void CompileShader(GLuint shader) OVERRIDE;
+ GLboolean alpha) override;
+virtual void CompileShader(GLuint shader) override;
virtual void CompressedTexImage2D(GLenum target,
GLint level,
GLenum internalformat,
@@ -60,7 +60,7 @@
GLsizei height,
GLint border,
GLsizei imageSize,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void CompressedTexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -69,7 +69,7 @@
GLsizei height,
GLenum format,
GLsizei imageSize,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void CopyTexImage2D(GLenum target,
GLint level,
GLenum internalformat,
@@ -77,7 +77,7 @@
GLint y,
GLsizei width,
GLsizei height,
- GLint border) OVERRIDE;
+ GLint border) override;
virtual void CopyTexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -85,170 +85,170 @@
GLint x,
GLint y,
GLsizei width,
- GLsizei height) OVERRIDE;
-virtual GLuint CreateProgram() OVERRIDE;
-virtual GLuint CreateShader(GLenum type) OVERRIDE;
-virtual void CullFace(GLenum mode) OVERRIDE;
-virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) OVERRIDE;
-virtual void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) OVERRIDE;
-virtual void DeleteProgram(GLuint program) OVERRIDE;
+ GLsizei height) override;
+virtual GLuint CreateProgram() override;
+virtual GLuint CreateShader(GLenum type) override;
+virtual void CullFace(GLenum mode) override;
+virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) override;
+virtual void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) override;
+virtual void DeleteProgram(GLuint program) override;
virtual void DeleteRenderbuffers(GLsizei n,
- const GLuint* renderbuffers) OVERRIDE;
-virtual void DeleteShader(GLuint shader) OVERRIDE;
-virtual void DeleteTextures(GLsizei n, const GLuint* textures) OVERRIDE;
-virtual void DepthFunc(GLenum func) OVERRIDE;
-virtual void DepthMask(GLboolean flag) OVERRIDE;
-virtual void DepthRangef(GLclampf zNear, GLclampf zFar) OVERRIDE;
-virtual void DetachShader(GLuint program, GLuint shader) OVERRIDE;
-virtual void Disable(GLenum cap) OVERRIDE;
-virtual void DisableVertexAttribArray(GLuint index) OVERRIDE;
-virtual void DrawArrays(GLenum mode, GLint first, GLsizei count) OVERRIDE;
+ const GLuint* renderbuffers) override;
+virtual void DeleteShader(GLuint shader) override;
+virtual void DeleteTextures(GLsizei n, const GLuint* textures) override;
+virtual void DepthFunc(GLenum func) override;
+virtual void DepthMask(GLboolean flag) override;
+virtual void DepthRangef(GLclampf zNear, GLclampf zFar) override;
+virtual void DetachShader(GLuint program, GLuint shader) override;
+virtual void Disable(GLenum cap) override;
+virtual void DisableVertexAttribArray(GLuint index) override;
+virtual void DrawArrays(GLenum mode, GLint first, GLsizei count) override;
virtual void DrawElements(GLenum mode,
GLsizei count,
GLenum type,
- const void* indices) OVERRIDE;
-virtual void Enable(GLenum cap) OVERRIDE;
-virtual void EnableVertexAttribArray(GLuint index) OVERRIDE;
-virtual void Finish() OVERRIDE;
-virtual void Flush() OVERRIDE;
+ const void* indices) override;
+virtual void Enable(GLenum cap) override;
+virtual void EnableVertexAttribArray(GLuint index) override;
+virtual void Finish() override;
+virtual void Flush() override;
virtual void FramebufferRenderbuffer(GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
- GLuint renderbuffer) OVERRIDE;
+ GLuint renderbuffer) override;
virtual void FramebufferTexture2D(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
- GLint level) OVERRIDE;
-virtual void FrontFace(GLenum mode) OVERRIDE;
-virtual void GenBuffers(GLsizei n, GLuint* buffers) OVERRIDE;
-virtual void GenerateMipmap(GLenum target) OVERRIDE;
-virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) OVERRIDE;
-virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) OVERRIDE;
-virtual void GenTextures(GLsizei n, GLuint* textures) OVERRIDE;
+ GLint level) override;
+virtual void FrontFace(GLenum mode) override;
+virtual void GenBuffers(GLsizei n, GLuint* buffers) override;
+virtual void GenerateMipmap(GLenum target) override;
+virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) override;
+virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override;
+virtual void GenTextures(GLsizei n, GLuint* textures) override;
virtual void GetActiveAttrib(GLuint program,
GLuint index,
GLsizei bufsize,
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual void GetActiveUniform(GLuint program,
GLuint index,
GLsizei bufsize,
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual void GetAttachedShaders(GLuint program,
GLsizei maxcount,
GLsizei* count,
- GLuint* shaders) OVERRIDE;
-virtual GLint GetAttribLocation(GLuint program, const char* name) OVERRIDE;
-virtual void GetBooleanv(GLenum pname, GLboolean* params) OVERRIDE;
+ GLuint* shaders) override;
+virtual GLint GetAttribLocation(GLuint program, const char* name) override;
+virtual void GetBooleanv(GLenum pname, GLboolean* params) override;
virtual void GetBufferParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
-virtual GLenum GetError() OVERRIDE;
-virtual void GetFloatv(GLenum pname, GLfloat* params) OVERRIDE;
+ GLint* params) override;
+virtual GLenum GetError() override;
+virtual void GetFloatv(GLenum pname, GLfloat* params) override;
virtual void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
- GLint* params) OVERRIDE;
-virtual void GetIntegerv(GLenum pname, GLint* params) OVERRIDE;
-virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) OVERRIDE;
+ GLint* params) override;
+virtual void GetIntegerv(GLenum pname, GLint* params) override;
+virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) override;
virtual void GetProgramInfoLog(GLuint program,
GLsizei bufsize,
GLsizei* length,
- char* infolog) OVERRIDE;
+ char* infolog) override;
virtual void GetRenderbufferParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
-virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) OVERRIDE;
+ GLint* params) override;
+virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override;
virtual void GetShaderInfoLog(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* infolog) OVERRIDE;
+ char* infolog) override;
virtual void GetShaderPrecisionFormat(GLenum shadertype,
GLenum precisiontype,
GLint* range,
- GLint* precision) OVERRIDE;
+ GLint* precision) override;
virtual void GetShaderSource(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* source) OVERRIDE;
-virtual const GLubyte* GetString(GLenum name) OVERRIDE;
+ char* source) override;
+virtual const GLubyte* GetString(GLenum name) override;
virtual void GetTexParameterfv(GLenum target,
GLenum pname,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetTexParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual void GetUniformfv(GLuint program,
GLint location,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetUniformiv(GLuint program,
GLint location,
- GLint* params) OVERRIDE;
-virtual GLint GetUniformLocation(GLuint program, const char* name) OVERRIDE;
+ GLint* params) override;
+virtual GLint GetUniformLocation(GLuint program, const char* name) override;
virtual void GetVertexAttribfv(GLuint index,
GLenum pname,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetVertexAttribiv(GLuint index,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual void GetVertexAttribPointerv(GLuint index,
GLenum pname,
- void** pointer) OVERRIDE;
-virtual void Hint(GLenum target, GLenum mode) OVERRIDE;
-virtual GLboolean IsBuffer(GLuint buffer) OVERRIDE;
-virtual GLboolean IsEnabled(GLenum cap) OVERRIDE;
-virtual GLboolean IsFramebuffer(GLuint framebuffer) OVERRIDE;
-virtual GLboolean IsProgram(GLuint program) OVERRIDE;
-virtual GLboolean IsRenderbuffer(GLuint renderbuffer) OVERRIDE;
-virtual GLboolean IsShader(GLuint shader) OVERRIDE;
-virtual GLboolean IsTexture(GLuint texture) OVERRIDE;
-virtual void LineWidth(GLfloat width) OVERRIDE;
-virtual void LinkProgram(GLuint program) OVERRIDE;
-virtual void PixelStorei(GLenum pname, GLint param) OVERRIDE;
-virtual void PolygonOffset(GLfloat factor, GLfloat units) OVERRIDE;
+ void** pointer) override;
+virtual void Hint(GLenum target, GLenum mode) override;
+virtual GLboolean IsBuffer(GLuint buffer) override;
+virtual GLboolean IsEnabled(GLenum cap) override;
+virtual GLboolean IsFramebuffer(GLuint framebuffer) override;
+virtual GLboolean IsProgram(GLuint program) override;
+virtual GLboolean IsRenderbuffer(GLuint renderbuffer) override;
+virtual GLboolean IsShader(GLuint shader) override;
+virtual GLboolean IsTexture(GLuint texture) override;
+virtual void LineWidth(GLfloat width) override;
+virtual void LinkProgram(GLuint program) override;
+virtual void PixelStorei(GLenum pname, GLint param) override;
+virtual void PolygonOffset(GLfloat factor, GLfloat units) override;
virtual void ReadPixels(GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
- void* pixels) OVERRIDE;
-virtual void ReleaseShaderCompiler() OVERRIDE;
+ void* pixels) override;
+virtual void ReleaseShaderCompiler() override;
virtual void RenderbufferStorage(GLenum target,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
-virtual void SampleCoverage(GLclampf value, GLboolean invert) OVERRIDE;
-virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) OVERRIDE;
+ GLsizei height) override;
+virtual void SampleCoverage(GLclampf value, GLboolean invert) override;
+virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override;
virtual void ShaderBinary(GLsizei n,
const GLuint* shaders,
GLenum binaryformat,
const void* binary,
- GLsizei length) OVERRIDE;
+ GLsizei length) override;
virtual void ShaderSource(GLuint shader,
GLsizei count,
const GLchar* const* str,
- const GLint* length) OVERRIDE;
-virtual void ShallowFinishCHROMIUM() OVERRIDE;
-virtual void ShallowFlushCHROMIUM() OVERRIDE;
-virtual void StencilFunc(GLenum func, GLint ref, GLuint mask) OVERRIDE;
+ const GLint* length) override;
+virtual void ShallowFinishCHROMIUM() override;
+virtual void ShallowFlushCHROMIUM() override;
+virtual void StencilFunc(GLenum func, GLint ref, GLuint mask) override;
virtual void StencilFuncSeparate(GLenum face,
GLenum func,
GLint ref,
- GLuint mask) OVERRIDE;
-virtual void StencilMask(GLuint mask) OVERRIDE;
-virtual void StencilMaskSeparate(GLenum face, GLuint mask) OVERRIDE;
-virtual void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) OVERRIDE;
+ GLuint mask) override;
+virtual void StencilMask(GLuint mask) override;
+virtual void StencilMaskSeparate(GLenum face, GLuint mask) override;
+virtual void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) override;
virtual void StencilOpSeparate(GLenum face,
GLenum fail,
GLenum zfail,
- GLenum zpass) OVERRIDE;
+ GLenum zpass) override;
virtual void TexImage2D(GLenum target,
GLint level,
GLint internalformat,
@@ -257,15 +257,15 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
-virtual void TexParameterf(GLenum target, GLenum pname, GLfloat param) OVERRIDE;
+ const void* pixels) override;
+virtual void TexParameterf(GLenum target, GLenum pname, GLfloat param) override;
virtual void TexParameterfv(GLenum target,
GLenum pname,
- const GLfloat* params) OVERRIDE;
-virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;
+ const GLfloat* params) override;
+virtual void TexParameteri(GLenum target, GLenum pname, GLint param) override;
virtual void TexParameteriv(GLenum target,
GLenum pname,
- const GLint* params) OVERRIDE;
+ const GLint* params) override;
virtual void TexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -274,78 +274,78 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
-virtual void Uniform1f(GLint location, GLfloat x) OVERRIDE;
+ const void* pixels) override;
+virtual void Uniform1f(GLint location, GLfloat x) override;
virtual void Uniform1fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
-virtual void Uniform1i(GLint location, GLint x) OVERRIDE;
-virtual void Uniform1iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
-virtual void Uniform2f(GLint location, GLfloat x, GLfloat y) OVERRIDE;
+ const GLfloat* v) override;
+virtual void Uniform1i(GLint location, GLint x) override;
+virtual void Uniform1iv(GLint location, GLsizei count, const GLint* v) override;
+virtual void Uniform2f(GLint location, GLfloat x, GLfloat y) override;
virtual void Uniform2fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
-virtual void Uniform2i(GLint location, GLint x, GLint y) OVERRIDE;
-virtual void Uniform2iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+ const GLfloat* v) override;
+virtual void Uniform2i(GLint location, GLint x, GLint y) override;
+virtual void Uniform2iv(GLint location, GLsizei count, const GLint* v) override;
virtual void Uniform3f(GLint location,
GLfloat x,
GLfloat y,
- GLfloat z) OVERRIDE;
+ GLfloat z) override;
virtual void Uniform3fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
-virtual void Uniform3i(GLint location, GLint x, GLint y, GLint z) OVERRIDE;
-virtual void Uniform3iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+ const GLfloat* v) override;
+virtual void Uniform3i(GLint location, GLint x, GLint y, GLint z) override;
+virtual void Uniform3iv(GLint location, GLsizei count, const GLint* v) override;
virtual void Uniform4f(GLint location,
GLfloat x,
GLfloat y,
GLfloat z,
- GLfloat w) OVERRIDE;
+ GLfloat w) override;
virtual void Uniform4fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
+ const GLfloat* v) override;
virtual void Uniform4i(GLint location,
GLint x,
GLint y,
GLint z,
- GLint w) OVERRIDE;
-virtual void Uniform4iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+ GLint w) override;
+virtual void Uniform4iv(GLint location, GLsizei count, const GLint* v) override;
virtual void UniformMatrix2fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
virtual void UniformMatrix3fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
virtual void UniformMatrix4fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
-virtual void UseProgram(GLuint program) OVERRIDE;
-virtual void ValidateProgram(GLuint program) OVERRIDE;
-virtual void VertexAttrib1f(GLuint indx, GLfloat x) OVERRIDE;
-virtual void VertexAttrib1fv(GLuint indx, const GLfloat* values) OVERRIDE;
-virtual void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) OVERRIDE;
-virtual void VertexAttrib2fv(GLuint indx, const GLfloat* values) OVERRIDE;
+ const GLfloat* value) override;
+virtual void UseProgram(GLuint program) override;
+virtual void ValidateProgram(GLuint program) override;
+virtual void VertexAttrib1f(GLuint indx, GLfloat x) override;
+virtual void VertexAttrib1fv(GLuint indx, const GLfloat* values) override;
+virtual void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) override;
+virtual void VertexAttrib2fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttrib3f(GLuint indx,
GLfloat x,
GLfloat y,
- GLfloat z) OVERRIDE;
-virtual void VertexAttrib3fv(GLuint indx, const GLfloat* values) OVERRIDE;
+ GLfloat z) override;
+virtual void VertexAttrib3fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttrib4f(GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z,
- GLfloat w) OVERRIDE;
-virtual void VertexAttrib4fv(GLuint indx, const GLfloat* values) OVERRIDE;
+ GLfloat w) override;
+virtual void VertexAttrib4fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttribPointer(GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
- const void* ptr) OVERRIDE;
-virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) OVERRIDE;
+ const void* ptr) override;
+virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override;
virtual void BlitFramebufferCHROMIUM(GLint srcX0,
GLint srcY0,
GLint srcX1,
@@ -355,60 +355,60 @@
GLint dstX1,
GLint dstY1,
GLbitfield mask,
- GLenum filter) OVERRIDE;
+ GLenum filter) override;
virtual void RenderbufferStorageMultisampleCHROMIUM(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void RenderbufferStorageMultisampleEXT(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void FramebufferTexture2DMultisampleEXT(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level,
- GLsizei samples) OVERRIDE;
+ GLsizei samples) override;
virtual void TexStorage2DEXT(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
- GLsizei height) OVERRIDE;
-virtual void GenQueriesEXT(GLsizei n, GLuint* queries) OVERRIDE;
-virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) OVERRIDE;
-virtual GLboolean IsQueryEXT(GLuint id) OVERRIDE;
-virtual void BeginQueryEXT(GLenum target, GLuint id) OVERRIDE;
-virtual void EndQueryEXT(GLenum target) OVERRIDE;
-virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) OVERRIDE;
+ GLsizei height) override;
+virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override;
+virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
+virtual GLboolean IsQueryEXT(GLuint id) override;
+virtual void BeginQueryEXT(GLenum target, GLuint id) override;
+virtual void EndQueryEXT(GLenum target) override;
+virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) override;
virtual void GetQueryObjectuivEXT(GLuint id,
GLenum pname,
- GLuint* params) OVERRIDE;
+ GLuint* params) override;
virtual void InsertEventMarkerEXT(GLsizei length,
- const GLchar* marker) OVERRIDE;
-virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) OVERRIDE;
-virtual void PopGroupMarkerEXT() OVERRIDE;
-virtual void GenVertexArraysOES(GLsizei n, GLuint* arrays) OVERRIDE;
-virtual void DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) OVERRIDE;
-virtual GLboolean IsVertexArrayOES(GLuint array) OVERRIDE;
-virtual void BindVertexArrayOES(GLuint array) OVERRIDE;
-virtual void SwapBuffers() OVERRIDE;
+ const GLchar* marker) override;
+virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) override;
+virtual void PopGroupMarkerEXT() override;
+virtual void GenVertexArraysOES(GLsizei n, GLuint* arrays) override;
+virtual void DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) override;
+virtual GLboolean IsVertexArrayOES(GLuint array) override;
+virtual void BindVertexArrayOES(GLuint array) override;
+virtual void SwapBuffers() override;
virtual GLuint GetMaxValueInBufferCHROMIUM(GLuint buffer_id,
GLsizei count,
GLenum type,
- GLuint offset) OVERRIDE;
-virtual GLboolean EnableFeatureCHROMIUM(const char* feature) OVERRIDE;
-virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) OVERRIDE;
-virtual GLboolean UnmapBufferCHROMIUM(GLuint target) OVERRIDE;
-virtual void* MapImageCHROMIUM(GLuint image_id) OVERRIDE;
-virtual void UnmapImageCHROMIUM(GLuint image_id) OVERRIDE;
+ GLuint offset) override;
+virtual GLboolean EnableFeatureCHROMIUM(const char* feature) override;
+virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
+virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
+virtual void* MapImageCHROMIUM(GLuint image_id) override;
+virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
- GLenum access) OVERRIDE;
-virtual void UnmapBufferSubDataCHROMIUM(const void* mem) OVERRIDE;
+ GLenum access) override;
+virtual void UnmapBufferSubDataCHROMIUM(const void* mem) override;
virtual void* MapTexSubImage2DCHROMIUM(GLenum target,
GLint level,
GLint xoffset,
@@ -417,81 +417,81 @@
GLsizei height,
GLenum format,
GLenum type,
- GLenum access) OVERRIDE;
-virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) OVERRIDE;
+ GLenum access) override;
+virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) override;
virtual void ResizeCHROMIUM(GLuint width,
GLuint height,
- GLfloat scale_factor) OVERRIDE;
-virtual const GLchar* GetRequestableExtensionsCHROMIUM() OVERRIDE;
-virtual void RequestExtensionCHROMIUM(const char* extension) OVERRIDE;
-virtual void RateLimitOffscreenContextCHROMIUM() OVERRIDE;
+ GLfloat scale_factor) override;
+virtual const GLchar* GetRequestableExtensionsCHROMIUM() override;
+virtual void RequestExtensionCHROMIUM(const char* extension) override;
+virtual void RateLimitOffscreenContextCHROMIUM() override;
virtual void GetMultipleIntegervCHROMIUM(const GLenum* pnames,
GLuint count,
GLint* results,
- GLsizeiptr size) OVERRIDE;
+ GLsizeiptr size) override;
virtual void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
- void* info) OVERRIDE;
-virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) OVERRIDE;
+ void* info) override;
+virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) override;
virtual GLuint CreateImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
-virtual void DestroyImageCHROMIUM(GLuint image_id) OVERRIDE;
+ GLenum usage) override;
+virtual void DestroyImageCHROMIUM(GLuint image_id) override;
virtual void GetImageParameterivCHROMIUM(GLuint image_id,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
virtual void GetTranslatedShaderSourceANGLE(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* source) OVERRIDE;
+ char* source) override;
virtual void PostSubBufferCHROMIUM(GLint x,
GLint y,
GLint width,
- GLint height) OVERRIDE;
+ GLint height) override;
virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
GLsizei width,
GLsizei height,
GLuint ioSurfaceId,
- GLuint plane) OVERRIDE;
+ GLuint plane) override;
virtual void CopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id,
GLint level,
GLint internalformat,
- GLenum dest_type) OVERRIDE;
+ GLenum dest_type) override;
virtual void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
- GLsizei primcount) OVERRIDE;
+ GLsizei primcount) override;
virtual void DrawElementsInstancedANGLE(GLenum mode,
GLsizei count,
GLenum type,
const void* indices,
- GLsizei primcount) OVERRIDE;
-virtual void VertexAttribDivisorANGLE(GLuint index, GLuint divisor) OVERRIDE;
-virtual void GenMailboxCHROMIUM(GLbyte* mailbox) OVERRIDE;
+ GLsizei primcount) override;
+virtual void VertexAttribDivisorANGLE(GLuint index, GLuint divisor) override;
+virtual void GenMailboxCHROMIUM(GLbyte* mailbox) override;
virtual void ProduceTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ProduceTextureDirectCHROMIUM(GLuint texture,
GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual GLuint CreateAndConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void BindUniformLocationCHROMIUM(GLuint program,
GLint location,
- const char* name) OVERRIDE;
-virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE;
-virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE;
-virtual void TraceBeginCHROMIUM(const char* name) OVERRIDE;
-virtual void TraceEndCHROMIUM() OVERRIDE;
+ const char* name) override;
+virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
+virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
+virtual void TraceBeginCHROMIUM(const char* name) override;
+virtual void TraceEndCHROMIUM() override;
virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
GLint level,
GLint xoffset,
@@ -500,7 +500,7 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void AsyncTexImage2DCHROMIUM(GLenum target,
GLint level,
GLenum internalformat,
@@ -509,17 +509,17 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
-virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE;
-virtual void WaitAllAsyncTexImage2DCHROMIUM() OVERRIDE;
+ const void* pixels) override;
+virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
+virtual void WaitAllAsyncTexImage2DCHROMIUM() override;
virtual void DiscardFramebufferEXT(GLenum target,
GLsizei count,
- const GLenum* attachments) OVERRIDE;
-virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
-virtual GLuint InsertSyncPointCHROMIUM() OVERRIDE;
-virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
-virtual void DrawBuffersEXT(GLsizei count, const GLenum* bufs) OVERRIDE;
-virtual void DiscardBackbufferCHROMIUM() OVERRIDE;
+ const GLenum* attachments) override;
+virtual void LoseContextCHROMIUM(GLenum current, GLenum other) override;
+virtual GLuint InsertSyncPointCHROMIUM() override;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) override;
+virtual void DrawBuffersEXT(GLsizei count, const GLenum* bufs) override;
+virtual void DiscardBackbufferCHROMIUM() override;
virtual void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
GLenum plane_transform,
GLuint overlay_texture_id,
@@ -530,7 +530,7 @@
GLfloat uv_x,
GLfloat uv_y,
GLfloat uv_width,
- GLfloat uv_height) OVERRIDE;
-virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) OVERRIDE;
-virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) OVERRIDE;
+ GLfloat uv_height) override;
+virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
+virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index 1083251..1e7bc8f 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -12,47 +12,47 @@
#ifndef GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_AUTOGEN_H_
-virtual void ActiveTexture(GLenum texture) OVERRIDE;
-virtual void AttachShader(GLuint program, GLuint shader) OVERRIDE;
+virtual void ActiveTexture(GLenum texture) override;
+virtual void AttachShader(GLuint program, GLuint shader) override;
virtual void BindAttribLocation(GLuint program,
GLuint index,
- const char* name) OVERRIDE;
-virtual void BindBuffer(GLenum target, GLuint buffer) OVERRIDE;
-virtual void BindFramebuffer(GLenum target, GLuint framebuffer) OVERRIDE;
-virtual void BindRenderbuffer(GLenum target, GLuint renderbuffer) OVERRIDE;
-virtual void BindTexture(GLenum target, GLuint texture) OVERRIDE;
+ const char* name) override;
+virtual void BindBuffer(GLenum target, GLuint buffer) override;
+virtual void BindFramebuffer(GLenum target, GLuint framebuffer) override;
+virtual void BindRenderbuffer(GLenum target, GLuint renderbuffer) override;
+virtual void BindTexture(GLenum target, GLuint texture) override;
virtual void BlendColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
-virtual void BlendEquation(GLenum mode) OVERRIDE;
-virtual void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) OVERRIDE;
-virtual void BlendFunc(GLenum sfactor, GLenum dfactor) OVERRIDE;
+ GLclampf alpha) override;
+virtual void BlendEquation(GLenum mode) override;
+virtual void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) override;
+virtual void BlendFunc(GLenum sfactor, GLenum dfactor) override;
virtual void BlendFuncSeparate(GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
- GLenum dstAlpha) OVERRIDE;
+ GLenum dstAlpha) override;
virtual void BufferData(GLenum target,
GLsizeiptr size,
const void* data,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
virtual void BufferSubData(GLenum target,
GLintptr offset,
GLsizeiptr size,
- const void* data) OVERRIDE;
-virtual GLenum CheckFramebufferStatus(GLenum target) OVERRIDE;
-virtual void Clear(GLbitfield mask) OVERRIDE;
+ const void* data) override;
+virtual GLenum CheckFramebufferStatus(GLenum target) override;
+virtual void Clear(GLbitfield mask) override;
virtual void ClearColor(GLclampf red,
GLclampf green,
GLclampf blue,
- GLclampf alpha) OVERRIDE;
-virtual void ClearDepthf(GLclampf depth) OVERRIDE;
-virtual void ClearStencil(GLint s) OVERRIDE;
+ GLclampf alpha) override;
+virtual void ClearDepthf(GLclampf depth) override;
+virtual void ClearStencil(GLint s) override;
virtual void ColorMask(GLboolean red,
GLboolean green,
GLboolean blue,
- GLboolean alpha) OVERRIDE;
-virtual void CompileShader(GLuint shader) OVERRIDE;
+ GLboolean alpha) override;
+virtual void CompileShader(GLuint shader) override;
virtual void CompressedTexImage2D(GLenum target,
GLint level,
GLenum internalformat,
@@ -60,7 +60,7 @@
GLsizei height,
GLint border,
GLsizei imageSize,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void CompressedTexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -69,7 +69,7 @@
GLsizei height,
GLenum format,
GLsizei imageSize,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void CopyTexImage2D(GLenum target,
GLint level,
GLenum internalformat,
@@ -77,7 +77,7 @@
GLint y,
GLsizei width,
GLsizei height,
- GLint border) OVERRIDE;
+ GLint border) override;
virtual void CopyTexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -85,170 +85,170 @@
GLint x,
GLint y,
GLsizei width,
- GLsizei height) OVERRIDE;
-virtual GLuint CreateProgram() OVERRIDE;
-virtual GLuint CreateShader(GLenum type) OVERRIDE;
-virtual void CullFace(GLenum mode) OVERRIDE;
-virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) OVERRIDE;
-virtual void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) OVERRIDE;
-virtual void DeleteProgram(GLuint program) OVERRIDE;
+ GLsizei height) override;
+virtual GLuint CreateProgram() override;
+virtual GLuint CreateShader(GLenum type) override;
+virtual void CullFace(GLenum mode) override;
+virtual void DeleteBuffers(GLsizei n, const GLuint* buffers) override;
+virtual void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) override;
+virtual void DeleteProgram(GLuint program) override;
virtual void DeleteRenderbuffers(GLsizei n,
- const GLuint* renderbuffers) OVERRIDE;
-virtual void DeleteShader(GLuint shader) OVERRIDE;
-virtual void DeleteTextures(GLsizei n, const GLuint* textures) OVERRIDE;
-virtual void DepthFunc(GLenum func) OVERRIDE;
-virtual void DepthMask(GLboolean flag) OVERRIDE;
-virtual void DepthRangef(GLclampf zNear, GLclampf zFar) OVERRIDE;
-virtual void DetachShader(GLuint program, GLuint shader) OVERRIDE;
-virtual void Disable(GLenum cap) OVERRIDE;
-virtual void DisableVertexAttribArray(GLuint index) OVERRIDE;
-virtual void DrawArrays(GLenum mode, GLint first, GLsizei count) OVERRIDE;
+ const GLuint* renderbuffers) override;
+virtual void DeleteShader(GLuint shader) override;
+virtual void DeleteTextures(GLsizei n, const GLuint* textures) override;
+virtual void DepthFunc(GLenum func) override;
+virtual void DepthMask(GLboolean flag) override;
+virtual void DepthRangef(GLclampf zNear, GLclampf zFar) override;
+virtual void DetachShader(GLuint program, GLuint shader) override;
+virtual void Disable(GLenum cap) override;
+virtual void DisableVertexAttribArray(GLuint index) override;
+virtual void DrawArrays(GLenum mode, GLint first, GLsizei count) override;
virtual void DrawElements(GLenum mode,
GLsizei count,
GLenum type,
- const void* indices) OVERRIDE;
-virtual void Enable(GLenum cap) OVERRIDE;
-virtual void EnableVertexAttribArray(GLuint index) OVERRIDE;
-virtual void Finish() OVERRIDE;
-virtual void Flush() OVERRIDE;
+ const void* indices) override;
+virtual void Enable(GLenum cap) override;
+virtual void EnableVertexAttribArray(GLuint index) override;
+virtual void Finish() override;
+virtual void Flush() override;
virtual void FramebufferRenderbuffer(GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
- GLuint renderbuffer) OVERRIDE;
+ GLuint renderbuffer) override;
virtual void FramebufferTexture2D(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
- GLint level) OVERRIDE;
-virtual void FrontFace(GLenum mode) OVERRIDE;
-virtual void GenBuffers(GLsizei n, GLuint* buffers) OVERRIDE;
-virtual void GenerateMipmap(GLenum target) OVERRIDE;
-virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) OVERRIDE;
-virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) OVERRIDE;
-virtual void GenTextures(GLsizei n, GLuint* textures) OVERRIDE;
+ GLint level) override;
+virtual void FrontFace(GLenum mode) override;
+virtual void GenBuffers(GLsizei n, GLuint* buffers) override;
+virtual void GenerateMipmap(GLenum target) override;
+virtual void GenFramebuffers(GLsizei n, GLuint* framebuffers) override;
+virtual void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override;
+virtual void GenTextures(GLsizei n, GLuint* textures) override;
virtual void GetActiveAttrib(GLuint program,
GLuint index,
GLsizei bufsize,
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual void GetActiveUniform(GLuint program,
GLuint index,
GLsizei bufsize,
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual void GetAttachedShaders(GLuint program,
GLsizei maxcount,
GLsizei* count,
- GLuint* shaders) OVERRIDE;
-virtual GLint GetAttribLocation(GLuint program, const char* name) OVERRIDE;
-virtual void GetBooleanv(GLenum pname, GLboolean* params) OVERRIDE;
+ GLuint* shaders) override;
+virtual GLint GetAttribLocation(GLuint program, const char* name) override;
+virtual void GetBooleanv(GLenum pname, GLboolean* params) override;
virtual void GetBufferParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
-virtual GLenum GetError() OVERRIDE;
-virtual void GetFloatv(GLenum pname, GLfloat* params) OVERRIDE;
+ GLint* params) override;
+virtual GLenum GetError() override;
+virtual void GetFloatv(GLenum pname, GLfloat* params) override;
virtual void GetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname,
- GLint* params) OVERRIDE;
-virtual void GetIntegerv(GLenum pname, GLint* params) OVERRIDE;
-virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) OVERRIDE;
+ GLint* params) override;
+virtual void GetIntegerv(GLenum pname, GLint* params) override;
+virtual void GetProgramiv(GLuint program, GLenum pname, GLint* params) override;
virtual void GetProgramInfoLog(GLuint program,
GLsizei bufsize,
GLsizei* length,
- char* infolog) OVERRIDE;
+ char* infolog) override;
virtual void GetRenderbufferParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
-virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) OVERRIDE;
+ GLint* params) override;
+virtual void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override;
virtual void GetShaderInfoLog(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* infolog) OVERRIDE;
+ char* infolog) override;
virtual void GetShaderPrecisionFormat(GLenum shadertype,
GLenum precisiontype,
GLint* range,
- GLint* precision) OVERRIDE;
+ GLint* precision) override;
virtual void GetShaderSource(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* source) OVERRIDE;
-virtual const GLubyte* GetString(GLenum name) OVERRIDE;
+ char* source) override;
+virtual const GLubyte* GetString(GLenum name) override;
virtual void GetTexParameterfv(GLenum target,
GLenum pname,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetTexParameteriv(GLenum target,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual void GetUniformfv(GLuint program,
GLint location,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetUniformiv(GLuint program,
GLint location,
- GLint* params) OVERRIDE;
-virtual GLint GetUniformLocation(GLuint program, const char* name) OVERRIDE;
+ GLint* params) override;
+virtual GLint GetUniformLocation(GLuint program, const char* name) override;
virtual void GetVertexAttribfv(GLuint index,
GLenum pname,
- GLfloat* params) OVERRIDE;
+ GLfloat* params) override;
virtual void GetVertexAttribiv(GLuint index,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual void GetVertexAttribPointerv(GLuint index,
GLenum pname,
- void** pointer) OVERRIDE;
-virtual void Hint(GLenum target, GLenum mode) OVERRIDE;
-virtual GLboolean IsBuffer(GLuint buffer) OVERRIDE;
-virtual GLboolean IsEnabled(GLenum cap) OVERRIDE;
-virtual GLboolean IsFramebuffer(GLuint framebuffer) OVERRIDE;
-virtual GLboolean IsProgram(GLuint program) OVERRIDE;
-virtual GLboolean IsRenderbuffer(GLuint renderbuffer) OVERRIDE;
-virtual GLboolean IsShader(GLuint shader) OVERRIDE;
-virtual GLboolean IsTexture(GLuint texture) OVERRIDE;
-virtual void LineWidth(GLfloat width) OVERRIDE;
-virtual void LinkProgram(GLuint program) OVERRIDE;
-virtual void PixelStorei(GLenum pname, GLint param) OVERRIDE;
-virtual void PolygonOffset(GLfloat factor, GLfloat units) OVERRIDE;
+ void** pointer) override;
+virtual void Hint(GLenum target, GLenum mode) override;
+virtual GLboolean IsBuffer(GLuint buffer) override;
+virtual GLboolean IsEnabled(GLenum cap) override;
+virtual GLboolean IsFramebuffer(GLuint framebuffer) override;
+virtual GLboolean IsProgram(GLuint program) override;
+virtual GLboolean IsRenderbuffer(GLuint renderbuffer) override;
+virtual GLboolean IsShader(GLuint shader) override;
+virtual GLboolean IsTexture(GLuint texture) override;
+virtual void LineWidth(GLfloat width) override;
+virtual void LinkProgram(GLuint program) override;
+virtual void PixelStorei(GLenum pname, GLint param) override;
+virtual void PolygonOffset(GLfloat factor, GLfloat units) override;
virtual void ReadPixels(GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
- void* pixels) OVERRIDE;
-virtual void ReleaseShaderCompiler() OVERRIDE;
+ void* pixels) override;
+virtual void ReleaseShaderCompiler() override;
virtual void RenderbufferStorage(GLenum target,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
-virtual void SampleCoverage(GLclampf value, GLboolean invert) OVERRIDE;
-virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) OVERRIDE;
+ GLsizei height) override;
+virtual void SampleCoverage(GLclampf value, GLboolean invert) override;
+virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override;
virtual void ShaderBinary(GLsizei n,
const GLuint* shaders,
GLenum binaryformat,
const void* binary,
- GLsizei length) OVERRIDE;
+ GLsizei length) override;
virtual void ShaderSource(GLuint shader,
GLsizei count,
const GLchar* const* str,
- const GLint* length) OVERRIDE;
-virtual void ShallowFinishCHROMIUM() OVERRIDE;
-virtual void ShallowFlushCHROMIUM() OVERRIDE;
-virtual void StencilFunc(GLenum func, GLint ref, GLuint mask) OVERRIDE;
+ const GLint* length) override;
+virtual void ShallowFinishCHROMIUM() override;
+virtual void ShallowFlushCHROMIUM() override;
+virtual void StencilFunc(GLenum func, GLint ref, GLuint mask) override;
virtual void StencilFuncSeparate(GLenum face,
GLenum func,
GLint ref,
- GLuint mask) OVERRIDE;
-virtual void StencilMask(GLuint mask) OVERRIDE;
-virtual void StencilMaskSeparate(GLenum face, GLuint mask) OVERRIDE;
-virtual void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) OVERRIDE;
+ GLuint mask) override;
+virtual void StencilMask(GLuint mask) override;
+virtual void StencilMaskSeparate(GLenum face, GLuint mask) override;
+virtual void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) override;
virtual void StencilOpSeparate(GLenum face,
GLenum fail,
GLenum zfail,
- GLenum zpass) OVERRIDE;
+ GLenum zpass) override;
virtual void TexImage2D(GLenum target,
GLint level,
GLint internalformat,
@@ -257,15 +257,15 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
-virtual void TexParameterf(GLenum target, GLenum pname, GLfloat param) OVERRIDE;
+ const void* pixels) override;
+virtual void TexParameterf(GLenum target, GLenum pname, GLfloat param) override;
virtual void TexParameterfv(GLenum target,
GLenum pname,
- const GLfloat* params) OVERRIDE;
-virtual void TexParameteri(GLenum target, GLenum pname, GLint param) OVERRIDE;
+ const GLfloat* params) override;
+virtual void TexParameteri(GLenum target, GLenum pname, GLint param) override;
virtual void TexParameteriv(GLenum target,
GLenum pname,
- const GLint* params) OVERRIDE;
+ const GLint* params) override;
virtual void TexSubImage2D(GLenum target,
GLint level,
GLint xoffset,
@@ -274,78 +274,78 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
-virtual void Uniform1f(GLint location, GLfloat x) OVERRIDE;
+ const void* pixels) override;
+virtual void Uniform1f(GLint location, GLfloat x) override;
virtual void Uniform1fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
-virtual void Uniform1i(GLint location, GLint x) OVERRIDE;
-virtual void Uniform1iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
-virtual void Uniform2f(GLint location, GLfloat x, GLfloat y) OVERRIDE;
+ const GLfloat* v) override;
+virtual void Uniform1i(GLint location, GLint x) override;
+virtual void Uniform1iv(GLint location, GLsizei count, const GLint* v) override;
+virtual void Uniform2f(GLint location, GLfloat x, GLfloat y) override;
virtual void Uniform2fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
-virtual void Uniform2i(GLint location, GLint x, GLint y) OVERRIDE;
-virtual void Uniform2iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+ const GLfloat* v) override;
+virtual void Uniform2i(GLint location, GLint x, GLint y) override;
+virtual void Uniform2iv(GLint location, GLsizei count, const GLint* v) override;
virtual void Uniform3f(GLint location,
GLfloat x,
GLfloat y,
- GLfloat z) OVERRIDE;
+ GLfloat z) override;
virtual void Uniform3fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
-virtual void Uniform3i(GLint location, GLint x, GLint y, GLint z) OVERRIDE;
-virtual void Uniform3iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+ const GLfloat* v) override;
+virtual void Uniform3i(GLint location, GLint x, GLint y, GLint z) override;
+virtual void Uniform3iv(GLint location, GLsizei count, const GLint* v) override;
virtual void Uniform4f(GLint location,
GLfloat x,
GLfloat y,
GLfloat z,
- GLfloat w) OVERRIDE;
+ GLfloat w) override;
virtual void Uniform4fv(GLint location,
GLsizei count,
- const GLfloat* v) OVERRIDE;
+ const GLfloat* v) override;
virtual void Uniform4i(GLint location,
GLint x,
GLint y,
GLint z,
- GLint w) OVERRIDE;
-virtual void Uniform4iv(GLint location, GLsizei count, const GLint* v) OVERRIDE;
+ GLint w) override;
+virtual void Uniform4iv(GLint location, GLsizei count, const GLint* v) override;
virtual void UniformMatrix2fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
virtual void UniformMatrix3fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
+ const GLfloat* value) override;
virtual void UniformMatrix4fv(GLint location,
GLsizei count,
GLboolean transpose,
- const GLfloat* value) OVERRIDE;
-virtual void UseProgram(GLuint program) OVERRIDE;
-virtual void ValidateProgram(GLuint program) OVERRIDE;
-virtual void VertexAttrib1f(GLuint indx, GLfloat x) OVERRIDE;
-virtual void VertexAttrib1fv(GLuint indx, const GLfloat* values) OVERRIDE;
-virtual void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) OVERRIDE;
-virtual void VertexAttrib2fv(GLuint indx, const GLfloat* values) OVERRIDE;
+ const GLfloat* value) override;
+virtual void UseProgram(GLuint program) override;
+virtual void ValidateProgram(GLuint program) override;
+virtual void VertexAttrib1f(GLuint indx, GLfloat x) override;
+virtual void VertexAttrib1fv(GLuint indx, const GLfloat* values) override;
+virtual void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) override;
+virtual void VertexAttrib2fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttrib3f(GLuint indx,
GLfloat x,
GLfloat y,
- GLfloat z) OVERRIDE;
-virtual void VertexAttrib3fv(GLuint indx, const GLfloat* values) OVERRIDE;
+ GLfloat z) override;
+virtual void VertexAttrib3fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttrib4f(GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z,
- GLfloat w) OVERRIDE;
-virtual void VertexAttrib4fv(GLuint indx, const GLfloat* values) OVERRIDE;
+ GLfloat w) override;
+virtual void VertexAttrib4fv(GLuint indx, const GLfloat* values) override;
virtual void VertexAttribPointer(GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
- const void* ptr) OVERRIDE;
-virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) OVERRIDE;
+ const void* ptr) override;
+virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override;
virtual void BlitFramebufferCHROMIUM(GLint srcX0,
GLint srcY0,
GLint srcX1,
@@ -355,60 +355,60 @@
GLint dstX1,
GLint dstY1,
GLbitfield mask,
- GLenum filter) OVERRIDE;
+ GLenum filter) override;
virtual void RenderbufferStorageMultisampleCHROMIUM(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void RenderbufferStorageMultisampleEXT(GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
- GLsizei height) OVERRIDE;
+ GLsizei height) override;
virtual void FramebufferTexture2DMultisampleEXT(GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level,
- GLsizei samples) OVERRIDE;
+ GLsizei samples) override;
virtual void TexStorage2DEXT(GLenum target,
GLsizei levels,
GLenum internalFormat,
GLsizei width,
- GLsizei height) OVERRIDE;
-virtual void GenQueriesEXT(GLsizei n, GLuint* queries) OVERRIDE;
-virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) OVERRIDE;
-virtual GLboolean IsQueryEXT(GLuint id) OVERRIDE;
-virtual void BeginQueryEXT(GLenum target, GLuint id) OVERRIDE;
-virtual void EndQueryEXT(GLenum target) OVERRIDE;
-virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) OVERRIDE;
+ GLsizei height) override;
+virtual void GenQueriesEXT(GLsizei n, GLuint* queries) override;
+virtual void DeleteQueriesEXT(GLsizei n, const GLuint* queries) override;
+virtual GLboolean IsQueryEXT(GLuint id) override;
+virtual void BeginQueryEXT(GLenum target, GLuint id) override;
+virtual void EndQueryEXT(GLenum target) override;
+virtual void GetQueryivEXT(GLenum target, GLenum pname, GLint* params) override;
virtual void GetQueryObjectuivEXT(GLuint id,
GLenum pname,
- GLuint* params) OVERRIDE;
+ GLuint* params) override;
virtual void InsertEventMarkerEXT(GLsizei length,
- const GLchar* marker) OVERRIDE;
-virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) OVERRIDE;
-virtual void PopGroupMarkerEXT() OVERRIDE;
-virtual void GenVertexArraysOES(GLsizei n, GLuint* arrays) OVERRIDE;
-virtual void DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) OVERRIDE;
-virtual GLboolean IsVertexArrayOES(GLuint array) OVERRIDE;
-virtual void BindVertexArrayOES(GLuint array) OVERRIDE;
-virtual void SwapBuffers() OVERRIDE;
+ const GLchar* marker) override;
+virtual void PushGroupMarkerEXT(GLsizei length, const GLchar* marker) override;
+virtual void PopGroupMarkerEXT() override;
+virtual void GenVertexArraysOES(GLsizei n, GLuint* arrays) override;
+virtual void DeleteVertexArraysOES(GLsizei n, const GLuint* arrays) override;
+virtual GLboolean IsVertexArrayOES(GLuint array) override;
+virtual void BindVertexArrayOES(GLuint array) override;
+virtual void SwapBuffers() override;
virtual GLuint GetMaxValueInBufferCHROMIUM(GLuint buffer_id,
GLsizei count,
GLenum type,
- GLuint offset) OVERRIDE;
-virtual GLboolean EnableFeatureCHROMIUM(const char* feature) OVERRIDE;
-virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) OVERRIDE;
-virtual GLboolean UnmapBufferCHROMIUM(GLuint target) OVERRIDE;
-virtual void* MapImageCHROMIUM(GLuint image_id) OVERRIDE;
-virtual void UnmapImageCHROMIUM(GLuint image_id) OVERRIDE;
+ GLuint offset) override;
+virtual GLboolean EnableFeatureCHROMIUM(const char* feature) override;
+virtual void* MapBufferCHROMIUM(GLuint target, GLenum access) override;
+virtual GLboolean UnmapBufferCHROMIUM(GLuint target) override;
+virtual void* MapImageCHROMIUM(GLuint image_id) override;
+virtual void UnmapImageCHROMIUM(GLuint image_id) override;
virtual void* MapBufferSubDataCHROMIUM(GLuint target,
GLintptr offset,
GLsizeiptr size,
- GLenum access) OVERRIDE;
-virtual void UnmapBufferSubDataCHROMIUM(const void* mem) OVERRIDE;
+ GLenum access) override;
+virtual void UnmapBufferSubDataCHROMIUM(const void* mem) override;
virtual void* MapTexSubImage2DCHROMIUM(GLenum target,
GLint level,
GLint xoffset,
@@ -417,81 +417,81 @@
GLsizei height,
GLenum format,
GLenum type,
- GLenum access) OVERRIDE;
-virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) OVERRIDE;
+ GLenum access) override;
+virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) override;
virtual void ResizeCHROMIUM(GLuint width,
GLuint height,
- GLfloat scale_factor) OVERRIDE;
-virtual const GLchar* GetRequestableExtensionsCHROMIUM() OVERRIDE;
-virtual void RequestExtensionCHROMIUM(const char* extension) OVERRIDE;
-virtual void RateLimitOffscreenContextCHROMIUM() OVERRIDE;
+ GLfloat scale_factor) override;
+virtual const GLchar* GetRequestableExtensionsCHROMIUM() override;
+virtual void RequestExtensionCHROMIUM(const char* extension) override;
+virtual void RateLimitOffscreenContextCHROMIUM() override;
virtual void GetMultipleIntegervCHROMIUM(const GLenum* pnames,
GLuint count,
GLint* results,
- GLsizeiptr size) OVERRIDE;
+ GLsizeiptr size) override;
virtual void GetProgramInfoCHROMIUM(GLuint program,
GLsizei bufsize,
GLsizei* size,
- void* info) OVERRIDE;
-virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) OVERRIDE;
+ void* info) override;
+virtual GLuint CreateStreamTextureCHROMIUM(GLuint texture) override;
virtual GLuint CreateImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
-virtual void DestroyImageCHROMIUM(GLuint image_id) OVERRIDE;
+ GLenum usage) override;
+virtual void DestroyImageCHROMIUM(GLuint image_id) override;
virtual void GetImageParameterivCHROMIUM(GLuint image_id,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual GLuint CreateGpuMemoryBufferImageCHROMIUM(GLsizei width,
GLsizei height,
GLenum internalformat,
- GLenum usage) OVERRIDE;
+ GLenum usage) override;
virtual void GetTranslatedShaderSourceANGLE(GLuint shader,
GLsizei bufsize,
GLsizei* length,
- char* source) OVERRIDE;
+ char* source) override;
virtual void PostSubBufferCHROMIUM(GLint x,
GLint y,
GLint width,
- GLint height) OVERRIDE;
+ GLint height) override;
virtual void TexImageIOSurface2DCHROMIUM(GLenum target,
GLsizei width,
GLsizei height,
GLuint ioSurfaceId,
- GLuint plane) OVERRIDE;
+ GLuint plane) override;
virtual void CopyTextureCHROMIUM(GLenum target,
GLenum source_id,
GLenum dest_id,
GLint level,
GLint internalformat,
- GLenum dest_type) OVERRIDE;
+ GLenum dest_type) override;
virtual void DrawArraysInstancedANGLE(GLenum mode,
GLint first,
GLsizei count,
- GLsizei primcount) OVERRIDE;
+ GLsizei primcount) override;
virtual void DrawElementsInstancedANGLE(GLenum mode,
GLsizei count,
GLenum type,
const void* indices,
- GLsizei primcount) OVERRIDE;
-virtual void VertexAttribDivisorANGLE(GLuint index, GLuint divisor) OVERRIDE;
-virtual void GenMailboxCHROMIUM(GLbyte* mailbox) OVERRIDE;
+ GLsizei primcount) override;
+virtual void VertexAttribDivisorANGLE(GLuint index, GLuint divisor) override;
+virtual void GenMailboxCHROMIUM(GLbyte* mailbox) override;
virtual void ProduceTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ProduceTextureDirectCHROMIUM(GLuint texture,
GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void ConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual GLuint CreateAndConsumeTextureCHROMIUM(GLenum target,
- const GLbyte* mailbox) OVERRIDE;
+ const GLbyte* mailbox) override;
virtual void BindUniformLocationCHROMIUM(GLuint program,
GLint location,
- const char* name) OVERRIDE;
-virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE;
-virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) OVERRIDE;
-virtual void TraceBeginCHROMIUM(const char* name) OVERRIDE;
-virtual void TraceEndCHROMIUM() OVERRIDE;
+ const char* name) override;
+virtual void BindTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
+virtual void ReleaseTexImage2DCHROMIUM(GLenum target, GLint imageId) override;
+virtual void TraceBeginCHROMIUM(const char* name) override;
+virtual void TraceEndCHROMIUM() override;
virtual void AsyncTexSubImage2DCHROMIUM(GLenum target,
GLint level,
GLint xoffset,
@@ -500,7 +500,7 @@
GLsizei height,
GLenum format,
GLenum type,
- const void* data) OVERRIDE;
+ const void* data) override;
virtual void AsyncTexImage2DCHROMIUM(GLenum target,
GLint level,
GLenum internalformat,
@@ -509,17 +509,17 @@
GLint border,
GLenum format,
GLenum type,
- const void* pixels) OVERRIDE;
-virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) OVERRIDE;
-virtual void WaitAllAsyncTexImage2DCHROMIUM() OVERRIDE;
+ const void* pixels) override;
+virtual void WaitAsyncTexImage2DCHROMIUM(GLenum target) override;
+virtual void WaitAllAsyncTexImage2DCHROMIUM() override;
virtual void DiscardFramebufferEXT(GLenum target,
GLsizei count,
- const GLenum* attachments) OVERRIDE;
-virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
-virtual GLuint InsertSyncPointCHROMIUM() OVERRIDE;
-virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
-virtual void DrawBuffersEXT(GLsizei count, const GLenum* bufs) OVERRIDE;
-virtual void DiscardBackbufferCHROMIUM() OVERRIDE;
+ const GLenum* attachments) override;
+virtual void LoseContextCHROMIUM(GLenum current, GLenum other) override;
+virtual GLuint InsertSyncPointCHROMIUM() override;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) override;
+virtual void DrawBuffersEXT(GLsizei count, const GLenum* bufs) override;
+virtual void DiscardBackbufferCHROMIUM() override;
virtual void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
GLenum plane_transform,
GLuint overlay_texture_id,
@@ -530,7 +530,7 @@
GLfloat uv_x,
GLfloat uv_y,
GLfloat uv_width,
- GLfloat uv_height) OVERRIDE;
-virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) OVERRIDE;
-virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) OVERRIDE;
+ GLfloat uv_height) override;
+virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
+virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/program_info_manager.cc b/gpu/command_buffer/client/program_info_manager.cc
index d854aa0..a74b4f0 100644
--- a/gpu/command_buffer/client/program_info_manager.cc
+++ b/gpu/command_buffer/client/program_info_manager.cc
@@ -19,22 +19,22 @@
NonCachedProgramInfoManager();
virtual ~NonCachedProgramInfoManager();
- virtual void CreateInfo(GLuint program) OVERRIDE;
+ virtual void CreateInfo(GLuint program) override;
- virtual void DeleteInfo(GLuint program) OVERRIDE;
+ virtual void DeleteInfo(GLuint program) override;
virtual bool GetProgramiv(GLES2Implementation* gl,
GLuint program,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual GLint GetAttribLocation(GLES2Implementation* gl,
GLuint program,
- const char* name) OVERRIDE;
+ const char* name) override;
virtual GLint GetUniformLocation(GLES2Implementation* gl,
GLuint program,
- const char* name) OVERRIDE;
+ const char* name) override;
virtual bool GetActiveAttrib(GLES2Implementation* gl,
GLuint program,
@@ -43,7 +43,7 @@
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual bool GetActiveUniform(GLES2Implementation* gl,
GLuint program,
@@ -52,7 +52,7 @@
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
};
@@ -107,22 +107,22 @@
CachedProgramInfoManager();
virtual ~CachedProgramInfoManager();
- virtual void CreateInfo(GLuint program) OVERRIDE;
+ virtual void CreateInfo(GLuint program) override;
- virtual void DeleteInfo(GLuint program) OVERRIDE;
+ virtual void DeleteInfo(GLuint program) override;
virtual bool GetProgramiv(GLES2Implementation* gl,
GLuint program,
GLenum pname,
- GLint* params) OVERRIDE;
+ GLint* params) override;
virtual GLint GetAttribLocation(GLES2Implementation* gl,
GLuint program,
- const char* name) OVERRIDE;
+ const char* name) override;
virtual GLint GetUniformLocation(GLES2Implementation* gl,
GLuint program,
- const char* name) OVERRIDE;
+ const char* name) override;
virtual bool GetActiveAttrib(GLES2Implementation* gl,
GLuint program,
@@ -131,7 +131,7 @@
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
virtual bool GetActiveUniform(GLES2Implementation* gl,
GLuint program,
@@ -140,7 +140,7 @@
GLsizei* length,
GLint* size,
GLenum* type,
- char* name) OVERRIDE;
+ char* name) override;
private:
class Program {
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc
index 96ab8d1..b99ad1e 100644
--- a/gpu/command_buffer/client/share_group.cc
+++ b/gpu/command_buffer/client/share_group.cc
@@ -31,7 +31,7 @@
// Overridden from IdHandlerInterface.
virtual void MakeIds(
GLES2Implementation* /* gl_impl */,
- GLuint id_offset, GLsizei n, GLuint* ids) OVERRIDE {
+ GLuint id_offset, GLsizei n, GLuint* ids) override {
base::AutoLock auto_lock(lock_);
if (id_offset == 0) {
for (GLsizei ii = 0; ii < n; ++ii) {
@@ -48,7 +48,7 @@
// Overridden from IdHandlerInterface.
virtual bool FreeIds(
GLES2Implementation* gl_impl,
- GLsizei n, const GLuint* ids, DeleteFn delete_fn) OVERRIDE {
+ GLsizei n, const GLuint* ids, DeleteFn delete_fn) override {
base::AutoLock auto_lock(lock_);
for (GLsizei ii = 0; ii < n; ++ii) {
@@ -65,14 +65,14 @@
}
// Overridden from IdHandlerInterface.
- virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE {
+ virtual bool MarkAsUsedForBind(GLuint id) override {
if (id == 0)
return true;
base::AutoLock auto_lock(lock_);
return id_allocator_.MarkAsUsed(id);
}
- virtual void FreeContext(GLES2Implementation* gl_impl) OVERRIDE {}
+ virtual void FreeContext(GLES2Implementation* gl_impl) override {}
private:
base::Lock lock_;
@@ -89,7 +89,7 @@
virtual void MakeIds(GLES2Implementation* gl_impl,
GLuint /* id_offset */,
GLsizei n,
- GLuint* ids) OVERRIDE {
+ GLuint* ids) override {
base::AutoLock auto_lock(lock_);
// Collect pending FreeIds from other flush_generation.
@@ -116,7 +116,7 @@
virtual bool FreeIds(GLES2Implementation* gl_impl,
GLsizei n,
const GLuint* ids,
- DeleteFn delete_fn) OVERRIDE {
+ DeleteFn delete_fn) override {
// Delete stub must run before CollectPendingFreeIds.
(gl_impl->*delete_fn)(n, ids);
@@ -146,7 +146,7 @@
}
// Overridden from IdHandler.
- virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE {
+ virtual bool MarkAsUsedForBind(GLuint id) override {
#ifndef NDEBUG
if (id != 0) {
base::AutoLock auto_lock(lock_);
@@ -157,7 +157,7 @@
}
// Overridden from IdHandlerInterface.
- virtual void FreeContext(GLES2Implementation* gl_impl) OVERRIDE {
+ virtual void FreeContext(GLES2Implementation* gl_impl) override {
base::AutoLock auto_lock(lock_);
CollectPendingFreeIds(gl_impl);
}
@@ -198,7 +198,7 @@
// Overridden from IdHandlerInterface.
virtual void MakeIds(
GLES2Implementation* /* gl_impl */,
- GLuint id_offset, GLsizei n, GLuint* ids) OVERRIDE {
+ GLuint id_offset, GLsizei n, GLuint* ids) override {
base::AutoLock auto_lock(lock_);
for (GLsizei ii = 0; ii < n; ++ii) {
ids[ii] = ++last_id_ + id_offset;
@@ -208,19 +208,19 @@
// Overridden from IdHandlerInterface.
virtual bool FreeIds(
GLES2Implementation* gl_impl,
- GLsizei n, const GLuint* ids, DeleteFn delete_fn) OVERRIDE {
+ GLsizei n, const GLuint* ids, DeleteFn delete_fn) override {
// Ids are never freed.
(gl_impl->*delete_fn)(n, ids);
return true;
}
// Overridden from IdHandlerInterface.
- virtual bool MarkAsUsedForBind(GLuint /* id */) OVERRIDE {
+ virtual bool MarkAsUsedForBind(GLuint /* id */) override {
// This is only used for Shaders and Programs which have no bind.
return false;
}
- virtual void FreeContext(GLES2Implementation* gl_impl) OVERRIDE {}
+ virtual void FreeContext(GLES2Implementation* gl_impl) override {}
private:
base::Lock lock_;
diff --git a/gpu/command_buffer/client/transfer_buffer.h b/gpu/command_buffer/client/transfer_buffer.h
index 348ad32..c27dd21 100644
--- a/gpu/command_buffer/client/transfer_buffer.h
+++ b/gpu/command_buffer/client/transfer_buffer.h
@@ -63,17 +63,17 @@
unsigned int min_buffer_size,
unsigned int max_buffer_size,
unsigned int alignment,
- unsigned int size_to_flush) OVERRIDE;
- virtual int GetShmId() OVERRIDE;
- virtual void* GetResultBuffer() OVERRIDE;
- virtual int GetResultOffset() OVERRIDE;
- virtual void Free() OVERRIDE;
- virtual bool HaveBuffer() const OVERRIDE;
+ unsigned int size_to_flush) override;
+ virtual int GetShmId() override;
+ virtual void* GetResultBuffer() override;
+ virtual int GetResultOffset() override;
+ virtual void Free() override;
+ virtual bool HaveBuffer() const override;
virtual void* AllocUpTo(
- unsigned int size, unsigned int* size_allocated) OVERRIDE;
- virtual void* Alloc(unsigned int size) OVERRIDE;
- virtual RingBuffer::Offset GetOffset(void* pointer) const OVERRIDE;
- virtual void FreePendingToken(void* p, unsigned int token) OVERRIDE;
+ unsigned int size, unsigned int* size_allocated) override;
+ virtual void* Alloc(unsigned int size) override;
+ virtual RingBuffer::Offset GetOffset(void* pointer) const override;
+ virtual void FreePendingToken(void* p, unsigned int token) override;
// These are for testing.
unsigned int GetCurrentMaxAllocationWithoutRealloc() const;
diff --git a/gpu/command_buffer/client/transfer_buffer_unittest.cc b/gpu/command_buffer/client/transfer_buffer_unittest.cc
index cb8558f..4e99ba9 100644
--- a/gpu/command_buffer/client/transfer_buffer_unittest.cc
+++ b/gpu/command_buffer/client/transfer_buffer_unittest.cc
@@ -36,8 +36,8 @@
: transfer_buffer_id_(0) {
}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
virtual void Initialize(unsigned int size_to_flush) {
ASSERT_TRUE(transfer_buffer_->Initialize(
@@ -248,8 +248,8 @@
: transfer_buffer_id_(0) {
}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
MockClientCommandBufferCanFail* command_buffer() const {
return command_buffer_.get();
diff --git a/gpu/command_buffer/common/buffer.h b/gpu/command_buffer/common/buffer.h
index d8a8356..6685ac5 100644
--- a/gpu/command_buffer/common/buffer.h
+++ b/gpu/command_buffer/common/buffer.h
@@ -29,8 +29,8 @@
SharedMemoryBufferBacking(scoped_ptr<base::SharedMemory> shared_memory,
size_t size);
virtual ~SharedMemoryBufferBacking();
- virtual void* GetMemory() const OVERRIDE;
- virtual size_t GetSize() const OVERRIDE;
+ virtual void* GetMemory() const override;
+ virtual size_t GetSize() const override;
base::SharedMemory* shared_memory() { return shared_memory_.get(); }
private:
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager.h b/gpu/command_buffer/service/async_pixel_transfer_manager.h
index 1a818f3..63b30c6 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager.h
@@ -94,8 +94,8 @@
// gles2::TextureRef::DestructionObserver implementation:
virtual void OnTextureManagerDestroying(gles2::TextureManager* manager)
- OVERRIDE;
- virtual void OnTextureRefDestroying(gles2::TextureRef* texture) OVERRIDE;
+ override;
+ virtual void OnTextureRefDestroying(gles2::TextureRef* texture) override;
protected:
AsyncPixelTransferManager();
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
index e153617..1e4066f 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_egl.cc
@@ -97,7 +97,7 @@
Stop();
}
- virtual void Init() OVERRIDE {
+ virtual void Init() override {
gfx::GLShareGroup* share_group = NULL;
surface_ = new gfx::PbufferGLSurfaceEGL(gfx::Size(1, 1));
surface_->Initialize();
@@ -107,7 +107,7 @@
DCHECK(is_current);
}
- virtual void CleanUp() OVERRIDE {
+ virtual void CleanUp() override {
surface_ = NULL;
context_->ReleaseCurrent(surface_.get());
context_ = NULL;
@@ -409,12 +409,12 @@
virtual void AsyncTexImage2D(
const AsyncTexImage2DParams& tex_params,
const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) OVERRIDE;
+ const base::Closure& bind_callback) override;
virtual void AsyncTexSubImage2D(
const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) OVERRIDE;
- virtual bool TransferIsInProgress() OVERRIDE;
- virtual void WaitForTransferCompletion() OVERRIDE;
+ const AsyncMemoryParams& mem_params) override;
+ virtual bool TransferIsInProgress() override;
+ virtual void WaitForTransferCompletion() override;
private:
// Returns true if a work-around was used.
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h b/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h
index 8f0c4b3..dc6798b 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_egl.h
@@ -19,15 +19,15 @@
virtual ~AsyncPixelTransferManagerEGL();
// AsyncPixelTransferManager implementation:
- virtual void BindCompletedAsyncTransfers() OVERRIDE;
+ virtual void BindCompletedAsyncTransfers() override;
virtual void AsyncNotifyCompletion(
const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
- virtual uint32 GetTextureUploadCount() OVERRIDE;
- virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
- virtual void ProcessMorePendingTransfers() OVERRIDE;
- virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
- virtual void WaitAllAsyncTexImage2D() OVERRIDE;
+ AsyncPixelTransferCompletionObserver* observer) override;
+ virtual uint32 GetTextureUploadCount() override;
+ virtual base::TimeDelta GetTotalTextureUploadTime() override;
+ virtual void ProcessMorePendingTransfers() override;
+ virtual bool NeedsProcessMorePendingTransfers() override;
+ virtual void WaitAllAsyncTexImage2D() override;
// State shared between Managers and Delegates.
struct SharedState {
@@ -46,7 +46,7 @@
// AsyncPixelTransferManager implementation:
virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) OVERRIDE;
+ const AsyncTexImage2DParams& define_params) override;
SharedState shared_state_;
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
index 40ec87f..c43491d 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.cc
@@ -42,12 +42,12 @@
virtual void AsyncTexImage2D(
const AsyncTexImage2DParams& tex_params,
const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) OVERRIDE;
+ const base::Closure& bind_callback) override;
virtual void AsyncTexSubImage2D(
const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) OVERRIDE;
- virtual bool TransferIsInProgress() OVERRIDE;
- virtual void WaitForTransferCompletion() OVERRIDE;
+ const AsyncMemoryParams& mem_params) override;
+ virtual bool TransferIsInProgress() override;
+ virtual void WaitForTransferCompletion() override;
private:
void PerformAsyncTexImage2D(AsyncTexImage2DParams tex_params,
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h
index af3262f..0ec950c 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_idle.h
@@ -17,15 +17,15 @@
virtual ~AsyncPixelTransferManagerIdle();
// AsyncPixelTransferManager implementation:
- virtual void BindCompletedAsyncTransfers() OVERRIDE;
+ virtual void BindCompletedAsyncTransfers() override;
virtual void AsyncNotifyCompletion(
const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
- virtual uint32 GetTextureUploadCount() OVERRIDE;
- virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
- virtual void ProcessMorePendingTransfers() OVERRIDE;
- virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
- virtual void WaitAllAsyncTexImage2D() OVERRIDE;
+ AsyncPixelTransferCompletionObserver* observer) override;
+ virtual uint32 GetTextureUploadCount() override;
+ virtual base::TimeDelta GetTotalTextureUploadTime() override;
+ virtual void ProcessMorePendingTransfers() override;
+ virtual bool NeedsProcessMorePendingTransfers() override;
+ virtual void WaitAllAsyncTexImage2D() override;
struct Task {
Task(uint64 transfer_id,
@@ -56,7 +56,7 @@
// AsyncPixelTransferManager implementation:
virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) OVERRIDE;
+ const AsyncTexImage2DParams& define_params) override;
SharedState shared_state_;
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
index 99103b8..e28ff82 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.cc
@@ -71,7 +71,7 @@
wait_for_init.Wait();
}
- virtual void CleanUp() OVERRIDE {
+ virtual void CleanUp() override {
surface_ = NULL;
context_ = NULL;
}
@@ -385,12 +385,12 @@
virtual void AsyncTexImage2D(
const AsyncTexImage2DParams& tex_params,
const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) OVERRIDE;
+ const base::Closure& bind_callback) override;
virtual void AsyncTexSubImage2D(
const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) OVERRIDE;
- virtual bool TransferIsInProgress() OVERRIDE;
- virtual void WaitForTransferCompletion() OVERRIDE;
+ const AsyncMemoryParams& mem_params) override;
+ virtual bool TransferIsInProgress() override;
+ virtual void WaitForTransferCompletion() override;
private:
// A raw pointer is safe because the SharedState is owned by the Manager,
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h
index 64daffe..9f9f04e 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_share_group.h
@@ -23,15 +23,15 @@
virtual ~AsyncPixelTransferManagerShareGroup();
// AsyncPixelTransferManager implementation:
- virtual void BindCompletedAsyncTransfers() OVERRIDE;
+ virtual void BindCompletedAsyncTransfers() override;
virtual void AsyncNotifyCompletion(
const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
- virtual uint32 GetTextureUploadCount() OVERRIDE;
- virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
- virtual void ProcessMorePendingTransfers() OVERRIDE;
- virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
- virtual void WaitAllAsyncTexImage2D() OVERRIDE;
+ AsyncPixelTransferCompletionObserver* observer) override;
+ virtual uint32 GetTextureUploadCount() override;
+ virtual base::TimeDelta GetTotalTextureUploadTime() override;
+ virtual void ProcessMorePendingTransfers() override;
+ virtual bool NeedsProcessMorePendingTransfers() override;
+ virtual void WaitAllAsyncTexImage2D() override;
// State shared between Managers and Delegates.
struct SharedState {
@@ -48,7 +48,7 @@
// AsyncPixelTransferManager implementation:
virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) OVERRIDE;
+ const AsyncTexImage2DParams& define_params) override;
SharedState shared_state_;
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc
index d5f96b0..4b8ce1d 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_stub.cc
@@ -17,12 +17,12 @@
virtual void AsyncTexImage2D(
const AsyncTexImage2DParams& tex_params,
const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) OVERRIDE;
+ const base::Closure& bind_callback) override;
virtual void AsyncTexSubImage2D(
const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) OVERRIDE;
- virtual bool TransferIsInProgress() OVERRIDE;
- virtual void WaitForTransferCompletion() OVERRIDE;
+ const AsyncMemoryParams& mem_params) override;
+ virtual bool TransferIsInProgress() override;
+ virtual void WaitForTransferCompletion() override;
private:
DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateStub);
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h b/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h
index a93ce94..c2fa3eb 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_stub.h
@@ -15,21 +15,21 @@
virtual ~AsyncPixelTransferManagerStub();
// AsyncPixelTransferManager implementation:
- virtual void BindCompletedAsyncTransfers() OVERRIDE;
+ virtual void BindCompletedAsyncTransfers() override;
virtual void AsyncNotifyCompletion(
const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
- virtual uint32 GetTextureUploadCount() OVERRIDE;
- virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
- virtual void ProcessMorePendingTransfers() OVERRIDE;
- virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
- virtual void WaitAllAsyncTexImage2D() OVERRIDE;
+ AsyncPixelTransferCompletionObserver* observer) override;
+ virtual uint32 GetTextureUploadCount() override;
+ virtual base::TimeDelta GetTotalTextureUploadTime() override;
+ virtual void ProcessMorePendingTransfers() override;
+ virtual bool NeedsProcessMorePendingTransfers() override;
+ virtual void WaitAllAsyncTexImage2D() override;
private:
// AsyncPixelTransferManager implementation:
virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) OVERRIDE;
+ const AsyncTexImage2DParams& define_params) override;
DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferManagerStub);
};
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
index cd7d087..b5851d2 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
@@ -19,12 +19,12 @@
virtual void AsyncTexImage2D(
const AsyncTexImage2DParams& tex_params,
const AsyncMemoryParams& mem_params,
- const base::Closure& bind_callback) OVERRIDE;
+ const base::Closure& bind_callback) override;
virtual void AsyncTexSubImage2D(
const AsyncTexSubImage2DParams& tex_params,
- const AsyncMemoryParams& mem_params) OVERRIDE;
- virtual bool TransferIsInProgress() OVERRIDE;
- virtual void WaitForTransferCompletion() OVERRIDE;
+ const AsyncMemoryParams& mem_params) override;
+ virtual bool TransferIsInProgress() override;
+ virtual void WaitForTransferCompletion() override;
private:
// Safe to hold a raw pointer because SharedState is owned by the Manager
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h
index 7d0b8b6..a08e915 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.h
@@ -15,15 +15,15 @@
virtual ~AsyncPixelTransferManagerSync();
// AsyncPixelTransferManager implementation:
- virtual void BindCompletedAsyncTransfers() OVERRIDE;
+ virtual void BindCompletedAsyncTransfers() override;
virtual void AsyncNotifyCompletion(
const AsyncMemoryParams& mem_params,
- AsyncPixelTransferCompletionObserver* observer) OVERRIDE;
- virtual uint32 GetTextureUploadCount() OVERRIDE;
- virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
- virtual void ProcessMorePendingTransfers() OVERRIDE;
- virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
- virtual void WaitAllAsyncTexImage2D() OVERRIDE;
+ AsyncPixelTransferCompletionObserver* observer) override;
+ virtual uint32 GetTextureUploadCount() override;
+ virtual base::TimeDelta GetTotalTextureUploadTime() override;
+ virtual void ProcessMorePendingTransfers() override;
+ virtual bool NeedsProcessMorePendingTransfers() override;
+ virtual void WaitAllAsyncTexImage2D() override;
// State shared between Managers and Delegates.
struct SharedState {
@@ -38,7 +38,7 @@
// AsyncPixelTransferManager implementation:
virtual AsyncPixelTransferDelegate* CreatePixelTransferDelegateImpl(
gles2::TextureRef* ref,
- const AsyncTexImage2DParams& define_params) OVERRIDE;
+ const AsyncTexImage2DParams& define_params) override;
SharedState shared_state_;
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index ac23301..e3e2ebd 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -45,23 +45,23 @@
virtual ~CommandBufferService();
// CommandBuffer implementation:
- virtual bool Initialize() OVERRIDE;
- virtual State GetLastState() OVERRIDE;
- virtual int32 GetLastToken() OVERRIDE;
- virtual void Flush(int32 put_offset) OVERRIDE;
- virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE;
- virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE;
- virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE;
+ virtual bool Initialize() override;
+ virtual State GetLastState() override;
+ virtual int32 GetLastToken() override;
+ virtual void Flush(int32 put_offset) override;
+ virtual void WaitForTokenInRange(int32 start, int32 end) override;
+ virtual void WaitForGetOffsetInRange(int32 start, int32 end) override;
+ virtual void SetGetBuffer(int32 transfer_buffer_id) override;
virtual scoped_refptr<Buffer> CreateTransferBuffer(size_t size,
- int32* id) OVERRIDE;
- virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
+ int32* id) override;
+ virtual void DestroyTransferBuffer(int32 id) override;
// CommandBufferServiceBase implementation:
- virtual void SetGetOffset(int32 get_offset) OVERRIDE;
- virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) OVERRIDE;
- virtual void SetToken(int32 token) OVERRIDE;
- virtual void SetParseError(error::Error error) OVERRIDE;
- virtual void SetContextLostReason(error::ContextLostReason) OVERRIDE;
+ virtual void SetGetOffset(int32 get_offset) override;
+ virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) override;
+ virtual void SetToken(int32 token) override;
+ virtual void SetParseError(error::Error error) override;
+ virtual void SetContextLostReason(error::ContextLostReason) override;
// Sets a callback that is called whenever the put offset is changed. When
// called with sync==true, the callback must not return until some progress
diff --git a/gpu/command_buffer/service/common_decoder_unittest.cc b/gpu/command_buffer/service/common_decoder_unittest.cc
index 0faa8e9..cc965cd 100644
--- a/gpu/command_buffer/service/common_decoder_unittest.cc
+++ b/gpu/command_buffer/service/common_decoder_unittest.cc
@@ -51,7 +51,7 @@
class TestCommonDecoder : public CommonDecoder {
public:
// Overridden from AsyncAPIInterface
- virtual const char* GetCommandName(unsigned int command_id) const OVERRIDE {
+ virtual const char* GetCommandName(unsigned int command_id) const override {
return GetCommonCommandName(static_cast<cmd::CommandId>(command_id));
}
@@ -59,7 +59,7 @@
virtual error::Error DoCommand(
unsigned int command,
unsigned int arg_count,
- const void* cmd_data) OVERRIDE {
+ const void* cmd_data) override {
return DoCommonCommand(command, arg_count, cmd_data);
}
@@ -88,7 +88,7 @@
// Overridden from CommandBufferEngine.
virtual scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id)
- OVERRIDE {
+ override {
if (IsValidSharedMemoryId(shm_id))
return buffer_;
return NULL;
@@ -110,7 +110,7 @@
}
// Overridden from CommandBufferEngine.
- virtual void set_token(int32 token) OVERRIDE {
+ virtual void set_token(int32 token) override {
token_ = token;
}
@@ -119,13 +119,13 @@
}
// Overridden from CommandBufferEngine.
- virtual bool SetGetBuffer(int32 transfer_buffer_id) OVERRIDE {
+ virtual bool SetGetBuffer(int32 transfer_buffer_id) override {
NOTREACHED();
return false;
}
// Overridden from CommandBufferEngine.
- virtual bool SetGetOffset(int32 offset) OVERRIDE {
+ virtual bool SetGetOffset(int32 offset) override {
if (static_cast<size_t>(offset) < kBufferSize) {
get_offset_ = offset;
return true;
@@ -134,7 +134,7 @@
}
// Overridden from CommandBufferEngine.
- virtual int32 GetGetOffset() OVERRIDE {
+ virtual int32 GetGetOffset() override {
return get_offset_;
}
diff --git a/gpu/command_buffer/service/error_state.cc b/gpu/command_buffer/service/error_state.cc
index ce65aa1..c71a159 100644
--- a/gpu/command_buffer/service/error_state.cc
+++ b/gpu/command_buffer/service/error_state.cc
@@ -19,43 +19,43 @@
explicit ErrorStateImpl(ErrorStateClient* client, Logger* logger);
virtual ~ErrorStateImpl();
- virtual uint32 GetGLError() OVERRIDE;
+ virtual uint32 GetGLError() override;
virtual void SetGLError(
const char* filename,
int line,
unsigned int error,
const char* function_name,
- const char* msg) OVERRIDE;
+ const char* msg) override;
virtual void SetGLErrorInvalidEnum(
const char* filename,
int line,
const char* function_name,
unsigned int value,
- const char* label) OVERRIDE;
+ const char* label) override;
virtual void SetGLErrorInvalidParami(
const char* filename,
int line,
unsigned int error,
const char* function_name,
unsigned int pname,
- int param) OVERRIDE;
+ int param) override;
virtual void SetGLErrorInvalidParamf(
const char* filename,
int line,
unsigned int error,
const char* function_name,
unsigned int pname,
- float param) OVERRIDE;
+ float param) override;
virtual unsigned int PeekGLError(
- const char* filename, int line, const char* function_name) OVERRIDE;
+ const char* filename, int line, const char* function_name) override;
virtual void CopyRealGLErrorsToWrapper(
- const char* filename, int line, const char* function_name) OVERRIDE;
+ const char* filename, int line, const char* function_name) override;
virtual void ClearRealGLErrors(
- const char* filename, int line, const char* function_name) OVERRIDE;
+ const char* filename, int line, const char* function_name) override;
private:
// The last error message set.
diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc
index 937dd1e..106e183 100644
--- a/gpu/command_buffer/service/feature_info_unittest.cc
+++ b/gpu/command_buffer/service/feature_info_unittest.cc
@@ -74,11 +74,11 @@
}
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Do nothing here, since we are using the explicit Setup*() functions.
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
info_ = NULL;
GpuServiceTest::TearDown();
}
diff --git a/gpu/command_buffer/service/framebuffer_manager.cc b/gpu/command_buffer/service/framebuffer_manager.cc
index b8026c0..4448ac8 100644
--- a/gpu/command_buffer/service/framebuffer_manager.cc
+++ b/gpu/command_buffer/service/framebuffer_manager.cc
@@ -48,61 +48,61 @@
: renderbuffer_(renderbuffer) {
}
- virtual GLsizei width() const OVERRIDE {
+ virtual GLsizei width() const override {
return renderbuffer_->width();
}
- virtual GLsizei height() const OVERRIDE {
+ virtual GLsizei height() const override {
return renderbuffer_->height();
}
- virtual GLenum internal_format() const OVERRIDE {
+ virtual GLenum internal_format() const override {
return renderbuffer_->internal_format();
}
- virtual GLenum texture_type() const OVERRIDE {
+ virtual GLenum texture_type() const override {
return 0;
}
- virtual GLsizei samples() const OVERRIDE {
+ virtual GLsizei samples() const override {
return renderbuffer_->samples();
}
- virtual GLuint object_name() const OVERRIDE {
+ virtual GLuint object_name() const override {
return renderbuffer_->client_id();
}
- virtual bool cleared() const OVERRIDE {
+ virtual bool cleared() const override {
return renderbuffer_->cleared();
}
virtual void SetCleared(
RenderbufferManager* renderbuffer_manager,
TextureManager* /* texture_manager */,
- bool cleared) OVERRIDE {
+ bool cleared) override {
renderbuffer_manager->SetCleared(renderbuffer_.get(), cleared);
}
virtual bool IsTexture(
- TextureRef* /* texture */) const OVERRIDE {
+ TextureRef* /* texture */) const override {
return false;
}
virtual bool IsRenderbuffer(
- Renderbuffer* renderbuffer) const OVERRIDE {
+ Renderbuffer* renderbuffer) const override {
return renderbuffer_.get() == renderbuffer;
}
- virtual bool CanRenderTo() const OVERRIDE {
+ virtual bool CanRenderTo() const override {
return true;
}
- virtual void DetachFromFramebuffer(Framebuffer* framebuffer) const OVERRIDE {
+ virtual void DetachFromFramebuffer(Framebuffer* framebuffer) const override {
// Nothing to do for renderbuffers.
}
virtual bool ValidForAttachmentType(
- GLenum attachment_type, uint32 max_color_attachments) OVERRIDE {
+ GLenum attachment_type, uint32 max_color_attachments) override {
uint32 need = GLES2Util::GetChannelsNeededForAttachmentType(
attachment_type, max_color_attachments);
uint32 have = GLES2Util::GetChannelsForFormat(internal_format());
@@ -114,18 +114,18 @@
}
virtual size_t GetSignatureSize(
- TextureManager* texture_manager) const OVERRIDE {
+ TextureManager* texture_manager) const override {
return renderbuffer_->GetSignatureSize();
}
virtual void AddToSignature(
- TextureManager* texture_manager, std::string* signature) const OVERRIDE {
+ TextureManager* texture_manager, std::string* signature) const override {
DCHECK(signature);
renderbuffer_->AddToSignature(signature);
}
- virtual void OnWillRenderTo() const OVERRIDE {}
- virtual void OnDidRenderTo() const OVERRIDE {}
+ virtual void OnWillRenderTo() const override {}
+ virtual void OnDidRenderTo() const override {}
protected:
virtual ~RenderbufferAttachment() { }
@@ -147,7 +147,7 @@
samples_(samples) {
}
- virtual GLsizei width() const OVERRIDE {
+ virtual GLsizei width() const override {
GLsizei temp_width = 0;
GLsizei temp_height = 0;
texture_ref_->texture()->GetLevelSize(
@@ -155,7 +155,7 @@
return temp_width;
}
- virtual GLsizei height() const OVERRIDE {
+ virtual GLsizei height() const override {
GLsizei temp_width = 0;
GLsizei temp_height = 0;
texture_ref_->texture()->GetLevelSize(
@@ -163,7 +163,7 @@
return temp_height;
}
- virtual GLenum internal_format() const OVERRIDE {
+ virtual GLenum internal_format() const override {
GLenum temp_type = 0;
GLenum temp_internal_format = 0;
texture_ref_->texture()->GetLevelType(
@@ -171,7 +171,7 @@
return temp_internal_format;
}
- virtual GLenum texture_type() const OVERRIDE {
+ virtual GLenum texture_type() const override {
GLenum temp_type = 0;
GLenum temp_internal_format = 0;
texture_ref_->texture()->GetLevelType(
@@ -179,33 +179,33 @@
return temp_type;
}
- virtual GLsizei samples() const OVERRIDE {
+ virtual GLsizei samples() const override {
return samples_;
}
- virtual GLuint object_name() const OVERRIDE {
+ virtual GLuint object_name() const override {
return texture_ref_->client_id();
}
- virtual bool cleared() const OVERRIDE {
+ virtual bool cleared() const override {
return texture_ref_->texture()->IsLevelCleared(target_, level_);
}
virtual void SetCleared(
RenderbufferManager* /* renderbuffer_manager */,
TextureManager* texture_manager,
- bool cleared) OVERRIDE {
+ bool cleared) override {
texture_manager->SetLevelCleared(
texture_ref_.get(), target_, level_, cleared);
}
- virtual bool IsTexture(TextureRef* texture) const OVERRIDE {
+ virtual bool IsTexture(TextureRef* texture) const override {
return texture == texture_ref_.get();
}
virtual bool IsRenderbuffer(
Renderbuffer* /* renderbuffer */)
- const OVERRIDE {
+ const override {
return false;
}
@@ -213,18 +213,18 @@
return texture_ref_.get();
}
- virtual bool CanRenderTo() const OVERRIDE {
+ virtual bool CanRenderTo() const override {
return texture_ref_->texture()->CanRenderTo();
}
virtual void DetachFromFramebuffer(Framebuffer* framebuffer)
- const OVERRIDE {
+ const override {
texture_ref_->texture()->DetachFromFramebuffer();
framebuffer->OnTextureRefDetached(texture_ref_.get());
}
virtual bool ValidForAttachmentType(
- GLenum attachment_type, uint32 max_color_attachments) OVERRIDE {
+ GLenum attachment_type, uint32 max_color_attachments) override {
GLenum type = 0;
GLenum internal_format = 0;
if (!texture_ref_->texture()->GetLevelType(
@@ -245,22 +245,22 @@
}
virtual size_t GetSignatureSize(
- TextureManager* texture_manager) const OVERRIDE {
+ TextureManager* texture_manager) const override {
return texture_manager->GetSignatureSize();
}
virtual void AddToSignature(
- TextureManager* texture_manager, std::string* signature) const OVERRIDE {
+ TextureManager* texture_manager, std::string* signature) const override {
DCHECK(signature);
texture_manager->AddToSignature(
texture_ref_.get(), target_, level_, signature);
}
- virtual void OnWillRenderTo() const OVERRIDE {
+ virtual void OnWillRenderTo() const override {
texture_ref_->texture()->OnWillModifyPixels();
}
- virtual void OnDidRenderTo() const OVERRIDE {
+ virtual void OnDidRenderTo() const override {
texture_ref_->texture()->OnDidModifyPixels();
}
diff --git a/gpu/command_buffer/service/gl_context_virtual.h b/gpu/command_buffer/service/gl_context_virtual.h
index fdecbdd..76f4021 100644
--- a/gpu/command_buffer/service/gl_context_virtual.h
+++ b/gpu/command_buffer/service/gl_context_virtual.h
@@ -36,18 +36,18 @@
// Implement GLContext.
virtual bool Initialize(
gfx::GLSurface* compatible_surface,
- gfx::GpuPreference gpu_preference) OVERRIDE;
- virtual void Destroy() OVERRIDE;
- virtual bool MakeCurrent(gfx::GLSurface* surface) OVERRIDE;
- virtual void ReleaseCurrent(gfx::GLSurface* surface) OVERRIDE;
- virtual bool IsCurrent(gfx::GLSurface* surface) OVERRIDE;
- virtual void* GetHandle() OVERRIDE;
- virtual void SetSwapInterval(int interval) OVERRIDE;
- virtual std::string GetExtensions() OVERRIDE;
- virtual bool GetTotalGpuMemory(size_t* bytes) OVERRIDE;
- virtual void SetSafeToForceGpuSwitch() OVERRIDE;
- virtual bool WasAllocatedUsingRobustnessExtension() OVERRIDE;
- virtual void SetUnbindFboOnMakeCurrent() OVERRIDE;
+ gfx::GpuPreference gpu_preference) override;
+ virtual void Destroy() override;
+ virtual bool MakeCurrent(gfx::GLSurface* surface) override;
+ virtual void ReleaseCurrent(gfx::GLSurface* surface) override;
+ virtual bool IsCurrent(gfx::GLSurface* surface) override;
+ virtual void* GetHandle() override;
+ virtual void SetSwapInterval(int interval) override;
+ virtual std::string GetExtensions() override;
+ virtual bool GetTotalGpuMemory(size_t* bytes) override;
+ virtual void SetSafeToForceGpuSwitch() override;
+ virtual bool WasAllocatedUsingRobustnessExtension() override;
+ virtual void SetUnbindFboOnMakeCurrent() override;
protected:
virtual ~GLContextVirtual();
diff --git a/gpu/command_buffer/service/gl_state_restorer_impl.h b/gpu/command_buffer/service/gl_state_restorer_impl.h
index 73534b8..b8ccc44 100644
--- a/gpu/command_buffer/service/gl_state_restorer_impl.h
+++ b/gpu/command_buffer/service/gl_state_restorer_impl.h
@@ -24,11 +24,11 @@
explicit GLStateRestorerImpl(base::WeakPtr<gles2::GLES2Decoder> decoder);
virtual ~GLStateRestorerImpl();
- virtual bool IsInitialized() OVERRIDE;
- virtual void RestoreState(const gfx::GLStateRestorer* prev_state) OVERRIDE;
- virtual void RestoreAllTextureUnitBindings() OVERRIDE;
- virtual void RestoreActiveTextureUnitBinding(unsigned int target) OVERRIDE;
- virtual void RestoreFramebufferBindings() OVERRIDE;
+ virtual bool IsInitialized() override;
+ virtual void RestoreState(const gfx::GLStateRestorer* prev_state) override;
+ virtual void RestoreAllTextureUnitBindings() override;
+ virtual void RestoreActiveTextureUnitBinding(unsigned int target) override;
+ virtual void RestoreFramebufferBindings() override;
private:
const gles2::ContextState* GetContextState() const;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 9bf037f..65587ec 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -511,7 +511,7 @@
: async_upload_token_(async_upload_token) {
}
- virtual void DidComplete(const AsyncMemoryParams& mem_params) OVERRIDE {
+ virtual void DidComplete(const AsyncMemoryParams& mem_params) override {
DCHECK(mem_params.buffer().get());
void* data = mem_params.GetDataAddress();
AsyncUploadSync* sync = static_cast<AsyncUploadSync*>(data);
@@ -563,12 +563,12 @@
// Overridden from AsyncAPIInterface.
virtual Error DoCommand(unsigned int command,
unsigned int arg_count,
- const void* args) OVERRIDE;
+ const void* args) override;
virtual error::Error DoCommands(unsigned int num_commands,
const void* buffer,
int num_entries,
- int* entries_processed) OVERRIDE;
+ int* entries_processed) override;
template <bool DebugImpl>
error::Error DoCommandsImpl(unsigned int num_commands,
@@ -577,7 +577,7 @@
int* entries_processed);
// Overridden from AsyncAPIInterface.
- virtual const char* GetCommandName(unsigned int command_id) const OVERRIDE;
+ virtual const char* GetCommandName(unsigned int command_id) const override;
// Overridden from GLES2Decoder.
virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface,
@@ -585,96 +585,96 @@
bool offscreen,
const gfx::Size& size,
const DisallowedFeatures& disallowed_features,
- const std::vector<int32>& attribs) OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ const std::vector<int32>& attribs) override;
+ virtual void Destroy(bool have_context) override;
virtual void SetSurface(
- const scoped_refptr<gfx::GLSurface>& surface) OVERRIDE;
- virtual void ProduceFrontBuffer(const Mailbox& mailbox) OVERRIDE;
- virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) OVERRIDE;
+ const scoped_refptr<gfx::GLSurface>& surface) override;
+ virtual void ProduceFrontBuffer(const Mailbox& mailbox) override;
+ virtual bool ResizeOffscreenFrameBuffer(const gfx::Size& size) override;
void UpdateParentTextureInfo();
- virtual bool MakeCurrent() OVERRIDE;
- virtual GLES2Util* GetGLES2Util() OVERRIDE { return &util_; }
- virtual gfx::GLContext* GetGLContext() OVERRIDE { return context_.get(); }
- virtual ContextGroup* GetContextGroup() OVERRIDE { return group_.get(); }
- virtual Capabilities GetCapabilities() OVERRIDE;
- virtual void RestoreState(const ContextState* prev_state) OVERRIDE;
+ virtual bool MakeCurrent() override;
+ virtual GLES2Util* GetGLES2Util() override { return &util_; }
+ virtual gfx::GLContext* GetGLContext() override { return context_.get(); }
+ virtual ContextGroup* GetContextGroup() override { return group_.get(); }
+ virtual Capabilities GetCapabilities() override;
+ virtual void RestoreState(const ContextState* prev_state) override;
- virtual void RestoreActiveTexture() const OVERRIDE {
+ virtual void RestoreActiveTexture() const override {
state_.RestoreActiveTexture();
}
virtual void RestoreAllTextureUnitBindings(
- const ContextState* prev_state) const OVERRIDE {
+ const ContextState* prev_state) const override {
state_.RestoreAllTextureUnitBindings(prev_state);
}
virtual void RestoreActiveTextureUnitBinding(
- unsigned int target) const OVERRIDE {
+ unsigned int target) const override {
state_.RestoreActiveTextureUnitBinding(target);
}
- virtual void RestoreBufferBindings() const OVERRIDE {
+ virtual void RestoreBufferBindings() const override {
state_.RestoreBufferBindings();
}
- virtual void RestoreGlobalState() const OVERRIDE {
+ virtual void RestoreGlobalState() const override {
state_.RestoreGlobalState(NULL);
}
- virtual void RestoreProgramBindings() const OVERRIDE {
+ virtual void RestoreProgramBindings() const override {
state_.RestoreProgramBindings();
}
- virtual void RestoreTextureUnitBindings(unsigned unit) const OVERRIDE {
+ virtual void RestoreTextureUnitBindings(unsigned unit) const override {
state_.RestoreTextureUnitBindings(unit, NULL);
}
- virtual void RestoreFramebufferBindings() const OVERRIDE;
- virtual void RestoreRenderbufferBindings() OVERRIDE;
- virtual void RestoreTextureState(unsigned service_id) const OVERRIDE;
+ virtual void RestoreFramebufferBindings() const override;
+ virtual void RestoreRenderbufferBindings() override;
+ virtual void RestoreTextureState(unsigned service_id) const override;
- virtual void ClearAllAttributes() const OVERRIDE;
- virtual void RestoreAllAttributes() const OVERRIDE;
+ virtual void ClearAllAttributes() const override;
+ virtual void RestoreAllAttributes() const override;
- virtual QueryManager* GetQueryManager() OVERRIDE {
+ virtual QueryManager* GetQueryManager() override {
return query_manager_.get();
}
- virtual VertexArrayManager* GetVertexArrayManager() OVERRIDE {
+ virtual VertexArrayManager* GetVertexArrayManager() override {
return vertex_array_manager_.get();
}
- virtual ImageManager* GetImageManager() OVERRIDE {
+ virtual ImageManager* GetImageManager() override {
return image_manager_.get();
}
- virtual bool ProcessPendingQueries() OVERRIDE;
- virtual bool HasMoreIdleWork() OVERRIDE;
- virtual void PerformIdleWork() OVERRIDE;
+ virtual bool ProcessPendingQueries() override;
+ virtual bool HasMoreIdleWork() override;
+ virtual void PerformIdleWork() override;
- virtual void WaitForReadPixels(base::Closure callback) OVERRIDE;
+ virtual void WaitForReadPixels(base::Closure callback) override;
virtual void SetResizeCallback(
- const base::Callback<void(gfx::Size, float)>& callback) OVERRIDE;
+ const base::Callback<void(gfx::Size, float)>& callback) override;
- virtual Logger* GetLogger() OVERRIDE;
+ virtual Logger* GetLogger() override;
- virtual void BeginDecoding() OVERRIDE;
- virtual void EndDecoding() OVERRIDE;
+ virtual void BeginDecoding() override;
+ virtual void EndDecoding() override;
- virtual ErrorState* GetErrorState() OVERRIDE;
- virtual const ContextState* GetContextState() OVERRIDE { return &state_; }
+ virtual ErrorState* GetErrorState() override;
+ virtual const ContextState* GetContextState() override { return &state_; }
virtual void SetShaderCacheCallback(
- const ShaderCacheCallback& callback) OVERRIDE;
+ const ShaderCacheCallback& callback) override;
virtual void SetWaitSyncPointCallback(
- const WaitSyncPointCallback& callback) OVERRIDE;
+ const WaitSyncPointCallback& callback) override;
virtual AsyncPixelTransferManager*
- GetAsyncPixelTransferManager() OVERRIDE;
- virtual void ResetAsyncPixelTransferManagerForTest() OVERRIDE;
+ GetAsyncPixelTransferManager() override;
+ virtual void ResetAsyncPixelTransferManagerForTest() override;
virtual void SetAsyncPixelTransferManagerForTest(
- AsyncPixelTransferManager* manager) OVERRIDE;
- virtual void SetIgnoreCachedStateForTest(bool ignore) OVERRIDE;
+ AsyncPixelTransferManager* manager) override;
+ virtual void SetIgnoreCachedStateForTest(bool ignore) override;
void ProcessFinishedAsyncTransfers();
virtual bool GetServiceTextureId(uint32 client_texture_id,
- uint32* service_texture_id) OVERRIDE;
+ uint32* service_texture_id) override;
- virtual uint32 GetTextureUploadCount() OVERRIDE;
- virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
- virtual base::TimeDelta GetTotalProcessingCommandsTime() OVERRIDE;
- virtual void AddProcessingCommandsTime(base::TimeDelta) OVERRIDE;
+ virtual uint32 GetTextureUploadCount() override;
+ virtual base::TimeDelta GetTotalTextureUploadTime() override;
+ virtual base::TimeDelta GetTotalProcessingCommandsTime() override;
+ virtual void AddProcessingCommandsTime(base::TimeDelta) override;
// Restores the current state to the user's settings.
void RestoreCurrentFramebufferBindings();
@@ -690,14 +690,14 @@
bool BoundFramebufferHasDepthAttachment();
bool BoundFramebufferHasStencilAttachment();
- virtual error::ContextLostReason GetContextLostReason() OVERRIDE;
+ virtual error::ContextLostReason GetContextLostReason() override;
// Overridden from FramebufferManager::TextureDetachObserver:
virtual void OnTextureRefDetachedFromFramebuffer(
- TextureRef* texture) OVERRIDE;
+ TextureRef* texture) override;
// Overriden from ErrorStateClient.
- virtual void OnOutOfMemoryError() OVERRIDE;
+ virtual void OnOutOfMemoryError() override;
// Ensure Renderbuffer corresponding to last DoBindRenderbuffer() is bound.
void EnsureRenderbufferBound();
@@ -1164,7 +1164,7 @@
unsigned type,
int width,
int height,
- bool is_texture_immutable) OVERRIDE;
+ bool is_texture_immutable) override;
// Restore all GL state that affects clearing.
void RestoreClearState();
@@ -1567,9 +1567,9 @@
error::Error* error, GLint* real_location, GLuint* service_id,
void** result, GLenum* result_type);
- virtual bool WasContextLost() OVERRIDE;
- virtual bool WasContextLostByRobustnessExtension() OVERRIDE;
- virtual void LoseContext(uint32 reset_status) OVERRIDE;
+ virtual bool WasContextLost() override;
+ virtual bool WasContextLostByRobustnessExtension() override;
+ virtual void LoseContext(uint32 reset_status) override;
#if defined(OS_MACOSX)
void ReleaseIOSurfaceForTexture(GLuint texture_id);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
index 0730752..d510946 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h
@@ -69,8 +69,8 @@
engine_->ClearSharedMemory();
}
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
template <typename T>
error::Error ExecuteCmd(const T& cmd) {
@@ -557,21 +557,21 @@
virtual ~MockCommandBufferEngine();
virtual scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id)
- OVERRIDE;
+ override;
void ClearSharedMemory() {
memset(valid_buffer_->memory(), kInitialMemoryValue, kSharedBufferSize);
}
- virtual void set_token(int32 token) OVERRIDE;
+ virtual void set_token(int32 token) override;
- virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) OVERRIDE;
+ virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) override;
// Overridden from CommandBufferEngine.
- virtual bool SetGetOffset(int32 offset) OVERRIDE;
+ virtual bool SetGetOffset(int32 offset) override;
// Overridden from CommandBufferEngine.
- virtual int32 GetGetOffset() OVERRIDE;
+ virtual int32 GetGetOffset() override;
private:
scoped_refptr<gpu::Buffer> valid_buffer_;
@@ -628,8 +628,8 @@
}
protected:
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
};
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc
index 28e24de..311e798 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_extensions.cc
@@ -19,7 +19,7 @@
class GLES2DecoderTestWithCHROMIUMPathRendering : public GLES2DecoderTest {
public:
GLES2DecoderTestWithCHROMIUMPathRendering() {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
InitState init;
init.gl_version = "opengl es 3.1";
init.has_alpha = true;
diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h
index 0390632..fed0ce4 100644
--- a/gpu/command_buffer/service/gpu_scheduler.h
+++ b/gpu/command_buffer/service/gpu_scheduler.h
@@ -83,11 +83,11 @@
void SetSchedulingChangedCallback(const SchedulingChangedCallback& callback);
// Implementation of CommandBufferEngine.
- virtual scoped_refptr<Buffer> GetSharedMemoryBuffer(int32 shm_id) OVERRIDE;
- virtual void set_token(int32 token) OVERRIDE;
- virtual bool SetGetBuffer(int32 transfer_buffer_id) OVERRIDE;
- virtual bool SetGetOffset(int32 offset) OVERRIDE;
- virtual int32 GetGetOffset() OVERRIDE;
+ virtual scoped_refptr<Buffer> GetSharedMemoryBuffer(int32 shm_id) override;
+ virtual void set_token(int32 token) override;
+ virtual bool SetGetBuffer(int32 transfer_buffer_id) override;
+ virtual bool SetGetOffset(int32 offset) override;
+ virtual int32 GetGetOffset() override;
void SetCommandProcessedCallback(const base::Closure& callback);
diff --git a/gpu/command_buffer/service/gpu_service_test.h b/gpu/command_buffer/service/gpu_service_test.h
index c467c14..189031c 100644
--- a/gpu/command_buffer/service/gpu_service_test.h
+++ b/gpu/command_buffer/service/gpu_service_test.h
@@ -26,8 +26,8 @@
protected:
void SetUpWithGLVersion(const char* gl_version, const char* gl_extensions);
- virtual void SetUp() OVERRIDE;
- virtual void TearDown() OVERRIDE;
+ virtual void SetUp() override;
+ virtual void TearDown() override;
scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_;
diff --git a/gpu/command_buffer/service/gpu_state_tracer.cc b/gpu/command_buffer/service/gpu_state_tracer.cc
index 6eb5007..5311e9c 100644
--- a/gpu/command_buffer/service/gpu_state_tracer.cc
+++ b/gpu/command_buffer/service/gpu_state_tracer.cc
@@ -24,7 +24,7 @@
bool SaveScreenshot(const gfx::Size& size);
// base::debug::ConvertableToTraceFormat implementation.
- virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE;
+ virtual void AppendAsTraceFormat(std::string* out) const override;
private:
explicit Snapshot(const ContextState* state);
diff --git a/gpu/command_buffer/service/gpu_tracer.h b/gpu/command_buffer/service/gpu_tracer.h
index 63e5646..8099230 100644
--- a/gpu/command_buffer/service/gpu_tracer.h
+++ b/gpu/command_buffer/service/gpu_tracer.h
@@ -117,7 +117,7 @@
static scoped_refptr<TraceOutputter> Create(const std::string& name);
virtual void Trace(const std::string& name,
int64 start_time,
- int64 end_time) OVERRIDE;
+ int64 end_time) override;
protected:
friend class base::RefCounted<Outputter>;
diff --git a/gpu/command_buffer/service/gpu_tracer_unittest.cc b/gpu/command_buffer/service/gpu_tracer_unittest.cc
index fe91f70..6be4d5b 100644
--- a/gpu/command_buffer/service/gpu_tracer_unittest.cc
+++ b/gpu/command_buffer/service/gpu_tracer_unittest.cc
@@ -207,14 +207,14 @@
class GpuARBTimerTracerTest : public BaseGpuTracerTest {
protected:
- virtual GpuTracerType GetTracerType() OVERRIDE {
+ virtual GpuTracerType GetTracerType() override {
return kTracerTypeARBTimer;
}
};
class GpuDisjointTimerTracerTest : public BaseGpuTracerTest {
protected:
- virtual GpuTracerType GetTracerType() OVERRIDE {
+ virtual GpuTracerType GetTracerType() override {
return kTracerTypeDisjointTimer;
}
};
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index 45199a7..707b9ef 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -62,18 +62,18 @@
public:
GpuInProcessThread();
- virtual void AddRef() const OVERRIDE {
+ virtual void AddRef() const override {
base::RefCountedThreadSafe<GpuInProcessThread>::AddRef();
}
- virtual void Release() const OVERRIDE {
+ virtual void Release() const override {
base::RefCountedThreadSafe<GpuInProcessThread>::Release();
}
- virtual void ScheduleTask(const base::Closure& task) OVERRIDE;
- virtual void ScheduleIdleWork(const base::Closure& callback) OVERRIDE;
- virtual bool UseVirtualizedGLContexts() OVERRIDE { return false; }
+ virtual void ScheduleTask(const base::Closure& task) override;
+ virtual void ScheduleIdleWork(const base::Closure& callback) override;
+ virtual bool UseVirtualizedGLContexts() override { return false; }
virtual scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache()
- OVERRIDE;
+ override;
private:
virtual ~GpuInProcessThread();
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h
index b650725..e91d6f6 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.h
+++ b/gpu/command_buffer/service/in_process_command_buffer.h
@@ -80,35 +80,35 @@
void Destroy();
// CommandBuffer implementation:
- virtual bool Initialize() OVERRIDE;
- virtual State GetLastState() OVERRIDE;
- virtual int32 GetLastToken() OVERRIDE;
- virtual void Flush(int32 put_offset) OVERRIDE;
- virtual void WaitForTokenInRange(int32 start, int32 end) OVERRIDE;
- virtual void WaitForGetOffsetInRange(int32 start, int32 end) OVERRIDE;
- virtual void SetGetBuffer(int32 shm_id) OVERRIDE;
+ virtual bool Initialize() override;
+ virtual State GetLastState() override;
+ virtual int32 GetLastToken() override;
+ virtual void Flush(int32 put_offset) override;
+ virtual void WaitForTokenInRange(int32 start, int32 end) override;
+ virtual void WaitForGetOffsetInRange(int32 start, int32 end) override;
+ virtual void SetGetBuffer(int32 shm_id) override;
virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(size_t size,
- int32* id) OVERRIDE;
- virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
- virtual gpu::error::Error GetLastError() OVERRIDE;
+ int32* id) override;
+ virtual void DestroyTransferBuffer(int32 id) override;
+ virtual gpu::error::Error GetLastError() override;
// GpuControl implementation:
- virtual gpu::Capabilities GetCapabilities() OVERRIDE;
+ virtual gpu::Capabilities GetCapabilities() override;
virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
size_t height,
unsigned internalformat,
unsigned usage,
- int32* id) OVERRIDE;
- virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
- virtual uint32 InsertSyncPoint() OVERRIDE;
- virtual uint32 InsertFutureSyncPoint() OVERRIDE;
- virtual void RetireSyncPoint(uint32 sync_point) OVERRIDE;
+ int32* id) override;
+ virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual uint32 InsertSyncPoint() override;
+ virtual uint32 InsertFutureSyncPoint() override;
+ virtual void RetireSyncPoint(uint32 sync_point) override;
virtual void SignalSyncPoint(uint32 sync_point,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void SignalQuery(uint32 query_id,
- const base::Closure& callback) OVERRIDE;
- virtual void SetSurfaceVisible(bool visible) OVERRIDE;
- virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE;
+ const base::Closure& callback) override;
+ virtual void SetSurfaceVisible(bool visible) override;
+ virtual uint32 CreateStreamTexture(uint32 texture_id) override;
// The serializer interface to the GPU service (i.e. thread).
class Service {
diff --git a/gpu/command_buffer/service/memory_program_cache.h b/gpu/command_buffer/service/memory_program_cache.h
index e72f9f5..56e5979 100644
--- a/gpu/command_buffer/service/memory_program_cache.h
+++ b/gpu/command_buffer/service/memory_program_cache.h
@@ -33,7 +33,7 @@
Shader* shader_b,
const ShaderTranslatorInterface* translator_b,
const LocationMap* bind_attrib_location_map,
- const ShaderCacheCallback& shader_callback) OVERRIDE;
+ const ShaderCacheCallback& shader_callback) override;
virtual void SaveLinkedProgram(
GLuint program,
const Shader* shader_a,
@@ -41,12 +41,12 @@
const Shader* shader_b,
const ShaderTranslatorInterface* translator_b,
const LocationMap* bind_attrib_location_map,
- const ShaderCacheCallback& shader_callback) OVERRIDE;
+ const ShaderCacheCallback& shader_callback) override;
- virtual void LoadProgram(const std::string& program) OVERRIDE;
+ virtual void LoadProgram(const std::string& program) override;
private:
- virtual void ClearBackend() OVERRIDE;
+ virtual void ClearBackend() override;
class ProgramCacheValue : public base::RefCounted<ProgramCacheValue> {
public:
diff --git a/gpu/command_buffer/service/program_cache_unittest.cc b/gpu/command_buffer/service/program_cache_unittest.cc
index 4e2abc3..37597d3 100644
--- a/gpu/command_buffer/service/program_cache_unittest.cc
+++ b/gpu/command_buffer/service/program_cache_unittest.cc
@@ -22,7 +22,7 @@
Shader* /* shader_b */,
const ShaderTranslatorInterface* /* translator_b */,
const LocationMap* /* bind_attrib_location_map */,
- const ShaderCacheCallback& /* callback */) OVERRIDE {
+ const ShaderCacheCallback& /* callback */) override {
return PROGRAM_LOAD_SUCCESS;
}
virtual void SaveLinkedProgram(
@@ -32,11 +32,11 @@
const Shader* /* shader_b */,
const ShaderTranslatorInterface* /* translator_b */,
const LocationMap* /* bind_attrib_location_map */,
- const ShaderCacheCallback& /* callback */) OVERRIDE { }
+ const ShaderCacheCallback& /* callback */) override { }
- virtual void LoadProgram(const std::string& /* program */) OVERRIDE {}
+ virtual void LoadProgram(const std::string& /* program */) override {}
- virtual void ClearBackend() OVERRIDE {}
+ virtual void ClearBackend() override {}
void SaySuccessfullyCached(const std::string& shader1,
const ShaderTranslatorInterface* translator_1,
diff --git a/gpu/command_buffer/service/query_manager.cc b/gpu/command_buffer/service/query_manager.cc
index 1d36c89..fdc7d0a 100644
--- a/gpu/command_buffer/service/query_manager.cc
+++ b/gpu/command_buffer/service/query_manager.cc
@@ -34,7 +34,7 @@
cancelled_ = true;
}
- virtual void DidComplete(const AsyncMemoryParams& mem_params) OVERRIDE {
+ virtual void DidComplete(const AsyncMemoryParams& mem_params) override {
base::AutoLock locked(lock_);
if (!cancelled_) {
DCHECK(mem_params.buffer().get());
@@ -62,10 +62,10 @@
AsyncPixelTransfersCompletedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~AsyncPixelTransfersCompletedQuery();
@@ -139,10 +139,10 @@
AllSamplesPassedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset,
GLuint service_id);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~AllSamplesPassedQuery();
@@ -198,10 +198,10 @@
CommandsIssuedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~CommandsIssuedQuery();
@@ -245,10 +245,10 @@
CommandLatencyQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~CommandLatencyQuery();
@@ -291,10 +291,10 @@
AsyncReadPixelsCompletedQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
void Complete();
@@ -351,10 +351,10 @@
GetErrorQuery(
QueryManager* manager, GLenum target, int32 shm_id, uint32 shm_offset);
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~GetErrorQuery();
@@ -398,10 +398,10 @@
uint32 shm_offset);
// Overridden from QueryManager::Query:
- virtual bool Begin() OVERRIDE;
- virtual bool End(base::subtle::Atomic32 submit_count) OVERRIDE;
- virtual bool Process() OVERRIDE;
- virtual void Destroy(bool have_context) OVERRIDE;
+ virtual bool Begin() override;
+ virtual bool End(base::subtle::Atomic32 submit_count) override;
+ virtual bool Process() override;
+ virtual void Destroy(bool have_context) override;
protected:
virtual ~CommandsCompletedQuery();
diff --git a/gpu/command_buffer/service/query_manager_unittest.cc b/gpu/command_buffer/service/query_manager_unittest.cc
index 9f0156f..f6335e8 100644
--- a/gpu/command_buffer/service/query_manager_unittest.cc
+++ b/gpu/command_buffer/service/query_manager_unittest.cc
@@ -100,7 +100,7 @@
}
virtual scoped_refptr<gpu::Buffer> GetSharedMemoryBuffer(int32 shm_id)
- OVERRIDE {
+ override {
return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_;
}
@@ -108,23 +108,23 @@
memset(data_, kInitialMemoryValue, kSharedBufferSize);
}
- virtual void set_token(int32 token) OVERRIDE {
+ virtual void set_token(int32 token) override {
DCHECK(false);
}
- virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) OVERRIDE {
+ virtual bool SetGetBuffer(int32 /* transfer_buffer_id */) override {
DCHECK(false);
return false;
}
// Overridden from CommandBufferEngine.
- virtual bool SetGetOffset(int32 offset) OVERRIDE {
+ virtual bool SetGetOffset(int32 offset) override {
DCHECK(false);
return false;
}
// Overridden from CommandBufferEngine.
- virtual int32 GetGetOffset() OVERRIDE {
+ virtual int32 GetGetOffset() override {
DCHECK(false);
return 0;
}
diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h
index 77e04ab..57a198e 100644
--- a/gpu/command_buffer/service/shader_translator.h
+++ b/gpu/command_buffer/service/shader_translator.h
@@ -117,7 +117,7 @@
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
GlslImplementationType glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds) OVERRIDE;
+ ShCompileOptions driver_bug_workarounds) override;
// Overridden from ShaderTranslatorInterface.
virtual bool Translate(const std::string& shader_source,
@@ -126,10 +126,10 @@
VariableMap* attrib_map,
VariableMap* uniform_map,
VariableMap* varying_map,
- NameMap* name_map) const OVERRIDE;
+ NameMap* name_map) const override;
virtual std::string GetStringForOptionsThatWouldAffectCompilation() const
- OVERRIDE;
+ override;
void AddDestructionObserver(DestructionObserver* observer);
void RemoveDestructionObserver(DestructionObserver* observer);
diff --git a/gpu/command_buffer/service/shader_translator_cache.h b/gpu/command_buffer/service/shader_translator_cache.h
index 2a272d1..02f5829 100644
--- a/gpu/command_buffer/service/shader_translator_cache.h
+++ b/gpu/command_buffer/service/shader_translator_cache.h
@@ -29,7 +29,7 @@
ShaderTranslatorCache();
// ShaderTranslator::DestructionObserver implementation
- virtual void OnDestruct(ShaderTranslator* translator) OVERRIDE;
+ virtual void OnDestruct(ShaderTranslator* translator) override;
scoped_refptr<ShaderTranslator> GetTranslator(
sh::GLenum shader_type,
diff --git a/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc b/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
index b59cf5c..1026f45 100644
--- a/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
+++ b/gpu/command_buffer/service/stream_texture_manager_in_process_android.cc
@@ -23,20 +23,20 @@
const base::Closure& release_callback);
// implement gfx::GLImage
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE;
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE;
- virtual void DidUseTexImage() OVERRIDE {}
- virtual void WillModifyTexImage() OVERRIDE {}
- virtual void DidModifyTexImage() OVERRIDE {}
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override;
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override;
+ virtual void DidUseTexImage() override {}
+ virtual void WillModifyTexImage() override {}
+ virtual void DidModifyTexImage() override {}
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
- const gfx::RectF& crop_rect) OVERRIDE;
+ const gfx::RectF& crop_rect) override;
private:
virtual ~GLImageImpl();
@@ -137,7 +137,8 @@
GL_RGBA,
GL_UNSIGNED_BYTE,
true);
- texture_manager->SetLevelImage(texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image);
+ texture_manager->SetLevelImage(
+ texture, GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get());
{
base::AutoLock lock(map_lock_);
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc
index 393dda0..8932ec2 100644
--- a/gpu/command_buffer/service/texture_definition.cc
+++ b/gpu/command_buffer/service/texture_definition.cc
@@ -30,20 +30,20 @@
const gfx::Size& size);
// Implement GLImage.
- virtual void Destroy(bool have_context) OVERRIDE;
- virtual gfx::Size GetSize() OVERRIDE;
- virtual bool BindTexImage(unsigned target) OVERRIDE;
- virtual void ReleaseTexImage(unsigned target) OVERRIDE;
- virtual bool CopyTexImage(unsigned target) OVERRIDE;
- virtual void WillUseTexImage() OVERRIDE;
- virtual void WillModifyTexImage() OVERRIDE;
- virtual void DidModifyTexImage() OVERRIDE;
- virtual void DidUseTexImage() OVERRIDE;
+ virtual void Destroy(bool have_context) override;
+ virtual gfx::Size GetSize() override;
+ virtual bool BindTexImage(unsigned target) override;
+ virtual void ReleaseTexImage(unsigned target) override;
+ virtual bool CopyTexImage(unsigned target) override;
+ virtual void WillUseTexImage() override;
+ virtual void WillModifyTexImage() override;
+ virtual void DidModifyTexImage() override;
+ virtual void DidUseTexImage() override;
virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
int z_order,
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
- const gfx::RectF& crop_rect) OVERRIDE;
+ const gfx::RectF& crop_rect) override;
protected:
virtual ~GLImageSync();
@@ -124,14 +124,14 @@
private:
NativeImageBufferEGL(EGLDisplay display, EGLImageKHR image);
virtual ~NativeImageBufferEGL();
- virtual void AddClient(gfx::GLImage* client) OVERRIDE;
- virtual void RemoveClient(gfx::GLImage* client) OVERRIDE;
- virtual bool IsClient(gfx::GLImage* client) OVERRIDE;
- virtual void BindToTexture(GLenum target) OVERRIDE;
- virtual void WillRead(gfx::GLImage* client) OVERRIDE;
- virtual void WillWrite(gfx::GLImage* client) OVERRIDE;
- virtual void DidRead(gfx::GLImage* client) OVERRIDE;
- virtual void DidWrite(gfx::GLImage* client) OVERRIDE;
+ virtual void AddClient(gfx::GLImage* client) override;
+ virtual void RemoveClient(gfx::GLImage* client) override;
+ virtual bool IsClient(gfx::GLImage* client) override;
+ virtual void BindToTexture(GLenum target) override;
+ virtual void WillRead(gfx::GLImage* client) override;
+ virtual void WillWrite(gfx::GLImage* client) override;
+ virtual void DidRead(gfx::GLImage* client) override;
+ virtual void DidWrite(gfx::GLImage* client) override;
EGLDisplay egl_display_;
EGLImageKHR egl_image_;
@@ -307,14 +307,14 @@
private:
virtual ~NativeImageBufferStub() {}
- virtual void AddClient(gfx::GLImage* client) OVERRIDE {}
- virtual void RemoveClient(gfx::GLImage* client) OVERRIDE {}
- virtual bool IsClient(gfx::GLImage* client) OVERRIDE { return true; }
- virtual void BindToTexture(GLenum target) OVERRIDE {}
- virtual void WillRead(gfx::GLImage* client) OVERRIDE {}
- virtual void WillWrite(gfx::GLImage* client) OVERRIDE {}
- virtual void DidRead(gfx::GLImage* client) OVERRIDE {}
- virtual void DidWrite(gfx::GLImage* client) OVERRIDE {}
+ virtual void AddClient(gfx::GLImage* client) override {}
+ virtual void RemoveClient(gfx::GLImage* client) override {}
+ virtual bool IsClient(gfx::GLImage* client) override { return true; }
+ virtual void BindToTexture(GLenum target) override {}
+ virtual void WillRead(gfx::GLImage* client) override {}
+ virtual void WillWrite(gfx::GLImage* client) override {}
+ virtual void DidRead(gfx::GLImage* client) override {}
+ virtual void DidWrite(gfx::GLImage* client) override {}
DISALLOW_COPY_AND_ASSIGN(NativeImageBufferStub);
};
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index bfbdcb1..acc63d7 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -425,20 +425,7 @@
return;
}
- const Texture::LevelInfo& first_face = level_infos_[0][0];
- int levels_needed = TextureManager::ComputeMipMapCount(
- target_, first_face.width, first_face.height, first_face.depth);
- bool cleared = true;
- for (size_t ii = 0; ii < level_infos_.size(); ++ii) {
- for (GLint jj = 0; jj < levels_needed; ++jj) {
- const Texture::LevelInfo& info = level_infos_[ii][jj];
- if (info.width > 0 && info.height > 0 && info.depth > 0 &&
- !info.cleared) {
- cleared = false;
- break;
- }
- }
- }
+ const bool cleared = (num_uncleared_mips_ == 0);
// If texture is uncleared and is attached to a framebuffer,
// that framebuffer must be marked possibly incomplete.
diff --git a/gpu/command_buffer/service/texture_manager_unittest.cc b/gpu/command_buffer/service/texture_manager_unittest.cc
index 2d509ae..9604cb1 100644
--- a/gpu/command_buffer/service/texture_manager_unittest.cc
+++ b/gpu/command_buffer/service/texture_manager_unittest.cc
@@ -2169,12 +2169,12 @@
virtual void TrackMemoryAllocatedChange(size_t old_size,
size_t new_size,
- Pool pool) OVERRIDE {
+ Pool pool) override {
DCHECK_LT(static_cast<size_t>(pool), arraysize(current_size_));
current_size_[pool] += new_size - old_size;
}
- virtual bool EnsureGPUMemoryAvailable(size_t size_needed) OVERRIDE {
+ virtual bool EnsureGPUMemoryAvailable(size_t size_needed) override {
return true;
}
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.h b/gpu/command_buffer/service/transfer_buffer_manager.h
index d8bb3bb..40cd168 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager.h
+++ b/gpu/command_buffer/service/transfer_buffer_manager.h
@@ -34,9 +34,9 @@
bool Initialize();
virtual bool RegisterTransferBuffer(int32 id,
scoped_ptr<BufferBacking> buffer_backing)
- OVERRIDE;
- virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
- virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) OVERRIDE;
+ override;
+ virtual void DestroyTransferBuffer(int32 id) override;
+ virtual scoped_refptr<Buffer> GetTransferBuffer(int32 id) override;
private:
virtual ~TransferBufferManager();
diff --git a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
index b047978..444f714 100644
--- a/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
+++ b/gpu/command_buffer/service/transfer_buffer_manager_unittest.cc
@@ -57,10 +57,10 @@
class FakeBufferBacking : public BufferBacking {
public:
- virtual void* GetMemory() const OVERRIDE {
+ virtual void* GetMemory() const override {
return reinterpret_cast<void*>(0xBADF00D0);
}
- virtual size_t GetSize() const OVERRIDE { return 42; }
+ virtual size_t GetSize() const override { return 42; }
static scoped_ptr<BufferBacking> Make() {
return scoped_ptr<BufferBacking>(new FakeBufferBacking);
}
diff --git a/gpu/command_buffer/tests/gl_manager.cc b/gpu/command_buffer/tests/gl_manager.cc
index bebf74c..2a837eb 100644
--- a/gpu/command_buffer/tests/gl_manager.cc
+++ b/gpu/command_buffer/tests/gl_manager.cc
@@ -56,16 +56,16 @@
mapped_(false) {}
// Overridden from gfx::GpuMemoryBuffer:
- virtual void* Map() OVERRIDE {
+ virtual void* Map() override {
mapped_ = true;
return &bytes_->data().front();
}
- virtual void Unmap() OVERRIDE { mapped_ = false; }
- virtual bool IsMapped() const OVERRIDE { return mapped_; }
- virtual uint32 GetStride() const OVERRIDE {
+ virtual void Unmap() override { mapped_ = false; }
+ virtual bool IsMapped() const override { return mapped_; }
+ virtual uint32 GetStride() const override {
return size_.width() * BytesPerPixel(internalformat_);
}
- virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE {
+ virtual gfx::GpuMemoryBufferHandle GetHandle() const override {
NOTREACHED();
return gfx::GpuMemoryBufferHandle();
}
diff --git a/gpu/command_buffer/tests/gl_manager.h b/gpu/command_buffer/tests/gl_manager.h
index 9f58e81..a4f4c71 100644
--- a/gpu/command_buffer/tests/gl_manager.h
+++ b/gpu/command_buffer/tests/gl_manager.h
@@ -90,22 +90,22 @@
const gpu::gles2::FeatureInfo::Workarounds& workarounds() const;
// GpuControl implementation.
- virtual Capabilities GetCapabilities() OVERRIDE;
+ virtual Capabilities GetCapabilities() override;
virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
size_t height,
unsigned internalformat,
unsigned usage,
- int32* id) OVERRIDE;
- virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
- virtual uint32 InsertSyncPoint() OVERRIDE;
- virtual uint32 InsertFutureSyncPoint() OVERRIDE;
- virtual void RetireSyncPoint(uint32 sync_point) OVERRIDE;
+ int32* id) override;
+ virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual uint32 InsertSyncPoint() override;
+ virtual uint32 InsertFutureSyncPoint() override;
+ virtual void RetireSyncPoint(uint32 sync_point) override;
virtual void SignalSyncPoint(uint32 sync_point,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void SignalQuery(uint32 query,
- const base::Closure& callback) OVERRIDE;
- virtual void SetSurfaceVisible(bool visible) OVERRIDE;
- virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE;
+ const base::Closure& callback) override;
+ virtual void SetSurfaceVisible(bool visible) override;
+ virtual uint32 CreateStreamTexture(uint32 texture_id) override;
private:
void PumpCommands();
diff --git a/gpu/command_buffer/tests/gl_unittests_android.cc b/gpu/command_buffer/tests/gl_unittests_android.cc
index 27b0cb6..d3517a6 100644
--- a/gpu/command_buffer/tests/gl_unittests_android.cc
+++ b/gpu/command_buffer/tests/gl_unittests_android.cc
@@ -22,11 +22,11 @@
class GLSurfaceTextureTest : public testing::Test {
protected:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
gl_.Initialize(GLManager::Options());
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
gl_.Destroy();
}
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc
index d693d85..7edb628 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -1082,7 +1082,7 @@
GpuControlListEntryDualGPUTest() { }
virtual ~GpuControlListEntryDualGPUTest() { }
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
// Set up a NVIDIA/Intel dual, with NVIDIA as primary and Intel as
// secondary, and initially Intel is active.
gpu_info_.gpu.vendor_id = 0x10de;
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index 20df5d6..d38e1eb 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "7.4",
+ "version": "7.5",
"entries": [
{
"id": 1,
@@ -763,6 +763,7 @@
"os": {
"type": "linux"
},
+ "driver_vendor": "Mesa",
"features": [
"disable_post_sub_buffers_for_onscreen_surfaces"
]
@@ -1013,13 +1014,13 @@
},
{
"id": 91,
- "cr_bugs": [150500],
+ "cr_bugs": [150500, 414816],
"description": "ETC1 non-power-of-two sized textures crash older IMG drivers",
"os": {
"type": "android"
},
"gl_vendor": "Imagination.*",
- "gl_renderer": "PowerVR SGX 540.*",
+ "gl_renderer": "PowerVR SGX 5.*",
"features": [
"etc1_power_of_two_only"
]
diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc
index f560dcb..c7951f9 100644
--- a/gpu/config/gpu_info.cc
+++ b/gpu/config/gpu_info.cc
@@ -17,6 +17,19 @@
enumerator->EndGPUDevice();
}
+void EnumerateVideoEncodeAcceleratorSupportedProfile(
+ gpu::GPUInfo::Enumerator* enumerator,
+ const media::VideoEncodeAccelerator::SupportedProfile profile) {
+ enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
+ enumerator->AddInt("profile", profile.profile);
+ enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width());
+ enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height());
+ enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator);
+ enumerator->AddInt("maxFramerateDenominator",
+ profile.max_framerate_denominator);
+ enumerator->EndVideoEncodeAcceleratorSupportedProfile();
+}
+
} // namespace
namespace gpu {
@@ -88,6 +101,8 @@
CollectInfoResult dx_diagnostics_info_state;
DxDiagNode dx_diagnostics;
#endif
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+ video_encode_accelerator_supported_profiles;
};
// If this assert fails then most likely something below needs to be updated.
@@ -142,6 +157,12 @@
#if defined(OS_WIN)
enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state);
#endif
+ // TODO(kbr): add dx_diagnostics on Windows.
+ for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size();
+ ++ii) {
+ EnumerateVideoEncodeAcceleratorSupportedProfile(
+ enumerator, video_encode_accelerator_supported_profiles[ii]);
+ }
enumerator->EndAuxAttributes();
}
diff --git a/gpu/config/gpu_info.h b/gpu/config/gpu_info.h
index 8f5479b..bdbb205 100644
--- a/gpu/config/gpu_info.h
+++ b/gpu/config/gpu_info.h
@@ -18,6 +18,7 @@
#include "gpu/config/dx_diag_node.h"
#include "gpu/config/gpu_performance_stats.h"
#include "gpu/gpu_export.h"
+#include "media/video/video_encode_accelerator.h"
namespace gpu {
@@ -177,6 +178,8 @@
DxDiagNode dx_diagnostics;
#endif
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+ video_encode_accelerator_supported_profiles;
// Note: when adding new members, please remember to update EnumerateFields
// in gpu_info.cc.
diff --git a/gpu/config/gpu_info_collector.cc b/gpu/config/gpu_info_collector.cc
index 78dfe22..5d25546 100644
--- a/gpu/config/gpu_info_collector.cc
+++ b/gpu/config/gpu_info_collector.cc
@@ -156,6 +156,8 @@
basic_gpu_info->direct_rendering = context_gpu_info.direct_rendering;
basic_gpu_info->context_info_state = context_gpu_info.context_info_state;
basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
+ basic_gpu_info->video_encode_accelerator_supported_profiles =
+ context_gpu_info.video_encode_accelerator_supported_profiles;
}
} // namespace gpu
diff --git a/gpu/config/gpu_info_unittest.cc b/gpu/config/gpu_info_unittest.cc
index 48d476f..71d4e5c 100644
--- a/gpu/config/gpu_info_unittest.cc
+++ b/gpu/config/gpu_info_unittest.cc
@@ -32,6 +32,7 @@
#if defined(OS_WIN)
EXPECT_EQ(gpu_info.dx_diagnostics_info_state, kCollectInfoNone);
#endif
+ EXPECT_EQ(gpu_info.video_encode_accelerator_supported_profiles.size(), 0u);
}
} // namespace gpu
diff --git a/gpu/config/gpu_test_config.h b/gpu/config/gpu_test_config.h
index 635a977..8600a4a 100644
--- a/gpu/config/gpu_test_config.h
+++ b/gpu/config/gpu_test_config.h
@@ -95,7 +95,7 @@
virtual ~GPUTestBotConfig();
// This should only be called when no gpu_vendor is added.
- virtual void AddGPUVendor(uint32 gpu_vendor) OVERRIDE;
+ virtual void AddGPUVendor(uint32 gpu_vendor) override;
// Return false if gpu_info does not have valid vendor_id and device_id.
bool SetGPUInfo(const GPUInfo& gpu_info);
@@ -103,7 +103,7 @@
// Check if the bot config is valid, i.e., if it is one valid test-bot
// environment. For example, if a field is unknown, or if OS is not one
// fully defined OS, then it's valid.
- virtual bool IsValid() const OVERRIDE;
+ virtual bool IsValid() const override;
// Check if a bot config matches a test config, i.e., the test config is a
// superset of the bot config.
diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
index 27ed77a..99496ae 100644
--- a/gpu/config/software_rendering_list_json.cc
+++ b/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@
{
"name": "software rendering list",
// Please update the version number whenever you change this file.
- "version": "9.9",
+ "version": "9.10",
"entries": [
{
"id": 1,
@@ -1055,7 +1055,7 @@
"HTC One",
"C5303", "C6603", "C6903",
"GT-I8262", "GT-I8552", "GT-I9195",
- "GT-I9500", "GT-I9505",
+ "GT-I9505",
"SAMSUNG-SCH-I337", "SCH-I545", "SGH-M919",
"SM-N900", "SM-N9005", "SPH-L720",
"XT907", "XT1032", "XT1033", "XT1080"]
diff --git a/gpu/gles2_conform_support/egl/display.h b/gpu/gles2_conform_support/egl/display.h
index 5be81a9..2876427 100644
--- a/gpu/gles2_conform_support/egl/display.h
+++ b/gpu/gles2_conform_support/egl/display.h
@@ -74,22 +74,22 @@
bool MakeCurrent(EGLSurface draw, EGLSurface read, EGLContext ctx);
// GpuControl implementation.
- virtual gpu::Capabilities GetCapabilities() OVERRIDE;
+ virtual gpu::Capabilities GetCapabilities() override;
virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(size_t width,
size_t height,
unsigned internalformat,
unsigned usage,
- int32* id) OVERRIDE;
- virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
- virtual uint32 InsertSyncPoint() OVERRIDE;
- virtual uint32 InsertFutureSyncPoint() OVERRIDE;
- virtual void RetireSyncPoint(uint32 sync_point) OVERRIDE;
+ int32* id) override;
+ virtual void DestroyGpuMemoryBuffer(int32 id) override;
+ virtual uint32 InsertSyncPoint() override;
+ virtual uint32 InsertFutureSyncPoint() override;
+ virtual void RetireSyncPoint(uint32 sync_point) override;
virtual void SignalSyncPoint(uint32 sync_point,
- const base::Closure& callback) OVERRIDE;
+ const base::Closure& callback) override;
virtual void SignalQuery(uint32 query,
- const base::Closure& callback) OVERRIDE;
- virtual void SetSurfaceVisible(bool visible) OVERRIDE;
- virtual uint32 CreateStreamTexture(uint32 texture_id) OVERRIDE;
+ const base::Closure& callback) override;
+ virtual void SetSurfaceVisible(bool visible) override;
+ virtual uint32 CreateStreamTexture(uint32 texture_id) override;
private:
EGLNativeDisplayType display_id_;
diff --git a/gpu/tools/compositor_model_bench/forward_render_model.cc b/gpu/tools/compositor_model_bench/forward_render_model.cc
index c570bf3..ddacdce 100644
--- a/gpu/tools/compositor_model_bench/forward_render_model.cc
+++ b/gpu/tools/compositor_model_bench/forward_render_model.cc
@@ -15,18 +15,18 @@
public:
ForwardRenderNodeVisitor() {}
- virtual void BeginVisitRenderNode(RenderNode* v) OVERRIDE {
+ virtual void BeginVisitRenderNode(RenderNode* v) override {
NOTREACHED();
}
- virtual void BeginVisitCCNode(CCNode* v) OVERRIDE {
+ virtual void BeginVisitCCNode(CCNode* v) override {
if (!v->drawsContent())
return;
ConfigAndActivateShaderForNode(v);
DrawQuad(v->width(), v->height());
}
- virtual void BeginVisitContentLayerNode(ContentLayerNode* l) OVERRIDE {
+ virtual void BeginVisitContentLayerNode(ContentLayerNode* l) override {
if (!l->drawsContent())
return;
ConfigAndActivateShaderForTiling(l);
diff --git a/gpu/tools/compositor_model_bench/forward_render_model.h b/gpu/tools/compositor_model_bench/forward_render_model.h
index 76590fe..68f02a8 100644
--- a/gpu/tools/compositor_model_bench/forward_render_model.h
+++ b/gpu/tools/compositor_model_bench/forward_render_model.h
@@ -19,9 +19,9 @@
explicit ForwardRenderSimulator(RenderNode* root,
int window_width,
int window_height);
- virtual ~ForwardRenderSimulator() OVERRIDE;
- virtual void Update() OVERRIDE;
- virtual void Resize(int width, int height) OVERRIDE;
+ virtual ~ForwardRenderSimulator() override;
+ virtual void Update() override;
+ virtual void Resize(int width, int height) override;
private:
scoped_ptr<ForwardRenderNodeVisitor> visitor_;
diff --git a/gpu/tools/compositor_model_bench/render_model_utils.h b/gpu/tools/compositor_model_bench/render_model_utils.h
index eaa8991..30aac0f 100644
--- a/gpu/tools/compositor_model_bench/render_model_utils.h
+++ b/gpu/tools/compositor_model_bench/render_model_utils.h
@@ -25,13 +25,13 @@
typedef std::vector<Tile>::iterator tile_iter;
explicit TextureGenerator(RenderNode* root);
- virtual ~TextureGenerator() OVERRIDE;
+ virtual ~TextureGenerator() override;
// RenderNodeVisitor functions look for textures and pass them
// off to HandleTexture (which behaves appropriately depending
// on which pass we are in.)
- virtual void BeginVisitRenderNode(RenderNode* node) OVERRIDE;
- virtual void BeginVisitCCNode(CCNode* node) OVERRIDE;
+ virtual void BeginVisitRenderNode(RenderNode* node) override;
+ virtual void BeginVisitCCNode(CCNode* node) override;
private:
enum TextureGenStage {
diff --git a/gpu/tools/compositor_model_bench/render_tree.h b/gpu/tools/compositor_model_bench/render_tree.h
index adee4b8..e28cb80 100644
--- a/gpu/tools/compositor_model_bench/render_tree.h
+++ b/gpu/tools/compositor_model_bench/render_tree.h
@@ -137,7 +137,7 @@
public:
ContentLayerNode();
virtual ~ContentLayerNode();
- virtual void Accept(RenderNodeVisitor* v) OVERRIDE;
+ virtual void Accept(RenderNodeVisitor* v) override;
void set_skipsDraw(bool skips) {
skipsDraw_ = skips;
@@ -157,7 +157,7 @@
CCNode();
virtual ~CCNode();
- virtual void Accept(RenderNodeVisitor* v) OVERRIDE;
+ virtual void Accept(RenderNodeVisitor* v) override;
ShaderID vertex_shader() {
return vertex_shader_;
diff --git a/mojo/BUILD.gn b/mojo/BUILD.gn
index 2161ddc..7db56f7 100644
--- a/mojo/BUILD.gn
+++ b/mojo/BUILD.gn
@@ -12,6 +12,7 @@
}
deps = [
":tests",
+ "//mojo/apps/js",
"//mojo/common",
"//mojo/examples",
"//mojo/public",
@@ -42,6 +43,8 @@
testonly = true
deps = [
"//mojo/application_manager:mojo_application_manager_unittests",
+ "//mojo/apps/js/test:mojo_apps_js_unittests",
+ "//mojo/bindings/js/tests:mojo_js_unittests",
"//mojo/common:mojo_common_unittests",
"//mojo/edk/system:mojo_message_pipe_perftests",
"//mojo/edk/system:mojo_system_unittests",
diff --git a/mojo/android/javatests/mojo_test_case.cc b/mojo/android/javatests/mojo_test_case.cc
index f14dfd8..419d14d 100644
--- a/mojo/android/javatests/mojo_test_case.cc
+++ b/mojo/android/javatests/mojo_test_case.cc
@@ -13,13 +13,17 @@
#include "base/run_loop.h"
#include "base/test/test_support_android.h"
#include "jni/MojoTestCase_jni.h"
+#include "mojo/common/message_pump_mojo.h"
+
#include "mojo/public/cpp/environment/environment.h"
namespace {
struct TestEnvironment {
+ TestEnvironment() : message_loop(mojo::common::MessagePumpMojo::Create()) {}
+
base::ShadowingAtExitManager at_exit;
- base::MessageLoopForUI message_loop;
+ base::MessageLoop message_loop;
};
} // namespace
@@ -46,12 +50,16 @@
}
static void RunLoop(JNIEnv* env, jobject jcaller, jlong timeout_ms) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::MessageLoop::QuitClosure(),
- base::TimeDelta::FromMilliseconds(timeout_ms));
base::RunLoop run_loop;
- run_loop.Run();
+ if (timeout_ms) {
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::MessageLoop::QuitClosure(),
+ base::TimeDelta::FromMilliseconds(timeout_ms));
+ run_loop.Run();
+ } else {
+ run_loop.RunUntilIdle();
+ }
}
bool RegisterMojoTestCase(JNIEnv* env) {
diff --git a/mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java b/mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java
index 3adb2fb..49ffd48 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/MojoTestCase.java
@@ -38,12 +38,26 @@
super.tearDown();
}
+ /**
+ * Runs the run loop for the given time.
+ */
+ protected void runLoop(long timeoutMS) {
+ nativeRunLoop(timeoutMS);
+ }
+
+ /**
+ * Runs the run loop until no handle or task are immediately available.
+ */
+ protected void runLoopUntilIdle() {
+ nativeRunLoop(0);
+ }
+
private native void nativeInitApplicationContext(Context context);
private native long nativeSetupTestEnvironment();
private native void nativeTearDownTestEnvironment(long testEnvironment);
- protected native void nativeRunLoop(long timeoutMS);
+ private native void nativeRunLoop(long timeoutMS);
}
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/ConnectorTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/ConnectorTest.java
index 2bf733c..14a9864 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/bindings/ConnectorTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/ConnectorTest.java
@@ -24,8 +24,6 @@
*/
public class ConnectorTest extends MojoTestCase {
- private static final long RUN_LOOP_TIMEOUT_MS = 25;
-
private static final int DATA_LENGTH = 1024;
private MessagePipeHandle mHandle;
@@ -87,7 +85,7 @@
public void testReceivingMessage() {
mHandle.writeMessage(mTestMessage.getData(), new ArrayList<Handle>(),
MessagePipeHandle.WriteFlags.NONE);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNull(mErrorHandler.getLastMojoException());
assertEquals(1, mReceiver.messages.size());
Message received = mReceiver.messages.get(0);
@@ -101,7 +99,7 @@
@SmallTest
public void testErrors() {
mHandle.close();
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNotNull(mErrorHandler.getLastMojoException());
assertEquals(MojoResult.FAILED_PRECONDITION,
mErrorHandler.getLastMojoException().getMojoResult());
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/ExecutorFactoryTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/ExecutorFactoryTest.java
index 40fa43b..56f4b40 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/bindings/ExecutorFactoryTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/ExecutorFactoryTest.java
@@ -53,7 +53,7 @@
mExecutor.execute(action);
mExecutor.execute(action);
assertEquals(0, mThreadContainer.size());
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoop(RUN_LOOP_TIMEOUT_MS);
assertEquals(2, mThreadContainer.size());
for (Thread thread : mThreadContainer) {
assertEquals(Thread.currentThread(), thread);
@@ -95,7 +95,7 @@
fail("Unexpected exception: " + e.getMessage());
}
assertEquals(0, mThreadContainer.size());
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoop(RUN_LOOP_TIMEOUT_MS);
assertEquals(CONCURRENCY_LEVEL, mThreadContainer.size());
for (Thread thread : mThreadContainer) {
assertEquals(Thread.currentThread(), thread);
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java
index 253add9..4744508 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/InterfacesTest.java
@@ -31,7 +31,7 @@
*/
public class InterfacesTest extends MojoTestCase {
- private static final long RUN_LOOP_TIMEOUT_MS = 25;
+ private static final String OBJECT_NAME = "hello world";
private final List<Closeable> mCloseablesToClose = new ArrayList<Closeable>();
@@ -241,7 +241,6 @@
* calls are forwared to |impl|.
*/
private void checkProxy(NamedObject.Proxy proxy, MockNamedObjectImpl impl) {
- final String NAME = "hello world";
RecordingGetNameResponse callback = new RecordingGetNameResponse();
CapturingErrorHandler errorHandler = new CapturingErrorHandler();
proxy.setErrorHandler(errorHandler);
@@ -252,28 +251,28 @@
}
proxy.getName(callback);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNull(errorHandler.getLastMojoException());
assertTrue(callback.wasCalled());
assertEquals("", callback.getName());
callback.reset();
- proxy.setName(NAME);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ proxy.setName(OBJECT_NAME);
+ runLoopUntilIdle();
assertNull(errorHandler.getLastMojoException());
if (impl != null) {
assertNull(impl.getLastMojoException());
- assertEquals(NAME, impl.getNameSynchronously());
+ assertEquals(OBJECT_NAME, impl.getNameSynchronously());
}
proxy.getName(callback);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNull(errorHandler.getLastMojoException());
assertTrue(callback.wasCalled());
- assertEquals(NAME, callback.getName());
+ assertEquals(OBJECT_NAME, callback.getName());
}
@SmallTest
@@ -320,7 +319,7 @@
assertFalse(client.isClosed());
proxy.close();
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertTrue(impl.isClosed());
assertTrue(client.isClosed());
@@ -338,7 +337,7 @@
assertFalse(client.wasDidStuffCalled());
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertTrue(client.wasDidStuffCalled());
}
diff --git a/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java b/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java
index e90bcd2..f28b2ab 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/bindings/RouterTest.java
@@ -24,8 +24,6 @@
*/
public class RouterTest extends MojoTestCase {
- private static final long RUN_LOOP_TIMEOUT_MS = 25;
-
private MessagePipeHandle mHandle;
private Router mRouter;
private RecordingMessageReceiverWithResponder mReceiver;
@@ -82,7 +80,7 @@
Message responseMessage = encoder.getMessage();
mHandle.writeMessage(responseMessage.getData(), new ArrayList<Handle>(),
MessagePipeHandle.WriteFlags.NONE);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(1, mReceiver.messages.size());
ServiceMessage receivedResponseMessage = mReceiver.messages.get(0).asServiceMessage();
@@ -108,7 +106,7 @@
Message headerMessage = encoder.getMessage();
mHandle.writeMessage(headerMessage.getData(), new ArrayList<Handle>(),
MessagePipeHandle.WriteFlags.NONE);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(1, mReceiver.messagesWithReceivers.size());
Pair<Message, MessageReceiver> receivedMessage =
diff --git a/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java b/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
index 355156e..9c4718c 100644
--- a/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
+++ b/mojo/android/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
@@ -598,7 +598,7 @@
handles.second.writeMessage(ByteBuffer.allocateDirect(1), null,
MessagePipeHandle.WriteFlags.NONE);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNull(asyncWaiterResult.getException());
assertEquals(MojoResult.OK, asyncWaiterResult.getResult());
}
@@ -623,12 +623,12 @@
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
handles.second.close();
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNull(asyncWaiterResult.getException());
assertEquals(MojoResult.FAILED_PRECONDITION, asyncWaiterResult.getResult());
}
@@ -653,12 +653,12 @@
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
cancellable.cancel();
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
// TODO(qsr) Re-enable when MojoWaitMany handles it correctly.
// assertNull(asyncWaiterResult.getException());
// assertEquals(MojoResult.CANCELLED, asyncWaiterResult.getResult());
@@ -684,7 +684,7 @@
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
- nativeRunLoop(10 * RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertNull(asyncWaiterResult.getException());
assertEquals(MojoResult.DEADLINE_EXCEEDED, asyncWaiterResult.getResult());
}
@@ -709,18 +709,18 @@
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
cancellable.cancel();
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
handles.second.writeMessage(ByteBuffer.allocateDirect(1), null,
MessagePipeHandle.WriteFlags.NONE);
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
}
@@ -747,7 +747,7 @@
assertEquals(null, asyncWaiterResult.getException());
cancellable.cancel();
- nativeRunLoop(RUN_LOOP_TIMEOUT_MS);
+ runLoopUntilIdle();
assertEquals(Integer.MIN_VALUE, asyncWaiterResult.getResult());
assertEquals(null, asyncWaiterResult.getException());
}
diff --git a/mojo/application_manager/BUILD.gn b/mojo/application_manager/BUILD.gn
index 22c0edd..f788086 100644
--- a/mojo/application_manager/BUILD.gn
+++ b/mojo/application_manager/BUILD.gn
@@ -51,7 +51,7 @@
"//base",
"//mojo/application",
"//mojo/common",
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/environment:chromium",
"//mojo/public/cpp/bindings",
"//testing/gtest",
diff --git a/mojo/apps/js/bindings/connection_unittests.js b/mojo/apps/js/bindings/connection_unittests.js
index 0b0a71b..258192d 100644
--- a/mojo/apps/js/bindings/connection_unittests.js
+++ b/mojo/apps/js/bindings/connection_unittests.js
@@ -85,13 +85,14 @@
var receivedFrobinate = false;
var receivedDidFrobinate = false;
- // ServiceImpl -------------------------------------------------------------
+ // ServiceImpl ------------------------------------------------------------
function ServiceImpl(peer) {
this.peer = peer;
}
- ServiceImpl.prototype = Object.create(sample_service.ServiceStub.prototype);
+ ServiceImpl.prototype = Object.create(
+ sample_service.Service.stubClass.prototype);
ServiceImpl.prototype.frobinate = function(foo, baz, port) {
receivedFrobinate = true;
@@ -103,14 +104,14 @@
this.peer.didFrobinate(42);
};
- // ServiceImpl -------------------------------------------------------------
+ // ServiceClientImpl ------------------------------------------------------
function ServiceClientImpl(peer) {
this.peer = peer;
}
ServiceClientImpl.prototype =
- Object.create(sample_service.ServiceClientStub.prototype);
+ Object.create(sample_service.ServiceClient.stubClass.prototype);
ServiceClientImpl.prototype.didFrobinate = function(result) {
receivedDidFrobinate = true;
@@ -123,10 +124,10 @@
var sourcePipe = core.createMessagePipe();
var connection0 = new connection.Connection(
- pipe.handle0, ServiceImpl, sample_service.ServiceClientProxy);
+ pipe.handle0, ServiceImpl, sample_service.ServiceClient.proxyClass);
var connection1 = new connection.Connection(
- pipe.handle1, ServiceClientImpl, sample_service.ServiceProxy);
+ pipe.handle1, ServiceClientImpl, sample_service.Service.proxyClass);
var foo = new sample_service.Foo();
foo.bar = new sample_service.Bar();
@@ -163,7 +164,7 @@
var pipe = core.createMessagePipe();
var connection1 = new connection.Connection(
- pipe.handle1, function() {}, sample_service.ServiceProxy);
+ pipe.handle1, function() {}, sample_service.Service.proxyClass);
// Close the other end of the pipe.
core.close(pipe.handle0);
@@ -196,7 +197,7 @@
}
ProviderImpl.prototype =
- Object.create(sample_interfaces.ProviderStub.prototype);
+ Object.create(sample_interfaces.Provider.stubClass.prototype);
ProviderImpl.prototype.echoString = function(a) {
mockSupport.queuePump(core.RESULT_OK);
@@ -215,15 +216,19 @@
}
ProviderClientImpl.prototype =
- Object.create(sample_interfaces.ProviderClientStub.prototype);
+ Object.create(sample_interfaces.ProviderClient.stubClass.prototype);
var pipe = core.createMessagePipe();
var connection0 = new connection.Connection(
- pipe.handle0, ProviderImpl, sample_interfaces.ProviderClientProxy);
+ pipe.handle0,
+ ProviderImpl,
+ sample_interfaces.ProviderClient.proxyClass);
var connection1 = new connection.Connection(
- pipe.handle1, ProviderClientImpl, sample_interfaces.ProviderProxy);
+ pipe.handle1,
+ ProviderClientImpl,
+ sample_interfaces.Provider.proxyClass);
var origReadMessage = core.readMessage;
// echoString
diff --git a/mojo/apps/js/bindings/gl/BUILD.gn b/mojo/apps/js/bindings/gl/BUILD.gn
index 0ee7e13..4f3eaf2 100644
--- a/mojo/apps/js/bindings/gl/BUILD.gn
+++ b/mojo/apps/js/bindings/gl/BUILD.gn
@@ -18,6 +18,6 @@
"//mojo/bindings/js",
"//mojo/environment:chromium",
"//mojo/public/gles2:for_shared_library",
- "//mojo/services/gles2:bindings",
+ "//mojo/services/gles2:lib",
]
}
diff --git a/mojo/apps/js/bindings/sample_service_unittests.js b/mojo/apps/js/bindings/sample_service_unittests.js
index 2b8c31c..8030f44 100644
--- a/mojo/apps/js/bindings/sample_service_unittests.js
+++ b/mojo/apps/js/bindings/sample_service_unittests.js
@@ -133,11 +133,11 @@
function ServiceImpl() {
}
- ServiceImpl.prototype = Object.create(sample.ServiceStub.prototype);
+ ServiceImpl.prototype = Object.create(sample.Service.stubClass.prototype);
ServiceImpl.prototype.frobinate = function(foo, baz, port) {
checkFoo(foo);
- expect(baz).toBe(sample.ServiceStub.BazOptions.EXTRA);
+ expect(baz).toBe(sample.Service.BazOptions.EXTRA);
expect(port).toBe(10);
global.result = "PASS";
};
@@ -156,7 +156,7 @@
};
var receiver = new SimpleMessageReceiver();
- var serviceProxy = new sample.ServiceProxy(receiver);
+ var serviceProxy = new sample.Service.proxyClass(receiver);
checkDefaultValues();
@@ -164,5 +164,5 @@
checkFoo(foo);
var port = 10;
- serviceProxy.frobinate(foo, sample.ServiceProxy.BazOptions.EXTRA, port);
+ serviceProxy.frobinate(foo, sample.Service.BazOptions.EXTRA, port);
});
diff --git a/mojo/apps/js/main.js b/mojo/apps/js/main.js
index c8eaac5..e2562cf 100644
--- a/mojo/apps/js/main.js
+++ b/mojo/apps/js/main.js
@@ -22,19 +22,24 @@
], function(core, connection, support, net, loader, mojo, console) {
var netServiceHandle = mojo.connectToService(
- "mojo:mojo_network_service", "mojo::NetworkService");
+ "mojo:mojo_network_service", net.NetworkService.name);
var netConnection = new connection.Connection(
- netServiceHandle, net.NetworkServiceStub, net.NetworkServiceProxy);
+ netServiceHandle,
+ net.NetworkService.stubClass,
+ net.NetworkService.proxyClass);
- var urlLoaderPipe = new core.createMessagePipe();
+ var urlLoaderPipe = core.createMessagePipe();
netConnection.remote.createURLLoader(urlLoaderPipe.handle1);
var urlLoaderConnection = new connection.Connection(
- urlLoaderPipe.handle0, loader.URLLoaderStub, loader.URLLoaderProxy);
+ urlLoaderPipe.handle0,
+ loader.URLLoader.stubClass,
+ loader.URLLoader.proxyClass);
- var urlRequest = new loader.URLRequest();
- urlRequest.url = "http://www.cnn.com";
- urlRequest.method = "GET";
- urlRequest.auto_follow_redirects = true;
+ var urlRequest = new loader.URLRequest({
+ url: "http://www.cnn.com",
+ method: "GET",
+ auto_follow_redirects: true
+ });
var urlRequestPromise = urlLoaderConnection.remote.start(urlRequest);
urlRequestPromise.then(function(result) {
diff --git a/mojo/apps/js/test/BUILD.gn b/mojo/apps/js/test/BUILD.gn
index 2b09e71..1258316 100644
--- a/mojo/apps/js/test/BUILD.gn
+++ b/mojo/apps/js/test/BUILD.gn
@@ -11,7 +11,7 @@
"//gin:gin_test",
"//mojo/apps/js",
"//mojo/common",
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/edk/test:test_support",
"//mojo/public/interfaces/bindings/tests:test_interfaces",
]
diff --git a/mojo/apps/js/test/js_to_cpp_unittest.js b/mojo/apps/js/test/js_to_cpp_unittest.js
index b1073c8..ed57603 100644
--- a/mojo/apps/js/test/js_to_cpp_unittest.js
+++ b/mojo/apps/js/test/js_to_cpp_unittest.js
@@ -24,7 +24,8 @@
cppSide.startTest();
}
- JsSideConnection.prototype = Object.create(jsToCpp.JsSideStub.prototype);
+ JsSideConnection.prototype =
+ Object.create(jsToCpp.JsSide.stubClass.prototype);
JsSideConnection.prototype.ping = function (arg) {
this.cppSide_.pingResponse();
@@ -215,6 +216,6 @@
sampleMessage[i] = 255 - i;
}
retainedConnection = new connection.Connection(handle, JsSideConnection,
- jsToCpp.CppSideProxy);
+ jsToCpp.CppSide.proxyClass);
};
});
diff --git a/mojo/aura/BUILD.gn b/mojo/aura/BUILD.gn
index f6d6450..62d135f 100644
--- a/mojo/aura/BUILD.gn
+++ b/mojo/aura/BUILD.gn
@@ -7,13 +7,14 @@
sources = [
"aura_init.cc",
"aura_init.h",
- "context_factory_mojo.cc",
- "context_factory_mojo.h",
"screen_mojo.cc",
"screen_mojo.h",
+ "surface_binding.cc",
+ "surface_binding.h",
+ "surface_context_factory.cc",
+ "surface_context_factory.h",
"window_tree_host_mojo.cc",
"window_tree_host_mojo.h",
- "window_tree_host_mojo_delegate.h",
]
public_deps = [
@@ -28,7 +29,14 @@
"//ui/events:events_base",
"//ui/gl",
"//mojo/cc",
+ "//mojo/public/cpp/application",
"//mojo/public/gles2:for_shared_library",
+ "//mojo/public/interfaces/application:application",
+ "//mojo/services/public/cpp/geometry",
+ "//mojo/services/public/cpp/surfaces",
+ "//mojo/services/public/cpp/view_manager",
+ "//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/native_viewport",
+ "//mojo/services/public/interfaces/surfaces",
]
}
diff --git a/mojo/aura/aura_init.cc b/mojo/aura/aura_init.cc
index df17ab7..39b2fee 100644
--- a/mojo/aura/aura_init.cc
+++ b/mojo/aura/aura_init.cc
@@ -4,7 +4,6 @@
#include "mojo/aura/aura_init.h"
-#include "mojo/aura/context_factory_mojo.h"
#include "mojo/aura/screen_mojo.h"
#include "ui/aura/env.h"
@@ -13,9 +12,6 @@
AuraInit::AuraInit() {
aura::Env::CreateInstance(false);
- context_factory_.reset(new ContextFactoryMojo);
- aura::Env::GetInstance()->set_context_factory(context_factory_.get());
-
screen_.reset(ScreenMojo::Create());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
}
diff --git a/mojo/aura/aura_init.h b/mojo/aura/aura_init.h
index dea1684..3f59449 100644
--- a/mojo/aura/aura_init.h
+++ b/mojo/aura/aura_init.h
@@ -7,10 +7,6 @@
#include "base/memory/scoped_ptr.h"
-namespace ui {
-class ContextFactory;
-}
-
namespace mojo {
class ScreenMojo;
@@ -22,7 +18,6 @@
~AuraInit();
private:
- scoped_ptr<ui::ContextFactory> context_factory_;
scoped_ptr<ScreenMojo> screen_;
DISALLOW_COPY_AND_ASSIGN(AuraInit);
diff --git a/mojo/aura/context_factory_mojo.cc b/mojo/aura/context_factory_mojo.cc
deleted file mode 100644
index 5b55cba..0000000
--- a/mojo/aura/context_factory_mojo.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/aura/context_factory_mojo.h"
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "cc/output/output_surface.h"
-#include "cc/output/software_output_device.h"
-#include "cc/resources/shared_bitmap_manager.h"
-#include "mojo/aura/window_tree_host_mojo.h"
-#include "skia/ext/platform_canvas.h"
-#include "ui/compositor/reflector.h"
-
-namespace mojo {
-namespace {
-
-void FreeSharedBitmap(cc::SharedBitmap* shared_bitmap) {
- delete shared_bitmap->memory();
-}
-
-void IgnoreSharedBitmap(cc::SharedBitmap* shared_bitmap) {}
-
-class SoftwareOutputDeviceViewManager : public cc::SoftwareOutputDevice {
- public:
- explicit SoftwareOutputDeviceViewManager(ui::Compositor* compositor)
- : compositor_(compositor) {
- }
- virtual ~SoftwareOutputDeviceViewManager() {}
-
- // cc::SoftwareOutputDevice:
- virtual void EndPaint(cc::SoftwareFrameData* frame_data) override {
- WindowTreeHostMojo* window_tree_host =
- WindowTreeHostMojo::ForCompositor(compositor_);
- DCHECK(window_tree_host);
- window_tree_host->SetContents(
- skia::GetTopDevice(*canvas_)->accessBitmap(true));
-
- SoftwareOutputDevice::EndPaint(frame_data);
- }
-
- private:
- ui::Compositor* compositor_;
-
- DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDeviceViewManager);
-};
-
-// TODO(sky): this is a copy from cc/test. Copy to a common place.
-class TestSharedBitmapManager : public cc::SharedBitmapManager {
- public:
- TestSharedBitmapManager() {}
- virtual ~TestSharedBitmapManager() {}
-
- virtual scoped_ptr<cc::SharedBitmap> AllocateSharedBitmap(
- const gfx::Size& size) override {
- base::AutoLock lock(lock_);
- scoped_ptr<base::SharedMemory> memory(new base::SharedMemory);
- memory->CreateAndMapAnonymous(size.GetArea() * 4);
- cc::SharedBitmapId id = cc::SharedBitmap::GenerateId();
- bitmap_map_[id] = memory.get();
- return scoped_ptr<cc::SharedBitmap>(
- new cc::SharedBitmap(memory.release(), id,
- base::Bind(&FreeSharedBitmap)));
- }
-
- virtual scoped_ptr<cc::SharedBitmap> GetSharedBitmapFromId(
- const gfx::Size&,
- const cc::SharedBitmapId& id) override {
- base::AutoLock lock(lock_);
- if (bitmap_map_.find(id) == bitmap_map_.end())
- return scoped_ptr<cc::SharedBitmap>();
- return scoped_ptr<cc::SharedBitmap>(
- new cc::SharedBitmap(bitmap_map_[id], id,
- base::Bind(&IgnoreSharedBitmap)));
- }
-
- virtual scoped_ptr<cc::SharedBitmap> GetBitmapForSharedMemory(
- base::SharedMemory* memory) override {
- base::AutoLock lock(lock_);
- cc::SharedBitmapId id = cc::SharedBitmap::GenerateId();
- bitmap_map_[id] = memory;
- return scoped_ptr<cc::SharedBitmap>(
- new cc::SharedBitmap(memory, id, base::Bind(&IgnoreSharedBitmap)));
- }
-
- private:
- base::Lock lock_;
- std::map<cc::SharedBitmapId, base::SharedMemory*> bitmap_map_;
-
- DISALLOW_COPY_AND_ASSIGN(TestSharedBitmapManager);
-};
-
-} // namespace
-
-ContextFactoryMojo::ContextFactoryMojo()
- : shared_bitmap_manager_(new TestSharedBitmapManager()) {
-}
-
-ContextFactoryMojo::~ContextFactoryMojo() {}
-
-scoped_ptr<cc::OutputSurface> ContextFactoryMojo::CreateOutputSurface(
- ui::Compositor* compositor,
- bool software_fallback) {
- scoped_ptr<cc::SoftwareOutputDevice> output_device(
- new SoftwareOutputDeviceViewManager(compositor));
- return make_scoped_ptr(new cc::OutputSurface(output_device.Pass()));
-}
-
-scoped_refptr<ui::Reflector> ContextFactoryMojo::CreateReflector(
- ui::Compositor* mirroed_compositor,
- ui::Layer* mirroring_layer) {
- return new ui::Reflector();
-}
-
-void ContextFactoryMojo::RemoveReflector(
- scoped_refptr<ui::Reflector> reflector) {
-}
-
-scoped_refptr<cc::ContextProvider>
-ContextFactoryMojo::SharedMainThreadContextProvider() {
- return scoped_refptr<cc::ContextProvider>(NULL);
-}
-
-void ContextFactoryMojo::RemoveCompositor(ui::Compositor* compositor) {}
-
-bool ContextFactoryMojo::DoesCreateTestContexts() { return false; }
-
-cc::SharedBitmapManager* ContextFactoryMojo::GetSharedBitmapManager() {
- return shared_bitmap_manager_.get();
-}
-
-base::MessageLoopProxy* ContextFactoryMojo::GetCompositorMessageLoop() {
- return NULL;
-}
-
-} // namespace mojo
diff --git a/mojo/aura/surface_binding.cc b/mojo/aura/surface_binding.cc
new file mode 100644
index 0000000..ada166e
--- /dev/null
+++ b/mojo/aura/surface_binding.cc
@@ -0,0 +1,251 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/aura/surface_binding.h"
+
+#include <map>
+
+#include "base/bind.h"
+#include "base/lazy_instance.h"
+#include "base/threading/thread_local.h"
+#include "cc/output/compositor_frame.h"
+#include "cc/output/output_surface.h"
+#include "cc/output/output_surface_client.h"
+#include "cc/output/software_output_device.h"
+#include "cc/resources/shared_bitmap_manager.h"
+#include "mojo/aura/window_tree_host_mojo.h"
+#include "mojo/cc/context_provider_mojo.h"
+#include "mojo/cc/output_surface_mojo.h"
+#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
+#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
+#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
+#include "mojo/services/public/cpp/view_manager/view.h"
+#include "mojo/services/public/cpp/view_manager/view_manager.h"
+#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
+#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
+#include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h"
+
+namespace mojo {
+namespace {
+
+// SurfaceclientImpl -----------------------------------------------------------
+
+class SurfaceClientImpl : public SurfaceClient {
+ public:
+ SurfaceClientImpl() {}
+ virtual ~SurfaceClientImpl() {}
+
+ // SurfaceClient:
+ virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override {
+ // TODO (sky|jamesr): figure out right way to recycle resources.
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SurfaceClientImpl);
+};
+
+// OutputSurface ---------------------------------------------------------------
+
+// OutputSurface implementation for a view. Pushes the surface id to View when
+// appropriate.
+class OutputSurfaceImpl : public cc::OutputSurface {
+ public:
+ OutputSurfaceImpl(View* view,
+ const scoped_refptr<cc::ContextProvider>& context_provider,
+ Surface* surface,
+ cc::SurfaceIdAllocator* id_allocator);
+ virtual ~OutputSurfaceImpl();
+
+ // cc::OutputSurface:
+ virtual void SwapBuffers(cc::CompositorFrame* frame) override;
+
+ private:
+ View* view_;
+ Surface* surface_;
+ cc::SurfaceIdAllocator* id_allocator_;
+ cc::SurfaceId surface_id_;
+ gfx::Size surface_size_;
+
+ DISALLOW_COPY_AND_ASSIGN(OutputSurfaceImpl);
+};
+
+OutputSurfaceImpl::OutputSurfaceImpl(
+ View* view,
+ const scoped_refptr<cc::ContextProvider>& context_provider,
+ Surface* surface,
+ cc::SurfaceIdAllocator* id_allocator)
+ : cc::OutputSurface(context_provider),
+ view_(view),
+ surface_(surface),
+ id_allocator_(id_allocator) {
+ capabilities_.delegated_rendering = true;
+ capabilities_.max_frames_pending = 1;
+}
+
+OutputSurfaceImpl::~OutputSurfaceImpl() {
+}
+
+void OutputSurfaceImpl::SwapBuffers(cc::CompositorFrame* frame) {
+ gfx::Size frame_size =
+ frame->delegated_frame_data->render_pass_list.back()->output_rect.size();
+ if (frame_size != surface_size_) {
+ if (!surface_id_.is_null())
+ surface_->DestroySurface(SurfaceId::From(surface_id_));
+ surface_id_ = id_allocator_->GenerateId();
+ surface_->CreateSurface(SurfaceId::From(surface_id_),
+ Size::From(frame_size));
+ view_->SetSurfaceId(SurfaceId::From(surface_id_));
+ surface_size_ = frame_size;
+ }
+
+ surface_->SubmitFrame(SurfaceId::From(surface_id_), Frame::From(*frame));
+
+ client_->DidSwapBuffers();
+ client_->DidSwapBuffersComplete();
+}
+
+} // namespace
+
+// PerViewManagerState ---------------------------------------------------------
+
+// State needed per ViewManager. Provides the real implementation of
+// CreateOutputSurface. SurfaceBinding obtains a pointer to the
+// PerViewManagerState appropriate for the ViewManager. PerViewManagerState is
+// stored in a thread local map. When no more refereces to a PerViewManagerState
+// remain the PerViewManagerState is deleted and the underlying map cleaned up.
+class SurfaceBinding::PerViewManagerState
+ : public base::RefCounted<PerViewManagerState> {
+ public:
+ static PerViewManagerState* Get(Shell* shell, ViewManager* view_manager);
+
+ scoped_ptr<cc::OutputSurface> CreateOutputSurface(View* view);
+
+ private:
+ typedef std::map<ViewManager*, PerViewManagerState*> ViewManagerToStateMap;
+
+ friend class base::RefCounted<PerViewManagerState>;
+
+ PerViewManagerState(Shell* shell, ViewManager* view_manager);
+ ~PerViewManagerState();
+
+ void Init();
+
+ // Callback when a Surface has been created.
+ void OnCreatedSurfaceConnection(SurfacePtr surface, uint32_t id_namespace);
+
+ static base::LazyInstance<
+ base::ThreadLocalPointer<ViewManagerToStateMap>>::Leaky view_states;
+
+ Shell* shell_;
+ ViewManager* view_manager_;
+
+ // Set of state needed to create an OutputSurface.
+ scoped_ptr<SurfaceClient> surface_client_;
+ GpuPtr gpu_;
+ SurfacePtr surface_;
+ SurfacesServicePtr surfaces_service_;
+ scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
+
+ DISALLOW_COPY_AND_ASSIGN(PerViewManagerState);
+};
+
+// static
+base::LazyInstance<base::ThreadLocalPointer<
+ SurfaceBinding::PerViewManagerState::ViewManagerToStateMap>>::Leaky
+ SurfaceBinding::PerViewManagerState::view_states;
+
+// static
+SurfaceBinding::PerViewManagerState* SurfaceBinding::PerViewManagerState::Get(
+ Shell* shell,
+ ViewManager* view_manager) {
+ ViewManagerToStateMap* view_map = view_states.Pointer()->Get();
+ if (!view_map) {
+ view_map = new ViewManagerToStateMap;
+ view_states.Pointer()->Set(view_map);
+ }
+ if (!(*view_map)[view_manager]) {
+ (*view_map)[view_manager] = new PerViewManagerState(shell, view_manager);
+ (*view_map)[view_manager]->Init();
+ }
+ return (*view_map)[view_manager];
+}
+
+scoped_ptr<cc::OutputSurface>
+SurfaceBinding::PerViewManagerState::CreateOutputSurface(View* view) {
+ // TODO(sky): figure out lifetime here. Do I need to worry about the return
+ // value outliving this?
+ CommandBufferPtr cb;
+ gpu_->CreateOffscreenGLES2Context(GetProxy(&cb));
+ scoped_refptr<cc::ContextProvider> context_provider(
+ new ContextProviderMojo(cb.PassMessagePipe()));
+ return scoped_ptr<cc::OutputSurface>(new OutputSurfaceImpl(
+ view, context_provider, surface_.get(), surface_id_allocator_.get()));
+}
+
+SurfaceBinding::PerViewManagerState::PerViewManagerState(
+ Shell* shell,
+ ViewManager* view_manager)
+ : shell_(shell), view_manager_(view_manager) {
+}
+
+SurfaceBinding::PerViewManagerState::~PerViewManagerState() {
+ ViewManagerToStateMap* view_map = view_states.Pointer()->Get();
+ DCHECK(view_map);
+ DCHECK_EQ(this, (*view_map)[view_manager_]);
+ view_map->erase(view_manager_);
+ if (view_map->empty()) {
+ delete view_map;
+ view_states.Pointer()->Set(nullptr);
+ }
+}
+
+void SurfaceBinding::PerViewManagerState::Init() {
+ DCHECK(!surfaces_service_.get());
+
+ ServiceProviderPtr surfaces_service_provider;
+ shell_->ConnectToApplication("mojo:mojo_surfaces_service",
+ GetProxy(&surfaces_service_provider));
+ ConnectToService(surfaces_service_provider.get(), &surfaces_service_);
+ // base::Unretained is ok here as we block until the call is received.
+ surfaces_service_->CreateSurfaceConnection(
+ base::Bind(&PerViewManagerState::OnCreatedSurfaceConnection,
+ base::Unretained(this)));
+ // Block until we get the surface. This is done to make it easy for client
+ // code. OTOH blocking is ick and leads to all sorts of problems.
+ // TODO(sky): ick! There needs to be a better way to deal with this.
+ surfaces_service_.WaitForIncomingMethodCall();
+ DCHECK(surface_.get());
+ surface_client_.reset(new SurfaceClientImpl);
+ surface_.set_client(surface_client_.get());
+
+ ServiceProviderPtr gpu_service_provider;
+ // TODO(jamesr): Should be mojo:mojo_gpu_service
+ shell_->ConnectToApplication("mojo:mojo_native_viewport_service",
+ GetProxy(&gpu_service_provider));
+ ConnectToService(gpu_service_provider.get(), &gpu_);
+}
+
+void SurfaceBinding::PerViewManagerState::OnCreatedSurfaceConnection(
+ SurfacePtr surface,
+ uint32_t id_namespace) {
+ surface_id_allocator_.reset(new cc::SurfaceIdAllocator(id_namespace));
+ surface_ = surface.Pass();
+}
+
+// SurfaceBinding --------------------------------------------------------------
+
+SurfaceBinding::SurfaceBinding(Shell* shell, View* view)
+ : view_(view),
+ state_(PerViewManagerState::Get(shell, view->view_manager())) {
+}
+
+SurfaceBinding::~SurfaceBinding() {
+}
+
+scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() {
+ return state_->CreateOutputSurface(view_);
+}
+
+} // namespace mojo
diff --git a/mojo/aura/surface_binding.h b/mojo/aura/surface_binding.h
new file mode 100644
index 0000000..33f6eac
--- /dev/null
+++ b/mojo/aura/surface_binding.h
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_AURA_SURFACE_BINDING_H_
+#define MOJO_AURA_SURFACE_BINDING_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace cc {
+class OutputSurface;
+}
+
+namespace mojo {
+class Shell;
+class View;
+
+// SurfaceBinding is responsible for managing the connections necessary to
+// bind a View to the surfaces service.
+// Internally SurfaceBinding manages one connection (and related structures) per
+// ViewManager. That is, all Views from a particular ViewManager share the same
+// connection.
+class SurfaceBinding {
+ public:
+ SurfaceBinding(Shell* shell, View* view);
+ ~SurfaceBinding();
+
+ // Creates an OutputSurface that renders to the View supplied to the
+ // constructor.
+ scoped_ptr<cc::OutputSurface> CreateOutputSurface();
+
+ private:
+ class PerViewManagerState;
+
+ Shell* shell_;
+ View* view_;
+ scoped_refptr<PerViewManagerState> state_;
+
+ DISALLOW_COPY_AND_ASSIGN(SurfaceBinding);
+};
+
+} // namespace mojo
+
+#endif // MOJO_AURA_SURFACE_BINDING_H_
diff --git a/mojo/aura/surface_context_factory.cc b/mojo/aura/surface_context_factory.cc
new file mode 100644
index 0000000..1e56029
--- /dev/null
+++ b/mojo/aura/surface_context_factory.cc
@@ -0,0 +1,58 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/aura/surface_context_factory.h"
+
+#include "cc/output/output_surface.h"
+#include "cc/resources/shared_bitmap_manager.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
+#include "mojo/services/public/cpp/view_manager/view.h"
+#include "ui/compositor/reflector.h"
+
+namespace mojo {
+
+SurfaceContextFactory::SurfaceContextFactory(Shell* shell, View* view)
+ : surface_binding_(shell, view) {
+}
+
+SurfaceContextFactory::~SurfaceContextFactory() {
+}
+
+scoped_ptr<cc::OutputSurface> SurfaceContextFactory::CreateOutputSurface(
+ ui::Compositor* compositor,
+ bool software_fallback) {
+ return surface_binding_.CreateOutputSurface();
+}
+
+scoped_refptr<ui::Reflector> SurfaceContextFactory::CreateReflector(
+ ui::Compositor* mirroed_compositor,
+ ui::Layer* mirroring_layer) {
+ return new ui::Reflector();
+}
+
+void SurfaceContextFactory::RemoveReflector(
+ scoped_refptr<ui::Reflector> reflector) {
+}
+
+scoped_refptr<cc::ContextProvider>
+SurfaceContextFactory::SharedMainThreadContextProvider() {
+ return nullptr;
+}
+
+void SurfaceContextFactory::RemoveCompositor(ui::Compositor* compositor) {
+}
+
+bool SurfaceContextFactory::DoesCreateTestContexts() {
+ return false;
+}
+
+cc::SharedBitmapManager* SurfaceContextFactory::GetSharedBitmapManager() {
+ return nullptr;
+}
+
+base::MessageLoopProxy* SurfaceContextFactory::GetCompositorMessageLoop() {
+ return nullptr;
+}
+
+} // namespace mojo
diff --git a/mojo/aura/context_factory_mojo.h b/mojo/aura/surface_context_factory.h
similarity index 69%
rename from mojo/aura/context_factory_mojo.h
rename to mojo/aura/surface_context_factory.h
index 437359d..dc0e8d0 100644
--- a/mojo/aura/context_factory_mojo.h
+++ b/mojo/aura/surface_context_factory.h
@@ -2,18 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_AURA_CONTEXT_FACTORY_MOJO_H_
-#define MOJO_AURA_CONTEXT_FACTORY_MOJO_H_
+#ifndef MOJO_AURA_SURFACE_CONTEXT_FACTORY_H_
+#define MOJO_AURA_SURFACE_CONTEXT_FACTORY_H_
-#include "base/macros.h"
+#include "mojo/aura/surface_binding.h"
#include "ui/compositor/compositor.h"
namespace mojo {
+class Shell;
+class View;
-class ContextFactoryMojo : public ui::ContextFactory {
+class SurfaceContextFactory : public ui::ContextFactory {
public:
- ContextFactoryMojo();
- virtual ~ContextFactoryMojo();
+ SurfaceContextFactory(Shell* shell, View* view);
+ virtual ~SurfaceContextFactory();
private:
// ContextFactory:
@@ -31,11 +33,11 @@
virtual cc::SharedBitmapManager* GetSharedBitmapManager() override;
virtual base::MessageLoopProxy* GetCompositorMessageLoop() override;
- scoped_ptr<cc::SharedBitmapManager> shared_bitmap_manager_;
+ SurfaceBinding surface_binding_;
- DISALLOW_COPY_AND_ASSIGN(ContextFactoryMojo);
+ DISALLOW_COPY_AND_ASSIGN(SurfaceContextFactory);
};
} // namespace mojo
-#endif // MOJO_AURA_CONTEXT_FACTORY_MOJO_H_
+#endif // MOJO_AURA_SURFACE_CONTEXT_FACTORY_H_
diff --git a/mojo/aura/window_tree_host_mojo.cc b/mojo/aura/window_tree_host_mojo.cc
index 8ef87c6..9f30e13 100644
--- a/mojo/aura/window_tree_host_mojo.cc
+++ b/mojo/aura/window_tree_host_mojo.cc
@@ -4,9 +4,9 @@
#include "mojo/aura/window_tree_host_mojo.h"
-#include <vector>
-
-#include "mojo/aura/window_tree_host_mojo_delegate.h"
+#include "mojo/aura/surface_context_factory.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
+#include "mojo/services/public/cpp/view_manager/view_manager.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
@@ -14,86 +14,32 @@
#include "ui/events/event_constants.h"
namespace mojo {
-namespace {
-
-const char kTreeHostsKey[] = "tree_hosts";
-
-typedef std::vector<WindowTreeHostMojo*> Managers;
-
-class TreeHosts : public base::SupportsUserData::Data {
- public:
- TreeHosts() {}
- virtual ~TreeHosts() {}
-
- static TreeHosts* Get() {
- TreeHosts* hosts = static_cast<TreeHosts*>(
- aura::Env::GetInstance()->GetUserData(kTreeHostsKey));
- if (!hosts) {
- hosts = new TreeHosts;
- aura::Env::GetInstance()->SetUserData(kTreeHostsKey, hosts);
- }
- return hosts;
- }
-
- void Add(WindowTreeHostMojo* manager) {
- managers_.push_back(manager);
- }
-
- void Remove(WindowTreeHostMojo* manager) {
- Managers::iterator i = std::find(managers_.begin(), managers_.end(),
- manager);
- DCHECK(i != managers_.end());
- managers_.erase(i);
- }
-
- const std::vector<WindowTreeHostMojo*> managers() const {
- return managers_;
- }
-
- private:
- Managers managers_;
-
- DISALLOW_COPY_AND_ASSIGN(TreeHosts);
-};
-
-} // namespace
////////////////////////////////////////////////////////////////////////////////
// WindowTreeHostMojo, public:
-WindowTreeHostMojo::WindowTreeHostMojo(View* view,
- WindowTreeHostMojoDelegate* delegate)
- : view_(view),
- bounds_(view->bounds()),
- delegate_(delegate) {
+WindowTreeHostMojo::WindowTreeHostMojo(Shell* shell, View* view)
+ : view_(view), bounds_(view->bounds()) {
view_->AddObserver(this);
- CreateCompositor(GetAcceleratedWidget());
- TreeHosts::Get()->Add(this);
+ context_factory_.reset(new SurfaceContextFactory(shell, view_));
+ // WindowTreeHost creates the compositor using the ContextFactory from
+ // aura::Env. Install |context_factory_| there so that |context_factory_| is
+ // picked up.
+ ui::ContextFactory* default_context_factory =
+ aura::Env::GetInstance()->context_factory();
+ aura::Env::GetInstance()->set_context_factory(context_factory_.get());
+ CreateCompositor(GetAcceleratedWidget());
+ aura::Env::GetInstance()->set_context_factory(default_context_factory);
+ DCHECK_EQ(context_factory_.get(), compositor()->context_factory());
}
WindowTreeHostMojo::~WindowTreeHostMojo() {
view_->RemoveObserver(this);
- TreeHosts::Get()->Remove(this);
DestroyCompositor();
DestroyDispatcher();
}
-// static
-WindowTreeHostMojo* WindowTreeHostMojo::ForCompositor(
- ui::Compositor* compositor) {
- const Managers& managers = TreeHosts::Get()->managers();
- for (size_t i = 0; i < managers.size(); ++i) {
- if (managers[i]->compositor() == compositor)
- return managers[i];
- }
- return NULL;
-}
-
-void WindowTreeHostMojo::SetContents(const SkBitmap& contents) {
- delegate_->CompositorContentsChanged(contents);
-}
-
////////////////////////////////////////////////////////////////////////////////
// WindowTreeHostMojo, aura::WindowTreeHost implementation:
diff --git a/mojo/aura/window_tree_host_mojo.h b/mojo/aura/window_tree_host_mojo.h
index af00203..f43e90d 100644
--- a/mojo/aura/window_tree_host_mojo.h
+++ b/mojo/aura/window_tree_host_mojo.h
@@ -19,24 +19,18 @@
namespace mojo {
-class WindowTreeHostMojoDelegate;
+class Shell;
+class SurfaceContextFactory;
class WindowTreeHostMojo : public aura::WindowTreeHost,
public ui::EventSource,
public ViewObserver {
public:
- WindowTreeHostMojo(View* view, WindowTreeHostMojoDelegate* delegate);
+ WindowTreeHostMojo(Shell* shell, View* view);
virtual ~WindowTreeHostMojo();
- // Returns the WindowTreeHostMojo for the specified compositor.
- static WindowTreeHostMojo* ForCompositor(ui::Compositor* compositor);
-
const gfx::Rect& bounds() const { return bounds_; }
- // Sets the contents to show in this WindowTreeHost. This forwards to the
- // delegate.
- void SetContents(const SkBitmap& contents);
-
ui::EventDispatchDetails SendEventToProcessor(ui::Event* event) {
return ui::EventSource::SendEventToProcessor(event);
}
@@ -69,7 +63,7 @@
gfx::Rect bounds_;
- WindowTreeHostMojoDelegate* delegate_;
+ scoped_ptr<SurfaceContextFactory> context_factory_;
DISALLOW_COPY_AND_ASSIGN(WindowTreeHostMojo);
};
diff --git a/mojo/aura/window_tree_host_mojo_delegate.h b/mojo/aura/window_tree_host_mojo_delegate.h
deleted file mode 100644
index 9ab13b2..0000000
--- a/mojo/aura/window_tree_host_mojo_delegate.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_DELEGATE_H_
-#define MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_DELEGATE_H_
-
-class SkBitmap;
-
-namespace mojo {
-
-class WindowTreeHostMojoDelegate {
- public:
- // Invoked when the contents of the composite associated with the
- // WindowTreeHostMojo are updated.
- virtual void CompositorContentsChanged(const SkBitmap& bitmap) = 0;
-
- protected:
- virtual ~WindowTreeHostMojoDelegate() {}
-};
-
-} // namespace mojo
-
-#endif // MOJO_EXAMPLES_AURA_DEMO_WINDOW_TREE_HOST_VIEW_MANAGER_DELEGATE_H_
diff --git a/mojo/bindings/js/core.cc b/mojo/bindings/js/core.cc
index 9ab2f19..e116db1 100644
--- a/mojo/bindings/js/core.cc
+++ b/mojo/bindings/js/core.cc
@@ -230,8 +230,9 @@
// and the buffer will contain whatever was read before the error occurred.
// The drainData data pipe handle argument is closed automatically.
-v8::Handle<v8::Value> DoDrainData(gin::Arguments* args, mojo::Handle handle) {
- return (new DrainData(args->isolate(), handle))->GetPromise();
+v8::Handle<v8::Value> DoDrainData(gin::Arguments* args,
+ gin::Handle<gin::HandleWrapper> handle) {
+ return (new DrainData(args->isolate(), handle->release()))->GetPromise();
}
gin::WrapperInfo g_wrapper_info = { gin::kEmbedderNativeGin };
diff --git a/mojo/bindings/js/tests/BUILD.gn b/mojo/bindings/js/tests/BUILD.gn
index c85e68f..2d13ff4 100644
--- a/mojo/bindings/js/tests/BUILD.gn
+++ b/mojo/bindings/js/tests/BUILD.gn
@@ -7,7 +7,7 @@
deps = [
"//gin:gin_test",
"//mojo/bindings/js",
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/edk/test:test_support",
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/utility",
diff --git a/mojo/common/BUILD.gn b/mojo/common/BUILD.gn
index a825189..df1e4df 100644
--- a/mojo/common/BUILD.gn
+++ b/mojo/common/BUILD.gn
@@ -36,7 +36,7 @@
":common",
"//base",
"//base:message_loop_tests",
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/edk/test:test_support",
"//mojo/environment:chromium",
"//mojo/public/cpp/bindings",
diff --git a/mojo/common/test/BUILD.gn b/mojo/common/test/BUILD.gn
deleted file mode 100644
index ebad97e..0000000
--- a/mojo/common/test/BUILD.gn
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# GYP version: mojo/mojo_base.gyp:mojo_run_all_unittests
-source_set("run_all_unittests") {
- testonly = true
- deps = [
- ":test_support_impl",
- "//base",
- "//base/test:test_support",
- "//mojo/edk/system",
- "//mojo/public/c/test_support",
- "//testing/gtest",
- ]
-
- sources = [ "run_all_unittests.cc" ]
-}
-
-# GYP version: mojo/mojo_base.gyp:mojo_run_all_perftests
-source_set("run_all_perftests") {
- testonly = true
- deps = [
- ":test_support_impl",
- "//base",
- "//base/test:test_support",
- "//mojo/edk/system",
- "//mojo/public/c/test_support",
- ]
-
- sources = [ "run_all_perftests.cc" ]
-}
-
-
-# GYP version: mojo/mojo_base.gyp:mojo_test_support_impl
-source_set("test_support_impl") {
- testonly = true
- deps = [
- "//base",
- ]
-
- sources = [
- "test_support_impl.cc",
- "test_support_impl.h",
- ]
-}
diff --git a/mojo/common/test/DEPS b/mojo/common/test/DEPS
deleted file mode 100644
index 61ef5fe..0000000
--- a/mojo/common/test/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+mojo/edk/embedder",
-]
diff --git a/mojo/edk/embedder/PRESUBMIT.py b/mojo/edk/PRESUBMIT.py
similarity index 93%
rename from mojo/edk/embedder/PRESUBMIT.py
rename to mojo/edk/PRESUBMIT.py
index 9cd39bc..43d5417 100644
--- a/mojo/edk/embedder/PRESUBMIT.py
+++ b/mojo/edk/PRESUBMIT.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Presubmit script for mojo/edk/embedder.
+"""Presubmit script for mojo/edk.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
diff --git a/mojo/edk/embedder/embedder.cc b/mojo/edk/embedder/embedder.cc
index b3033c4..cb84f3e 100644
--- a/mojo/edk/embedder/embedder.cc
+++ b/mojo/edk/embedder/embedder.cc
@@ -11,9 +11,9 @@
#include "mojo/edk/embedder/platform_support.h"
#include "mojo/edk/system/channel.h"
#include "mojo/edk/system/channel_endpoint.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/core.h"
#include "mojo/edk/system/entrypoints.h"
-#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/system/message_pipe_dispatcher.h"
#include "mojo/edk/system/platform_handle_dispatcher.h"
#include "mojo/edk/system/raw_channel.h"
@@ -58,17 +58,18 @@
// |Shutdown()| will have to be called on it).
// Attach the endpoint.
- system::MessageInTransit::EndpointId endpoint_id =
+ system::ChannelEndpointId endpoint_id =
channel->AttachEndpoint(channel_endpoint);
- if (endpoint_id == system::MessageInTransit::kInvalidEndpointId) {
+ if (!endpoint_id.is_valid()) {
// This means that, e.g., the other endpoint of the message pipe was closed
// first. But it's not necessarily an error per se.
DVLOG(2) << "Channel::AttachEndpoint() failed";
return channel;
}
- CHECK_EQ(endpoint_id, system::Channel::kBootstrapEndpointId);
+ CHECK_EQ(endpoint_id, system::ChannelEndpointId::GetBootstrap());
- channel->RunEndpoint(channel_endpoint, system::Channel::kBootstrapEndpointId);
+ channel->RunEndpoint(channel_endpoint,
+ system::ChannelEndpointId::GetBootstrap());
return channel;
}
diff --git a/mojo/edk/embedder/platform_channel_pair_win.cc b/mojo/edk/embedder/platform_channel_pair_win.cc
index 1cafc4f..4804eed 100644
--- a/mojo/edk/embedder/platform_channel_pair_win.cc
+++ b/mojo/edk/embedder/platform_channel_pair_win.cc
@@ -53,8 +53,8 @@
const DWORD kFlags =
SECURITY_SQOS_PRESENT | SECURITY_ANONYMOUS | FILE_FLAG_OVERLAPPED;
// Allow the handle to be inherited by child processes.
- SECURITY_ATTRIBUTES security_attributes = {sizeof(SECURITY_ATTRIBUTES),
- nullptr, TRUE};
+ SECURITY_ATTRIBUTES security_attributes = {
+ sizeof(SECURITY_ATTRIBUTES), nullptr, TRUE};
client_handle_.reset(
PlatformHandle(CreateFileW(pipe_name.c_str(),
kDesiredAccess,
diff --git a/mojo/edk/mojo_edk.gyp b/mojo/edk/mojo_edk.gyp
new file mode 100644
index 0000000..ac5ba95
--- /dev/null
+++ b/mojo/edk/mojo_edk.gyp
@@ -0,0 +1,405 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Essential components (and their tests) that are needed to build
+# Chrome should be here. Other components that are useful only in
+# Mojo land like mojo_shell should be in mojo.gyp.
+{
+ 'includes': [
+ '../mojo_variables.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'mojo_edk',
+ 'type': 'none',
+ 'dependencies': [
+ # NOTE: If adding a new dependency here, please consider whether it
+ # should also be added to the list of Mojo-related dependencies of
+ # build/all.gyp:All on iOS, as All cannot depend on the mojo_base
+ # target on iOS due to the presence of the js targets, which cause v8
+ # to be built.
+ 'mojo_message_pipe_perftests',
+ 'mojo_public_application_unittests',
+ 'mojo_public_bindings_unittests',
+ 'mojo_public_environment_unittests',
+ 'mojo_public_system_perftests',
+ 'mojo_public_system_unittests',
+ 'mojo_public_utility_unittests',
+ 'mojo_system_impl',
+ 'mojo_system_unittests',
+ ],
+ },
+ {
+ 'target_name': 'mojo_none',
+ 'type': 'none',
+ },
+ {
+ # GN version: //mojo/edk/test:run_all_unittests
+ 'target_name': 'mojo_run_all_unittests',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../base/base.gyp:test_support_base',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_system_impl',
+ 'mojo_test_support_impl',
+ '../public/mojo_public.gyp:mojo_test_support',
+ ],
+ 'sources': [
+ 'test/run_all_unittests.cc',
+ ],
+ },
+ {
+ # GN version: //mojo/edk/test:run_all_perftests
+ 'target_name': 'mojo_run_all_perftests',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../base/base.gyp:test_support_base',
+ 'mojo_system_impl',
+ 'mojo_test_support_impl',
+ '../public/mojo_public.gyp:mojo_test_support',
+ ],
+ 'sources': [
+ 'test/run_all_perftests.cc',
+ ],
+ },
+ # TODO(vtl): Reorganize the mojo_public_*_unittests.
+ {
+ # GN version: //mojo/public/cpp/bindings/tests:mojo_public_bindings_unittests
+ 'target_name': 'mojo_public_bindings_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_run_all_unittests',
+ '../public/mojo_public.gyp:mojo_cpp_bindings',
+ '../public/mojo_public.gyp:mojo_environment_standalone',
+ '../public/mojo_public.gyp:mojo_public_bindings_test_utils',
+ '../public/mojo_public.gyp:mojo_public_test_interfaces',
+ '../public/mojo_public.gyp:mojo_public_test_utils',
+ '../public/mojo_public.gyp:mojo_utility',
+ ],
+ 'sources': [
+ '../public/cpp/bindings/tests/array_unittest.cc',
+ '../public/cpp/bindings/tests/bounds_checker_unittest.cc',
+ '../public/cpp/bindings/tests/buffer_unittest.cc',
+ '../public/cpp/bindings/tests/connector_unittest.cc',
+ '../public/cpp/bindings/tests/handle_passing_unittest.cc',
+ '../public/cpp/bindings/tests/interface_ptr_unittest.cc',
+ '../public/cpp/bindings/tests/request_response_unittest.cc',
+ '../public/cpp/bindings/tests/router_unittest.cc',
+ '../public/cpp/bindings/tests/sample_service_unittest.cc',
+ '../public/cpp/bindings/tests/serialization_warning_unittest.cc',
+ '../public/cpp/bindings/tests/string_unittest.cc',
+ '../public/cpp/bindings/tests/struct_unittest.cc',
+ '../public/cpp/bindings/tests/type_conversion_unittest.cc',
+ '../public/cpp/bindings/tests/validation_unittest.cc',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/environment/tests:mojo_public_environment_unittests
+ 'target_name': 'mojo_public_environment_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_run_all_unittests',
+ '../public/mojo_public.gyp:mojo_environment_standalone',
+ '../public/mojo_public.gyp:mojo_public_test_utils',
+ '../public/mojo_public.gyp:mojo_utility',
+ ],
+ 'include_dirs': [ '../..' ],
+ 'sources': [
+ '../public/cpp/environment/tests/async_waiter_unittest.cc',
+ '../public/cpp/environment/tests/logger_unittest.cc',
+ '../public/cpp/environment/tests/logging_unittest.cc',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/application/tests:mojo_public_application_unittests
+ 'target_name': 'mojo_public_application_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_run_all_unittests',
+ '../public/mojo_public.gyp:mojo_application_standalone',
+ '../public/mojo_public.gyp:mojo_utility',
+ '../public/mojo_public.gyp:mojo_environment_standalone',
+ ],
+ 'sources': [
+ '../public/cpp/application/tests/service_registry_unittest.cc',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/application/tests:mojo_public_system_unittests
+ 'target_name': 'mojo_public_system_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_run_all_unittests',
+ '../public/mojo_public.gyp:mojo_public_test_utils',
+ ],
+ 'include_dirs': [ '../..' ],
+ 'sources': [
+ '<@(mojo_public_system_unittest_sources)',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/application/tests:mojo_public_utility_unittests
+ 'target_name': 'mojo_public_utility_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_run_all_unittests',
+ '../public/mojo_public.gyp:mojo_public_test_utils',
+ '../public/mojo_public.gyp:mojo_utility',
+ ],
+ 'include_dirs': [ '../..' ],
+ 'sources': [
+ '../public/cpp/utility/tests/mutex_unittest.cc',
+ '../public/cpp/utility/tests/run_loop_unittest.cc',
+ '../public/cpp/utility/tests/thread_unittest.cc',
+ ],
+ 'conditions': [
+ # See crbug.com/342893:
+ ['OS=="win"', {
+ 'sources!': [
+ '../public/cpp/utility/tests/mutex_unittest.cc',
+ '../public/cpp/utility/tests/thread_unittest.cc',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/public/c/system/tests:perftests
+ 'target_name': 'mojo_public_system_perftests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_run_all_perftests',
+ '../public/mojo_public.gyp:mojo_public_test_utils',
+ '../public/mojo_public.gyp:mojo_utility',
+ ],
+ 'sources': [
+ '../public/c/system/tests/core_perftest.cc',
+ ],
+ },
+
+ {
+ # GN version: //mojo/edk/system
+ 'target_name': 'mojo_system_impl',
+ 'type': '<(component)',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ ],
+ 'defines': [
+ 'MOJO_SYSTEM_IMPL_IMPLEMENTATION',
+ 'MOJO_SYSTEM_IMPLEMENTATION',
+ 'MOJO_USE_SYSTEM_IMPL',
+ ],
+ 'sources': [
+ 'embedder/channel_init.cc',
+ 'embedder/channel_init.h',
+ 'embedder/embedder.cc',
+ 'embedder/embedder.h',
+ 'embedder/platform_channel_pair.cc',
+ 'embedder/platform_channel_pair.h',
+ 'embedder/platform_channel_pair_posix.cc',
+ 'embedder/platform_channel_pair_win.cc',
+ 'embedder/platform_channel_utils_posix.cc',
+ 'embedder/platform_channel_utils_posix.h',
+ 'embedder/platform_handle.cc',
+ 'embedder/platform_handle.h',
+ 'embedder/platform_handle_utils.h',
+ 'embedder/platform_handle_utils_posix.cc',
+ 'embedder/platform_handle_utils_win.cc',
+ 'embedder/platform_handle_vector.h',
+ 'embedder/platform_shared_buffer.h',
+ 'embedder/platform_support.h',
+ 'embedder/scoped_platform_handle.h',
+ 'embedder/simple_platform_shared_buffer.cc',
+ 'embedder/simple_platform_shared_buffer.h',
+ 'embedder/simple_platform_shared_buffer_posix.cc',
+ 'embedder/simple_platform_shared_buffer_win.cc',
+ 'embedder/simple_platform_support.cc',
+ 'embedder/simple_platform_support.h',
+ 'system/channel.cc',
+ 'system/channel.h',
+ 'system/channel_endpoint.cc',
+ 'system/channel_endpoint.h',
+ 'system/channel_endpoint_id.h',
+ 'system/constants.h',
+ 'system/core.cc',
+ 'system/core.h',
+ 'system/data_pipe.cc',
+ 'system/data_pipe.h',
+ 'system/data_pipe_consumer_dispatcher.cc',
+ 'system/data_pipe_consumer_dispatcher.h',
+ 'system/data_pipe_producer_dispatcher.cc',
+ 'system/data_pipe_producer_dispatcher.h',
+ 'system/dispatcher.cc',
+ 'system/dispatcher.h',
+ 'system/entrypoints.cc',
+ 'system/handle_signals_state.h',
+ 'system/handle_table.cc',
+ 'system/handle_table.h',
+ 'system/local_data_pipe.cc',
+ 'system/local_data_pipe.h',
+ 'system/local_message_pipe_endpoint.cc',
+ 'system/local_message_pipe_endpoint.h',
+ 'system/mapping_table.cc',
+ 'system/mapping_table.h',
+ 'system/memory.cc',
+ 'system/memory.h',
+ 'system/message_in_transit.cc',
+ 'system/message_in_transit.h',
+ 'system/message_in_transit_queue.cc',
+ 'system/message_in_transit_queue.h',
+ 'system/message_pipe.cc',
+ 'system/message_pipe.h',
+ 'system/message_pipe_dispatcher.cc',
+ 'system/message_pipe_dispatcher.h',
+ 'system/message_pipe_endpoint.cc',
+ 'system/message_pipe_endpoint.h',
+ 'system/options_validation.h',
+ 'system/platform_handle_dispatcher.cc',
+ 'system/platform_handle_dispatcher.h',
+ 'system/proxy_message_pipe_endpoint.cc',
+ 'system/proxy_message_pipe_endpoint.h',
+ 'system/raw_channel.cc',
+ 'system/raw_channel.h',
+ 'system/raw_channel_posix.cc',
+ 'system/raw_channel_win.cc',
+ 'system/shared_buffer_dispatcher.cc',
+ 'system/shared_buffer_dispatcher.h',
+ 'system/simple_dispatcher.cc',
+ 'system/simple_dispatcher.h',
+ 'system/transport_data.cc',
+ 'system/transport_data.h',
+ 'system/waiter.cc',
+ 'system/waiter.h',
+ 'system/waiter_list.cc',
+ 'system/waiter_list.h',
+ # Test-only code:
+ # TODO(vtl): It's a little unfortunate that these end up in the same
+ # component as non-test-only code. In the static build, this code should
+ # hopefully be dead-stripped.
+ 'embedder/test_embedder.cc',
+ 'embedder/test_embedder.h',
+ ],
+ 'all_dependent_settings': {
+ # Ensures that dependent projects import the core functions on Windows.
+ 'defines': ['MOJO_USE_SYSTEM_IMPL'],
+ }
+ },
+ {
+ # GN version: //mojo/edk/system:mojo_system_unittests
+ 'target_name': 'mojo_system_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_common_test_support',
+ 'mojo_system_impl',
+ ],
+ 'sources': [
+ 'embedder/embedder_unittest.cc',
+ 'embedder/platform_channel_pair_posix_unittest.cc',
+ 'embedder/simple_platform_shared_buffer_unittest.cc',
+ 'system/channel_unittest.cc',
+ 'system/core_unittest.cc',
+ 'system/core_test_base.cc',
+ 'system/core_test_base.h',
+ 'system/data_pipe_unittest.cc',
+ 'system/dispatcher_unittest.cc',
+ 'system/local_data_pipe_unittest.cc',
+ 'system/memory_unittest.cc',
+ 'system/message_pipe_dispatcher_unittest.cc',
+ 'system/message_pipe_test_utils.h',
+ 'system/message_pipe_test_utils.cc',
+ 'system/message_pipe_unittest.cc',
+ 'system/multiprocess_message_pipe_unittest.cc',
+ 'system/options_validation_unittest.cc',
+ 'system/platform_handle_dispatcher_unittest.cc',
+ 'system/raw_channel_unittest.cc',
+ 'system/remote_message_pipe_unittest.cc',
+ 'system/run_all_unittests.cc',
+ 'system/shared_buffer_dispatcher_unittest.cc',
+ 'system/simple_dispatcher_unittest.cc',
+ 'system/test_utils.cc',
+ 'system/test_utils.h',
+ 'system/waiter_list_unittest.cc',
+ 'system/waiter_test_utils.cc',
+ 'system/waiter_test_utils.h',
+ 'system/waiter_unittest.cc',
+ ],
+ 'conditions': [
+ ['OS=="ios"', {
+ 'sources!': [
+ 'embedder/embedder_unittest.cc',
+ 'system/multiprocess_message_pipe_unittest.cc',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/edk/system:mojo_message_pipe_perftests
+ 'target_name': 'mojo_message_pipe_perftests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../base/base.gyp:test_support_base',
+ '../../base/base.gyp:test_support_perf',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_common_test_support',
+ 'mojo_system_impl',
+ ],
+ 'sources': [
+ 'system/message_pipe_perftest.cc',
+ 'system/message_pipe_test_utils.h',
+ 'system/message_pipe_test_utils.cc',
+ 'system/test_utils.cc',
+ 'system/test_utils.h',
+ ],
+ },
+ {
+ # GN version: //mojo/common/test:test_support_impl
+ 'target_name': 'mojo_test_support_impl',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ ],
+ 'sources': [
+ 'test/test_support_impl.cc',
+ 'test/test_support_impl.h',
+ ],
+ },
+ {
+ # GN version: //mojo/edk/test:test_support
+ 'target_name': 'mojo_common_test_support',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../base/base.gyp:test_support_base',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_system_impl',
+ ],
+ 'sources': [
+ 'test/multiprocess_test_helper.cc',
+ 'test/multiprocess_test_helper.h',
+ 'test/test_utils.h',
+ 'test/test_utils_posix.cc',
+ 'test/test_utils_win.cc',
+ ],
+ 'conditions': [
+ ['OS=="ios"', {
+ 'sources!': [
+ 'test/multiprocess_test_helper.cc',
+ ],
+ }],
+ ],
+ },
+ ],
+}
diff --git a/mojo/edk/system/BUILD.gn b/mojo/edk/system/BUILD.gn
index 549af7d..7baec81 100644
--- a/mojo/edk/system/BUILD.gn
+++ b/mojo/edk/system/BUILD.gn
@@ -30,6 +30,7 @@
"channel.h",
"channel_endpoint.cc",
"channel_endpoint.h",
+ "channel_endpoint_id.h",
"constants.h",
"core.cc",
"core.h",
@@ -85,7 +86,7 @@
]
}
-# GYP version: mojo/mojo_base.gyp:mojo_system_unittests
+# GYP version: mojo/edk/mojo_edk.gyp:mojo_system_unittests
test("mojo_system_unittests") {
deps = [
":system",
@@ -126,7 +127,7 @@
]
}
-# GYP version: mojo/mojo_base.gyp:mojo_message_pipe_perftests
+# GYP version: mojo/edk/mojo_edk.gyp:mojo_message_pipe_perftests
test("mojo_message_pipe_perftests") {
deps = [
":system",
diff --git a/mojo/edk/system/PRESUBMIT.py b/mojo/edk/system/PRESUBMIT.py
deleted file mode 100644
index 2827571..0000000
--- a/mojo/edk/system/PRESUBMIT.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Presubmit script for mojo/edk/system.
-
-See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
-for more details about the presubmit API built into depot_tools.
-"""
-
-def CheckChangeOnUpload(input_api, output_api):
- results = []
- results += input_api.canned_checks.CheckChangeHasOnlyOneEol(input_api,
- output_api)
- results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
- return results
diff --git a/mojo/edk/system/channel.cc b/mojo/edk/system/channel.cc
index 2cc99b6..50411b3 100644
--- a/mojo/edk/system/channel.cc
+++ b/mojo/edk/system/channel.cc
@@ -18,18 +18,10 @@
namespace mojo {
namespace system {
-static_assert(Channel::kBootstrapEndpointId !=
- MessageInTransit::kInvalidEndpointId,
- "kBootstrapEndpointId is invalid");
-
-STATIC_CONST_MEMBER_DEFINITION const MessageInTransit::EndpointId
- Channel::kBootstrapEndpointId;
-
Channel::Channel(embedder::PlatformSupport* platform_support)
: platform_support_(platform_support),
is_running_(false),
- is_shutting_down_(false),
- next_local_id_(kBootstrapEndpointId) {
+ is_shutting_down_(false) {
}
bool Channel::Init(scoped_ptr<RawChannel> raw_channel) {
@@ -73,13 +65,13 @@
for (IdToEndpointMap::iterator it = to_destroy.begin();
it != to_destroy.end();
++it) {
- if (it->second->state_ == ChannelEndpoint::STATE_NORMAL) {
- it->second->OnDisconnect();
+ if (it->second.get()) {
num_live++;
+ it->second->OnDisconnect();
+ it->second->DetachFromChannel();
} else {
num_zombies++;
}
- it->second->DetachFromChannel();
}
DVLOG_IF(2, num_live || num_zombies) << "Shut down Channel with " << num_live
<< " live endpoints and " << num_zombies
@@ -95,24 +87,21 @@
// keeps the endpoint alive even after the lock is released. Otherwise, there's
// the temptation to simply pass the result of |new ChannelEndpoint(...)|
// directly to this function, which wouldn't be sufficient for safety.
-MessageInTransit::EndpointId Channel::AttachEndpoint(
+ChannelEndpointId Channel::AttachEndpoint(
scoped_refptr<ChannelEndpoint> endpoint) {
DCHECK(endpoint.get());
- MessageInTransit::EndpointId local_id;
+ ChannelEndpointId local_id;
{
base::AutoLock locker(lock_);
DLOG_IF(WARNING, is_shutting_down_)
<< "AttachEndpoint() while shutting down";
- while (next_local_id_ == MessageInTransit::kInvalidEndpointId ||
- local_id_to_endpoint_map_.find(next_local_id_) !=
- local_id_to_endpoint_map_.end())
- next_local_id_++;
-
- local_id = next_local_id_;
- next_local_id_++;
+ do {
+ local_id = local_id_generator_.GetNext();
+ } while (local_id_to_endpoint_map_.find(local_id) !=
+ local_id_to_endpoint_map_.end());
local_id_to_endpoint_map_[local_id] = endpoint;
}
@@ -123,18 +112,12 @@
// TODO(vtl): This function is currently slightly absurd, but we'll eventually
// get rid of it and merge it with |AttachEndpoint()|.
void Channel::RunEndpoint(scoped_refptr<ChannelEndpoint> endpoint,
- MessageInTransit::EndpointId remote_id) {
+ ChannelEndpointId remote_id) {
{
base::AutoLock locker(lock_);
DLOG_IF(WARNING, is_shutting_down_)
<< "RunMessagePipeEndpoint() while shutting down";
-
- // Absurdity: |endpoint->state_| is protected by our lock.
- if (endpoint->state_ != ChannelEndpoint::STATE_NORMAL) {
- DVLOG(2) << "Ignoring run message pipe endpoint for zombie endpoint";
- return;
- }
}
// TODO(vtl): FIXME -- We need to handle the case that message pipe is already
@@ -142,9 +125,8 @@
endpoint->Run(remote_id);
}
-void Channel::RunRemoteMessagePipeEndpoint(
- MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id) {
+void Channel::RunRemoteMessagePipeEndpoint(ChannelEndpointId local_id,
+ ChannelEndpointId remote_id) {
#if DCHECK_IS_ON
{
base::AutoLock locker(lock_);
@@ -160,8 +142,8 @@
HandleLocalError(base::StringPrintf(
"Failed to send message to run remote message pipe endpoint (local ID "
"%u, remote ID %u)",
- static_cast<unsigned>(local_id),
- static_cast<unsigned>(remote_id)));
+ static_cast<unsigned>(local_id.value()),
+ static_cast<unsigned>(remote_id.value())));
}
}
@@ -185,42 +167,32 @@
return raw_channel_->IsWriteBufferEmpty();
}
-void Channel::DetachMessagePipeEndpoint(
- MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id) {
- DCHECK_NE(local_id, MessageInTransit::kInvalidEndpointId);
+void Channel::DetachEndpoint(ChannelEndpoint* endpoint,
+ ChannelEndpointId local_id,
+ ChannelEndpointId remote_id) {
+ DCHECK(endpoint);
+ DCHECK(local_id.is_valid());
- // If this is non-null after the locked block, the endpoint should be detached
- // (and no remove message sent).
- scoped_refptr<ChannelEndpoint> endpoint_to_detach;
+ if (!remote_id.is_valid())
+ return; // Nothing to do.
+
{
base::AutoLock locker_(lock_);
if (!is_running_)
return;
IdToEndpointMap::iterator it = local_id_to_endpoint_map_.find(local_id);
- DCHECK(it != local_id_to_endpoint_map_.end());
+ // We detach immediately if we receive a remove message, so it's possible
+ // that the local ID is no longer in |local_id_to_endpoint_map_|, or even
+ // that it's since been reused for another endpoint. In both cases, there's
+ // nothing more to do.
+ if (it == local_id_to_endpoint_map_.end() || it->second.get() != endpoint)
+ return;
- switch (it->second->state_) {
- case ChannelEndpoint::STATE_NORMAL:
- it->second->state_ = ChannelEndpoint::STATE_WAIT_REMOTE_REMOVE_ACK;
- if (remote_id == MessageInTransit::kInvalidEndpointId)
- return;
- // We have to send a remove message (outside the lock).
- break;
- case ChannelEndpoint::STATE_WAIT_LOCAL_DETACH:
- endpoint_to_detach = it->second;
- local_id_to_endpoint_map_.erase(it);
- // We have to detach (outside the lock).
- break;
- case ChannelEndpoint::STATE_WAIT_REMOTE_REMOVE_ACK:
- NOTREACHED();
- return;
- }
- }
- if (endpoint_to_detach.get()) {
- endpoint_to_detach->DetachFromChannel();
- return;
+ DCHECK(it->second.get());
+ it->second = nullptr;
+
+ // Send a remove message outside the lock.
}
if (!SendControlMessage(
@@ -230,8 +202,8 @@
HandleLocalError(base::StringPrintf(
"Failed to send message to remove remote message pipe endpoint (local "
"ID %u, remote ID %u)",
- static_cast<unsigned>(local_id),
- static_cast<unsigned>(remote_id)));
+ static_cast<unsigned>(local_id.value()),
+ static_cast<unsigned>(remote_id.value())));
}
}
@@ -303,14 +275,13 @@
DCHECK(message_view.type() == MessageInTransit::kTypeMessagePipeEndpoint ||
message_view.type() == MessageInTransit::kTypeMessagePipe);
- MessageInTransit::EndpointId local_id = message_view.destination_id();
- if (local_id == MessageInTransit::kInvalidEndpointId) {
+ ChannelEndpointId local_id = message_view.destination_id();
+ if (!local_id.is_valid()) {
HandleRemoteError("Received message with no destination ID");
return;
}
scoped_refptr<ChannelEndpoint> endpoint;
- ChannelEndpoint::State state = ChannelEndpoint::STATE_NORMAL;
{
base::AutoLock locker(lock_);
@@ -322,14 +293,21 @@
IdToEndpointMap::const_iterator it =
local_id_to_endpoint_map_.find(local_id);
if (it != local_id_to_endpoint_map_.end()) {
+ // Ignore messages for zombie endpoints (not an error).
+ if (!it->second.get()) {
+ DVLOG(2) << "Ignoring downstream message for zombie endpoint (local ID "
+ "= " << local_id
+ << ", remote ID = " << message_view.source_id() << ")";
+ return;
+ }
+
endpoint = it->second;
- state = it->second->state_;
}
}
if (!endpoint.get()) {
HandleRemoteError(base::StringPrintf(
"Received a message for nonexistent local destination ID %u",
- static_cast<unsigned>(local_id)));
+ static_cast<unsigned>(local_id.value())));
// This is strongly indicative of some problem. However, it's not a fatal
// error, since it may indicate a buggy (or hostile) remote process. Don't
// die even for Debug builds, since handling this properly needs to be
@@ -338,17 +316,10 @@
return;
}
- // Ignore messages for zombie endpoints (not an error).
- if (state != ChannelEndpoint::STATE_NORMAL) {
- DVLOG(2) << "Ignoring downstream message for zombie endpoint (local ID = "
- << local_id << ", remote ID = " << message_view.source_id() << ")";
- return;
- }
-
if (!endpoint->OnReadMessage(message_view, platform_handles.Pass())) {
HandleLocalError(
base::StringPrintf("Failed to enqueue message to local ID %u",
- static_cast<unsigned>(local_id)));
+ static_cast<unsigned>(local_id.value())));
return;
}
}
@@ -404,8 +375,8 @@
}
}
-bool Channel::OnRunMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id) {
+bool Channel::OnRunMessagePipeEndpoint(ChannelEndpointId local_id,
+ ChannelEndpointId remote_id) {
scoped_refptr<ChannelEndpoint> endpoint;
{
base::AutoLock locker(lock_);
@@ -421,9 +392,8 @@
return true;
}
-bool Channel::OnRemoveMessagePipeEndpoint(
- MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id) {
+bool Channel::OnRemoveMessagePipeEndpoint(ChannelEndpointId local_id,
+ ChannelEndpointId remote_id) {
DCHECK(creation_thread_checker_.CalledOnValidThread());
scoped_refptr<ChannelEndpoint> endpoint;
@@ -436,27 +406,18 @@
return false;
}
- switch (it->second->state_) {
- case ChannelEndpoint::STATE_NORMAL:
- // This is the normal case; we'll proceed on to "wait local detach".
- break;
-
- case ChannelEndpoint::STATE_WAIT_LOCAL_DETACH:
- // We can only be in this state because we got a "remove" already, so
- // getting another such message is invalid.
- DVLOG(2) << "Remove message pipe endpoint error: wrong state";
- return false;
-
- case ChannelEndpoint::STATE_WAIT_REMOTE_REMOVE_ACK:
- // Remove messages "crossed"; we have to wait for the ack.
- return true;
+ if (!it->second.get()) {
+ // Remove messages "crossed"; we have to wait for the ack.
+ return true;
}
- it->second->state_ = ChannelEndpoint::STATE_WAIT_LOCAL_DETACH;
endpoint = it->second;
- // Send the remove ack message outside the lock.
+ local_id_to_endpoint_map_.erase(it);
+ // Detach and send the remove ack message outside the lock.
}
+ endpoint->DetachFromChannel();
+
if (!SendControlMessage(
MessageInTransit::kSubtypeChannelRemoveMessagePipeEndpointAck,
local_id,
@@ -464,45 +425,37 @@
HandleLocalError(base::StringPrintf(
"Failed to send message to remove remote message pipe endpoint ack "
"(local ID %u, remote ID %u)",
- static_cast<unsigned>(local_id),
- static_cast<unsigned>(remote_id)));
+ static_cast<unsigned>(local_id.value()),
+ static_cast<unsigned>(remote_id.value())));
}
endpoint->OnDisconnect();
return true;
}
-bool Channel::OnRemoveMessagePipeEndpointAck(
- MessageInTransit::EndpointId local_id) {
+bool Channel::OnRemoveMessagePipeEndpointAck(ChannelEndpointId local_id) {
DCHECK(creation_thread_checker_.CalledOnValidThread());
- scoped_refptr<ChannelEndpoint> endpoint;
- {
- base::AutoLock locker(lock_);
+ base::AutoLock locker(lock_);
- IdToEndpointMap::iterator it = local_id_to_endpoint_map_.find(local_id);
- if (it == local_id_to_endpoint_map_.end()) {
- DVLOG(2) << "Remove message pipe endpoint ack error: not found";
- return false;
- }
-
- if (it->second->state_ != ChannelEndpoint::STATE_WAIT_REMOTE_REMOVE_ACK) {
- DVLOG(2) << "Remove message pipe endpoint ack error: wrong state";
- return false;
- }
-
- endpoint = it->second;
- local_id_to_endpoint_map_.erase(it);
- // Detach the endpoint outside the lock.
+ IdToEndpointMap::iterator it = local_id_to_endpoint_map_.find(local_id);
+ if (it == local_id_to_endpoint_map_.end()) {
+ DVLOG(2) << "Remove message pipe endpoint ack error: not found";
+ return false;
}
- endpoint->DetachFromChannel();
+ if (it->second.get()) {
+ DVLOG(2) << "Remove message pipe endpoint ack error: wrong state";
+ return false;
+ }
+
+ local_id_to_endpoint_map_.erase(it);
return true;
}
bool Channel::SendControlMessage(MessageInTransit::Subtype subtype,
- MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id) {
+ ChannelEndpointId local_id,
+ ChannelEndpointId remote_id) {
DVLOG(2) << "Sending channel control message: subtype " << subtype
<< ", local ID " << local_id << ", remote ID " << remote_id;
scoped_ptr<MessageInTransit> message(new MessageInTransit(
diff --git a/mojo/edk/system/channel.h b/mojo/edk/system/channel.h
index 7088cbd..5ece5da 100644
--- a/mojo/edk/system/channel.h
+++ b/mojo/edk/system/channel.h
@@ -7,7 +7,6 @@
#include <stdint.h>
-#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -17,6 +16,7 @@
#include "base/threading/thread_checker.h"
#include "mojo/edk/embedder/scoped_platform_handle.h"
#include "mojo/edk/system/channel_endpoint.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/system/message_pipe.h"
#include "mojo/edk/system/raw_channel.h"
@@ -51,9 +51,6 @@
: public base::RefCountedThreadSafe<Channel>,
public RawChannel::Delegate {
public:
- // The first message pipe endpoint attached will have this as its local ID.
- static const MessageInTransit::EndpointId kBootstrapEndpointId = 1;
-
// |platform_support| (typically owned by |Core|) must remain alive until
// after |Shutdown()| is called.
explicit Channel(embedder::PlatformSupport* platform_support);
@@ -76,20 +73,19 @@
// Attaches the given endpoint to this channel. This assigns it a local ID,
// which it returns. The first endpoint attached will always have
- // |kBootstrapEndpointId| as its local ID. (For bootstrapping, this occurs on
- // both sides, so one should use |kBootstrapEndpointId| for the remote ID for
- // the first message pipe across a channel.) Returns |kInvalidEndpointId| on
- // failure.
+ // |ChannelEndpointId::GetBootstrap()| as its local ID. (For bootstrapping,
+ // this occurs on both sides, so one should use that same bootstrap ID for the
+ // remote ID for the first message pipe across a channel.) Returns an invalid
+ // |ChannelEndpointId| on failure.
// TODO(vtl): This should be combined with "run", and it should take a
// |ChannelEndpoint| instead.
// TODO(vtl): Maybe limit the number of attached message pipes.
- MessageInTransit::EndpointId AttachEndpoint(
- scoped_refptr<ChannelEndpoint> endpoint);
+ ChannelEndpointId AttachEndpoint(scoped_refptr<ChannelEndpoint> endpoint);
// Runs the given endpoint (which must have been attached to this |Channel|,
// and not detached), assigning it the specified |remote_id|.
void RunEndpoint(scoped_refptr<ChannelEndpoint> endpoint,
- MessageInTransit::EndpointId remote_id);
+ ChannelEndpointId remote_id);
// Tells the other side of the channel to run a message pipe endpoint (which
// must already be attached); |local_id| and |remote_id| are relative to this
@@ -97,8 +93,8 @@
// its local ID).
// TODO(vtl): Maybe we should just have a flag argument to
// |RunMessagePipeEndpoint()| that tells it to do this.
- void RunRemoteMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id);
+ void RunRemoteMessagePipeEndpoint(ChannelEndpointId local_id,
+ ChannelEndpointId remote_id);
// This forwards |message| verbatim to |raw_channel_|.
bool WriteMessage(scoped_ptr<MessageInTransit> message);
@@ -108,12 +104,14 @@
// |FlushWriteBufferAndShutdown()| or something like that.
bool IsWriteBufferEmpty();
- // This removes the message pipe/port's endpoint (with the given local ID and
- // given remote ID, which should be |kInvalidEndpointId| if not yet running),
- // returned by |AttachEndpoint()| from this channel. After this is called,
- // |local_id| may be reused for another message pipe.
- void DetachMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id);
+ // This removes the given endpoint from this channel (|local_id| and
+ // |remote_id| are specified as an optimization; the latter should be an
+ // invalid |ChannelEndpointId| if the endpoint is not yet running). Note: If
+ // this is called, the |Channel| will *not* call
+ // |ChannelEndpoint::DetachFromChannel()|.
+ void DetachEndpoint(ChannelEndpoint* endpoint,
+ ChannelEndpointId local_id,
+ ChannelEndpointId remote_id);
// See |RawChannel::GetSerializedPlatformHandleSize()|.
size_t GetSerializedPlatformHandleSize() const;
@@ -141,13 +139,13 @@
embedder::ScopedPlatformHandleVectorPtr platform_handles);
// Handles "run message pipe endpoint" messages.
- bool OnRunMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id);
+ bool OnRunMessagePipeEndpoint(ChannelEndpointId local_id,
+ ChannelEndpointId remote_id);
// Handles "remove message pipe endpoint" messages.
- bool OnRemoveMessagePipeEndpoint(MessageInTransit::EndpointId local_id,
- MessageInTransit::EndpointId remote_id);
+ bool OnRemoveMessagePipeEndpoint(ChannelEndpointId local_id,
+ ChannelEndpointId remote_id);
// Handles "remove message pipe endpoint ack" messages.
- bool OnRemoveMessagePipeEndpointAck(MessageInTransit::EndpointId local_id);
+ bool OnRemoveMessagePipeEndpointAck(ChannelEndpointId local_id);
// Handles errors (e.g., invalid messages) from the remote side. Callable from
// any thread.
@@ -159,8 +157,8 @@
// Helper to send channel control messages. Returns true on success. Should be
// called *without* |lock_| held. Callable from any thread.
bool SendControlMessage(MessageInTransit::Subtype subtype,
- MessageInTransit::EndpointId source_id,
- MessageInTransit::EndpointId destination_id);
+ ChannelEndpointId source_id,
+ ChannelEndpointId destination_id);
base::ThreadChecker creation_thread_checker_;
@@ -177,12 +175,13 @@
// Set when |WillShutdownSoon()| is called.
bool is_shutting_down_;
- typedef base::hash_map<MessageInTransit::EndpointId,
- scoped_refptr<ChannelEndpoint>> IdToEndpointMap;
+ typedef base::hash_map<ChannelEndpointId, scoped_refptr<ChannelEndpoint>>
+ IdToEndpointMap;
+ // Map from local IDs to endpoints. If the endpoint is null, this means that
+ // we're just waiting for the remove ack before removing the entry.
IdToEndpointMap local_id_to_endpoint_map_;
- // The next local ID to try (when allocating new local IDs). Note: It should
- // be checked for existence before use.
- MessageInTransit::EndpointId next_local_id_;
+ // Note: The IDs generated by this should be checked for existence before use.
+ LocalChannelEndpointIdGenerator local_id_generator_;
DISALLOW_COPY_AND_ASSIGN(Channel);
};
diff --git a/mojo/edk/system/channel_endpoint.cc b/mojo/edk/system/channel_endpoint.cc
index 40cb184..6fa44f1 100644
--- a/mojo/edk/system/channel_endpoint.cc
+++ b/mojo/edk/system/channel_endpoint.cc
@@ -13,12 +13,7 @@
namespace system {
ChannelEndpoint::ChannelEndpoint(MessagePipe* message_pipe, unsigned port)
- : state_(STATE_NORMAL),
- message_pipe_(message_pipe),
- port_(port),
- channel_(),
- local_id_(MessageInTransit::kInvalidEndpointId),
- remote_id_(MessageInTransit::kInvalidEndpointId) {
+ : message_pipe_(message_pipe), port_(port), channel_(nullptr) {
DCHECK(message_pipe_.get());
DCHECK(port_ == 0 || port_ == 1);
}
@@ -33,7 +28,7 @@
base::AutoLock locker(lock_);
- if (!channel_ || remote_id_ == MessageInTransit::kInvalidEndpointId) {
+ if (!channel_ || !remote_id_.is_valid()) {
// We may reach here if we haven't been attached or run yet.
// TODO(vtl): We may also reach here if the channel is shut down early for
// some reason (with live message pipes on it). We can't check |state_| yet,
@@ -44,7 +39,7 @@
}
// TODO(vtl): Currently, this only works in the "running" case.
- DCHECK_NE(remote_id_, MessageInTransit::kInvalidEndpointId);
+ DCHECK(remote_id_.is_valid());
return WriteMessageNoLock(message.Pass());
}
@@ -53,7 +48,6 @@
// TODO(vtl): Once |message_pipe_| is under |lock_|, we should null it out
// here. For now, get the channel to do so for us.
- scoped_refptr<Channel> channel;
{
base::AutoLock locker(lock_);
DCHECK(message_pipe_.get());
@@ -61,34 +55,36 @@
if (!channel_)
return;
- DCHECK_NE(local_id_, MessageInTransit::kInvalidEndpointId);
+ DCHECK(local_id_.is_valid());
// TODO(vtl): Once we combine "run" into "attach", |remote_id_| should valid
// here as well.
- channel = channel_;
+ channel_->DetachEndpoint(this, local_id_, remote_id_);
+ channel_ = nullptr;
+ local_id_ = ChannelEndpointId();
+ remote_id_ = ChannelEndpointId();
}
- // Don't call this under |lock_|, since it'll call us back.
- // TODO(vtl): This seems pretty suboptimal.
- channel->DetachMessagePipeEndpoint(local_id_, remote_id_);
}
void ChannelEndpoint::AttachToChannel(Channel* channel,
- MessageInTransit::EndpointId local_id) {
+ ChannelEndpointId local_id) {
DCHECK(channel);
- DCHECK_NE(local_id, MessageInTransit::kInvalidEndpointId);
+ DCHECK(local_id.is_valid());
base::AutoLock locker(lock_);
DCHECK(!channel_);
- DCHECK_EQ(local_id_, MessageInTransit::kInvalidEndpointId);
+ DCHECK(!local_id_.is_valid());
channel_ = channel;
local_id_ = local_id;
}
-void ChannelEndpoint::Run(MessageInTransit::EndpointId remote_id) {
- DCHECK_NE(remote_id, MessageInTransit::kInvalidEndpointId);
+void ChannelEndpoint::Run(ChannelEndpointId remote_id) {
+ DCHECK(remote_id.is_valid());
base::AutoLock locker(lock_);
- DCHECK(channel_);
- DCHECK_EQ(remote_id_, MessageInTransit::kInvalidEndpointId);
+ if (!channel_)
+ return;
+
+ DCHECK(!remote_id_.is_valid());
remote_id_ = remote_id;
while (!paused_message_queue_.IsEmpty()) {
@@ -148,20 +144,25 @@
void ChannelEndpoint::DetachFromChannel() {
base::AutoLock locker(lock_);
- DCHECK(channel_);
- DCHECK_NE(local_id_, MessageInTransit::kInvalidEndpointId);
+ // This may already be null if we already detached from the channel in
+ // |DetachFromMessagePipe()| by calling |Channel::DetachEndpoint()| (and there
+ // are racing detaches).
+ if (!channel_)
+ return;
+
+ DCHECK(local_id_.is_valid());
// TODO(vtl): Once we combine "run" into "attach", |remote_id_| should valid
// here as well.
channel_ = nullptr;
- local_id_ = MessageInTransit::kInvalidEndpointId;
- remote_id_ = MessageInTransit::kInvalidEndpointId;
+ local_id_ = ChannelEndpointId();
+ remote_id_ = ChannelEndpointId();
}
ChannelEndpoint::~ChannelEndpoint() {
DCHECK(!message_pipe_.get());
DCHECK(!channel_);
- DCHECK_EQ(local_id_, MessageInTransit::kInvalidEndpointId);
- DCHECK_EQ(remote_id_, MessageInTransit::kInvalidEndpointId);
+ DCHECK(!local_id_.is_valid());
+ DCHECK(!remote_id_.is_valid());
}
bool ChannelEndpoint::WriteMessageNoLock(scoped_ptr<MessageInTransit> message) {
@@ -170,8 +171,8 @@
lock_.AssertAcquired();
DCHECK(channel_);
- DCHECK_NE(local_id_, MessageInTransit::kInvalidEndpointId);
- DCHECK_NE(remote_id_, MessageInTransit::kInvalidEndpointId);
+ DCHECK(local_id_.is_valid());
+ DCHECK(remote_id_.is_valid());
message->SerializeAndCloseDispatchers(channel_);
message->set_source_id(local_id_);
diff --git a/mojo/edk/system/channel_endpoint.h b/mojo/edk/system/channel_endpoint.h
index 0ba7aaf..cc5f736 100644
--- a/mojo/edk/system/channel_endpoint.h
+++ b/mojo/edk/system/channel_endpoint.h
@@ -10,7 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "mojo/edk/embedder/platform_handle_vector.h"
-#include "mojo/edk/system/message_in_transit.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/message_in_transit_queue.h"
#include "mojo/edk/system/system_impl_export.h"
@@ -18,6 +18,7 @@
namespace system {
class Channel;
+class MessageInTransit;
class MessagePipe;
// TODO(vtl): The plan:
@@ -131,10 +132,10 @@
// Methods called by |Channel|:
// Called by |Channel| when it takes a reference to this object.
- void AttachToChannel(Channel* channel, MessageInTransit::EndpointId local_id);
+ void AttachToChannel(Channel* channel, ChannelEndpointId local_id);
// TODO(vtl): Combine this with |AttachToChannel()|.
- void Run(MessageInTransit::EndpointId remote_id);
+ void Run(ChannelEndpointId remote_id);
// Called by |Channel| when it receives a message for the message pipe.
bool OnReadMessage(const MessageInTransit::View& message_view,
@@ -150,30 +151,12 @@
void DetachFromChannel();
private:
- enum State {
- // Attached, possibly running or not.
- STATE_NORMAL,
- // "Zombie" states:
- // Waiting for |DetachMessagePipeEndpoint()| before removing.
- STATE_WAIT_LOCAL_DETACH,
- // Waiting for a |kSubtypeChannelRemoveMessagePipeEndpointAck| before
- // removing.
- STATE_WAIT_REMOTE_REMOVE_ACK,
- };
-
- // TODO(vtl): This is totally temporary, until this becomes a proper
- // self-contained class. See the plan above.
- friend class Channel;
-
friend class base::RefCountedThreadSafe<ChannelEndpoint>;
~ChannelEndpoint();
// Must be called with |lock_| held.
bool WriteMessageNoLock(scoped_ptr<MessageInTransit> message);
- // TODO(vtl): Move these under lock.
- State state_;
-
// TODO(vtl): Move the things above under lock.
// Protects the members below.
base::Lock lock_;
@@ -194,8 +177,8 @@
// |channel_| must be valid whenever it is non-null. Before |*channel_| gives
// up its reference to this object, it must call |DetachFromChannel()|.
Channel* channel_;
- MessageInTransit::EndpointId local_id_;
- MessageInTransit::EndpointId remote_id_;
+ ChannelEndpointId local_id_;
+ ChannelEndpointId remote_id_;
// This queue is used before we're running on a channel and ready to send
// messages.
diff --git a/mojo/edk/system/channel_endpoint_id.h b/mojo/edk/system/channel_endpoint_id.h
new file mode 100644
index 0000000..fc1ad60
--- /dev/null
+++ b/mojo/edk/system/channel_endpoint_id.h
@@ -0,0 +1,124 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_ID_H_
+#define MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_ID_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include <ostream>
+
+#include "base/containers/hash_tables.h"
+#include "base/macros.h"
+#include "build/build_config.h"
+
+namespace mojo {
+namespace system {
+
+// ChannelEndpointId -----------------------------------------------------------
+
+class LocalChannelEndpointIdGenerator;
+
+// Represents an ID for an endpoint (i.e., one side of a message pipe) on a
+// |Channel|. This class must be POD.
+class ChannelEndpointId {
+ public:
+ ChannelEndpointId() : value_(0) {}
+ ChannelEndpointId(const ChannelEndpointId& other) : value_(other.value_) {}
+
+ // Returns the local ID to use for the first message pipe endpoint on a
+ // channel.
+ static ChannelEndpointId GetBootstrap() {
+ ChannelEndpointId rv;
+ rv.value_ = 1;
+ return rv;
+ }
+
+ bool operator==(const ChannelEndpointId& other) const {
+ return value_ == other.value_;
+ }
+ bool operator!=(const ChannelEndpointId& other) const {
+ return !operator==(other);
+ }
+ // So that we can be used in |std::map|, etc.
+ bool operator<(const ChannelEndpointId& other) const {
+ return value_ < other.value_;
+ }
+
+ bool is_valid() const { return !!value_; }
+ uint32_t value() const { return value_; }
+
+ private:
+ friend class LocalChannelEndpointIdGenerator;
+
+ uint32_t value_;
+
+ // Copying and assignment allowed.
+};
+// This wrapper should add no overhead.
+// TODO(vtl): Rewrite |sizeof(uint32_t)| as |sizeof(ChannelEndpointId::value)|
+// once we have sufficient C++11 support.
+static_assert(sizeof(ChannelEndpointId) == sizeof(uint32_t),
+ "ChannelEndpointId has incorrect size");
+
+// So logging macros and |DCHECK_EQ()|, etc. work.
+inline std::ostream& operator<<(std::ostream& out,
+ const ChannelEndpointId& channel_endpoint_id) {
+ return out << channel_endpoint_id.value();
+}
+
+// LocalChannelEndpointIdGenerator ---------------------------------------------
+
+// A simple generator for "new" local |ChannelEndpointId|s. It does not track
+// used/existing IDs; that must be done separately. (This class is not
+// thread-safe.)
+class LocalChannelEndpointIdGenerator {
+ public:
+ LocalChannelEndpointIdGenerator()
+ : next_channel_endpoint_id_(ChannelEndpointId::GetBootstrap()) {}
+
+ ChannelEndpointId GetNext() {
+ ChannelEndpointId rv = next_channel_endpoint_id_;
+ next_channel_endpoint_id_.value_++;
+ // Skip over the invalid value, in case we wrap.
+ if (!next_channel_endpoint_id_.is_valid())
+ next_channel_endpoint_id_.value_++;
+ return rv;
+ }
+
+ private:
+ ChannelEndpointId next_channel_endpoint_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(LocalChannelEndpointIdGenerator);
+};
+
+} // namespace system
+} // namespace mojo
+
+// Define "hash" functions for |ChannelEndpointId|s, so they can be used in hash
+// tables.
+// TODO(vtl): Once we can use |std::unordered_{map,set}|, update this (and
+// remove the base/containers/hash_tables.h and build/build_config.h includes).
+namespace BASE_HASH_NAMESPACE {
+
+#if defined(COMPILER_GCC)
+
+template <>
+struct hash<mojo::system::ChannelEndpointId> {
+ size_t operator()(mojo::system::ChannelEndpointId channel_endpoint_id) const {
+ return static_cast<size_t>(channel_endpoint_id.value());
+ }
+};
+
+#elif defined(COMPILER_MSVC)
+
+inline size_t hash_value(mojo::system::ChannelEndpointId channel_endpoint_id) {
+ return static_cast<size_t>(channel_endpoint_id.value());
+}
+#endif
+
+} // namespace BASE_HASH_NAMESPACE
+
+#endif // MOJO_EDK_SYSTEM_CHANNEL_ENDPOINT_ID_H_
diff --git a/mojo/edk/system/channel_unittest.cc b/mojo/edk/system/channel_unittest.cc
index 0c5d596..8ac23e1 100644
--- a/mojo/edk/system/channel_unittest.cc
+++ b/mojo/edk/system/channel_unittest.cc
@@ -11,7 +11,7 @@
#include "mojo/edk/embedder/platform_channel_pair.h"
#include "mojo/edk/embedder/simple_platform_support.h"
#include "mojo/edk/system/channel_endpoint.h"
-#include "mojo/edk/system/message_in_transit.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/message_pipe.h"
#include "mojo/edk/system/raw_channel.h"
#include "mojo/edk/system/test_utils.h"
@@ -198,9 +198,8 @@
scoped_refptr<MessagePipe> mp(
MessagePipe::CreateLocalProxy(&channel_endpoint));
- MessageInTransit::EndpointId local_id =
- channel()->AttachEndpoint(channel_endpoint);
- EXPECT_EQ(Channel::kBootstrapEndpointId, local_id);
+ ChannelEndpointId local_id = channel()->AttachEndpoint(channel_endpoint);
+ EXPECT_EQ(ChannelEndpointId::GetBootstrap(), local_id);
mp->Close(0);
@@ -210,7 +209,7 @@
// |AttachEndpoint()| to indicate whether |Run...()| will necessarily be
// called or not. (Then, in the case that it may not be called, this will
// return false.)
- channel()->RunEndpoint(channel_endpoint, Channel::kBootstrapEndpointId);
+ channel()->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
io_thread()->PostTaskAndWait(
FROM_HERE,
@@ -237,16 +236,15 @@
scoped_refptr<MessagePipe> mp(
MessagePipe::CreateLocalProxy(&channel_endpoint));
- MessageInTransit::EndpointId local_id =
- channel()->AttachEndpoint(channel_endpoint);
- EXPECT_EQ(Channel::kBootstrapEndpointId, local_id);
+ ChannelEndpointId local_id = channel()->AttachEndpoint(channel_endpoint);
+ EXPECT_EQ(ChannelEndpointId::GetBootstrap(), local_id);
// TODO(vtl): Currently, we always "expect" a |RunMessagePipeEndpoint()| after
// an |AttachEndpoint()| (which is actually incorrect). We need to refactor
// |AttachEndpoint()| to indicate whether |Run...()| will necessarily be
// called or not. (Then, in the case that it may not be called, we should test
// a |Shutdown()| without the |Run...()|.)
- channel()->RunEndpoint(channel_endpoint, Channel::kBootstrapEndpointId);
+ channel()->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
Waiter waiter;
waiter.Init();
@@ -289,11 +287,10 @@
scoped_refptr<MessagePipe> mp(
MessagePipe::CreateLocalProxy(&channel_endpoint));
- MessageInTransit::EndpointId local_id =
- channel()->AttachEndpoint(channel_endpoint);
- EXPECT_EQ(Channel::kBootstrapEndpointId, local_id);
+ ChannelEndpointId local_id = channel()->AttachEndpoint(channel_endpoint);
+ EXPECT_EQ(ChannelEndpointId::GetBootstrap(), local_id);
- channel()->RunEndpoint(channel_endpoint, Channel::kBootstrapEndpointId);
+ channel()->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
io_thread()->PostTaskAndWait(
FROM_HERE,
diff --git a/mojo/edk/system/data_pipe.cc b/mojo/edk/system/data_pipe.cc
index 3aca67a..ace5fd3 100644
--- a/mojo/edk/system/data_pipe.cc
+++ b/mojo/edk/system/data_pipe.cc
@@ -22,7 +22,8 @@
// static
const MojoCreateDataPipeOptions DataPipe::kDefaultCreateOptions = {
static_cast<uint32_t>(sizeof(MojoCreateDataPipeOptions)),
- MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE, 1u,
+ MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
+ 1u,
static_cast<uint32_t>(kDefaultDataPipeCapacityBytes)};
// static
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h
index 3e2230a..8d3edd4 100644
--- a/mojo/edk/system/dispatcher.h
+++ b/mojo/edk/system/dispatcher.h
@@ -226,7 +226,7 @@
virtual void CancelAllWaitersNoLock();
virtual void CloseImplNoLock();
virtual scoped_refptr<Dispatcher>
- CreateEquivalentDispatcherAndCloseImplNoLock() = 0;
+ CreateEquivalentDispatcherAndCloseImplNoLock() = 0;
// These are to be overridden by subclasses (if necessary). They are never
// called after the dispatcher has been closed. They are called under |lock_|.
diff --git a/mojo/edk/system/memory.cc b/mojo/edk/system/memory.cc
index 606c08f..1d7f792 100644
--- a/mojo/edk/system/memory.cc
+++ b/mojo/edk/system/memory.cc
@@ -40,7 +40,7 @@
template <size_t size, size_t alignment>
void MOJO_SYSTEM_IMPL_EXPORT
-CheckUserPointerWithCount(const void* pointer, size_t count) {
+ CheckUserPointerWithCount(const void* pointer, size_t count) {
CHECK_LE(count, std::numeric_limits<size_t>::max() / size);
CHECK(count == 0 || (pointer && IsAligned<alignment>(pointer)));
}
@@ -75,7 +75,7 @@
#if defined(COMPILER_MSVC) && defined(ARCH_CPU_32_BITS)
template <>
void MOJO_SYSTEM_IMPL_EXPORT
-CheckUserPointerWithSize<8>(const void* pointer, size_t size) {
+ CheckUserPointerWithSize<8>(const void* pointer, size_t size) {
CHECK(size == 0 ||
(!!pointer && reinterpret_cast<uintptr_t>(pointer) % 8 == 0));
}
diff --git a/mojo/edk/system/message_in_transit.cc b/mojo/edk/system/message_in_transit.cc
index f1fb91d..eb68664 100644
--- a/mojo/edk/system/message_in_transit.cc
+++ b/mojo/edk/system/message_in_transit.cc
@@ -32,8 +32,6 @@
MessageInTransit::kSubtypeChannelRemoveMessagePipeEndpointAck;
STATIC_CONST_MEMBER_DEFINITION const MessageInTransit::Subtype
MessageInTransit::kSubtypeRawChannelPosixExtraPlatformHandles;
-STATIC_CONST_MEMBER_DEFINITION const MessageInTransit::EndpointId
- MessageInTransit::kInvalidEndpointId;
STATIC_CONST_MEMBER_DEFINITION const size_t MessageInTransit::kMessageAlignment;
struct MessageInTransit::PrivateStructForCompileAsserts {
@@ -202,8 +200,8 @@
// |total_size| is updated below, from the other values.
header()->type = type;
header()->subtype = subtype;
- header()->source_id = kInvalidEndpointId;
- header()->destination_id = kInvalidEndpointId;
+ header()->source_id = ChannelEndpointId();
+ header()->destination_id = ChannelEndpointId();
header()->num_bytes = num_bytes;
header()->unused = 0;
// Note: If dispatchers are subsequently attached, then |total_size| will have
diff --git a/mojo/edk/system/message_in_transit.h b/mojo/edk/system/message_in_transit.h
index 7714fa7..06b4f6c 100644
--- a/mojo/edk/system/message_in_transit.h
+++ b/mojo/edk/system/message_in_transit.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/aligned_memory.h"
#include "base/memory/scoped_ptr.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/dispatcher.h"
#include "mojo/edk/system/memory.h"
#include "mojo/edk/system/system_impl_export.h"
@@ -64,10 +65,6 @@
// Subtypes for type |kTypeRawChannel|:
static const Subtype kSubtypeRawChannelPosixExtraPlatformHandles = 0;
- typedef uint32_t EndpointId;
- // Never a valid endpoint ID.
- static const EndpointId kInvalidEndpointId = 0;
-
// Messages (the header and data) must always be aligned to a multiple of this
// quantity (which must be a power of 2).
static const size_t kMessageAlignment = 8;
@@ -118,8 +115,10 @@
}
Type type() const { return header()->type; }
Subtype subtype() const { return header()->subtype; }
- EndpointId source_id() const { return header()->source_id; }
- EndpointId destination_id() const { return header()->destination_id; }
+ ChannelEndpointId source_id() const { return header()->source_id; }
+ ChannelEndpointId destination_id() const {
+ return header()->destination_id;
+ }
private:
const Header* header() const { return static_cast<const Header*>(buffer_); }
@@ -194,11 +193,13 @@
Type type() const { return header()->type; }
Subtype subtype() const { return header()->subtype; }
- EndpointId source_id() const { return header()->source_id; }
- EndpointId destination_id() const { return header()->destination_id; }
+ ChannelEndpointId source_id() const { return header()->source_id; }
+ ChannelEndpointId destination_id() const { return header()->destination_id; }
- void set_source_id(EndpointId source_id) { header()->source_id = source_id; }
- void set_destination_id(EndpointId destination_id) {
+ void set_source_id(ChannelEndpointId source_id) {
+ header()->source_id = source_id;
+ }
+ void set_destination_id(ChannelEndpointId destination_id) {
header()->destination_id = destination_id;
}
@@ -230,10 +231,10 @@
// correct value if dispatchers are attached but
// |SerializeAndCloseDispatchers()| has not been called.
uint32_t total_size;
- Type type; // 2 bytes.
- Subtype subtype; // 2 bytes.
- EndpointId source_id; // 4 bytes.
- EndpointId destination_id; // 4 bytes.
+ Type type; // 2 bytes.
+ Subtype subtype; // 2 bytes.
+ ChannelEndpointId source_id; // 4 bytes.
+ ChannelEndpointId destination_id; // 4 bytes.
// Size of actual message data.
uint32_t num_bytes;
uint32_t unused;
diff --git a/mojo/edk/system/message_pipe_dispatcher.cc b/mojo/edk/system/message_pipe_dispatcher.cc
index 2b3f028..4234eba 100644
--- a/mojo/edk/system/message_pipe_dispatcher.cc
+++ b/mojo/edk/system/message_pipe_dispatcher.cc
@@ -7,10 +7,10 @@
#include "base/logging.h"
#include "mojo/edk/system/channel.h"
#include "mojo/edk/system/channel_endpoint.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/constants.h"
#include "mojo/edk/system/local_message_pipe_endpoint.h"
#include "mojo/edk/system/memory.h"
-#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/system/message_pipe.h"
#include "mojo/edk/system/options_validation.h"
#include "mojo/edk/system/proxy_message_pipe_endpoint.h"
@@ -23,7 +23,7 @@
const unsigned kInvalidPort = static_cast<unsigned>(-1);
struct SerializedMessagePipeDispatcher {
- MessageInTransit::EndpointId endpoint_id;
+ ChannelEndpointId endpoint_id;
};
} // namespace
@@ -108,9 +108,9 @@
scoped_refptr<MessagePipeDispatcher> dispatcher =
CreateRemoteMessagePipe(&channel_endpoint);
- MessageInTransit::EndpointId remote_id =
+ ChannelEndpointId remote_id =
static_cast<const SerializedMessagePipeDispatcher*>(source)->endpoint_id;
- if (remote_id == MessageInTransit::kInvalidEndpointId) {
+ if (!remote_id.is_valid()) {
// This means that the other end was closed, and there were no messages
// enqueued for us.
// TODO(vtl): This is wrong. We should produce a "dead" message pipe
@@ -118,9 +118,8 @@
NOTIMPLEMENTED();
return scoped_refptr<MessagePipeDispatcher>();
}
- MessageInTransit::EndpointId local_id =
- channel->AttachEndpoint(channel_endpoint);
- if (local_id == MessageInTransit::kInvalidEndpointId) {
+ ChannelEndpointId local_id = channel->AttachEndpoint(channel_endpoint);
+ if (!local_id.is_valid()) {
LOG(ERROR) << "Failed to deserialize message pipe dispatcher (failed to "
"attach; remote ID = " << remote_id << ")";
return scoped_refptr<MessagePipeDispatcher>();
@@ -246,13 +245,13 @@
// Convert the local endpoint to a proxy endpoint (moving the message queue)
// and attach it to the channel.
- MessageInTransit::EndpointId endpoint_id =
+ ChannelEndpointId endpoint_id =
channel->AttachEndpoint(message_pipe_->ConvertLocalToProxy(port_));
- // Note: It's okay to get an endpoint ID of |kInvalidEndpointId|. (It's
- // possible that the other endpoint -- the one that we're not sending -- was
- // closed in the intervening time.) In that case, we need to deserialize a
- // "dead" message pipe dispatcher on the other end. (Note that this is
- // different from just producing |MOJO_HANDLE_INVALID|.)
+ // Note: It's okay to get an invalid endpoint ID. (It's possible that the
+ // other endpoint -- the one that we're not sending -- was closed in the
+ // intervening time.) In that case, we need to deserialize a "dead" message
+ // pipe dispatcher on the other end. (Note that this is different from just
+ // producing |MOJO_HANDLE_INVALID|.)
DVLOG(2) << "Serializing message pipe dispatcher (local ID = " << endpoint_id
<< ")";
diff --git a/mojo/edk/system/message_pipe_test_utils.cc b/mojo/edk/system/message_pipe_test_utils.cc
index b600945..879a6da 100644
--- a/mojo/edk/system/message_pipe_test_utils.cc
+++ b/mojo/edk/system/message_pipe_test_utils.cc
@@ -86,8 +86,8 @@
// the IO thread message loop, and that message loop runs) before the
// message pipe endpoint is attached.
CHECK_EQ(channel_->AttachEndpoint(channel_endpoint),
- Channel::kBootstrapEndpointId);
- channel_->RunEndpoint(channel_endpoint, Channel::kBootstrapEndpointId);
+ ChannelEndpointId::GetBootstrap());
+ channel_->RunEndpoint(channel_endpoint, ChannelEndpointId::GetBootstrap());
}
void ChannelThread::ShutdownChannelOnIOThread() {
diff --git a/mojo/edk/system/options_validation_unittest.cc b/mojo/edk/system/options_validation_unittest.cc
index f410f24..89c4e60 100644
--- a/mojo/edk/system/options_validation_unittest.cc
+++ b/mojo/edk/system/options_validation_unittest.cc
@@ -18,14 +18,14 @@
typedef uint32_t TestOptionsFlags;
-MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment);
+static_assert(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
struct MOJO_ALIGNAS(8) TestOptions {
uint32_t struct_size;
TestOptionsFlags flags;
uint32_t member1;
uint32_t member2;
};
-MOJO_COMPILE_ASSERT(sizeof(TestOptions) == 16, TestOptions_has_wrong_size);
+static_assert(sizeof(TestOptions) == 16, "TestOptions has wrong size");
const uint32_t kSizeOfTestOptions = static_cast<uint32_t>(sizeof(TestOptions));
diff --git a/mojo/edk/system/remote_message_pipe_unittest.cc b/mojo/edk/system/remote_message_pipe_unittest.cc
index 942d496..0193393 100644
--- a/mojo/edk/system/remote_message_pipe_unittest.cc
+++ b/mojo/edk/system/remote_message_pipe_unittest.cc
@@ -26,6 +26,7 @@
#include "mojo/edk/embedder/simple_platform_support.h"
#include "mojo/edk/system/channel.h"
#include "mojo/edk/system/channel_endpoint.h"
+#include "mojo/edk/system/channel_endpoint_id.h"
#include "mojo/edk/system/message_pipe.h"
#include "mojo/edk/system/message_pipe_dispatcher.h"
#include "mojo/edk/system/platform_handle_dispatcher.h"
@@ -73,8 +74,8 @@
// This bootstraps |ep| on |channels_[channel_index]|. It assumes/requires
// that this is the bootstrap case, i.e., that the endpoint IDs are both/will
- // both be |Channel::kBootstrapEndpointId|. This returns *without* waiting for
- // it to finish connecting.
+ // both be |ChannelEndpointId::GetBootstrap()|. This returns *without* waiting
+ // for it to finish connecting.
void BootstrapChannelEndpointNoWait(unsigned channel_index,
scoped_refptr<ChannelEndpoint> ep) {
io_thread_.PostTask(
@@ -136,8 +137,8 @@
if (!channels_[1].get())
CreateAndInitChannel(1);
- MessageInTransit::EndpointId local_id0 = channels_[0]->AttachEndpoint(ep0);
- MessageInTransit::EndpointId local_id1 = channels_[1]->AttachEndpoint(ep1);
+ ChannelEndpointId local_id0 = channels_[0]->AttachEndpoint(ep0);
+ ChannelEndpointId local_id1 = channels_[1]->AttachEndpoint(ep1);
channels_[0]->RunEndpoint(ep0, local_id1);
channels_[1]->RunEndpoint(ep1, local_id0);
@@ -149,13 +150,14 @@
CHECK(channel_index == 0 || channel_index == 1);
CreateAndInitChannel(channel_index);
- MessageInTransit::EndpointId endpoint_id =
+ ChannelEndpointId endpoint_id =
channels_[channel_index]->AttachEndpoint(ep);
- if (endpoint_id == MessageInTransit::kInvalidEndpointId)
+ if (!endpoint_id.is_valid())
return;
- CHECK_EQ(endpoint_id, Channel::kBootstrapEndpointId);
- channels_[channel_index]->RunEndpoint(ep, Channel::kBootstrapEndpointId);
+ CHECK_EQ(endpoint_id, ChannelEndpointId::GetBootstrap());
+ channels_[channel_index]->RunEndpoint(ep,
+ ChannelEndpointId::GetBootstrap());
}
void RestoreInitialStateOnIOThread() {
diff --git a/mojo/edk/test/BUILD.gn b/mojo/edk/test/BUILD.gn
index 6a6f312..e5d53b5 100644
--- a/mojo/edk/test/BUILD.gn
+++ b/mojo/edk/test/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_base.gyp:mojo_common_test_support
+# GYP version: mojo/edk/mojo_edk.gyp:mojo_common_test_support
source_set("test_support") {
testonly = true
sources = [
@@ -20,3 +20,46 @@
"//testing/gtest",
]
}
+
+# GYP version: mojo/edk/mojo_edk.gyp:mojo_run_all_unittests
+source_set("run_all_unittests") {
+ testonly = true
+ deps = [
+ ":test_support_impl",
+ "//base",
+ "//base/test:test_support",
+ "//mojo/edk/system",
+ "//mojo/public/c/test_support",
+ "//testing/gtest",
+ ]
+
+ sources = [ "run_all_unittests.cc" ]
+}
+
+# GYP version: mojo/edk/mojo_edk.gyp:mojo_run_all_perftests
+source_set("run_all_perftests") {
+ testonly = true
+ deps = [
+ ":test_support_impl",
+ "//base",
+ "//base/test:test_support",
+ "//mojo/edk/system",
+ "//mojo/public/c/test_support",
+ ]
+
+ sources = [ "run_all_perftests.cc" ]
+}
+
+
+# GYP version: mojo/edk/mojo_edk.gyp:mojo_test_support_impl
+source_set("test_support_impl") {
+ testonly = true
+ deps = [
+ "//base",
+ ]
+
+ sources = [
+ "test_support_impl.cc",
+ "test_support_impl.h",
+ ]
+}
diff --git a/mojo/edk/test/multiprocess_test_helper.h b/mojo/edk/test/multiprocess_test_helper.h
index ea77544..6b2713f 100644
--- a/mojo/edk/test/multiprocess_test_helper.h
+++ b/mojo/edk/test/multiprocess_test_helper.h
@@ -68,22 +68,24 @@
// |MultiprocessTestHelper|. It returns an |int|, which will be the process's
// exit code (but see the comment about |WaitForChildShutdown()|).
#define MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) \
- MULTIPROCESS_TEST_MAIN_WITH_SETUP( \
- test_child_name ## TestChildMain, \
- ::mojo::test::MultiprocessTestHelper::ChildSetup)
+ MULTIPROCESS_TEST_MAIN_WITH_SETUP( \
+ test_child_name##TestChildMain, \
+ ::mojo::test::MultiprocessTestHelper::ChildSetup)
// Use this (and |WaitForChildTestShutdown()|) for the child process's "main()",
// if you want to use |EXPECT_...()| or |ASSERT_...()|; it has a |void| return
// type. (Note that while an |ASSERT_...()| failure will abort the test in the
// child, it will not abort the test in the parent.)
#define MOJO_MULTIPROCESS_TEST_CHILD_TEST(test_child_name) \
- void test_child_name ## TestChildTest(); \
- MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \
- test_child_name ## TestChildTest(); \
- return (::testing::Test::HasFatalFailure() || \
- ::testing::Test::HasNonfatalFailure()) ? 1 : 0; \
- } \
- void test_child_name ## TestChildTest()
+ void test_child_name##TestChildTest(); \
+ MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \
+ test_child_name##TestChildTest(); \
+ return (::testing::Test::HasFatalFailure() || \
+ ::testing::Test::HasNonfatalFailure()) \
+ ? 1 \
+ : 0; \
+ } \
+ void test_child_name##TestChildTest()
} // namespace test
} // namespace mojo
diff --git a/mojo/edk/test/multiprocess_test_helper_unittest.cc b/mojo/edk/test/multiprocess_test_helper_unittest.cc
index ec2ba22..2961a74 100644
--- a/mojo/edk/test/multiprocess_test_helper_unittest.cc
+++ b/mojo/edk/test/multiprocess_test_helper_unittest.cc
@@ -118,8 +118,8 @@
MOJO_MULTIPROCESS_TEST_CHILD_TEST(ChildTestPasses) {
ASSERT_TRUE(MultiprocessTestHelper::client_platform_handle.is_valid());
- EXPECT_TRUE(IsNonBlocking(
- MultiprocessTestHelper::client_platform_handle.get()));
+ EXPECT_TRUE(
+ IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get()));
}
TEST_F(MultiprocessTestHelperTest, ChildTestFailsAssert) {
@@ -132,8 +132,9 @@
MOJO_MULTIPROCESS_TEST_CHILD_TEST(ChildTestFailsAssert) {
ASSERT_FALSE(MultiprocessTestHelper::client_platform_handle.is_valid())
<< "DISREGARD: Expected failure in child process";
- ASSERT_FALSE(IsNonBlocking(
- MultiprocessTestHelper::client_platform_handle.get())) << "Not reached";
+ ASSERT_FALSE(
+ IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get()))
+ << "Not reached";
CHECK(false) << "Not reached";
}
@@ -147,8 +148,8 @@
MOJO_MULTIPROCESS_TEST_CHILD_TEST(ChildTestFailsExpect) {
EXPECT_FALSE(MultiprocessTestHelper::client_platform_handle.is_valid())
<< "DISREGARD: Expected failure #1 in child process";
- EXPECT_FALSE(IsNonBlocking(
- MultiprocessTestHelper::client_platform_handle.get()))
+ EXPECT_FALSE(
+ IsNonBlocking(MultiprocessTestHelper::client_platform_handle.get()))
<< "DISREGARD: Expected failure #2 in child process";
}
diff --git a/mojo/common/test/run_all_perftests.cc b/mojo/edk/test/run_all_perftests.cc
similarity index 91%
rename from mojo/common/test/run_all_perftests.cc
rename to mojo/edk/test/run_all_perftests.cc
index e3f41aa..f0eacc6 100644
--- a/mojo/common/test/run_all_perftests.cc
+++ b/mojo/edk/test/run_all_perftests.cc
@@ -3,8 +3,8 @@
// found in the LICENSE file.
#include "base/test/perf_test_suite.h"
-#include "mojo/common/test/test_support_impl.h"
#include "mojo/edk/embedder/test_embedder.h"
+#include "mojo/edk/test/test_support_impl.h"
#include "mojo/public/tests/test_support_private.h"
int main(int argc, char** argv) {
diff --git a/mojo/common/test/run_all_unittests.cc b/mojo/edk/test/run_all_unittests.cc
similarity index 83%
rename from mojo/common/test/run_all_unittests.cc
rename to mojo/edk/test/run_all_unittests.cc
index 48c054e..c66ea50 100644
--- a/mojo/common/test/run_all_unittests.cc
+++ b/mojo/edk/test/run_all_unittests.cc
@@ -5,8 +5,8 @@
#include "base/bind.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
-#include "mojo/common/test/test_support_impl.h"
#include "mojo/edk/embedder/test_embedder.h"
+#include "mojo/edk/test/test_support_impl.h"
#include "mojo/public/tests/test_support_private.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -21,6 +21,7 @@
mojo::test::TestSupport::Init(new mojo::test::TestSupportImpl());
return base::LaunchUnitTests(
- argc, argv, base::Bind(&base::TestSuite::Run,
- base::Unretained(&test_suite)));
+ argc,
+ argv,
+ base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
}
diff --git a/mojo/common/test/test_support_impl.cc b/mojo/edk/test/test_support_impl.cc
similarity index 95%
rename from mojo/common/test/test_support_impl.cc
rename to mojo/edk/test/test_support_impl.cc
index 89e6de1..2a86331 100644
--- a/mojo/common/test/test_support_impl.cc
+++ b/mojo/edk/test/test_support_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/common/test/test_support_impl.h"
+#include "mojo/edk/test/test_support_impl.h"
#include <stdlib.h>
#include <string.h>
@@ -56,7 +56,8 @@
char** TestSupportImpl::EnumerateSourceRootRelativeDirectory(
const char* relative_path) {
std::vector<std::string> names;
- base::FileEnumerator e(ResolveSourceRootRelativePath(relative_path), false,
+ base::FileEnumerator e(ResolveSourceRootRelativePath(relative_path),
+ false,
base::FileEnumerator::FILES);
for (base::FilePath name = e.Next(); !name.empty(); name = e.Next())
names.push_back(name.BaseName().AsUTF8Unsafe());
diff --git a/mojo/common/test/test_support_impl.h b/mojo/edk/test/test_support_impl.h
similarity index 75%
rename from mojo/common/test/test_support_impl.h
rename to mojo/edk/test/test_support_impl.h
index 9f69bfe..8cc9de6 100644
--- a/mojo/common/test/test_support_impl.h
+++ b/mojo/edk/test/test_support_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_COMMON_TEST_TEST_SUPPORT_IMPL_H_
-#define MOJO_COMMON_TEST_TEST_SUPPORT_IMPL_H_
+#ifndef MOJO_EDK_TEST_TEST_SUPPORT_IMPL_H_
+#define MOJO_EDK_TEST_TEST_SUPPORT_IMPL_H_
#include "base/macros.h"
#include "mojo/public/tests/test_support_private.h"
@@ -20,8 +20,8 @@
double value,
const char* units) override;
virtual FILE* OpenSourceRootRelativeFile(const char* relative_path) override;
- virtual char** EnumerateSourceRootRelativeDirectory(const char* relative_path)
- override;
+ virtual char** EnumerateSourceRootRelativeDirectory(
+ const char* relative_path) override;
private:
DISALLOW_COPY_AND_ASSIGN(TestSupportImpl);
@@ -30,4 +30,4 @@
} // namespace test
} // namespace mojo
-#endif // MOJO_COMMON_TEST_TEST_SUPPORT_IMPL_H_
+#endif // MOJO_EDK_TEST_TEST_SUPPORT_IMPL_H_
diff --git a/mojo/edk/test/test_utils_win.cc b/mojo/edk/test/test_utils_win.cc
index 42613a6..5d5b942 100644
--- a/mojo/edk/test/test_utils_win.cc
+++ b/mojo/edk/test/test_utils_win.cc
@@ -20,14 +20,17 @@
const void* buffer,
size_t bytes_to_write,
size_t* bytes_written) {
- OVERLAPPED overlapped = { 0 };
+ OVERLAPPED overlapped = {0};
DWORD bytes_written_dword = 0;
- if (!WriteFile(handle.handle, buffer, static_cast<DWORD>(bytes_to_write),
- &bytes_written_dword, &overlapped)) {
+ if (!WriteFile(handle.handle,
+ buffer,
+ static_cast<DWORD>(bytes_to_write),
+ &bytes_written_dword,
+ &overlapped)) {
if (GetLastError() != ERROR_IO_PENDING ||
- !GetOverlappedResult(handle.handle, &overlapped, &bytes_written_dword,
- TRUE)) {
+ !GetOverlappedResult(
+ handle.handle, &overlapped, &bytes_written_dword, TRUE)) {
return false;
}
}
@@ -40,14 +43,17 @@
void* buffer,
size_t buffer_size,
size_t* bytes_read) {
- OVERLAPPED overlapped = { 0 };
+ OVERLAPPED overlapped = {0};
DWORD bytes_read_dword = 0;
- if (!ReadFile(handle.handle, buffer, static_cast<DWORD>(buffer_size),
- &bytes_read_dword, &overlapped)) {
+ if (!ReadFile(handle.handle,
+ buffer,
+ static_cast<DWORD>(buffer_size),
+ &bytes_read_dword,
+ &overlapped)) {
if (GetLastError() != ERROR_IO_PENDING ||
- !GetOverlappedResult(handle.handle, &overlapped, &bytes_read_dword,
- TRUE)) {
+ !GetOverlappedResult(
+ handle.handle, &overlapped, &bytes_read_dword, TRUE)) {
return false;
}
}
@@ -60,18 +66,21 @@
void* buffer,
size_t buffer_size,
size_t* bytes_read) {
- OVERLAPPED overlapped = { 0 };
+ OVERLAPPED overlapped = {0};
DWORD bytes_read_dword = 0;
- if (!ReadFile(handle.handle, buffer, static_cast<DWORD>(buffer_size),
- &bytes_read_dword, &overlapped)) {
+ if (!ReadFile(handle.handle,
+ buffer,
+ static_cast<DWORD>(buffer_size),
+ &bytes_read_dword,
+ &overlapped)) {
if (GetLastError() != ERROR_IO_PENDING)
return false;
CancelIo(handle.handle);
- if (!GetOverlappedResult(handle.handle, &overlapped, &bytes_read_dword,
- TRUE)) {
+ if (!GetOverlappedResult(
+ handle.handle, &overlapped, &bytes_read_dword, TRUE)) {
*bytes_read = 0;
return true;
}
@@ -92,7 +101,8 @@
&rv,
0,
TRUE,
- DUPLICATE_SAME_ACCESS)) << "DuplicateHandle";
+ DUPLICATE_SAME_ACCESS))
+ << "DuplicateHandle";
return embedder::ScopedPlatformHandle(embedder::PlatformHandle(rv));
}
@@ -108,10 +118,9 @@
flags |= _O_RDONLY;
if (strchr(mode, 't'))
flags |= _O_TEXT;
- base::ScopedFILE rv(
- _fdopen(_open_osfhandle(reinterpret_cast<intptr_t>(h.release().handle),
- flags),
- mode));
+ base::ScopedFILE rv(_fdopen(
+ _open_osfhandle(reinterpret_cast<intptr_t>(h.release().handle), flags),
+ mode));
PCHECK(rv) << "_fdopen";
return rv.Pass();
}
diff --git a/mojo/examples/BUILD.gn b/mojo/examples/BUILD.gn
index 7708161..bb42f4d 100644
--- a/mojo/examples/BUILD.gn
+++ b/mojo/examples/BUILD.gn
@@ -12,6 +12,7 @@
"//mojo/examples/compositor_app",
"//mojo/examples/content_handler_demo",
"//mojo/examples/echo",
+ "//mojo/examples/pepper_container_app",
"//mojo/examples/png_viewer",
"//mojo/examples/sample_app",
"//mojo/examples/surfaces_app",
diff --git a/mojo/examples/apptest/example_apptest.cc b/mojo/examples/apptest/example_apptest.cc
index ca3fda8..cd1c7d8 100644
--- a/mojo/examples/apptest/example_apptest.cc
+++ b/mojo/examples/apptest/example_apptest.cc
@@ -6,7 +6,6 @@
#include "mojo/examples/apptest/example_client_impl.h"
#include "mojo/examples/apptest/example_service.mojom.h"
#include "mojo/public/c/system/main.h"
-#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/bindings/callback.h"
#include "mojo/public/cpp/environment/environment.h"
@@ -25,28 +24,37 @@
namespace {
-class ExampleServiceTest : public testing::Test {
+class ExampleApptest : public testing::Test {
public:
- ExampleServiceTest() {
+ ExampleApptest() {
g_application_impl_hack->ConnectToService("mojo:mojo_example_service",
&example_service_);
example_service_.set_client(&example_client_);
}
- virtual ~ExampleServiceTest() override {}
+ virtual ~ExampleApptest() override {}
protected:
ExampleServicePtr example_service_;
ExampleClientImpl example_client_;
private:
- MOJO_DISALLOW_COPY_AND_ASSIGN(ExampleServiceTest);
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ExampleApptest);
};
-TEST_F(ExampleServiceTest, Ping) {
+TEST_F(ExampleApptest, PongClientDirectly) {
+ // Test very basic standalone ExampleClient functionality.
+ ExampleClientImpl example_client;
+ EXPECT_EQ(0, example_client.last_pong_value());
+ example_client.Pong(1);
+ EXPECT_EQ(1, example_client.last_pong_value());
+}
+
+TEST_F(ExampleApptest, PingServiceToPongClient) {
+ // Test ExampleClient and ExampleService interaction.
EXPECT_EQ(0, example_client_.last_pong_value());
example_service_->Ping(1);
- RunLoop::current()->Run();
+ EXPECT_TRUE(example_service_.WaitForIncomingMethodCall());
EXPECT_EQ(1, example_client_.last_pong_value());
}
@@ -54,18 +62,16 @@
struct SetAndQuit : public Callback<void()>::Runnable {
SetAndQuit(T* val, T result) : val_(val), result_(result) {}
virtual ~SetAndQuit() {}
- virtual void Run() const override {
- *val_ = result_;
- RunLoop::current()->Quit();
- }
+ virtual void Run() const override { *val_ = result_; }
T* val_;
T result_;
};
-TEST_F(ExampleServiceTest, RunCallback) {
+TEST_F(ExampleApptest, RunCallbackViaService) {
+ // Test ExampleService callback functionality.
bool was_run = false;
example_service_->RunCallback(SetAndQuit<bool>(&was_run, true));
- RunLoop::current()->Run();
+ EXPECT_TRUE(example_service_.WaitForIncomingMethodCall());
EXPECT_TRUE(was_run);
}
@@ -75,15 +81,15 @@
MojoResult MojoMain(MojoHandle shell_handle) {
mojo::Environment env;
+ // TODO(msw): Destroy this ambient RunLoop before running tests.
+ // Need to CancelWait() / PassMessagePipe() from the ShellPtr?
mojo::RunLoop loop;
-
- // TODO(tim): Perhaps the delegate should be the thing that provides
- // the ExampleServiceTest with the ApplicationImpl somehow.
mojo::ApplicationDelegate* delegate = new mojo::ExampleClientApplication();
mojo::ApplicationImpl app(delegate, shell_handle);
g_application_impl_hack = &app;
+ MOJO_CHECK(app.WaitForInitialize());
- // TODO(msw): Get actual commandline arguments.
+ // TODO(msw): Plumb commandline arguments through app->args().
int argc = 0;
char** argv = NULL;
testing::InitGoogleTest(&argc, argv);
diff --git a/mojo/examples/apptest/example_client_application.cc b/mojo/examples/apptest/example_client_application.cc
index 8ba5739..ca59eff 100644
--- a/mojo/examples/apptest/example_client_application.cc
+++ b/mojo/examples/apptest/example_client_application.cc
@@ -4,8 +4,6 @@
#include "mojo/examples/apptest/example_client_application.h"
-#include "mojo/examples/apptest/example_client_impl.h"
-
namespace mojo {
ExampleClientApplication::ExampleClientApplication() {}
diff --git a/mojo/examples/apptest/example_client_impl.cc b/mojo/examples/apptest/example_client_impl.cc
index 9d539be..d794117 100644
--- a/mojo/examples/apptest/example_client_impl.cc
+++ b/mojo/examples/apptest/example_client_impl.cc
@@ -8,11 +8,11 @@
namespace mojo {
ExampleClientImpl::ExampleClientImpl() : last_pong_value_(0) {}
+
ExampleClientImpl::~ExampleClientImpl() {}
void ExampleClientImpl::Pong(uint16_t pong_value) {
last_pong_value_ = pong_value;
- RunLoop::current()->Quit();
}
} // namespace mojo
diff --git a/mojo/examples/apptest/example_client_impl.h b/mojo/examples/apptest/example_client_impl.h
index 25d817a..ee835ca 100644
--- a/mojo/examples/apptest/example_client_impl.h
+++ b/mojo/examples/apptest/example_client_impl.h
@@ -10,19 +10,17 @@
namespace mojo {
-class ApplicationConnection;
-
class ExampleClientImpl : public InterfaceImpl<ExampleClient> {
public:
- explicit ExampleClientImpl();
+ ExampleClientImpl();
virtual ~ExampleClientImpl();
int16_t last_pong_value() const { return last_pong_value_; }
- private:
// InterfaceImpl<ExampleClient> overrides.
virtual void Pong(uint16_t pong_value) override;
+ private:
int16_t last_pong_value_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ExampleClientImpl);
};
diff --git a/mojo/examples/apptest/example_service_impl.cc b/mojo/examples/apptest/example_service_impl.cc
index b656ce0..b8e53d5 100644
--- a/mojo/examples/apptest/example_service_impl.cc
+++ b/mojo/examples/apptest/example_service_impl.cc
@@ -14,12 +14,10 @@
void ExampleServiceImpl::Ping(uint16_t ping_value) {
client()->Pong(ping_value);
- RunLoop::current()->Quit();
}
void ExampleServiceImpl::RunCallback(const Callback<void()>& callback) {
callback.Run();
- RunLoop::current()->Quit();
}
} // namespace mojo
diff --git a/mojo/examples/aura_demo/aura_demo.cc b/mojo/examples/aura_demo/aura_demo.cc
index 1895761..917ea61 100644
--- a/mojo/examples/aura_demo/aura_demo.cc
+++ b/mojo/examples/aura_demo/aura_demo.cc
@@ -8,10 +8,8 @@
#include "base/bind.h"
#include "base/macros.h"
#include "mojo/application/application_runner_chromium.h"
-#include "mojo/aura/context_factory_mojo.h"
#include "mojo/aura/screen_mojo.h"
#include "mojo/aura/window_tree_host_mojo.h"
-#include "mojo/aura/window_tree_host_mojo_delegate.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
@@ -107,10 +105,10 @@
};
class AuraDemo : public mojo::ApplicationDelegate,
- public mojo::WindowTreeHostMojoDelegate,
public mojo::ViewManagerDelegate {
public:
- AuraDemo() : window1_(NULL), window2_(NULL), window21_(NULL) {}
+ AuraDemo()
+ : shell_(nullptr), window1_(NULL), window2_(NULL), window21_(NULL) {}
virtual ~AuraDemo() {}
private:
@@ -123,7 +121,7 @@
// TODO(beng): this function could be called multiple times!
root_ = root;
- window_tree_host_.reset(new mojo::WindowTreeHostMojo(root, this));
+ window_tree_host_.reset(new mojo::WindowTreeHostMojo(shell_, root));
window_tree_host_->InitHost();
window_tree_client_.reset(
@@ -157,17 +155,11 @@
base::MessageLoop::current()->Quit();
}
- // WindowTreeHostMojoDelegate:
- virtual void CompositorContentsChanged(const SkBitmap& bitmap) override {
- root_->SetContents(bitmap);
- }
-
virtual void Initialize(mojo::ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
- new mojo::ViewManagerClientFactory(app->shell(), this));
+ new mojo::ViewManagerClientFactory(shell_, this));
aura::Env::CreateInstance(true);
- context_factory_.reset(new mojo::ContextFactoryMojo);
- aura::Env::GetInstance()->set_context_factory(context_factory_.get());
screen_.reset(mojo::ScreenMojo::Create());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
}
@@ -178,9 +170,9 @@
return true;
}
- scoped_ptr<DemoWindowTreeClient> window_tree_client_;
+ mojo::Shell* shell_;
- scoped_ptr<ui::ContextFactory> context_factory_;
+ scoped_ptr<DemoWindowTreeClient> window_tree_client_;
scoped_ptr<mojo::ScreenMojo> screen_;
diff --git a/mojo/examples/bitmap_uploader/BUILD.gn b/mojo/examples/bitmap_uploader/BUILD.gn
new file mode 100644
index 0000000..1ed540e
--- /dev/null
+++ b/mojo/examples/bitmap_uploader/BUILD.gn
@@ -0,0 +1,37 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# GYP version: mojo/mojo_examples.gypi:mojo_bitmap_uploader
+source_set("bitmap_uploader") {
+ sources = [
+ "bitmap_uploader.cc",
+ "bitmap_uploader.h",
+ ]
+
+ public_deps = [
+ "//base",
+ "//cc/surfaces",
+ "//mojo/public/c/gles2",
+ "//mojo/services/public/interfaces/gpu",
+ "//mojo/services/public/interfaces/surfaces",
+ "//skia",
+ "//ui/gfx/geometry",
+ ]
+ deps = [
+ "//gpu",
+ "//mojo/application",
+ "//mojo/public/cpp/bindings:bindings",
+ "//mojo/public/interfaces/application",
+ "//mojo/services/public/cpp/geometry",
+ "//mojo/services/public/cpp/surfaces",
+ "//mojo/services/public/cpp/view_manager",
+ "//mojo/services/public/interfaces/geometry",
+ "//mojo/services/public/interfaces/input_events:input_events",
+ "//mojo/services/public/interfaces/surfaces:surface_id",
+ "//mojo/services/public/interfaces/view_manager",
+ "//mojo/services/public/interfaces/window_manager",
+ "//ui/events",
+ "//ui/gfx",
+ ]
+}
diff --git a/mojo/examples/bitmap_uploader/DEPS b/mojo/examples/bitmap_uploader/DEPS
new file mode 100644
index 0000000..a46d043
--- /dev/null
+++ b/mojo/examples/bitmap_uploader/DEPS
@@ -0,0 +1,10 @@
+include_rules = [
+ "+cc/surfaces/surface_id.h",
+ "+cc/surfaces/surface_id_allocator.h",
+ "+gpu/command_buffer/common/mailbox.h",
+ "+gpu/GLES2",
+ "+mojo/geometry",
+ "+third_party/khronos/GLES2",
+ "+third_party/skia/include",
+ "+ui/gfx",
+]
diff --git a/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.cc b/mojo/examples/bitmap_uploader/bitmap_uploader.cc
similarity index 83%
rename from mojo/services/public/cpp/view_manager/lib/bitmap_uploader.cc
rename to mojo/examples/bitmap_uploader/bitmap_uploader.cc
index 80447ed..facc58a 100644
--- a/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.cc
+++ b/mojo/examples/bitmap_uploader/bitmap_uploader.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h"
+#include "mojo/examples/bitmap_uploader/bitmap_uploader.h"
#ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES
@@ -15,6 +15,8 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "mojo/public/c/gles2/gles2.h"
+#include "mojo/public/cpp/application/connect.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/public/cpp/geometry/geometry_type_converters.h"
#include "mojo/services/public/cpp/surfaces/surfaces_type_converters.h"
#include "mojo/services/public/cpp/surfaces/surfaces_utils.h"
@@ -34,21 +36,27 @@
}
}
-BitmapUploader::BitmapUploader(ViewManagerClientImpl* client,
- Id view_id,
- SurfacesServicePtr surfaces_service,
- GpuPtr gpu_service)
- : client_(client),
- view_id_(view_id),
- surfaces_service_(surfaces_service.Pass()),
- gpu_service_(gpu_service.Pass()),
+BitmapUploader::BitmapUploader(View* view)
+ : view_(view),
color_(SK_ColorTRANSPARENT),
next_resource_id_(1u),
weak_factory_(this) {
+}
+
+void BitmapUploader::Init(Shell* shell) {
+ ServiceProviderPtr surfaces_service_provider;
+ shell->ConnectToApplication("mojo:mojo_surfaces_service",
+ GetProxy(&surfaces_service_provider));
+ ConnectToService(surfaces_service_provider.get(), &surfaces_service_);
+ ServiceProviderPtr gpu_service_provider;
+ shell->ConnectToApplication("mojo:mojo_native_viewport_service",
+ GetProxy(&gpu_service_provider));
+ ConnectToService(gpu_service_provider.get(), &gpu_service_);
+
surfaces_service_->CreateSurfaceConnection(base::Bind(
&BitmapUploader::OnSurfaceConnectionCreated, weak_factory_.GetWeakPtr()));
CommandBufferPtr gles2_client;
- gpu_service_->CreateOffscreenGLES2Context(Get(&gles2_client));
+ gpu_service_->CreateOffscreenGLES2Context(GetProxy(&gles2_client));
gles2_context_ =
MojoGLES2CreateContext(gles2_client.PassMessagePipe().release().value(),
&LostContext,
@@ -61,12 +69,6 @@
MojoGLES2DestroyContext(gles2_context_);
}
-void BitmapUploader::SetSize(const gfx::Size& size) {
- if (size_ == size)
- return;
- size_ = size;
-}
-
void BitmapUploader::SetColor(SkColor color) {
if (color_ == color)
return;
@@ -75,37 +77,36 @@
Upload();
}
-void BitmapUploader::SetBitmap(SkBitmap bitmap) {
+void BitmapUploader::SetBitmap(const SkBitmap& bitmap) {
bitmap_ = bitmap;
if (surface_)
Upload();
}
void BitmapUploader::Upload() {
- if (size_.width() == 0 || size_.height() == 0) {
- client_->SetSurfaceId(view_id_, SurfaceId::New());
+ const gfx::Size& size(view_->bounds().size());
+ if (size.IsEmpty()) {
+ view_->SetSurfaceId(SurfaceId::New());
return;
}
- if (!surface_) { // Can't upload yet, store for later.
- done_callback_ = done_callback_;
+ if (!surface_) // Can't upload yet, store for later.
return;
- }
- if (id_.is_null() || size_ != surface_size_) {
+ if (id_.is_null() || size != surface_size_) {
if (!id_.is_null())
surface_->DestroySurface(SurfaceId::From(id_));
id_ = id_allocator_->GenerateId();
- surface_->CreateSurface(SurfaceId::From(id_), Size::From(size_));
- client_->SetSurfaceId(view_id_, SurfaceId::From(id_));
- surface_size_ = size_;
+ surface_->CreateSurface(SurfaceId::From(id_), Size::From(size));
+ view_->SetSurfaceId(SurfaceId::From(id_));
+ surface_size_ = size;
}
- gfx::Rect bounds(size_);
+ gfx::Rect bounds(size);
PassPtr pass = CreateDefaultPass(1, bounds);
FramePtr frame = Frame::New();
frame->resources.resize(0u);
pass->quads.resize(0u);
- pass->shared_quad_states.push_back(CreateDefaultSQS(size_));
+ pass->shared_quad_states.push_back(CreateDefaultSQS(size));
MojoGLES2MakeCurrent(gles2_context_);
if (!bitmap_.isNull()) {
diff --git a/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h b/mojo/examples/bitmap_uploader/bitmap_uploader.h
similarity index 67%
rename from mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h
rename to mojo/examples/bitmap_uploader/bitmap_uploader.h
index f049409..56f37fe 100644
--- a/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h
+++ b/mojo/examples/bitmap_uploader/bitmap_uploader.h
@@ -2,15 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_
-#define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_
+#ifndef MOJO_EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_
+#define MOJO_EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "cc/surfaces/surface_id.h"
#include "mojo/public/c/gles2/gles2.h"
-#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h"
@@ -22,20 +21,19 @@
}
namespace mojo {
-class ViewManagerClientImpl;
+class Shell;
+class View;
+// BitmapUploader is useful if you want to draw a bitmap or color in a View.
class BitmapUploader : public SurfaceClient {
public:
- BitmapUploader(ViewManagerClientImpl* client,
- Id view_id,
- SurfacesServicePtr surfaces_service,
- GpuPtr gpu_service);
+ explicit BitmapUploader(View* view);
virtual ~BitmapUploader();
- void SetSize(const gfx::Size& size);
+ void Init(Shell* shell);
+
void SetColor(SkColor color);
- void SetBitmap(SkBitmap bitmap);
- void SetDoneCallback(const base::Callback<void(SurfaceIdPtr)>& done_callback);
+ void SetBitmap(const SkBitmap& bitmap);
private:
void Upload();
@@ -43,10 +41,9 @@
uint32_t BindTextureForSize(const gfx::Size size);
// SurfaceClient implementation.
- virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE;
+ virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override;
- ViewManagerClientImpl* client_;
- Id view_id_;
+ View* view_;
SurfacesServicePtr surfaces_service_;
GpuPtr gpu_service_;
MojoGLES2Context gles2_context_;
@@ -54,7 +51,6 @@
gfx::Size size_;
SkColor color_;
SkBitmap bitmap_;
- base::Callback<void(SurfaceIdPtr)> done_callback_;
SurfacePtr surface_;
cc::SurfaceId id_;
scoped_ptr<cc::SurfaceIdAllocator> id_allocator_;
@@ -69,4 +65,4 @@
} // namespace mojo
-#endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_BITMAP_UPLOADER_H_
+#endif // MOJO_EXAMPLES_BITMAP_UPLOADER_BITMAP_UPLOADER_H_
diff --git a/mojo/examples/browser/browser.cc b/mojo/examples/browser/browser.cc
index 2a77f89..2f22d16 100644
--- a/mojo/examples/browser/browser.cc
+++ b/mojo/examples/browser/browser.cc
@@ -155,9 +155,7 @@
public ViewObserver {
public:
Browser()
- : view_manager_(NULL),
- root_(NULL),
- widget_(NULL) {}
+ : shell_(nullptr), view_manager_(NULL), root_(NULL), widget_(NULL) {}
virtual ~Browser() {
if (root_)
@@ -167,8 +165,9 @@
private:
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
- new ViewManagerClientFactory(app->shell(), this));
+ new ViewManagerClientFactory(shell_, this));
views_init_.reset(new ViewsInit);
app->ConnectToService("mojo:mojo_window_manager", &window_manager_);
}
@@ -193,7 +192,7 @@
widget_ = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.native_widget = new NativeWidgetViewManager(widget_, view);
+ params.native_widget = new NativeWidgetViewManager(widget_, shell_, view);
params.delegate = widget_delegate;
params.bounds = gfx::Rect(view->bounds().width(), view->bounds().height());
widget_->Init(params);
@@ -252,6 +251,8 @@
root_ = NULL;
}
+ Shell* shell_;
+
scoped_ptr<ViewsInit> views_init_;
ViewManager* view_manager_;
diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc
index 279fe75..516edbb 100644
--- a/mojo/examples/compositor_app/compositor_app.cc
+++ b/mojo/examples/compositor_app/compositor_app.cc
@@ -56,7 +56,7 @@
CommandBufferPtr cb;
// TODO(jamesr): Output to a surface instead.
gpu_service_->CreateOnscreenGLES2Context(
- native_viewport_id, Size::From(gfx::Size(800, 600)), Get(&cb));
+ native_viewport_id, Size::From(gfx::Size(800, 600)), GetProxy(&cb));
host_.reset(new CompositorHost(cb.PassMessagePipe()));
}
diff --git a/mojo/examples/embedded_app/BUILD.gn b/mojo/examples/embedded_app/BUILD.gn
index 3e82cbb..12cf1b9 100644
--- a/mojo/examples/embedded_app/BUILD.gn
+++ b/mojo/examples/embedded_app/BUILD.gn
@@ -12,6 +12,7 @@
deps = [
"//base",
"//mojo/application",
+ "//mojo/examples/bitmap_uploader",
"//mojo/examples/window_manager:bindings",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
diff --git a/mojo/examples/embedded_app/embedded_app.cc b/mojo/examples/embedded_app/embedded_app.cc
index da51fae..98c418e 100644
--- a/mojo/examples/embedded_app/embedded_app.cc
+++ b/mojo/examples/embedded_app/embedded_app.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/examples/bitmap_uploader/bitmap_uploader.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_delegate.h"
@@ -31,11 +32,18 @@
SK_ColorMAGENTA};
struct Window {
- Window(View* root, scoped_ptr<ServiceProvider> embedder_service_provider)
+ Window(View* root,
+ scoped_ptr<ServiceProvider> embedder_service_provider,
+ Shell* shell)
: root(root),
- embedder_service_provider(embedder_service_provider.Pass()) {}
+ embedder_service_provider(embedder_service_provider.Pass()),
+ bitmap_uploader(root) {
+ bitmap_uploader.Init(shell);
+ }
+
View* root;
scoped_ptr<ServiceProvider> embedder_service_provider;
+ BitmapUploader bitmap_uploader;
};
class EmbeddedApp
@@ -43,13 +51,14 @@
public ViewManagerDelegate,
public ViewObserver {
public:
- EmbeddedApp() { url::AddStandardScheme("mojo"); }
+ EmbeddedApp() : shell_(nullptr) { url::AddStandardScheme("mojo"); }
virtual ~EmbeddedApp() {}
private:
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
new ViewManagerClientFactory(app->shell(), this));
}
@@ -66,8 +75,10 @@
ServiceProviderImpl* exported_services,
scoped_ptr<ServiceProvider> imported_services) override {
root->AddObserver(this);
- windows_[root->id()] = new Window(root, imported_services.Pass());
- root->SetColor(kColors[next_color_++ % arraysize(kColors)]);
+ Window* window = new Window(root, imported_services.Pass(), shell_);
+ windows_[root->id()] = window;
+ window->bitmap_uploader.SetColor(
+ kColors[next_color_++ % arraysize(kColors)]);
}
virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {
base::MessageLoop::current()->Quit();
@@ -91,6 +102,7 @@
}
}
+ Shell* shell_;
scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_;
typedef std::map<Id, Window*> WindowMap;
diff --git a/mojo/examples/keyboard/keyboard.cc b/mojo/examples/keyboard/keyboard.cc
index 8eae684..3cd4a4e 100644
--- a/mojo/examples/keyboard/keyboard.cc
+++ b/mojo/examples/keyboard/keyboard.cc
@@ -51,7 +51,8 @@
public KeyboardDelegate {
public:
Keyboard()
- : keyboard_service_factory_(this),
+ : shell_(nullptr),
+ keyboard_service_factory_(this),
view_manager_(NULL),
keyboard_service_(NULL),
target_(0) {}
@@ -68,8 +69,9 @@
private:
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
- new ViewManagerClientFactory(app->shell(), this));
+ new ViewManagerClientFactory(shell_, this));
}
virtual bool ConfigureIncomingConnection(
@@ -88,7 +90,7 @@
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.native_widget = new NativeWidgetViewManager(widget, view);
+ params.native_widget = new NativeWidgetViewManager(widget, shell_, view);
params.delegate = widget_delegate;
params.bounds = gfx::Rect(view->bounds().width(), view->bounds().height());
widget->Init(params);
@@ -119,6 +121,8 @@
event_flags);
}
+ Shell* shell_;
+
InterfaceFactoryImplWithContext<KeyboardServiceImpl, Keyboard>
keyboard_service_factory_;
diff --git a/mojo/examples/media_viewer/BUILD.gn b/mojo/examples/media_viewer/BUILD.gn
index b17d2d3..d322ca0 100644
--- a/mojo/examples/media_viewer/BUILD.gn
+++ b/mojo/examples/media_viewer/BUILD.gn
@@ -26,6 +26,7 @@
"//mojo/services/public/interfaces/view_manager",
"//mojo/views",
"//skia",
+ "//ui/gfx",
"//ui/gfx/geometry",
"//ui/views",
]
diff --git a/mojo/examples/media_viewer/media_viewer.cc b/mojo/examples/media_viewer/media_viewer.cc
index 33cf200..533fe36 100644
--- a/mojo/examples/media_viewer/media_viewer.cc
+++ b/mojo/examples/media_viewer/media_viewer.cc
@@ -34,6 +34,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/image/image_skia.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/button.h"
@@ -134,11 +135,12 @@
virtual void ButtonPressed(ControlType type) = 0;
};
- ControlPanel(Delegate* delegate) : delegate_(delegate), buttons_() {}
+ explicit ControlPanel(Delegate* delegate)
+ : delegate_(delegate), shell_(nullptr), buttons_() {}
virtual ~ControlPanel() {}
- void Initialize(View* view) {
+ void Initialize(View* view, Shell* shell) {
const char* kNames[] = { "Zoom In", "Actual Size", "Zoom Out" };
views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
@@ -160,7 +162,7 @@
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.native_widget = new NativeWidgetViewManager(widget, view);
+ params.native_widget = new NativeWidgetViewManager(widget, shell, view);
params.delegate = widget_delegate;
params.bounds = gfx::Rect(view->bounds().width(), view->bounds().height());
params.opacity = views::Widget::InitParams::OPAQUE_WINDOW;
@@ -181,6 +183,7 @@
}
Delegate* delegate_;
+ Shell* shell_;
views::Button* buttons_[CONTROL_COUNT];
DISALLOW_COPY_AND_ASSIGN(ControlPanel);
@@ -193,7 +196,8 @@
public ViewObserver {
public:
MediaViewer()
- : app_(NULL),
+ : shell_(nullptr),
+ app_(NULL),
view_manager_(NULL),
root_view_(NULL),
control_view_(NULL),
@@ -213,6 +217,7 @@
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
new ViewManagerClientFactory(app->shell(), this));
app_ = app;
@@ -248,7 +253,7 @@
content_view_ = View::Create(view_manager_);
root_view_->AddChild(content_view_);
- control_panel_.Initialize(control_view_);
+ control_panel_.Initialize(control_view_, shell_);
LayoutViews();
root_view_->AddObserver(this);
@@ -297,6 +302,8 @@
return it != handler_map_.end() ? it->second : std::string();
}
+ Shell* shell_;
+
scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_;
ApplicationImpl* app_;
diff --git a/mojo/examples/nesting_app/BUILD.gn b/mojo/examples/nesting_app/BUILD.gn
index e25263f..86f611c 100644
--- a/mojo/examples/nesting_app/BUILD.gn
+++ b/mojo/examples/nesting_app/BUILD.gn
@@ -12,10 +12,8 @@
deps = [
"//base",
- "//ui/gfx/geometry",
- "//ui/gl",
- "//url",
"//mojo/application",
+ "//mojo/examples/bitmap_uploader",
"//mojo/examples/window_manager:bindings",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
@@ -23,5 +21,8 @@
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/geometry",
"//mojo/services/public/interfaces/navigation",
+ "//ui/gfx/geometry",
+ "//ui/gl",
+ "//url",
]
}
diff --git a/mojo/examples/nesting_app/nesting_app.cc b/mojo/examples/nesting_app/nesting_app.cc
index a7fb74e..e3bcbcd 100644
--- a/mojo/examples/nesting_app/nesting_app.cc
+++ b/mojo/examples/nesting_app/nesting_app.cc
@@ -7,6 +7,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/stringprintf.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/examples/bitmap_uploader/bitmap_uploader.h"
#include "mojo/examples/window_manager/window_manager.mojom.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
@@ -37,12 +38,13 @@
public ViewManagerDelegate,
public ViewObserver {
public:
- NestingApp() : nested_(NULL) {}
+ NestingApp() : nested_(nullptr), shell_(nullptr) {}
virtual ~NestingApp() {}
private:
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
new ViewManagerClientFactory(app->shell(), this));
}
@@ -61,7 +63,9 @@
ServiceProviderImpl* exported_services,
scoped_ptr<ServiceProvider> imported_services) override {
root->AddObserver(this);
- root->SetColor(SK_ColorCYAN);
+ bitmap_uploader_.reset(new BitmapUploader(root));
+ bitmap_uploader_->Init(shell_);
+ bitmap_uploader_->SetColor(SK_ColorCYAN);
nested_ = View::Create(view_manager);
root->AddChild(nested_);
@@ -85,7 +89,9 @@
scoped_ptr<ViewManagerClientFactory> view_manager_client_factory_;
View* nested_;
+ Shell* shell_;
IWindowManagerPtr window_manager_;
+ scoped_ptr<BitmapUploader> bitmap_uploader_;
DISALLOW_COPY_AND_ASSIGN(NestingApp);
};
diff --git a/mojo/examples/pepper_container_app/pepper_container_app.cc b/mojo/examples/pepper_container_app/pepper_container_app.cc
index 4b64441..82c35f0 100644
--- a/mojo/examples/pepper_container_app/pepper_container_app.cc
+++ b/mojo/examples/pepper_container_app/pepper_container_app.cc
@@ -92,7 +92,7 @@
size->width = 600;
// TODO(jamesr): Output a surface to the native viewport instead.
gpu_service_->CreateOnscreenGLES2Context(
- native_viewport_id_, size.Pass(), Get(&command_buffer));
+ native_viewport_id_, size.Pass(), GetProxy(&command_buffer));
return command_buffer.PassMessagePipe();
}
diff --git a/mojo/examples/png_viewer/BUILD.gn b/mojo/examples/png_viewer/BUILD.gn
index 9fc2315..e5265b3 100644
--- a/mojo/examples/png_viewer/BUILD.gn
+++ b/mojo/examples/png_viewer/BUILD.gn
@@ -12,6 +12,7 @@
deps = [
"//mojo/application",
+ "//mojo/examples/bitmap_uploader",
"//mojo/examples/media_viewer:bindings",
"//mojo/public/c/system:for_shared_library",
"//mojo/public/cpp/bindings",
diff --git a/mojo/examples/png_viewer/png_viewer.cc b/mojo/examples/png_viewer/png_viewer.cc
index 792879a..bb6e321 100644
--- a/mojo/examples/png_viewer/png_viewer.cc
+++ b/mojo/examples/png_viewer/png_viewer.cc
@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/string_tokenizer.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/examples/bitmap_uploader/bitmap_uploader.h"
#include "mojo/examples/media_viewer/media_viewer.mojom.h"
#include "mojo/public/c/system/main.h"
#include "mojo/public/cpp/application/application_connection.h"
@@ -59,7 +60,8 @@
scoped_ptr<ServiceProvider> imported_services,
Shell* shell)
: imported_services_(imported_services.Pass()),
- root_(NULL),
+ shell_(shell),
+ root_(nullptr),
view_manager_client_factory_(shell, this),
zoom_percentage_(kDefaultZoomPercentage) {
exported_services->AddService(&view_manager_client_factory_);
@@ -78,7 +80,9 @@
scoped_ptr<ServiceProvider> imported_services) override {
root_ = root;
root_->AddObserver(this);
- root_->SetColor(SK_ColorGRAY);
+ bitmap_uploader_.reset(new BitmapUploader(root_));
+ bitmap_uploader_->Init(shell_);
+ bitmap_uploader_->SetColor(SK_ColorGRAY);
if (!bitmap_.isNull())
DrawBitmap();
}
@@ -138,7 +142,8 @@
SkFloatToScalar(zoom_percentage_ * 1.0f / kDefaultZoomPercentage);
canvas->scale(scale, scale);
canvas->drawBitmap(bitmap_, 0, 0, &paint);
- root_->SetContents(skia::GetTopDevice(*canvas)->accessBitmap(true));
+ bitmap_uploader_->SetBitmap(
+ skia::GetTopDevice(*canvas)->accessBitmap(true));
}
void ZoomIn() {
@@ -179,9 +184,11 @@
SkBitmap bitmap_;
scoped_ptr<ServiceProvider> imported_services_;
+ Shell* shell_;
View* root_;
ViewManagerClientFactory view_manager_client_factory_;
uint16_t zoom_percentage_;
+ scoped_ptr<BitmapUploader> bitmap_uploader_;
DISALLOW_COPY_AND_ASSIGN(PNGView);
};
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc
index 6ffdb59..ca60ee0 100644
--- a/mojo/examples/sample_app/sample_app.cc
+++ b/mojo/examples/sample_app/sample_app.cc
@@ -71,7 +71,7 @@
mojo::CommandBufferPtr command_buffer;
// TODO(jamesr): Output to a surface instead.
gpu_service_->CreateOnscreenGLES2Context(
- native_viewport_id, size.Pass(), Get(&command_buffer));
+ native_viewport_id, size.Pass(), GetProxy(&command_buffer));
gles2_client_.reset(new GLES2ClientImpl(command_buffer.Pass()));
}
diff --git a/mojo/examples/surfaces_app/BUILD.gn b/mojo/examples/surfaces_app/BUILD.gn
index dc7df4d..448e954 100644
--- a/mojo/examples/surfaces_app/BUILD.gn
+++ b/mojo/examples/surfaces_app/BUILD.gn
@@ -29,10 +29,13 @@
"//mojo/common",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_shared_library",
- "//mojo/services/public/interfaces/geometry",
+ "//mojo/public/cpp/system",
"//mojo/services/public/cpp/geometry",
- "//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/cpp/surfaces",
+ "//mojo/services/public/interfaces/geometry",
+ "//mojo/services/public/interfaces/gpu",
+ "//mojo/services/public/interfaces/surfaces",
+ "//mojo/services/public/interfaces/native_viewport",
]
sources = [
@@ -53,17 +56,19 @@
"//base",
"//cc",
"//cc/surfaces",
- "//skia",
- "//ui/gfx",
- "//ui/gfx/geometry",
"//mojo/application",
"//mojo/common",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_shared_library",
- "//mojo/services/public/interfaces/geometry",
+ "//mojo/public/cpp/bindings",
"//mojo/services/public/cpp/geometry",
- "//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/cpp/surfaces",
+ "//mojo/services/public/interfaces/geometry",
+ "//mojo/services/public/interfaces/surfaces",
+ "//mojo/services/public/interfaces/surfaces:surface_id",
+ "//skia",
+ "//ui/gfx",
+ "//ui/gfx/geometry",
]
sources = [
@@ -83,19 +88,25 @@
"//base",
"//cc",
"//cc/surfaces",
- "//skia",
- "//ui/gfx",
- "//ui/gfx/geometry",
- "//mojo/common",
+ "//gpu/command_buffer/common",
"//mojo/application",
+ "//mojo/common",
"//mojo/environment:chromium",
"//mojo/examples/sample_app:spinning_cube",
"//mojo/public/c/system:for_shared_library",
+ "//mojo/public/cpp/bindings",
+ "//mojo/public/cpp/environment",
+ "//mojo/public/cpp/system",
"//mojo/public/gles2:for_shared_library",
- "//mojo/services/public/interfaces/geometry",
"//mojo/services/public/cpp/geometry",
- "//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/cpp/surfaces",
+ "//mojo/services/public/interfaces/geometry",
+ "//mojo/services/public/interfaces/gpu",
+ "//mojo/services/public/interfaces/surfaces",
+ "//mojo/services/public/interfaces/surfaces:surface_id",
+ "//skia",
+ "//ui/gfx",
+ "//ui/gfx/geometry",
]
sources = [
@@ -109,6 +120,8 @@
deps = [
"//cc",
"//skia",
+ "//ui/gfx",
+ "//ui/gfx/geometry",
]
sources = [
diff --git a/mojo/examples/surfaces_app/DEPS b/mojo/examples/surfaces_app/DEPS
index 23379ad..acce9a2 100644
--- a/mojo/examples/surfaces_app/DEPS
+++ b/mojo/examples/surfaces_app/DEPS
@@ -3,6 +3,7 @@
"-cc/blink",
"+gpu/GLES2",
"+gpu/command_buffer/client",
+ "+gpu/command_buffer/common",
"+third_party/khronos/GLES2",
"+third_party/skia/include",
"+ui/gfx",
diff --git a/mojo/examples/surfaces_app/child_gl_app.cc b/mojo/examples/surfaces_app/child_gl_app.cc
index 9646db4..b84826b 100644
--- a/mojo/examples/surfaces_app/child_gl_app.cc
+++ b/mojo/examples/surfaces_app/child_gl_app.cc
@@ -39,7 +39,7 @@
virtual void Create(ApplicationConnection* connection,
InterfaceRequest<Child> request) override {
CommandBufferPtr command_buffer;
- gpu_service_->CreateOffscreenGLES2Context(Get(&command_buffer));
+ gpu_service_->CreateOffscreenGLES2Context(GetProxy(&command_buffer));
BindToRequest(
new ChildGLImpl(surfaces_service_connection_, command_buffer.Pass()),
&request);
diff --git a/mojo/examples/surfaces_app/child_gl_impl.cc b/mojo/examples/surfaces_app/child_gl_impl.cc
index 72374fb..77b3823 100644
--- a/mojo/examples/surfaces_app/child_gl_impl.cc
+++ b/mojo/examples/surfaces_app/child_gl_impl.cc
@@ -16,6 +16,8 @@
#include "cc/quads/texture_draw_quad.h"
#include "gpu/GLES2/gl2chromium.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
#include "mojo/examples/surfaces_app/surfaces_util.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/environment/environment.h"
diff --git a/mojo/examples/wget/wget.cc b/mojo/examples/wget/wget.cc
index f7c03bb..09c4f7b 100644
--- a/mojo/examples/wget/wget.cc
+++ b/mojo/examples/wget/wget.cc
@@ -80,7 +80,7 @@
std::string url((args.size() > 1) ? args[1].get() : PromptForURL());
printf("Loading: %s\n", url.c_str());
- network_service_->CreateURLLoader(Get(&url_loader_));
+ network_service_->CreateURLLoader(GetProxy(&url_loader_));
URLRequestPtr request(URLRequest::New());
request->url = url;
diff --git a/mojo/examples/window_manager/debug_panel.cc b/mojo/examples/window_manager/debug_panel.cc
index c65785c..7d86cfe 100644
--- a/mojo/examples/window_manager/debug_panel.cc
+++ b/mojo/examples/window_manager/debug_panel.cc
@@ -24,23 +24,27 @@
} // namespace
-DebugPanel::DebugPanel(Delegate* delegate, View* view)
+DebugPanel::DebugPanel(Delegate* delegate, Shell* shell, View* view)
: delegate_(delegate),
view_(view),
- navigation_target_label_(new views::Label(
- base::ASCIIToUTF16("Navigation target:"))),
- navigation_target_new_(new views::RadioButton(
- base::ASCIIToUTF16("New window"), kNavigationTargetGroupId)),
- navigation_target_source_(new views::RadioButton(
- base::ASCIIToUTF16("Source window"), kNavigationTargetGroupId)),
- navigation_target_default_(new views::RadioButton(
- base::ASCIIToUTF16("Default"), kNavigationTargetGroupId)),
- colored_square_(new views::BlueButton(
- this, base::ASCIIToUTF16("Local nav test"))),
- close_last_(new views::BlueButton(
- this, base::ASCIIToUTF16("Close last window"))),
- cross_app_(new views::BlueButton(
- this, base::ASCIIToUTF16("Cross-app nav test"))) {
+ navigation_target_label_(
+ new views::Label(base::ASCIIToUTF16("Navigation target:"))),
+ navigation_target_new_(
+ new views::RadioButton(base::ASCIIToUTF16("New window"),
+ kNavigationTargetGroupId)),
+ navigation_target_source_(
+ new views::RadioButton(base::ASCIIToUTF16("Source window"),
+ kNavigationTargetGroupId)),
+ navigation_target_default_(
+ new views::RadioButton(base::ASCIIToUTF16("Default"),
+ kNavigationTargetGroupId)),
+ colored_square_(
+ new views::BlueButton(this, base::ASCIIToUTF16("Local nav test"))),
+ close_last_(
+ new views::BlueButton(this, base::ASCIIToUTF16("Close last window"))),
+ cross_app_(
+ new views::BlueButton(this,
+ base::ASCIIToUTF16("Cross-app nav test"))) {
navigation_target_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
navigation_target_default_->SetChecked(true);
@@ -59,7 +63,7 @@
views::Widget* widget = new views::Widget();
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.native_widget = new NativeWidgetViewManager(widget, view);
+ params.native_widget = new NativeWidgetViewManager(widget, shell, view);
params.delegate = widget_delegate;
params.bounds = gfx::Rect(view->bounds().size());
widget->Init(params);
diff --git a/mojo/examples/window_manager/debug_panel.h b/mojo/examples/window_manager/debug_panel.h
index 160e400..eec3067 100644
--- a/mojo/examples/window_manager/debug_panel.h
+++ b/mojo/examples/window_manager/debug_panel.h
@@ -20,13 +20,11 @@
namespace mojo {
+class Shell;
class View;
namespace examples {
-namespace {
-}
-
// A panel of controls intended to demonstrate the functionality of the window
// manager.
class DebugPanel : public views::LayoutManager, public views::ButtonListener {
@@ -42,7 +40,7 @@
virtual ~Delegate(){}
};
- DebugPanel(Delegate* delegate, View* view);
+ DebugPanel(Delegate* delegate, Shell* shell, View* view);
virtual ~DebugPanel();
Target navigation_target() const;
@@ -57,6 +55,7 @@
void Navigate(const std::string& url);
Delegate* delegate_;
+ Shell* shell_;
View* view_;
views::Label* navigation_target_label_;
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index 2cb5458..fbbf074 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -340,7 +340,8 @@
public ui::EventHandler {
public:
WindowManager()
- : window_manager_factory_(this),
+ : shell_(nullptr),
+ window_manager_factory_(this),
launcher_ui_(NULL),
view_manager_(NULL),
window_manager_app_(new WindowManagerApp(this, this)),
@@ -408,6 +409,7 @@
// Overridden from ApplicationDelegate:
virtual void Initialize(ApplicationImpl* app) override {
+ shell_ = app->shell();
app_ = app;
views_init_.reset(new ViewsInit);
window_manager_app_->Initialize(app);
@@ -558,7 +560,7 @@
kTextfieldHeight);
view->SetBounds(bounds);
- debug_panel_ = new DebugPanel(this, view);
+ debug_panel_ = new DebugPanel(this, shell_, view);
return view->id();
}
@@ -573,6 +575,8 @@
return windows_.end();
}
+ Shell* shell_;
+
InterfaceFactoryImplWithContext<WindowManagerConnection, WindowManager>
window_manager_factory_;
diff --git a/mojo/examples/wm_flow/BUILD.gn b/mojo/examples/wm_flow/BUILD.gn
index ef665c0..50ce507 100644
--- a/mojo/examples/wm_flow/BUILD.gn
+++ b/mojo/examples/wm_flow/BUILD.gn
@@ -66,6 +66,7 @@
":embeddee_bindings",
"//base",
"//mojo/application",
+ "//mojo/examples/bitmap_uploader",
"//mojo/public/c/system:for_shared_library",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/window_manager:lib",
@@ -85,6 +86,7 @@
":embeddee_bindings",
"//base",
"//mojo/application",
+ "//mojo/examples/bitmap_uploader",
"//mojo/public/c/system:for_shared_library",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/window_manager:lib",
diff --git a/mojo/examples/wm_flow/app/app.cc b/mojo/examples/wm_flow/app/app.cc
index f2bea10..658433c 100644
--- a/mojo/examples/wm_flow/app/app.cc
+++ b/mojo/examples/wm_flow/app/app.cc
@@ -2,9 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <map>
+
#include "base/bind.h"
#include "base/macros.h"
+#include "base/stl_util.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/examples/bitmap_uploader/bitmap_uploader.h"
#include "mojo/examples/wm_flow/app/embedder.mojom.h"
#include "mojo/examples/wm_flow/embedded/embeddee.mojom.h"
#include "mojo/public/c/system/main.h"
@@ -51,12 +55,15 @@
public mojo::ViewManagerDelegate,
public mojo::ViewObserver {
public:
- WMFlowApp() : embed_count_(0) {}
- virtual ~WMFlowApp() {}
+ WMFlowApp() : shell_(nullptr), embed_count_(0) {}
+ virtual ~WMFlowApp() { STLDeleteValues(&uploaders_); }
private:
+ typedef std::map<mojo::View*, mojo::BitmapUploader*> ViewToUploader;
+
// Overridden from Application:
virtual void Initialize(mojo::ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
new mojo::ViewManagerClientFactory(app->shell(), this));
view_manager_context_.reset(new mojo::ViewManagerContext(app));
@@ -79,7 +86,10 @@
mojo::ServiceProviderImpl* exported_services,
scoped_ptr<mojo::ServiceProvider> imported_services) override {
root->AddObserver(this);
- root->SetColor(kColors[embed_count_++ % arraysize(kColors)]);
+ mojo::BitmapUploader* uploader = new mojo::BitmapUploader(root);
+ uploaders_[root] = uploader;
+ uploader->Init(shell_);
+ uploader->SetColor(kColors[embed_count_++ % arraysize(kColors)]);
mojo::View* embed = mojo::View::Create(view_manager);
root->AddChild(embed);
@@ -98,7 +108,9 @@
base::Unretained(this)));
}
virtual void OnViewManagerDisconnected(
- mojo::ViewManager* view_manager) override {}
+ mojo::ViewManager* view_manager) override {
+ STLDeleteValues(&uploaders_);
+ }
// Overridden from mojo::ViewObserver:
virtual void OnViewInputEvent(mojo::View* view,
@@ -109,6 +121,10 @@
}
}
virtual void OnViewDestroyed(mojo::View* view) override {
+ if (uploaders_.find(view) != uploaders_.end()) {
+ delete uploaders_[view];
+ uploaders_.erase(view);
+ }
--embed_count_;
view->RemoveObserver(this);
}
@@ -121,11 +137,13 @@
view_manager_context_->Embed("mojo:mojo_wm_flow_app");
}
+ mojo::Shell* shell_;
int embed_count_;
scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_;
mojo::InterfaceFactoryImpl<EmbedderImpl> embedder_factory_;
scoped_ptr<mojo::ViewManagerContext> view_manager_context_;
EmbeddeePtr embeddee_;
+ ViewToUploader uploaders_;
DISALLOW_COPY_AND_ASSIGN(WMFlowApp);
};
diff --git a/mojo/examples/wm_flow/embedded/embedded.cc b/mojo/examples/wm_flow/embedded/embedded.cc
index f69aa90..d328501 100644
--- a/mojo/examples/wm_flow/embedded/embedded.cc
+++ b/mojo/examples/wm_flow/embedded/embedded.cc
@@ -5,6 +5,7 @@
#include "base/bind.h"
#include "base/macros.h"
#include "mojo/application/application_runner_chromium.h"
+#include "mojo/examples/bitmap_uploader/bitmap_uploader.h"
#include "mojo/examples/wm_flow/app/embedder.mojom.h"
#include "mojo/examples/wm_flow/embedded/embeddee.mojom.h"
#include "mojo/public/cpp/application/application_connection.h"
@@ -41,12 +42,13 @@
class WMFlowEmbedded : public mojo::ApplicationDelegate,
public mojo::ViewManagerDelegate {
public:
- WMFlowEmbedded() {}
+ WMFlowEmbedded() : shell_(nullptr) {}
virtual ~WMFlowEmbedded() {}
private:
// Overridden from Application:
virtual void Initialize(mojo::ApplicationImpl* app) override {
+ shell_ = app->shell();
view_manager_client_factory_.reset(
new mojo::ViewManagerClientFactory(app->shell(), this));
}
@@ -62,7 +64,9 @@
mojo::View* root,
mojo::ServiceProviderImpl* exported_services,
scoped_ptr<mojo::ServiceProvider> imported_services) override {
- root->SetColor(SK_ColorMAGENTA);
+ bitmap_uploader_.reset(new mojo::BitmapUploader(root));
+ bitmap_uploader_->Init(shell_);
+ bitmap_uploader_->SetColor(SK_ColorMAGENTA);
exported_services->AddService(&embeddee_factory_);
mojo::ConnectToService(imported_services.get(), &embedder_);
@@ -76,9 +80,11 @@
printf("HelloWorld() ack'ed\n");
}
+ mojo::Shell* shell_;
scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_;
EmbedderPtr embedder_;
mojo::InterfaceFactoryImpl<EmbeddeeImpl> embeddee_factory_;
+ scoped_ptr<mojo::BitmapUploader> bitmap_uploader_;
DISALLOW_COPY_AND_ASSIGN(WMFlowEmbedded);
};
diff --git a/mojo/examples/wm_flow/wm/frame_controller.cc b/mojo/examples/wm_flow/wm/frame_controller.cc
index 7ed1dac..40ff041 100644
--- a/mojo/examples/wm_flow/wm/frame_controller.cc
+++ b/mojo/examples/wm_flow/wm/frame_controller.cc
@@ -95,6 +95,7 @@
// FrameController, public:
FrameController::FrameController(
+ mojo::Shell* shell,
mojo::View* view,
mojo::View** app_view,
aura::client::ActivationClient* activation_client,
@@ -117,7 +118,8 @@
frame_view_->AddPreTargetHandler(frame_event_handler_.get());
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.native_widget = new mojo::NativeWidgetViewManager(widget_, view_);
+ params.native_widget =
+ new mojo::NativeWidgetViewManager(widget_, shell, view_);
params.bounds = gfx::Rect(view_->bounds().size());
widget_->Init(params);
widget_->SetContentsView(frame_view_);
diff --git a/mojo/examples/wm_flow/wm/frame_controller.h b/mojo/examples/wm_flow/wm/frame_controller.h
index 2c7d9e9..0add0a1 100644
--- a/mojo/examples/wm_flow/wm/frame_controller.h
+++ b/mojo/examples/wm_flow/wm/frame_controller.h
@@ -17,6 +17,7 @@
namespace mojo {
class NativeWidgetViewManager;
+class Shell;
class View;
class WindowManagerApp;
}
@@ -31,7 +32,8 @@
// to any events targeted at it.
class FrameController : mojo::ViewObserver {
public:
- FrameController(mojo::View* view,
+ FrameController(mojo::Shell* shell,
+ mojo::View* view,
mojo::View** app_view,
aura::client::ActivationClient* activation_client,
mojo::WindowManagerApp* window_manager_app);
diff --git a/mojo/examples/wm_flow/wm/wm.cc b/mojo/examples/wm_flow/wm/wm.cc
index f2787fc..56d8b39 100644
--- a/mojo/examples/wm_flow/wm/wm.cc
+++ b/mojo/examples/wm_flow/wm/wm.cc
@@ -91,7 +91,8 @@
public mojo::ViewObserver {
public:
SimpleWM()
- : window_manager_app_(new mojo::WindowManagerApp(this, this)),
+ : shell_(nullptr),
+ window_manager_app_(new mojo::WindowManagerApp(this, this)),
view_manager_(NULL),
root_(NULL),
window_container_(NULL),
@@ -101,6 +102,7 @@
private:
// Overridden from mojo::ApplicationDelegate:
virtual void Initialize(mojo::ApplicationImpl* impl) override {
+ shell_ = impl->shell();
window_manager_app_->Initialize(impl);
}
virtual bool ConfigureIncomingConnection(
@@ -175,11 +177,13 @@
aura::client::ActivationClient* client = aura::client::GetActivationClient(
window_manager_app_->host()->window());
- new FrameController(frame_view, app_view, client,
- window_manager_app_.get());
+ new FrameController(
+ shell_, frame_view, app_view, client, window_manager_app_.get());
return frame_view;
}
+ mojo::Shell* shell_;
+
scoped_ptr<mojo::WindowManagerApp> window_manager_app_;
mojo::ViewManager* view_manager_;
diff --git a/mojo/gles2/BUILD.gn b/mojo/gles2/BUILD.gn
index 1f33403..4e1e13d 100644
--- a/mojo/gles2/BUILD.gn
+++ b/mojo/gles2/BUILD.gn
@@ -25,7 +25,7 @@
"//gpu/command_buffer/common",
"//mojo/environment:chromium",
"//mojo/public/c/system:for_component",
- "//mojo/services/gles2:bindings",
+ "//mojo/services/gles2:lib",
"//mojo/services/public/interfaces/gpu",
]
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp
index 091d0b3..2225224 100644
--- a/mojo/mojo.gyp
+++ b/mojo/mojo.gyp
@@ -25,6 +25,7 @@
'target_name': 'mojo',
'type': 'none',
'dependencies': [
+ 'edk/mojo_edk.gyp:mojo_edk',
'mojo_application_manager',
'mojo_application_manager_unittests',
'mojo_apps_js_unittests',
@@ -39,6 +40,7 @@
'mojo_example_service',
'mojo_geometry_lib',
'mojo_html_viewer',
+ 'mojo_input_events_lib',
'mojo_js_content_handler',
'mojo_js_standalone',
'mojo_js_unittests',
@@ -59,9 +61,10 @@
'mojo_surfaces_service',
'mojo_test_app',
'mojo_test_request_tracker_app',
- 'mojo_view_manager_lib',
'mojo_view_manager_lib_unittests',
'mojo_wget',
+ 'services/public/mojo_services_public.gyp:mojo_services_public',
+ 'public/mojo_public.gyp:mojo_public',
],
'conditions': [
['use_aura==1', {
@@ -76,13 +79,13 @@
'mojo_keyboard',
'mojo_media_viewer',
'mojo_nesting_app',
+ 'mojo_view_manager',
+ 'mojo_view_manager_unittests',
'mojo_window_manager',
'mojo_wm_flow_app',
'mojo_wm_flow_embedded',
'mojo_wm_flow_init',
'mojo_wm_flow_wm',
- 'mojo_view_manager',
- 'mojo_view_manager_unittests',
],
}],
['OS == "linux"', {
@@ -109,10 +112,10 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -148,15 +151,15 @@
'../base/base.gyp:base',
'../base/base.gyp:base_static',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_application_manager',
- 'mojo_base.gyp:mojo_application_bindings',
- 'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_application_chromium',
+ 'mojo_base.gyp:mojo_common_lib',
'mojo_external_service_bindings',
'mojo_gles2_impl',
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
'mojo_spy',
+ 'public/mojo_public.gyp:mojo_application_bindings',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'sources': [
@@ -226,7 +229,7 @@
'target_name': 'mojo_shell_test_support',
'type': 'static_library',
'dependencies': [
- 'mojo_base.gyp:mojo_system_impl',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_shell_lib',
],
'sources': [
@@ -266,10 +269,10 @@
'../testing/gtest.gyp:gtest',
'../net/net.gyp:net_test_support',
'../url/url.gyp:url_lib',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_application_manager',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_base.gyp:mojo_system_impl',
'mojo_shell_lib',
'mojo_test_app',
'mojo_test_request_tracker_app',
@@ -303,11 +306,11 @@
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../url/url.gyp:url_lib',
- 'mojo_content_handler_bindings',
- 'mojo_network_bindings',
- 'mojo_base.gyp:mojo_application_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_content_handler_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_environment_chromium',
+ 'public/mojo_public.gyp:mojo_application_bindings',
'<(mojo_system_for_component)',
],
'sources': [
@@ -321,8 +324,8 @@
],
'export_dependent_settings': [
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
- 'mojo_base.gyp:mojo_application_bindings',
- 'mojo_network_bindings',
+ 'public/mojo_public.gyp:mojo_application_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
],
},
{
@@ -333,12 +336,12 @@
'../base/base.gyp:base',
'../testing/gtest.gyp:gtest',
'../url/url.gyp:url_lib',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
'mojo_application_manager',
- 'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_base.gyp:mojo_run_all_unittests',
'mojo_base.gyp:mojo_application_chromium',
+ 'mojo_base.gyp:mojo_common_lib',
+ 'mojo_base.gyp:mojo_environment_chromium',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'sources': [
@@ -358,14 +361,14 @@
'../skia/skia.gyp:skia',
'../gpu/gpu.gyp:gles2_implementation',
'mojo_geometry_lib',
- 'mojo_surfaces_bindings',
'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'export_dependent_settings': [
- 'mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
],
'sources': [
'cc/context_provider_mojo.cc',
@@ -386,8 +389,8 @@
'../gpu/gpu.gyp:gles2_cmd_helper',
'../gpu/gpu.gyp:gles2_implementation',
'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_gles2_bindings',
- 'mojo_gpu_bindings',
+ 'mojo_gles2_lib',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
'<(mojo_system_for_component)',
],
'defines': [
@@ -403,7 +406,7 @@
],
},
'export_dependent_settings': [
- 'mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
],
'sources': [
'gles2/command_buffer_client_impl.cc',
@@ -424,12 +427,12 @@
'type': 'executable',
'dependencies': [
'../gin/gin.gyp:gin_test',
- 'mojo_base.gyp:mojo_common_test_support',
- 'mojo_base.gyp:mojo_environment_standalone',
+ 'edk/mojo_edk.gyp:mojo_common_test_support',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
'mojo_base.gyp:mojo_js_bindings_lib',
- 'mojo_base.gyp:mojo_public_test_interfaces',
- 'mojo_base.gyp:mojo_run_all_unittests',
- 'mojo_base.gyp:mojo_utility',
+ 'public/mojo_public.gyp:mojo_environment_standalone',
+ 'public/mojo_public.gyp:mojo_public_test_interfaces',
+ 'public/mojo_public.gyp:mojo_utility',
],
'sources': [
'bindings/js/tests/run_js_tests.cc',
@@ -459,11 +462,11 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
- 'mojo_base.gyp:mojo_application_bindings',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_environment_chromium',
'mojo_base.gyp:mojo_jni_headers',
'mojo_shell_lib',
+ 'public/mojo_public.gyp:mojo_application_bindings',
],
'sources': [
'shell/android/library_loader.cc',
@@ -502,10 +505,10 @@
'../testing/gtest.gyp:gtest',
'../net/net.gyp:net_test_support',
'../url/url.gyp:url_lib',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_application_manager',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_base.gyp:mojo_system_impl',
'mojo_shell_lib',
],
'sources': [
@@ -529,7 +532,12 @@
'../ui/events/events.gyp:events',
'../ui/events/events.gyp:events_base',
'mojo_cc_support',
- 'mojo_native_viewport_bindings',
+ 'mojo_geometry_lib',
+ 'mojo_surfaces_lib',
+ 'mojo_view_manager_lib',
+ 'public/mojo_public.gyp:mojo_application_base',
+ 'public/mojo_public.gyp:mojo_application_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
@@ -537,13 +545,14 @@
'sources': [
'aura/aura_init.cc',
'aura/aura_init.h',
- 'aura/context_factory_mojo.cc',
- 'aura/context_factory_mojo.h',
'aura/screen_mojo.cc',
'aura/screen_mojo.h',
+ 'aura/surface_binding.cc',
+ 'aura/surface_binding.h',
+ 'aura/surface_context_factory.cc',
+ 'aura/surface_context_factory.h',
'aura/window_tree_host_mojo.cc',
'aura/window_tree_host_mojo.h',
- 'aura/window_tree_host_mojo_delegate.h',
],
},
{
@@ -562,7 +571,8 @@
'../ui/wm/wm.gyp:wm',
'mojo_aura_support',
'mojo_views_support_internal',
- 'mojo_view_manager_bindings',
+ 'mojo_view_manager_lib',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
],
'sources': [
'views/input_method_mojo_linux.cc',
@@ -596,6 +606,27 @@
'MOJO_VIEWS_IMPLEMENTATION',
],
},
+ {
+ # GN version: //mojo/services/public/cpp/view_manager/lib:run_unittests
+ 'target_name': 'mojo_view_manager_run_unittests',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:test_support_base',
+ ],
+ 'sources': [
+ 'services/public/cpp/view_manager/lib/view_manager_test_suite.cc',
+ 'services/public/cpp/view_manager/lib/view_manager_test_suite.h',
+ 'services/public/cpp/view_manager/lib/view_manager_unittests.cc',
+ ],
+ 'conditions': [
+ ['use_x11==1', {
+ 'dependencies': [
+ '../ui/gfx/x/gfx_x11.gyp:gfx_x11',
+ ],
+ }],
+ ],
+ },
],
}],
['component!="shared_library" and OS=="linux"', {
@@ -615,9 +646,9 @@
'public/python/src/python_system_helper.h',
],
'dependencies': [
- 'mojo_base.gyp:mojo_environment_standalone',
- 'mojo_base.gyp:mojo_system',
- 'mojo_base.gyp:mojo_utility',
+ 'public/mojo_public.gyp:mojo_environment_standalone',
+ 'public/mojo_public.gyp:mojo_system',
+ 'public/mojo_public.gyp:mojo_utility',
],
'includes': [ '../third_party/cython/cython_compiler.gypi' ],
},
@@ -633,7 +664,7 @@
'python/system/mojo/embedder.pyx',
],
'dependencies': [
- 'mojo_base.gyp:mojo_system_impl',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
],
'includes': [ '../third_party/cython/cython_compiler.gypi' ],
},
@@ -716,7 +747,7 @@
'type': 'none',
'dependencies': [
'mojo_python',
- 'mojo_base.gyp:mojo_public_test_interfaces',
+ 'public/mojo_public.gyp:mojo_public_test_interfaces',
],
'includes': [
'../build/isolate.gypi',
diff --git a/mojo/mojo_apps.gypi b/mojo/mojo_apps.gypi
index ea597e3..0a7aa5c 100644
--- a/mojo/mojo_apps.gypi
+++ b/mojo/mojo_apps.gypi
@@ -19,8 +19,8 @@
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_environment_chromium',
'mojo_base.gyp:mojo_js_bindings_lib',
- 'mojo_gles2_bindings',
- 'mojo_native_viewport_bindings',
+ 'mojo_gles2_lib',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
@@ -29,8 +29,8 @@
'../base/base.gyp:base',
'../gin/gin.gyp:gin',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_gles2_bindings',
- 'mojo_native_viewport_bindings',
+ 'mojo_gles2_lib',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
],
'sources': [
'apps/js/mojo_runner_delegate.cc',
@@ -54,10 +54,10 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -66,12 +66,12 @@
'type': 'executable',
'dependencies': [
'../gin/gin.gyp:gin_test',
- 'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_common_test_support',
- 'mojo_base.gyp:mojo_public_test_interfaces',
- 'mojo_base.gyp:mojo_run_all_unittests',
+ 'edk/mojo_edk.gyp:mojo_common_test_support',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
'mojo_apps_js_bindings',
+ 'mojo_base.gyp:mojo_common_lib',
'mojo_js_lib',
+ 'public/mojo_public.gyp:mojo_public_test_interfaces',
],
'sources': [
'apps/js/test/handle_unittest.cc',
@@ -84,14 +84,14 @@
'target_name': 'mojo_js_apps_lib',
'type': 'static_library',
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_application_chromium',
'mojo_apps_js_bindings',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
+ 'mojo_base.gyp:mojo_application_chromium',
'mojo_js_lib',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
],
'sources': [
'apps/js/application_delegate_impl.cc',
@@ -104,7 +104,7 @@
'target_name': 'mojo_js_content_handler',
'type': 'loadable_module',
'dependencies': [
- 'mojo_content_handler_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_content_handler_bindings',
'mojo_js_apps_lib',
'<(mojo_system_for_loadable_module)',
],
diff --git a/mojo/mojo_base.gyp b/mojo/mojo_base.gyp
index fd942f4..704651f 100644
--- a/mojo/mojo_base.gyp
+++ b/mojo/mojo_base.gyp
@@ -7,8 +7,6 @@
# Mojo land like mojo_shell should be in mojo.gyp.
{
'includes': [
- 'mojo_public.gypi',
- 'mojo_public_tests.gypi',
'mojo_variables.gypi',
],
'targets': [
@@ -23,30 +21,16 @@
# to be built.
'mojo_common_lib',
'mojo_common_unittests',
- 'mojo_cpp_bindings',
- 'mojo_js_bindings',
'mojo_message_generator',
- 'mojo_message_pipe_perftests',
- 'mojo_public_application_unittests',
- 'mojo_public_test_utils',
- 'mojo_public_bindings_unittests',
- 'mojo_public_environment_unittests',
- 'mojo_public_system_perftests',
- 'mojo_public_system_unittests',
- 'mojo_public_utility_unittests',
- 'mojo_system',
- 'mojo_system_impl',
- 'mojo_system_unittests',
- 'mojo_utility',
],
'conditions': [
['OS == "android"', {
'dependencies': [
- 'mojo_bindings_java',
- 'mojo_public_java',
- 'mojo_system_java',
'libmojo_system_java',
+ 'mojo_system_java',
'mojo_test_apk',
+ 'public/mojo_public.gyp:mojo_bindings_java',
+ 'public/mojo_public.gyp:mojo_public_java',
],
}],
]
@@ -56,226 +40,6 @@
'type': 'none',
},
{
- # GN version: //mojo/common/test:run_all_unittests
- 'target_name': 'mojo_run_all_unittests',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../testing/gtest.gyp:gtest',
- 'mojo_system_impl',
- 'mojo_test_support',
- 'mojo_test_support_impl',
- ],
- 'sources': [
- 'common/test/run_all_unittests.cc',
- ],
- },
- {
- # GN version: //mojo/common/test:run_all_perftests
- 'target_name': 'mojo_run_all_perftests',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:test_support_base',
- 'mojo_system_impl',
- 'mojo_test_support',
- 'mojo_test_support_impl',
- ],
- 'sources': [
- 'common/test/run_all_perftests.cc',
- ],
- },
- {
- # GN version: //mojo/edk/system
- 'target_name': 'mojo_system_impl',
- 'type': '<(component)',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
- ],
- 'defines': [
- 'MOJO_SYSTEM_IMPL_IMPLEMENTATION',
- 'MOJO_SYSTEM_IMPLEMENTATION',
- 'MOJO_USE_SYSTEM_IMPL',
- ],
- 'sources': [
- 'edk/embedder/channel_init.cc',
- 'edk/embedder/channel_init.h',
- 'edk/embedder/embedder.cc',
- 'edk/embedder/embedder.h',
- 'edk/embedder/platform_channel_pair.cc',
- 'edk/embedder/platform_channel_pair.h',
- 'edk/embedder/platform_channel_pair_posix.cc',
- 'edk/embedder/platform_channel_pair_win.cc',
- 'edk/embedder/platform_channel_utils_posix.cc',
- 'edk/embedder/platform_channel_utils_posix.h',
- 'edk/embedder/platform_handle.cc',
- 'edk/embedder/platform_handle.h',
- 'edk/embedder/platform_handle_utils.h',
- 'edk/embedder/platform_handle_utils_posix.cc',
- 'edk/embedder/platform_handle_utils_win.cc',
- 'edk/embedder/platform_handle_vector.h',
- 'edk/embedder/platform_shared_buffer.h',
- 'edk/embedder/platform_support.h',
- 'edk/embedder/scoped_platform_handle.h',
- 'edk/embedder/simple_platform_shared_buffer.cc',
- 'edk/embedder/simple_platform_shared_buffer.h',
- 'edk/embedder/simple_platform_shared_buffer_posix.cc',
- 'edk/embedder/simple_platform_shared_buffer_win.cc',
- 'edk/embedder/simple_platform_support.cc',
- 'edk/embedder/simple_platform_support.h',
- 'edk/system/channel.cc',
- 'edk/system/channel.h',
- 'edk/system/channel_endpoint.cc',
- 'edk/system/channel_endpoint.h',
- 'edk/system/constants.h',
- 'edk/system/core.cc',
- 'edk/system/core.h',
- 'edk/system/data_pipe.cc',
- 'edk/system/data_pipe.h',
- 'edk/system/data_pipe_consumer_dispatcher.cc',
- 'edk/system/data_pipe_consumer_dispatcher.h',
- 'edk/system/data_pipe_producer_dispatcher.cc',
- 'edk/system/data_pipe_producer_dispatcher.h',
- 'edk/system/dispatcher.cc',
- 'edk/system/dispatcher.h',
- 'edk/system/entrypoints.cc',
- 'edk/system/handle_signals_state.h',
- 'edk/system/handle_table.cc',
- 'edk/system/handle_table.h',
- 'edk/system/local_data_pipe.cc',
- 'edk/system/local_data_pipe.h',
- 'edk/system/local_message_pipe_endpoint.cc',
- 'edk/system/local_message_pipe_endpoint.h',
- 'edk/system/mapping_table.cc',
- 'edk/system/mapping_table.h',
- 'edk/system/memory.cc',
- 'edk/system/memory.h',
- 'edk/system/message_in_transit.cc',
- 'edk/system/message_in_transit.h',
- 'edk/system/message_in_transit_queue.cc',
- 'edk/system/message_in_transit_queue.h',
- 'edk/system/message_pipe.cc',
- 'edk/system/message_pipe.h',
- 'edk/system/message_pipe_dispatcher.cc',
- 'edk/system/message_pipe_dispatcher.h',
- 'edk/system/message_pipe_endpoint.cc',
- 'edk/system/message_pipe_endpoint.h',
- 'edk/system/options_validation.h',
- 'edk/system/platform_handle_dispatcher.cc',
- 'edk/system/platform_handle_dispatcher.h',
- 'edk/system/proxy_message_pipe_endpoint.cc',
- 'edk/system/proxy_message_pipe_endpoint.h',
- 'edk/system/raw_channel.cc',
- 'edk/system/raw_channel.h',
- 'edk/system/raw_channel_posix.cc',
- 'edk/system/raw_channel_win.cc',
- 'edk/system/shared_buffer_dispatcher.cc',
- 'edk/system/shared_buffer_dispatcher.h',
- 'edk/system/simple_dispatcher.cc',
- 'edk/system/simple_dispatcher.h',
- 'edk/system/transport_data.cc',
- 'edk/system/transport_data.h',
- 'edk/system/waiter.cc',
- 'edk/system/waiter.h',
- 'edk/system/waiter_list.cc',
- 'edk/system/waiter_list.h',
- # Test-only code:
- # TODO(vtl): It's a little unfortunate that these end up in the same
- # component as non-test-only code. In the static build, this code should
- # hopefully be dead-stripped.
- 'edk/embedder/test_embedder.cc',
- 'edk/embedder/test_embedder.h',
- ],
- 'all_dependent_settings': {
- # Ensures that dependent projects import the core functions on Windows.
- 'defines': ['MOJO_USE_SYSTEM_IMPL'],
- }
- },
- {
- # GN version: //mojo/edk/system:mojo_system_unittests
- 'target_name': 'mojo_system_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../testing/gtest.gyp:gtest',
- 'mojo_common_test_support',
- 'mojo_system_impl',
- ],
- 'sources': [
- 'edk/embedder/embedder_unittest.cc',
- 'edk/embedder/platform_channel_pair_posix_unittest.cc',
- 'edk/embedder/simple_platform_shared_buffer_unittest.cc',
- 'edk/system/channel_unittest.cc',
- 'edk/system/core_unittest.cc',
- 'edk/system/core_test_base.cc',
- 'edk/system/core_test_base.h',
- 'edk/system/data_pipe_unittest.cc',
- 'edk/system/dispatcher_unittest.cc',
- 'edk/system/local_data_pipe_unittest.cc',
- 'edk/system/memory_unittest.cc',
- 'edk/system/message_pipe_dispatcher_unittest.cc',
- 'edk/system/message_pipe_test_utils.h',
- 'edk/system/message_pipe_test_utils.cc',
- 'edk/system/message_pipe_unittest.cc',
- 'edk/system/multiprocess_message_pipe_unittest.cc',
- 'edk/system/options_validation_unittest.cc',
- 'edk/system/platform_handle_dispatcher_unittest.cc',
- 'edk/system/raw_channel_unittest.cc',
- 'edk/system/remote_message_pipe_unittest.cc',
- 'edk/system/run_all_unittests.cc',
- 'edk/system/shared_buffer_dispatcher_unittest.cc',
- 'edk/system/simple_dispatcher_unittest.cc',
- 'edk/system/test_utils.cc',
- 'edk/system/test_utils.h',
- 'edk/system/waiter_list_unittest.cc',
- 'edk/system/waiter_test_utils.cc',
- 'edk/system/waiter_test_utils.h',
- 'edk/system/waiter_unittest.cc',
- ],
- 'conditions': [
- ['OS=="ios"', {
- 'sources!': [
- 'edk/embedder/embedder_unittest.cc',
- 'edk/system/multiprocess_message_pipe_unittest.cc',
- ],
- }],
- ],
- },
- {
- # GN version: //mojo/edk/system:mojo_message_pipe_perftests
- 'target_name': 'mojo_message_pipe_perftests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../base/base.gyp:test_support_perf',
- '../testing/gtest.gyp:gtest',
- 'mojo_common_test_support',
- 'mojo_environment_chromium',
- 'mojo_system_impl',
- ],
- 'sources': [
- 'edk/system/message_pipe_perftest.cc',
- 'edk/system/message_pipe_test_utils.h',
- 'edk/system/message_pipe_test_utils.cc',
- 'edk/system/test_utils.cc',
- 'edk/system/test_utils.h',
- ],
- },
- {
- # GN version: //mojo/common/test:test_support_impl
- 'target_name': 'mojo_test_support_impl',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:base',
- ],
- 'sources': [
- 'common/test/test_support_impl.cc',
- 'common/test/test_support_impl.h',
- ],
- },
- {
# GN version: //mojo/common
'target_name': 'mojo_common_lib',
'type': '<(component)',
@@ -306,31 +70,6 @@
],
},
{
- # GN version: //mojo/edk/test:test_support
- 'target_name': 'mojo_common_test_support',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../testing/gtest.gyp:gtest',
- 'mojo_system_impl',
- ],
- 'sources': [
- 'edk/test/multiprocess_test_helper.cc',
- 'edk/test/multiprocess_test_helper.h',
- 'edk/test/test_utils.h',
- 'edk/test/test_utils_posix.cc',
- 'edk/test/test_utils_win.cc',
- ],
- 'conditions': [
- ['OS=="ios"', {
- 'sources!': [
- 'edk/test/multiprocess_test_helper.cc',
- ],
- }],
- ],
- },
- {
# GN version: //mojo/common:mojo_common_unittests
'target_name': 'mojo_common_unittests',
'type': 'executable',
@@ -339,12 +78,12 @@
'../base/base.gyp:base_message_loop_tests',
'../testing/gtest.gyp:gtest',
'../url/url.gyp:url_lib',
- 'mojo_cpp_bindings',
- 'mojo_environment_chromium',
+ 'edk/mojo_edk.gyp:mojo_common_test_support',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
'mojo_common_lib',
- 'mojo_common_test_support',
- 'mojo_public_test_utils',
- 'mojo_run_all_unittests',
+ 'mojo_environment_chromium',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_public_test_utils',
],
'sources': [
'common/common_type_converters_unittest.cc',
@@ -412,12 +151,12 @@
'application/application_runner_chromium.h',
],
'dependencies': [
- 'mojo_application_base',
'mojo_common_lib',
'mojo_environment_chromium',
+ 'public/mojo_public.gyp:mojo_application_base',
],
'export_dependent_settings': [
- 'mojo_application_base',
+ 'public/mojo_public.gyp:mojo_application_base',
],
},
{
@@ -457,10 +196,10 @@
'dependencies': [
'../base/base.gyp:base',
'../testing/gtest.gyp:gtest',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_common_lib',
- 'mojo_cpp_bindings',
'mojo_environment_chromium',
- 'mojo_system_impl',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'sources': [
'tools/message_generator.cc',
@@ -502,7 +241,7 @@
'type': 'none',
'dependencies': [
'../base/base.gyp:base_java',
- 'mojo_public_java',
+ 'public/mojo_public.gyp:mojo_public_java',
],
'variables': {
'java_in_dir': '<(DEPTH)/mojo/android/system',
@@ -515,10 +254,10 @@
'dependencies': [
'../base/base.gyp:base',
'../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_common_lib',
'mojo_environment_chromium',
'mojo_jni_headers',
- 'mojo_system_impl',
],
'sources': [
'android/system/core_impl.cc',
@@ -533,7 +272,7 @@
'../base/base.gyp:test_support_base',
'libmojo_system_java',
'mojo_jni_headers',
- 'mojo_public_bindings_test_utils',
+ 'public/mojo_public.gyp:mojo_public_bindings_test_utils',
],
'defines': [
'UNIT_TEST' # As exported from testing/gtest.gyp:gtest.
@@ -550,10 +289,10 @@
'target_name': 'mojo_test_apk',
'type': 'none',
'dependencies': [
- 'mojo_bindings_java',
- 'mojo_public_test_interfaces',
- 'mojo_system_java',
'../base/base.gyp:base_java_test_support',
+ 'public/mojo_public.gyp:mojo_bindings_java',
+ 'mojo_system_java',
+ 'public/mojo_public.gyp:mojo_public_test_interfaces',
],
'variables': {
'apk_name': 'MojoTest',
diff --git a/mojo/mojo_examples.gypi b/mojo/mojo_examples.gypi
index 9638743..382d61f 100644
--- a/mojo/mojo_examples.gypi
+++ b/mojo/mojo_examples.gypi
@@ -9,10 +9,10 @@
'target_name': 'mojo_echo_client',
'type': 'loadable_module',
'dependencies': [
- 'mojo_base.gyp:mojo_application_standalone',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
'mojo_echo_service_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -34,11 +34,11 @@
'examples/echo/echo_service.mojom',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -46,10 +46,10 @@
'target_name': 'mojo_echo_service',
'type': 'loadable_module',
'dependencies': [
- 'mojo_base.gyp:mojo_application_standalone',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
'mojo_echo_service_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -69,12 +69,12 @@
'type': 'loadable_module',
'dependencies': [
'../base/base.gyp:base',
- 'mojo_base.gyp:mojo_application_standalone',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_geometry_bindings',
- 'mojo_gpu_bindings',
- 'mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -104,10 +104,10 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -115,10 +115,10 @@
'target_name': 'mojo_example_service',
'type': 'loadable_module',
'dependencies': [
- 'mojo_base.gyp:mojo_application_standalone', # For ApplicationDelegate.
- 'mojo_base.gyp:mojo_cpp_bindings', # For *.mojom.h
'mojo_example_service_bindings',
- 'mojo_base.gyp:mojo_utility', # For RunLoop.
+ 'public/mojo_public.gyp:mojo_application_standalone', # For ApplicationDelegate.
+ 'public/mojo_public.gyp:mojo_cpp_bindings', # For *.mojom.h
+ 'public/mojo_public.gyp:mojo_utility', # For RunLoop.
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -134,10 +134,10 @@
'type': 'loadable_module',
'dependencies': [
'../testing/gtest.gyp:gtest',
- 'mojo_base.gyp:mojo_application_standalone', # For ApplicationDelegate.
'mojo_example_service',
'mojo_example_service_bindings',
- 'mojo_base.gyp:mojo_utility', # For RunLoop.
+ 'public/mojo_public.gyp:mojo_application_standalone', # For ApplicationDelegate.
+ 'public/mojo_public.gyp:mojo_utility', # For RunLoop.
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -167,10 +167,10 @@
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
'mojo_cc_support',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
- 'mojo_gpu_bindings',
- 'mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -194,10 +194,10 @@
'target_name': 'mojo_wget',
'type': 'loadable_module',
'dependencies': [
- 'mojo_base.gyp:mojo_application_standalone',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone', # For ApplicationDelegate.
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -209,10 +209,10 @@
'target_name': 'mojo_content_handler_demo',
'type': 'loadable_module',
'dependencies': [
- 'mojo_base.gyp:mojo_application_standalone',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_content_handler_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_content_handler_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone', # For ApplicationDelegate.
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -235,10 +235,10 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -249,12 +249,13 @@
'../skia/skia.gyp:skia',
'../ui/gfx/gfx.gyp:gfx',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_content_handler_bindings',
+ 'mojo_bitmap_uploader',
'mojo_media_viewer_bindings',
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_content_handler_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
'mojo_view_manager_lib',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -274,9 +275,9 @@
'../ui/events/events.gyp:events_base',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_geometry_bindings',
- 'mojo_gpu_bindings',
- 'mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -372,13 +373,14 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
- 'mojo_gpu_bindings',
- 'mojo_native_viewport_bindings',
- 'mojo_surfaces_bindings',
'mojo_surfaces_app_bindings',
'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -398,12 +400,12 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -426,11 +428,13 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
'mojo_surfaces_app_bindings',
- 'mojo_surfaces_bindings',
'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_surface_id_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -449,17 +453,19 @@
'../base/base.gyp:base',
'../cc/cc.gyp:cc',
'../cc/cc.gyp:cc_surfaces',
+ '../gpu/gpu.gyp:gpu',
'../skia/skia.gyp:skia',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
- 'mojo_gpu_bindings',
'mojo_surfaces_app_bindings',
- 'mojo_surfaces_bindings',
'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -474,7 +480,42 @@
'examples/sample_app/spinning_cube.cc',
'examples/sample_app/spinning_cube.h',
],
- }
+ },
+ {
+ # GN version: //mojo/examples/bitmap_uploader
+ 'target_name': 'mojo_bitmap_uploader',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../cc/cc.gyp:cc_surfaces',
+ '../gpu/gpu.gyp:gpu',
+ '../skia/skia.gyp:skia',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ '../third_party/khronos/khronos.gyp:khronos_headers',
+ 'mojo_base.gyp:mojo_application_chromium',
+ 'mojo_geometry_lib',
+ 'mojo_surfaces_lib',
+ 'public/mojo_public.gyp:mojo_application_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surface_id_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
+ ],
+ 'includes': [
+ 'mojo_public_gles2_for_loadable_module.gypi',
+ ],
+ 'sources': [
+ 'examples/bitmap_uploader/bitmap_uploader.cc',
+ 'examples/bitmap_uploader/bitmap_uploader.h',
+ ],
+ 'export_dependent_settings': [
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
+ ],
+ },
],
'conditions': [
['use_aura==1', {
@@ -491,12 +532,12 @@
'../ui/compositor/compositor.gyp:compositor',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
+ 'mojo_aura_support',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_aura_support',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
'mojo_view_manager_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -510,7 +551,7 @@
'dependencies': [
'../base/base.gyp:base',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'mojo_view_manager_lib',
'<(mojo_system_for_loadable_module)',
],
@@ -536,17 +577,17 @@
'../ui/resources/ui_resources.gyp:ui_test_pak',
'../ui/views/views.gyp:views',
'../url/url.gyp:url_lib',
+ 'mojo_aura_support',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_aura_support',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
'mojo_input_events_lib',
- 'mojo_navigation_bindings',
- 'mojo_views_support',
- 'mojo_view_manager_bindings',
'mojo_view_manager_lib',
+ 'mojo_views_support',
'mojo_window_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -570,11 +611,11 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_geometry_bindings',
- 'mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'mojo_view_manager_lib',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -602,17 +643,17 @@
'../ui/resources/ui_resources.gyp:ui_test_pak',
'../ui/views/views.gyp:views',
'../url/url.gyp:url_lib',
+ 'mojo_aura_support',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_aura_support',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
'mojo_input_events_lib',
'mojo_keyboard_bindings',
- 'mojo_navigation_bindings',
- 'mojo_views_support',
- 'mojo_view_manager_bindings',
'mojo_view_manager_lib',
+ 'mojo_views_support',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -633,10 +674,10 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -647,12 +688,12 @@
'examples/window_manager/window_manager.mojom',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -669,19 +710,19 @@
'../ui/resources/ui_resources.gyp:ui_test_pak',
'../ui/views/views.gyp:views',
'../ui/wm/wm.gyp:wm',
- 'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
'mojo_aura_support',
+ 'mojo_base.gyp:mojo_application_chromium',
'mojo_core_window_manager_lib',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
'mojo_input_events_lib',
'mojo_keyboard_bindings',
- 'mojo_navigation_bindings',
'mojo_view_manager_lib',
'mojo_views_support',
'mojo_window_manager_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -702,12 +743,13 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'../url/url.gyp:url_lib',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_geometry_bindings',
- 'mojo_navigation_bindings',
+ 'mojo_bitmap_uploader',
'mojo_view_manager_lib',
'mojo_window_manager_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -726,12 +768,13 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'../url/url.gyp:url_lib',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_geometry_bindings',
- 'mojo_navigation_bindings',
+ 'mojo_bitmap_uploader',
'mojo_view_manager_lib',
'mojo_window_manager_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -748,15 +791,16 @@
'dependencies': [
'../base/base.gyp:base',
'../skia/skia.gyp:skia',
+ '../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/views/views.gyp:views',
'mojo_base.gyp:mojo_application_chromium',
'mojo_input_events_lib',
'mojo_media_viewer_bindings',
- 'mojo_navigation_bindings',
- 'mojo_views_support',
- 'mojo_view_manager_bindings',
'mojo_view_manager_lib',
+ 'mojo_views_support',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -790,7 +834,7 @@
'dependencies': [
'../base/base.gyp:base',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'mojo_view_manager_lib',
'<(mojo_system_for_loadable_module)',
],
@@ -806,11 +850,11 @@
'examples/wm_flow/app/embedder.mojom',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -821,11 +865,11 @@
'examples/wm_flow/embedded/embeddee.mojom',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -835,10 +879,11 @@
'dependencies': [
'../base/base.gyp:base',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_core_window_manager_bindings',
+ 'mojo_bitmap_uploader',
'mojo_view_manager_lib',
'mojo_wm_flow_embeddee_bindings',
'mojo_wm_flow_embedder_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_core_window_manager_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -852,10 +897,11 @@
'dependencies': [
'../base/base.gyp:base',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_core_window_manager_bindings',
+ 'mojo_bitmap_uploader',
'mojo_view_manager_lib',
'mojo_wm_flow_embeddee_bindings',
'mojo_wm_flow_embedder_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_core_window_manager_bindings',
'<(mojo_system_for_loadable_module)',
],
'sources': [
diff --git a/mojo/mojo_nacl.gyp b/mojo/mojo_nacl.gyp
index a813046..ea16dee 100644
--- a/mojo/mojo_nacl.gyp
+++ b/mojo/mojo_nacl.gyp
@@ -61,7 +61,7 @@
'type': 'executable',
'dependencies': [
'../base/base.gyp:base',
- 'mojo_base.gyp:mojo_system_impl',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'monacl_sel',
],
'sources': [
diff --git a/mojo/mojo_public.gypi b/mojo/mojo_public.gypi
deleted file mode 100644
index cc7fc15..0000000
--- a/mojo/mojo_public.gypi
+++ /dev/null
@@ -1,257 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
- 'targets': [
- {
- # GN version: //mojo/public/c/system
- 'target_name': 'mojo_system',
- 'type': 'static_library',
- 'defines': [
- 'MOJO_SYSTEM_IMPLEMENTATION',
- ],
- 'include_dirs': [
- '..',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '..',
- ],
- },
- 'all_dependent_settings': {
- 'conditions': [
- # We need to be able to call the MojoSetSystemThunks() function in
- # system_thunks.cc
- ['OS=="android"', {
- 'ldflags!': [
- '-Wl,--exclude-libs=ALL',
- ],
- }],
- ],
- },
- 'sources': [
- 'public/c/system/buffer.h',
- 'public/c/system/core.h',
- 'public/c/system/data_pipe.h',
- 'public/c/system/functions.h',
- 'public/c/system/macros.h',
- 'public/c/system/message_pipe.h',
- 'public/c/system/system_export.h',
- 'public/c/system/types.h',
- 'public/platform/native/system_thunks.cc',
- 'public/platform/native/system_thunks.h',
- ],
- },
- {
- # GN version: //mojo/public/cpp/bindings
- 'target_name': 'mojo_cpp_bindings',
- 'type': 'static_library',
- 'include_dirs': [
- '..'
- ],
- 'sources': [
- 'public/cpp/bindings/array.h',
- 'public/cpp/bindings/callback.h',
- 'public/cpp/bindings/error_handler.h',
- 'public/cpp/bindings/interface_impl.h',
- 'public/cpp/bindings/interface_ptr.h',
- 'public/cpp/bindings/interface_request.h',
- 'public/cpp/bindings/message.h',
- 'public/cpp/bindings/message_filter.h',
- 'public/cpp/bindings/no_interface.h',
- 'public/cpp/bindings/string.h',
- 'public/cpp/bindings/type_converter.h',
- 'public/cpp/bindings/lib/array_internal.h',
- 'public/cpp/bindings/lib/array_internal.cc',
- 'public/cpp/bindings/lib/array_serialization.h',
- 'public/cpp/bindings/lib/bindings_internal.h',
- 'public/cpp/bindings/lib/bindings_serialization.cc',
- 'public/cpp/bindings/lib/bindings_serialization.h',
- 'public/cpp/bindings/lib/bounds_checker.cc',
- 'public/cpp/bindings/lib/bounds_checker.h',
- 'public/cpp/bindings/lib/buffer.h',
- 'public/cpp/bindings/lib/callback_internal.h',
- 'public/cpp/bindings/lib/connector.cc',
- 'public/cpp/bindings/lib/connector.h',
- 'public/cpp/bindings/lib/filter_chain.cc',
- 'public/cpp/bindings/lib/filter_chain.h',
- 'public/cpp/bindings/lib/fixed_buffer.cc',
- 'public/cpp/bindings/lib/fixed_buffer.h',
- 'public/cpp/bindings/lib/interface_impl_internal.h',
- 'public/cpp/bindings/lib/interface_ptr_internal.h',
- 'public/cpp/bindings/lib/message.cc',
- 'public/cpp/bindings/lib/message_builder.cc',
- 'public/cpp/bindings/lib/message_builder.h',
- 'public/cpp/bindings/lib/message_filter.cc',
- 'public/cpp/bindings/lib/message_header_validator.cc',
- 'public/cpp/bindings/lib/message_header_validator.h',
- 'public/cpp/bindings/lib/message_internal.h',
- 'public/cpp/bindings/lib/message_queue.cc',
- 'public/cpp/bindings/lib/message_queue.h',
- 'public/cpp/bindings/lib/no_interface.cc',
- 'public/cpp/bindings/lib/router.cc',
- 'public/cpp/bindings/lib/router.h',
- 'public/cpp/bindings/lib/shared_data.h',
- 'public/cpp/bindings/lib/shared_ptr.h',
- 'public/cpp/bindings/lib/string_serialization.h',
- 'public/cpp/bindings/lib/string_serialization.cc',
- 'public/cpp/bindings/lib/validation_errors.cc',
- 'public/cpp/bindings/lib/validation_errors.h',
- ],
- },
- {
- # GN version: //mojo/public/js/bindings
- 'target_name': 'mojo_js_bindings',
- 'type': 'static_library',
- 'include_dirs': [
- '..'
- ],
- 'sources': [
- 'public/js/bindings/constants.cc',
- 'public/js/bindings/constants.h',
- ],
- },
- {
- # GN version: //mojo/public/cpp/environment:standalone
- 'target_name': 'mojo_environment_standalone',
- 'type': 'static_library',
- 'sources': [
- 'public/c/environment/async_waiter.h',
- 'public/c/environment/logger.h',
- 'public/cpp/environment/environment.h',
- 'public/cpp/environment/lib/default_async_waiter.cc',
- 'public/cpp/environment/lib/default_async_waiter.h',
- 'public/cpp/environment/lib/default_logger.cc',
- 'public/cpp/environment/lib/default_logger.h',
- 'public/cpp/environment/lib/environment.cc',
- 'public/cpp/environment/lib/logging.cc',
- 'public/cpp/environment/logging.h',
- ],
- 'include_dirs': [
- '..',
- ],
- },
- {
- # GN version: //mojo/public/cpp/utility
- 'target_name': 'mojo_utility',
- 'type': 'static_library',
- 'sources': [
- 'public/cpp/utility/mutex.h',
- 'public/cpp/utility/run_loop.h',
- 'public/cpp/utility/run_loop_handler.h',
- 'public/cpp/utility/thread.h',
- 'public/cpp/utility/lib/mutex.cc',
- 'public/cpp/utility/lib/run_loop.cc',
- 'public/cpp/utility/lib/thread.cc',
- 'public/cpp/utility/lib/thread_local.h',
- 'public/cpp/utility/lib/thread_local_posix.cc',
- 'public/cpp/utility/lib/thread_local_win.cc',
- ],
- 'conditions': [
- # See crbug.com/342893:
- ['OS=="win"', {
- 'sources!': [
- 'public/cpp/utility/mutex.h',
- 'public/cpp/utility/thread.h',
- 'public/cpp/utility/lib/mutex.cc',
- 'public/cpp/utility/lib/thread.cc',
- ],
- }],
- ],
- 'include_dirs': [
- '..',
- ],
- },
- {
- # GN version: //mojo/public/interfaces/application:application
- 'target_name': 'mojo_application_bindings',
- 'type': 'static_library',
- 'sources': [
- 'public/interfaces/application/application.mojom',
- 'public/interfaces/application/service_provider.mojom',
- 'public/interfaces/application/shell.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_cpp_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_cpp_bindings',
- ],
- },
- {
- # GN version: //mojo/public/cpp/application
- 'target_name': 'mojo_application_base',
- 'type': 'static_library',
- 'sources': [
- 'public/cpp/application/application_connection.h',
- 'public/cpp/application/application_delegate.h',
- 'public/cpp/application/application_impl.h',
- 'public/cpp/application/connect.h',
- 'public/cpp/application/service_provider_impl.h',
- 'public/cpp/application/interface_factory.h',
- 'public/cpp/application/interface_factory_impl.h',
- 'public/cpp/application/lib/application_connection.cc',
- 'public/cpp/application/lib/application_delegate.cc',
- 'public/cpp/application/lib/application_impl.cc',
- 'public/cpp/application/lib/service_provider_impl.cc',
- 'public/cpp/application/lib/service_connector.cc',
- 'public/cpp/application/lib/service_connector.h',
- 'public/cpp/application/lib/service_registry.cc',
- 'public/cpp/application/lib/service_registry.h',
- 'public/cpp/application/lib/weak_service_provider.cc',
- 'public/cpp/application/lib/weak_service_provider.h',
- ],
- 'dependencies': [
- 'mojo_application_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_application_bindings',
- ],
- },
- {
- # GN version: //mojo/public/cpp/application:standalone"
- 'target_name': 'mojo_application_standalone',
- 'type': 'static_library',
- 'sources': [
- 'public/cpp/application/lib/application_runner.cc',
- 'public/cpp/application/application_runner.h',
- ],
- 'dependencies': [
- 'mojo_application_base',
- 'mojo_environment_standalone',
- ],
- 'export_dependent_settings': [
- 'mojo_application_base',
- ],
- },
- ],
- 'conditions': [
- ['OS == "android"', {
- 'targets': [
- {
- # GN version: //mojo/public/java_system
- 'target_name': 'mojo_public_java',
- 'type': 'none',
- 'variables': {
- 'java_in_dir': 'public/java/system',
- },
- 'includes': [ '../build/java.gypi' ],
- },
- {
- # GN version: //mojo/public/java_bindings
- 'target_name': 'mojo_bindings_java',
- 'type': 'none',
- 'variables': {
- 'java_in_dir': 'public/java/bindings',
- },
- 'dependencies': [
- 'mojo_public_java',
- ],
- 'includes': [ '../build/java.gypi' ],
- },
- ],
- }],
- ],
-}
diff --git a/mojo/mojo_public_gles2_for_loadable_module.gypi b/mojo/mojo_public_gles2_for_loadable_module.gypi
index 54c1a49..2f91651 100644
--- a/mojo/mojo_public_gles2_for_loadable_module.gypi
+++ b/mojo/mojo_public_gles2_for_loadable_module.gypi
@@ -10,7 +10,7 @@
'conditions': [
['component=="shared_library"', {
'dependencies': [
- 'mojo.gyp:mojo_gles2_impl',
+ '<(DEPTH)/mojo/mojo.gyp:mojo_gles2_impl',
],
}, { # component!="shared_library"
'defines': [
@@ -18,14 +18,14 @@
'GLES2_USE_MOJO',
],
'include_dirs': [
- '..',
+ '<(DEPTH)',
],
'dependencies': [
- '../third_party/khronos/khronos.gyp:khronos_headers'
+ '<(DEPTH)/third_party/khronos/khronos.gyp:khronos_headers'
],
'direct_dependent_settings': {
'include_dirs': [
- '..',
+ '<(DEPTH)',
],
'defines': [
'GLES2_USE_MOJO',
@@ -43,16 +43,16 @@
],
},
'sources': [
- 'public/c/gles2/gles2.h',
- 'public/c/gles2/gles2_export.h',
- 'public/platform/native/gles2_thunks.cc',
- 'public/platform/native/gles2_thunks.h',
- 'public/platform/native/gles2_impl_thunks.cc',
- 'public/platform/native/gles2_impl_thunks.h',
- 'public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.cc',
- 'public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.h',
- 'public/platform/native/gles2_impl_chromium_sync_point_thunks.cc',
- 'public/platform/native/gles2_impl_chromium_sync_point_thunks.h',
+ '<(DEPTH)/mojo/public/c/gles2/gles2.h',
+ '<(DEPTH)/mojo/public/c/gles2/gles2_export.h',
+ '<(DEPTH)/mojo/public/platform/native/gles2_thunks.cc',
+ '<(DEPTH)/mojo/public/platform/native/gles2_thunks.h',
+ '<(DEPTH)/mojo/public/platform/native/gles2_impl_thunks.cc',
+ '<(DEPTH)/mojo/public/platform/native/gles2_impl_thunks.h',
+ '<(DEPTH)/mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.cc',
+ '<(DEPTH)/mojo/public/platform/native/gles2_impl_chromium_texture_mailbox_thunks.h',
+ '<(DEPTH)/mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.cc',
+ '<(DEPTH)/mojo/public/platform/native/gles2_impl_chromium_sync_point_thunks.h',
],
}]
]
diff --git a/mojo/mojo_public_tests.gypi b/mojo/mojo_public_tests.gypi
deleted file mode 100644
index 6cf4730..0000000
--- a/mojo/mojo_public_tests.gypi
+++ /dev/null
@@ -1,217 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-{
- 'targets': [
- {
- # GN version: //mojo/public/c/test_support
- 'target_name': 'mojo_test_support',
- 'defines': [
- 'MOJO_TEST_SUPPORT_IMPLEMENTATION',
- ],
- 'include_dirs': [
- '..',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '..',
- ],
- },
- 'sources': [
- 'public/c/test_support/test_support.h',
- 'public/c/test_support/test_support_export.h',
- # TODO(vtl): Convert this to thunks http://crbug.com/386799
- 'public/tests/test_support_private.cc',
- 'public/tests/test_support_private.h',
- ],
- 'conditions': [
- ['OS=="ios"', {
- 'type': 'static_library',
- }, {
- 'type': 'shared_library',
- }],
- ['OS=="mac"', {
- 'xcode_settings': {
- # Make it a run-path dependent library.
- 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
- },
- }],
- ],
- },
- {
- # GN version: //mojo/public/cpp/test_support:test_utils
- 'target_name': 'mojo_public_test_utils',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:base',
- '../testing/gtest.gyp:gtest',
- 'mojo_test_support',
- ],
- 'sources': [
- 'public/cpp/test_support/lib/test_support.cc',
- 'public/cpp/test_support/lib/test_utils.cc',
- 'public/cpp/test_support/test_utils.h',
- ],
- },
- {
- # GN version: //mojo/public/cpp/bindings/tests:mojo_public_bindings_test_utils
- 'target_name': 'mojo_public_bindings_test_utils',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:base',
- ],
- 'sources': [
- 'public/cpp/bindings/tests/validation_test_input_parser.cc',
- 'public/cpp/bindings/tests/validation_test_input_parser.h',
- ],
- },
- # TODO(vtl): Reorganize the mojo_public_*_unittests.
- {
- # GN version: //mojo/public/cpp/bindings/tests:mojo_public_bindings_unittests
- 'target_name': 'mojo_public_bindings_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../testing/gtest.gyp:gtest',
- 'mojo_cpp_bindings',
- 'mojo_environment_standalone',
- 'mojo_public_test_utils',
- 'mojo_run_all_unittests',
- 'mojo_public_bindings_test_utils',
- 'mojo_public_test_interfaces',
- 'mojo_utility',
- ],
- 'sources': [
- 'public/cpp/bindings/tests/array_unittest.cc',
- 'public/cpp/bindings/tests/bounds_checker_unittest.cc',
- 'public/cpp/bindings/tests/buffer_unittest.cc',
- 'public/cpp/bindings/tests/connector_unittest.cc',
- 'public/cpp/bindings/tests/handle_passing_unittest.cc',
- 'public/cpp/bindings/tests/interface_ptr_unittest.cc',
- 'public/cpp/bindings/tests/request_response_unittest.cc',
- 'public/cpp/bindings/tests/router_unittest.cc',
- 'public/cpp/bindings/tests/sample_service_unittest.cc',
- 'public/cpp/bindings/tests/serialization_warning_unittest.cc',
- 'public/cpp/bindings/tests/string_unittest.cc',
- 'public/cpp/bindings/tests/struct_unittest.cc',
- 'public/cpp/bindings/tests/type_conversion_unittest.cc',
- 'public/cpp/bindings/tests/validation_unittest.cc',
- ],
- },
- {
- # GN version: //mojo/public/cpp/environment/tests:mojo_public_environment_unittests
- 'target_name': 'mojo_public_environment_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../testing/gtest.gyp:gtest',
- 'mojo_environment_standalone',
- 'mojo_public_test_utils',
- 'mojo_run_all_unittests',
- 'mojo_utility',
- ],
- 'include_dirs': [ '..' ],
- 'sources': [
- 'public/cpp/environment/tests/async_waiter_unittest.cc',
- 'public/cpp/environment/tests/logger_unittest.cc',
- 'public/cpp/environment/tests/logging_unittest.cc',
- ],
- },
- {
- # GN version: //mojo/public/cpp/application/tests:mojo_public_application_unittests
- 'target_name': 'mojo_public_application_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../testing/gtest.gyp:gtest',
- 'mojo_application_standalone',
- 'mojo_utility',
- 'mojo_environment_standalone',
- 'mojo_run_all_unittests',
- ],
- 'sources': [
- 'public/cpp/application/tests/service_registry_unittest.cc',
- ],
- },
- {
- # GN version: //mojo/public/cpp/application/tests:mojo_public_system_unittests
- 'target_name': 'mojo_public_system_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../testing/gtest.gyp:gtest',
- 'mojo_public_test_utils',
- 'mojo_run_all_unittests',
- ],
- 'include_dirs': [ '..' ],
- 'sources': [
- '<@(mojo_public_system_unittest_sources)',
- ],
- },
- {
- # GN version: //mojo/public/cpp/application/tests:mojo_public_utility_unittests
- 'target_name': 'mojo_public_utility_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../testing/gtest.gyp:gtest',
- 'mojo_public_test_utils',
- 'mojo_run_all_unittests',
- 'mojo_utility',
- ],
- 'include_dirs' : [ '..' ],
- 'sources': [
- 'public/cpp/utility/tests/mutex_unittest.cc',
- 'public/cpp/utility/tests/run_loop_unittest.cc',
- 'public/cpp/utility/tests/thread_unittest.cc',
- ],
- 'conditions': [
- # See crbug.com/342893:
- ['OS=="win"', {
- 'sources!': [
- 'public/cpp/utility/tests/mutex_unittest.cc',
- 'public/cpp/utility/tests/thread_unittest.cc',
- ],
- }],
- ],
- },
- {
- # GN version: //mojo/public/c/system/tests:perftests
- 'target_name': 'mojo_public_system_perftests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../testing/gtest.gyp:gtest',
- 'mojo_public_test_utils',
- 'mojo_run_all_perftests',
- 'mojo_utility',
- ],
- 'sources': [
- 'public/c/system/tests/core_perftest.cc',
- ],
- },
- {
- # GN version: //mojo/public/interfaces/bindings/tests:test_interfaces
- 'target_name': 'mojo_public_test_interfaces',
- 'type': 'static_library',
- 'sources': [
- 'public/interfaces/bindings/tests/math_calculator.mojom',
- 'public/interfaces/bindings/tests/no_module.mojom',
- 'public/interfaces/bindings/tests/rect.mojom',
- 'public/interfaces/bindings/tests/regression_tests.mojom',
- 'public/interfaces/bindings/tests/sample_factory.mojom',
- 'public/interfaces/bindings/tests/sample_import.mojom',
- 'public/interfaces/bindings/tests/sample_import2.mojom',
- 'public/interfaces/bindings/tests/sample_interfaces.mojom',
- 'public/interfaces/bindings/tests/sample_service.mojom',
- 'public/interfaces/bindings/tests/serialization_test_structs.mojom',
- 'public/interfaces/bindings/tests/test_structs.mojom',
- 'public/interfaces/bindings/tests/validation_test_interfaces.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'export_dependent_settings': [
- 'mojo_cpp_bindings',
- ],
- 'dependencies': [
- 'mojo_cpp_bindings',
- ],
- },
- ],
-}
diff --git a/mojo/mojo_services.gypi b/mojo/mojo_services.gypi
index 4c0e103..5b2bd9c 100644
--- a/mojo/mojo_services.gypi
+++ b/mojo/mojo_services.gypi
@@ -10,11 +10,11 @@
'type': 'loadable_module',
'dependencies': [
'../base/base.gyp:base',
- 'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_clipboard_bindings',
+ 'mojo_base.gyp:mojo_common_lib',
+ 'services/public/mojo_services_public.gyp:mojo_clipboard_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -24,21 +24,6 @@
],
},
{
- # GN version: //mojo/services/public/interfaces/clipboard
- 'target_name': 'mojo_clipboard_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/clipboard/clipboard.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- },
- {
# GN version: //mojo/services/clipboard:mojo_clipboard_unittests
'target_name': 'mojo_clipboard_unittests',
'type': 'executable',
@@ -46,11 +31,11 @@
'../base/base.gyp:base',
'../base/base.gyp:test_support_base',
'../testing/gtest.gyp:gtest',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_application_manager',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_run_all_unittests',
- 'mojo_base.gyp:mojo_system_impl',
- 'mojo_clipboard_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_clipboard_bindings',
'mojo_shell_test_support',
],
'sources': [
@@ -58,8 +43,8 @@
],
},
{
- # GN version: //mojo/services/gles2:bindings
- 'target_name': 'mojo_gles2_bindings',
+ # GN version: //mojo/services/gles2:lib
+ 'target_name': 'mojo_gles2_lib',
'type': 'static_library',
'sources': [
'services/gles2/command_buffer_type_conversions.cc',
@@ -67,15 +52,14 @@
'services/gles2/mojo_buffer_backing.cc',
'services/gles2/mojo_buffer_backing.h',
],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_gpu_bindings',
'../gpu/gpu.gyp:command_buffer_common',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -95,16 +79,16 @@
'../url/url.gyp:url_lib',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_clipboard_bindings',
'mojo_cc_support',
- 'mojo_content_handler_bindings',
- 'mojo_gpu_bindings',
- 'mojo_navigation_bindings',
- 'mojo_network_bindings',
- 'mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_clipboard_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_content_handler_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_navigation_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
'mojo_view_manager_lib',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'include_dirs': [
@@ -149,147 +133,6 @@
],
},
{
- # GN version: //mojo/services/public/cpp/input_events
- 'target_name': 'mojo_input_events_lib',
- 'type': '<(component)',
- 'defines': [
- 'MOJO_INPUT_EVENTS_IMPLEMENTATION',
- ],
- 'dependencies': [
- '../base/base.gyp:base',
- '../ui/events/events.gyp:events',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_input_events_bindings',
- 'mojo_geometry_bindings',
- 'mojo_geometry_lib',
- '<(mojo_system_for_component)',
- ],
- 'sources': [
- 'services/public/cpp/input_events/lib/input_events_type_converters.cc',
- 'services/public/cpp/input_events/lib/mojo_extended_key_event_data.cc',
- 'services/public/cpp/input_events/lib/mojo_extended_key_event_data.h',
- 'services/public/cpp/input_events/input_events_type_converters.h',
- 'services/public/cpp/input_events/mojo_input_events_export.h',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/input_events
- 'target_name': 'mojo_input_events_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/input_events/input_event_constants.mojom',
- 'services/public/interfaces/input_events/input_events.mojom',
- 'services/public/interfaces/input_events/input_key_codes.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/geometry
- 'target_name': 'mojo_geometry_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/geometry/geometry.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/geometry
- 'target_name': 'mojo_geometry_lib',
- 'type': '<(component)',
- 'defines': [
- 'MOJO_GEOMETRY_IMPLEMENTATION',
- ],
- 'dependencies': [
- '../skia/skia.gyp:skia',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_geometry_bindings',
- '<(mojo_system_for_component)',
- ],
- 'export_dependent_settings': [
- '../ui/gfx/gfx.gyp:gfx',
- ],
- 'sources': [
- 'services/public/cpp/geometry/lib/geometry_type_converters.cc',
- 'services/public/cpp/geometry/geometry_type_converters.h',
- 'services/public/cpp/geometry/mojo_geometry_export.h',
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/surfaces
- 'target_name': 'mojo_surfaces_lib',
- 'type': '<(component)',
- 'defines': [
- 'MOJO_SURFACES_IMPLEMENTATION',
- ],
- 'dependencies': [
- '../base/base.gyp:base',
- '../cc/cc.gyp:cc',
- '../cc/cc.gyp:cc_surfaces',
- '../skia/skia.gyp:skia',
- '../gpu/gpu.gyp:gpu',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_geometry_lib',
- 'mojo_surfaces_bindings',
- 'mojo_gpu_bindings',
- '<(mojo_system_for_component)',
- ],
- 'export_dependent_settings': [
- 'mojo_geometry_lib',
- 'mojo_surfaces_bindings',
- ],
- 'sources': [
- 'services/public/cpp/surfaces/lib/surfaces_type_converters.cc',
- 'services/public/cpp/surfaces/lib/surfaces_utils.cc',
- 'services/public/cpp/surfaces/surfaces_type_converters.h',
- 'services/public/cpp/surfaces/surfaces_utils.h',
- 'services/public/cpp/surfaces/mojo_surfaces_export.h',
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/surfaces/tests
- 'target_name': 'mojo_surfaces_lib_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../cc/cc.gyp:cc',
- '../cc/cc.gyp:cc_surfaces',
- '../gpu/gpu.gyp:gpu',
- '../skia/skia.gyp:skia',
- '../testing/gtest.gyp:gtest',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_geometry',
- '../ui/gfx/gfx.gyp:gfx_test_support',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_base.gyp:mojo_run_all_unittests',
- 'mojo_geometry_lib',
- 'mojo_surfaces_bindings',
- 'mojo_surfaces_lib',
- ],
- 'sources': [
- 'services/public/cpp/surfaces/tests/surface_unittest.cc',
- ],
- },
- {
# GN version: //mojo/services/gles2
'target_name': 'mojo_gles2_service',
'type': 'static_library',
@@ -299,10 +142,10 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/gl/gl.gyp:gl',
- 'mojo_gles2_bindings',
+ 'mojo_gles2_lib',
],
'export_dependent_settings': [
- 'mojo_gles2_bindings',
+ 'mojo_gles2_lib',
],
'sources': [
'services/gles2/command_buffer_impl.cc',
@@ -310,47 +153,6 @@
],
},
{
- # GN version: //mojo/services/public/interfaces/gpu
- 'target_name': 'mojo_gpu_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/gpu/command_buffer.mojom',
- 'services/public/interfaces/gpu/gpu.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/native_viewport
- 'target_name': 'mojo_native_viewport_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/native_viewport/native_viewport.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_gles2_bindings',
- 'mojo_input_events_bindings',
- 'mojo_surface_id_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_gles2_bindings',
- 'mojo_input_events_bindings',
- 'mojo_surface_id_bindings',
- ],
- },
- {
# GN version: //mojo/services/native_viewport
'target_name': 'mojo_native_viewport_service_lib',
'type': 'static_library',
@@ -363,20 +165,20 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
'mojo_gles2_service',
- 'mojo_gpu_bindings',
'mojo_input_events_lib',
- 'mojo_native_viewport_bindings',
- 'mojo_surfaces_bindings',
'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
],
'export_dependent_settings': [
- 'mojo_geometry_bindings',
- 'mojo_gpu_bindings',
- 'mojo_native_viewport_bindings',
- 'mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
],
'sources': [
'services/native_viewport/gpu_impl.cc',
@@ -428,75 +230,18 @@
'target_name': 'mojo_native_viewport_service',
'type': 'loadable_module',
'dependencies': [
- 'mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
'mojo_native_viewport_service_lib',
'<(mojo_system_for_loadable_module)',
],
'export_dependent_settings': [
- 'mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
],
'sources': [
'services/native_viewport/main.cc',
],
},
{
- # GN version: //mojo/services/public/interfaces/navigation
- 'target_name': 'mojo_navigation_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/navigation/navigation.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_network_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/content_handler
- 'target_name': 'mojo_content_handler_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/content_handler/content_handler.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_application_bindings',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_network_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/network
- 'target_name': 'mojo_network_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/network/cookie_store.mojom',
- 'services/public/interfaces/network/net_address.mojom',
- 'services/public/interfaces/network/network_error.mojom',
- 'services/public/interfaces/network/network_service.mojom',
- 'services/public/interfaces/network/tcp_bound_socket.mojom',
- 'services/public/interfaces/network/tcp_client_socket.mojom',
- 'services/public/interfaces/network/tcp_server_socket.mojom',
- 'services/public/interfaces/network/udp_socket.mojom',
- 'services/public/interfaces/network/url_loader.mojom',
- 'services/public/interfaces/network/web_socket.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- },
- {
# GN version: //mojo/services/network:lib
'target_name': 'mojo_network_service_lib',
'type': 'static_library',
@@ -506,10 +251,10 @@
'../url/url.gyp:url_lib',
'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
],
'export_dependent_settings': [
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
],
'sources': [
'services/network/cookie_store_impl.cc',
@@ -533,12 +278,12 @@
'target_name': 'mojo_network_service',
'type': 'loadable_module',
'dependencies': [
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
'mojo_network_service_lib',
'<(mojo_system_for_loadable_module)',
],
'export_dependent_settings': [
- 'mojo_network_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_network_bindings',
],
'sources': [
'services/network/main.cc',
@@ -555,11 +300,11 @@
'../ui/gfx/gfx.gyp:gfx_geometry',
'mojo_base.gyp:mojo_application_chromium',
'mojo_cc_support',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
- 'mojo_gpu_bindings',
- 'mojo_surfaces_bindings',
'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
'<(mojo_system_for_loadable_module)',
],
'includes': [
@@ -575,35 +320,36 @@
],
},
{
- # GN version: //mojo/services/public/cpp/view_manager:common
- 'target_name': 'mojo_view_manager_common',
- 'type': 'static_library',
- 'sources': [
- 'services/public/cpp/view_manager/types.h',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/view_manager
- 'target_name': 'mojo_view_manager_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/view_manager/view_manager.mojom',
- 'services/public/interfaces/view_manager/view_manager_constants.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
+ # GN version: //mojo/services/public/cpp/view_manager/tests:mojo_view_manager_lib_unittests
+ 'target_name': 'mojo_view_manager_lib_unittests',
+ 'type': 'executable',
'dependencies': [
- 'mojo_base.gyp:mojo_application_bindings',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_input_events_bindings',
- 'mojo_surface_id_bindings',
+ '../base/base.gyp:base',
+ '../base/base.gyp:test_support_base',
+ '../testing/gtest.gyp:gtest',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_test_support',
+ 'mojo.gyp:mojo_shell_test_support',
+ 'mojo_base.gyp:mojo_environment_chromium',
+ 'mojo_geometry_lib',
+ 'mojo_view_manager_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_application_bindings',
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_input_events_bindings',
- 'mojo_surface_id_bindings',
+ 'sources': [
+ 'services/public/cpp/view_manager/tests/view_unittest.cc',
+ 'services/public/cpp/view_manager/tests/view_manager_unittest.cc',
+ ],
+ 'conditions': [
+ ['use_aura==1', {
+ 'dependencies': [
+ 'mojo_view_manager_run_unittests'
+ ],
+ }, { # use_aura==0
+ 'dependencies': [
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
+ ],
+ }],
],
},
{
@@ -612,30 +358,24 @@
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
- '../cc/cc.gyp:cc_surfaces',
- '../gpu/gpu.gyp:gpu',
- '../skia/skia.gyp:skia',
- '../ui/events/events.gyp:events',
- '../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
- '../third_party/khronos/khronos.gyp:khronos_headers',
+ 'mojo_application_manager',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_base.gyp:mojo_application_bindings',
- 'mojo_core_window_manager_bindings',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
- 'mojo_surfaces_bindings',
- 'mojo_surfaces_lib',
- 'mojo_view_manager_bindings',
- 'mojo_view_manager_common',
- 'mojo_gpu_bindings',
+ 'public/mojo_public.gyp:mojo_application_base',
+ 'public/mojo_public.gyp:mojo_application_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_core_window_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surface_id_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_common',
],
'includes': [
'mojo_public_gles2_for_loadable_module.gypi',
],
'sources': [
- 'services/public/cpp/view_manager/lib/bitmap_uploader.cc',
- 'services/public/cpp/view_manager/lib/bitmap_uploader.h',
'services/public/cpp/view_manager/lib/view.cc',
'services/public/cpp/view_manager/lib/view_manager_client_factory.cc',
'services/public/cpp/view_manager/lib/view_manager_client_impl.cc',
@@ -653,79 +393,7 @@
'services/public/cpp/view_manager/window_manager_delegate.h',
],
'export_dependent_settings': [
- 'mojo_gpu_bindings',
- 'mojo_surfaces_bindings',
- 'mojo_view_manager_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/cpp/view_manager/tests:mojo_view_manager_lib_unittests
- 'target_name': 'mojo_view_manager_lib_unittests',
- 'type': 'executable',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- '../testing/gtest.gyp:gtest',
- '../ui/gfx/gfx.gyp:gfx',
- '../ui/gfx/gfx.gyp:gfx_test_support',
- 'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_geometry_bindings',
- 'mojo_geometry_lib',
- 'mojo_shell_test_support',
- 'mojo_view_manager_bindings',
- 'mojo_view_manager_lib',
- ],
- 'sources': [
- 'services/public/cpp/view_manager/tests/view_unittest.cc',
- 'services/public/cpp/view_manager/tests/view_manager_unittest.cc',
- ],
- 'conditions': [
- ['use_aura==1', {
- 'dependencies': [
- 'mojo_view_manager_run_unittests'
- ],
- }, { # use_aura==0
- 'dependencies': [
- 'mojo_base.gyp:mojo_run_all_unittests',
- ],
- }],
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/surfaces
- 'target_name': 'mojo_surfaces_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/surfaces/surfaces.mojom',
- 'services/public/interfaces/surfaces/surfaces_service.mojom',
- 'services/public/interfaces/surfaces/quads.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_gles2_bindings',
- 'mojo_surface_id_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- 'mojo_geometry_bindings',
- 'mojo_surface_id_bindings',
- ],
- },
- {
- # GN version: //mojo/services/public/interfaces/surfaces:surface_id
- 'target_name': 'mojo_surface_id_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/surfaces/surface_id.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
- ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
],
},
{
@@ -739,10 +407,10 @@
],
'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ 'public/mojo_public.gyp:mojo_cpp_bindings',
],
},
{
@@ -751,9 +419,9 @@
'type': 'loadable_module',
'dependencies': [
'../base/base.gyp:base',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_base.gyp:mojo_application_standalone',
'mojo_test_service_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -773,9 +441,9 @@
'type': 'loadable_module',
'dependencies': [
'../base/base.gyp:base',
- 'mojo_base.gyp:mojo_utility',
- 'mojo_base.gyp:mojo_application_standalone',
'mojo_test_service_bindings',
+ 'public/mojo_public.gyp:mojo_application_standalone',
+ 'public/mojo_public.gyp:mojo_utility',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -790,18 +458,135 @@
],
},
{
- # GN version: //mojo/services/public/interfaces/window_manager
- 'target_name': 'mojo_core_window_manager_bindings',
- 'type': 'static_library',
- 'sources': [
- 'services/public/interfaces/window_manager/window_manager.mojom',
- ],
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
- 'export_dependent_settings': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ # GN version: //mojo/services/public/cpp/input_events
+ 'target_name': 'mojo_input_events_lib',
+ 'type': '<(component)',
+ 'defines': [
+ 'MOJO_INPUT_EVENTS_IMPLEMENTATION',
],
'dependencies': [
- 'mojo_base.gyp:mojo_cpp_bindings',
+ '../base/base.gyp:base',
+ '../ui/events/events.gyp:events',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'mojo_geometry_lib',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
+ '<(mojo_system_for_component)',
+ ],
+ 'sources': [
+ 'services/public/cpp/input_events/lib/input_events_type_converters.cc',
+ 'services/public/cpp/input_events/lib/mojo_extended_key_event_data.cc',
+ 'services/public/cpp/input_events/lib/mojo_extended_key_event_data.h',
+ 'services/public/cpp/input_events/input_events_type_converters.h',
+ 'services/public/cpp/input_events/mojo_input_events_export.h',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/cpp/geometry
+ 'target_name': 'mojo_geometry_lib',
+ 'type': '<(component)',
+ 'defines': [
+ 'MOJO_GEOMETRY_IMPLEMENTATION',
+ ],
+ 'dependencies': [
+ '../skia/skia.gyp:skia',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ '<(mojo_system_for_component)',
+ ],
+ 'export_dependent_settings': [
+ '../ui/gfx/gfx.gyp:gfx',
+ ],
+ 'sources': [
+ 'services/public/cpp/geometry/lib/geometry_type_converters.cc',
+ 'services/public/cpp/geometry/geometry_type_converters.h',
+ 'services/public/cpp/geometry/mojo_geometry_export.h',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/cpp/surfaces
+ 'target_name': 'mojo_surfaces_lib',
+ 'type': '<(component)',
+ 'defines': [
+ 'MOJO_SURFACES_IMPLEMENTATION',
+ ],
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../cc/cc.gyp:cc',
+ '../cc/cc.gyp:cc_surfaces',
+ '../skia/skia.gyp:skia',
+ '../gpu/gpu.gyp:gpu',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ 'mojo_geometry_lib',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ '<(mojo_system_for_component)',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_lib',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ ],
+ 'sources': [
+ 'services/public/cpp/surfaces/lib/surfaces_type_converters.cc',
+ 'services/public/cpp/surfaces/lib/surfaces_utils.cc',
+ 'services/public/cpp/surfaces/surfaces_type_converters.h',
+ 'services/public/cpp/surfaces/surfaces_utils.h',
+ 'services/public/cpp/surfaces/mojo_surfaces_export.h',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/cpp/surfaces/tests
+ 'target_name': 'mojo_surfaces_lib_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:test_support_base',
+ '../cc/cc.gyp:cc',
+ '../cc/cc.gyp:cc_surfaces',
+ '../gpu/gpu.gyp:gpu',
+ '../skia/skia.gyp:skia',
+ '../testing/gtest.gyp:gtest',
+ '../ui/gfx/gfx.gyp:gfx',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ '../ui/gfx/gfx.gyp:gfx_test_support',
+ 'edk/mojo_edk.gyp:mojo_run_all_unittests',
+ 'mojo_base.gyp:mojo_environment_chromium',
+ 'mojo_geometry_lib',
+ 'mojo_surfaces_lib',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ ],
+ 'sources': [
+ 'services/public/cpp/surfaces/tests/surface_unittest.cc',
+ ],
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'dependencies': [
+ 'mojo_base.gyp:mojo_environment_chromium',
+ ],
+ }],
],
},
],
@@ -821,20 +606,20 @@
'../ui/events/events.gyp:events_base',
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
- 'mojo_base.gyp:mojo_common_lib',
'mojo_base.gyp:mojo_application_chromium',
'mojo_base.gyp:mojo_common_lib',
- 'mojo_geometry_bindings',
+ 'mojo_base.gyp:mojo_common_lib',
'mojo_geometry_lib',
- 'mojo_gpu_bindings',
- 'mojo_input_events_bindings',
'mojo_input_events_lib',
- 'mojo_native_viewport_bindings',
- 'mojo_surfaces_bindings',
'mojo_surfaces_lib',
- 'mojo_view_manager_bindings',
- 'mojo_view_manager_common',
- 'mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_gpu_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_native_viewport_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_surfaces_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_common',
'<(mojo_system_for_loadable_module)',
],
'sources': [
@@ -869,27 +654,6 @@
],
},
{
- # GN version: //mojo/services/public/cpp/view_manager/lib:run_unittests
- 'target_name': 'mojo_view_manager_run_unittests',
- 'type': 'static_library',
- 'dependencies': [
- '../base/base.gyp:base',
- '../base/base.gyp:test_support_base',
- ],
- 'sources': [
- 'services/public/cpp/view_manager/lib/view_manager_test_suite.cc',
- 'services/public/cpp/view_manager/lib/view_manager_test_suite.h',
- 'services/public/cpp/view_manager/lib/view_manager_unittests.cc',
- ],
- 'conditions': [
- ['use_x11==1', {
- 'dependencies': [
- '../ui/gfx/x/gfx_x11.gyp:gfx_x11',
- ],
- }],
- ],
- },
- {
# GN version: //mojo/services/view_manager:mojo_view_manager_unittests
'target_name': 'mojo_view_manager_unittests',
'type': 'executable',
@@ -900,17 +664,17 @@
'../testing/gtest.gyp:gtest',
'../ui/aura/aura.gyp:aura',
'../ui/gfx/gfx.gyp:gfx_geometry',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_application_manager',
- 'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_application_chromium',
- 'mojo_geometry_bindings',
'mojo_geometry_lib',
- 'mojo_input_events_bindings',
'mojo_input_events_lib',
'mojo_shell_test_support',
- 'mojo_view_manager_bindings',
- 'mojo_view_manager_common',
'mojo_view_manager_run_unittests',
+ 'services/public/mojo_services_public.gyp:mojo_geometry_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_input_events_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_common',
# Included only to force deps for bots.
'mojo_native_viewport_service',
'mojo_surfaces_service',
@@ -946,12 +710,12 @@
'../ui/gfx/gfx.gyp:gfx',
'../ui/gfx/gfx.gyp:gfx_geometry',
'../ui/wm/wm.gyp:wm',
- 'mojo_base.gyp:mojo_common_lib',
- 'mojo_base.gyp:mojo_application_chromium',
'mojo_aura_support',
- 'mojo_core_window_manager_bindings',
+ 'mojo_base.gyp:mojo_application_chromium',
+ 'mojo_base.gyp:mojo_common_lib',
'mojo_input_events_lib',
'mojo_view_manager_lib',
+ 'services/public/mojo_services_public.gyp:mojo_core_window_manager_bindings',
],
'sources': [
'services/window_manager/window_manager_app.cc',
@@ -979,12 +743,12 @@
'dependencies': [
'../base/base.gyp:test_support_base',
'../testing/gtest.gyp:gtest',
+ 'edk/mojo_edk.gyp:mojo_system_impl',
'mojo_application_manager',
- 'mojo_base.gyp:mojo_system_impl',
'mojo_base.gyp:mojo_environment_chromium',
- 'mojo_core_window_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_core_window_manager_bindings',
'mojo_shell_test_support',
- 'mojo_view_manager_bindings',
+ 'services/public/mojo_services_public.gyp:mojo_view_manager_bindings',
'mojo_view_manager_lib',
],
'sources': [
diff --git a/mojo/mojo_variables.gypi b/mojo/mojo_variables.gypi
index 39146d7..6e73b5a 100644
--- a/mojo/mojo_variables.gypi
+++ b/mojo/mojo_variables.gypi
@@ -32,21 +32,21 @@
# which Mojo system library they are using.
#
['component=="shared_library"', {
- 'mojo_system_for_component': "<(DEPTH)/mojo/mojo_base.gyp:mojo_system_impl",
- 'mojo_system_for_loadable_module': "<(DEPTH)/mojo/mojo_base.gyp:mojo_system_impl",
+ 'mojo_system_for_component': "<(DEPTH)/mojo/edk/mojo_edk.gyp:mojo_system_impl",
+ 'mojo_system_for_loadable_module': "<(DEPTH)/mojo/edk/mojo_edk.gyp:mojo_system_impl",
'mojo_gles2_for_component': "<(DEPTH)/mojo/mojo_base.gyp:mojo_gles2_impl",
}, {
'mojo_system_for_component': "<(DEPTH)/mojo/mojo_base.gyp:mojo_none",
- 'mojo_system_for_loadable_module': "<(DEPTH)/mojo/mojo_base.gyp:mojo_system",
+ 'mojo_system_for_loadable_module': "<(DEPTH)/mojo/public/mojo_public.gyp:mojo_system",
'mojo_gles2_for_component': "<(DEPTH)/mojo/mojo_base.gyp:mojo_none",
}],
],
'mojo_public_system_unittest_sources': [
- 'public/c/system/tests/core_unittest.cc',
- 'public/c/system/tests/core_unittest_pure_c.c',
- 'public/c/system/tests/macros_unittest.cc',
- 'public/cpp/system/tests/core_unittest.cc',
- 'public/cpp/system/tests/macros_unittest.cc',
+ '<(DEPTH)/mojo/public/c/system/tests/core_unittest.cc',
+ '<(DEPTH)/mojo/public/c/system/tests/core_unittest_pure_c.c',
+ '<(DEPTH)/mojo/public/c/system/tests/macros_unittest.cc',
+ '<(DEPTH)/mojo/public/cpp/system/tests/core_unittest.cc',
+ '<(DEPTH)/mojo/public/cpp/system/tests/macros_unittest.cc',
],
},
}
diff --git a/mojo/public/BUILD.gn b/mojo/public/BUILD.gn
index 8eb4647..1874a6c 100644
--- a/mojo/public/BUILD.gn
+++ b/mojo/public/BUILD.gn
@@ -37,6 +37,7 @@
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/utility",
"//mojo/public/interfaces/application",
+ "//mojo/public/js/bindings",
]
}
diff --git a/mojo/public/c/system/buffer.h b/mojo/public/c/system/buffer.h
index 19e3c52..97bc340 100644
--- a/mojo/public/c/system/buffer.h
+++ b/mojo/public/c/system/buffer.h
@@ -38,13 +38,13 @@
((MojoCreateSharedBufferOptionsFlags)0)
#endif
-MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment);
+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
struct MOJO_ALIGNAS(8) MojoCreateSharedBufferOptions {
uint32_t struct_size;
MojoCreateSharedBufferOptionsFlags flags;
};
-MOJO_COMPILE_ASSERT(sizeof(MojoCreateSharedBufferOptions) == 8,
- MojoCreateSharedBufferOptions_has_wrong_size);
+MOJO_STATIC_ASSERT(sizeof(MojoCreateSharedBufferOptions) == 8,
+ "MojoCreateSharedBufferOptions has wrong size");
// |MojoDuplicateBufferHandleOptions|: Used to specify parameters in duplicating
// access to a shared buffer to |MojoDuplicateBufferHandle()|.
@@ -71,8 +71,8 @@
uint32_t struct_size;
MojoDuplicateBufferHandleOptionsFlags flags;
};
-MOJO_COMPILE_ASSERT(sizeof(MojoDuplicateBufferHandleOptions) == 8,
- MojoDuplicateBufferHandleOptions_has_wrong_size);
+MOJO_STATIC_ASSERT(sizeof(MojoDuplicateBufferHandleOptions) == 8,
+ "MojoDuplicateBufferHandleOptions has wrong size");
// |MojoMapBufferFlags|: Used to specify different modes to |MojoMapBuffer()|.
// |MOJO_MAP_BUFFER_FLAG_NONE| - No flags; default mode.
diff --git a/mojo/public/c/system/data_pipe.h b/mojo/public/c/system/data_pipe.h
index c8087ea..e4a15e9 100644
--- a/mojo/public/c/system/data_pipe.h
+++ b/mojo/public/c/system/data_pipe.h
@@ -46,15 +46,15 @@
((MojoCreateDataPipeOptionsFlags)1 << 0)
#endif
-MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment);
+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
struct MOJO_ALIGNAS(8) MojoCreateDataPipeOptions {
uint32_t struct_size;
MojoCreateDataPipeOptionsFlags flags;
uint32_t element_num_bytes;
uint32_t capacity_num_bytes;
};
-MOJO_COMPILE_ASSERT(sizeof(MojoCreateDataPipeOptions) == 16,
- MojoCreateDataPipeOptions_has_wrong_size);
+MOJO_STATIC_ASSERT(sizeof(MojoCreateDataPipeOptions) == 16,
+ "MojoCreateDataPipeOptions has wrong size");
// |MojoWriteDataFlags|: Used to specify different modes to |MojoWriteData()|
// and |MojoBeginWriteData()|.
diff --git a/mojo/public/c/system/macros.h b/mojo/public/c/system/macros.h
index 564ee60..dde65ff 100644
--- a/mojo/public/c/system/macros.h
+++ b/mojo/public/c/system/macros.h
@@ -43,18 +43,11 @@
// Assert things at compile time. (|msg| should be a valid identifier name.)
// This macro is currently C++-only, but we want to use it in the C core.h.
// Use like:
-// MOJO_COMPILE_ASSERT(sizeof(Foo) == 12, Foo_has_invalid_size);
-#if __cplusplus >= 201103L
-#define MOJO_COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
-#elif defined(__cplusplus)
-namespace mojo {
-template <bool>
-struct CompileAssert {};
-}
-#define MOJO_COMPILE_ASSERT(expr, msg) \
- typedef ::mojo::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
+// MOJO_STATIC_ASSERT(sizeof(Foo) == 12, "Foo has invalid size");
+#if defined(__cplusplus)
+#define MOJO_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
#else
-#define MOJO_COMPILE_ASSERT(expr, msg)
+#define MOJO_STATIC_ASSERT(expr, msg)
#endif
// Like the C++11 |alignof| operator.
diff --git a/mojo/public/c/system/message_pipe.h b/mojo/public/c/system/message_pipe.h
index b08ba75..97d8887 100644
--- a/mojo/public/c/system/message_pipe.h
+++ b/mojo/public/c/system/message_pipe.h
@@ -31,13 +31,13 @@
((MojoCreateMessagePipeOptionsFlags)0)
#endif
-MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int64_t) == 8, int64_t_has_weird_alignment);
+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int64_t) == 8, "int64_t has weird alignment");
struct MOJO_ALIGNAS(8) MojoCreateMessagePipeOptions {
uint32_t struct_size;
MojoCreateMessagePipeOptionsFlags flags;
};
-MOJO_COMPILE_ASSERT(sizeof(MojoCreateMessagePipeOptions) == 8,
- MojoCreateMessagePipeOptions_has_wrong_size);
+MOJO_STATIC_ASSERT(sizeof(MojoCreateMessagePipeOptions) == 8,
+ "MojoCreateMessagePipeOptions has wrong size");
// |MojoWriteMessageFlags|: Used to specify different modes to
// |MojoWriteMessage()|.
diff --git a/mojo/public/c/system/tests/BUILD.gn b/mojo/public/c/system/tests/BUILD.gn
index e9aa06f..02b591a 100644
--- a/mojo/public/c/system/tests/BUILD.gn
+++ b/mojo/public/c/system/tests/BUILD.gn
@@ -19,7 +19,7 @@
]
}
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_system_perftests
+# GYP version: mojo/mojo_base.gyp:mojo_public_system_perftests
executable("perftests") {
testonly = true
output_name = "mojo_public_system_perftests"
@@ -30,7 +30,7 @@
deps = [
"//base",
- "//mojo/common/test:run_all_perftests",
+ "//mojo/edk/test:run_all_perftests",
"//mojo/public/c/environment",
"//mojo/public/cpp/system",
"//mojo/public/cpp/test_support:test_utils",
diff --git a/mojo/public/c/system/tests/macros_unittest.cc b/mojo/public/c/system/tests/macros_unittest.cc
index 6a694b8..d4292cf 100644
--- a/mojo/public/c/system/tests/macros_unittest.cc
+++ b/mojo/public/c/system/tests/macros_unittest.cc
@@ -34,14 +34,14 @@
abort();
}
-// First test |MOJO_COMPILE_ASSERT()| in a global scope.
-MOJO_COMPILE_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t),
- bad_compile_assert_failure_in_global_scope);
+// First test |MOJO_STATIC_ASSERT()| in a global scope.
+MOJO_STATIC_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t),
+ "Bad static_assert() failure in global scope");
TEST(MacrosTest, CompileAssert) {
// Then in a local scope.
- MOJO_COMPILE_ASSERT(sizeof(int32_t) == 2 * sizeof(int16_t),
- bad_compile_assert_failure);
+ MOJO_STATIC_ASSERT(sizeof(int32_t) == 2 * sizeof(int16_t),
+ "Bad static_assert() failure");
}
TEST(MacrosTest, Alignof) {
diff --git a/mojo/public/c/system/types.h b/mojo/public/c/system/types.h
index 5a72d2f..96441dc 100644
--- a/mojo/public/c/system/types.h
+++ b/mojo/public/c/system/types.h
@@ -165,12 +165,12 @@
// TODO(vtl): Add out parameters with this to MojoWait/MojoWaitMany.
// Note: This struct is not extensible (and only has 32-bit quantities), so it's
// 32-bit-aligned.
-MOJO_COMPILE_ASSERT(MOJO_ALIGNOF(int32_t) == 4, int32_t_has_weird_alignment);
+MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment");
struct MOJO_ALIGNAS(4) MojoHandleSignalsState {
MojoHandleSignals satisfied_signals;
MojoHandleSignals satisfiable_signals;
};
-MOJO_COMPILE_ASSERT(sizeof(MojoHandleSignalsState) == 8,
- MojoHandleSignalsState_has_wrong_size);
+MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8,
+ "MojoHandleSignalsState has wrong size");
#endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_
diff --git a/mojo/public/c/test_support/BUILD.gn b/mojo/public/c/test_support/BUILD.gn
index 42db434..2129c90 100644
--- a/mojo/public/c/test_support/BUILD.gn
+++ b/mojo/public/c/test_support/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_test_support
+# GYP version: mojo/public/mojo_public.gyp:mojo_test_support
shared_library("test_support") {
output_name = "mojo_test_support"
diff --git a/mojo/edk/embedder/PRESUBMIT.py b/mojo/public/cpp/PRESUBMIT.py
similarity index 93%
copy from mojo/edk/embedder/PRESUBMIT.py
copy to mojo/public/cpp/PRESUBMIT.py
index 9cd39bc..908f7a6 100644
--- a/mojo/edk/embedder/PRESUBMIT.py
+++ b/mojo/public/cpp/PRESUBMIT.py
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Presubmit script for mojo/edk/embedder.
+"""Presubmit script for mojo/public/cpp.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
diff --git a/mojo/public/cpp/application/BUILD.gn b/mojo/public/cpp/application/BUILD.gn
index 900edef..c7f0da6 100644
--- a/mojo/public/cpp/application/BUILD.gn
+++ b/mojo/public/cpp/application/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public.gypi:mojo_application_base
+# GYP version: mojo/public/mojo_public.gyp:mojo_application_base
source_set("application") {
sources = [
"application_connection.h",
@@ -32,7 +32,7 @@
]
}
-# GYP version: mojo/mojo_public.gypi:mojo_application_standalone
+# GYP version: mojo/public/mojo_public.gyp:mojo_application_standalone
source_set("standalone") {
sources = [
"lib/application_runner.cc"
diff --git a/mojo/public/cpp/application/application_impl.h b/mojo/public/cpp/application/application_impl.h
index 4b4cb93..b647427 100644
--- a/mojo/public/cpp/application/application_impl.h
+++ b/mojo/public/cpp/application/application_impl.h
@@ -54,8 +54,7 @@
public:
ApplicationImpl(ApplicationDelegate* delegate,
ScopedMessagePipeHandle shell_handle);
- ApplicationImpl(ApplicationDelegate* delegate,
- MojoHandle shell_handle);
+ ApplicationImpl(ApplicationDelegate* delegate, MojoHandle shell_handle);
virtual ~ApplicationImpl();
Shell* shell() const { return shell_.get(); }
@@ -74,6 +73,9 @@
ConnectToApplication(application_url)->ConnectToService(ptr);
}
+ // Wait for the ShellPtr's Initialize message.
+ bool WaitForInitialize();
+
private:
class ShellPtrWatcher;
diff --git a/mojo/public/cpp/application/interface_factory.h b/mojo/public/cpp/application/interface_factory.h
index 90abd13..8840fcb 100644
--- a/mojo/public/cpp/application/interface_factory.h
+++ b/mojo/public/cpp/application/interface_factory.h
@@ -11,7 +11,8 @@
namespace mojo {
class ApplicationConnection;
-template <typename Interface> class InterfaceRequest;
+template <typename Interface>
+class InterfaceRequest;
// Implement this class to provide implementations of a given interface and
// bind them to incoming requests. The implementation of this class is
diff --git a/mojo/public/cpp/application/lazy_interface_ptr.h b/mojo/public/cpp/application/lazy_interface_ptr.h
index 1f4b973..1ecb043 100644
--- a/mojo/public/cpp/application/lazy_interface_ptr.h
+++ b/mojo/public/cpp/application/lazy_interface_ptr.h
@@ -10,14 +10,13 @@
namespace mojo {
-template<typename Interface>
+template <typename Interface>
class LazyInterfacePtr : public InterfacePtr<Interface> {
public:
LazyInterfacePtr() : service_provider_(nullptr) {}
LazyInterfacePtr(ServiceProvider* service_provider)
- : service_provider_(service_provider) {
- }
+ : service_provider_(service_provider) {}
void set_service_provider(ServiceProvider* service_provider) {
if (service_provider != service_provider_) {
@@ -29,8 +28,7 @@
Interface* get() const {
if (!InterfacePtr<Interface>::get()) {
mojo::ConnectToService<Interface>(
- service_provider_,
- const_cast<LazyInterfacePtr<Interface>*>(this));
+ service_provider_, const_cast<LazyInterfacePtr<Interface>*>(this));
}
return InterfacePtr<Interface>::get();
}
diff --git a/mojo/public/cpp/application/lib/application_connection.cc b/mojo/public/cpp/application/lib/application_connection.cc
index 4978a35..d557817 100644
--- a/mojo/public/cpp/application/lib/application_connection.cc
+++ b/mojo/public/cpp/application/lib/application_connection.cc
@@ -6,7 +6,7 @@
namespace mojo {
-ApplicationConnection::~ApplicationConnection() {}
+ApplicationConnection::~ApplicationConnection() {
+}
} // namespace mojo
-
diff --git a/mojo/public/cpp/application/lib/application_delegate.cc b/mojo/public/cpp/application/lib/application_delegate.cc
index 715daa0..bd6aebd 100644
--- a/mojo/public/cpp/application/lib/application_delegate.cc
+++ b/mojo/public/cpp/application/lib/application_delegate.cc
@@ -6,10 +6,13 @@
namespace mojo {
-ApplicationDelegate::ApplicationDelegate() {}
-ApplicationDelegate::~ApplicationDelegate() {}
+ApplicationDelegate::ApplicationDelegate() {
+}
+ApplicationDelegate::~ApplicationDelegate() {
+}
-void ApplicationDelegate::Initialize(ApplicationImpl* app) {}
+void ApplicationDelegate::Initialize(ApplicationImpl* app) {
+}
bool ApplicationDelegate::ConfigureIncomingConnection(
ApplicationConnection* connection) {
diff --git a/mojo/public/cpp/application/lib/application_impl.cc b/mojo/public/cpp/application/lib/application_impl.cc
index 0c86356..e237aef 100644
--- a/mojo/public/cpp/application/lib/application_impl.cc
+++ b/mojo/public/cpp/application/lib/application_impl.cc
@@ -13,8 +13,7 @@
class ApplicationImpl::ShellPtrWatcher : public ErrorHandler {
public:
- ShellPtrWatcher(ApplicationImpl* impl)
- : impl_(impl) {}
+ ShellPtrWatcher(ApplicationImpl* impl) : impl_(impl) {}
virtual ~ShellPtrWatcher() {}
@@ -39,10 +38,12 @@
void ApplicationImpl::ClearConnections() {
for (ServiceRegistryList::iterator i(incoming_service_registries_.begin());
- i != incoming_service_registries_.end(); ++i)
+ i != incoming_service_registries_.end();
+ ++i)
delete *i;
for (ServiceRegistryList::iterator i(outgoing_service_registries_.begin());
- i != outgoing_service_registries_.end(); ++i)
+ i != outgoing_service_registries_.end();
+ ++i)
delete *i;
incoming_service_registries_.clear();
outgoing_service_registries_.clear();
@@ -64,11 +65,10 @@
const String& application_url) {
MOJO_CHECK(initialized_);
ServiceProviderPtr out_service_provider;
- shell_->ConnectToApplication(application_url, Get(&out_service_provider));
+ shell_->ConnectToApplication(application_url,
+ GetProxy(&out_service_provider));
internal::ServiceRegistry* registry = new internal::ServiceRegistry(
- this,
- application_url,
- out_service_provider.Pass());
+ this, application_url, out_service_provider.Pass());
if (!delegate_->ConfigureOutgoingConnection(registry)) {
delete registry;
return nullptr;
@@ -77,6 +77,13 @@
return registry;
}
+bool ApplicationImpl::WaitForInitialize() {
+ MOJO_CHECK(!initialized_);
+ bool result = shell_.WaitForIncomingMethodCall();
+ MOJO_CHECK(initialized_ || !result);
+ return result;
+}
+
void ApplicationImpl::BindShell(ScopedMessagePipeHandle shell_handle) {
shell_watch_ = new ShellPtrWatcher(this);
shell_.Bind(shell_handle.Pass());
diff --git a/mojo/public/cpp/application/lib/application_runner.cc b/mojo/public/cpp/application/lib/application_runner.cc
index b451a90..dec7448 100644
--- a/mojo/public/cpp/application/lib/application_runner.cc
+++ b/mojo/public/cpp/application/lib/application_runner.cc
@@ -17,8 +17,11 @@
}
ApplicationRunner::ApplicationRunner(ApplicationDelegate* delegate)
- : delegate_(delegate) {}
-ApplicationRunner::~ApplicationRunner() { assert(!delegate_); }
+ : delegate_(delegate) {
+}
+ApplicationRunner::~ApplicationRunner() {
+ assert(!delegate_);
+}
MojoResult ApplicationRunner::Run(MojoHandle shell_handle) {
Environment env;
diff --git a/mojo/public/cpp/application/lib/service_connector.cc b/mojo/public/cpp/application/lib/service_connector.cc
index 51e7d84..ada5d9c 100644
--- a/mojo/public/cpp/application/lib/service_connector.cc
+++ b/mojo/public/cpp/application/lib/service_connector.cc
@@ -8,11 +8,11 @@
namespace internal {
ServiceConnectorBase::ServiceConnectorBase(const std::string& name)
- : name_(name),
- application_connection_(nullptr) {
+ : name_(name), application_connection_(nullptr) {
}
-ServiceConnectorBase::~ServiceConnectorBase() {}
+ServiceConnectorBase::~ServiceConnectorBase() {
+}
} // namespace internal
} // namespace mojo
diff --git a/mojo/public/cpp/application/lib/service_connector.h b/mojo/public/cpp/application/lib/service_connector.h
index 9ddaeb7..70c1380 100644
--- a/mojo/public/cpp/application/lib/service_connector.h
+++ b/mojo/public/cpp/application/lib/service_connector.h
@@ -21,7 +21,8 @@
ScopedMessagePipeHandle client_handle) = 0;
std::string name() const { return name_; }
void set_application_connection(ApplicationConnection* connection) {
- application_connection_ = connection; }
+ application_connection_ = connection;
+ }
protected:
std::string name_;
diff --git a/mojo/public/cpp/application/lib/service_registry.cc b/mojo/public/cpp/application/lib/service_registry.cc
index c83e84f..19a8be2 100644
--- a/mojo/public/cpp/application/lib/service_registry.cc
+++ b/mojo/public/cpp/application/lib/service_registry.cc
@@ -20,12 +20,14 @@
remote_service_provider_.set_client(this);
}
-ServiceRegistry::ServiceRegistry() : application_impl_(nullptr) {}
+ServiceRegistry::ServiceRegistry() : application_impl_(nullptr) {
+}
ServiceRegistry::~ServiceRegistry() {
for (NameToServiceConnectorMap::iterator i =
name_to_service_connector_.begin();
- i != name_to_service_connector_.end(); ++i) {
+ i != name_to_service_connector_.end();
+ ++i) {
delete i->second;
}
name_to_service_connector_.clear();
diff --git a/mojo/public/cpp/application/lib/service_registry.h b/mojo/public/cpp/application/lib/service_registry.h
index 32d4b2b..2ac8eb8 100644
--- a/mojo/public/cpp/application/lib/service_registry.h
+++ b/mojo/public/cpp/application/lib/service_registry.h
@@ -47,8 +47,7 @@
const std::string url_;
private:
- bool RemoveServiceConnectorInternal(
- ServiceConnectorBase* service_connector);
+ bool RemoveServiceConnectorInternal(ServiceConnectorBase* service_connector);
Application* application_;
typedef std::map<std::string, ServiceConnectorBase*>
diff --git a/mojo/public/cpp/application/lib/weak_service_provider.cc b/mojo/public/cpp/application/lib/weak_service_provider.cc
index b0d2511..de0cb6c 100644
--- a/mojo/public/cpp/application/lib/weak_service_provider.cc
+++ b/mojo/public/cpp/application/lib/weak_service_provider.cc
@@ -12,8 +12,8 @@
WeakServiceProvider::WeakServiceProvider(ServiceProviderImpl* creator,
ServiceProvider* service_provider)
- : creator_(creator),
- service_provider_(service_provider) {}
+ : creator_(creator), service_provider_(service_provider) {
+}
WeakServiceProvider::~WeakServiceProvider() {
if (creator_)
diff --git a/mojo/public/cpp/application/service_provider_impl.h b/mojo/public/cpp/application/service_provider_impl.h
index f388511..92f8f35 100644
--- a/mojo/public/cpp/application/service_provider_impl.h
+++ b/mojo/public/cpp/application/service_provider_impl.h
@@ -48,8 +48,7 @@
// Overridden from InterfaceImpl:
virtual void OnConnectionError() override;
- void AddServiceConnector(
- internal::ServiceConnectorBase* service_connector);
+ void AddServiceConnector(internal::ServiceConnectorBase* service_connector);
void RemoveServiceConnector(
internal::ServiceConnectorBase* service_connector);
diff --git a/mojo/public/cpp/application/tests/BUILD.gn b/mojo/public/cpp/application/tests/BUILD.gn
index 4c22c19..61678ab 100644
--- a/mojo/public/cpp/application/tests/BUILD.gn
+++ b/mojo/public/cpp/application/tests/BUILD.gn
@@ -2,11 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_application_unittests
+# GYP version: mojo/mojo_base.gyp:mojo_public_application_unittests
test("mojo_public_application_unittests") {
deps = [
"//base",
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/public/cpp/application:standalone",
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/utility",
diff --git a/mojo/public/cpp/bindings/array.h b/mojo/public/cpp/bindings/array.h
index 53c8c18..b7f3cc0 100644
--- a/mojo/public/cpp/bindings/array.h
+++ b/mojo/public/cpp/bindings/array.h
@@ -22,8 +22,7 @@
class Array {
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(Array, RValue)
public:
- typedef internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value>
- Traits;
+ typedef internal::ArrayTraits<T, internal::IsMoveOnlyType<T>::value> Traits;
typedef typename Traits::ConstRefType ConstRefType;
typedef typename Traits::RefType RefType;
typedef typename Traits::StorageType StorageType;
@@ -44,9 +43,7 @@
return *this;
}
- static Array New(size_t size) {
- return Array(size).Pass();
- }
+ static Array New(size_t size) { return Array(size).Pass(); }
template <typename U>
static Array From(const U& other) {
@@ -89,12 +86,8 @@
Traits::Resize(&vec_, size);
}
- const std::vector<StorageType>& storage() const {
- return vec_;
- }
- operator const std::vector<StorageType>&() const {
- return vec_;
- }
+ const std::vector<StorageType>& storage() const { return vec_; }
+ operator const std::vector<StorageType>&() const { return vec_; }
void Swap(Array* other) {
std::swap(is_null_, other->is_null_);
@@ -132,7 +125,7 @@
};
template <typename T, typename E>
-struct TypeConverter<Array<T>, std::vector<E> > {
+struct TypeConverter<Array<T>, std::vector<E>> {
static Array<T> Convert(const std::vector<E>& input) {
Array<T> result(input.size());
for (size_t i = 0; i < input.size(); ++i)
@@ -142,7 +135,7 @@
};
template <typename E, typename T>
-struct TypeConverter<std::vector<E>, Array<T> > {
+struct TypeConverter<std::vector<E>, Array<T>> {
static std::vector<E> Convert(const Array<T>& input) {
std::vector<E> result;
if (!input.is_null()) {
diff --git a/mojo/public/cpp/bindings/interface_ptr.h b/mojo/public/cpp/bindings/interface_ptr.h
index 8dfd465..c56e770 100644
--- a/mojo/public/cpp/bindings/interface_ptr.h
+++ b/mojo/public/cpp/bindings/interface_ptr.h
@@ -33,9 +33,7 @@
~InterfacePtr() {}
- Interface* get() const {
- return internal_state_.instance();
- }
+ Interface* get() const { return internal_state_.instance(); }
Interface* operator->() const { return get(); }
Interface& operator*() const { return *get(); }
@@ -76,9 +74,7 @@
// This method may be called to query if the underlying pipe has encountered
// an error. If true, this means method calls made on this interface will be
// dropped (and may have already been dropped) on the floor.
- bool encountered_error() const {
- return internal_state_.encountered_error();
- }
+ bool encountered_error() const { return internal_state_.encountered_error(); }
// This method may be called to register an ErrorHandler to observe a
// connection error on the underlying pipe. It must only be called on a bound
diff --git a/mojo/public/cpp/bindings/interface_request.h b/mojo/public/cpp/bindings/interface_request.h
index 6b7d303..0a6dc2c 100644
--- a/mojo/public/cpp/bindings/interface_request.h
+++ b/mojo/public/cpp/bindings/interface_request.h
@@ -16,9 +16,7 @@
public:
InterfaceRequest() {}
- InterfaceRequest(RValue other) {
- handle_ = other.object->handle_.Pass();
- }
+ InterfaceRequest(RValue other) { handle_ = other.object->handle_.Pass(); }
InterfaceRequest& operator=(RValue other) {
handle_ = other.object->handle_.Pass();
return *this;
@@ -27,13 +25,9 @@
// Returns true if the request has yet to be completed.
bool is_pending() const { return handle_.is_valid(); }
- void Bind(ScopedMessagePipeHandle handle) {
- handle_ = handle.Pass();
- }
+ void Bind(ScopedMessagePipeHandle handle) { handle_ = handle.Pass(); }
- ScopedMessagePipeHandle PassMessagePipe() {
- return handle_.Pass();
- }
+ ScopedMessagePipeHandle PassMessagePipe() { return handle_.Pass(); }
private:
ScopedMessagePipeHandle handle_;
@@ -60,12 +54,12 @@
//
// InterfacePtr<Foo> foo = ...;
// InterfacePtr<Bar> bar;
-// foo->CreateBar(Get(&bar));
+// foo->CreateBar(GetProxy(&bar));
//
// Upon return from CreateBar, |bar| is ready to have methods called on it.
//
template <typename Interface>
-InterfaceRequest<Interface> Get(InterfacePtr<Interface>* ptr) {
+InterfaceRequest<Interface> GetProxy(InterfacePtr<Interface>* ptr) {
MessagePipe pipe;
ptr->Bind(pipe.handle0.Pass());
return MakeRequest<Interface>(pipe.handle1.Pass());
diff --git a/mojo/public/cpp/bindings/lib/array_internal.cc b/mojo/public/cpp/bindings/lib/array_internal.cc
index 9f62aa2..61e4b0d 100644
--- a/mojo/public/cpp/bindings/lib/array_internal.cc
+++ b/mojo/public/cpp/bindings/lib/array_internal.cc
@@ -30,12 +30,11 @@
}
ArrayDataTraits<bool>::BitRef::BitRef(uint8_t* storage, uint8_t mask)
- : storage_(storage),
- mask_(mask) {
+ : storage_(storage), mask_(mask) {
}
-ArrayDataTraits<bool>::BitRef&
-ArrayDataTraits<bool>::BitRef::operator=(bool value) {
+ArrayDataTraits<bool>::BitRef& ArrayDataTraits<bool>::BitRef::operator=(
+ bool value) {
if (value) {
*storage_ |= mask_;
} else {
@@ -44,8 +43,8 @@
return *this;
}
-ArrayDataTraits<bool>::BitRef&
-ArrayDataTraits<bool>::BitRef::operator=(const BitRef& value) {
+ArrayDataTraits<bool>::BitRef& ArrayDataTraits<bool>::BitRef::operator=(
+ const BitRef& value) {
return (*this) = static_cast<bool>(value);
}
diff --git a/mojo/public/cpp/bindings/lib/array_internal.h b/mojo/public/cpp/bindings/lib/array_internal.h
index 3681d8e..ded07b9 100644
--- a/mojo/public/cpp/bindings/lib/array_internal.h
+++ b/mojo/public/cpp/bindings/lib/array_internal.h
@@ -18,7 +18,8 @@
#include "mojo/public/cpp/environment/logging.h"
namespace mojo {
-template <typename T> class Array;
+template <typename T>
+class Array;
class String;
namespace internal {
@@ -113,6 +114,7 @@
BitRef& operator=(bool value);
BitRef& operator=(const BitRef& value);
operator bool() const;
+
private:
friend struct ArrayDataTraits<bool>;
BitRef(uint8_t* storage, uint8_t mask);
@@ -157,14 +159,14 @@
};
// NoValidateParams is used to indicate the end of an ArrayValidateParams chain.
-class NoValidateParams {
-};
+class NoValidateParams {};
// What follows is code to support the serialization of Array_Data<T>. There
// are two interesting cases: arrays of primitives and arrays of objects.
// Arrays of objects are represented as arrays of pointers to objects.
-template <typename T, bool is_handle> struct ArraySerializationHelper;
+template <typename T, bool is_handle>
+struct ArraySerializationHelper;
template <typename T>
struct ArraySerializationHelper<T, false> {
@@ -172,23 +174,20 @@
static void EncodePointersAndHandles(const ArrayHeader* header,
ElementType* elements,
- std::vector<Handle>* handles) {
- }
+ std::vector<Handle>* handles) {}
static void DecodePointersAndHandles(const ArrayHeader* header,
ElementType* elements,
- std::vector<Handle>* handles) {
- }
+ std::vector<Handle>* handles) {}
template <bool element_is_nullable, typename ElementValidateParams>
static bool ValidateElements(const ArrayHeader* header,
const ElementType* elements,
BoundsChecker* bounds_checker) {
- MOJO_COMPILE_ASSERT(!element_is_nullable,
- Primitive_type_should_be_non_nullable);
- MOJO_COMPILE_ASSERT(
- (IsSame<ElementValidateParams, NoValidateParams>::value),
- Primitive_type_should_not_have_array_validate_params);
+ static_assert(!element_is_nullable,
+ "Primitive type should be non-nullable");
+ static_assert((IsSame<ElementValidateParams, NoValidateParams>::value),
+ "Primitive type should not have array validate params");
return true;
}
};
@@ -209,9 +208,8 @@
static bool ValidateElements(const ArrayHeader* header,
const ElementType* elements,
BoundsChecker* bounds_checker) {
- MOJO_COMPILE_ASSERT(
- (IsSame<ElementValidateParams, NoValidateParams>::value),
- Handle_type_should_not_have_array_validate_params);
+ static_assert((IsSame<ElementValidateParams, NoValidateParams>::value),
+ "Handle type should not have array validate params");
for (uint32_t i = 0; i < header->num_elements; ++i) {
if (!element_is_nullable &&
@@ -220,7 +218,8 @@
VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
MakeMessageWithArrayIndex(
"invalid handle in array expecting valid handles",
- header->num_elements, i).c_str());
+ header->num_elements,
+ i).c_str());
return false;
}
if (!bounds_checker->ClaimHandle(elements[i])) {
@@ -254,9 +253,9 @@
static bool ValidateElements(const ArrayHeader* header,
const ElementType* elements,
BoundsChecker* bounds_checker) {
- return ArraySerializationHelper<Handle, true>::
- ValidateElements<element_is_nullable, ElementValidateParams>(
- header, elements, bounds_checker);
+ return ArraySerializationHelper<Handle, true>::ValidateElements<
+ element_is_nullable,
+ ElementValidateParams>(header, elements, bounds_checker);
}
};
@@ -286,9 +285,9 @@
if (!element_is_nullable && !elements[i].offset) {
ReportValidationError(
VALIDATION_ERROR_UNEXPECTED_NULL_POINTER,
- MakeMessageWithArrayIndex(
- "null in array expecting valid pointers",
- header->num_elements, i).c_str());
+ MakeMessageWithArrayIndex("null in array expecting valid pointers",
+ header->num_elements,
+ i).c_str());
return false;
}
if (!ValidateEncodedPointer(&elements[i].offset)) {
@@ -307,9 +306,8 @@
template <typename T, typename Params>
struct ValidateCaller {
static bool Run(const void* data, BoundsChecker* bounds_checker) {
- MOJO_COMPILE_ASSERT(
- (IsSame<Params, NoValidateParams>::value),
- Struct_type_should_not_have_array_validate_params);
+ static_assert((IsSame<Params, NoValidateParams>::value),
+ "Struct type should not have array validate params");
return T::Validate(data, bounds_checker);
}
@@ -340,8 +338,8 @@
uint32_t num_bytes =
Traits::GetStorageSize(static_cast<uint32_t>(num_elements));
- return new (buf->Allocate(num_bytes)) Array_Data<T>(
- num_bytes, static_cast<uint32_t>(num_elements));
+ return new (buf->Allocate(num_bytes))
+ Array_Data<T>(num_bytes, static_cast<uint32_t>(num_elements));
}
template <typename Params>
@@ -364,11 +362,11 @@
}
if (Params::expected_num_elements != 0 &&
header->num_elements != Params::expected_num_elements) {
- ReportValidationError(
- VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER,
- MakeMessageWithExpectedArraySize(
- "fixed-size array has wrong number of elements",
- header->num_elements, Params::expected_num_elements).c_str());
+ ReportValidationError(VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER,
+ MakeMessageWithExpectedArraySize(
+ "fixed-size array has wrong number of elements",
+ header->num_elements,
+ Params::expected_num_elements).c_str());
return false;
}
if (!bounds_checker->ClaimMemory(data, header->num_bytes)) {
@@ -378,8 +376,9 @@
const Array_Data<T>* object = static_cast<const Array_Data<T>*>(data);
return Helper::template ValidateElements<
- Params::element_is_nullable, typename Params::ElementValidateParams>(
- &object->header_, object->storage(), bounds_checker);
+ Params::element_is_nullable,
+ typename Params::ElementValidateParams>(
+ &object->header_, object->storage(), bounds_checker);
}
size_t size() const { return header_.num_elements; }
@@ -395,8 +394,8 @@
}
StorageType* storage() {
- return reinterpret_cast<StorageType*>(
- reinterpret_cast<char*>(this) + sizeof(*this));
+ return reinterpret_cast<StorageType*>(reinterpret_cast<char*>(this) +
+ sizeof(*this));
}
const StorageType* storage() const {
@@ -423,22 +422,22 @@
// Elements of type internal::ArrayDataTraits<T>::StorageType follow.
};
-MOJO_COMPILE_ASSERT(sizeof(Array_Data<char>) == 8, bad_sizeof_Array_Data);
+static_assert(sizeof(Array_Data<char>) == 8, "Bad sizeof(Array_Data)");
// UTF-8 encoded
typedef Array_Data<char> String_Data;
-template <typename T, bool kIsMoveOnlyType> struct ArrayTraits {};
+template <typename T, bool kIsMoveOnlyType>
+struct ArrayTraits {};
-template <typename T> struct ArrayTraits<T, false> {
+template <typename T>
+struct ArrayTraits<T, false> {
typedef T StorageType;
typedef typename std::vector<T>::reference RefType;
typedef typename std::vector<T>::const_reference ConstRefType;
typedef ConstRefType ForwardType;
- static inline void Initialize(std::vector<T>* vec) {
- }
- static inline void Finalize(std::vector<T>* vec) {
- }
+ static inline void Initialize(std::vector<T>* vec) {}
+ static inline void Finalize(std::vector<T>* vec) {}
static inline ConstRefType at(const std::vector<T>* vec, size_t offset) {
return vec->at(offset);
}
@@ -457,7 +456,8 @@
}
};
-template <typename T> struct ArrayTraits<T, true> {
+template <typename T>
+struct ArrayTraits<T, true> {
struct StorageType {
char buf[sizeof(T) + (8 - (sizeof(T) % 8)) % 8]; // Make 8-byte aligned.
};
@@ -511,7 +511,8 @@
}
};
-template <> struct WrapperTraits<String, false> {
+template <>
+struct WrapperTraits<String, false> {
typedef String_Data* DataType;
};
diff --git a/mojo/public/cpp/bindings/lib/array_serialization.h b/mojo/public/cpp/bindings/lib/array_serialization.h
index 4407de8..fd18863 100644
--- a/mojo/public/cpp/bindings/lib/array_serialization.h
+++ b/mojo/public/cpp/bindings/lib/array_serialization.h
@@ -25,7 +25,8 @@
// Serialize_() doesn't seem to work. Therefore, this function is named
// differently from those Serialize_() overloads.
template <typename ValidateParams, typename E, typename F>
-inline void SerializeArray_(Array<E> input, internal::Buffer* buf,
+inline void SerializeArray_(Array<E> input,
+ internal::Buffer* buf,
internal::Array_Data<F>** output);
template <typename E, typename F>
@@ -36,49 +37,50 @@
template <typename E, typename F, bool move_only = IsMoveOnlyType<E>::value>
struct ArraySerializer;
-template <typename E, typename F> struct ArraySerializer<E, F, false> {
- MOJO_COMPILE_ASSERT(sizeof(E) == sizeof(F), wrong_array_serializer);
+template <typename E, typename F>
+struct ArraySerializer<E, F, false> {
+ static_assert(sizeof(E) == sizeof(F), "Incorrect array serializer");
static size_t GetSerializedSize(const Array<E>& input) {
return sizeof(Array_Data<F>) + Align(input.size() * sizeof(E));
}
template <bool element_is_nullable, typename ElementValidateParams>
- static void SerializeElements(
- Array<E> input, Buffer* buf, Array_Data<F>* output) {
- MOJO_COMPILE_ASSERT(!element_is_nullable,
- Primitive_type_should_be_non_nullable);
- MOJO_COMPILE_ASSERT(
- (IsSame<ElementValidateParams, NoValidateParams>::value),
- Primitive_type_should_not_have_array_validate_params);
+ static void SerializeElements(Array<E> input,
+ Buffer* buf,
+ Array_Data<F>* output) {
+ static_assert(!element_is_nullable,
+ "Primitive type should be non-nullable");
+ static_assert((IsSame<ElementValidateParams, NoValidateParams>::value),
+ "Primitive type should not have array validate params");
memcpy(output->storage(), &input.storage()[0], input.size() * sizeof(E));
}
- static void DeserializeElements(
- Array_Data<F>* input, Array<E>* output) {
+ static void DeserializeElements(Array_Data<F>* input, Array<E>* output) {
std::vector<E> result(input->size());
memcpy(&result[0], input->storage(), input->size() * sizeof(E));
output->Swap(&result);
}
};
-template <> struct ArraySerializer<bool, bool, false> {
+template <>
+struct ArraySerializer<bool, bool, false> {
static size_t GetSerializedSize(const Array<bool>& input) {
return sizeof(Array_Data<bool>) + Align((input.size() + 7) / 8);
}
template <bool element_is_nullable, typename ElementValidateParams>
- static void SerializeElements(
- Array<bool> input, Buffer* buf, Array_Data<bool>* output) {
- MOJO_COMPILE_ASSERT(!element_is_nullable,
- Primitive_type_should_be_non_nullable);
- MOJO_COMPILE_ASSERT(
- (IsSame<ElementValidateParams, NoValidateParams>::value),
- Primitive_type_should_not_have_array_validate_params);
+ static void SerializeElements(Array<bool> input,
+ Buffer* buf,
+ Array_Data<bool>* output) {
+ static_assert(!element_is_nullable,
+ "Primitive type should be non-nullable");
+ static_assert((IsSame<ElementValidateParams, NoValidateParams>::value),
+ "Primitive type should not have array validate params");
// TODO(darin): Can this be a memcpy somehow instead of a bit-by-bit copy?
for (size_t i = 0; i < input.size(); ++i)
output->at(i) = input[i];
}
- static void DeserializeElements(
- Array_Data<bool>* input, Array<bool>* output) {
+ static void DeserializeElements(Array_Data<bool>* input,
+ Array<bool>* output) {
Array<bool> result(input->size());
// TODO(darin): Can this be a memcpy somehow instead of a bit-by-bit copy?
for (size_t i = 0; i < input->size(); ++i)
@@ -87,17 +89,17 @@
}
};
-template <typename H> struct ArraySerializer<ScopedHandleBase<H>, H, true> {
- static size_t GetSerializedSize(const Array<ScopedHandleBase<H> >& input) {
+template <typename H>
+struct ArraySerializer<ScopedHandleBase<H>, H, true> {
+ static size_t GetSerializedSize(const Array<ScopedHandleBase<H>>& input) {
return sizeof(Array_Data<H>) + Align(input.size() * sizeof(H));
}
template <bool element_is_nullable, typename ElementValidateParams>
- static void SerializeElements(Array<ScopedHandleBase<H> > input,
+ static void SerializeElements(Array<ScopedHandleBase<H>> input,
Buffer* buf,
Array_Data<H>* output) {
- MOJO_COMPILE_ASSERT(
- (IsSame<ElementValidateParams, NoValidateParams>::value),
- Handle_type_should_not_have_array_validate_params);
+ static_assert((IsSame<ElementValidateParams, NoValidateParams>::value),
+ "Handle type should not have array validate params");
for (size_t i = 0; i < input.size(); ++i) {
output->at(i) = input[i].release(); // Transfer ownership of the handle.
@@ -106,21 +108,24 @@
VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE,
MakeMessageWithArrayIndex(
"invalid handle in array expecting valid handles",
- input.size(), i));
+ input.size(),
+ i));
}
}
- static void DeserializeElements(
- Array_Data<H>* input, Array<ScopedHandleBase<H> >* output) {
- Array<ScopedHandleBase<H> > result(input->size());
+ static void DeserializeElements(Array_Data<H>* input,
+ Array<ScopedHandleBase<H>>* output) {
+ Array<ScopedHandleBase<H>> result(input->size());
for (size_t i = 0; i < input->size(); ++i)
result.at(i) = MakeScopedHandle(FetchAndReset(&input->at(i)));
output->Swap(&result);
}
};
-template <typename S> struct ArraySerializer<S, typename S::Data_*, true> {
+template <typename S>
+struct ArraySerializer<S, typename S::Data_*, true> {
static size_t GetSerializedSize(const Array<S>& input) {
- size_t size = sizeof(Array_Data<typename S::Data_*>) +
+ size_t size =
+ sizeof(Array_Data<typename S::Data_*>) +
input.size() * sizeof(internal::StructPointer<typename S::Data_>);
for (size_t i = 0; i < input.size(); ++i)
size += GetSerializedSize_(input[i]);
@@ -142,8 +147,8 @@
"null in array expecting valid pointers", input.size(), i));
}
}
- static void DeserializeElements(
- Array_Data<typename S::Data_*>* input, Array<S>* output) {
+ static void DeserializeElements(Array_Data<typename S::Data_*>* input,
+ Array<S>* output) {
Array<S> result(input->size());
for (size_t i = 0; i < input->size(); ++i) {
S element;
@@ -157,8 +162,8 @@
template <typename T, typename Params>
struct SerializeCaller {
static void Run(T input, Buffer* buf, typename T::Data_** output) {
- MOJO_COMPILE_ASSERT((IsSame<Params, NoValidateParams>::value),
- Struct_type_should_not_have_array_validate_params);
+ static_assert((IsSame<Params, NoValidateParams>::value),
+ "Struct type should not have array validate params");
Serialize_(input.Pass(), buf, output);
}
@@ -174,23 +179,23 @@
};
};
-template <> struct ArraySerializer<String, String_Data*, false> {
+template <>
+struct ArraySerializer<String, String_Data*, false> {
static size_t GetSerializedSize(const Array<String>& input) {
size_t size = sizeof(Array_Data<String_Data*>) +
- input.size() * sizeof(internal::StringPointer);
+ input.size() * sizeof(internal::StringPointer);
for (size_t i = 0; i < input.size(); ++i)
size += GetSerializedSize_(input[i]);
return size;
}
template <bool element_is_nullable, typename ElementValidateParams>
- static void SerializeElements(
- Array<String> input,
- Buffer* buf,
- Array_Data<String_Data*>* output) {
- MOJO_COMPILE_ASSERT(
+ static void SerializeElements(Array<String> input,
+ Buffer* buf,
+ Array_Data<String_Data*>* output) {
+ static_assert(
(IsSame<ElementValidateParams,
- ArrayValidateParams<0, false, NoValidateParams> >::value),
- String_type_has_unexpected_array_validate_params);
+ ArrayValidateParams<0, false, NoValidateParams>>::value),
+ "String type has unexpected array validate params");
for (size_t i = 0; i < input.size(); ++i) {
String_Data* element;
@@ -203,8 +208,8 @@
"null in array expecting valid strings", input.size(), i));
}
}
- static void DeserializeElements(
- Array_Data<String_Data*>* input, Array<String>* output) {
+ static void DeserializeElements(Array_Data<String_Data*>* input,
+ Array<String>* output) {
Array<String> result(input->size());
for (size_t i = 0; i < input->size(); ++i)
Deserialize_(input->at(i), &result[i]);
@@ -223,7 +228,8 @@
}
template <typename ValidateParams, typename E, typename F>
-inline void SerializeArray_(Array<E> input, internal::Buffer* buf,
+inline void SerializeArray_(Array<E> input,
+ internal::Buffer* buf,
internal::Array_Data<F>** output) {
if (input) {
MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING(
@@ -232,7 +238,8 @@
internal::VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER,
internal::MakeMessageWithExpectedArraySize(
"fixed-size array has wrong number of elements",
- input.size(), ValidateParams::expected_num_elements));
+ input.size(),
+ ValidateParams::expected_num_elements));
internal::Array_Data<F>* result =
internal::Array_Data<F>::New(input.size(), buf);
@@ -240,7 +247,7 @@
internal::ArraySerializer<E, F>::template SerializeElements<
ValidateParams::element_is_nullable,
typename ValidateParams::ElementValidateParams>(
- internal::Forward(input), buf, result);
+ internal::Forward(input), buf, result);
}
*output = result;
} else {
diff --git a/mojo/public/cpp/bindings/lib/bindings_internal.h b/mojo/public/cpp/bindings/lib/bindings_internal.h
index f12be10..8650191 100644
--- a/mojo/public/cpp/bindings/lib/bindings_internal.h
+++ b/mojo/public/cpp/bindings/lib/bindings_internal.h
@@ -12,7 +12,8 @@
class String;
namespace internal {
-template <typename T> class Array_Data;
+template <typename T>
+class Array_Data;
#pragma pack(push, 1)
@@ -20,33 +21,33 @@
uint32_t num_bytes;
uint32_t num_fields;
};
-MOJO_COMPILE_ASSERT(sizeof(StructHeader) == 8, bad_sizeof_StructHeader);
+static_assert(sizeof(StructHeader) == 8, "Bad sizeof(StructHeader)");
struct ArrayHeader {
uint32_t num_bytes;
uint32_t num_elements;
};
-MOJO_COMPILE_ASSERT(sizeof(ArrayHeader) == 8, bad_sizeof_ArrayHeader);
+static_assert(sizeof(ArrayHeader) == 8, "Bad_sizeof(ArrayHeader)");
template <typename T>
union StructPointer {
uint64_t offset;
T* ptr;
};
-MOJO_COMPILE_ASSERT(sizeof(StructPointer<char>) == 8, bad_sizeof_StructPointer);
+static_assert(sizeof(StructPointer<char>) == 8, "Bad_sizeof(StructPointer)");
template <typename T>
union ArrayPointer {
uint64_t offset;
Array_Data<T>* ptr;
};
-MOJO_COMPILE_ASSERT(sizeof(ArrayPointer<char>) == 8, bad_sizeof_ArrayPointer);
+static_assert(sizeof(ArrayPointer<char>) == 8, "Bad_sizeof(ArrayPointer)");
union StringPointer {
uint64_t offset;
Array_Data<char>* ptr;
};
-MOJO_COMPILE_ASSERT(sizeof(StringPointer) == 8, bad_sizeof_StringPointer);
+static_assert(sizeof(StringPointer) == 8, "Bad_sizeof(StringPointer)");
#pragma pack(pop)
@@ -63,20 +64,24 @@
return temp;
}
-template <typename H> struct IsHandle {
+template <typename H>
+struct IsHandle {
enum { value = IsBaseOf<Handle, H>::value };
};
template <typename T, bool move_only = IsMoveOnlyType<T>::value>
struct WrapperTraits;
-template <typename T> struct WrapperTraits<T, false> {
+template <typename T>
+struct WrapperTraits<T, false> {
typedef T DataType;
};
-template <typename H> struct WrapperTraits<ScopedHandleBase<H>, true> {
+template <typename H>
+struct WrapperTraits<ScopedHandleBase<H>, true> {
typedef H DataType;
};
-template <typename S> struct WrapperTraits<S, true> {
+template <typename S>
+struct WrapperTraits<S, true> {
typedef typename S::Data_* DataType;
};
diff --git a/mojo/public/cpp/bindings/lib/bindings_serialization.cc b/mojo/public/cpp/bindings/lib/bindings_serialization.cc
index 7161efe..936d0ca 100644
--- a/mojo/public/cpp/bindings/lib/bindings_serialization.cc
+++ b/mojo/public/cpp/bindings/lib/bindings_serialization.cc
@@ -16,7 +16,7 @@
const size_t kAlignment = 8;
-template<typename T>
+template <typename T>
T AlignImpl(T t) {
return t + (kAlignment - (t % kAlignment)) % kAlignment;
}
@@ -57,7 +57,7 @@
bool ValidateEncodedPointer(const uint64_t* offset) {
// Cast to uintptr_t so overflow behavior is well defined.
return reinterpret_cast<uintptr_t>(offset) + *offset >=
- reinterpret_cast<uintptr_t>(offset);
+ reinterpret_cast<uintptr_t>(offset);
}
void EncodeHandle(Handle* handle, std::vector<Handle>* handles) {
diff --git a/mojo/public/cpp/bindings/lib/bounds_checker.cc b/mojo/public/cpp/bindings/lib/bounds_checker.cc
index 87f5b7c..5b96b2d 100644
--- a/mojo/public/cpp/bindings/lib/bounds_checker.cc
+++ b/mojo/public/cpp/bindings/lib/bounds_checker.cc
@@ -11,7 +11,8 @@
namespace mojo {
namespace internal {
-BoundsChecker::BoundsChecker(const void* data, uint32_t data_num_bytes,
+BoundsChecker::BoundsChecker(const void* data,
+ uint32_t data_num_bytes,
size_t num_handles)
: data_begin_(reinterpret_cast<uintptr_t>(data)),
data_end_(data_begin_ + data_num_bytes),
diff --git a/mojo/public/cpp/bindings/lib/bounds_checker.h b/mojo/public/cpp/bindings/lib/bounds_checker.h
index 6c47230..f0520be 100644
--- a/mojo/public/cpp/bindings/lib/bounds_checker.h
+++ b/mojo/public/cpp/bindings/lib/bounds_checker.h
@@ -21,8 +21,7 @@
public:
// [data, data + data_num_bytes) specifies the initial valid memory range.
// [0, num_handles) specifies the initial valid range of handle indices.
- BoundsChecker(const void* data, uint32_t data_num_bytes,
- size_t num_handles);
+ BoundsChecker(const void* data, uint32_t data_num_bytes, size_t num_handles);
~BoundsChecker();
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc
index c0b70b8..ef63ecf 100644
--- a/mojo/public/cpp/bindings/lib/connector.cc
+++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -69,15 +69,16 @@
if (drop_writes_)
return true;
- MojoResult rv = WriteMessageRaw(
- message_pipe_.get(),
- message->data(),
- message->data_num_bytes(),
- message->mutable_handles()->empty() ? nullptr :
- reinterpret_cast<const MojoHandle*>(
- &message->mutable_handles()->front()),
- static_cast<uint32_t>(message->mutable_handles()->size()),
- MOJO_WRITE_MESSAGE_FLAG_NONE);
+ MojoResult rv =
+ WriteMessageRaw(message_pipe_.get(),
+ message->data(),
+ message->data_num_bytes(),
+ message->mutable_handles()->empty()
+ ? nullptr
+ : reinterpret_cast<const MojoHandle*>(
+ &message->mutable_handles()->front()),
+ static_cast<uint32_t>(message->mutable_handles()->size()),
+ MOJO_WRITE_MESSAGE_FLAG_NONE);
switch (rv) {
case MOJO_RESULT_OK:
diff --git a/mojo/public/cpp/bindings/lib/fixed_buffer.cc b/mojo/public/cpp/bindings/lib/fixed_buffer.cc
index 9542ef8..980abc3 100644
--- a/mojo/public/cpp/bindings/lib/fixed_buffer.cc
+++ b/mojo/public/cpp/bindings/lib/fixed_buffer.cc
@@ -15,9 +15,7 @@
namespace internal {
FixedBuffer::FixedBuffer(size_t size)
- : ptr_(nullptr),
- cursor_(0),
- size_(internal::Align(size)) {
+ : ptr_(nullptr), cursor_(0), size_(internal::Align(size)) {
// calloc() required to zero memory and thus avoid info leaks.
ptr_ = static_cast<char*>(calloc(size_, 1));
}
diff --git a/mojo/public/cpp/bindings/lib/interface_ptr_internal.h b/mojo/public/cpp/bindings/lib/interface_ptr_internal.h
index 77386fa..a38baf7 100644
--- a/mojo/public/cpp/bindings/lib/interface_ptr_internal.h
+++ b/mojo/public/cpp/bindings/lib/interface_ptr_internal.h
@@ -69,9 +69,7 @@
return handle_.Pass();
}
- bool is_bound() const {
- return handle_.is_valid() || router_;
- }
+ bool is_bound() const { return handle_.is_valid() || router_; }
void set_client(typename Interface::Client* client) {
ConfigureProxyIfNecessary();
@@ -100,9 +98,9 @@
class ProxyWithStub : public Interface::Proxy_ {
public:
explicit ProxyWithStub(MessageReceiverWithResponder* receiver)
- : Interface::Proxy_(receiver) {
- }
+ : Interface::Proxy_(receiver) {}
typename Interface::Client::Stub_ stub;
+
private:
MOJO_DISALLOW_COPY_AND_ASSIGN(ProxyWithStub);
};
diff --git a/mojo/public/cpp/bindings/lib/message.cc b/mojo/public/cpp/bindings/lib/message.cc
index cec60c0..2723bcb 100644
--- a/mojo/public/cpp/bindings/lib/message.cc
+++ b/mojo/public/cpp/bindings/lib/message.cc
@@ -12,16 +12,15 @@
namespace mojo {
-Message::Message()
- : data_num_bytes_(0),
- data_(nullptr) {
+Message::Message() : data_num_bytes_(0), data_(nullptr) {
}
Message::~Message() {
free(data_);
for (std::vector<Handle>::iterator it = handles_.begin();
- it != handles_.end(); ++it) {
+ it != handles_.end();
+ ++it) {
if (it->is_valid())
CloseRaw(*it);
}
@@ -64,15 +63,15 @@
message.AllocUninitializedData(num_bytes);
message.mutable_handles()->resize(num_handles);
- rv = ReadMessageRaw(handle,
- message.mutable_data(),
- &num_bytes,
- message.mutable_handles()->empty()
- ? nullptr
- : reinterpret_cast<MojoHandle*>(
- &message.mutable_handles()->front()),
- &num_handles,
- MOJO_READ_MESSAGE_FLAG_NONE);
+ rv = ReadMessageRaw(
+ handle,
+ message.mutable_data(),
+ &num_bytes,
+ message.mutable_handles()->empty()
+ ? nullptr
+ : reinterpret_cast<MojoHandle*>(&message.mutable_handles()->front()),
+ &num_handles,
+ MOJO_READ_MESSAGE_FLAG_NONE);
if (receiver && rv == MOJO_RESULT_OK)
*receiver_result = receiver->Accept(&message);
diff --git a/mojo/public/cpp/bindings/lib/message_builder.cc b/mojo/public/cpp/bindings/lib/message_builder.cc
index c746644..cc914e8 100644
--- a/mojo/public/cpp/bindings/lib/message_builder.cc
+++ b/mojo/public/cpp/bindings/lib/message_builder.cc
@@ -31,8 +31,7 @@
message->AdoptData(num_bytes, static_cast<MessageData*>(buf_.Leak()));
}
-MessageBuilder::MessageBuilder(size_t size)
- : buf_(size) {
+MessageBuilder::MessageBuilder(size_t size) : buf_(size) {
}
MessageWithRequestIDBuilder::MessageWithRequestIDBuilder(uint32_t name,
diff --git a/mojo/public/cpp/bindings/lib/message_builder.h b/mojo/public/cpp/bindings/lib/message_builder.h
index b4988ff..a10940c 100644
--- a/mojo/public/cpp/bindings/lib/message_builder.h
+++ b/mojo/public/cpp/bindings/lib/message_builder.h
@@ -36,25 +36,30 @@
class MessageWithRequestIDBuilder : public MessageBuilder {
public:
- MessageWithRequestIDBuilder(uint32_t name, size_t payload_size,
- uint32_t flags, uint64_t request_id);
+ MessageWithRequestIDBuilder(uint32_t name,
+ size_t payload_size,
+ uint32_t flags,
+ uint64_t request_id);
};
class RequestMessageBuilder : public MessageWithRequestIDBuilder {
public:
RequestMessageBuilder(uint32_t name, size_t payload_size)
- : MessageWithRequestIDBuilder(name, payload_size, kMessageExpectsResponse,
- 0) {
- }
+ : MessageWithRequestIDBuilder(name,
+ payload_size,
+ kMessageExpectsResponse,
+ 0) {}
};
class ResponseMessageBuilder : public MessageWithRequestIDBuilder {
public:
- ResponseMessageBuilder(uint32_t name, size_t payload_size,
+ ResponseMessageBuilder(uint32_t name,
+ size_t payload_size,
uint64_t request_id)
- : MessageWithRequestIDBuilder(name, payload_size, kMessageIsResponse,
- request_id) {
- }
+ : MessageWithRequestIDBuilder(name,
+ payload_size,
+ kMessageIsResponse,
+ request_id) {}
};
} // namespace internal
diff --git a/mojo/public/cpp/bindings/lib/message_header_validator.cc b/mojo/public/cpp/bindings/lib/message_header_validator.cc
index a55917a..9d28ecc 100644
--- a/mojo/public/cpp/bindings/lib/message_header_validator.cc
+++ b/mojo/public/cpp/bindings/lib/message_header_validator.cc
@@ -37,9 +37,8 @@
// Validate flags (allow unknown bits):
// These flags require a RequestID.
- if (header->num_fields < 3 &&
- ((header->flags & kMessageExpectsResponse) ||
- (header->flags & kMessageIsResponse))) {
+ if (header->num_fields < 3 && ((header->flags & kMessageExpectsResponse) ||
+ (header->flags & kMessageIsResponse))) {
ReportValidationError(VALIDATION_ERROR_MESSAGE_HEADER_MISSING_REQUEST_ID);
return false;
}
@@ -66,8 +65,8 @@
// if |message| contains handles.
BoundsChecker bounds_checker(message->data(), message->data_num_bytes(), 0);
- if (!ValidateStructHeader(message->data(), sizeof(MessageHeader), 2,
- &bounds_checker)) {
+ if (!ValidateStructHeader(
+ message->data(), sizeof(MessageHeader), 2, &bounds_checker)) {
return false;
}
diff --git a/mojo/public/cpp/bindings/lib/message_internal.h b/mojo/public/cpp/bindings/lib/message_internal.h
index 3c67902..cdecf91 100644
--- a/mojo/public/cpp/bindings/lib/message_internal.h
+++ b/mojo/public/cpp/bindings/lib/message_internal.h
@@ -12,29 +12,26 @@
#pragma pack(push, 1)
-enum {
- kMessageExpectsResponse = 1 << 0,
- kMessageIsResponse = 1 << 1
-};
+enum { kMessageExpectsResponse = 1 << 0, kMessageIsResponse = 1 << 1 };
struct MessageHeader : internal::StructHeader {
uint32_t name;
uint32_t flags;
};
-MOJO_COMPILE_ASSERT(sizeof(MessageHeader) == 16, bad_sizeof_MessageHeader);
+static_assert(sizeof(MessageHeader) == 16, "Bad sizeof(MessageHeader)");
struct MessageHeaderWithRequestID : MessageHeader {
uint64_t request_id;
};
-MOJO_COMPILE_ASSERT(sizeof(MessageHeaderWithRequestID) == 24,
- bad_sizeof_MessageHeaderWithRequestID);
+static_assert(sizeof(MessageHeaderWithRequestID) == 24,
+ "Bad sizeof(MessageHeaderWithRequestID)");
struct MessageData {
MessageHeader header;
};
-MOJO_COMPILE_ASSERT(sizeof(MessageData) == sizeof(MessageHeader),
- bad_sizeof_MessageData);
+static_assert(sizeof(MessageData) == sizeof(MessageHeader),
+ "Bad sizeof(MessageData)");
#pragma pack(pop)
diff --git a/mojo/public/cpp/bindings/lib/router.cc b/mojo/public/cpp/bindings/lib/router.cc
index 3478840..91a5d31 100644
--- a/mojo/public/cpp/bindings/lib/router.cc
+++ b/mojo/public/cpp/bindings/lib/router.cc
@@ -14,10 +14,8 @@
class ResponderThunk : public MessageReceiver {
public:
explicit ResponderThunk(const SharedData<Router*>& router)
- : router_(router) {
- }
- virtual ~ResponderThunk() {
- }
+ : router_(router) {}
+ virtual ~ResponderThunk() {}
// MessageReceiver implementation:
virtual bool Accept(Message* message) override {
@@ -69,7 +67,8 @@
weak_self_.set_value(nullptr);
for (ResponderMap::const_iterator i = responders_.begin();
- i != responders_.end(); ++i) {
+ i != responders_.end();
+ ++i) {
delete i->second;
}
}
@@ -79,8 +78,7 @@
return connector_.Accept(message);
}
-bool Router::AcceptWithResponder(Message* message,
- MessageReceiver* responder) {
+bool Router::AcceptWithResponder(Message* message, MessageReceiver* responder) {
MOJO_DCHECK(message->has_flag(kMessageExpectsResponse));
// Reserve 0 in case we want it to convey special meaning in the future.
diff --git a/mojo/public/cpp/bindings/lib/router.h b/mojo/public/cpp/bindings/lib/router.h
index ebd4928..0972c1c 100644
--- a/mojo/public/cpp/bindings/lib/router.h
+++ b/mojo/public/cpp/bindings/lib/router.h
@@ -38,9 +38,7 @@
// waiting to read from the pipe.
bool encountered_error() const { return connector_.encountered_error(); }
- void CloseMessagePipe() {
- connector_.CloseMessagePipe();
- }
+ void CloseMessagePipe() { connector_.CloseMessagePipe(); }
ScopedMessagePipeHandle PassMessagePipe() {
return connector_.PassMessagePipe();
@@ -53,9 +51,7 @@
// Blocks the current thread for the first incoming method call, i.e., either
// a call to a client method or a callback method.
- bool WaitForIncomingMessage() {
- return connector_.WaitForIncomingMessage();
- }
+ bool WaitForIncomingMessage() { return connector_.WaitForIncomingMessage(); }
// Sets this object to testing mode.
// In testing mode:
diff --git a/mojo/public/cpp/bindings/lib/shared_data.h b/mojo/public/cpp/bindings/lib/shared_data.h
index c7bd54f..54c9346 100644
--- a/mojo/public/cpp/bindings/lib/shared_data.h
+++ b/mojo/public/cpp/bindings/lib/shared_data.h
@@ -14,15 +14,11 @@
template <typename T>
class SharedData {
public:
- ~SharedData() {
- holder_->Release();
- }
+ ~SharedData() { holder_->Release(); }
- SharedData() : holder_(new Holder()) {
- }
+ SharedData() : holder_(new Holder()) {}
- explicit SharedData(const T& value) : holder_(new Holder(value)) {
- }
+ explicit SharedData(const T& value) : holder_(new Holder(value)) {}
SharedData(const SharedData<T>& other) : holder_(other.holder_) {
holder_->Retain();
@@ -47,26 +43,21 @@
holder_ = new Holder(value);
}
- void set_value(const T& value) {
- holder_->value = value;
- }
- T* mutable_value() {
- return &holder_->value;
- }
- const T& value() const {
- return holder_->value;
- }
+ void set_value(const T& value) { holder_->value = value; }
+ T* mutable_value() { return &holder_->value; }
+ const T& value() const { return holder_->value; }
private:
class Holder {
public:
- Holder() : value(), ref_count_(1) {
- }
- Holder(const T& value) : value(value), ref_count_(1) {
- }
+ Holder() : value(), ref_count_(1) {}
+ Holder(const T& value) : value(value), ref_count_(1) {}
void Retain() { ++ref_count_; }
- void Release() { if (--ref_count_ == 0) delete this; }
+ void Release() {
+ if (--ref_count_ == 0)
+ delete this;
+ }
T value;
diff --git a/mojo/public/cpp/bindings/lib/shared_ptr.h b/mojo/public/cpp/bindings/lib/shared_ptr.h
index 899e792..37c8735 100644
--- a/mojo/public/cpp/bindings/lib/shared_ptr.h
+++ b/mojo/public/cpp/bindings/lib/shared_ptr.h
@@ -18,22 +18,14 @@
public:
SharedPtr() {}
- explicit SharedPtr(P* ptr) {
- impl_.mutable_value()->ptr = ptr;
- }
+ explicit SharedPtr(P* ptr) { impl_.mutable_value()->ptr = ptr; }
// Default copy-constructor and assignment operator are OK.
- P* get() {
- return impl_.value().ptr;
- }
- const P* get() const {
- return impl_.value().ptr;
- }
+ P* get() { return impl_.value().ptr; }
+ const P* get() const { return impl_.value().ptr; }
- void reset() {
- impl_.reset();
- }
+ void reset() { impl_.reset(); }
P* operator->() { return get(); }
const P* operator->() const { return get(); }
@@ -46,11 +38,9 @@
delete ptr;
}
- Impl() : ptr(nullptr) {
- }
+ Impl() : ptr(nullptr) {}
- Impl(P* ptr) : ptr(ptr) {
- }
+ Impl(P* ptr) : ptr(ptr) {}
P* ptr;
diff --git a/mojo/public/cpp/bindings/lib/string_serialization.cc b/mojo/public/cpp/bindings/lib/string_serialization.cc
index a0544c0..e29d6f8 100644
--- a/mojo/public/cpp/bindings/lib/string_serialization.cc
+++ b/mojo/public/cpp/bindings/lib/string_serialization.cc
@@ -14,7 +14,8 @@
return internal::Align(sizeof(internal::String_Data) + input.size());
}
-void Serialize_(const String& input, internal::Buffer* buf,
+void Serialize_(const String& input,
+ internal::Buffer* buf,
internal::String_Data** output) {
if (input) {
internal::String_Data* result =
diff --git a/mojo/public/cpp/bindings/lib/string_serialization.h b/mojo/public/cpp/bindings/lib/string_serialization.h
index bad2a0c..0118742 100644
--- a/mojo/public/cpp/bindings/lib/string_serialization.h
+++ b/mojo/public/cpp/bindings/lib/string_serialization.h
@@ -11,7 +11,8 @@
namespace mojo {
size_t GetSerializedSize_(const String& input);
-void Serialize_(const String& input, internal::Buffer* buffer,
+void Serialize_(const String& input,
+ internal::Buffer* buffer,
internal::String_Data** output);
void Deserialize_(internal::String_Data* input, String* output);
diff --git a/mojo/public/cpp/bindings/lib/template_util.h b/mojo/public/cpp/bindings/lib/template_util.h
index 5991266..bc459f1 100644
--- a/mojo/public/cpp/bindings/lib/template_util.h
+++ b/mojo/public/cpp/bindings/lib/template_util.h
@@ -8,24 +8,29 @@
namespace mojo {
namespace internal {
-template<class T, T v>
+template <class T, T v>
struct IntegralConstant {
static const T value = v;
};
-template <class T, T v> const T IntegralConstant<T, v>::value;
+template <class T, T v>
+const T IntegralConstant<T, v>::value;
typedef IntegralConstant<bool, true> TrueType;
typedef IntegralConstant<bool, false> FalseType;
-template <class T> struct IsConst : FalseType {};
-template <class T> struct IsConst<const T> : TrueType {};
+template <class T>
+struct IsConst : FalseType {};
+template <class T>
+struct IsConst<const T> : TrueType {};
-template<bool B, typename T = void>
+template <bool B, typename T = void>
struct EnableIf {};
-template<typename T>
-struct EnableIf<true, T> { typedef T type; };
+template <typename T>
+struct EnableIf<true, T> {
+ typedef T type;
+};
// Types YesType and NoType are guaranteed such that sizeof(YesType) <
// sizeof(NoType).
@@ -38,15 +43,16 @@
// A helper template to determine if given type is non-const move-only-type,
// i.e. if a value of the given type should be passed via .Pass() in a
// destructive way.
-template <typename T> struct IsMoveOnlyType {
+template <typename T>
+struct IsMoveOnlyType {
template <typename U>
static YesType Test(const typename U::MoveOnlyTypeForCPP03*);
template <typename U>
static NoType Test(...);
- static const bool value = sizeof(Test<T>(0)) == sizeof(YesType) &&
- !IsConst<T>::value;
+ static const bool value =
+ sizeof(Test<T>(0)) == sizeof(YesType) && !IsConst<T>::value;
};
template <typename T>
@@ -61,13 +67,16 @@
// This goop is a trick used to implement a template that can be used to
// determine if a given class is the base class of another given class.
-template<typename, typename> struct IsSame {
+template <typename, typename>
+struct IsSame {
static bool const value = false;
};
-template<typename A> struct IsSame<A, A> {
+template <typename A>
+struct IsSame<A, A> {
static bool const value = true;
};
-template<typename Base, typename Derived> struct IsBaseOf {
+template <typename Base, typename Derived>
+struct IsBaseOf {
private:
// This class doesn't work correctly with forward declarations.
// Because sizeof cannot be applied to incomplete types, this line prevents us
@@ -75,8 +84,8 @@
typedef char (*EnsureTypesAreComplete)[sizeof(Base) + sizeof(Derived)];
static Derived* CreateDerived();
- static char (&Check(Base*))[1];
- static char (&Check(...))[2];
+ static char(&Check(Base*))[1];
+ static char(&Check(...))[2];
public:
static bool const value = sizeof Check(CreateDerived()) == 1 &&
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.cc b/mojo/public/cpp/bindings/lib/validation_errors.cc
index 47bcf02..0f55789 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.cc
+++ b/mojo/public/cpp/bindings/lib/validation_errors.cc
@@ -83,7 +83,7 @@
}
SerializationWarningObserverForTesting::
-~SerializationWarningObserverForTesting() {
+ ~SerializationWarningObserverForTesting() {
MOJO_DCHECK(g_serialization_warning_observer == this);
g_serialization_warning_observer = nullptr;
}
diff --git a/mojo/public/cpp/bindings/lib/validation_errors.h b/mojo/public/cpp/bindings/lib/validation_errors.h
index 6152e60..ef5ab9e 100644
--- a/mojo/public/cpp/bindings/lib/validation_errors.h
+++ b/mojo/public/cpp/bindings/lib/validation_errors.h
@@ -101,11 +101,11 @@
// of the serialzation result.
//
// In non-debug build, does nothing (not even compiling |condition|).
-#define MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( \
- condition, error, description) \
+#define MOJO_INTERNAL_DLOG_SERIALIZATION_WARNING( \
+ condition, error, description) \
MOJO_DLOG_IF(FATAL, (condition) && !ReportSerializationWarning(error)) \
- << "The outgoing message will trigger " \
- << ValidationErrorToString(error) << " at the receiving side (" \
+ << "The outgoing message will trigger " \
+ << ValidationErrorToString(error) << " at the receiving side (" \
<< description << ").";
#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_VALIDATION_ERRORS_H_
diff --git a/mojo/public/cpp/bindings/message.h b/mojo/public/cpp/bindings/message.h
index 62801f1..72201f4 100644
--- a/mojo/public/cpp/bindings/message.h
+++ b/mojo/public/cpp/bindings/message.h
@@ -31,8 +31,8 @@
uint32_t data_num_bytes() const { return data_num_bytes_; }
// Access the raw bytes of the message.
- const uint8_t* data() const { return
- reinterpret_cast<const uint8_t*>(data_);
+ const uint8_t* data() const {
+ return reinterpret_cast<const uint8_t*>(data_);
}
uint8_t* mutable_data() { return reinterpret_cast<uint8_t*>(data_); }
@@ -47,12 +47,12 @@
uint64_t request_id() const {
MOJO_DCHECK(has_request_id());
return static_cast<const internal::MessageHeaderWithRequestID*>(
- &data_->header)->request_id;
+ &data_->header)->request_id;
}
void set_request_id(uint64_t request_id) {
MOJO_DCHECK(has_request_id());
- static_cast<internal::MessageHeaderWithRequestID*>(&data_->header)->
- request_id = request_id;
+ static_cast<internal::MessageHeaderWithRequestID*>(&data_->header)
+ ->request_id = request_id;
}
// Access the payload.
@@ -102,8 +102,8 @@
// |responder| and will delete it after calling |responder->Accept| or upon
// its own destruction.
//
- virtual bool AcceptWithResponder(
- Message* message, MessageReceiver* responder) MOJO_WARN_UNUSED_RESULT = 0;
+ virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder)
+ MOJO_WARN_UNUSED_RESULT = 0;
};
// Read a single message from the pipe and dispatch to the given receiver. The
diff --git a/mojo/public/cpp/bindings/no_interface.h b/mojo/public/cpp/bindings/no_interface.h
index 07587bd..d8143bd 100644
--- a/mojo/public/cpp/bindings/no_interface.h
+++ b/mojo/public/cpp/bindings/no_interface.h
@@ -43,7 +43,6 @@
MessageReceiver* responder) override;
};
-
// AnyInterface is for use in cases where any interface would do (e.g., see the
// Shell::Connect method).
diff --git a/mojo/public/cpp/bindings/string.h b/mojo/public/cpp/bindings/string.h
index cd7db26..3c1520a 100644
--- a/mojo/public/cpp/bindings/string.h
+++ b/mojo/public/cpp/bindings/string.h
@@ -24,11 +24,10 @@
value_ = chars;
}
String(const char* chars, size_t num_chars)
- : value_(chars, num_chars),
- is_null_(false) {
- }
+ : value_(chars, num_chars), is_null_(false) {}
template <size_t N>
- String(const char chars[N]) : value_(chars, N-1), is_null_(false) {}
+ String(const char chars[N])
+ : value_(chars, N - 1), is_null_(false) {}
template <typename U>
static String From(const U& other) {
@@ -102,9 +101,15 @@
inline bool operator==(const String& a, const char* b) {
return !a.is_null() && a.get() == b;
}
-inline bool operator!=(const String& a, const String& b) { return !(a == b); }
-inline bool operator!=(const char* a, const String& b) { return !(a == b); }
-inline bool operator!=(const String& a, const char* b) { return !(a == b); }
+inline bool operator!=(const String& a, const String& b) {
+ return !(a == b);
+}
+inline bool operator!=(const char* a, const String& b) {
+ return !(a == b);
+}
+inline bool operator!=(const String& a, const char* b) {
+ return !(a == b);
+}
inline std::ostream& operator<<(std::ostream& out, const String& s) {
return out << s.get();
@@ -126,7 +131,7 @@
struct TypeConverter<String, char[N]> {
static String Convert(const char input[N]) {
MOJO_DCHECK(input);
- return String(input, N-1);
+ return String(input, N - 1);
}
};
@@ -135,7 +140,7 @@
struct TypeConverter<String, const char[N]> {
static String Convert(const char input[N]) {
MOJO_DCHECK(input);
- return String(input, N-1);
+ return String(input, N - 1);
}
};
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h
index 46729dd..75a46bb 100644
--- a/mojo/public/cpp/bindings/struct_ptr.h
+++ b/mojo/public/cpp/bindings/struct_ptr.h
@@ -17,7 +17,9 @@
class StructHelper {
public:
template <typename Ptr>
- static void Initialize(Ptr* ptr) { ptr->Initialize(); }
+ static void Initialize(Ptr* ptr) {
+ ptr->Initialize();
+ }
};
} // namespace internal
@@ -25,13 +27,12 @@
template <typename Struct>
class StructPtr {
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(StructPtr, RValue);
+
public:
typedef typename Struct::Data_ Data_;
StructPtr() : ptr_(nullptr) {}
- ~StructPtr() {
- delete ptr_;
- }
+ ~StructPtr() { delete ptr_; }
StructPtr(RValue other) : ptr_(nullptr) { Take(other.object); }
StructPtr& operator=(RValue other) {
@@ -63,16 +64,12 @@
}
Struct* get() const { return ptr_; }
- void Swap(StructPtr* other) {
- std::swap(ptr_, other->ptr_);
- }
+ void Swap(StructPtr* other) { std::swap(ptr_, other->ptr_); }
// Please note that calling this method will fail compilation if the value
// type |Struct| doesn't have a Clone() method defined (which usually means
// that it contains Mojo handles).
- StructPtr Clone() const {
- return is_null() ? StructPtr() : ptr_->Clone();
- }
+ StructPtr Clone() const { return is_null() ? StructPtr() : ptr_->Clone(); }
private:
typedef Struct* StructPtr::*Testable;
@@ -99,6 +96,7 @@
template <typename Struct>
class InlinedStructPtr {
MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(InlinedStructPtr, RValue);
+
public:
typedef typename Struct::Data_ Data_;
@@ -118,7 +116,7 @@
void reset() {
is_null_ = true;
- value_.~Struct();
+ value_. ~Struct();
new (&value_) Struct();
}
diff --git a/mojo/public/cpp/bindings/tests/BUILD.gn b/mojo/public/cpp/bindings/tests/BUILD.gn
index 6a4b2df..12b122c 100644
--- a/mojo/public/cpp/bindings/tests/BUILD.gn
+++ b/mojo/public/cpp/bindings/tests/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_bindings_unittests
+# GYP version: mojo/mojo_base.gyp:mojo_public_bindings_unittests
test("mojo_public_bindings_unittests") {
sources = [
"array_unittest.cc",
@@ -22,7 +22,7 @@
]
deps = [
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/public/cpp/bindings",
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/system",
diff --git a/mojo/public/cpp/bindings/tests/array_unittest.cc b/mojo/public/cpp/bindings/tests/array_unittest.cc
index 82a705f..b899513 100644
--- a/mojo/public/cpp/bindings/tests/array_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/array_unittest.cc
@@ -86,7 +86,7 @@
TEST_F(ArrayTest, Basic) {
Array<char> array(8);
for (size_t i = 0; i < array.size(); ++i) {
- char val = static_cast<char>(i*2);
+ char val = static_cast<char>(i * 2);
array[i] = val;
EXPECT_EQ(val, array.at(i));
}
@@ -209,7 +209,7 @@
array[i] = static_cast<int32_t>(i);
size_t size = GetSerializedSize_(array);
- EXPECT_EQ(8U + 4*4U, size);
+ EXPECT_EQ(8U + 4 * 4U, size);
FixedBuffer buf(size);
Array_Data<int32_t>* data;
@@ -234,13 +234,14 @@
}
size_t size = GetSerializedSize_(array);
- EXPECT_EQ(8U + 2*8U + 2*(8U + 4*4U), size);
+ EXPECT_EQ(8U + 2 * 8U + 2 * (8U + 4 * 4U), size);
FixedBuffer buf(size);
Array_Data<Array_Data<int32_t>*>* data;
- SerializeArray_<ArrayValidateParams<0, false,
- ArrayValidateParams<0, false,
- NoValidateParams>>>(
+ SerializeArray_<
+ ArrayValidateParams<0,
+ false,
+ ArrayValidateParams<0, false, NoValidateParams>>>(
array.Pass(), &buf, &data);
Array<Array<int32_t>> array2;
@@ -284,17 +285,18 @@
}
size_t size = GetSerializedSize_(array);
- EXPECT_EQ(8U + // array header
- 10*8U + // array payload (10 pointers)
- 10*(8U + // string header
- 8U), // string length of 1 padded to 8
+ EXPECT_EQ(8U + // array header
+ 10 * 8U + // array payload (10 pointers)
+ 10 * (8U + // string header
+ 8U), // string length of 1 padded to 8
size);
FixedBuffer buf(size);
Array_Data<String_Data*>* data;
- SerializeArray_<ArrayValidateParams<0, false,
- ArrayValidateParams<0, false,
- NoValidateParams>>>(
+ SerializeArray_<
+ ArrayValidateParams<0,
+ false,
+ ArrayValidateParams<0, false, NoValidateParams>>>(
array.Pass(), &buf, &data);
Array<String> array2;
diff --git a/mojo/public/cpp/bindings/tests/bounds_checker_unittest.cc b/mojo/public/cpp/bindings/tests/bounds_checker_unittest.cc
index 8378cdd..1cd9618 100644
--- a/mojo/public/cpp/bindings/tests/bounds_checker_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/bounds_checker_unittest.cc
@@ -21,8 +21,8 @@
TEST(BoundsCheckerTest, ConstructorRangeOverflow) {
{
// Test memory range overflow.
- internal::BoundsChecker
- checker(ToPtr(std::numeric_limits<uintptr_t>::max() - 3000), 5000, 0);
+ internal::BoundsChecker checker(
+ ToPtr(std::numeric_limits<uintptr_t>::max() - 3000), 5000, 0);
EXPECT_FALSE(checker.IsValidRange(
ToPtr(std::numeric_limits<uintptr_t>::max() - 3000), 1));
@@ -92,8 +92,8 @@
}
{
- internal::BoundsChecker
- checker(ToPtr(std::numeric_limits<uintptr_t>::max() - 2000), 1000, 0);
+ internal::BoundsChecker checker(
+ ToPtr(std::numeric_limits<uintptr_t>::max() - 2000), 1000, 0);
// Test overflow.
EXPECT_FALSE(checker.IsValidRange(
@@ -146,8 +146,8 @@
// |internal::kEncodedInvalidHandleValue|.
EXPECT_EQ(internal::kEncodedInvalidHandleValue,
std::numeric_limits<uint32_t>::max());
- internal::BoundsChecker checker(ToPtr(0), 0,
- std::numeric_limits<uint32_t>::max());
+ internal::BoundsChecker checker(
+ ToPtr(0), 0, std::numeric_limits<uint32_t>::max());
EXPECT_TRUE(
checker.ClaimHandle(Handle(std::numeric_limits<uint32_t>::max() - 1)));
@@ -188,15 +188,15 @@
}
{
- internal::BoundsChecker
- checker(ToPtr(std::numeric_limits<uintptr_t>::max() - 1000), 500, 0);
+ internal::BoundsChecker checker(
+ ToPtr(std::numeric_limits<uintptr_t>::max() - 1000), 500, 0);
// Test overflow.
EXPECT_FALSE(checker.ClaimMemory(
ToPtr(std::numeric_limits<uintptr_t>::max() - 750), 4000));
- EXPECT_FALSE(checker.ClaimMemory(
- ToPtr(std::numeric_limits<uintptr_t>::max() - 750),
- std::numeric_limits<uint32_t>::max()));
+ EXPECT_FALSE(
+ checker.ClaimMemory(ToPtr(std::numeric_limits<uintptr_t>::max() - 750),
+ std::numeric_limits<uint32_t>::max()));
// This should be fine.
EXPECT_TRUE(checker.ClaimMemory(
diff --git a/mojo/public/cpp/bindings/tests/connector_unittest.cc b/mojo/public/cpp/bindings/tests/connector_unittest.cc
index 317f4c8..b90faf6 100644
--- a/mojo/public/cpp/bindings/tests/connector_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/connector_unittest.cc
@@ -19,21 +19,16 @@
class MessageAccumulator : public MessageReceiver {
public:
- MessageAccumulator() {
- }
+ MessageAccumulator() {}
virtual bool Accept(Message* message) override {
queue_.Push(message);
return true;
}
- bool IsEmpty() const {
- return queue_.IsEmpty();
- }
+ bool IsEmpty() const { return queue_.IsEmpty(); }
- void Pop(Message* message) {
- queue_.Pop(message);
- }
+ void Pop(Message* message) { queue_.Pop(message); }
private:
internal::MessageQueue queue_;
@@ -78,8 +73,7 @@
class ConnectorTest : public testing::Test {
public:
- ConnectorTest() {
- }
+ ConnectorTest() {}
virtual void SetUp() override {
CreateMessagePipe(nullptr, &handle0_, &handle1_);
@@ -94,9 +88,7 @@
builder.Finish(message);
}
- void PumpMessages() {
- loop_.RunUntilIdle();
- }
+ void PumpMessages() { loop_.RunUntilIdle(); }
protected:
ScopedMessagePipeHandle handle0_;
@@ -189,7 +181,7 @@
internal::Connector connector0(handle0_.Pass());
internal::Connector connector1(handle1_.Pass());
- const char* kText[] = { "hello", "world" };
+ const char* kText[] = {"hello", "world"};
for (size_t i = 0; i < MOJO_ARRAYSIZE(kText); ++i) {
Message message;
@@ -219,7 +211,7 @@
internal::Connector connector0(handle0_.Pass());
internal::Connector connector1(handle1_.Pass());
- const char* kText[] = { "hello", "world" };
+ const char* kText[] = {"hello", "world"};
for (size_t i = 0; i < MOJO_ARRAYSIZE(kText); ++i) {
Message message;
@@ -369,7 +361,7 @@
internal::Connector connector0(handle0_.Pass());
internal::Connector connector1(handle1_.Pass());
- const char* kText[] = { "hello", "world" };
+ const char* kText[] = {"hello", "world"};
for (size_t i = 0; i < MOJO_ARRAYSIZE(kText); ++i) {
Message message;
diff --git a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
index d4cffb4..ac02f5f 100644
--- a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
@@ -17,11 +17,9 @@
class StringRecorder {
public:
- explicit StringRecorder(std::string* buf) : buf_(buf) {
- }
- void Run(const String& a) const {
- *buf_ = a.To<std::string>();
- }
+ explicit StringRecorder(std::string* buf) : buf_(buf) {}
+ void Run(const String& a) const { *buf_ = a.To<std::string>(); }
+
private:
std::string* buf_;
};
@@ -88,14 +86,15 @@
ASSERT_TRUE(pipe.is_valid());
uint32_t data_size = 0;
ASSERT_EQ(MOJO_RESULT_OK,
- ReadDataRaw(pipe.get(), nullptr, &data_size,
- MOJO_READ_DATA_FLAG_QUERY));
+ ReadDataRaw(
+ pipe.get(), nullptr, &data_size, MOJO_READ_DATA_FLAG_QUERY));
ASSERT_NE(0, static_cast<int>(data_size));
char data[64];
ASSERT_LT(static_cast<int>(data_size), 64);
- ASSERT_EQ(MOJO_RESULT_OK,
- ReadDataRaw(pipe.get(), data, &data_size,
- MOJO_READ_DATA_FLAG_ALL_OR_NONE));
+ ASSERT_EQ(
+ MOJO_RESULT_OK,
+ ReadDataRaw(
+ pipe.get(), data, &data_size, MOJO_READ_DATA_FLAG_ALL_OR_NONE));
client()->DidStuff2(data);
}
@@ -124,16 +123,13 @@
class SampleFactoryClientImpl : public sample::FactoryClient {
public:
- SampleFactoryClientImpl() : got_response_(false) {
- }
+ SampleFactoryClientImpl() : got_response_(false) {}
void set_expected_text_reply(const std::string& expected_text_reply) {
expected_text_reply_ = expected_text_reply;
}
- bool got_response() const {
- return got_response_;
- }
+ bool got_response() const { return got_response_; }
virtual void DidStuff(sample::ResponsePtr response,
const String& text_reply) override {
@@ -171,13 +167,9 @@
class HandlePassingTest : public testing::Test {
public:
- virtual void TearDown() {
- PumpMessages();
- }
+ virtual void TearDown() { PumpMessages(); }
- void PumpMessages() {
- loop_.RunUntilIdle();
- }
+ void PumpMessages() { loop_.RunUntilIdle(); }
private:
Environment env_;
@@ -247,11 +239,10 @@
// factory.
ScopedDataPipeProducerHandle producer_handle;
ScopedDataPipeConsumerHandle consumer_handle;
- MojoCreateDataPipeOptions options = {
- sizeof(MojoCreateDataPipeOptions),
- MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
- 1,
- 1024};
+ MojoCreateDataPipeOptions options = {sizeof(MojoCreateDataPipeOptions),
+ MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,
+ 1,
+ 1024};
ASSERT_EQ(MOJO_RESULT_OK,
CreateDataPipe(&options, &producer_handle, &consumer_handle));
std::string expected_text_reply = "got it";
@@ -259,8 +250,10 @@
// +1 for \0.
uint32_t data_size = static_cast<uint32_t>(expected_text_reply.size() + 1);
ASSERT_EQ(MOJO_RESULT_OK,
- WriteDataRaw(producer_handle.get(), expected_text_reply.c_str(),
- &data_size, MOJO_WRITE_DATA_FLAG_ALL_OR_NONE));
+ WriteDataRaw(producer_handle.get(),
+ expected_text_reply.c_str(),
+ &data_size,
+ MOJO_WRITE_DATA_FLAG_ALL_OR_NONE));
factory->DoStuff2(consumer_handle.Pass());
@@ -321,7 +314,7 @@
sample::NamedObjectPtr object1;
EXPECT_FALSE(object1);
- InterfaceRequest<sample::NamedObject> object1_request = Get(&object1);
+ InterfaceRequest<sample::NamedObject> object1_request = GetProxy(&object1);
EXPECT_TRUE(object1_request.is_pending());
factory->CreateNamedObject(object1_request.Pass());
EXPECT_FALSE(object1_request.is_pending()); // We've passed the request.
@@ -330,7 +323,7 @@
object1->SetName("object1");
sample::NamedObjectPtr object2;
- factory->CreateNamedObject(Get(&object2));
+ factory->CreateNamedObject(GetProxy(&object2));
object2->SetName("object2");
std::string name1;
diff --git a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
index ded6d47..058667f 100644
--- a/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
@@ -15,8 +15,7 @@
class ErrorObserver : public ErrorHandler {
public:
- ErrorObserver() : encountered_error_(false) {
- }
+ ErrorObserver() : encountered_error_(false) {}
bool encountered_error() const { return encountered_error_; }
@@ -30,10 +29,7 @@
public:
virtual ~MathCalculatorImpl() {}
- MathCalculatorImpl()
- : total_(0.0),
- got_connection_(false) {
- }
+ MathCalculatorImpl() : total_(0.0), got_connection_(false) {}
virtual void OnConnectionEstablished() override { got_connection_ = true; }
@@ -49,9 +45,7 @@
client()->Output(total_);
}
- bool got_connection() const {
- return got_connection_;
- }
+ bool got_connection() const { return got_connection_; }
private:
double total_;
@@ -61,8 +55,7 @@
class MathCalculatorUIImpl : public math::CalculatorUI {
public:
explicit MathCalculatorUIImpl(math::CalculatorPtr calculator)
- : calculator_(calculator.Pass()),
- output_(0.0) {
+ : calculator_(calculator.Pass()), output_(0.0) {
calculator_.set_client(this);
}
@@ -70,29 +63,17 @@
return calculator_.WaitForIncomingMethodCall();
}
- bool encountered_error() const {
- return calculator_.encountered_error();
- }
+ bool encountered_error() const { return calculator_.encountered_error(); }
- void Add(double value) {
- calculator_->Add(value);
- }
+ void Add(double value) { calculator_->Add(value); }
- void Subtract(double value) {
- calculator_->Add(-value);
- }
+ void Subtract(double value) { calculator_->Add(-value); }
- void Multiply(double value) {
- calculator_->Multiply(value);
- }
+ void Multiply(double value) { calculator_->Multiply(value); }
- void Divide(double value) {
- calculator_->Multiply(1.0 / value);
- }
+ void Divide(double value) { calculator_->Multiply(1.0 / value); }
- double GetOutput() const {
- return output_;
- }
+ double GetOutput() const { return output_; }
private:
// math::CalculatorUI implementation:
@@ -105,8 +86,7 @@
class SelfDestructingMathCalculatorUIImpl : public math::CalculatorUI {
public:
explicit SelfDestructingMathCalculatorUIImpl(math::CalculatorPtr calculator)
- : calculator_(calculator.Pass()),
- nesting_level_(0) {
+ : calculator_(calculator.Pass()), nesting_level_(0) {
++num_instances_;
calculator_.set_client(this);
}
@@ -119,9 +99,7 @@
static int num_instances() { return num_instances_; }
private:
- virtual ~SelfDestructingMathCalculatorUIImpl() {
- --num_instances_;
- }
+ virtual ~SelfDestructingMathCalculatorUIImpl() { --num_instances_; }
virtual void Output(double value) override {
if (--nesting_level_ > 0) {
@@ -150,9 +128,7 @@
virtual void OnConnectionEstablished() override { got_connection_ = true; }
- bool got_connection() const {
- return got_connection_;
- }
+ bool got_connection() const { return got_connection_; }
int max_call_depth() { return max_call_depth_; }
@@ -176,13 +152,9 @@
class InterfacePtrTest : public testing::Test {
public:
- virtual ~InterfacePtrTest() {
- loop_.RunUntilIdle();
- }
+ virtual ~InterfacePtrTest() { loop_.RunUntilIdle(); }
- void PumpMessages() {
- loop_.RunUntilIdle();
- }
+ void PumpMessages() { loop_.RunUntilIdle(); }
private:
Environment env_;
diff --git a/mojo/public/cpp/bindings/tests/request_response_unittest.cc b/mojo/public/cpp/bindings/tests/request_response_unittest.cc
index 3755e64..a5d562d 100644
--- a/mojo/public/cpp/bindings/tests/request_response_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/request_response_unittest.cc
@@ -44,49 +44,41 @@
class StringRecorder {
public:
- explicit StringRecorder(std::string* buf) : buf_(buf) {
- }
- void Run(const String& a) const {
- *buf_ = a;
- }
+ explicit StringRecorder(std::string* buf) : buf_(buf) {}
+ void Run(const String& a) const { *buf_ = a; }
void Run(const String& a, const String& b) const {
*buf_ = a.get() + b.get();
}
+
private:
std::string* buf_;
};
class EnumRecorder {
public:
- explicit EnumRecorder(sample::Enum* value) : value_(value) {
- }
- void Run(sample::Enum a) const {
- *value_ = a;
- }
+ explicit EnumRecorder(sample::Enum* value) : value_(value) {}
+ void Run(sample::Enum a) const { *value_ = a; }
+
private:
sample::Enum* value_;
};
class MessagePipeWriter {
public:
- explicit MessagePipeWriter(const char* text) : text_(text) {
- }
+ explicit MessagePipeWriter(const char* text) : text_(text) {}
void Run(ScopedMessagePipeHandle handle) const {
WriteTextMessage(handle.get(), text_);
}
+
private:
std::string text_;
};
class RequestResponseTest : public testing::Test {
public:
- virtual ~RequestResponseTest() {
- loop_.RunUntilIdle();
- }
+ virtual ~RequestResponseTest() { loop_.RunUntilIdle(); }
- void PumpMessages() {
- loop_.RunUntilIdle();
- }
+ void PumpMessages() { loop_.RunUntilIdle(); }
private:
Environment env_;
diff --git a/mojo/public/cpp/bindings/tests/router_unittest.cc b/mojo/public/cpp/bindings/tests/router_unittest.cc
index d74e525..287a96d 100644
--- a/mojo/public/cpp/bindings/tests/router_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/router_unittest.cc
@@ -24,8 +24,10 @@
builder.Finish(message);
}
-void AllocResponseMessage(uint32_t name, const char* text,
- uint64_t request_id, Message* message) {
+void AllocResponseMessage(uint32_t name,
+ const char* text,
+ uint64_t request_id,
+ Message* message) {
size_t payload_size = strlen(text) + 1; // Plus null terminator.
internal::ResponseMessageBuilder builder(name, payload_size, request_id);
memcpy(builder.buffer()->Allocate(payload_size), text, payload_size);
@@ -34,8 +36,7 @@
class MessageAccumulator : public MessageReceiver {
public:
- explicit MessageAccumulator(internal::MessageQueue* queue) : queue_(queue) {
- }
+ explicit MessageAccumulator(internal::MessageQueue* queue) : queue_(queue) {}
virtual bool Accept(Message* message) override {
queue_->Push(message);
@@ -48,8 +49,7 @@
class ResponseGenerator : public MessageReceiverWithResponder {
public:
- ResponseGenerator() {
- }
+ ResponseGenerator() {}
virtual bool Accept(Message* message) override { return false; }
@@ -60,7 +60,8 @@
return SendResponse(message->name(), message->request_id(), responder);
}
- bool SendResponse(uint32_t name, uint64_t request_id,
+ bool SendResponse(uint32_t name,
+ uint64_t request_id,
MessageReceiver* responder) {
Message response;
AllocResponseMessage(name, "world", request_id, &response);
@@ -73,12 +74,9 @@
class LazyResponseGenerator : public ResponseGenerator {
public:
- LazyResponseGenerator() : responder_(nullptr), name_(0), request_id_(0) {
- }
+ LazyResponseGenerator() : responder_(nullptr), name_(0), request_id_(0) {}
- virtual ~LazyResponseGenerator() {
- delete responder_;
- }
+ virtual ~LazyResponseGenerator() { delete responder_; }
virtual bool AcceptWithResponder(Message* message,
MessageReceiver* responder) override {
@@ -103,8 +101,7 @@
class RouterTest : public testing::Test {
public:
- RouterTest() {
- }
+ RouterTest() {}
virtual void SetUp() override {
CreateMessagePipe(nullptr, &handle0_, &handle1_);
@@ -112,9 +109,7 @@
virtual void TearDown() override {}
- void PumpMessages() {
- loop_.RunUntilIdle();
- }
+ void PumpMessages() { loop_.RunUntilIdle(); }
protected:
ScopedMessagePipeHandle handle0_;
@@ -216,7 +211,6 @@
PumpMessages();
EXPECT_TRUE(generator.has_responder());
-
}
generator.Complete(); // This should end up doing nothing.
diff --git a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
index 2385772..a8ea60d 100644
--- a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
@@ -74,7 +74,7 @@
output_streams[i] = producer.Pass();
}
- mojo::Array<mojo::Array<bool> > array_of_array_of_bools(2);
+ mojo::Array<mojo::Array<bool>> array_of_array_of_bools(2);
for (size_t i = 0; i < 2; ++i) {
mojo::Array<bool> array_of_bools(2);
for (size_t j = 0; j < 2; ++j)
@@ -175,7 +175,8 @@
}
template <typename H>
-void Print(int depth, const char* name,
+void Print(int depth,
+ const char* name,
const mojo::ScopedHandleBase<H>& value) {
PrintSpacer(depth);
std::cout << name << ": 0x" << std::hex << value.get().value() << std::endl;
@@ -238,8 +239,8 @@
void DumpHex(const uint8_t* bytes, uint32_t num_bytes) {
for (uint32_t i = 0; i < num_bytes; ++i) {
- std::cout << std::setw(2) << std::setfill('0') << std::hex <<
- uint32_t(bytes[i]);
+ std::cout << std::setw(2) << std::setfill('0') << std::hex
+ << uint32_t(bytes[i]);
if (i % 16 == 15) {
std::cout << std::endl;
@@ -280,8 +281,7 @@
class ServiceProxyImpl : public ServiceProxy {
public:
explicit ServiceProxyImpl(mojo::MessageReceiverWithResponder* receiver)
- : ServiceProxy(receiver) {
- }
+ : ServiceProxy(receiver) {}
};
class SimpleMessageReceiver : public mojo::MessageReceiverWithResponder {
diff --git a/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc b/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
index 8709460..b8eeaa6 100644
--- a/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/serialization_warning_unittest.cc
@@ -24,8 +24,8 @@
using mojo::internal::NoValidateParams;
// Creates an array of arrays of handles (2 X 3) for testing.
-Array<Array<ScopedHandle> > CreateTestNestedHandleArray() {
- Array<Array<ScopedHandle> > array(2);
+Array<Array<ScopedHandle>> CreateTestNestedHandleArray() {
+ Array<Array<ScopedHandle>> array(2);
for (size_t i = 0; i < array.size(); ++i) {
Array<ScopedHandle> nested_array(3);
for (size_t j = 0; j < nested_array.size(); ++j) {
@@ -158,25 +158,31 @@
}
TEST_F(SerializationWarningTest, ArrayOfArraysOfHandles) {
- Array<Array<ScopedHandle> > test_array = CreateTestNestedHandleArray();
+ Array<Array<ScopedHandle>> test_array = CreateTestNestedHandleArray();
test_array[0] = Array<ScopedHandle>();
test_array[1][0] = ScopedHandle();
- TestArrayWarning<ArrayValidateParams<0, true,
- ArrayValidateParams<0, true, NoValidateParams> > >(
+ TestArrayWarning<
+ ArrayValidateParams<0,
+ true,
+ ArrayValidateParams<0, true, NoValidateParams>>>(
test_array.Pass(), mojo::internal::VALIDATION_ERROR_NONE);
test_array = CreateTestNestedHandleArray();
test_array[0] = Array<ScopedHandle>();
- TestArrayWarning<ArrayValidateParams<0, false,
- ArrayValidateParams<0, true, NoValidateParams> > >(
+ TestArrayWarning<
+ ArrayValidateParams<0,
+ false,
+ ArrayValidateParams<0, true, NoValidateParams>>>(
test_array.Pass(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER);
test_array = CreateTestNestedHandleArray();
test_array[1][0] = ScopedHandle();
- TestArrayWarning<ArrayValidateParams<0, true,
- ArrayValidateParams<0, false, NoValidateParams> > >(
+ TestArrayWarning<
+ ArrayValidateParams<0,
+ true,
+ ArrayValidateParams<0, false, NoValidateParams>>>(
test_array.Pass(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE);
}
@@ -186,19 +192,25 @@
for (size_t i = 0; i < test_array.size(); ++i)
test_array[i] = "hello";
- TestArrayWarning<ArrayValidateParams<0, true,
- ArrayValidateParams<0, false, NoValidateParams> > >(
+ TestArrayWarning<
+ ArrayValidateParams<0,
+ true,
+ ArrayValidateParams<0, false, NoValidateParams>>>(
test_array.Pass(), mojo::internal::VALIDATION_ERROR_NONE);
test_array = Array<String>(3);
- TestArrayWarning<ArrayValidateParams<0, false,
- ArrayValidateParams<0, false, NoValidateParams> > >(
+ TestArrayWarning<
+ ArrayValidateParams<0,
+ false,
+ ArrayValidateParams<0, false, NoValidateParams>>>(
test_array.Pass(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_NULL_POINTER);
test_array = Array<String>(2);
- TestArrayWarning<ArrayValidateParams<3, true,
- ArrayValidateParams<0, false, NoValidateParams> > >(
+ TestArrayWarning<
+ ArrayValidateParams<3,
+ true,
+ ArrayValidateParams<0, false, NoValidateParams>>>(
test_array.Pass(),
mojo::internal::VALIDATION_ERROR_UNEXPECTED_ARRAY_HEADER);
}
diff --git a/mojo/public/cpp/bindings/tests/struct_unittest.cc b/mojo/public/cpp/bindings/tests/struct_unittest.cc
index 7d74498..c7e7599 100644
--- a/mojo/public/cpp/bindings/tests/struct_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/struct_unittest.cc
@@ -103,7 +103,7 @@
pair->second = MakeRect();
size_t size = GetSerializedSize_(pair);
- EXPECT_EQ(8U + 16U + 2*(8U + 16U), size);
+ EXPECT_EQ(8U + 16U + 2 * (8U + 16U), size);
mojo::internal::FixedBuffer buf(size);
internal::RectPair_Data* data;
@@ -125,15 +125,15 @@
region->rects[i] = MakeRect(static_cast<int32_t>(i) + 1);
size_t size = GetSerializedSize_(region);
- EXPECT_EQ(8U + // header
- 8U + // name pointer
- 8U + // rects pointer
- 8U + // name header
- 8U + // name payload (rounded up)
- 8U + // rects header
- 4*8U + // rects payload (four pointers)
- 4*(8U + // rect header
- 16U), // rect payload (four ints)
+ EXPECT_EQ(8U + // header
+ 8U + // name pointer
+ 8U + // rects pointer
+ 8U + // name header
+ 8U + // name payload (rounded up)
+ 8U + // rects header
+ 4 * 8U + // rects payload (four pointers)
+ 4 * (8U + // rect header
+ 16U), // rect payload (four ints)
size);
mojo::internal::FixedBuffer buf(size);
@@ -157,9 +157,9 @@
EXPECT_TRUE(region->rects.is_null());
size_t size = GetSerializedSize_(region);
- EXPECT_EQ(8U + // header
- 8U + // name pointer
- 8U, // rects pointer
+ EXPECT_EQ(8U + // header
+ 8U + // name pointer
+ 8U, // rects pointer
size);
mojo::internal::FixedBuffer buf(size);
diff --git a/mojo/public/cpp/bindings/tests/type_conversion_unittest.cc b/mojo/public/cpp/bindings/tests/type_conversion_unittest.cc
index 9500839..776ac14 100644
--- a/mojo/public/cpp/bindings/tests/type_conversion_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/type_conversion_unittest.cc
@@ -27,8 +27,7 @@
return false;
for (size_t i = 0; i < rects1.size(); ++i) {
- if (rects1[i]->x != rects2[i]->x ||
- rects1[i]->y != rects2[i]->y ||
+ if (rects1[i]->x != rects2[i]->x || rects1[i]->y != rects2[i]->y ||
rects1[i]->width != rects2[i]->width ||
rects1[i]->height != rects2[i]->height) {
return false;
@@ -79,7 +78,7 @@
static RedmondNamedRegion Convert(const test::NamedRegionPtr& input) {
RedmondNamedRegion region;
region.name = input->name;
- region.rects = input->rects.To<std::vector<RedmondRect> >();
+ region.rects = input->rects.To<std::vector<RedmondRect>>();
return region;
}
};
@@ -151,14 +150,13 @@
TEST(TypeConversionTest, CustomTypeConverter_Array_Null) {
Array<RectPtr> rects;
- std::vector<RedmondRect> redmond_rects =
- rects.To<std::vector<RedmondRect> >();
+ std::vector<RedmondRect> redmond_rects = rects.To<std::vector<RedmondRect>>();
EXPECT_TRUE(redmond_rects.empty());
}
TEST(TypeConversionTest, CustomTypeConverter_Array) {
- const RedmondRect kBase = { 10, 20, 30, 40 };
+ const RedmondRect kBase = {10, 20, 30, 40};
Array<RectPtr> rects(10);
for (size_t i = 0; i < rects.size(); ++i) {
@@ -168,8 +166,7 @@
rects[i] = Rect::From(rr);
}
- std::vector<RedmondRect> redmond_rects =
- rects.To<std::vector<RedmondRect> >();
+ std::vector<RedmondRect> redmond_rects = rects.To<std::vector<RedmondRect>>();
Array<RectPtr> rects2 = Array<RectPtr>::From(redmond_rects);
EXPECT_TRUE(AreEqualRectArrays(rects, rects2));
@@ -179,7 +176,7 @@
RedmondNamedRegion redmond_region;
redmond_region.name = "foopy";
- const RedmondRect kBase = { 10, 20, 30, 40 };
+ const RedmondRect kBase = {10, 20, 30, 40};
for (size_t i = 0; i < 10; ++i) {
RedmondRect rect = kBase;
diff --git a/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc b/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc
index f5b5a01..9d2607d 100644
--- a/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc
+++ b/mojo/public/cpp/bindings/tests/validation_test_input_parser.cc
@@ -35,7 +35,8 @@
typedef std::pair<const char*, const char*> Range;
typedef bool (ValidationTestInputParser::*ParseDataFunc)(
- const DataType& type, const std::string& value_string);
+ const DataType& type,
+ const std::string& value_string);
struct DataType {
const char* name;
@@ -117,36 +118,34 @@
};
#define DATA_TYPE(name, data_size, parse_data_func) \
- {name, sizeof(name) - 1, data_size, parse_data_func}
+ { name, sizeof(name) - 1, data_size, parse_data_func }
const ValidationTestInputParser::DataType
ValidationTestInputParser::kDataTypes[] = {
- DATA_TYPE("[u1]", 1, &ValidationTestInputParser::ParseUnsignedInteger),
- DATA_TYPE("[u2]", 2, &ValidationTestInputParser::ParseUnsignedInteger),
- DATA_TYPE("[u4]", 4, &ValidationTestInputParser::ParseUnsignedInteger),
- DATA_TYPE("[u8]", 8, &ValidationTestInputParser::ParseUnsignedInteger),
- DATA_TYPE("[s1]", 1, &ValidationTestInputParser::ParseSignedInteger),
- DATA_TYPE("[s2]", 2, &ValidationTestInputParser::ParseSignedInteger),
- DATA_TYPE("[s4]", 4, &ValidationTestInputParser::ParseSignedInteger),
- DATA_TYPE("[s8]", 8, &ValidationTestInputParser::ParseSignedInteger),
- DATA_TYPE("[b]", 1, &ValidationTestInputParser::ParseBinarySequence),
- DATA_TYPE("[f]", 4, &ValidationTestInputParser::ParseFloat),
- DATA_TYPE("[d]", 8, &ValidationTestInputParser::ParseDouble),
- DATA_TYPE("[dist4]", 4, &ValidationTestInputParser::ParseDistance),
- DATA_TYPE("[dist8]", 8, &ValidationTestInputParser::ParseDistance),
- DATA_TYPE("[anchr]", 0, &ValidationTestInputParser::ParseAnchor),
- DATA_TYPE("[handles]", 0, &ValidationTestInputParser::ParseHandles)
-};
+ DATA_TYPE("[u1]", 1, &ValidationTestInputParser::ParseUnsignedInteger),
+ DATA_TYPE("[u2]", 2, &ValidationTestInputParser::ParseUnsignedInteger),
+ DATA_TYPE("[u4]", 4, &ValidationTestInputParser::ParseUnsignedInteger),
+ DATA_TYPE("[u8]", 8, &ValidationTestInputParser::ParseUnsignedInteger),
+ DATA_TYPE("[s1]", 1, &ValidationTestInputParser::ParseSignedInteger),
+ DATA_TYPE("[s2]", 2, &ValidationTestInputParser::ParseSignedInteger),
+ DATA_TYPE("[s4]", 4, &ValidationTestInputParser::ParseSignedInteger),
+ DATA_TYPE("[s8]", 8, &ValidationTestInputParser::ParseSignedInteger),
+ DATA_TYPE("[b]", 1, &ValidationTestInputParser::ParseBinarySequence),
+ DATA_TYPE("[f]", 4, &ValidationTestInputParser::ParseFloat),
+ DATA_TYPE("[d]", 8, &ValidationTestInputParser::ParseDouble),
+ DATA_TYPE("[dist4]", 4, &ValidationTestInputParser::ParseDistance),
+ DATA_TYPE("[dist8]", 8, &ValidationTestInputParser::ParseDistance),
+ DATA_TYPE("[anchr]", 0, &ValidationTestInputParser::ParseAnchor),
+ DATA_TYPE("[handles]", 0, &ValidationTestInputParser::ParseHandles)};
const size_t ValidationTestInputParser::kDataTypeCount =
sizeof(ValidationTestInputParser::kDataTypes) /
sizeof(ValidationTestInputParser::kDataTypes[0]);
-ValidationTestInputParser::ValidationTestInputParser(
- const std::string& input,
- std::vector<uint8_t>* data,
- size_t* num_handles,
- std::string* error_message)
+ValidationTestInputParser::ValidationTestInputParser(const std::string& input,
+ std::vector<uint8_t>* data,
+ size_t* num_handles,
+ std::string* error_message)
: input_(input),
input_cursor_(0),
data_(data),
@@ -170,8 +169,8 @@
result = ParseItem(range);
if (!result) {
- *error_message_ = "Error occurred when parsing " +
- std::string(range.first, range.second);
+ *error_message_ =
+ "Error occurred when parsing " + std::string(range.first, range.second);
} else if (!pending_distance_items_.empty()) {
// We have parsed all the contents in |input_| successfully, but there are
// unmatched dist4/8 items.
@@ -201,16 +200,18 @@
if (input_cursor_ >= input_.size())
return false;
- if (StartsWith(Range(&input_[0] + input_cursor_,
- &input_[0] + input_.size()),
- "//", 2)) {
+ if (StartsWith(
+ Range(&input_[0] + input_cursor_, &input_[0] + input_.size()),
+ "//",
+ 2)) {
// Skip contents until the end of the line.
input_cursor_ = input_.find_first_of(kEndOfLineChars, input_cursor_);
} else {
range->first = &input_[0] + input_cursor_;
input_cursor_ = input_.find_first_of(kItemDelimiters, input_cursor_);
- range->second = input_cursor_ >= input_.size() ?
- &input_[0] + input_.size() : &input_[0] + input_cursor_;
+ range->second = input_cursor_ >= input_.size()
+ ? &input_[0] + input_.size()
+ : &input_[0] + input_cursor_;
return true;
}
}
@@ -232,7 +233,8 @@
}
bool ValidationTestInputParser::ParseUnsignedInteger(
- const DataType& type, const std::string& value_string) {
+ const DataType& type,
+ const std::string& value_string) {
unsigned long long int value;
if (!ConvertToUnsignedInteger(value_string, &value))
return false;
@@ -253,7 +255,8 @@
}
bool ValidationTestInputParser::ParseSignedInteger(
- const DataType& type, const std::string& value_string) {
+ const DataType& type,
+ const std::string& value_string) {
long long int value;
if (sscanf(value_string.c_str(), "%lli", &value) != 1)
return false;
@@ -273,9 +276,9 @@
}
}
-bool ValidationTestInputParser::ParseFloat(
- const DataType& type, const std::string& value_string) {
- MOJO_COMPILE_ASSERT(sizeof(float) == 4, float_size_is_not_4);
+bool ValidationTestInputParser::ParseFloat(const DataType& type,
+ const std::string& value_string) {
+ static_assert(sizeof(float) == 4, "sizeof(float) is not 4");
float value;
if (sscanf(value_string.c_str(), "%f", &value) != 1)
@@ -287,7 +290,7 @@
bool ValidationTestInputParser::ParseDouble(const DataType& type,
const std::string& value_string) {
- MOJO_COMPILE_ASSERT(sizeof(double) == 8, double_size_is_not_8);
+ static_assert(sizeof(double) == 8, "sizeof(double) is not 8");
double value;
if (sscanf(value_string.c_str(), "%lf", &value) != 1)
@@ -298,7 +301,8 @@
}
bool ValidationTestInputParser::ParseBinarySequence(
- const DataType& type, const std::string& value_string) {
+ const DataType& type,
+ const std::string& value_string) {
if (value_string.size() != 8)
return false;
diff --git a/mojo/public/cpp/bindings/tests/validation_unittest.cc b/mojo/public/cpp/bindings/tests/validation_unittest.cc
index bf0894c..e7f8cc2 100644
--- a/mojo/public/cpp/bindings/tests/validation_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/validation_unittest.cc
@@ -44,11 +44,11 @@
size_t num_handles;
std::string error_message;
- bool result = ParseValidationTestInput(input, &data, &num_handles,
- &error_message);
+ bool result =
+ ParseValidationTestInput(input, &data, &num_handles, &error_message);
if (expected_result) {
- if (result && error_message.empty() &&
- expected_data == data && expected_num_handles == num_handles) {
+ if (result && error_message.empty() && expected_data == data &&
+ expected_num_handles == num_handles) {
return true;
}
@@ -132,8 +132,8 @@
}
std::string GetPath(const std::string& root, const std::string& suffix) {
- return "mojo/public/interfaces/bindings/tests/data/validation/" +
- root + suffix;
+ return "mojo/public/interfaces/bindings/tests/data/validation/" + root +
+ suffix;
}
// |message| should be a newly created object.
@@ -187,8 +187,7 @@
class ValidationTest : public testing::Test {
public:
- virtual ~ValidationTest() {
- }
+ virtual ~ValidationTest() {}
private:
Environment env_;
@@ -196,11 +195,9 @@
class ValidationIntegrationTest : public ValidationTest {
public:
- ValidationIntegrationTest() : test_message_receiver_(nullptr) {
- }
+ ValidationIntegrationTest() : test_message_receiver_(nullptr) {}
- virtual ~ValidationIntegrationTest() {
- }
+ virtual ~ValidationIntegrationTest() {}
virtual void SetUp() override {
ScopedMessagePipeHandle tester_endpoint;
@@ -219,24 +216,17 @@
PumpMessages();
}
- MessageReceiver* test_message_receiver() {
- return test_message_receiver_;
- }
+ MessageReceiver* test_message_receiver() { return test_message_receiver_; }
- ScopedMessagePipeHandle testee_endpoint() {
- return testee_endpoint_.Pass();
- }
+ ScopedMessagePipeHandle testee_endpoint() { return testee_endpoint_.Pass(); }
private:
class TestMessageReceiver : public MessageReceiver {
public:
TestMessageReceiver(ValidationIntegrationTest* owner,
ScopedMessagePipeHandle handle)
- : owner_(owner),
- connector_(handle.Pass()) {
- }
- virtual ~TestMessageReceiver() {
- }
+ : owner_(owner), connector_(handle.Pass()) {}
+ virtual ~TestMessageReceiver() {}
virtual bool Accept(Message* message) override {
bool rv = connector_.Accept(message);
@@ -249,9 +239,7 @@
mojo::internal::Connector connector_;
};
- void PumpMessages() {
- loop_.RunUntilIdle();
- }
+ void PumpMessages() { loop_.RunUntilIdle(); }
RunLoop loop_;
TestMessageReceiver* test_message_receiver_;
@@ -260,8 +248,7 @@
class IntegrationTestInterface1Client : public IntegrationTestInterface1 {
public:
- virtual ~IntegrationTestInterface1Client() {
- }
+ virtual ~IntegrationTestInterface1Client() {}
virtual void Method0(BasicStructPtr param0) override {}
};
@@ -269,8 +256,7 @@
class IntegrationTestInterface1Impl
: public InterfaceImpl<IntegrationTestInterface1> {
public:
- virtual ~IntegrationTestInterface1Impl() {
- }
+ virtual ~IntegrationTestInterface1Impl() {}
virtual void Method0(BasicStructPtr param0) override {}
};
@@ -297,8 +283,9 @@
EXPECT_TRUE(TestInputParser(input, true, expected, 0));
}
{
- std::string input = "[u1]0x10// hello world !! \n\r \t [u2]65535 \n"
- "[u4]65536 [u8]0xFFFFFFFFFFFFFFFF 0 0Xff";
+ std::string input =
+ "[u1]0x10// hello world !! \n\r \t [u2]65535 \n"
+ "[u4]65536 [u8]0xFFFFFFFFFFFFFFFF 0 0Xff";
std::vector<uint8_t> expected;
Append(&expected, static_cast<uint8_t>(0x10));
Append(&expected, static_cast<uint16_t>(65535));
@@ -356,21 +343,19 @@
// Test some failure cases.
{
- const char* error_inputs[] = {
- "/ hello world",
- "[u1]x",
- "[u2]-1000",
- "[u1]0x100",
- "[s2]-0x8001",
- "[b]1",
- "[b]1111111k",
- "[dist4]unmatched",
- "[anchr]hello [dist8]hello",
- "[dist4]a [dist4]a [anchr]a",
- "[dist4]a [anchr]a [dist4]a [anchr]a",
- "0 [handles]50",
- nullptr
- };
+ const char* error_inputs[] = {"/ hello world",
+ "[u1]x",
+ "[u2]-1000",
+ "[u1]0x100",
+ "[s2]-0x8001",
+ "[b]1",
+ "[b]1111111k",
+ "[dist4]unmatched",
+ "[anchr]hello [dist8]hello",
+ "[dist4]a [dist4]a [anchr]a",
+ "[dist4]a [anchr]a [dist4]a [anchr]a",
+ "0 [handles]50",
+ nullptr};
for (size_t i = 0; error_inputs[i]; ++i) {
std::vector<uint8_t> expected;
diff --git a/mojo/public/cpp/environment/lib/default_async_waiter.cc b/mojo/public/cpp/environment/lib/default_async_waiter.cc
index b03623e..9211c0f 100644
--- a/mojo/public/cpp/environment/lib/default_async_waiter.cc
+++ b/mojo/public/cpp/environment/lib/default_async_waiter.cc
@@ -23,14 +23,9 @@
RunLoopHandlerImpl(const Handle& handle,
MojoAsyncWaitCallback callback,
void* closure)
- : handle_(handle),
- callback_(callback),
- closure_(closure) {
- }
+ : handle_(handle), callback_(callback), closure_(closure) {}
- virtual ~RunLoopHandlerImpl() {
- RunLoop::current()->RemoveHandler(handle_);
- }
+ virtual ~RunLoopHandlerImpl() { RunLoop::current()->RemoveHandler(handle_); }
// RunLoopHandler:
virtual void OnHandleReady(const Handle& handle) override {
@@ -83,10 +78,7 @@
namespace internal {
-const MojoAsyncWaiter kDefaultAsyncWaiter = {
- AsyncWait,
- CancelWait
-};
+const MojoAsyncWaiter kDefaultAsyncWaiter = {AsyncWait, CancelWait};
} // namespace internal
diff --git a/mojo/public/cpp/environment/lib/default_logger.cc b/mojo/public/cpp/environment/lib/default_logger.cc
index af4a628..05cafbd 100644
--- a/mojo/public/cpp/environment/lib/default_logger.cc
+++ b/mojo/public/cpp/environment/lib/default_logger.cc
@@ -18,12 +18,12 @@
MojoLogLevel g_minimum_log_level = MOJO_LOG_LEVEL_INFO;
const char* GetLogLevelString(MojoLogLevel log_level) {
- if (log_level <= MOJO_LOG_LEVEL_VERBOSE-3)
+ if (log_level <= MOJO_LOG_LEVEL_VERBOSE - 3)
return "VERBOSE4+";
switch (log_level) {
- case MOJO_LOG_LEVEL_VERBOSE-2:
+ case MOJO_LOG_LEVEL_VERBOSE - 2:
return "VERBOSE3";
- case MOJO_LOG_LEVEL_VERBOSE-1:
+ case MOJO_LOG_LEVEL_VERBOSE - 1:
return "VERBOSE2";
case MOJO_LOG_LEVEL_VERBOSE:
return "VERBOSE1";
@@ -60,11 +60,9 @@
namespace internal {
-const MojoLogger kDefaultLogger = {
- LogMessage,
- GetMinimumLogLevel,
- SetMinimumLogLevel
-};
+const MojoLogger kDefaultLogger = {LogMessage,
+ GetMinimumLogLevel,
+ SetMinimumLogLevel};
} // namespace internal
diff --git a/mojo/public/cpp/environment/lib/environment.cc b/mojo/public/cpp/environment/lib/environment.cc
index 5fde8f7..92f31ed 100644
--- a/mojo/public/cpp/environment/lib/environment.cc
+++ b/mojo/public/cpp/environment/lib/environment.cc
@@ -20,11 +20,11 @@
void Init(const MojoAsyncWaiter* default_async_waiter,
const MojoLogger* default_logger) {
- g_default_async_waiter =
- default_async_waiter ? default_async_waiter :
- &internal::kDefaultAsyncWaiter;
- g_default_logger = default_logger ? default_logger :
- &internal::kDefaultLogger;
+ g_default_async_waiter = default_async_waiter
+ ? default_async_waiter
+ : &internal::kDefaultAsyncWaiter;
+ g_default_logger =
+ default_logger ? default_logger : &internal::kDefaultLogger;
RunLoop::SetUp();
}
diff --git a/mojo/public/cpp/environment/logging.h b/mojo/public/cpp/environment/logging.h
index a3e2cef..00baf01 100644
--- a/mojo/public/cpp/environment/logging.h
+++ b/mojo/public/cpp/environment/logging.h
@@ -18,28 +18,26 @@
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/system/macros.h"
-#define MOJO_LOG_STREAM(level) \
- ::mojo::internal::LogMessage(__FILE__, __LINE__, \
- MOJO_LOG_LEVEL_ ## level).stream()
+#define MOJO_LOG_STREAM(level) \
+ ::mojo::internal::LogMessage(__FILE__, __LINE__, MOJO_LOG_LEVEL_##level) \
+ .stream()
#define MOJO_LAZY_LOG_STREAM(level, condition) \
- !(condition) ? \
- (void) 0 : \
- ::mojo::internal::VoidifyOstream() & MOJO_LOG_STREAM(level)
+ !(condition) ? (void)0 \
+ : ::mojo::internal::VoidifyOstream() & MOJO_LOG_STREAM(level)
#define MOJO_SHOULD_LOG(level) \
- (MOJO_LOG_LEVEL_ ## level >= \
- ::mojo::Environment::GetDefaultLogger()->GetMinimumLogLevel())
+ (MOJO_LOG_LEVEL_##level >= \
+ ::mojo::Environment::GetDefaultLogger()->GetMinimumLogLevel())
-#define MOJO_LOG(level) \
- MOJO_LAZY_LOG_STREAM(level, MOJO_SHOULD_LOG(level))
+#define MOJO_LOG(level) MOJO_LAZY_LOG_STREAM(level, MOJO_SHOULD_LOG(level))
#define MOJO_LOG_IF(level, condition) \
- MOJO_LAZY_LOG_STREAM(level, MOJO_SHOULD_LOG(level) && (condition))
+ MOJO_LAZY_LOG_STREAM(level, MOJO_SHOULD_LOG(level) && (condition))
-#define MOJO_CHECK(condition) \
- MOJO_LAZY_LOG_STREAM(FATAL, !(condition)) \
- << "Check failed: " #condition ". "
+#define MOJO_CHECK(condition) \
+ MOJO_LAZY_LOG_STREAM(FATAL, !(condition)) << "Check failed: " #condition "." \
+ " "
// Note: For non-debug builds, |MOJO_DLOG_IF()| *eliminates* (i.e., doesn't
// compile) the condition, whereas |MOJO_DCHECK()| "neuters" the condition
diff --git a/mojo/public/cpp/environment/tests/BUILD.gn b/mojo/public/cpp/environment/tests/BUILD.gn
index 55ded10..6fb56f8 100644
--- a/mojo/public/cpp/environment/tests/BUILD.gn
+++ b/mojo/public/cpp/environment/tests/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_environment_unittests
+# GYP version: mojo/mojo_base.gyp:mojo_public_environment_unittests
test("mojo_public_environment_unittests") {
sources = [
"async_waiter_unittest.cc",
@@ -11,7 +11,7 @@
]
deps = [
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/public/c/environment",
"//mojo/public/cpp/environment:standalone",
"//mojo/public/cpp/system",
diff --git a/mojo/public/cpp/environment/tests/async_waiter_unittest.cc b/mojo/public/cpp/environment/tests/async_waiter_unittest.cc
index 0992f89..52f1406 100644
--- a/mojo/public/cpp/environment/tests/async_waiter_unittest.cc
+++ b/mojo/public/cpp/environment/tests/async_waiter_unittest.cc
@@ -17,8 +17,7 @@
class TestAsyncWaitCallback {
public:
- TestAsyncWaitCallback() : result_count_(0), last_result_(MOJO_RESULT_OK) {
- }
+ TestAsyncWaitCallback() : result_count_(0), last_result_(MOJO_RESULT_OK) {}
virtual ~TestAsyncWaitCallback() {}
int result_count() const { return result_count_; }
@@ -71,9 +70,8 @@
MessagePipe test_pipe;
EXPECT_TRUE(test::WriteTextMessage(test_pipe.handle1.get(), std::string()));
- CallAsyncWait(test_pipe.handle0.get(),
- MOJO_HANDLE_SIGNAL_READABLE,
- &callback);
+ CallAsyncWait(
+ test_pipe.handle0.get(), MOJO_HANDLE_SIGNAL_READABLE, &callback);
RunLoop::current()->Run();
EXPECT_EQ(1, callback.result_count());
EXPECT_EQ(MOJO_RESULT_OK, callback.last_result());
@@ -88,12 +86,10 @@
EXPECT_TRUE(test::WriteTextMessage(test_pipe1.handle1.get(), std::string()));
EXPECT_TRUE(test::WriteTextMessage(test_pipe2.handle1.get(), std::string()));
- CallAsyncWait(test_pipe1.handle0.get(),
- MOJO_HANDLE_SIGNAL_READABLE,
- &callback1);
- CallAsyncWait(test_pipe2.handle0.get(),
- MOJO_HANDLE_SIGNAL_READABLE,
- &callback2);
+ CallAsyncWait(
+ test_pipe1.handle0.get(), MOJO_HANDLE_SIGNAL_READABLE, &callback1);
+ CallAsyncWait(
+ test_pipe2.handle0.get(), MOJO_HANDLE_SIGNAL_READABLE, &callback2);
RunLoop::current()->Run();
EXPECT_EQ(1, callback1.result_count());
@@ -108,10 +104,8 @@
MessagePipe test_pipe;
EXPECT_TRUE(test::WriteTextMessage(test_pipe.handle1.get(), std::string()));
- CallCancelWait(
- CallAsyncWait(test_pipe.handle0.get(),
- MOJO_HANDLE_SIGNAL_READABLE,
- &callback));
+ CallCancelWait(CallAsyncWait(
+ test_pipe.handle0.get(), MOJO_HANDLE_SIGNAL_READABLE, &callback));
RunLoop::current()->Run();
EXPECT_EQ(0, callback.result_count());
}
diff --git a/mojo/public/cpp/environment/tests/logger_unittest.cc b/mojo/public/cpp/environment/tests/logger_unittest.cc
index e30a84b..7aef2ee 100644
--- a/mojo/public/cpp/environment/tests/logger_unittest.cc
+++ b/mojo/public/cpp/environment/tests/logger_unittest.cc
@@ -13,24 +13,24 @@
Environment environment;
const MojoLogger* const logger = Environment::GetDefaultLogger();
- logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE-1, "Logged at VERBOSE-1 level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, "Logged at VERBOSE-1 level");
logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, "Logged at VERBOSE level");
logger->LogMessage(MOJO_LOG_LEVEL_INFO, "Logged at INFO level");
logger->LogMessage(MOJO_LOG_LEVEL_WARNING, "Logged at WARNING level");
logger->LogMessage(MOJO_LOG_LEVEL_ERROR, "Logged at ERROR level");
// This should kill us:
- EXPECT_DEATH_IF_SUPPORTED({
- logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level");
- }, "");
+ EXPECT_DEATH_IF_SUPPORTED(
+ { logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level"); },
+ "");
}
TEST(LoggerTest, LogLevels) {
Environment environment;
const MojoLogger* const logger = Environment::GetDefaultLogger();
- for (MojoLogLevel log_level = MOJO_LOG_LEVEL_VERBOSE-1;
- log_level <= MOJO_LOG_LEVEL_FATAL+1;
+ for (MojoLogLevel log_level = MOJO_LOG_LEVEL_VERBOSE - 1;
+ log_level <= MOJO_LOG_LEVEL_FATAL + 1;
log_level++) {
logger->SetMinimumLogLevel(log_level);
@@ -39,16 +39,16 @@
else
EXPECT_EQ(MOJO_LOG_LEVEL_FATAL, logger->GetMinimumLogLevel());
- logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE-1, "Logged at VERBOSE-1 level");
+ logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE - 1, "Logged at VERBOSE-1 level");
logger->LogMessage(MOJO_LOG_LEVEL_VERBOSE, "Logged at VERBOSE level");
logger->LogMessage(MOJO_LOG_LEVEL_INFO, "Logged at INFO level");
logger->LogMessage(MOJO_LOG_LEVEL_WARNING, "Logged at WARNING level");
logger->LogMessage(MOJO_LOG_LEVEL_ERROR, "Logged at ERROR level");
// This should kill us:
- EXPECT_DEATH_IF_SUPPORTED({
- logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level");
- }, "");
+ EXPECT_DEATH_IF_SUPPORTED(
+ { logger->LogMessage(MOJO_LOG_LEVEL_FATAL, "Logged at FATAL level"); },
+ "");
}
}
diff --git a/mojo/public/cpp/environment/tests/logging_unittest.cc b/mojo/public/cpp/environment/tests/logging_unittest.cc
index 45f527e..609def1 100644
--- a/mojo/public/cpp/environment/tests/logging_unittest.cc
+++ b/mojo/public/cpp/environment/tests/logging_unittest.cc
@@ -68,9 +68,7 @@
last_message_ = message;
}
- static MojoLogLevel MockGetMinimumLogLevel() {
- return minimum_log_level_;
- }
+ static MojoLogLevel MockGetMinimumLogLevel() { return minimum_log_level_; }
static void MockSetMinimumLogLevel(MojoLogLevel minimum_log_level) {
minimum_log_level_ = minimum_log_level;
@@ -90,10 +88,9 @@
// static
const MojoLogger LoggingTest::kMockLogger = {
- &LoggingTest::MockLogMessage,
- &LoggingTest::MockGetMinimumLogLevel,
- &LoggingTest::MockSetMinimumLogLevel
-};
+ &LoggingTest::MockLogMessage,
+ &LoggingTest::MockGetMinimumLogLevel,
+ &LoggingTest::MockSetMinimumLogLevel};
// static
MojoLogLevel LoggingTest::minimum_log_level_ = MOJO_LOG_LEVEL_INFO;
@@ -117,8 +114,8 @@
}
TEST_F(LoggingTest, InternalLogMessage) {
- internal::LogMessage("foo.cc", 123, MOJO_LOG_LEVEL_INFO).stream()
- << "hello " << "world";
+ internal::LogMessage("foo.cc", 123, MOJO_LOG_LEVEL_INFO).stream() << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
EXPECT_EQ(MOJO_LOG_LEVEL_INFO, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
@@ -126,7 +123,8 @@
ResetMockLogger();
internal::LogMessage("./path/to/foo.cc", 123, MOJO_LOG_LEVEL_WARNING).stream()
- << "hello " << "world";
+ << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
EXPECT_EQ(MOJO_LOG_LEVEL_WARNING, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
@@ -134,7 +132,8 @@
ResetMockLogger();
internal::LogMessage("/path/to/foo.cc", 123, MOJO_LOG_LEVEL_ERROR).stream()
- << "hello " << "world";
+ << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
EXPECT_EQ(MOJO_LOG_LEVEL_ERROR, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
@@ -142,7 +141,8 @@
ResetMockLogger();
internal::LogMessage("path/to/foo.cc", 123, MOJO_LOG_LEVEL_FATAL).stream()
- << "hello " << "world";
+ << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
EXPECT_EQ(MOJO_LOG_LEVEL_FATAL, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
@@ -150,31 +150,35 @@
ResetMockLogger();
internal::LogMessage(".\\xy\\foo.cc", 123, MOJO_LOG_LEVEL_VERBOSE).stream()
- << "hello " << "world";
+ << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
EXPECT_EQ(MOJO_LOG_LEVEL_VERBOSE, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
ResetMockLogger();
- internal::LogMessage("xy\\foo.cc", 123, MOJO_LOG_LEVEL_VERBOSE-1).stream()
- << "hello " << "world";
+ internal::LogMessage("xy\\foo.cc", 123, MOJO_LOG_LEVEL_VERBOSE - 1).stream()
+ << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
- EXPECT_EQ(MOJO_LOG_LEVEL_VERBOSE-1, last_log_level());
+ EXPECT_EQ(MOJO_LOG_LEVEL_VERBOSE - 1, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
ResetMockLogger();
- internal::LogMessage("C:\\xy\\foo.cc", 123, MOJO_LOG_LEVEL_VERBOSE-9).stream()
- << "hello " << "world";
+ internal::LogMessage("C:\\xy\\foo.cc", 123, MOJO_LOG_LEVEL_VERBOSE - 9)
+ .stream()
+ << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
- EXPECT_EQ(MOJO_LOG_LEVEL_VERBOSE-9, last_log_level());
+ EXPECT_EQ(MOJO_LOG_LEVEL_VERBOSE - 9, last_log_level());
EXPECT_EQ("foo.cc(123): hello world", last_message());
ResetMockLogger();
- internal::LogMessage(__FILE__, 123, MOJO_LOG_LEVEL_INFO).stream()
- << "hello " << "world";
+ internal::LogMessage(__FILE__, 123, MOJO_LOG_LEVEL_INFO).stream() << "hello "
+ << "world";
EXPECT_TRUE(log_message_was_called());
EXPECT_EQ(MOJO_LOG_LEVEL_INFO, last_log_level());
EXPECT_EQ(OUR_FILENAME "(123): hello world", last_message());
@@ -250,7 +254,8 @@
EXPECT_TRUE(MOJO_SHOULD_LOG(ERROR));
EXPECT_TRUE(MOJO_SHOULD_LOG(FATAL));
- Environment::GetDefaultLogger()->SetMinimumLogLevel(MOJO_LOG_LEVEL_VERBOSE-1);
+ Environment::GetDefaultLogger()->SetMinimumLogLevel(MOJO_LOG_LEVEL_VERBOSE -
+ 1);
EXPECT_TRUE(MOJO_SHOULD_LOG(VERBOSE));
EXPECT_TRUE(MOJO_SHOULD_LOG(INFO));
EXPECT_TRUE(MOJO_SHOULD_LOG(WARNING));
@@ -416,7 +421,7 @@
ResetMockLogger();
- // |MOJO_DLOG_IF()| shouldn't compile its condition for non-debug builds.
+// |MOJO_DLOG_IF()| shouldn't compile its condition for non-debug builds.
#ifndef NDEBUG
bool debug_only = true;
#endif
diff --git a/mojo/public/cpp/system/buffer.h b/mojo/public/cpp/system/buffer.h
index ad9966a..8b6a618 100644
--- a/mojo/public/cpp/system/buffer.h
+++ b/mojo/public/cpp/system/buffer.h
@@ -23,13 +23,12 @@
// Copying and assignment allowed.
};
-MOJO_COMPILE_ASSERT(sizeof(SharedBufferHandle) == sizeof(Handle),
- bad_size_for_cpp_SharedBufferHandle);
+static_assert(sizeof(SharedBufferHandle) == sizeof(Handle),
+ "Bad size for C++ SharedBufferHandle");
typedef ScopedHandleBase<SharedBufferHandle> ScopedSharedBufferHandle;
-MOJO_COMPILE_ASSERT(sizeof(ScopedSharedBufferHandle) ==
- sizeof(SharedBufferHandle),
- bad_size_for_cpp_ScopedSharedBufferHandle);
+static_assert(sizeof(ScopedSharedBufferHandle) == sizeof(SharedBufferHandle),
+ "Bad size for C++ ScopedSharedBufferHandle");
inline MojoResult CreateSharedBuffer(
const MojoCreateSharedBufferOptions* options,
@@ -37,8 +36,8 @@
ScopedSharedBufferHandle* shared_buffer) {
assert(shared_buffer);
SharedBufferHandle handle;
- MojoResult rv = MojoCreateSharedBuffer(options, num_bytes,
- handle.mutable_value());
+ MojoResult rv =
+ MojoCreateSharedBuffer(options, num_bytes, handle.mutable_value());
// Reset even on failure (reduces the chances that a "stale"/incorrect handle
// will be used).
shared_buffer->reset(handle);
diff --git a/mojo/public/cpp/system/data_pipe.h b/mojo/public/cpp/system/data_pipe.h
index b2f6e68..b645a0f 100644
--- a/mojo/public/cpp/system/data_pipe.h
+++ b/mojo/public/cpp/system/data_pipe.h
@@ -23,13 +23,13 @@
// Copying and assignment allowed.
};
-MOJO_COMPILE_ASSERT(sizeof(DataPipeProducerHandle) == sizeof(Handle),
- bad_size_for_cpp_DataPipeProducerHandle);
+static_assert(sizeof(DataPipeProducerHandle) == sizeof(Handle),
+ "Bad size for C++ DataPipeProducerHandle");
typedef ScopedHandleBase<DataPipeProducerHandle> ScopedDataPipeProducerHandle;
-MOJO_COMPILE_ASSERT(sizeof(ScopedDataPipeProducerHandle) ==
- sizeof(DataPipeProducerHandle),
- bad_size_for_cpp_ScopedDataPipeProducerHandle);
+static_assert(sizeof(ScopedDataPipeProducerHandle) ==
+ sizeof(DataPipeProducerHandle),
+ "Bad size for C++ ScopedDataPipeProducerHandle");
class DataPipeConsumerHandle : public Handle {
public:
@@ -39,13 +39,13 @@
// Copying and assignment allowed.
};
-MOJO_COMPILE_ASSERT(sizeof(DataPipeConsumerHandle) == sizeof(Handle),
- bad_size_for_cpp_DataPipeConsumerHandle);
+static_assert(sizeof(DataPipeConsumerHandle) == sizeof(Handle),
+ "Bad size for C++ DataPipeConsumerHandle");
typedef ScopedHandleBase<DataPipeConsumerHandle> ScopedDataPipeConsumerHandle;
-MOJO_COMPILE_ASSERT(sizeof(ScopedDataPipeConsumerHandle) ==
- sizeof(DataPipeConsumerHandle),
- bad_size_for_cpp_ScopedDataPipeConsumerHandle);
+static_assert(sizeof(ScopedDataPipeConsumerHandle) ==
+ sizeof(DataPipeConsumerHandle),
+ "Bad size for C++ ScopedDataPipeConsumerHandle");
inline MojoResult CreateDataPipe(
const MojoCreateDataPipeOptions* options,
@@ -55,7 +55,8 @@
assert(data_pipe_consumer);
DataPipeProducerHandle producer_handle;
DataPipeConsumerHandle consumer_handle;
- MojoResult rv = MojoCreateDataPipe(options, producer_handle.mutable_value(),
+ MojoResult rv = MojoCreateDataPipe(options,
+ producer_handle.mutable_value(),
consumer_handle.mutable_value());
// Reset even on failure (reduces the chances that a "stale"/incorrect handle
// will be used).
@@ -75,8 +76,8 @@
void** buffer,
uint32_t* buffer_num_bytes,
MojoWriteDataFlags flags) {
- return MojoBeginWriteData(data_pipe_producer.value(), buffer,
- buffer_num_bytes, flags);
+ return MojoBeginWriteData(
+ data_pipe_producer.value(), buffer, buffer_num_bytes, flags);
}
inline MojoResult EndWriteDataRaw(DataPipeProducerHandle data_pipe_producer,
@@ -95,8 +96,8 @@
const void** buffer,
uint32_t* buffer_num_bytes,
MojoReadDataFlags flags) {
- return MojoBeginReadData(data_pipe_consumer.value(), buffer, buffer_num_bytes,
- flags);
+ return MojoBeginReadData(
+ data_pipe_consumer.value(), buffer, buffer_num_bytes, flags);
}
inline MojoResult EndReadDataRaw(DataPipeConsumerHandle data_pipe_consumer,
diff --git a/mojo/public/cpp/system/handle.h b/mojo/public/cpp/system/handle.h
index 72b14c8..f84c559 100644
--- a/mojo/public/cpp/system/handle.h
+++ b/mojo/public/cpp/system/handle.h
@@ -93,8 +93,7 @@
template <class CompatibleHandleType>
explicit ScopedHandleBase(ScopedHandleBase<CompatibleHandleType> other)
- : handle_(other.release()) {
- }
+ : handle_(other.release()) {}
// Move-only constructor and operator=.
ScopedHandleBase(RValue other) : handle_(other.object->release()) {}
@@ -111,16 +110,14 @@
template <typename PassedHandleType>
static ScopedHandleBase<HandleType> From(
ScopedHandleBase<PassedHandleType> other) {
- MOJO_COMPILE_ASSERT(
+ static_assert(
sizeof(static_cast<PassedHandleType*>(static_cast<HandleType*>(0))),
- HandleType_is_not_a_subtype_of_PassedHandleType);
+ "HandleType is not a subtype of PassedHandleType");
return ScopedHandleBase<HandleType>(
static_cast<HandleType>(other.release().value()));
}
- void swap(ScopedHandleBase& other) {
- handle_.swap(other.handle_);
- }
+ void swap(ScopedHandleBase& other) { handle_.swap(other.handle_); }
HandleType release() MOJO_WARN_UNUSED_RESULT {
HandleType rv;
@@ -133,9 +130,7 @@
handle_ = handle;
}
- bool is_valid() const {
- return handle_.is_valid();
- }
+ bool is_valid() const { return handle_.is_valid(); }
private:
void CloseIfNecessary() {
@@ -170,9 +165,7 @@
other.value_ = temp;
}
- bool is_valid() const {
- return value_ != kInvalidHandleValue;
- }
+ bool is_valid() const { return value_ != kInvalidHandleValue; }
const MojoHandle& value() const { return value_; }
MojoHandle* mutable_value() { return &value_; }
@@ -185,13 +178,12 @@
};
// Should have zero overhead.
-MOJO_COMPILE_ASSERT(sizeof(Handle) == sizeof(MojoHandle),
- bad_size_for_cpp_Handle);
+static_assert(sizeof(Handle) == sizeof(MojoHandle), "Bad size for C++ Handle");
// The scoper should also impose no more overhead.
typedef ScopedHandleBase<Handle> ScopedHandle;
-MOJO_COMPILE_ASSERT(sizeof(ScopedHandle) == sizeof(Handle),
- bad_size_for_cpp_ScopedHandle);
+static_assert(sizeof(ScopedHandle) == sizeof(Handle),
+ "Bad size for C++ ScopedHandle");
inline MojoResult Wait(Handle handle,
MojoHandleSignals signals,
@@ -229,7 +221,8 @@
// Note: There's nothing to do, since the argument will be destroyed when it
// goes out of scope.
template <class HandleType>
-inline void Close(ScopedHandleBase<HandleType> /*handle*/) {}
+inline void Close(ScopedHandleBase<HandleType> /*handle*/) {
+}
// Most users should typically use |Close()| (above) instead.
inline MojoResult CloseRaw(Handle handle) {
diff --git a/mojo/public/cpp/system/macros.h b/mojo/public/cpp/system/macros.h
index 605906e..564b6be 100644
--- a/mojo/public/cpp/system/macros.h
+++ b/mojo/public/cpp/system/macros.h
@@ -14,35 +14,36 @@
// A macro to disallow the copy constructor and operator= functions.
// This should be used in the private: declarations for a class.
#define MOJO_DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
// Used to calculate the number of elements in an array.
// (See |arraysize()| in Chromium's base/basictypes.h for more details.)
namespace mojo {
template <typename T, size_t N>
-char (&ArraySizeHelper(T (&array)[N]))[N];
+char(&ArraySizeHelper(T(&array)[N]))[N];
#if !defined(_MSC_VER)
template <typename T, size_t N>
-char (&ArraySizeHelper(const T (&array)[N]))[N];
+char(&ArraySizeHelper(const T(&array)[N]))[N];
#endif
} // namespace mojo
#define MOJO_ARRAYSIZE(array) (sizeof(::mojo::ArraySizeHelper(array)))
// Used to make a type move-only in C++03. See Chromium's base/move.h for more
// details.
-#define MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
- private: \
- struct rvalue_type { \
- explicit rvalue_type(type* object) : object(object) {} \
- type* object; \
- }; \
- type(type&); \
- void operator=(type&); \
- public: \
- operator rvalue_type() { return rvalue_type(this); } \
- type Pass() { return type(rvalue_type(this)); } \
- typedef void MoveOnlyTypeForCPP03; \
- private:
-
+#define MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \
+ private: \
+ struct rvalue_type { \
+ explicit rvalue_type(type* object) : object(object) {} \
+ type* object; \
+ }; \
+ type(type&); \
+ void operator=(type&); \
+ \
+ public: \
+ operator rvalue_type() { return rvalue_type(this); } \
+ type Pass() { return type(rvalue_type(this)); } \
+ typedef void MoveOnlyTypeForCPP03; \
+ \
+ private:
#endif // MOJO_PUBLIC_CPP_SYSTEM_MACROS_H_
diff --git a/mojo/public/cpp/system/message_pipe.h b/mojo/public/cpp/system/message_pipe.h
index 7ef6314..d960189 100644
--- a/mojo/public/cpp/system/message_pipe.h
+++ b/mojo/public/cpp/system/message_pipe.h
@@ -23,13 +23,12 @@
// Copying and assignment allowed.
};
-MOJO_COMPILE_ASSERT(sizeof(MessagePipeHandle) == sizeof(Handle),
- bad_size_for_cpp_MessagePipeHandle);
+static_assert(sizeof(MessagePipeHandle) == sizeof(Handle),
+ "Bad size for C++ MessagePipeHandle");
typedef ScopedHandleBase<MessagePipeHandle> ScopedMessagePipeHandle;
-MOJO_COMPILE_ASSERT(sizeof(ScopedMessagePipeHandle) ==
- sizeof(MessagePipeHandle),
- bad_size_for_cpp_ScopedMessagePipeHandle);
+static_assert(sizeof(ScopedMessagePipeHandle) == sizeof(MessagePipeHandle),
+ "Bad size for C++ ScopedMessagePipeHandle");
inline MojoResult CreateMessagePipe(const MojoCreateMessagePipeOptions* options,
ScopedMessagePipeHandle* message_pipe0,
@@ -38,9 +37,8 @@
assert(message_pipe1);
MessagePipeHandle handle0;
MessagePipeHandle handle1;
- MojoResult rv = MojoCreateMessagePipe(options,
- handle0.mutable_value(),
- handle1.mutable_value());
+ MojoResult rv = MojoCreateMessagePipe(
+ options, handle0.mutable_value(), handle1.mutable_value());
// Reset even on failure (reduces the chances that a "stale"/incorrect handle
// will be used).
message_pipe0->reset(handle0);
@@ -57,8 +55,8 @@
const MojoHandle* handles,
uint32_t num_handles,
MojoWriteMessageFlags flags) {
- return MojoWriteMessage(message_pipe.value(), bytes, num_bytes, handles,
- num_handles, flags);
+ return MojoWriteMessage(
+ message_pipe.value(), bytes, num_bytes, handles, num_handles, flags);
}
inline MojoResult ReadMessageRaw(MessagePipeHandle message_pipe,
@@ -67,8 +65,8 @@
MojoHandle* handles,
uint32_t* num_handles,
MojoReadMessageFlags flags) {
- return MojoReadMessage(message_pipe.value(), bytes, num_bytes, handles,
- num_handles, flags);
+ return MojoReadMessage(
+ message_pipe.value(), bytes, num_bytes, handles, num_handles, flags);
}
// A wrapper class that automatically creates a message pipe and owns both
diff --git a/mojo/public/cpp/system/tests/BUILD.gn b/mojo/public/cpp/system/tests/BUILD.gn
index 3226662..a0270c2 100644
--- a/mojo/public/cpp/system/tests/BUILD.gn
+++ b/mojo/public/cpp/system/tests/BUILD.gn
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_system_unittests
+# GYP version: mojo/mojo_base.gyp:mojo_public_system_unittests
test("mojo_public_system_unittests") {
deps = [
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/public/c/system/tests",
"//mojo/public/cpp/system",
"//mojo/public/cpp/test_support:test_utils",
diff --git a/mojo/public/cpp/system/tests/core_unittest.cc b/mojo/public/cpp/system/tests/core_unittest.cc
index a44bc07..90650e7 100644
--- a/mojo/public/cpp/system/tests/core_unittest.cc
+++ b/mojo/public/cpp/system/tests/core_unittest.cc
@@ -80,7 +80,7 @@
EXPECT_FALSE(handle_to_int.find(h3) == handle_to_int.end());
EXPECT_EQ(3, handle_to_int[h3]);
EXPECT_TRUE(handle_to_int.find(Handle(static_cast<MojoHandle>(13579))) ==
- handle_to_int.end());
+ handle_to_int.end());
// TODO(vtl): With C++11, support |std::unordered_map|s, etc. (Or figure out
// how to support the variations of |hash_map|.)
@@ -122,27 +122,32 @@
{
MessagePipeHandle h_invalid;
EXPECT_FALSE(h_invalid.is_valid());
+ EXPECT_EQ(
+ MOJO_RESULT_INVALID_ARGUMENT,
+ WriteMessageRaw(
+ h_invalid, nullptr, 0, nullptr, 0, MOJO_WRITE_MESSAGE_FLAG_NONE));
+ char buffer[10] = {0};
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
WriteMessageRaw(h_invalid,
- nullptr, 0,
- nullptr, 0,
- MOJO_WRITE_MESSAGE_FLAG_NONE));
- char buffer[10] = { 0 };
- EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
- WriteMessageRaw(h_invalid,
- buffer, sizeof(buffer),
- nullptr, 0,
+ buffer,
+ sizeof(buffer),
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
ReadMessageRaw(h_invalid,
- nullptr, nullptr,
- nullptr, nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_NONE));
uint32_t buffer_size = static_cast<uint32_t>(sizeof(buffer));
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
ReadMessageRaw(h_invalid,
- buffer, &buffer_size,
- nullptr, nullptr,
+ buffer,
+ &buffer_size,
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_NONE));
// Basic tests of waiting and closing.
@@ -177,13 +182,14 @@
EXPECT_FALSE(h1.get().is_valid());
// Make sure |h1| is closed.
- EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT,
- MojoWait(hv1, ~MOJO_HANDLE_SIGNAL_NONE,
- MOJO_DEADLINE_INDEFINITE));
+ EXPECT_EQ(
+ MOJO_RESULT_INVALID_ARGUMENT,
+ MojoWait(hv1, ~MOJO_HANDLE_SIGNAL_NONE, MOJO_DEADLINE_INDEFINITE));
- EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
- Wait(h0.get(), MOJO_HANDLE_SIGNAL_READABLE,
- MOJO_DEADLINE_INDEFINITE));
+ EXPECT_EQ(
+ MOJO_RESULT_FAILED_PRECONDITION,
+ Wait(
+ h0.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE));
}
// |hv0| should have been closed when |h0| went out of scope, so this close
// should fail.
@@ -199,18 +205,23 @@
const uint32_t kHelloSize = static_cast<uint32_t>(sizeof(kHello));
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h0.get(),
- kHello, kHelloSize,
- nullptr, 0,
+ kHello,
+ kHelloSize,
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
- EXPECT_EQ(MOJO_RESULT_OK,
- Wait(h1.get(), MOJO_HANDLE_SIGNAL_READABLE,
- MOJO_DEADLINE_INDEFINITE));
- char buffer[10] = { 0 };
+ EXPECT_EQ(
+ MOJO_RESULT_OK,
+ Wait(
+ h1.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE));
+ char buffer[10] = {0};
uint32_t buffer_size = static_cast<uint32_t>(sizeof(buffer));
EXPECT_EQ(MOJO_RESULT_OK,
ReadMessageRaw(h1.get(),
- buffer, &buffer_size,
- nullptr, nullptr,
+ buffer,
+ &buffer_size,
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_NONE));
EXPECT_EQ(kHelloSize, buffer_size);
EXPECT_STREQ(kHello, buffer);
@@ -225,8 +236,10 @@
const uint32_t kWorldSize = static_cast<uint32_t>(sizeof(kWorld));
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(mp.handle0.get(),
- kWorld, kWorldSize,
- nullptr, 0,
+ kWorld,
+ kWorldSize,
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// Send |mp.handle1| over |h1| to |h0|.
@@ -237,16 +250,19 @@
uint32_t handles_count = 1;
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h1.get(),
- kHello, kHelloSize,
- handles, handles_count,
+ kHello,
+ kHelloSize,
+ handles,
+ handles_count,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// |handles[0]| should actually be invalid now.
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(handles[0]));
// Read "hello" and the sent handle.
- EXPECT_EQ(MOJO_RESULT_OK,
- Wait(h0.get(), MOJO_HANDLE_SIGNAL_READABLE,
- MOJO_DEADLINE_INDEFINITE));
+ EXPECT_EQ(
+ MOJO_RESULT_OK,
+ Wait(
+ h0.get(), MOJO_HANDLE_SIGNAL_READABLE, MOJO_DEADLINE_INDEFINITE));
memset(buffer, 0, sizeof(buffer));
buffer_size = static_cast<uint32_t>(sizeof(buffer));
for (size_t i = 0; i < MOJO_ARRAYSIZE(handles); i++)
@@ -254,8 +270,10 @@
handles_count = static_cast<uint32_t>(MOJO_ARRAYSIZE(handles));
EXPECT_EQ(MOJO_RESULT_OK,
ReadMessageRaw(h0.get(),
- buffer, &buffer_size,
- handles, &handles_count,
+ buffer,
+ &buffer_size,
+ handles,
+ &handles_count,
MOJO_READ_MESSAGE_FLAG_NONE));
EXPECT_EQ(kHelloSize, buffer_size);
EXPECT_STREQ(kHello, buffer);
@@ -267,7 +285,8 @@
// Save |handles[0]| to check that it gets properly closed.
hv0 = handles[0];
EXPECT_EQ(MOJO_RESULT_OK,
- Wait(mp.handle1.get(), MOJO_HANDLE_SIGNAL_READABLE,
+ Wait(mp.handle1.get(),
+ MOJO_HANDLE_SIGNAL_READABLE,
MOJO_DEADLINE_INDEFINITE));
memset(buffer, 0, sizeof(buffer));
buffer_size = static_cast<uint32_t>(sizeof(buffer));
@@ -276,8 +295,10 @@
handles_count = static_cast<uint32_t>(MOJO_ARRAYSIZE(handles));
EXPECT_EQ(MOJO_RESULT_OK,
ReadMessageRaw(mp.handle1.get(),
- buffer, &buffer_size,
- handles, &handles_count,
+ buffer,
+ &buffer_size,
+ handles,
+ &handles_count,
MOJO_READ_MESSAGE_FLAG_NONE));
EXPECT_EQ(kWorldSize, buffer_size);
EXPECT_STREQ(kWorld, buffer);
@@ -308,14 +329,18 @@
const uint32_t kWorldSize = static_cast<uint32_t>(sizeof(kWorld));
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h2.get(),
- kWorld, kWorldSize,
- nullptr, 0,
+ kWorld,
+ kWorldSize,
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// And also a message to |h3|.
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h3.get(),
- kWorld, kWorldSize,
- nullptr, 0,
+ kWorld,
+ kWorldSize,
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// Send |h3| over |h1| to |h0|.
@@ -327,8 +352,10 @@
EXPECT_FALSE(h3.get().is_valid());
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h1.get(),
- kHello, kHelloSize,
- &h3_value, 1,
+ kHello,
+ kHelloSize,
+ &h3_value,
+ 1,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// |h3_value| should actually be invalid now.
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(h3_value));
@@ -355,14 +382,18 @@
const uint32_t kWorldSize = static_cast<uint32_t>(sizeof(kWorld));
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h2.get(),
- kWorld, kWorldSize,
- nullptr, 0,
+ kWorld,
+ kWorldSize,
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// And also a message to |h3|.
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h3.get(),
- kWorld, kWorldSize,
- nullptr, 0,
+ kWorld,
+ kWorldSize,
+ nullptr,
+ 0,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// Send |h3| over |h1| to |h0|.
@@ -374,8 +405,10 @@
EXPECT_FALSE(h3.get().is_valid());
EXPECT_EQ(MOJO_RESULT_OK,
WriteMessageRaw(h1.get(),
- kHello, kHelloSize,
- &h3_value, 1,
+ kHello,
+ kHelloSize,
+ &h3_value,
+ 1,
MOJO_WRITE_MESSAGE_FLAG_NONE));
// |h3_value| should actually be invalid now.
EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, MojoClose(h3_value));
diff --git a/mojo/public/cpp/system/tests/macros_unittest.cc b/mojo/public/cpp/system/tests/macros_unittest.cc
index 49a8005..bca8af7 100644
--- a/mojo/public/cpp/system/tests/macros_unittest.cc
+++ b/mojo/public/cpp/system/tests/macros_unittest.cc
@@ -60,13 +60,13 @@
y.NoOp();
}
-// Test that |MOJO_ARRAYSIZE()| works in a |MOJO_COMPILE_ASSERT()|.
-const int kGlobalArray[5] = { 1, 2, 3, 4, 5 };
-MOJO_COMPILE_ASSERT(MOJO_ARRAYSIZE(kGlobalArray) == 5u,
- mojo_array_size_failed_in_compile_assert);
+// Test that |MOJO_ARRAYSIZE()| works in a |static_assert()|.
+const int kGlobalArray[5] = {1, 2, 3, 4, 5};
+static_assert(MOJO_ARRAYSIZE(kGlobalArray) == 5u,
+ "MOJO_ARRAY_SIZE() failed in static_assert()");
TEST(MacrosCppTest, ArraySize) {
- double local_array[4] = { 6.7, 7.8, 8.9, 9.0 };
+ double local_array[4] = {6.7, 7.8, 8.9, 9.0};
EXPECT_EQ(4u, MOJO_ARRAYSIZE(local_array));
}
diff --git a/mojo/public/cpp/test_support/BUILD.gn b/mojo/public/cpp/test_support/BUILD.gn
index 6c73c29..ad0280b 100644
--- a/mojo/public/cpp/test_support/BUILD.gn
+++ b/mojo/public/cpp/test_support/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_test_utils
+# GYP version: mojo/public/mojo_public.gyp:mojo_public_test_utils
source_set("test_utils") {
testonly = true
deps = [
diff --git a/mojo/public/cpp/test_support/lib/test_utils.cc b/mojo/public/cpp/test_support/lib/test_utils.cc
index 8491c4b..d489cf7 100644
--- a/mojo/public/cpp/test_support/lib/test_utils.cc
+++ b/mojo/public/cpp/test_support/lib/test_utils.cc
@@ -59,7 +59,11 @@
}
bool DiscardMessage(const MessagePipeHandle& handle) {
- MojoResult rv = ReadMessageRaw(handle, nullptr, nullptr, nullptr, nullptr,
+ MojoResult rv = ReadMessageRaw(handle,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr,
MOJO_READ_MESSAGE_FLAG_MAY_DISCARD);
return rv == MOJO_RESULT_OK;
}
diff --git a/mojo/public/cpp/utility/lib/run_loop.cc b/mojo/public/cpp/utility/lib/run_loop.cc
index bcbc623..5e01a63 100644
--- a/mojo/public/cpp/utility/lib/run_loop.cc
+++ b/mojo/public/cpp/utility/lib/run_loop.cc
@@ -76,9 +76,10 @@
HandlerData handler_data;
handler_data.handler = handler;
handler_data.handle_signals = handle_signals;
- handler_data.deadline = (deadline == MOJO_DEADLINE_INDEFINITE) ?
- kInvalidTimeTicks :
- GetTimeTicksNow() + static_cast<MojoTimeTicks>(deadline);
+ handler_data.deadline =
+ (deadline == MOJO_DEADLINE_INDEFINITE)
+ ? kInvalidTimeTicks
+ : GetTimeTicksNow() + static_cast<MojoTimeTicks>(deadline);
handler_data.id = next_handler_id_++;
handler_data_[handle] = handler_data;
}
@@ -148,9 +149,8 @@
return false;
}
- const MojoResult result = WaitMany(wait_state.handles,
- wait_state.handle_signals,
- wait_state.deadline);
+ const MojoResult result = WaitMany(
+ wait_state.handles, wait_state.handle_signals, wait_state.deadline);
if (result >= 0) {
const size_t index = static_cast<size_t>(result);
assert(handler_data_.find(wait_state.handles[index]) !=
@@ -180,10 +180,11 @@
const HandleToHandlerData cloned_handlers(handler_data_);
const MojoTimeTicks now(GetTimeTicksNow());
for (HandleToHandlerData::const_iterator i = cloned_handlers.begin();
- i != cloned_handlers.end(); ++i) {
+ i != cloned_handlers.end();
+ ++i) {
// Only check deadline exceeded if that's what we're notifying.
- if (check == CHECK_DEADLINE && (i->second.deadline == kInvalidTimeTicks ||
- i->second.deadline > now)) {
+ if (check == CHECK_DEADLINE &&
+ (i->second.deadline == kInvalidTimeTicks || i->second.deadline > now)) {
continue;
}
@@ -205,16 +206,15 @@
bool RunLoop::RemoveFirstInvalidHandle(const WaitState& wait_state) {
for (size_t i = 0; i < wait_state.handles.size(); ++i) {
- const MojoResult result =
- mojo::Wait(wait_state.handles[i], wait_state.handle_signals[i],
- static_cast<MojoDeadline>(0));
+ const MojoResult result = mojo::Wait(wait_state.handles[i],
+ wait_state.handle_signals[i],
+ static_cast<MojoDeadline>(0));
if (result == MOJO_RESULT_INVALID_ARGUMENT ||
result == MOJO_RESULT_FAILED_PRECONDITION) {
// Remove the handle first, this way if OnHandleError() tries to remove
// the handle our iterator isn't invalidated.
assert(handler_data_.find(wait_state.handles[i]) != handler_data_.end());
- RunLoopHandler* handler =
- handler_data_[wait_state.handles[i]].handler;
+ RunLoopHandler* handler = handler_data_[wait_state.handles[i]].handler;
handler_data_.erase(wait_state.handles[i]);
handler->OnHandleError(wait_state.handles[i], result);
return true;
@@ -228,7 +228,8 @@
WaitState wait_state;
MojoTimeTicks min_time = kInvalidTimeTicks;
for (HandleToHandlerData::const_iterator i = handler_data_.begin();
- i != handler_data_.end(); ++i) {
+ i != handler_data_.end();
+ ++i) {
wait_state.handles.push_back(i->first);
wait_state.handle_signals.push_back(i->second.handle_signals);
if (!non_blocking && i->second.deadline != kInvalidTimeTicks &&
diff --git a/mojo/public/cpp/utility/lib/thread.cc b/mojo/public/cpp/utility/lib/thread.cc
index da33497..ab772d7 100644
--- a/mojo/public/cpp/utility/lib/thread.cc
+++ b/mojo/public/cpp/utility/lib/thread.cc
@@ -8,18 +8,11 @@
namespace mojo {
-Thread::Thread()
- : options_(),
- thread_(),
- started_(false),
- joined_(false) {
+Thread::Thread() : options_(), thread_(), started_(false), joined_(false) {
}
Thread::Thread(const Options& options)
- : options_(options),
- thread_(),
- started_(false),
- joined_(false) {
+ : options_(options), thread_(), started_(false), joined_(false) {
}
Thread::~Thread() {
diff --git a/mojo/public/cpp/utility/lib/thread_local.h b/mojo/public/cpp/utility/lib/thread_local.h
index 4c3625d..f5461ee 100644
--- a/mojo/public/cpp/utility/lib/thread_local.h
+++ b/mojo/public/cpp/utility/lib/thread_local.h
@@ -32,24 +32,17 @@
template <typename P>
class ThreadLocalPointer {
public:
- ThreadLocalPointer() : slot_() {
- }
+ ThreadLocalPointer() : slot_() {}
- void Allocate() {
- ThreadLocalPlatform::AllocateSlot(&slot_);
- }
+ void Allocate() { ThreadLocalPlatform::AllocateSlot(&slot_); }
- void Free() {
- ThreadLocalPlatform::FreeSlot(slot_);
- }
+ void Free() { ThreadLocalPlatform::FreeSlot(slot_); }
P* Get() {
return static_cast<P*>(ThreadLocalPlatform::GetValueFromSlot(slot_));
}
- void Set(P* value) {
- ThreadLocalPlatform::SetValueInSlot(slot_, value);
- }
+ void Set(P* value) { ThreadLocalPlatform::SetValueInSlot(slot_, value); }
private:
ThreadLocalPlatform::SlotType slot_;
diff --git a/mojo/public/cpp/utility/mutex.h b/mojo/public/cpp/utility/mutex.h
index 35611c2..4dc4aee 100644
--- a/mojo/public/cpp/utility/mutex.h
+++ b/mojo/public/cpp/utility/mutex.h
@@ -63,7 +63,7 @@
};
// Catch bug where variable name is omitted (e.g., |MutexLock (&mu)|).
-#define MutexLock(x) MOJO_COMPILE_ASSERT(0, mutex_lock_missing_variable_name);
+#define MutexLock(x) static_assert(0, "MutexLock() missing variable name");
} // namespace mojo
diff --git a/mojo/public/cpp/utility/run_loop.h b/mojo/public/cpp/utility/run_loop.h
index 359208d..cb324aa 100644
--- a/mojo/public/cpp/utility/run_loop.h
+++ b/mojo/public/cpp/utility/run_loop.h
@@ -78,16 +78,10 @@
// Used for NotifyHandlers to specify whether HandlerData's |deadline|
// should be checked prior to notifying.
- enum CheckDeadline {
- CHECK_DEADLINE,
- IGNORE_DEADLINE
- };
+ enum CheckDeadline { CHECK_DEADLINE, IGNORE_DEADLINE };
// Mode of operation of the run loop.
- enum RunMode {
- UNTIL_EMPTY,
- UNTIL_IDLE
- };
+ enum RunMode { UNTIL_EMPTY, UNTIL_IDLE };
// Runs the loop servicing any handles and tasks that are ready. If
// |run_mode| is |UNTIL_IDLE|, does not wait for handles or tasks to become
diff --git a/mojo/public/cpp/utility/tests/BUILD.gn b/mojo/public/cpp/utility/tests/BUILD.gn
index 225bf07..dd1d154 100644
--- a/mojo/public/cpp/utility/tests/BUILD.gn
+++ b/mojo/public/cpp/utility/tests/BUILD.gn
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-# GYP version: mojo/mojo_public_tests.gypi:mojo_public_utility_unittests
+# GYP version: mojo/mojo_base.gyp:mojo_public_utility_unittests
test("mojo_public_utility_unittests") {
deps = [
- "//mojo/common/test:run_all_unittests",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/public/cpp/system",
"//mojo/public/cpp/test_support:test_utils",
"//mojo/public/cpp/utility",
diff --git a/mojo/public/interfaces/application/BUILD.gn b/mojo/public/interfaces/application/BUILD.gn
index 91e2447..8634597 100644
--- a/mojo/public/interfaces/application/BUILD.gn
+++ b/mojo/public/interfaces/application/BUILD.gn
@@ -4,7 +4,7 @@
import("//mojo/public/tools/bindings/mojom.gni")
-# GYP version: mojo/mojo_public.gypi:mojo_application_bindings
+# GYP version: mojo/public/mojo_public.gyp:mojo_application_bindings
mojom("application") {
sources = [
"application.mojom",
diff --git a/mojo/public/interfaces/bindings/tests/test_structs.mojom b/mojo/public/interfaces/bindings/tests/test_structs.mojom
index d361da7..6af0086 100644
--- a/mojo/public/interfaces/bindings/tests/test_structs.mojom
+++ b/mojo/public/interfaces/bindings/tests/test_structs.mojom
@@ -82,4 +82,30 @@
Rect? f16 = default;
};
+
+// Used to verify that the code generated for enum and const values defined
+// within a struct is correct. Assuming that a constant's value can be a literal
+// or another constant and that enum values can either be an integer constant or
+// another value from the same enum type.
+
+struct ScopedConstants {
+ const int32 TEN = 10;
+ const int32 ALSO_TEN = TEN;
+ enum EType {
+ E0,
+ E1,
+ E2 = 10,
+ E3 = E2,
+ E4,
+ };
+ const int32 TEN_TOO = EType.E2;
+ EType f0 = E0; // 0
+ EType f1 = E1; // 1
+ EType f2 = E2; // 10
+ EType f3 = E3; // 10
+ EType f4 = E4; // 11
+ int32 f5 = TEN;
+ int32 f6 = ALSO_TEN;
+};
+
}
diff --git a/mojo/public/js/bindings/connection.js b/mojo/public/js/bindings/connection.js
index 31cf2aa..01e33e9 100644
--- a/mojo/public/js/bindings/connection.js
+++ b/mojo/public/js/bindings/connection.js
@@ -16,6 +16,7 @@
this.local = new localFactory(this.remote);
this.router_.setIncomingReceiver(this.local);
+ // Validate incoming messages: remote responses and local requests.
var validateRequest = localFactory.prototype.validator;
var validateResponse = remoteFactory.prototype.validator;
var payloadValidators = [];
diff --git a/mojo/public/js/bindings/struct_unittests.js b/mojo/public/js/bindings/struct_unittests.js
index b9948a9..2d7abe5 100644
--- a/mojo/public/js/bindings/struct_unittests.js
+++ b/mojo/public/js/bindings/struct_unittests.js
@@ -72,8 +72,30 @@
expect(s.f16).toEqual(r);
}
+ function testScopedConstants() {
+ expect(testStructs.ScopedConstants.TEN).toEqual(10);
+ expect(testStructs.ScopedConstants.ALSO_TEN).toEqual(10);
+ expect(testStructs.ScopedConstants.TEN_TOO).toEqual(10);
+
+ expect(testStructs.ScopedConstants.EType.E0).toEqual(0);
+ expect(testStructs.ScopedConstants.EType.E1).toEqual(1);
+ expect(testStructs.ScopedConstants.EType.E2).toEqual(10);
+ expect(testStructs.ScopedConstants.EType.E3).toEqual(10);
+ expect(testStructs.ScopedConstants.EType.E4).toEqual(11);
+
+ var s = new testStructs.ScopedConstants();
+ expect(s.f0).toEqual(0);
+ expect(s.f1).toEqual(1);
+ expect(s.f2).toEqual(10);
+ expect(s.f3).toEqual(10);
+ expect(s.f4).toEqual(11);
+ expect(s.f5).toEqual(10);
+ expect(s.f6).toEqual(10);
+ }
+
testConstructors();
testNoDefaultFieldValues();
testDefaultFieldValues();
+ testScopedConstants();
this.result = "PASS";
});
\ No newline at end of file
diff --git a/mojo/public/js/bindings/validation_unittests.js b/mojo/public/js/bindings/validation_unittests.js
index 73fd9c7..59aeb59 100644
--- a/mojo/public/js/bindings/validation_unittests.js
+++ b/mojo/public/js/bindings/validation_unittests.js
@@ -246,12 +246,12 @@
function testConformanceMessageValidation() {
testMessageValidation("conformance_", [
- testInterface.ConformanceTestInterfaceStub.prototype.validator]);
+ testInterface.ConformanceTestInterface.validateRequest]);
}
function testNotImplementedMessageValidation() {
testMessageValidation("not_implemented_", [
- testInterface.ConformanceTestInterfaceStub.prototype.validator]);
+ testInterface.ConformanceTestInterface.validateRequest]);
}
function testIntegratedMessageValidation() {
@@ -279,8 +279,8 @@
var testConnection = new connection.TestConnection(
testMessagePipe.handle1,
- testInterface.IntegrationTestInterface1Stub,
- testInterface.IntegrationTestInterface2Proxy);
+ testInterface.IntegrationTestInterface1.stubClass,
+ testInterface.IntegrationTestInterface2.proxyClass);
var validationError = noError;
testConnection.router_.validationErrorHandler = function(err) {
diff --git a/mojo/public/mojo_public.gyp b/mojo/public/mojo_public.gyp
new file mode 100644
index 0000000..6911209
--- /dev/null
+++ b/mojo/public/mojo_public.gyp
@@ -0,0 +1,363 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../mojo_variables.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'mojo_public',
+ 'type': 'none',
+ 'dependencies': [
+ 'mojo_js_bindings',
+ 'mojo_public_test_interfaces',
+ 'mojo_public_test_utils',
+ 'mojo_system',
+ 'mojo_utility',
+ ],
+ },
+ {
+ 'target_name': 'mojo_none',
+ 'type': 'none',
+ },
+ {
+ # GN version: //mojo/public/c/system
+ 'target_name': 'mojo_system',
+ 'type': 'static_library',
+ 'defines': [
+ 'MOJO_SYSTEM_IMPLEMENTATION',
+ ],
+ 'include_dirs': [
+ '../..',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../..',
+ ],
+ },
+ 'all_dependent_settings': {
+ 'conditions': [
+ # We need to be able to call the MojoSetSystemThunks() function in
+ # system_thunks.cc
+ ['OS=="android"', {
+ 'ldflags!': [
+ '-Wl,--exclude-libs=ALL',
+ ],
+ }],
+ ],
+ },
+ 'sources': [
+ 'c/system/buffer.h',
+ 'c/system/core.h',
+ 'c/system/data_pipe.h',
+ 'c/system/functions.h',
+ 'c/system/macros.h',
+ 'c/system/message_pipe.h',
+ 'c/system/system_export.h',
+ 'c/system/types.h',
+ 'platform/native/system_thunks.cc',
+ 'platform/native/system_thunks.h',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/bindings
+ 'target_name': 'mojo_cpp_bindings',
+ 'type': 'static_library',
+ 'include_dirs': [
+ '../..'
+ ],
+ 'sources': [
+ 'cpp/bindings/array.h',
+ 'cpp/bindings/callback.h',
+ 'cpp/bindings/error_handler.h',
+ 'cpp/bindings/interface_impl.h',
+ 'cpp/bindings/interface_ptr.h',
+ 'cpp/bindings/interface_request.h',
+ 'cpp/bindings/message.h',
+ 'cpp/bindings/message_filter.h',
+ 'cpp/bindings/no_interface.h',
+ 'cpp/bindings/string.h',
+ 'cpp/bindings/type_converter.h',
+ 'cpp/bindings/lib/array_internal.h',
+ 'cpp/bindings/lib/array_internal.cc',
+ 'cpp/bindings/lib/array_serialization.h',
+ 'cpp/bindings/lib/bindings_internal.h',
+ 'cpp/bindings/lib/bindings_serialization.cc',
+ 'cpp/bindings/lib/bindings_serialization.h',
+ 'cpp/bindings/lib/bounds_checker.cc',
+ 'cpp/bindings/lib/bounds_checker.h',
+ 'cpp/bindings/lib/buffer.h',
+ 'cpp/bindings/lib/callback_internal.h',
+ 'cpp/bindings/lib/connector.cc',
+ 'cpp/bindings/lib/connector.h',
+ 'cpp/bindings/lib/filter_chain.cc',
+ 'cpp/bindings/lib/filter_chain.h',
+ 'cpp/bindings/lib/fixed_buffer.cc',
+ 'cpp/bindings/lib/fixed_buffer.h',
+ 'cpp/bindings/lib/interface_impl_internal.h',
+ 'cpp/bindings/lib/interface_ptr_internal.h',
+ 'cpp/bindings/lib/message.cc',
+ 'cpp/bindings/lib/message_builder.cc',
+ 'cpp/bindings/lib/message_builder.h',
+ 'cpp/bindings/lib/message_filter.cc',
+ 'cpp/bindings/lib/message_header_validator.cc',
+ 'cpp/bindings/lib/message_header_validator.h',
+ 'cpp/bindings/lib/message_internal.h',
+ 'cpp/bindings/lib/message_queue.cc',
+ 'cpp/bindings/lib/message_queue.h',
+ 'cpp/bindings/lib/no_interface.cc',
+ 'cpp/bindings/lib/router.cc',
+ 'cpp/bindings/lib/router.h',
+ 'cpp/bindings/lib/shared_data.h',
+ 'cpp/bindings/lib/shared_ptr.h',
+ 'cpp/bindings/lib/string_serialization.h',
+ 'cpp/bindings/lib/string_serialization.cc',
+ 'cpp/bindings/lib/validation_errors.cc',
+ 'cpp/bindings/lib/validation_errors.h',
+ ],
+ },
+ {
+ # GN version: //mojo/public/js/bindings
+ 'target_name': 'mojo_js_bindings',
+ 'type': 'static_library',
+ 'include_dirs': [
+ '../..'
+ ],
+ 'sources': [
+ 'js/bindings/constants.cc',
+ 'js/bindings/constants.h',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/environment:standalone
+ 'target_name': 'mojo_environment_standalone',
+ 'type': 'static_library',
+ 'sources': [
+ 'c/environment/async_waiter.h',
+ 'c/environment/logger.h',
+ 'cpp/environment/environment.h',
+ 'cpp/environment/lib/default_async_waiter.cc',
+ 'cpp/environment/lib/default_async_waiter.h',
+ 'cpp/environment/lib/default_logger.cc',
+ 'cpp/environment/lib/default_logger.h',
+ 'cpp/environment/lib/environment.cc',
+ 'cpp/environment/lib/logging.cc',
+ 'cpp/environment/logging.h',
+ ],
+ 'include_dirs': [
+ '../..',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/utility
+ 'target_name': 'mojo_utility',
+ 'type': 'static_library',
+ 'sources': [
+ 'cpp/utility/mutex.h',
+ 'cpp/utility/run_loop.h',
+ 'cpp/utility/run_loop_handler.h',
+ 'cpp/utility/thread.h',
+ 'cpp/utility/lib/mutex.cc',
+ 'cpp/utility/lib/run_loop.cc',
+ 'cpp/utility/lib/thread.cc',
+ 'cpp/utility/lib/thread_local.h',
+ 'cpp/utility/lib/thread_local_posix.cc',
+ 'cpp/utility/lib/thread_local_win.cc',
+ ],
+ 'conditions': [
+ # See crbug.com/342893:
+ ['OS=="win"', {
+ 'sources!': [
+ 'cpp/utility/mutex.h',
+ 'cpp/utility/thread.h',
+ 'cpp/utility/lib/mutex.cc',
+ 'cpp/utility/lib/thread.cc',
+ ],
+ }],
+ ],
+ 'include_dirs': [
+ '../..',
+ ],
+ },
+ {
+ # GN version: //mojo/public/interfaces/application:application
+ 'target_name': 'mojo_application_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/application/application.mojom',
+ 'interfaces/application/service_provider.mojom',
+ 'interfaces/application/shell.mojom',
+ ],
+ 'includes': [ 'tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/application
+ 'target_name': 'mojo_application_base',
+ 'type': 'static_library',
+ 'sources': [
+ 'cpp/application/application_connection.h',
+ 'cpp/application/application_delegate.h',
+ 'cpp/application/application_impl.h',
+ 'cpp/application/connect.h',
+ 'cpp/application/interface_factory.h',
+ 'cpp/application/interface_factory_impl.h',
+ 'cpp/application/lib/application_connection.cc',
+ 'cpp/application/lib/application_delegate.cc',
+ 'cpp/application/lib/application_impl.cc',
+ 'cpp/application/lib/service_provider_impl.cc',
+ 'cpp/application/lib/service_connector.cc',
+ 'cpp/application/lib/service_connector.h',
+ 'cpp/application/lib/service_registry.cc',
+ 'cpp/application/lib/service_registry.h',
+ 'cpp/application/lib/weak_service_provider.cc',
+ 'cpp/application/lib/weak_service_provider.h',
+ 'cpp/application/service_provider_impl.h',
+ ],
+ 'dependencies': [
+ 'mojo_application_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_application_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/application:standalone"
+ 'target_name': 'mojo_application_standalone',
+ 'type': 'static_library',
+ 'sources': [
+ 'cpp/application/lib/application_runner.cc',
+ 'cpp/application/application_runner.h',
+ ],
+ 'dependencies': [
+ 'mojo_application_base',
+ 'mojo_environment_standalone',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_application_base',
+ ],
+ },
+ {
+ # GN version: //mojo/public/c/test_support
+ 'target_name': 'mojo_test_support',
+ 'defines': [
+ 'MOJO_TEST_SUPPORT_IMPLEMENTATION',
+ ],
+ 'include_dirs': [
+ '../..',
+ ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [
+ '../..',
+ ],
+ },
+ 'sources': [
+ 'c/test_support/test_support.h',
+ 'c/test_support/test_support_export.h',
+ # TODO(vtl): Convert this to thunks http://crbug.com/386799
+ 'tests/test_support_private.cc',
+ 'tests/test_support_private.h',
+ ],
+ 'conditions': [
+ ['OS=="ios"', {
+ 'type': 'static_library',
+ }, {
+ 'type': 'shared_library',
+ }],
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ # Make it a run-path dependent library.
+ 'DYLIB_INSTALL_NAME_BASE': '@loader_path',
+ },
+ }],
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/test_support:test_utils
+ 'target_name': 'mojo_public_test_utils',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ '../../testing/gtest.gyp:gtest',
+ 'mojo_test_support',
+ ],
+ 'sources': [
+ 'cpp/test_support/lib/test_support.cc',
+ 'cpp/test_support/lib/test_utils.cc',
+ 'cpp/test_support/test_utils.h',
+ ],
+ },
+ {
+ # GN version: //mojo/public/cpp/bindings/tests:mojo_public_bindings_test_utils
+ 'target_name': 'mojo_public_bindings_test_utils',
+ 'type': 'static_library',
+ 'dependencies': [
+ '../../base/base.gyp:base',
+ ],
+ 'sources': [
+ 'cpp/bindings/tests/validation_test_input_parser.cc',
+ 'cpp/bindings/tests/validation_test_input_parser.h',
+ ],
+ },
+ {
+ # GN version: //mojo/public/interfaces/bindings/tests:test_interfaces
+ 'target_name': 'mojo_public_test_interfaces',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/bindings/tests/math_calculator.mojom',
+ 'interfaces/bindings/tests/no_module.mojom',
+ 'interfaces/bindings/tests/rect.mojom',
+ 'interfaces/bindings/tests/regression_tests.mojom',
+ 'interfaces/bindings/tests/sample_factory.mojom',
+ 'interfaces/bindings/tests/sample_import.mojom',
+ 'interfaces/bindings/tests/sample_import2.mojom',
+ 'interfaces/bindings/tests/sample_interfaces.mojom',
+ 'interfaces/bindings/tests/sample_service.mojom',
+ 'interfaces/bindings/tests/serialization_test_structs.mojom',
+ 'interfaces/bindings/tests/test_structs.mojom',
+ 'interfaces/bindings/tests/validation_test_interfaces.mojom',
+ ],
+ 'includes': [ 'tools/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ 'mojo_cpp_bindings',
+ ],
+ 'dependencies': [
+ 'mojo_cpp_bindings',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS == "android"', {
+ 'targets': [
+ {
+ # GN version: //mojo/public/java_system
+ 'target_name': 'mojo_public_java',
+ 'type': 'none',
+ 'variables': {
+ 'java_in_dir': 'java/system',
+ },
+ 'includes': [ '../../build/java.gypi' ],
+ },
+ {
+ # GN version: //mojo/public/java_bindings
+ 'target_name': 'mojo_bindings_java',
+ 'type': 'none',
+ 'variables': {
+ 'java_in_dir': 'java/bindings',
+ },
+ 'dependencies': [
+ 'mojo_public_java',
+ ],
+ 'includes': [ '../../build/java.gypi' ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/mojo/public/platform/native/BUILD.gn b/mojo/public/platform/native/BUILD.gn
index a3e720b..e7919ae 100644
--- a/mojo/public/platform/native/BUILD.gn
+++ b/mojo/public/platform/native/BUILD.gn
@@ -25,7 +25,7 @@
# source_set here, this flag change is not needed.
}
-# GYP version: mojo/mojo_public.gypi:mojo_gles2
+# GYP version: mojo/mojo_public_gles2_for_loadable_module.gypi
source_set("gles2_thunks") {
visibility = [ "//mojo/public/gles2:for_shared_library" ]
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl
index 0b11047..5de77d3 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/params_definition.tmpl
@@ -29,5 +29,5 @@
header_.num_fields = {{struct.packed.packed_fields|length}};
}
};
-MOJO_COMPILE_ASSERT(sizeof({{class_name}}) == {{struct.packed|struct_size}},
- bad_sizeof_{{class_name}});
+static_assert(sizeof({{class_name}}) == {{struct.packed|struct_size}},
+ "Bad sizeof({{class_name}})");
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
index 60a6a9e..b206f20 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_declaration.tmpl
@@ -18,5 +18,5 @@
{{class_name}}();
~{{class_name}}(); // NOT IMPLEMENTED
};
-MOJO_COMPILE_ASSERT(sizeof({{class_name}}) == {{struct.packed|struct_size}},
- bad_sizeof_{{class_name}});
+static_assert(sizeof({{class_name}}) == {{struct.packed|struct_size}},
+ "Bad sizeof({{class_name}})");
diff --git a/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
index 795116d..4ae0a9b 100644
--- a/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
@@ -1,6 +1,5 @@
-{%- macro enum_def(enum_name, enum, module) -%}
+{%- macro enum_def(enum_name, enum) -%}
{{enum_name}} = {};
-
{%- set prev_enum = 0 %}
{%- for field in enum.fields %}
{%- if field.value %}
diff --git a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
index b41929c..391d375 100644
--- a/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
@@ -1,4 +1,3 @@
-{%- set namespace_as_string = namespace|replace(".","::") %}
{%- for method in interface.methods %}
var k{{interface.name}}_{{method.name}}_Name = {{method.ordinal}};
{%- endfor %}
@@ -7,8 +6,6 @@
this.receiver_ = receiver;
}
- {{interface.name}}Proxy.NAME_ = '{{namespace_as_string}}::{{interface.name}}';
-
{%- for method in interface.methods %}
{{interface.name}}Proxy.prototype.{{method.name|stylize_method}} = function(
{%- for parameter in method.parameters -%}
@@ -54,8 +51,6 @@
function {{interface.name}}Stub() {
}
- {{interface.name}}Stub.NAME_ = '{{namespace_as_string}}::{{interface.name}}';
-
{{interface.name}}Stub.prototype.accept = function(message) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
@@ -157,22 +152,29 @@
{%- endif %}
}
+ var {{interface.name}} = {
+ name: '{{namespace|replace(".","::")}}::{{interface.name}}',
+ proxyClass: {{interface.name}}Proxy,
+ stubClass: {{interface.name}}Stub,
+ validateRequest: validate{{interface.name}}Request,
+{%- if interface|has_callbacks %}
+ validateResponse: validate{{interface.name}}Response,
+{%- else %}
+ validateResponse: null,
+{%- endif %}
+ };
+{#--- Interface Constants #}
+{%- for constant in interface.constants %}
+ {{interface.name}}.{{constant.name}} = {{constant.value|expression_to_text}},
+{%- endfor %}
+{#--- Interface Enums #}
+{%- from "enum_definition.tmpl" import enum_def -%}
+{%- for enum in interface.enums %}
+ {{ enum_def("%s.%s"|format(interface.name, enum.name), enum) }}
+{%- endfor %}
{{interface.name}}Stub.prototype.validator = validate{{interface.name}}Request;
{%- if interface|has_callbacks %}
{{interface.name}}Proxy.prototype.validator = validate{{interface.name}}Response;
{%- else %}
{{interface.name}}Proxy.prototype.validator = null;
-{%- endif -%}
-
-{#--- Enums #}
-{% from "enum_definition.tmpl" import enum_def -%}
-{% for enum in interface.enums %}
- {{enum_def("%sProxy.%s"|format(interface.name, enum.name), enum, module)}}
- {{interface.name}}Stub.{{enum.name}} = {{interface.name}}Proxy.{{enum.name}};
-{%- endfor %}
-
-{#--- Constants. #}
-{% for constant in interface.constants %}
- {{interface.name}}Proxy.{{constant.name}} = {{constant.value|expression_to_text}};
- {{interface.name}}Stub.{{constant.name}} = {{interface.name}}Proxy.{{constant.name}};
-{%- endfor %}
+{%- endif %}
diff --git a/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl b/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
index 93fa537..397a120 100644
--- a/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
@@ -22,7 +22,7 @@
{#--- Enums #}
{%- from "enum_definition.tmpl" import enum_def %}
{%- for enum in enums %}
- var {{ enum_def(enum.name, enum, module) }}
+ var {{ enum_def(enum.name, enum) }}
{%- endfor %}
{#--- Struct definitions #}
@@ -46,8 +46,12 @@
exports.{{struct.name}} = {{struct.name}};
{%- endfor %}
{%- for interface in interfaces %}
- exports.{{interface.name}}Proxy = {{interface.name}}Proxy;
- exports.{{interface.name}}Stub = {{interface.name}}Stub;
+ exports.{{interface.name}} = {{interface.name}};
+{#--- Interface Client #}
+{%- if interface.client in interfaces|map(attribute='name') %}
+ exports.{{interface.name}}.client = {{interface.client}};
+{%- endif %}
{%- endfor %}
+
return exports;
});
diff --git a/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl b/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
index d77b28b..c0d8793 100644
--- a/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
@@ -7,7 +7,7 @@
{#--- Enums #}
{%- from "enum_definition.tmpl" import enum_def %}
{% for enum in struct.enums %}
- {{enum_def("%s.%s"|format(struct.name, enum.name), enum, module)}}
+ {{enum_def("%s.%s"|format(struct.name, enum.name), enum)}}
{%- endfor %}
{#--- Constants #}
diff --git a/mojo/services/BUILD.gn b/mojo/services/BUILD.gn
index cdf3752..fb89e8f 100644
--- a/mojo/services/BUILD.gn
+++ b/mojo/services/BUILD.gn
@@ -7,7 +7,8 @@
group("services") {
deps = [
"//mojo/services/clipboard",
- "//mojo/services/gles2:bindings",
+ "//mojo/services/gles2:lib",
+ "//mojo/services/html_viewer",
"//mojo/services/network",
"//mojo/services/public/interfaces/clipboard",
"//mojo/services/public/interfaces/content_handler",
diff --git a/mojo/services/clipboard/BUILD.gn b/mojo/services/clipboard/BUILD.gn
index 5c3b78e..42ab408 100644
--- a/mojo/services/clipboard/BUILD.gn
+++ b/mojo/services/clipboard/BUILD.gn
@@ -30,8 +30,8 @@
"//mojo/application",
"//mojo/application_manager",
"//mojo/common",
- "//mojo/common/test:run_all_unittests",
"//mojo/edk/system",
+ "//mojo/edk/test:run_all_unittests",
"//mojo/environment:chromium",
"//mojo/services/public/interfaces/clipboard:clipboard",
"//mojo/shell:test_support",
diff --git a/mojo/services/gles2/BUILD.gn b/mojo/services/gles2/BUILD.gn
index 9bf840e..12513c2 100644
--- a/mojo/services/gles2/BUILD.gn
+++ b/mojo/services/gles2/BUILD.gn
@@ -7,7 +7,7 @@
# GYP version: mojo/mojo_services.gypi:mojo_gles2_service
source_set("gles2") {
public_deps = [
- ":bindings",
+ ":lib",
]
deps = [
"//base",
@@ -23,8 +23,8 @@
]
}
-# GYP version: mojo/mojo_services.gypi:mojo_gles2_bindings
-source_set("bindings") {
+# GYP version: mojo/mojo_services.gypi:mojo_gles2_lib
+source_set("lib") {
sources = [
"command_buffer_type_conversions.cc",
"command_buffer_type_conversions.h",
diff --git a/mojo/services/html_viewer/blink_platform_impl.cc b/mojo/services/html_viewer/blink_platform_impl.cc
index 8a7555b..697699a 100644
--- a/mojo/services/html_viewer/blink_platform_impl.cc
+++ b/mojo/services/html_viewer/blink_platform_impl.cc
@@ -59,7 +59,7 @@
app->ConnectToService("mojo:mojo_network_service", &network_service_);
CookieStorePtr cookie_store;
- network_service_->GetCookieStore(Get(&cookie_store));
+ network_service_->GetCookieStore(GetProxy(&cookie_store));
cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass()));
ClipboardPtr clipboard;
diff --git a/mojo/services/html_viewer/html_document_view.cc b/mojo/services/html_viewer/html_document_view.cc
index 7056501..400d8ca 100644
--- a/mojo/services/html_viewer/html_document_view.cc
+++ b/mojo/services/html_viewer/html_document_view.cc
@@ -155,15 +155,15 @@
void HTMLDocumentView::initializeLayerTreeView() {
ServiceProviderPtr surfaces_service_provider;
shell_->ConnectToApplication("mojo:mojo_surfaces_service",
- Get(&surfaces_service_provider));
- InterfacePtr<SurfacesService> surfaces_service;
+ GetProxy(&surfaces_service_provider));
+ SurfacesServicePtr surfaces_service;
ConnectToService(surfaces_service_provider.get(), &surfaces_service);
ServiceProviderPtr gpu_service_provider;
// TODO(jamesr): Should be mojo:mojo_gpu_service
shell_->ConnectToApplication("mojo:mojo_native_viewport_service",
- Get(&gpu_service_provider));
- InterfacePtr<Gpu> gpu_service;
+ GetProxy(&gpu_service_provider));
+ GpuPtr gpu_service;
ConnectToService(gpu_service_provider.get(), &gpu_service);
web_layer_tree_view_impl_.reset(new WebLayerTreeViewImpl(
compositor_thread_, surfaces_service.Pass(), gpu_service.Pass()));
diff --git a/mojo/services/html_viewer/weblayertreeview_impl.cc b/mojo/services/html_viewer/weblayertreeview_impl.cc
index 56ebc34..24eaaf9 100644
--- a/mojo/services/html_viewer/weblayertreeview_impl.cc
+++ b/mojo/services/html_viewer/weblayertreeview_impl.cc
@@ -220,7 +220,7 @@
void WebLayerTreeViewImpl::OnSurfaceConnectionCreated(SurfacePtr surface,
uint32_t id_namespace) {
CommandBufferPtr cb;
- gpu_service_->CreateOffscreenGLES2Context(Get(&cb));
+ gpu_service_->CreateOffscreenGLES2Context(GetProxy(&cb));
scoped_refptr<cc::ContextProvider> context_provider(
new ContextProviderMojo(cb.PassMessagePipe()));
output_surface_.reset(new OutputSurfaceMojo(
diff --git a/mojo/services/html_viewer/websockethandle_impl.cc b/mojo/services/html_viewer/websockethandle_impl.cc
index b927b10..c7f55e3 100644
--- a/mojo/services/html_viewer/websockethandle_impl.cc
+++ b/mojo/services/html_viewer/websockethandle_impl.cc
@@ -145,7 +145,7 @@
WebSocketHandleImpl::WebSocketHandleImpl(NetworkService* network_service)
: did_close_(false) {
- network_service->CreateWebSocket(Get(&web_socket_));
+ network_service->CreateWebSocket(GetProxy(&web_socket_));
}
WebSocketHandleImpl::~WebSocketHandleImpl() {
diff --git a/mojo/services/html_viewer/weburlloader_impl.cc b/mojo/services/html_viewer/weburlloader_impl.cc
index fb82bcf..87d9376 100644
--- a/mojo/services/html_viewer/weburlloader_impl.cc
+++ b/mojo/services/html_viewer/weburlloader_impl.cc
@@ -78,7 +78,7 @@
WebURLLoaderImpl::WebURLLoaderImpl(NetworkService* network_service)
: client_(NULL),
weak_factory_(this) {
- network_service->CreateURLLoader(Get(&url_loader_));
+ network_service->CreateURLLoader(GetProxy(&url_loader_));
}
WebURLLoaderImpl::~WebURLLoaderImpl() {
diff --git a/mojo/services/native_viewport/platform_viewport_mac.mm b/mojo/services/native_viewport/platform_viewport_mac.mm
index 9d11052..40bee95 100644
--- a/mojo/services/native_viewport/platform_viewport_mac.mm
+++ b/mojo/services/native_viewport/platform_viewport_mac.mm
@@ -27,7 +27,7 @@
private:
// Overridden from PlatformViewport:
- virtual void Init(const gfx::Rect& bounds) OVERRIDE {
+ virtual void Init(const gfx::Rect& bounds) override {
[NSApplication sharedApplication];
rect_ = bounds;
@@ -40,32 +40,32 @@
delegate_->OnBoundsChanged(rect_);
}
- virtual void Show() OVERRIDE {
+ virtual void Show() override {
[window_ orderFront:nil];
}
- virtual void Hide() OVERRIDE {
+ virtual void Hide() override {
[window_ orderOut:nil];
}
- virtual void Close() OVERRIDE {
+ virtual void Close() override {
// TODO(beng): perform this in response to NSWindow destruction.
delegate_->OnDestroyed();
}
- virtual gfx::Size GetSize() OVERRIDE {
+ virtual gfx::Size GetSize() override {
return rect_.size();
}
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {
+ virtual void SetBounds(const gfx::Rect& bounds) override {
NOTIMPLEMENTED();
}
- virtual void SetCapture() OVERRIDE {
+ virtual void SetCapture() override {
NOTIMPLEMENTED();
}
- virtual void ReleaseCapture() OVERRIDE {
+ virtual void ReleaseCapture() override {
NOTIMPLEMENTED();
}
diff --git a/mojo/services/native_viewport/platform_viewport_ozone.cc b/mojo/services/native_viewport/platform_viewport_ozone.cc
index b8076fb..dcac5ad 100644
--- a/mojo/services/native_viewport/platform_viewport_ozone.cc
+++ b/mojo/services/native_viewport/platform_viewport_ozone.cc
@@ -31,54 +31,54 @@
private:
// Overridden from PlatformViewport:
- virtual void Init(const gfx::Rect& bounds) OVERRIDE {
+ virtual void Init(const gfx::Rect& bounds) override {
platform_window_ =
ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds);
}
- virtual void Show() OVERRIDE { platform_window_->Show(); }
+ virtual void Show() override { platform_window_->Show(); }
- virtual void Hide() OVERRIDE { platform_window_->Hide(); }
+ virtual void Hide() override { platform_window_->Hide(); }
- virtual void Close() OVERRIDE { platform_window_->Close(); }
+ virtual void Close() override { platform_window_->Close(); }
- virtual gfx::Size GetSize() OVERRIDE {
+ virtual gfx::Size GetSize() override {
return platform_window_->GetBounds().size();
}
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {
+ virtual void SetBounds(const gfx::Rect& bounds) override {
platform_window_->SetBounds(bounds);
}
- virtual void SetCapture() OVERRIDE { platform_window_->SetCapture(); }
+ virtual void SetCapture() override { platform_window_->SetCapture(); }
- virtual void ReleaseCapture() OVERRIDE { platform_window_->ReleaseCapture(); }
+ virtual void ReleaseCapture() override { platform_window_->ReleaseCapture(); }
// ui::PlatformWindowDelegate:
- virtual void OnBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE {
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) override {
delegate_->OnBoundsChanged(new_bounds);
}
- virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE {}
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) override {}
- virtual void DispatchEvent(ui::Event* event) OVERRIDE {
+ virtual void DispatchEvent(ui::Event* event) override {
delegate_->OnEvent(event);
}
- virtual void OnCloseRequest() OVERRIDE { platform_window_->Close(); }
+ virtual void OnCloseRequest() override { platform_window_->Close(); }
- virtual void OnClosed() OVERRIDE { delegate_->OnDestroyed(); }
+ virtual void OnClosed() override { delegate_->OnDestroyed(); }
- virtual void OnWindowStateChanged(ui::PlatformWindowState state) OVERRIDE {}
+ virtual void OnWindowStateChanged(ui::PlatformWindowState state) override {}
- virtual void OnLostCapture() OVERRIDE {}
+ virtual void OnLostCapture() override {}
virtual void OnAcceleratedWidgetAvailable(
- gfx::AcceleratedWidget widget) OVERRIDE {
+ gfx::AcceleratedWidget widget) override {
delegate_->OnAcceleratedWidgetAvailable(widget);
}
- virtual void OnActivationChanged(bool active) OVERRIDE {}
+ virtual void OnActivationChanged(bool active) override {}
scoped_ptr<ui::PlatformWindow> platform_window_;
Delegate* delegate_;
diff --git a/mojo/services/native_viewport/platform_viewport_win.cc b/mojo/services/native_viewport/platform_viewport_win.cc
index 2227112..91c980c 100644
--- a/mojo/services/native_viewport/platform_viewport_win.cc
+++ b/mojo/services/native_viewport/platform_viewport_win.cc
@@ -25,70 +25,70 @@
private:
// Overridden from PlatformViewport:
- virtual void Init(const gfx::Rect& bounds) OVERRIDE {
+ virtual void Init(const gfx::Rect& bounds) override {
platform_window_.reset(new ui::WinWindow(this, bounds));
}
- virtual void Show() OVERRIDE {
+ virtual void Show() override {
platform_window_->Show();
}
- virtual void Hide() OVERRIDE {
+ virtual void Hide() override {
platform_window_->Hide();
}
- virtual void Close() OVERRIDE {
+ virtual void Close() override {
platform_window_->Close();
}
- virtual gfx::Size GetSize() OVERRIDE {
+ virtual gfx::Size GetSize() override {
return platform_window_->GetBounds().size();
}
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {
+ virtual void SetBounds(const gfx::Rect& bounds) override {
platform_window_->SetBounds(bounds);
}
- virtual void SetCapture() OVERRIDE {
+ virtual void SetCapture() override {
platform_window_->SetCapture();
}
- virtual void ReleaseCapture() OVERRIDE {
+ virtual void ReleaseCapture() override {
platform_window_->ReleaseCapture();
}
// ui::PlatformWindowDelegate:
- virtual void OnBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE {
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) override {
delegate_->OnBoundsChanged(new_bounds);
}
- virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE {
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) override {
}
- virtual void DispatchEvent(ui::Event* event) OVERRIDE {
+ virtual void DispatchEvent(ui::Event* event) override {
delegate_->OnEvent(event);
}
- virtual void OnCloseRequest() OVERRIDE {
+ virtual void OnCloseRequest() override {
platform_window_->Close();
}
- virtual void OnClosed() OVERRIDE {
+ virtual void OnClosed() override {
delegate_->OnDestroyed();
}
- virtual void OnWindowStateChanged(ui::PlatformWindowState state) OVERRIDE {
+ virtual void OnWindowStateChanged(ui::PlatformWindowState state) override {
}
- virtual void OnLostCapture() OVERRIDE {
+ virtual void OnLostCapture() override {
}
virtual void OnAcceleratedWidgetAvailable(
- gfx::AcceleratedWidget widget) OVERRIDE {
+ gfx::AcceleratedWidget widget) override {
delegate_->OnAcceleratedWidgetAvailable(widget);
}
- virtual void OnActivationChanged(bool active) OVERRIDE {}
+ virtual void OnActivationChanged(bool active) override {}
scoped_ptr<ui::PlatformWindow> platform_window_;
Delegate* delegate_;
diff --git a/mojo/services/native_viewport/platform_viewport_x11.cc b/mojo/services/native_viewport/platform_viewport_x11.cc
index d4914c7..0813a56 100644
--- a/mojo/services/native_viewport/platform_viewport_x11.cc
+++ b/mojo/services/native_viewport/platform_viewport_x11.cc
@@ -31,7 +31,7 @@
private:
// Overridden from PlatformViewport:
- virtual void Init(const gfx::Rect& bounds) OVERRIDE {
+ virtual void Init(const gfx::Rect& bounds) override {
CHECK(!event_source_);
CHECK(!platform_window_);
@@ -41,44 +41,44 @@
platform_window_->SetBounds(bounds);
}
- virtual void Show() OVERRIDE {
+ virtual void Show() override {
platform_window_->Show();
}
- virtual void Hide() OVERRIDE {
+ virtual void Hide() override {
platform_window_->Hide();
}
- virtual void Close() OVERRIDE {
+ virtual void Close() override {
platform_window_->Close();
}
- virtual gfx::Size GetSize() OVERRIDE {
+ virtual gfx::Size GetSize() override {
return bounds_.size();
}
- virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE {
+ virtual void SetBounds(const gfx::Rect& bounds) override {
platform_window_->SetBounds(bounds);
}
- virtual void SetCapture() OVERRIDE {
+ virtual void SetCapture() override {
platform_window_->SetCapture();
}
- virtual void ReleaseCapture() OVERRIDE {
+ virtual void ReleaseCapture() override {
platform_window_->ReleaseCapture();
}
// ui::PlatformWindowDelegate:
- virtual void OnBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE {
+ virtual void OnBoundsChanged(const gfx::Rect& new_bounds) override {
bounds_ = new_bounds;
delegate_->OnBoundsChanged(new_bounds);
}
- virtual void OnDamageRect(const gfx::Rect& damaged_region) OVERRIDE {
+ virtual void OnDamageRect(const gfx::Rect& damaged_region) override {
}
- virtual void DispatchEvent(ui::Event* event) OVERRIDE {
+ virtual void DispatchEvent(ui::Event* event) override {
delegate_->OnEvent(event);
// We want to emulate the WM_CHAR generation behaviour of Windows.
@@ -113,26 +113,26 @@
}
}
- virtual void OnCloseRequest() OVERRIDE {
+ virtual void OnCloseRequest() override {
platform_window_->Close();
}
- virtual void OnClosed() OVERRIDE {
+ virtual void OnClosed() override {
delegate_->OnDestroyed();
}
- virtual void OnWindowStateChanged(ui::PlatformWindowState state) OVERRIDE {
+ virtual void OnWindowStateChanged(ui::PlatformWindowState state) override {
}
- virtual void OnLostCapture() OVERRIDE {
+ virtual void OnLostCapture() override {
}
virtual void OnAcceleratedWidgetAvailable(
- gfx::AcceleratedWidget widget) OVERRIDE {
+ gfx::AcceleratedWidget widget) override {
delegate_->OnAcceleratedWidgetAvailable(widget);
}
- virtual void OnActivationChanged(bool active) OVERRIDE {}
+ virtual void OnActivationChanged(bool active) override {}
scoped_ptr<ui::PlatformEventSource> event_source_;
scoped_ptr<ui::PlatformWindow> platform_window_;
diff --git a/mojo/services/native_viewport/viewport_surface.cc b/mojo/services/native_viewport/viewport_surface.cc
index 8786e8c..883be4f 100644
--- a/mojo/services/native_viewport/viewport_surface.cc
+++ b/mojo/services/native_viewport/viewport_surface.cc
@@ -65,7 +65,7 @@
void ViewportSurface::BindSurfaceToNativeViewport() {
CommandBufferPtr cb;
gpu_service_->CreateOnscreenGLES2Context(
- widget_id_, Size::From(size_), Get(&cb));
+ widget_id_, Size::From(size_), GetProxy(&cb));
id_ = id_allocator_->GenerateId();
surface_->CreateGLES2BoundSurface(
diff --git a/mojo/services/native_viewport/viewport_surface.h b/mojo/services/native_viewport/viewport_surface.h
index 2ca8105..3e5ec59 100644
--- a/mojo/services/native_viewport/viewport_surface.h
+++ b/mojo/services/native_viewport/viewport_surface.h
@@ -39,7 +39,7 @@
void SubmitFrame();
// SurfaceClient implementation.
- virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE;
+ virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override;
SurfacePtr surface_;
Gpu* gpu_service_;
diff --git a/mojo/services/network/cookie_store_impl.h b/mojo/services/network/cookie_store_impl.h
index a2ff0b2..9ec5571 100644
--- a/mojo/services/network/cookie_store_impl.h
+++ b/mojo/services/network/cookie_store_impl.h
@@ -19,9 +19,9 @@
private:
// CookieStore methods:
virtual void Get(const String& url,
- const Callback<void(String)>& callback) OVERRIDE;
+ const Callback<void(String)>& callback) override;
virtual void Set(const String& url, const String& cookie,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
NetworkContext* context_;
GURL origin_;
diff --git a/mojo/services/network/main.cc b/mojo/services/network/main.cc
index 8d637ac..27c0d85 100644
--- a/mojo/services/network/main.cc
+++ b/mojo/services/network/main.cc
@@ -22,7 +22,7 @@
public:
Delegate() {}
- virtual void Initialize(mojo::ApplicationImpl* app) OVERRIDE {
+ virtual void Initialize(mojo::ApplicationImpl* app) override {
base::FilePath base_path;
CHECK(PathService::Get(base::DIR_TEMP, &base_path));
base_path = base_path.Append(FILE_PATH_LITERAL("network_service"));
@@ -31,7 +31,7 @@
// mojo::ApplicationDelegate implementation.
virtual bool ConfigureIncomingConnection(
- mojo::ApplicationConnection* connection) OVERRIDE {
+ mojo::ApplicationConnection* connection) override {
DCHECK(context_);
connection->AddService(this);
return true;
@@ -40,7 +40,7 @@
// mojo::InterfaceFactory<mojo::NetworkService> implementation.
virtual void Create(
mojo::ApplicationConnection* connection,
- mojo::InterfaceRequest<mojo::NetworkService> request) OVERRIDE {
+ mojo::InterfaceRequest<mojo::NetworkService> request) override {
mojo::BindToRequest(
new mojo::NetworkServiceImpl(connection, context_.get()), &request);
}
diff --git a/mojo/services/network/url_loader_impl.cc b/mojo/services/network/url_loader_impl.cc
index b5cbd0f..ab2ce8b 100644
--- a/mojo/services/network/url_loader_impl.cc
+++ b/mojo/services/network/url_loader_impl.cc
@@ -66,23 +66,23 @@
virtual ~UploadDataPipeElementReader() {}
// UploadElementReader overrides:
- virtual int Init(const net::CompletionCallback& callback) OVERRIDE {
+ virtual int Init(const net::CompletionCallback& callback) override {
offset_ = 0;
ReadDataRaw(pipe_.get(), NULL, &num_bytes_, MOJO_READ_DATA_FLAG_QUERY);
return net::OK;
}
- virtual uint64 GetContentLength() const OVERRIDE {
+ virtual uint64 GetContentLength() const override {
return num_bytes_;
}
- virtual uint64 BytesRemaining() const OVERRIDE {
+ virtual uint64 BytesRemaining() const override {
return num_bytes_ - offset_;
}
- virtual bool IsInMemory() const OVERRIDE {
+ virtual bool IsInMemory() const override {
return false;
}
virtual int Read(net::IOBuffer* buf,
int buf_length,
- const net::CompletionCallback& callback) OVERRIDE {
+ const net::CompletionCallback& callback) override {
uint32_t bytes_read =
std::min(static_cast<uint32_t>(BytesRemaining()),
static_cast<uint32_t>(buf_length));
diff --git a/mojo/services/network/url_loader_impl.h b/mojo/services/network/url_loader_impl.h
index 5c5af8a..2094999 100644
--- a/mojo/services/network/url_loader_impl.h
+++ b/mojo/services/network/url_loader_impl.h
@@ -5,7 +5,6 @@
#ifndef MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_
#define MOJO_SERVICES_NETWORK_URL_LOADER_IMPL_H_
-#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "mojo/common/handle_watcher.h"
@@ -30,19 +29,19 @@
// URLLoader methods:
virtual void Start(
URLRequestPtr request,
- const Callback<void(URLResponsePtr)>& callback) OVERRIDE;
+ const Callback<void(URLResponsePtr)>& callback) override;
virtual void FollowRedirect(
- const Callback<void(URLResponsePtr)>& callback) OVERRIDE;
+ const Callback<void(URLResponsePtr)>& callback) override;
virtual void QueryStatus(
- const Callback<void(URLLoaderStatusPtr)>& callback) OVERRIDE;
+ const Callback<void(URLLoaderStatusPtr)>& callback) override;
// net::URLRequest::Delegate methods:
virtual void OnReceivedRedirect(net::URLRequest* url_request,
const net::RedirectInfo& redirect_info,
- bool* defer_redirect) OVERRIDE;
- virtual void OnResponseStarted(net::URLRequest* url_request) OVERRIDE;
+ bool* defer_redirect) override;
+ virtual void OnResponseStarted(net::URLRequest* url_request) override;
virtual void OnReadCompleted(net::URLRequest* url_request, int bytes_read)
- OVERRIDE;
+ override;
void SendError(
int error,
diff --git a/mojo/services/network/web_socket_impl.cc b/mojo/services/network/web_socket_impl.cc
index 7ba9b22..7617562 100644
--- a/mojo/services/network/web_socket_impl.cc
+++ b/mojo/services/network/web_socket_impl.cc
@@ -72,25 +72,25 @@
virtual ChannelState OnAddChannelResponse(
bool fail,
const std::string& selected_subprotocol,
- const std::string& extensions) OVERRIDE;
+ const std::string& extensions) override;
virtual ChannelState OnDataFrame(bool fin,
WebSocketMessageType type,
- const std::vector<char>& data) OVERRIDE;
- virtual ChannelState OnClosingHandshake() OVERRIDE;
- virtual ChannelState OnFlowControl(int64 quota) OVERRIDE;
+ const std::vector<char>& data) override;
+ virtual ChannelState OnClosingHandshake() override;
+ virtual ChannelState OnFlowControl(int64 quota) override;
virtual ChannelState OnDropChannel(bool was_clean,
uint16 code,
- const std::string& reason) OVERRIDE;
- virtual ChannelState OnFailChannel(const std::string& message) OVERRIDE;
+ const std::string& reason) override;
+ virtual ChannelState OnFailChannel(const std::string& message) override;
virtual ChannelState OnStartOpeningHandshake(
- scoped_ptr<net::WebSocketHandshakeRequestInfo> request) OVERRIDE;
+ scoped_ptr<net::WebSocketHandshakeRequestInfo> request) override;
virtual ChannelState OnFinishOpeningHandshake(
- scoped_ptr<net::WebSocketHandshakeResponseInfo> response) OVERRIDE;
+ scoped_ptr<net::WebSocketHandshakeResponseInfo> response) override;
virtual ChannelState OnSSLCertificateError(
scoped_ptr<net::WebSocketEventInterface::SSLErrorCallbacks> callbacks,
const GURL& url,
const net::SSLInfo& ssl_info,
- bool fatal) OVERRIDE;
+ bool fatal) override;
// Called once we've written to |receive_stream_|.
void DidWriteToReceiveStream(bool fin,
diff --git a/mojo/services/network/web_socket_impl.h b/mojo/services/network/web_socket_impl.h
index bd8a27d..31855df 100644
--- a/mojo/services/network/web_socket_impl.h
+++ b/mojo/services/network/web_socket_impl.h
@@ -5,7 +5,6 @@
#ifndef MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
#define MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
-#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/public/cpp/bindings/interface_impl.h"
#include "mojo/services/public/interfaces/network/web_socket.mojom.h"
@@ -31,12 +30,12 @@
Array<String> protocols,
const String& origin,
ScopedDataPipeConsumerHandle send_stream,
- WebSocketClientPtr client) OVERRIDE;
+ WebSocketClientPtr client) override;
virtual void Send(bool fin,
WebSocket::MessageType type,
- uint32_t num_bytes) OVERRIDE;
- virtual void FlowControl(int64_t quota) OVERRIDE;
- virtual void Close(uint16_t code, const String& reason) OVERRIDE;
+ uint32_t num_bytes) override;
+ virtual void FlowControl(int64_t quota) override;
+ virtual void Close(uint16_t code, const String& reason) override;
// Called with the data to send once it has been read from |send_stream_|.
void DidReadFromSendStream(bool fin,
diff --git a/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h b/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h
index cd5be0f..15c1c48 100644
--- a/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h
+++ b/mojo/services/public/cpp/input_events/lib/mojo_extended_key_event_data.h
@@ -24,7 +24,7 @@
uint16_t unmodified_text() const { return unmodified_text_; }
// ui::ExtendedKeyEventData:
- virtual ui::ExtendedKeyEventData* Clone() const OVERRIDE;
+ virtual ui::ExtendedKeyEventData* Clone() const override;
private:
const int32_t windows_key_code_;
diff --git a/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc b/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
index dee0996..9d5bd0a 100644
--- a/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
+++ b/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
@@ -360,8 +360,7 @@
const cc::SharedQuadState* last_sqs = nullptr;
cc::SharedQuadStateList::ConstIterator next_sqs_iter =
input.shared_quad_state_list.begin();
- for (cc::QuadList::ConstIterator iter = input.quad_list.begin();
- iter != input.quad_list.end();
+ for (auto iter = input.quad_list.cbegin(); iter != input.quad_list.cend();
++iter) {
const cc::DrawQuad& quad = *iter;
quads[iter.index()] = Quad::From(quad);
diff --git a/mojo/services/public/cpp/surfaces/tests/BUILD.gn b/mojo/services/public/cpp/surfaces/tests/BUILD.gn
index 10810fe..4211eff 100644
--- a/mojo/services/public/cpp/surfaces/tests/BUILD.gn
+++ b/mojo/services/public/cpp/surfaces/tests/BUILD.gn
@@ -10,17 +10,17 @@
"//cc",
"//cc/surfaces",
"//gpu",
+ "//mojo/edk/test:run_all_unittests",
+ "//mojo/environment:chromium",
+ "//mojo/services/public/cpp/geometry",
+ "//mojo/services/public/cpp/surfaces",
+ "//mojo/services/public/interfaces/geometry",
+ "//mojo/services/public/interfaces/surfaces",
"//skia",
"//testing/gtest",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/gfx:test_support",
- "//mojo/environment:chromium",
- "//mojo/services/public/interfaces/surfaces",
- "//mojo/services/public/interfaces/geometry",
- "//mojo/services/public/cpp/geometry",
- "//mojo/services/public/cpp/surfaces",
- "//mojo/common/test:run_all_unittests",
]
sources = [ "surface_unittest.cc" ]
diff --git a/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc b/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
index bf04195..9076e5f 100644
--- a/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
+++ b/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
@@ -317,31 +317,31 @@
EXPECT_EQ(opacity, round_trip_sqs->opacity);
EXPECT_EQ(sorting_context_id, round_trip_sqs->sorting_context_id);
- cc::QuadList::Iterator dq_iter = round_trip_pass->quad_list.begin();
+ cc::DrawQuad* round_trip_quad = round_trip_pass->quad_list.front();
// First is solid color quad.
- ASSERT_EQ(cc::DrawQuad::SOLID_COLOR, dq_iter->material);
- EXPECT_EQ(rect, dq_iter->rect);
- EXPECT_EQ(opaque_rect, dq_iter->opaque_rect);
- EXPECT_EQ(visible_rect, dq_iter->visible_rect);
- EXPECT_EQ(needs_blending, dq_iter->needs_blending);
+ ASSERT_EQ(cc::DrawQuad::SOLID_COLOR, round_trip_quad->material);
+ EXPECT_EQ(rect, round_trip_quad->rect);
+ EXPECT_EQ(opaque_rect, round_trip_quad->opaque_rect);
+ EXPECT_EQ(visible_rect, round_trip_quad->visible_rect);
+ EXPECT_EQ(needs_blending, round_trip_quad->needs_blending);
const cc::SolidColorDrawQuad* round_trip_color_quad =
- cc::SolidColorDrawQuad::MaterialCast(&*dq_iter);
+ cc::SolidColorDrawQuad::MaterialCast(round_trip_quad);
EXPECT_EQ(arbitrary_color, round_trip_color_quad->color);
EXPECT_EQ(force_anti_aliasing_off,
round_trip_color_quad->force_anti_aliasing_off);
- ++dq_iter;
+ round_trip_quad = round_trip_pass->quad_list.ElementAt(1);
// Second is surface quad.
- ASSERT_EQ(cc::DrawQuad::SURFACE_CONTENT, dq_iter->material);
+ ASSERT_EQ(cc::DrawQuad::SURFACE_CONTENT, round_trip_quad->material);
const cc::SurfaceDrawQuad* round_trip_surface_quad =
- cc::SurfaceDrawQuad::MaterialCast(&*dq_iter);
+ cc::SurfaceDrawQuad::MaterialCast(round_trip_quad);
EXPECT_EQ(arbitrary_id, round_trip_surface_quad->surface_id);
- ++dq_iter;
+ round_trip_quad = round_trip_pass->quad_list.ElementAt(2);
// Third is texture quad.
- ASSERT_EQ(cc::DrawQuad::TEXTURE_CONTENT, dq_iter->material);
+ ASSERT_EQ(cc::DrawQuad::TEXTURE_CONTENT, round_trip_quad->material);
const cc::TextureDrawQuad* round_trip_texture_quad =
- cc::TextureDrawQuad::MaterialCast(&*dq_iter);
+ cc::TextureDrawQuad::MaterialCast(round_trip_quad);
EXPECT_EQ(resource_id, round_trip_texture_quad->resource_id);
EXPECT_EQ(premultiplied_alpha, round_trip_texture_quad->premultiplied_alpha);
EXPECT_EQ(uv_top_left, round_trip_texture_quad->uv_top_left);
diff --git a/mojo/services/public/cpp/view_manager/BUILD.gn b/mojo/services/public/cpp/view_manager/BUILD.gn
index cab9b73..a505893 100644
--- a/mojo/services/public/cpp/view_manager/BUILD.gn
+++ b/mojo/services/public/cpp/view_manager/BUILD.gn
@@ -5,8 +5,6 @@
# GYP version: mojo/mojo_services.gypi:mojo_view_manager_lib
source_set("view_manager") {
sources = [
- "lib/bitmap_uploader.cc",
- "lib/bitmap_uploader.h",
"lib/view.cc",
"lib/view_manager_client_factory.cc",
"lib/view_manager_client_impl.cc",
@@ -26,12 +24,9 @@
public_deps = [
":common",
- "//skia",
]
deps = [
"//base",
- "//cc/surfaces",
- "//gpu",
"//mojo/application",
"//mojo/public/c/gles2",
"//mojo/public/cpp/bindings:bindings",
@@ -39,16 +34,10 @@
"//mojo/services/public/cpp/geometry",
"//mojo/services/public/cpp/surfaces",
"//mojo/services/public/interfaces/geometry",
- "//mojo/services/public/interfaces/gpu",
"//mojo/services/public/interfaces/input_events:input_events",
- "//mojo/services/public/interfaces/native_viewport",
"//mojo/services/public/interfaces/surfaces:surface_id",
- "//mojo/services/public/interfaces/surfaces",
"//mojo/services/public/interfaces/view_manager",
"//mojo/services/public/interfaces/window_manager",
- "//skia",
- "//ui/events",
- "//ui/gfx",
"//ui/gfx/geometry",
]
}
diff --git a/mojo/services/public/cpp/view_manager/DEPS b/mojo/services/public/cpp/view_manager/DEPS
index 4460c19..8ce1d20 100644
--- a/mojo/services/public/cpp/view_manager/DEPS
+++ b/mojo/services/public/cpp/view_manager/DEPS
@@ -1,4 +1,3 @@
include_rules = [
- "+third_party/skia/include/core",
"+ui/gfx/geometry"
]
diff --git a/mojo/services/public/cpp/view_manager/lib/DEPS b/mojo/services/public/cpp/view_manager/lib/DEPS
index 0af5fad..35adfd8 100644
--- a/mojo/services/public/cpp/view_manager/lib/DEPS
+++ b/mojo/services/public/cpp/view_manager/lib/DEPS
@@ -1,11 +1,5 @@
include_rules = [
- "+cc/surfaces/surface_id.h",
- "+cc/surfaces/surface_id_allocator.h",
- "+gpu/GLES2",
- "+gpu/command_buffer/common/mailbox.h",
"+mojo/geometry",
- "+third_party/khronos/GLES2",
- "+third_party/skia",
"+ui/gfx",
]
diff --git a/mojo/services/public/cpp/view_manager/lib/view.cc b/mojo/services/public/cpp/view_manager/lib/view.cc
index fe45ffc..d0c86e0 100644
--- a/mojo/services/public/cpp/view_manager/lib/view.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view.cc
@@ -4,16 +4,10 @@
#include "mojo/services/public/cpp/view_manager/view.h"
-#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/cpp/application/service_provider_impl.h"
-#include "mojo/public/interfaces/application/shell.mojom.h"
-#include "mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h"
#include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h"
#include "mojo/services/public/cpp/view_manager/lib/view_private.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
-#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
-#include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h"
-#include "ui/gfx/canvas.h"
namespace mojo {
@@ -318,24 +312,6 @@
}
}
-void View::SetContents(const SkBitmap& contents) {
- if (manager_) {
- if (!bitmap_uploader_)
- CreateBitmapUploader();
- bitmap_uploader_->SetSize(bounds_.size());
- bitmap_uploader_->SetBitmap(contents);
- }
-}
-
-void View::SetColor(SkColor color) {
- if (manager_) {
- if (!bitmap_uploader_)
- CreateBitmapUploader();
- bitmap_uploader_->SetSize(bounds_.size());
- bitmap_uploader_->SetColor(color);
- }
-}
-
void View::SetFocus() {
if (manager_)
static_cast<ViewManagerClientImpl*>(manager_)->SetFocus(id_);
@@ -437,20 +413,4 @@
FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanged(this));
}
-void View::CreateBitmapUploader() {
- ViewManagerClientImpl* vmci = static_cast<ViewManagerClientImpl*>(manager_);
- SurfacesServicePtr surfaces_service;
- InterfacePtr<ServiceProvider> surfaces_service_provider;
- vmci->shell()->ConnectToApplication("mojo:mojo_surfaces_service",
- Get(&surfaces_service_provider));
- ConnectToService(surfaces_service_provider.get(), &surfaces_service);
- GpuPtr gpu_service;
- InterfacePtr<ServiceProvider> gpu_service_provider;
- vmci->shell()->ConnectToApplication("mojo:mojo_native_viewport_service",
- Get(&gpu_service_provider));
- ConnectToService(gpu_service_provider.get(), &gpu_service);
- bitmap_uploader_.reset(new BitmapUploader(
- vmci, id_, surfaces_service.Pass(), gpu_service.Pass()));
-}
-
} // namespace mojo
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
index 19955b2..7a3005a 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.cc
@@ -18,8 +18,6 @@
#include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
#include "mojo/services/public/cpp/view_manager/window_manager_delegate.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/gfx/codec/png_codec.h"
namespace mojo {
@@ -80,7 +78,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewDestroyed(View* view) OVERRIDE {
+ virtual void OnViewDestroyed(View* view) override {
DCHECK_EQ(view, root_);
static_cast<ViewManagerClientImpl*>(
ViewPrivate(root_).view_manager())->RemoveRoot(root_);
@@ -99,8 +97,7 @@
connection_id_(0),
next_id_(1),
delegate_(delegate),
- window_manager_delegate_(NULL),
- shell_(shell) {
+ window_manager_delegate_(NULL) {
// TODO(beng): Come up with a better way of establishing a configuration for
// what the active window manager is.
std::string window_manager_url = "mojo:mojo_window_manager";
@@ -110,7 +107,7 @@
"window-manager");
}
InterfacePtr<ServiceProvider> sp;
- shell->ConnectToApplication(window_manager_url, Get(&sp));
+ shell->ConnectToApplication(window_manager_url, GetProxy(&sp));
ConnectToService(sp.get(), &window_manager_);
window_manager_.set_client(this);
}
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
index bd09a58..e2dab1d 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
@@ -16,13 +16,11 @@
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
#include "mojo/services/public/interfaces/window_manager/window_manager.mojom.h"
-class SkBitmap;
-
namespace mojo {
+class Shell;
class ViewManager;
class ViewManagerDelegate;
class ViewManagerTransaction;
-class Shell;
// Manages the connection with the View Manager service.
class ViewManagerClientImpl : public ViewManager,
@@ -73,8 +71,6 @@
void AddView(View* view);
void RemoveView(Id view_id);
- Shell* shell() { return shell_; }
-
private:
friend class RootObserver;
@@ -82,57 +78,55 @@
// Overridden from ViewManager:
virtual void SetWindowManagerDelegate(
- WindowManagerDelegate* delegate) OVERRIDE;
- virtual void DispatchEvent(View* target, EventPtr event) OVERRIDE;
- virtual const std::string& GetEmbedderURL() const OVERRIDE;
- virtual const std::vector<View*>& GetRoots() const OVERRIDE;
- virtual View* GetViewById(Id id) OVERRIDE;
+ WindowManagerDelegate* delegate) override;
+ virtual void DispatchEvent(View* target, EventPtr event) override;
+ virtual const std::string& GetEmbedderURL() const override;
+ virtual const std::vector<View*>& GetRoots() const override;
+ virtual View* GetViewById(Id id) override;
// Overridden from InterfaceImpl:
- virtual void OnConnectionEstablished() OVERRIDE;
+ virtual void OnConnectionEstablished() override;
// Overridden from ViewManagerClient:
virtual void OnEmbed(ConnectionSpecificId connection_id,
const String& creator_url,
ViewDataPtr root,
- InterfaceRequest<ServiceProvider> services) OVERRIDE;
+ InterfaceRequest<ServiceProvider> services) override;
virtual void OnViewBoundsChanged(Id view_id,
RectPtr old_bounds,
- RectPtr new_bounds) OVERRIDE;
+ RectPtr new_bounds) override;
virtual void OnViewHierarchyChanged(Id view_id,
Id new_parent_id,
Id old_parent_id,
- Array<ViewDataPtr> views) OVERRIDE;
+ Array<ViewDataPtr> views) override;
virtual void OnViewReordered(Id view_id,
Id relative_view_id,
- OrderDirection direction) OVERRIDE;
- virtual void OnViewDeleted(Id view_id) OVERRIDE;
- virtual void OnViewVisibilityChanged(Id view_id, bool visible) OVERRIDE;
- virtual void OnViewDrawnStateChanged(Id view_id, bool drawn) OVERRIDE;
+ OrderDirection direction) override;
+ virtual void OnViewDeleted(Id view_id) override;
+ virtual void OnViewVisibilityChanged(Id view_id, bool visible) override;
+ virtual void OnViewDrawnStateChanged(Id view_id, bool drawn) override;
virtual void OnViewInputEvent(Id view_id,
EventPtr event,
- const Callback<void()>& callback) OVERRIDE;
+ const Callback<void()>& callback) override;
virtual void Embed(
const String& url,
- InterfaceRequest<ServiceProvider> service_provider) OVERRIDE;
- virtual void DispatchOnViewInputEvent(EventPtr event) OVERRIDE;
+ InterfaceRequest<ServiceProvider> service_provider) override;
+ virtual void DispatchOnViewInputEvent(EventPtr event) override;
// Overridden from WindowManagerClient:
- virtual void OnWindowManagerReady() OVERRIDE;
+ virtual void OnWindowManagerReady() override;
virtual void OnCaptureChanged(Id old_capture_view_id,
- Id new_capture_view_id) OVERRIDE;
+ Id new_capture_view_id) override;
virtual void OnFocusChanged(Id old_focused_view_id,
- Id new_focused_view_id) OVERRIDE;
+ Id new_focused_view_id) override;
virtual void OnActiveWindowChanged(Id old_focused_window,
- Id new_focused_window) OVERRIDE;
+ Id new_focused_window) override;
void RemoveRoot(View* root);
void OnActionCompleted(bool success);
void OnActionCompletedWithErrorCode(ErrorCode code);
- BitmapUploader* BitmapUploaderForView(Id view_id);
-
base::Callback<void(bool)> ActionCompletedCallback();
base::Callback<void(ErrorCode)> ActionCompletedCallbackWithErrorCode();
@@ -155,10 +149,6 @@
WindowManagerServicePtr window_manager_;
- // TODO(jamesr): Remove once all callers switch from SetContents to
- // SetSurfaceId.
- Shell* shell_;
-
DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl);
};
diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h b/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h
index e073bbd..28d3c24 100644
--- a/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h
+++ b/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h
@@ -15,7 +15,7 @@
virtual ~ViewManagerTestSuite();
protected:
- virtual void Initialize() OVERRIDE;
+ virtual void Initialize() override;
private:
DISALLOW_COPY_AND_ASSIGN(ViewManagerTestSuite);
diff --git a/mojo/services/public/cpp/view_manager/tests/BUILD.gn b/mojo/services/public/cpp/view_manager/tests/BUILD.gn
index a468a92..9b7fb67 100644
--- a/mojo/services/public/cpp/view_manager/tests/BUILD.gn
+++ b/mojo/services/public/cpp/view_manager/tests/BUILD.gn
@@ -28,6 +28,6 @@
if (use_aura) {
deps += [ "//mojo/services/public/cpp/view_manager/lib:run_unittests" ]
} else {
- deps += [ "//mojo/common/test:run_all_unittests" ]
+ deps += [ "//mojo/edk/test:run_all_unittests" ]
}
}
diff --git a/mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc b/mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc
index 693e91a..7358fe8 100644
--- a/mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc
+++ b/mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc
@@ -61,7 +61,7 @@
// Overridden from ApplicationLoader:
virtual void Load(ApplicationManager* manager,
const GURL& url,
- scoped_refptr<LoadCallbacks> callbacks) OVERRIDE {
+ scoped_refptr<LoadCallbacks> callbacks) override {
ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication();
if (!shell_handle.is_valid())
return;
@@ -71,10 +71,10 @@
}
virtual void OnApplicationError(ApplicationManager* manager,
- const GURL& url) OVERRIDE {}
+ const GURL& url) override {}
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
- OVERRIDE {
+ override {
connection->AddService(view_manager_client_factory_.get());
return true;
}
@@ -83,10 +83,10 @@
virtual void OnEmbed(ViewManager* view_manager,
View* root,
ServiceProviderImpl* exported_services,
- scoped_ptr<ServiceProvider> imported_services) OVERRIDE {
+ scoped_ptr<ServiceProvider> imported_services) override {
callback_.Run(view_manager, root);
}
- virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE {}
+ virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {}
ScopedVector<ApplicationImpl> apps_;
LoadedCallback callback_;
@@ -104,7 +104,7 @@
// Overridden from ViewObserver:
virtual void OnViewBoundsChanged(View* view,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
DCHECK_EQ(view, view_);
QuitRunLoop();
}
@@ -137,7 +137,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnTreeChanged(const TreeChangeParams& params) OVERRIDE {
+ virtual void OnTreeChanged(const TreeChangeParams& params) override {
if (IsTreeCorrectSize())
QuitRunLoop();
}
@@ -174,7 +174,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewDestroyed(View* view) OVERRIDE {
+ virtual void OnViewDestroyed(View* view) override {
std::set<Id>::iterator it = views_->find(view->id());
if (it != views_->end())
views_->erase(it);
@@ -216,7 +216,7 @@
// Overridden from ViewObserver:
virtual void OnViewReordered(View* view,
View* relative_view,
- OrderDirection direction) OVERRIDE {
+ OrderDirection direction) override {
DCHECK_EQ(view, view_);
QuitRunLoop();
}
@@ -246,7 +246,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewDestroyed(View* view) OVERRIDE {
+ virtual void OnViewDestroyed(View* view) override {
DCHECK_EQ(view, view_);
view_ = NULL;
}
@@ -302,7 +302,7 @@
private:
// Overridden from testing::Test:
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ConnectApplicationLoader::LoadedCallback ready_callback = base::Bind(
&ViewManagerTest::OnViewManagerLoaded, base::Unretained(this));
test_helper_.Init();
@@ -539,7 +539,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewVisibilityChanged(View* view) OVERRIDE {
+ virtual void OnViewVisibilityChanged(View* view) override {
EXPECT_EQ(view, view_);
QuitRunLoop();
}
@@ -601,7 +601,7 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewDrawnChanged(View* view) OVERRIDE {
+ virtual void OnViewDrawnChanged(View* view) override {
EXPECT_EQ(view, view_);
QuitRunLoop();
}
diff --git a/mojo/services/public/cpp/view_manager/tests/view_unittest.cc b/mojo/services/public/cpp/view_manager/tests/view_unittest.cc
index 3f08075..ab8ef88 100644
--- a/mojo/services/public/cpp/view_manager/tests/view_unittest.cc
+++ b/mojo/services/public/cpp/view_manager/tests/view_unittest.cc
@@ -131,10 +131,10 @@
private:
// Overridden from ViewObserver:
- virtual void OnTreeChanging(const TreeChangeParams& params) OVERRIDE {
+ virtual void OnTreeChanging(const TreeChangeParams& params) override {
received_params_.push_back(params);
}
- virtual void OnTreeChanged(const TreeChangeParams& params) OVERRIDE {
+ virtual void OnTreeChanged(const TreeChangeParams& params) override {
received_params_.push_back(params);
}
@@ -367,13 +367,13 @@
// Overridden from ViewObserver:
virtual void OnViewReordering(View* view,
View* relative_view,
- OrderDirection direction) OVERRIDE {
+ OrderDirection direction) override {
OnViewReordered(view, relative_view, direction);
}
virtual void OnViewReordered(View* view,
View* relative_view,
- OrderDirection direction) OVERRIDE {
+ OrderDirection direction) override {
Change change;
change.view = view;
change.relative_view = relative_view;
@@ -514,7 +514,7 @@
// Overridden from ViewObserver:
virtual void OnViewBoundsChanging(View* view,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
changes_.push_back(
base::StringPrintf(
"view=%s old_bounds=%s new_bounds=%s phase=changing",
@@ -524,7 +524,7 @@
}
virtual void OnViewBoundsChanged(View* view,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {
+ const gfx::Rect& new_bounds) override {
changes_.push_back(
base::StringPrintf(
"view=%s old_bounds=%s new_bounds=%s phase=changed",
@@ -575,13 +575,13 @@
private:
// Overridden from ViewObserver:
- virtual void OnViewVisibilityChanging(View* view) OVERRIDE {
+ virtual void OnViewVisibilityChanging(View* view) override {
changes_.push_back(
base::StringPrintf("view=%s phase=changing visibility=%s",
ViewIdToString(view->id()).c_str(),
view->visible() ? "true" : "false"));
}
- virtual void OnViewVisibilityChanged(View* view) OVERRIDE {
+ virtual void OnViewVisibilityChanged(View* view) override {
changes_.push_back(base::StringPrintf("view=%s phase=changed visibility=%s",
ViewIdToString(view->id()).c_str(),
view->visible() ? "true" : "false"));
diff --git a/mojo/services/public/cpp/view_manager/view.h b/mojo/services/public/cpp/view_manager/view.h
index f7afa49..a7161ea 100644
--- a/mojo/services/public/cpp/view_manager/view.h
+++ b/mojo/services/public/cpp/view_manager/view.h
@@ -14,14 +14,10 @@
#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
#include "mojo/services/public/interfaces/view_manager/view_manager_constants.mojom.h"
-#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/rect.h"
-class SkBitmap;
-
namespace mojo {
-class BitmapUploader;
class ServiceProviderImpl;
class View;
class ViewManager;
@@ -79,10 +75,6 @@
void SetSurfaceId(SurfaceIdPtr id);
- // TODO(beng): temporary only.
- void SetContents(const SkBitmap& contents);
- void SetColor(SkColor color);
-
// Focus.
void SetFocus();
@@ -110,7 +102,6 @@
bool LocalReorder(View* relative, OrderDirection direction);
void LocalSetBounds(const gfx::Rect& old_bounds, const gfx::Rect& new_bounds);
void LocalSetDrawn(bool drawn);
- void CreateBitmapUploader();
ViewManager* manager_;
Id id_;
@@ -127,10 +118,6 @@
// state. This field is only used if the view has no parent (eg it's a root).
bool drawn_;
- // TODO(jamesr): Temporary, remove when all clients are using surfaces
- // directly.
- scoped_ptr<BitmapUploader> bitmap_uploader_;
-
DISALLOW_COPY_AND_ASSIGN(View);
};
diff --git a/mojo/services/public/interfaces/network/net_address.mojom b/mojo/services/public/interfaces/network/net_address.mojom
index 337f251..a358e9e 100644
--- a/mojo/services/public/interfaces/network/net_address.mojom
+++ b/mojo/services/public/interfaces/network/net_address.mojom
@@ -26,6 +26,7 @@
struct NetAddress {
NetAddressFamily family = UNSPECIFIED;
+
// At most one of the following fields is non-NULL depending on the value of
// |family|.
NetAddressIPv4? ipv4;
diff --git a/mojo/services/public/interfaces/network/udp_socket.mojom b/mojo/services/public/interfaces/network/udp_socket.mojom
index b5b848d..526a454 100644
--- a/mojo/services/public/interfaces/network/udp_socket.mojom
+++ b/mojo/services/public/interfaces/network/udp_socket.mojom
@@ -13,8 +13,9 @@
// - (optional) Set options which are allowed prior to Bind().
// - Bind the socket.
// - (optional) Set options which are allowed after Bind().
-// - Send / request to receive packets. Received packets will be delivered to
-// UDPSocketClient.OnReceived().
+// - Send / request to receive datagrams. Received datagrams will be delivered
+// to UDPSocketClient.OnReceived().
+
[Client=UDPSocketClient]
interface UDPSocket {
// Allows the socket to share the local address to which it will be bound with
@@ -28,47 +29,80 @@
// returned in |bound_addr|.
Bind(NetAddress addr) => (NetworkError result, NetAddress? bound_addr);
- // Sets the send buffer size (in bytes) for the socket. The socket must be
+ // Sets the OS send buffer size (in bytes) for the socket. The socket must be
// bound.
- //
- // Note: This is only treated as a hint. Even if it succeeds, the service
- // doesn't guarantee it will conform to the size.
SetSendBufferSize(uint32 size) => (NetworkError result);
- // Sets the receive buffer size (in bytes) for the socket. The socket must be
- // bound.
- //
- // Note: This is only treated as a hint. Even if it succeeds, the service
- // doesn't guarantee it will conform to the size.
+ // Sets the OS receive buffer size (in bytes) for the socket. The socket must
+ // be bound.
SetReceiveBufferSize(uint32 size) => (NetworkError result);
- // Notifies that the client is ready to accept |number| of packets.
+ // Negotiates the maximum number of pending SendTo() requests. If
+ // |requested_size| is set to 0, this method queries the current settings.
+ //
+ // The service stores SendTo() requests in a queue while they are waiting to
+ // be executed (i.e., while they are waiting to be placed in the OS send
+ // buffer and sent out). This method negotiates how many requests (not bytes)
+ // this queue is able to store. If the queue is full, the service fails new
+ // requests directly with error code ERR_INSUFFICIENT_RESOURCES and discards
+ // those datagrams. If the client wants to avoid such failures, it needs to
+ // keep track of how many SendTo() calls are pending and make sure the number
+ // doesn't exceed the result of this method.
+ NegotiateMaxPendingSendRequests(uint32 requested_size)
+ => (uint32 actual_size);
+
+ // Notifies that the client is ready to accept |number| of datagrams.
// Correspondingly, OnReceived() of the UDPSocketClient interface will be
// called |number| times (errors also count), unless the connection is closed
// before that. The socket must be bound.
//
// It is allowed to call this method again before the previous request is
// completely satisfied. For example:
- // service->ReceiveMorePackets(3);
+ // service->ReceiveMore(3);
// ...
// // OnReceived() is called.
// // OnReceived() is called.
// ...
- // service->ReceiveMorePackets(3);
+ // service->ReceiveMore(3);
// // The client expects 4 more calls to OnReceived().
- ReceiveMorePackets(uint32 number);
+ //
+ // Please note that how ReceiveMore() is used will affect performance
+ // significantly. For example:
+ // // Approach 1:
+ // service->ReceiveMore(3);
+ // // OnReceived() is called.
+ // // OnReceived() is called.
+ // // OnReceived() is called.
+ //
+ // // Approach 2:
+ // service->ReceiveMore(1);
+ // // OnReceived() is called.
+ // service->ReceiveMore(1);
+ // // OnReceived() is called.
+ // service->ReceiveMore(1);
+ // // OnReceived() is called.
+ //
+ // It is very likely that approach 1 will perform better than approach 2,
+ // because in approach 2 getting every datagram takes at least the time of a
+ // round trip to the service side.
+ ReceiveMore(uint32 datagram_number);
// Sends data to the specified destination. The socket must be bound.
- // The method doesn't report the result of the operation.
- SendToAndForget(NetAddress addr, array<uint8> data);
-
- // Sends data to the specified destination. The socket must be bound.
- SendTo(NetAddress addr, array<uint8> data) => (NetworkError result);
+ // On success, |result.code| is a non-negative number indicating how many
+ // bytes have been written. Otherwise, it is a network error code, including
+ // (but not limited to):
+ // - ERR_INSUFFICIENT_RESOURCES (-12): The service doesn't have sufficient
+ // resource to complete the operation. One possible cause is that the client
+ // tries to send too many datagrams in a short period of time.
+ // TODO(yzshen): Formalize Mojo networking error codes.
+ SendTo(NetAddress dest_addr, array<uint8> data) => (NetworkError result);
};
interface UDPSocketClient {
- // |addr| and |data| are non-NULL on success.
- OnReceived(NetworkError result, NetAddress? addr, array<uint8>? data);
+ // On success, |src_addr| and |data| are non-NULL, and |result.code| is a
+ // non-negative number indicating how many bytes have been received. On
+ // failure, |result.code| is a network error code.
+ OnReceived(NetworkError result, NetAddress? src_addr, array<uint8>? data);
};
}
diff --git a/mojo/services/public/mojo_services_public.gyp b/mojo/services/public/mojo_services_public.gyp
new file mode 100644
index 0000000..e5de1af
--- /dev/null
+++ b/mojo/services/public/mojo_services_public.gyp
@@ -0,0 +1,261 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../mojo_variables.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'mojo_services_public',
+ 'type': 'none',
+ 'dependencies': [
+ 'mojo_clipboard_bindings',
+ 'mojo_content_handler_bindings',
+ 'mojo_core_window_manager_bindings',
+ 'mojo_geometry_bindings',
+ 'mojo_gpu_bindings',
+ 'mojo_input_events_bindings',
+ 'mojo_native_viewport_bindings',
+ 'mojo_navigation_bindings',
+ 'mojo_network_bindings',
+ 'mojo_surface_id_bindings',
+ 'mojo_surfaces_bindings',
+ 'mojo_view_manager_bindings',
+ 'mojo_view_manager_common',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/clipboard
+ 'target_name': 'mojo_clipboard_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/clipboard/clipboard.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/input_events
+ 'target_name': 'mojo_input_events_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/input_events/input_event_constants.mojom',
+ 'interfaces/input_events/input_events.mojom',
+ 'interfaces/input_events/input_key_codes.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_geometry_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/geometry
+ 'target_name': 'mojo_geometry_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/geometry/geometry.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/gpu
+ 'target_name': 'mojo_gpu_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/gpu/command_buffer.mojom',
+ 'interfaces/gpu/gpu.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_geometry_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/native_viewport
+ 'target_name': 'mojo_native_viewport_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/native_viewport/native_viewport.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_geometry_bindings',
+ 'mojo_gpu_bindings',
+ 'mojo_input_events_bindings',
+ 'mojo_surface_id_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_bindings',
+ 'mojo_gpu_bindings',
+ 'mojo_input_events_bindings',
+ 'mojo_surface_id_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/navigation
+ 'target_name': 'mojo_navigation_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/navigation/navigation.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'dependencies': [
+ 'mojo_network_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/content_handler
+ 'target_name': 'mojo_content_handler_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/content_handler/content_handler.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'dependencies': [
+ 'mojo_network_bindings',
+ '../../public/mojo_public.gyp:mojo_application_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/network
+ 'target_name': 'mojo_network_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/network/cookie_store.mojom',
+ 'interfaces/network/net_address.mojom',
+ 'interfaces/network/network_error.mojom',
+ 'interfaces/network/network_service.mojom',
+ 'interfaces/network/tcp_bound_socket.mojom',
+ 'interfaces/network/tcp_client_socket.mojom',
+ 'interfaces/network/tcp_server_socket.mojom',
+ 'interfaces/network/udp_socket.mojom',
+ 'interfaces/network/url_loader.mojom',
+ 'interfaces/network/web_socket.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'dependencies': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/cpp/view_manager:common
+ 'target_name': 'mojo_view_manager_common',
+ 'type': 'static_library',
+ 'sources': [
+ 'cpp/view_manager/types.h',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/view_manager
+ 'target_name': 'mojo_view_manager_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/view_manager/view_manager.mojom',
+ 'interfaces/view_manager/view_manager_constants.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_geometry_bindings',
+ 'mojo_input_events_bindings',
+ 'mojo_surface_id_bindings',
+ '../../public/mojo_public.gyp:mojo_application_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_bindings',
+ 'mojo_input_events_bindings',
+ 'mojo_surface_id_bindings',
+ '../../public/mojo_public.gyp:mojo_application_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/surfaces
+ 'target_name': 'mojo_surfaces_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/surfaces/surfaces.mojom',
+ 'interfaces/surfaces/surfaces_service.mojom',
+ 'interfaces/surfaces/quads.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ 'mojo_geometry_bindings',
+ 'mojo_gpu_bindings',
+ 'mojo_surface_id_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ 'mojo_geometry_bindings',
+ 'mojo_surface_id_bindings',
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/surfaces:surface_id
+ 'target_name': 'mojo_surface_id_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/surfaces/surface_id.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'dependencies': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ {
+ # GN version: //mojo/services/public/interfaces/window_manager
+ 'target_name': 'mojo_core_window_manager_bindings',
+ 'type': 'static_library',
+ 'sources': [
+ 'interfaces/window_manager/window_manager.mojom',
+ ],
+ 'includes': [ '../../public/tools/bindings/mojom_bindings_generator.gypi' ],
+ 'export_dependent_settings': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ 'dependencies': [
+ '../../public/mojo_public.gyp:mojo_cpp_bindings',
+ ],
+ },
+ ],
+}
diff --git a/mojo/services/surfaces/surfaces_impl.h b/mojo/services/surfaces/surfaces_impl.h
index 5ee6161..c074834 100644
--- a/mojo/services/surfaces/surfaces_impl.h
+++ b/mojo/services/surfaces/surfaces_impl.h
@@ -5,7 +5,6 @@
#ifndef MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
#define MOJO_SERVICES_SURFACES_SURFACES_IMPL_H_
-#include "base/compiler_specific.h"
#include "cc/surfaces/display_client.h"
#include "cc/surfaces/surface_factory.h"
#include "cc/surfaces/surface_factory_client.h"
@@ -38,25 +37,25 @@
virtual ~SurfacesImpl();
// Surface implementation.
- virtual void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) OVERRIDE;
- virtual void SubmitFrame(SurfaceIdPtr id, FramePtr frame) OVERRIDE;
- virtual void DestroySurface(SurfaceIdPtr id) OVERRIDE;
+ virtual void CreateSurface(SurfaceIdPtr id, mojo::SizePtr size) override;
+ virtual void SubmitFrame(SurfaceIdPtr id, FramePtr frame) override;
+ virtual void DestroySurface(SurfaceIdPtr id) override;
virtual void CreateGLES2BoundSurface(CommandBufferPtr gles2_client,
SurfaceIdPtr id,
- mojo::SizePtr size) OVERRIDE;
+ mojo::SizePtr size) override;
// SurfaceFactoryClient implementation.
virtual void ReturnResources(
- const cc::ReturnedResourceArray& resources) OVERRIDE;
+ const cc::ReturnedResourceArray& resources) override;
// DisplayClient implementation.
- virtual void DisplayDamaged() OVERRIDE;
- virtual void DidSwapBuffers() OVERRIDE;
- virtual void DidSwapBuffersComplete() OVERRIDE;
+ virtual void DisplayDamaged() override;
+ virtual void DidSwapBuffers() override;
+ virtual void DidSwapBuffersComplete() override;
virtual void CommitVSyncParameters(base::TimeTicks timebase,
- base::TimeDelta interval) OVERRIDE;
- virtual void OutputSurfaceLost() OVERRIDE;
- virtual void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) OVERRIDE;
+ base::TimeDelta interval) override;
+ virtual void OutputSurfaceLost() override;
+ virtual void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override;
cc::SurfaceFactory* factory() { return &factory_; }
diff --git a/mojo/services/surfaces/surfaces_service_application.h b/mojo/services/surfaces/surfaces_service_application.h
index 27fd621..c2fc8db 100644
--- a/mojo/services/surfaces/surfaces_service_application.h
+++ b/mojo/services/surfaces/surfaces_service_application.h
@@ -25,15 +25,15 @@
// ApplicationDelegate implementation.
virtual bool ConfigureIncomingConnection(
- ApplicationConnection* connection) OVERRIDE;
+ ApplicationConnection* connection) override;
// InterfaceFactory<SurfacsServicee> implementation.
virtual void Create(ApplicationConnection* connection,
- InterfaceRequest<SurfacesService> request) OVERRIDE;
+ InterfaceRequest<SurfacesService> request) override;
// SurfacesImpl::Client implementation.
- virtual void FrameSubmitted() OVERRIDE;
- virtual void SetDisplay(cc::Display*) OVERRIDE;
+ virtual void FrameSubmitted() override;
+ virtual void SetDisplay(cc::Display*) override;
private:
cc::SurfaceManager manager_;
diff --git a/mojo/services/surfaces/surfaces_service_impl.h b/mojo/services/surfaces/surfaces_service_impl.h
index 21dd185..a620872 100644
--- a/mojo/services/surfaces/surfaces_service_impl.h
+++ b/mojo/services/surfaces/surfaces_service_impl.h
@@ -26,7 +26,7 @@
// InterfaceImpl<SurfacesService> implementation.
virtual void CreateSurfaceConnection(const mojo::Callback<
- void(mojo::SurfacePtr, uint32_t)>& callback) OVERRIDE;
+ void(mojo::SurfacePtr, uint32_t)>& callback) override;
private:
cc::SurfaceManager* manager_;
diff --git a/mojo/services/view_manager/connection_manager.h b/mojo/services/view_manager/connection_manager.h
index c92fd69..36fc354 100644
--- a/mojo/services/view_manager/connection_manager.h
+++ b/mojo/services/view_manager/connection_manager.h
@@ -161,21 +161,21 @@
InterfaceRequest<ServiceProvider> service_provider);
// Overridden from ServerViewDelegate:
- virtual void OnViewDestroyed(const ServerView* view) OVERRIDE;
+ virtual void OnViewDestroyed(const ServerView* view) override;
virtual void OnWillChangeViewHierarchy(const ServerView* view,
const ServerView* new_parent,
- const ServerView* old_parent) OVERRIDE;
+ const ServerView* old_parent) override;
virtual void OnViewHierarchyChanged(const ServerView* view,
const ServerView* new_parent,
- const ServerView* old_parent) OVERRIDE;
+ const ServerView* old_parent) override;
virtual void OnViewBoundsChanged(const ServerView* view,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnViewSurfaceIdChanged(const ServerView* view) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnViewSurfaceIdChanged(const ServerView* view) override;
virtual void OnViewReordered(const ServerView* view,
const ServerView* relative,
- OrderDirection direction) OVERRIDE;
- virtual void OnWillChangeViewVisibility(const ServerView* view) OVERRIDE;
+ OrderDirection direction) override;
+ virtual void OnWillChangeViewVisibility(const ServerView* view) override;
ApplicationConnection* app_connection_;
diff --git a/mojo/services/view_manager/default_access_policy.h b/mojo/services/view_manager/default_access_policy.h
index 197736a..d8c0194 100644
--- a/mojo/services/view_manager/default_access_policy.h
+++ b/mojo/services/view_manager/default_access_policy.h
@@ -21,24 +21,24 @@
virtual ~DefaultAccessPolicy();
// AccessPolicy:
- virtual bool CanRemoveViewFromParent(const ServerView* view) const OVERRIDE;
+ virtual bool CanRemoveViewFromParent(const ServerView* view) const override;
virtual bool CanAddView(const ServerView* parent,
- const ServerView* child) const OVERRIDE;
+ const ServerView* child) const override;
virtual bool CanReorderView(const ServerView* view,
const ServerView* relative_view,
- OrderDirection direction) const OVERRIDE;
- virtual bool CanDeleteView(const ServerView* view) const OVERRIDE;
- virtual bool CanGetViewTree(const ServerView* view) const OVERRIDE;
+ OrderDirection direction) const override;
+ virtual bool CanDeleteView(const ServerView* view) const override;
+ virtual bool CanGetViewTree(const ServerView* view) const override;
virtual bool CanDescendIntoViewForViewTree(
- const ServerView* view) const OVERRIDE;
- virtual bool CanEmbed(const ServerView* view) const OVERRIDE;
- virtual bool CanChangeViewVisibility(const ServerView* view) const OVERRIDE;
- virtual bool CanSetViewSurfaceId(const ServerView* view) const OVERRIDE;
- virtual bool CanSetViewBounds(const ServerView* view) const OVERRIDE;
+ const ServerView* view) const override;
+ virtual bool CanEmbed(const ServerView* view) const override;
+ virtual bool CanChangeViewVisibility(const ServerView* view) const override;
+ virtual bool CanSetViewSurfaceId(const ServerView* view) const override;
+ virtual bool CanSetViewBounds(const ServerView* view) const override;
virtual bool ShouldNotifyOnHierarchyChange(
const ServerView* view,
const ServerView** new_parent,
- const ServerView** old_parent) const OVERRIDE;
+ const ServerView** old_parent) const override;
private:
bool IsViewInRoots(const ServerView* view) const;
diff --git a/mojo/services/view_manager/display_manager.h b/mojo/services/view_manager/display_manager.h
index 21009f3..8b95a57 100644
--- a/mojo/services/view_manager/display_manager.h
+++ b/mojo/services/view_manager/display_manager.h
@@ -54,13 +54,13 @@
void Draw();
// NativeViewportClient implementation.
- virtual void OnDestroyed() OVERRIDE;
- virtual void OnSizeChanged(SizePtr size) OVERRIDE;
+ virtual void OnDestroyed() override;
+ virtual void OnSizeChanged(SizePtr size) override;
virtual void OnEvent(EventPtr event,
- const mojo::Callback<void()>& callback) OVERRIDE;
+ const mojo::Callback<void()>& callback) override;
// SurfaceClient implementation.
- virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE;
+ virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override;
ConnectionManager* connection_manager_;
diff --git a/mojo/services/view_manager/main.cc b/mojo/services/view_manager/main.cc
index 86a7ba7..cd14dc0 100644
--- a/mojo/services/view_manager/main.cc
+++ b/mojo/services/view_manager/main.cc
@@ -19,7 +19,7 @@
virtual ~ViewManagerApp() {}
virtual bool ConfigureIncomingConnection(
- ApplicationConnection* connection) OVERRIDE {
+ ApplicationConnection* connection) override {
context_.ConfigureIncomingConnection(connection);
// TODO(sky): this needs some sort of authentication as well as making sure
// we only ever have one active at a time.
@@ -29,7 +29,7 @@
virtual void Create(
ApplicationConnection* connection,
- InterfaceRequest<ViewManagerInitService> request) OVERRIDE {
+ InterfaceRequest<ViewManagerInitService> request) override {
BindToRequest(new ViewManagerInitServiceImpl(connection, &context_),
&request);
}
diff --git a/mojo/services/view_manager/view_manager_init_service_context.cc b/mojo/services/view_manager/view_manager_init_service_context.cc
index 79a7067..bd93419 100644
--- a/mojo/services/view_manager/view_manager_init_service_context.cc
+++ b/mojo/services/view_manager/view_manager_init_service_context.cc
@@ -58,7 +58,7 @@
const String& url,
ServiceProviderPtr service_provider,
const Callback<void(bool)>& callback) {
- connection_manager_->EmbedRoot(url, Get(&service_provider));
+ connection_manager_->EmbedRoot(url, GetProxy(&service_provider));
callback.Run(true);
}
diff --git a/mojo/services/view_manager/view_manager_init_service_impl.h b/mojo/services/view_manager/view_manager_init_service_impl.h
index 49cc628..63fbc38 100644
--- a/mojo/services/view_manager/view_manager_init_service_impl.h
+++ b/mojo/services/view_manager/view_manager_init_service_impl.h
@@ -8,7 +8,6 @@
#include <string>
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
#include "mojo/services/view_manager/connection_manager.h"
#include "mojo/services/view_manager/view_manager_export.h"
@@ -41,7 +40,7 @@
// ViewManagerInitService overrides:
virtual void Embed(const String& url,
ServiceProviderPtr service_provider,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
ViewManagerInitServiceContext* context_;
diff --git a/mojo/services/view_manager/view_manager_service_impl.h b/mojo/services/view_manager/view_manager_service_impl.h
index 0295119..2f2ea9a 100644
--- a/mojo/services/view_manager/view_manager_service_impl.h
+++ b/mojo/services/view_manager/view_manager_service_impl.h
@@ -10,7 +10,6 @@
#include <vector>
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/services/public/interfaces/surfaces/surface_id.mojom.h"
@@ -149,46 +148,46 @@
// ViewManagerService:
virtual void CreateView(Id transport_view_id,
- const Callback<void(ErrorCode)>& callback) OVERRIDE;
+ const Callback<void(ErrorCode)>& callback) override;
virtual void DeleteView(Id transport_view_id,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void AddView(Id parent_id,
Id child_id,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void RemoveViewFromParent(
Id view_id,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void ReorderView(Id view_id,
Id relative_view_id,
OrderDirection direction,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void GetViewTree(
Id view_id,
- const Callback<void(Array<ViewDataPtr>)>& callback) OVERRIDE;
+ const Callback<void(Array<ViewDataPtr>)>& callback) override;
virtual void SetViewSurfaceId(Id view_id,
SurfaceIdPtr surface_id,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void SetViewBounds(Id view_id,
RectPtr bounds,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void SetViewVisibility(Id view_id,
bool visible,
- const Callback<void(bool)>& callback) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
virtual void Embed(const String& url,
Id view_id,
ServiceProviderPtr service_provider,
- const Callback<void(bool)>& callback) OVERRIDE;
- virtual void DispatchOnViewInputEvent(Id view_id, EventPtr event) OVERRIDE;
+ const Callback<void(bool)>& callback) override;
+ virtual void DispatchOnViewInputEvent(Id view_id, EventPtr event) override;
// InterfaceImpl:
virtual void OnConnectionEstablished() override;
// AccessPolicyDelegate:
- virtual const base::hash_set<Id>& GetRootsForAccessPolicy() const OVERRIDE;
+ virtual const base::hash_set<Id>& GetRootsForAccessPolicy() const override;
virtual bool IsViewKnownForAccessPolicy(
- const ServerView* view) const OVERRIDE;
+ const ServerView* view) const override;
virtual bool IsViewRootOfAnotherConnectionForAccessPolicy(
- const ServerView* view) const OVERRIDE;
+ const ServerView* view) const override;
ConnectionManager* connection_manager_;
diff --git a/mojo/services/view_manager/view_manager_unittest.cc b/mojo/services/view_manager/view_manager_unittest.cc
index cc972d4..4883cc8 100644
--- a/mojo/services/view_manager/view_manager_unittest.cc
+++ b/mojo/services/view_manager/view_manager_unittest.cc
@@ -276,7 +276,7 @@
}
// TestChangeTracker::Delegate:
- virtual void OnChangeAdded() OVERRIDE {
+ virtual void OnChangeAdded() override {
if (quit_count_ > 0 && --quit_count_ == 0)
QuitCountReached();
}
@@ -319,7 +319,7 @@
}
// InterfaceImpl:
- virtual void OnConnectionEstablished() OVERRIDE {
+ virtual void OnConnectionEstablished() override {
connection_.set_router(internal_state()->router());
connection_.set_view_manager(client());
}
@@ -329,43 +329,43 @@
ConnectionSpecificId connection_id,
const String& creator_url,
ViewDataPtr root,
- InterfaceRequest<ServiceProvider> services) OVERRIDE {
+ InterfaceRequest<ServiceProvider> services) override {
tracker_.OnEmbed(connection_id, creator_url, root.Pass());
}
virtual void OnViewBoundsChanged(Id view_id,
RectPtr old_bounds,
- RectPtr new_bounds) OVERRIDE {
+ RectPtr new_bounds) override {
tracker_.OnViewBoundsChanged(view_id, old_bounds.Pass(), new_bounds.Pass());
}
virtual void OnViewHierarchyChanged(Id view,
Id new_parent,
Id old_parent,
- Array<ViewDataPtr> views) OVERRIDE {
+ Array<ViewDataPtr> views) override {
tracker_.OnViewHierarchyChanged(view, new_parent, old_parent, views.Pass());
}
virtual void OnViewReordered(Id view_id,
Id relative_view_id,
- OrderDirection direction) OVERRIDE {
+ OrderDirection direction) override {
tracker_.OnViewReordered(view_id, relative_view_id, direction);
}
- virtual void OnViewDeleted(Id view) OVERRIDE { tracker_.OnViewDeleted(view); }
- virtual void OnViewVisibilityChanged(uint32_t view, bool visible) OVERRIDE {
+ virtual void OnViewDeleted(Id view) override { tracker_.OnViewDeleted(view); }
+ virtual void OnViewVisibilityChanged(uint32_t view, bool visible) override {
tracker_.OnViewVisibilityChanged(view, visible);
}
- virtual void OnViewDrawnStateChanged(uint32_t view, bool drawn) OVERRIDE {
+ virtual void OnViewDrawnStateChanged(uint32_t view, bool drawn) override {
tracker_.OnViewDrawnStateChanged(view, drawn);
}
virtual void OnViewInputEvent(Id view_id,
EventPtr event,
- const Callback<void()>& callback) OVERRIDE {
+ const Callback<void()>& callback) override {
tracker_.OnViewInputEvent(view_id, event.Pass());
}
virtual void Embed(
const String& url,
- InterfaceRequest<ServiceProvider> service_provider) OVERRIDE {
+ InterfaceRequest<ServiceProvider> service_provider) override {
tracker_.DelegateEmbed(url);
}
- virtual void DispatchOnViewInputEvent(mojo::EventPtr event) OVERRIDE {
+ virtual void DispatchOnViewInputEvent(mojo::EventPtr event) override {
}
private:
@@ -387,7 +387,7 @@
// ApplicationLoader implementation:
virtual void Load(ApplicationManager* manager,
const GURL& url,
- scoped_refptr<LoadCallbacks> callbacks) OVERRIDE {
+ scoped_refptr<LoadCallbacks> callbacks) override {
ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication();
if (!shell_handle.is_valid())
return;
@@ -396,18 +396,18 @@
apps_.push_back(app.release());
}
virtual void OnApplicationError(ApplicationManager* manager,
- const GURL& url) OVERRIDE {}
+ const GURL& url) override {}
// ApplicationDelegate implementation:
virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
- OVERRIDE {
+ override {
connection->AddService(this);
return true;
}
// InterfaceFactory<ViewManagerClient> implementation:
virtual void Create(ApplicationConnection* connection,
- InterfaceRequest<ViewManagerClient> request) OVERRIDE {
+ InterfaceRequest<ViewManagerClient> request) override {
BindToRequest(new TestViewManagerClientConnection, &request);
}
@@ -457,7 +457,7 @@
connection2_(NULL),
connection3_(NULL) {}
- virtual void SetUp() OVERRIDE {
+ virtual void SetUp() override {
ASSERT_TRUE(ViewManagerProxy::IsInInitialState());
test_helper_.Init();
@@ -484,7 +484,7 @@
connection_->DoRunLoopUntilChangesCount(1);
}
- virtual void TearDown() OVERRIDE {
+ virtual void TearDown() override {
if (connection3_)
connection3_->Destroy();
if (connection2_)
diff --git a/mojo/services/view_manager/window_manager_access_policy.h b/mojo/services/view_manager/window_manager_access_policy.h
index 5730a18..aa44fd6 100644
--- a/mojo/services/view_manager/window_manager_access_policy.h
+++ b/mojo/services/view_manager/window_manager_access_policy.h
@@ -20,24 +20,24 @@
virtual ~WindowManagerAccessPolicy();
// AccessPolicy:
- virtual bool CanRemoveViewFromParent(const ServerView* view) const OVERRIDE;
+ virtual bool CanRemoveViewFromParent(const ServerView* view) const override;
virtual bool CanAddView(const ServerView* parent,
- const ServerView* child) const OVERRIDE;
+ const ServerView* child) const override;
virtual bool CanReorderView(const ServerView* view,
const ServerView* relative_view,
- OrderDirection direction) const OVERRIDE;
- virtual bool CanDeleteView(const ServerView* view) const OVERRIDE;
- virtual bool CanGetViewTree(const ServerView* view) const OVERRIDE;
+ OrderDirection direction) const override;
+ virtual bool CanDeleteView(const ServerView* view) const override;
+ virtual bool CanGetViewTree(const ServerView* view) const override;
virtual bool CanDescendIntoViewForViewTree(
- const ServerView* view) const OVERRIDE;
- virtual bool CanEmbed(const ServerView* view) const OVERRIDE;
- virtual bool CanChangeViewVisibility(const ServerView* view) const OVERRIDE;
- virtual bool CanSetViewSurfaceId(const ServerView* view) const OVERRIDE;
- virtual bool CanSetViewBounds(const ServerView* view) const OVERRIDE;
+ const ServerView* view) const override;
+ virtual bool CanEmbed(const ServerView* view) const override;
+ virtual bool CanChangeViewVisibility(const ServerView* view) const override;
+ virtual bool CanSetViewSurfaceId(const ServerView* view) const override;
+ virtual bool CanSetViewBounds(const ServerView* view) const override;
virtual bool ShouldNotifyOnHierarchyChange(
const ServerView* view,
const ServerView** new_parent,
- const ServerView** old_parent) const OVERRIDE;
+ const ServerView** old_parent) const override;
private:
bool IsViewKnown(const ServerView* view) const;
diff --git a/mojo/services/window_manager/BUILD.gn b/mojo/services/window_manager/BUILD.gn
index b439775..8a93b2f 100644
--- a/mojo/services/window_manager/BUILD.gn
+++ b/mojo/services/window_manager/BUILD.gn
@@ -41,6 +41,7 @@
"//mojo/common",
"//mojo/environment:chromium",
"//mojo/public/cpp/bindings",
+ "//mojo/public/interfaces/application:application",
"//mojo/services/public/cpp/input_events",
"//mojo/services/public/cpp/view_manager",
"//mojo/services/public/interfaces/window_manager",
diff --git a/mojo/services/window_manager/window_manager_app.cc b/mojo/services/window_manager/window_manager_app.cc
index a22acba..3f4c5f0 100644
--- a/mojo/services/window_manager/window_manager_app.cc
+++ b/mojo/services/window_manager/window_manager_app.cc
@@ -9,6 +9,7 @@
#include "mojo/aura/aura_init.h"
#include "mojo/public/cpp/application/application_connection.h"
#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/public/cpp/input_events/input_events_type_converters.h"
#include "mojo/services/public/cpp/view_manager/view.h"
#include "mojo/services/public/cpp/view_manager/view_manager.h"
@@ -37,28 +38,28 @@
private:
// WindowDelegate overrides:
- virtual gfx::Size GetMinimumSize() const OVERRIDE { return gfx::Size(); }
- virtual gfx::Size GetMaximumSize() const OVERRIDE { return gfx::Size(); }
+ virtual gfx::Size GetMinimumSize() const override { return gfx::Size(); }
+ virtual gfx::Size GetMaximumSize() const override { return gfx::Size(); }
virtual void OnBoundsChanged(const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE {}
- virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE {
+ const gfx::Rect& new_bounds) override {}
+ virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override {
return gfx::kNullCursor;
}
- virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE {
+ virtual int GetNonClientComponent(const gfx::Point& point) const override {
return HTCAPTION;
}
virtual bool ShouldDescendIntoChildForEventHandling(
aura::Window* child,
- const gfx::Point& location) OVERRIDE { return true; }
- virtual bool CanFocus() OVERRIDE { return true; }
- virtual void OnCaptureLost() OVERRIDE {}
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {}
- virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {}
- virtual void OnWindowDestroying(aura::Window* window) OVERRIDE {}
- virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE {}
- virtual void OnWindowTargetVisibilityChanged(bool visible) OVERRIDE {}
- virtual bool HasHitTestMask() const OVERRIDE { return false; }
- virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE {}
+ const gfx::Point& location) override { return true; }
+ virtual bool CanFocus() override { return true; }
+ virtual void OnCaptureLost() override {}
+ virtual void OnPaint(gfx::Canvas* canvas) override {}
+ virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {}
+ virtual void OnWindowDestroying(aura::Window* window) override {}
+ virtual void OnWindowDestroyed(aura::Window* window) override {}
+ virtual void OnWindowTargetVisibilityChanged(bool visible) override {}
+ virtual bool HasHitTestMask() const override { return false; }
+ virtual void GetHitTestMask(gfx::Path* mask) const override {}
DISALLOW_COPY_AND_ASSIGN(DummyDelegate);
};
@@ -79,7 +80,8 @@
WindowManagerApp::WindowManagerApp(
ViewManagerDelegate* view_manager_delegate,
WindowManagerDelegate* window_manager_delegate)
- : window_manager_service_factory_(this),
+ : shell_(nullptr),
+ window_manager_service_factory_(this),
wrapped_view_manager_delegate_(view_manager_delegate),
wrapped_window_manager_delegate_(window_manager_delegate),
view_manager_(NULL),
@@ -147,9 +149,10 @@
// WindowManagerApp, ApplicationDelegate implementation:
void WindowManagerApp::Initialize(ApplicationImpl* impl) {
+ shell_ = impl->shell();
aura_init_.reset(new AuraInit);
view_manager_client_factory_.reset(
- new ViewManagerClientFactory(impl->shell(), this));
+ new ViewManagerClientFactory(shell_, this));
}
bool WindowManagerApp::ConfigureIncomingConnection(
@@ -171,7 +174,7 @@
view_manager_->SetWindowManagerDelegate(this);
root_ = root;
- window_tree_host_.reset(new WindowTreeHostMojo(root_, this));
+ window_tree_host_.reset(new WindowTreeHostMojo(shell_, root_));
window_tree_host_->window()->SetBounds(root->bounds());
window_tree_host_->window()->Show();
@@ -262,14 +265,6 @@
}
////////////////////////////////////////////////////////////////////////////////
-// WindowManagerApp, WindowTreeHostMojoDelegate implementation:
-
-void WindowManagerApp::CompositorContentsChanged(const SkBitmap& bitmap) {
- // We draw nothing.
- NOTREACHED();
-}
-
-////////////////////////////////////////////////////////////////////////////////
// WindowManagerApp, ui::EventHandler implementation:
void WindowManagerApp::OnEvent(ui::Event* event) {
diff --git a/mojo/services/window_manager/window_manager_app.h b/mojo/services/window_manager/window_manager_app.h
index 01221d6..c168a16 100644
--- a/mojo/services/window_manager/window_manager_app.h
+++ b/mojo/services/window_manager/window_manager_app.h
@@ -9,7 +9,6 @@
#include "base/memory/scoped_ptr.h"
#include "mojo/aura/window_tree_host_mojo.h"
-#include "mojo/aura/window_tree_host_mojo_delegate.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/interface_factory_impl.h"
#include "mojo/public/cpp/bindings/string.h"
@@ -59,7 +58,6 @@
public ViewManagerDelegate,
public WindowManagerDelegate,
public ViewObserver,
- public WindowTreeHostMojoDelegate,
public ui::EventHandler,
public aura::client::FocusChangeObserver,
public aura::client::ActivationChangeObserver {
@@ -107,8 +105,8 @@
// Overridden from WindowManagerDelegate:
virtual void Embed(
const String& url,
- InterfaceRequest<ServiceProvider> service_provider) OVERRIDE;
- virtual void DispatchEvent(EventPtr event) OVERRIDE;
+ InterfaceRequest<ServiceProvider> service_provider) override;
+ virtual void DispatchEvent(EventPtr event) override;
// Overridden from ViewObserver:
virtual void OnTreeChanged(
@@ -118,9 +116,6 @@
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override;
- // Overridden from WindowTreeHostMojoDelegate:
- virtual void CompositorContentsChanged(const SkBitmap& bitmap) override;
-
// Overridden from ui::EventHandler:
virtual void OnEvent(ui::Event* event) override;
@@ -141,6 +136,8 @@
// and removes from the registry.
void UnregisterSubtree(View* view);
+ Shell* shell_;
+
InterfaceFactoryImplWithContext<WindowManagerServiceImpl, WindowManagerApp>
window_manager_service_factory_;
diff --git a/mojo/services/window_manager/window_manager_unittests.cc b/mojo/services/window_manager/window_manager_unittests.cc
index 2ddceb8..dbd9a48 100644
--- a/mojo/services/window_manager/window_manager_unittests.cc
+++ b/mojo/services/window_manager/window_manager_unittests.cc
@@ -19,7 +19,7 @@
virtual ~WindowManagerTestSuite() {}
protected:
- virtual void Initialize() OVERRIDE {
+ virtual void Initialize() override {
#if defined(USE_X11)
// Each test ends up creating a new thread for the native viewport service.
// In other words we'll use X on different threads, so tell it that.
diff --git a/mojo/shell/dynamic_application_loader.cc b/mojo/shell/dynamic_application_loader.cc
index ac0686e..1f24cf3 100644
--- a/mojo/shell/dynamic_application_loader.cc
+++ b/mojo/shell/dynamic_application_loader.cc
@@ -135,7 +135,7 @@
request->bypass_cache = true;
}
- network_service->CreateURLLoader(Get(&url_loader_));
+ network_service->CreateURLLoader(GetProxy(&url_loader_));
url_loader_->Start(request.Pass(),
base::Bind(&NetworkLoader::OnLoadComplete,
weak_ptr_factory_.GetWeakPtr()));
diff --git a/mojo/shell/external_application_listener_unittest.cc b/mojo/shell/external_application_listener_unittest.cc
index 5676b68..6225dfd 100644
--- a/mojo/shell/external_application_listener_unittest.cc
+++ b/mojo/shell/external_application_listener_unittest.cc
@@ -140,7 +140,7 @@
void ConnectToAppByUrl(std::string app_url) {
ServiceProviderPtr sp;
- ptr_->ConnectToApplication(app_url, Get(&sp));
+ ptr_->ConnectToApplication(app_url, GetProxy(&sp));
}
const std::string& url() { return url_; }
diff --git a/mojo/shell/external_application_registrar_connection.cc b/mojo/shell/external_application_registrar_connection.cc
index 57498a9..a29734e 100644
--- a/mojo/shell/external_application_registrar_connection.cc
+++ b/mojo/shell/external_application_registrar_connection.cc
@@ -57,7 +57,7 @@
base::Closure register_complete_callback) {
DCHECK(!client_socket_);
registrar_->Register(
- String::From(app_url), Get(shell), register_complete_callback);
+ String::From(app_url), GetProxy(shell), register_complete_callback);
}
void ExternalApplicationRegistrarConnection::OnConnect(
diff --git a/mojo/tools/package_manager/package_fetcher.cc b/mojo/tools/package_manager/package_fetcher.cc
index b5a47e5..dee24c0 100644
--- a/mojo/tools/package_manager/package_fetcher.cc
+++ b/mojo/tools/package_manager/package_fetcher.cc
@@ -16,7 +16,7 @@
const GURL& url)
: delegate_(delegate),
url_(url) {
- network_service->CreateURLLoader(Get(&loader_));
+ network_service->CreateURLLoader(GetProxy(&loader_));
URLRequestPtr request(URLRequest::New());
request->url = url.spec();
diff --git a/mojo/views/BUILD.gn b/mojo/views/BUILD.gn
index 005654a..506a7ed 100644
--- a/mojo/views/BUILD.gn
+++ b/mojo/views/BUILD.gn
@@ -17,17 +17,21 @@
"views_init.h",
]
+ public_deps = [
+ "//mojo/aura",
+ "//mojo/services/public/cpp/view_manager",
+ "//skia",
+ "//ui/base",
+ "//ui/views",
+ ]
+
deps = [
":views_internal",
"//base",
"//base:i18n",
- "//skia",
"//third_party/icu",
"//ui/aura",
- "//ui/base",
- "//ui/views",
"//ui/wm",
- "//mojo/aura",
]
}
diff --git a/mojo/views/input_method_mojo_linux.h b/mojo/views/input_method_mojo_linux.h
index 0072a29..f941ab2 100644
--- a/mojo/views/input_method_mojo_linux.h
+++ b/mojo/views/input_method_mojo_linux.h
@@ -27,7 +27,7 @@
virtual ~InputMethodMojoLinux();
// Overriden from ui::InputMethodAuraLinux:
- virtual bool DispatchKeyEvent(const ui::KeyEvent& event) OVERRIDE;
+ virtual bool DispatchKeyEvent(const ui::KeyEvent& event) override;
private:
DISALLOW_COPY_AND_ASSIGN(InputMethodMojoLinux);
diff --git a/mojo/views/native_widget_view_manager.cc b/mojo/views/native_widget_view_manager.cc
index 6907ea6..9927c89 100644
--- a/mojo/views/native_widget_view_manager.cc
+++ b/mojo/views/native_widget_view_manager.cc
@@ -32,7 +32,7 @@
FocusRulesImpl() {}
virtual ~FocusRulesImpl() {}
- virtual bool SupportsChildActivation(aura::Window* window) const OVERRIDE {
+ virtual bool SupportsChildActivation(aura::Window* window) const override {
return true;
}
@@ -65,7 +65,7 @@
private:
// ui::EventHandler:
- virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
+ virtual void OnKeyEvent(ui::KeyEvent* event) override {
// See the comment in InputMethodEventFilter::OnKeyEvent() for details.
if (event->IsTranslated()) {
event->SetTranslated(false);
@@ -76,7 +76,7 @@
}
// ui::internal::InputMethodDelegate:
- virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) OVERRIDE {
+ virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
// See the comment in InputMethodEventFilter::DispatchKeyEventPostIME() for
// details.
ui::KeyEvent aura_event(event);
@@ -95,11 +95,12 @@
} // namespace
NativeWidgetViewManager::NativeWidgetViewManager(
- views::internal::NativeWidgetDelegate* delegate, View* view)
- : NativeWidgetAura(delegate),
- view_(view) {
+ views::internal::NativeWidgetDelegate* delegate,
+ Shell* shell,
+ View* view)
+ : NativeWidgetAura(delegate), view_(view) {
view_->AddObserver(this);
- window_tree_host_.reset(new WindowTreeHostMojo(view_, this));
+ window_tree_host_.reset(new WindowTreeHostMojo(shell, view_));
window_tree_host_->InitHost();
ime_filter_.reset(
@@ -129,16 +130,12 @@
NativeWidgetAura::InitNativeWidget(params);
}
-void NativeWidgetViewManager::CompositorContentsChanged(
- const SkBitmap& bitmap) {
- if (view_)
- view_->SetContents(bitmap);
-}
-
void NativeWidgetViewManager::OnViewDestroyed(View* view) {
DCHECK_EQ(view, view_);
view->RemoveObserver(this);
view_ = NULL;
+ // TODO(sky): WindowTreeHostMojo assumes the View outlives it.
+ // NativeWidgetViewManager needs to deal, likely by deleting this.
}
void NativeWidgetViewManager::OnViewBoundsChanged(View* view,
diff --git a/mojo/views/native_widget_view_manager.h b/mojo/views/native_widget_view_manager.h
index a9e8220..499a766 100644
--- a/mojo/views/native_widget_view_manager.h
+++ b/mojo/views/native_widget_view_manager.h
@@ -5,7 +5,6 @@
#ifndef MOJO_VIEWS_NATIVE_WIDGET_VIEW_MANAGER_H_
#define MOJO_VIEWS_NATIVE_WIDGET_VIEW_MANAGER_H_
-#include "mojo/aura/window_tree_host_mojo_delegate.h"
#include "mojo/services/public/cpp/view_manager/view_observer.h"
#include "ui/views/widget/native_widget_aura.h"
@@ -27,30 +26,28 @@
namespace mojo {
+class Shell;
class WindowTreeHostMojo;
class NativeWidgetViewManager : public views::NativeWidgetAura,
- public WindowTreeHostMojoDelegate,
public ViewObserver {
public:
NativeWidgetViewManager(views::internal::NativeWidgetDelegate* delegate,
+ Shell* shell,
View* view);
virtual ~NativeWidgetViewManager();
private:
// Overridden from internal::NativeWidgetAura:
virtual void InitNativeWidget(
- const views::Widget::InitParams& in_params) OVERRIDE;
-
- // WindowTreeHostMojoDelegate:
- virtual void CompositorContentsChanged(const SkBitmap& bitmap) OVERRIDE;
+ const views::Widget::InitParams& in_params) override;
// ViewObserver:
- virtual void OnViewDestroyed(View* view) OVERRIDE;
+ virtual void OnViewDestroyed(View* view) override;
virtual void OnViewBoundsChanged(View* view,
const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) OVERRIDE;
- virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE;
+ const gfx::Rect& new_bounds) override;
+ virtual void OnViewInputEvent(View* view, const EventPtr& event) override;
scoped_ptr<WindowTreeHostMojo> window_tree_host_;
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 6815ce1..3dcfa6b 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -197,8 +197,11 @@
"cert/ct_objects_extractor_nss.cc",
"cert/jwk_serializer_nss.cc",
"cert/scoped_nss_types.h",
+ "cert/test_root_certs_nss.cc",
"cert/x509_util_nss.cc",
"cert/x509_util_nss.h",
+ "ocsp/nss_ocsp.cc",
+ "ocsp/nss_ocsp.h",
"quic/crypto/aead_base_decrypter_nss.cc",
"quic/crypto/aead_base_encrypter_nss.cc",
"quic/crypto/aes_128_gcm_12_decrypter_nss.cc",
@@ -244,9 +247,6 @@
sources -= [
"cert/cert_verify_proc_nss.cc",
"cert/cert_verify_proc_nss.h",
- "cert/test_root_certs_nss.cc",
- "ocsp/nss_ocsp.cc",
- "ocsp/nss_ocsp.h",
]
}
} else {
@@ -317,7 +317,7 @@
]
}
- if (use_glib) {
+ if (use_glib && !is_chromeos) {
configs += [ "//build/config/linux:gconf" ]
deps += [ "//build/config/linux:gio" ]
}
@@ -340,7 +340,7 @@
"third_party/mozilla_security_manager/nsPKCS12Blob.h",
]
- if (!is_ios) {
+ if (!is_ios && !use_openssl) {
# These files are part of the partial implementation of NSS on iOS so
# keep them in that case.
sources -= [
@@ -551,8 +551,6 @@
]
}
-if (false) {
-
static_library("extras") {
sources = gypi_values.net_extras_sources
configs += [ "//build/config/compiler:wexit_time_destructors" ]
@@ -562,8 +560,6 @@
]
}
-} # if (false)
-
static_library("http_server") {
sources = [
"server/http_connection.cc",
@@ -853,7 +849,7 @@
"//base",
]
- if (is_linux) {
+ if (is_desktop_linux) {
configs += [
"//build/config/linux:gconf",
"//build/config/linux:glib",
@@ -1107,14 +1103,11 @@
test("net_unittests") {
sources = gypi_values.net_test_sources
- sources -= [
- "extras/sqlite/sqlite_channel_id_store_unittest.cc",
- ]
-
configs += [ ":net_win_size_truncation" ]
defines = []
deps = [
+ ":extras",
":http_server",
":net",
":quic_tools",
diff --git a/net/base/load_flags_list.h b/net/base/load_flags_list.h
index 72792eb..fbc6d72 100644
--- a/net/base/load_flags_list.h
+++ b/net/base/load_flags_list.h
@@ -125,3 +125,6 @@
// reduction proxy.
// TODO(rcs): Remove this flag as soon as http://crbug.com/339237 is resolved.
LOAD_FLAG(BYPASS_DATA_REDUCTION_PROXY, 1 << 28)
+
+// Indicates the the request is an asynchronous revalidation.
+LOAD_FLAG(ASYNC_REVALIDATION, 1 << 29)
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h
index 0626683..823cde1 100644
--- a/net/base/net_log_event_type_list.h
+++ b/net/base/net_log_event_type_list.h
@@ -835,6 +835,29 @@
EVENT_TYPE(HTTP_CACHE_READ_DATA)
EVENT_TYPE(HTTP_CACHE_WRITE_DATA)
+// Identifies the NetLog::Source() for the asynchronous HttpCache::Transaction
+// that will revalidate this entry.
+// The event parameters are:
+// {
+// "source_dependency": <Source identifier for the async Transaction>
+// }
+EVENT_TYPE(HTTP_CACHE_VALIDATE_RESOURCE_ASYNC)
+
+// The start/end of performing an async revalidation.
+// For the BEGIN phase, the event parameters are:
+// {
+// "source_dependency": <Source identifier for the Request>
+// "url": <String of URL being loaded>,
+// "method": <Method of request>
+// }
+//
+// For the END phase, if there was an error, the following parameters are
+// attached:
+// {
+// "net_error": <Net error code of the failure>,
+// }
+EVENT_TYPE(ASYNC_REVALIDATION)
+
// ------------------------------------------------------------------------
// Disk Cache / Memory Cache
// ------------------------------------------------------------------------
diff --git a/net/base/net_log_source_type_list.h b/net/base/net_log_source_type_list.h
index 265ba74..9d66c17 100644
--- a/net/base/net_log_source_type_list.h
+++ b/net/base/net_log_source_type_list.h
@@ -28,3 +28,4 @@
SOURCE_TYPE(DNS_PROBER)
SOURCE_TYPE(PROXY_CLIENT_SOCKET)
SOURCE_TYPE(IPV6_REACHABILITY_CHECK)
+SOURCE_TYPE(ASYNC_REVALIDATION)
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index d63dfe8..b9cf59f 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -251,8 +251,7 @@
return ((c >= 'a') && (c <= 'z')) || ((c >= '0') && (c <= '9'));
}
-bool IsCanonicalizedHostCompliant(const std::string& host,
- const std::string& desired_tld) {
+bool IsCanonicalizedHostCompliant(const std::string& host) {
if (host.empty())
return false;
@@ -282,8 +281,7 @@
}
}
- return most_recent_component_started_alphanumeric ||
- (!desired_tld.empty() && IsHostCharAlphanumeric(desired_tld[0]));
+ return most_recent_component_started_alphanumeric;
}
base::string16 StripWWW(const base::string16& text) {
diff --git a/net/base/net_util.h b/net/base/net_util.h
index 8420cb3..72ac169 100644
--- a/net/base/net_util.h
+++ b/net/base/net_util.h
@@ -215,15 +215,10 @@
// * Each component ends with an alphanumeric character or '-'
// * The last component begins with an alphanumeric character
// * Optional trailing dot after last component (means "treat as FQDN")
-// If |desired_tld| is non-NULL, the host will only be considered invalid if
-// appending it as a trailing component still results in an invalid host. This
-// helps us avoid marking as "invalid" user attempts to open, say, "www.-9.com"
-// by typing -, 9, <ctrl>+<enter>.
//
// NOTE: You should only pass in hosts that have been returned from
// CanonicalizeHost(), or you may not get accurate results.
-NET_EXPORT bool IsCanonicalizedHostCompliant(const std::string& host,
- const std::string& desired_tld);
+NET_EXPORT bool IsCanonicalizedHostCompliant(const std::string& host);
// Call these functions to get the html snippet for a directory listing.
// The return values of both functions are in UTF-8.
diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc
index 8131c43..0e17f1a 100644
--- a/net/base/net_util_unittest.cc
+++ b/net/base/net_util_unittest.cc
@@ -41,12 +41,6 @@
const char* expected;
};
-struct CompliantHostCase {
- const char* host;
- const char* desired_tld;
- bool expected_output;
-};
-
// Fills in sockaddr for the given 32-bit address (IPv4.)
// |bytes| should be an array of length 4.
void MakeIPv4Address(const uint8* bytes, int port, SockaddrStorage* storage) {
@@ -200,36 +194,39 @@
}
TEST(NetUtilTest, CompliantHost) {
+ struct CompliantHostCase {
+ const char* host;
+ bool expected_output;
+ };
+
const CompliantHostCase compliant_host_cases[] = {
- {"", "", false},
- {"a", "", true},
- {"-", "", false},
- {".", "", false},
- {"9", "", true},
- {"9a", "", true},
- {"a.", "", true},
- {"a.a", "", true},
- {"9.a", "", true},
- {"a.9", "", true},
- {"_9a", "", false},
- {"-9a", "", false},
- {"-9a", "a", true},
- {"a.a9", "", true},
- {"a.-a9", "", false},
- {"a+9a", "", false},
- {"-a.a9", "", true},
- {"1-.a-b", "", true},
- {"1_.a-b", "", false},
- {"1-2.a_b", "", true},
- {"a.b.c.d.e", "", true},
- {"1.2.3.4.5", "", true},
- {"1.2.3.4.5.", "", true},
+ {"", false},
+ {"a", true},
+ {"-", false},
+ {".", false},
+ {"9", true},
+ {"9a", true},
+ {"a.", true},
+ {"a.a", true},
+ {"9.a", true},
+ {"a.9", true},
+ {"_9a", false},
+ {"-9a", false},
+ {"a.a9", true},
+ {"a.-a9", false},
+ {"a+9a", false},
+ {"-a.a9", true},
+ {"1-.a-b", true},
+ {"1_.a-b", false},
+ {"1-2.a_b", true},
+ {"a.b.c.d.e", true},
+ {"1.2.3.4.5", true},
+ {"1.2.3.4.5.", true},
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(compliant_host_cases); ++i) {
EXPECT_EQ(compliant_host_cases[i].expected_output,
- IsCanonicalizedHostCompliant(compliant_host_cases[i].host,
- compliant_host_cases[i].desired_tld));
+ IsCanonicalizedHostCompliant(compliant_host_cases[i].host));
}
}
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index b75a543..ef9e252 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -4,6 +4,8 @@
#include "net/base/network_change_notifier.h"
+#include <limits>
+
#include "base/metrics/histogram.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
@@ -535,6 +537,13 @@
}
// static
+double NetworkChangeNotifier::GetMaxBandwidth() {
+ return g_network_change_notifier ?
+ g_network_change_notifier->GetCurrentMaxBandwidth() :
+ std::numeric_limits<double>::infinity();
+}
+
+// static
void NetworkChangeNotifier::GetDnsConfig(DnsConfig* config) {
if (!g_network_change_notifier) {
*config = DnsConfig();
@@ -766,6 +775,15 @@
}
#endif
+double NetworkChangeNotifier::GetCurrentMaxBandwidth() const {
+ // This default implementation conforms to the NetInfo V3 specification but
+ // should be overridden to provide specific bandwidth data based on the
+ // platform.
+ if (GetCurrentConnectionType() == CONNECTION_NONE)
+ return 0.0;
+ return std::numeric_limits<double>::infinity();
+}
+
// static
void NetworkChangeNotifier::NotifyObserversOfIPAddressChange() {
if (g_network_change_notifier &&
diff --git a/net/base/network_change_notifier.h b/net/base/network_change_notifier.h
index 46a4854..bdd2d18 100644
--- a/net/base/network_change_notifier.h
+++ b/net/base/network_change_notifier.h
@@ -132,7 +132,7 @@
// See the description of NetworkChangeNotifier::GetConnectionType().
// Implementations must be thread-safe. Implementations must also be
- // cheap as this could be called (repeatedly) from the network thread.
+ // cheap as it is called often.
virtual ConnectionType GetCurrentConnectionType() const = 0;
// Replaces the default class factory instance of NetworkChangeNotifier class.
@@ -159,6 +159,12 @@
// the internet, the connection type is CONNECTION_WIFI.
static ConnectionType GetConnectionType();
+ // Returns a theoretical upper limit on download bandwidth, potentially based
+ // on underlying connection type, signal strength, or some other signal. The
+ // default mapping of connection type to maximum bandwidth is provided in the
+ // NetInfo spec: http://w3c.github.io/netinfo/.
+ static double GetMaxBandwidth();
+
// Retrieve the last read DnsConfig. This could be expensive if the system has
// a large HOSTS file.
static void GetDnsConfig(DnsConfig* config);
@@ -295,6 +301,11 @@
GetAddressTrackerInternal() const;
#endif
+ // See the description of NetworkChangeNotifier::GetMaxBandwidth().
+ // Implementations must be thread-safe. Implementations must also be
+ // cheap as it is called often.
+ virtual double GetCurrentMaxBandwidth() const;
+
// Broadcasts a notification to all registered observers. Note that this
// happens asynchronously, even for observers on the current thread, even in
// tests.
diff --git a/net/base/network_change_notifier_unittest.cc b/net/base/network_change_notifier_unittest.cc
new file mode 100644
index 0000000..b8310fa
--- /dev/null
+++ b/net/base/network_change_notifier_unittest.cc
@@ -0,0 +1,60 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/network_change_notifier.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+
+// Note: This test is subject to the host's OS and network connection. This test
+// is not future-proof. New standards will come about necessitating the need to
+// alter the ranges of these tests.
+TEST(NetworkChangeNotifierTest, NetMaxBandwidthRange) {
+ NetworkChangeNotifier::ConnectionType connection_type =
+ NetworkChangeNotifier::GetConnectionType();
+ double max_bandwidth = NetworkChangeNotifier::GetMaxBandwidth();
+
+ // Always accept infinity as it's the default value if the bandwidth is
+ // unknown.
+ if (max_bandwidth == std::numeric_limits<double>::infinity()) {
+ EXPECT_NE(NetworkChangeNotifier::CONNECTION_NONE, connection_type);
+ return;
+ }
+
+ switch (connection_type) {
+ case NetworkChangeNotifier::CONNECTION_UNKNOWN:
+ EXPECT_EQ(std::numeric_limits<double>::infinity(), max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_ETHERNET:
+ EXPECT_GE(10.0, max_bandwidth);
+ EXPECT_LE(10000.0, max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_WIFI:
+ EXPECT_GE(1.0, max_bandwidth);
+ EXPECT_LE(7000.0, max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_2G:
+ EXPECT_GE(0.01, max_bandwidth);
+ EXPECT_LE(0.384, max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_3G:
+ EXPECT_GE(2.0, max_bandwidth);
+ EXPECT_LE(42.0, max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_4G:
+ EXPECT_GE(100.0, max_bandwidth);
+ EXPECT_LE(100.0, max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_NONE:
+ EXPECT_EQ(0.0, max_bandwidth);
+ break;
+ case NetworkChangeNotifier::CONNECTION_BLUETOOTH:
+ EXPECT_GE(1.0, max_bandwidth);
+ EXPECT_LE(24.0, max_bandwidth);
+ break;
+ }
+}
+
+} // namespace net
diff --git a/net/cert/cert_verify_proc_android.cc b/net/cert/cert_verify_proc_android.cc
index 6bc8ef5..91d0b55 100644
--- a/net/cert/cert_verify_proc_android.cc
+++ b/net/cert/cert_verify_proc_android.cc
@@ -69,7 +69,7 @@
}
scoped_refptr<X509Certificate> verified_cert =
X509Certificate::CreateFromDERCertChain(verified_chain_pieces);
- if (verified_cert)
+ if (verified_cert.get())
verify_result->verified_cert = verified_cert;
}
diff --git a/net/http/http_auth_gssapi_posix.h b/net/http/http_auth_gssapi_posix.h
index ddaf518..2e7b99b 100644
--- a/net/http/http_auth_gssapi_posix.h
+++ b/net/http/http_auth_gssapi_posix.h
@@ -16,6 +16,8 @@
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
// Including gssapi.h directly is deprecated in the 10.9 SDK.
#include <GSS/gssapi.h>
+#elif defined(OS_FREEBSD)
+#include <gssapi/gssapi.h>
#else
#include <gssapi.h>
#endif
@@ -99,7 +101,6 @@
OM_uint32* ctx_flags,
int* locally_initiated,
int* open) = 0;
-
};
// GSSAPISharedLibrary class is defined here so that unit tests can access it.
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 58fc24c..cbf2615 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -21,16 +21,19 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/field_trial.h"
+#include "base/metrics/histogram.h"
#include "base/pickle.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/worker_pool.h"
+#include "base/time/time.h"
#include "net/base/cache_type.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
+#include "net/base/network_delegate.h"
#include "net/base/upload_data_stream.h"
#include "net/disk_cache/disk_cache.h"
#include "net/http/disk_based_cert_cache.h"
@@ -292,12 +295,166 @@
};
//-----------------------------------------------------------------------------
+
+class HttpCache::AsyncValidation {
+ public:
+ AsyncValidation(const HttpRequestInfo& original_request, HttpCache* cache)
+ : request_(original_request), cache_(cache) {}
+ ~AsyncValidation() {}
+
+ void Start(const BoundNetLog& net_log,
+ scoped_ptr<Transaction> transaction,
+ NetworkDelegate* network_delegate);
+
+ private:
+ void OnStarted(int result);
+ void DoRead();
+ void OnRead(int result);
+
+ // Terminate this request with net error code |result|. Logs the transaction
+ // result and asks HttpCache to delete this object.
+ // If there was a client or server certificate error, it cannot be recovered
+ // asynchronously, so we need to prevent future attempts to asynchronously
+ // fetch the resource. In this case, the cache entry is doomed.
+ void Terminate(int result);
+
+ HttpRequestInfo request_;
+ scoped_refptr<IOBuffer> buf_;
+ CompletionCallback read_callback_;
+ scoped_ptr<Transaction> transaction_;
+ base::Time start_time_;
+
+ // The HttpCache object owns this object. This object is always deleted before
+ // the pointer to the cache becomes invalid.
+ HttpCache* cache_;
+
+ DISALLOW_COPY_AND_ASSIGN(AsyncValidation);
+};
+
+void HttpCache::AsyncValidation::Start(const BoundNetLog& net_log,
+ scoped_ptr<Transaction> transaction,
+ NetworkDelegate* network_delegate) {
+ transaction_ = transaction.Pass();
+ if (network_delegate) {
+ // This code is necessary to enable async transactions to pass over the
+ // data-reduction proxy. This is a violation of the "once-and-only-once"
+ // principle, since it copies code from URLRequestHttpJob. We cannot use the
+ // original callback passed to HttpCache::Transaction by URLRequestHttpJob
+ // as it will only be valid as long as the URLRequestHttpJob object is
+ // alive, and that object will be deleted as soon as the synchronous request
+ // completes.
+ //
+ // This code is also an encapsulation violation. We are exploiting the fact
+ // that the |request| parameter to NotifyBeforeSendProxyHeaders() is never
+ // actually used for anything, and so can be NULL.
+ //
+ // TODO(ricea): Do this better.
+ transaction_->SetBeforeProxyHeadersSentCallback(
+ base::Bind(&NetworkDelegate::NotifyBeforeSendProxyHeaders,
+ base::Unretained(network_delegate),
+ static_cast<URLRequest*>(NULL)));
+ // The above use of base::Unretained is safe because the NetworkDelegate has
+ // to live at least as long as the HttpNetworkSession which has to live as
+ // least as long as the HttpNetworkLayer which has to live at least as long
+ // this HttpCache object.
+ }
+
+ DCHECK_EQ(0, request_.load_flags & LOAD_ASYNC_REVALIDATION);
+ request_.load_flags |= LOAD_ASYNC_REVALIDATION;
+ start_time_ = base::Time::Now();
+ // This use of base::Unretained is safe because |transaction_| is owned by
+ // this object.
+ read_callback_ = base::Bind(&AsyncValidation::OnRead, base::Unretained(this));
+ // This use of base::Unretained is safe as above.
+ int rv = transaction_->Start(
+ &request_,
+ base::Bind(&AsyncValidation::OnStarted, base::Unretained(this)),
+ net_log);
+
+ if (rv == ERR_IO_PENDING)
+ return;
+
+ OnStarted(rv);
+}
+
+void HttpCache::AsyncValidation::OnStarted(int result) {
+ if (result != OK) {
+ DVLOG(1) << "Asynchronous transaction start failed for " << request_.url;
+ Terminate(result);
+ return;
+ }
+
+ while (transaction_->IsReadyToRestartForAuth()) {
+ // This code is based on URLRequestHttpJob::RestartTransactionWithAuth,
+ // however when we do this here cookies on the response will not be
+ // stored. Fortunately only a tiny number of sites set cookies on 401
+ // responses, and none of them use stale-while-revalidate.
+ result = transaction_->RestartWithAuth(
+ AuthCredentials(),
+ base::Bind(&AsyncValidation::OnStarted, base::Unretained(this)));
+ if (result == ERR_IO_PENDING)
+ return;
+ if (result != OK) {
+ DVLOG(1) << "Synchronous transaction restart with auth failed for "
+ << request_.url;
+ Terminate(result);
+ return;
+ }
+ }
+
+ DoRead();
+}
+
+void HttpCache::AsyncValidation::DoRead() {
+ const size_t kBufSize = 4096;
+ if (!buf_.get())
+ buf_ = new IOBuffer(kBufSize);
+
+ int rv = 0;
+ do {
+ rv = transaction_->Read(buf_.get(), kBufSize, read_callback_);
+ } while (rv > 0);
+
+ if (rv == ERR_IO_PENDING)
+ return;
+
+ OnRead(rv);
+}
+
+void HttpCache::AsyncValidation::OnRead(int result) {
+ if (result > 0) {
+ DoRead();
+ return;
+ }
+ Terminate(result);
+}
+
+void HttpCache::AsyncValidation::Terminate(int result) {
+ if (result == ERR_SSL_CLIENT_AUTH_CERT_NEEDED || IsCertificateError(result)) {
+ // We should not attempt to access this resource asynchronously again until
+ // the certificate problem has been resolved.
+ // TODO(ricea): For ERR_SSL_CLIENT_AUTH_CERT_NEEDED, mark the entry as
+ // requiring synchronous revalidation rather than just deleting it. Other
+ // certificate errors cause the resource to be considered uncacheable
+ // anyway.
+ cache_->DoomEntry(transaction_->key(), transaction_.get());
+ }
+ base::TimeDelta duration = base::Time::Now() - start_time_;
+ UMA_HISTOGRAM_TIMES("HttpCache.AsyncValidationDuration", duration);
+ transaction_->net_log().EndEventWithNetErrorCode(
+ NetLog::TYPE_ASYNC_REVALIDATION, result);
+ cache_->DeleteAsyncValidation(cache_->GenerateCacheKey(&request_));
+ // |this| is deleted.
+}
+
+//-----------------------------------------------------------------------------
HttpCache::HttpCache(const net::HttpNetworkSession::Params& params,
BackendFactory* backend_factory)
: net_log_(params.net_log),
backend_factory_(backend_factory),
building_backend_(false),
bypass_lock_for_test_(false),
+ use_stale_while_revalidate_(params.use_stale_while_revalidate),
mode_(NORMAL),
network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))),
weak_factory_(this) {
@@ -313,6 +470,7 @@
backend_factory_(backend_factory),
building_backend_(false),
bypass_lock_for_test_(false),
+ use_stale_while_revalidate_(session->params().use_stale_while_revalidate),
mode_(NORMAL),
network_layer_(new HttpNetworkLayer(session)),
weak_factory_(this) {
@@ -325,10 +483,14 @@
backend_factory_(backend_factory),
building_backend_(false),
bypass_lock_for_test_(false),
+ use_stale_while_revalidate_(false),
mode_(NORMAL),
network_layer_(network_layer),
weak_factory_(this) {
SetupQuicServerInfoFactory(network_layer_->GetSession());
+ HttpNetworkSession* session = network_layer_->GetSession();
+ if (session)
+ use_stale_while_revalidate_ = session->params().use_stale_while_revalidate;
}
HttpCache::~HttpCache() {
@@ -350,6 +512,7 @@
}
STLDeleteElements(&doomed_entries_);
+ STLDeleteValues(&async_validations_);
// Before deleting pending_ops_, we have to make sure that the disk cache is
// done with said operations, or it will attempt to use deleted data.
@@ -1038,6 +1201,43 @@
base::Bind(&HttpCache::OnProcessPendingQueue, GetWeakPtr(), entry));
}
+void HttpCache::PerformAsyncValidation(const HttpRequestInfo& original_request,
+ const BoundNetLog& net_log) {
+ DCHECK(use_stale_while_revalidate_);
+ std::string key = GenerateCacheKey(&original_request);
+ AsyncValidation* async_validation =
+ new AsyncValidation(original_request, this);
+ typedef AsyncValidationMap::value_type AsyncValidationKeyValue;
+ bool insert_ok =
+ async_validations_.insert(AsyncValidationKeyValue(key, async_validation))
+ .second;
+ if (!insert_ok) {
+ DVLOG(1) << "Harmless race condition detected on URL "
+ << original_request.url << "; discarding redundant revalidation.";
+ delete async_validation;
+ return;
+ }
+ HttpNetworkSession* network_session = GetSession();
+ NetworkDelegate* network_delegate = NULL;
+ if (network_session)
+ network_delegate = network_session->network_delegate();
+ scoped_ptr<HttpTransaction> transaction;
+ CreateTransaction(IDLE, &transaction);
+ scoped_ptr<Transaction> downcast_transaction(
+ static_cast<Transaction*>(transaction.release()));
+ async_validation->Start(
+ net_log, downcast_transaction.Pass(), network_delegate);
+ // |async_validation| may have been deleted here.
+}
+
+void HttpCache::DeleteAsyncValidation(const std::string& url) {
+ AsyncValidationMap::iterator it = async_validations_.find(url);
+ CHECK(it != async_validations_.end()); // security-critical invariant
+ AsyncValidation* async_validation = it->second;
+ async_validations_.erase(it);
+ delete async_validation;
+}
+
void HttpCache::OnProcessPendingQueue(ActiveEntry* entry) {
entry->will_process_pending_queue = false;
DCHECK(!entry->writer);
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index 35bc5b2..3f59839 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -15,6 +15,7 @@
#define NET_HTTP_HTTP_CACHE_H_
#include <list>
+#include <map>
#include <set>
#include <string>
@@ -201,6 +202,16 @@
bypass_lock_for_test_ = true;
}
+ bool use_stale_while_revalidate() const {
+ return use_stale_while_revalidate_;
+ }
+
+ // Enable stale_while_revalidate functionality for testing purposes.
+ void set_use_stale_while_revalidate_for_testing(
+ bool use_stale_while_revalidate) {
+ use_stale_while_revalidate_ = use_stale_while_revalidate;
+ }
+
// HttpTransactionFactory implementation:
virtual int CreateTransaction(RequestPriority priority,
scoped_ptr<HttpTransaction>* trans) OVERRIDE;
@@ -237,9 +248,11 @@
friend class Transaction;
friend class ViewCacheHelper;
struct PendingOp; // Info for an entry under construction.
+ class AsyncValidation; // Encapsulates a single async revalidation.
typedef std::list<Transaction*> TransactionList;
typedef std::list<WorkItem*> WorkItemList;
+ typedef std::map<std::string, AsyncValidation*> AsyncValidationMap;
struct ActiveEntry {
explicit ActiveEntry(disk_cache::Entry* entry);
@@ -374,6 +387,15 @@
// Resumes processing the pending list of |entry|.
void ProcessPendingQueue(ActiveEntry* entry);
+ // Called by Transaction to perform an asynchronous revalidation. Creates a
+ // new independent transaction as a copy of the original.
+ void PerformAsyncValidation(const HttpRequestInfo& original_request,
+ const BoundNetLog& net_log);
+
+ // Remove the AsyncValidation with url |url| from the |async_validations_| set
+ // and delete it.
+ void DeleteAsyncValidation(const std::string& url);
+
// Events (called via PostTask) ---------------------------------------------
void OnProcessPendingQueue(ActiveEntry* entry);
@@ -405,6 +427,10 @@
bool building_backend_;
bool bypass_lock_for_test_;
+ // true if the implementation of Cache-Control: stale-while-revalidate
+ // directive is enabled (either via command-line flag or experiment).
+ bool use_stale_while_revalidate_;
+
Mode mode_;
scoped_ptr<QuicServerInfoFactoryAdaptor> quic_server_info_factory_;
@@ -426,6 +452,9 @@
scoped_ptr<PlaybackCacheMap> playback_cache_map_;
+ // The async validations currently in progress, keyed by URL.
+ AsyncValidationMap async_validations_;
+
base::WeakPtrFactory<HttpCache> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(HttpCache);
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index b06e8f3..5e90131 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -17,6 +17,7 @@
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
@@ -26,6 +27,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
+#include "base/values.h"
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/load_flags.h"
@@ -238,6 +240,18 @@
}
}
+base::Value* NetLogAsyncRevalidationInfoCallback(
+ const net::NetLog::Source& source,
+ const net::HttpRequestInfo* request,
+ net::NetLog::LogLevel log_level) {
+ base::DictionaryValue* dict = new base::DictionaryValue();
+ source.AddToEventParameters(dict);
+
+ dict->SetString("url", request->url.possibly_invalid_spec());
+ dict->SetString("method", request->method);
+ return dict;
+}
+
enum ExternallyConditionalizedType {
EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION,
EXTERNALLY_CONDITIONALIZED_CACHE_USABLE,
@@ -2110,7 +2124,16 @@
int HttpCache::Transaction::BeginCacheValidation() {
DCHECK(mode_ == READ_WRITE);
- bool skip_validation = !RequiresValidation();
+ ValidationType required_validation = RequiresValidation();
+
+ bool skip_validation = (required_validation == VALIDATION_NONE);
+
+ if (required_validation == VALIDATION_ASYNCHRONOUS &&
+ !(request_->method == "GET" && (truncated_ || partial_)) && cache_ &&
+ cache_->use_stale_while_revalidate()) {
+ TriggerAsyncValidation();
+ skip_validation = true;
+ }
if (request_->method == "HEAD" &&
(truncated_ || response_.headers->response_code() == 206)) {
@@ -2140,6 +2163,7 @@
}
if (skip_validation) {
+ // TODO(ricea): Is this pattern okay for asynchronous revalidations?
UpdateTransactionPattern(PATTERN_ENTRY_USED);
RecordOfflineStatus(effective_load_flags_, OFFLINE_STATUS_FRESH_CACHE);
return SetupEntryForRead();
@@ -2295,37 +2319,42 @@
return rv;
}
-bool HttpCache::Transaction::RequiresValidation() {
+ValidationType HttpCache::Transaction::RequiresValidation() {
// TODO(darin): need to do more work here:
// - make sure we have a matching request method
// - watch out for cached responses that depend on authentication
// In playback mode, nothing requires validation.
if (cache_->mode() == net::HttpCache::PLAYBACK)
- return false;
+ return VALIDATION_NONE;
if (response_.vary_data.is_valid() &&
!response_.vary_data.MatchesRequest(*request_,
*response_.headers.get())) {
vary_mismatch_ = true;
- return true;
+ return VALIDATION_SYNCHRONOUS;
}
if (effective_load_flags_ & LOAD_PREFERRING_CACHE)
- return false;
+ return VALIDATION_NONE;
- if (effective_load_flags_ & LOAD_VALIDATE_CACHE)
- return true;
+ if (effective_load_flags_ & (LOAD_VALIDATE_CACHE | LOAD_ASYNC_REVALIDATION))
+ return VALIDATION_SYNCHRONOUS;
if (request_->method == "PUT" || request_->method == "DELETE")
- return true;
+ return VALIDATION_SYNCHRONOUS;
- if (response_.headers->RequiresValidation(
- response_.request_time, response_.response_time, Time::Now())) {
- return true;
+ ValidationType validation_required_by_headers =
+ response_.headers->RequiresValidation(
+ response_.request_time, response_.response_time, Time::Now());
+
+ if (validation_required_by_headers == VALIDATION_ASYNCHRONOUS) {
+ // Asynchronous revalidation is only supported for GET and HEAD methods.
+ if (request_->method != "GET" && request_->method != "HEAD")
+ return VALIDATION_SYNCHRONOUS;
}
- return false;
+ return validation_required_by_headers;
}
bool HttpCache::Transaction::ConditionalizeRequest() {
@@ -2374,12 +2403,9 @@
if (!use_if_range) {
// stale-while-revalidate is not useful when we only have a partial response
// cached, so don't set the header in that case.
- TimeDelta stale_while_revalidate;
- if (response_.headers->GetStaleWhileRevalidateValue(
- &stale_while_revalidate) &&
- stale_while_revalidate > TimeDelta()) {
- TimeDelta max_age =
- response_.headers->GetFreshnessLifetime(response_.response_time);
+ HttpResponseHeaders::FreshnessLifetimes lifetime =
+ response_.headers->GetFreshnessLifetimes(response_.response_time);
+ if (lifetime.stale > TimeDelta()) {
TimeDelta current_age = response_.headers->GetCurrentAge(
response_.request_time, response_.response_time, Time::Now());
@@ -2387,8 +2413,8 @@
kFreshnessHeader,
base::StringPrintf("max-age=%" PRId64
",stale-while-revalidate=%" PRId64 ",age=%" PRId64,
- max_age.InSeconds(),
- stale_while_revalidate.InSeconds(),
+ lifetime.fresh.InSeconds(),
+ lifetime.stale.InSeconds(),
current_age.InSeconds()));
}
}
@@ -2557,6 +2583,25 @@
}
}
+void HttpCache::Transaction::TriggerAsyncValidation() {
+ DCHECK(!request_->upload_data_stream);
+ BoundNetLog async_revalidation_net_log(
+ BoundNetLog::Make(net_log_.net_log(), NetLog::SOURCE_ASYNC_REVALIDATION));
+ net_log_.AddEvent(
+ NetLog::TYPE_HTTP_CACHE_VALIDATE_RESOURCE_ASYNC,
+ async_revalidation_net_log.source().ToEventParametersCallback());
+ async_revalidation_net_log.BeginEvent(
+ NetLog::TYPE_ASYNC_REVALIDATION,
+ base::Bind(
+ &NetLogAsyncRevalidationInfoCallback, net_log_.source(), request_));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&HttpCache::PerformAsyncValidation,
+ cache_, // cache_ is a weak pointer.
+ *request_,
+ async_revalidation_net_log));
+}
+
void HttpCache::Transaction::FailRangeRequest() {
response_ = *new_response_;
partial_->FixResponseHeaders(response_.headers.get(), false);
diff --git a/net/http/http_cache_transaction.h b/net/http/http_cache_transaction.h
index 37fcdef..b63e859 100644
--- a/net/http/http_cache_transaction.h
+++ b/net/http/http_cache_transaction.h
@@ -16,6 +16,7 @@
#include "net/base/request_priority.h"
#include "net/http/http_cache.h"
#include "net/http/http_request_headers.h"
+#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_transaction.h"
@@ -311,8 +312,9 @@
// Returns network error code.
int RestartNetworkRequestWithAuth(const AuthCredentials& credentials);
- // Called to determine if we need to validate the cache entry before using it.
- bool RequiresValidation();
+ // Called to determine if we need to validate the cache entry before using it,
+ // and whether the validation should be synchronous or asynchronous.
+ ValidationType RequiresValidation();
// Called to make the request conditional (to ask the server if the cached
// copy is valid). Returns true if able to make the request conditional.
@@ -329,6 +331,9 @@
// Removes content-length and byte range related info if needed.
void FixHeadersForHead();
+ // Launches an asynchronous revalidation based on this transaction.
+ void TriggerAsyncValidation();
+
// Changes the response code of a range request to be 416 (Requested range not
// satisfiable).
void FailRangeRequest();
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 46dad27..a7a04f1 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -10,6 +10,7 @@
#include "base/bind_helpers.h"
#include "base/memory/scoped_vector.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/base/cache_type.h"
@@ -6757,6 +6758,52 @@
RemoveMockTransaction(&kRangeGET_TransactionOK);
}
+// Framework for tests of stale-while-revalidate related functionality. With
+// the default settings (age=3601,stale-while-revalidate=7200,max-age=3600) it
+// will trigger the stale-while-revalidate asynchronous revalidation. Setting
+// |age_| to < 3600 will prevent any revalidation, and |age_| > 10800 will cause
+// synchronous revalidation.
+class HttpCacheStaleWhileRevalidateTest : public ::testing::Test {
+ protected:
+ HttpCacheStaleWhileRevalidateTest()
+ : transaction_(kSimpleGET_Transaction),
+ age_(3601),
+ stale_while_revalidate_(7200),
+ validator_("Last-Modified: Sat, 18 Apr 2007 01:10:43 GMT") {
+ cache_.http_cache()->set_use_stale_while_revalidate_for_testing(true);
+ }
+
+ // RunTransactionTest() with the arguments from this fixture.
+ void RunFixtureTransactionTest() {
+ std::string response_headers = base::StringPrintf(
+ "%s\n"
+ "Age: %d\n"
+ "Cache-Control: max-age=3600,stale-while-revalidate=%d\n",
+ validator_.c_str(),
+ age_,
+ stale_while_revalidate_);
+ transaction_.response_headers = response_headers.c_str();
+ RunTransactionTest(cache_.http_cache(), transaction_);
+ transaction_.response_headers = "";
+ }
+
+ // How many times this test has sent requests to the (fake) origin
+ // server. Every test case needs to make at least one request to initialise
+ // the cache.
+ int transaction_count() {
+ return cache_.network_layer()->transaction_count();
+ }
+
+ // How many times an existing cache entry was opened during the test case.
+ int open_count() { return cache_.disk_cache()->open_count(); }
+
+ MockHttpCache cache_;
+ ScopedMockTransaction transaction_;
+ int age_;
+ int stale_while_revalidate_;
+ std::string validator_;
+};
+
static void CheckResourceFreshnessHeader(const net::HttpRequestInfo* request,
std::string* response_status,
std::string* response_headers,
@@ -6768,27 +6815,20 @@
// Verify that the Resource-Freshness header is sent on a revalidation if the
// stale-while-revalidate directive was on the response.
-TEST(HttpCache, ResourceFreshnessHeaderSent) {
- MockHttpCache cache;
-
- ScopedMockTransaction stale_while_revalidate_transaction(
- kSimpleGET_Transaction);
- stale_while_revalidate_transaction.response_headers =
- "Last-Modified: Sat, 18 Apr 2007 01:10:43 GMT\n"
- "Age: 10801\n"
- "Cache-Control: max-age=3600,stale-while-revalidate=7200\n";
+TEST_F(HttpCacheStaleWhileRevalidateTest, ResourceFreshnessHeaderSent) {
+ age_ = 10801; // Outside the stale-while-revalidate window.
// Write to the cache.
- RunTransactionTest(cache.http_cache(), stale_while_revalidate_transaction);
+ RunFixtureTransactionTest();
- EXPECT_EQ(1, cache.network_layer()->transaction_count());
+ EXPECT_EQ(1, transaction_count());
// Send the request again and check that Resource-Freshness header is added.
- stale_while_revalidate_transaction.handler = CheckResourceFreshnessHeader;
+ transaction_.handler = CheckResourceFreshnessHeader;
- RunTransactionTest(cache.http_cache(), stale_while_revalidate_transaction);
+ RunFixtureTransactionTest();
- EXPECT_EQ(2, cache.network_layer()->transaction_count());
+ EXPECT_EQ(2, transaction_count());
}
static void CheckResourceFreshnessAbsent(const net::HttpRequestInfo* request,
@@ -6800,27 +6840,423 @@
// Verify that the Resource-Freshness header is not sent when
// stale-while-revalidate is 0.
-TEST(HttpCache, ResourceFreshnessHeaderNotSent) {
- MockHttpCache cache;
-
- ScopedMockTransaction stale_while_revalidate_transaction(
- kSimpleGET_Transaction);
- stale_while_revalidate_transaction.response_headers =
- "Last-Modified: Sat, 18 Apr 2007 01:10:43 GMT\n"
- "Age: 10801\n"
- "Cache-Control: max-age=3600,stale-while-revalidate=0\n";
+TEST_F(HttpCacheStaleWhileRevalidateTest, ResourceFreshnessHeaderNotSent) {
+ age_ = 10801;
+ stale_while_revalidate_ = 0;
// Write to the cache.
- RunTransactionTest(cache.http_cache(), stale_while_revalidate_transaction);
+ RunFixtureTransactionTest();
- EXPECT_EQ(1, cache.network_layer()->transaction_count());
+ EXPECT_EQ(1, transaction_count());
// Send the request again and check that Resource-Freshness header is absent.
- stale_while_revalidate_transaction.handler = CheckResourceFreshnessAbsent;
+ transaction_.handler = CheckResourceFreshnessAbsent;
- RunTransactionTest(cache.http_cache(), stale_while_revalidate_transaction);
+ RunFixtureTransactionTest();
- EXPECT_EQ(2, cache.network_layer()->transaction_count());
+ EXPECT_EQ(2, transaction_count());
+}
+
+// Verify that when stale-while-revalidate applies the response is read from
+// cache.
+TEST_F(HttpCacheStaleWhileRevalidateTest, ReadFromCache) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(0, open_count());
+ EXPECT_EQ(1, transaction_count());
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, open_count());
+ EXPECT_EQ(1, transaction_count());
+}
+
+// Verify that when stale-while-revalidate applies an asynchronous request is
+// sent.
+TEST_F(HttpCacheStaleWhileRevalidateTest, AsyncRequestSent) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Let the async request execute.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(2, transaction_count());
+}
+
+// Verify that tearing down the HttpCache with an async revalidation in progress
+// does not break anything (this test is most likely to find problems when run
+// with a memory checker such as AddressSanitizer).
+TEST_F(HttpCacheStaleWhileRevalidateTest, AsyncTearDown) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+}
+
+static void CheckIfModifiedSinceHeader(const net::HttpRequestInfo* request,
+ std::string* response_status,
+ std::string* response_headers,
+ std::string* response_data) {
+ std::string value;
+ EXPECT_TRUE(request->extra_headers.GetHeader("If-Modified-Since", &value));
+ EXPECT_EQ("Sat, 18 Apr 2007 01:10:43 GMT", value);
+}
+
+// Verify that the async revalidation contains an If-Modified-Since header.
+TEST_F(HttpCacheStaleWhileRevalidateTest, AsyncRequestIfModifiedSince) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ transaction_.handler = CheckIfModifiedSinceHeader;
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+}
+
+static void CheckIfNoneMatchHeader(const net::HttpRequestInfo* request,
+ std::string* response_status,
+ std::string* response_headers,
+ std::string* response_data) {
+ std::string value;
+ EXPECT_TRUE(request->extra_headers.GetHeader("If-None-Match", &value));
+ EXPECT_EQ("\"40a1-1320-4f6adefa22a40\"", value);
+}
+
+// If the response had ETag rather than Last-Modified, then that is used to
+// conditionalise the response.
+TEST_F(HttpCacheStaleWhileRevalidateTest, AsyncRequestIfNoneMatch) {
+ validator_ = "Etag: \"40a1-1320-4f6adefa22a40\"";
+
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ transaction_.handler = CheckIfNoneMatchHeader;
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+}
+
+static void CheckResourceFreshnessHeaderPresent(
+ const net::HttpRequestInfo* request,
+ std::string* response_status,
+ std::string* response_headers,
+ std::string* response_data) {
+ EXPECT_TRUE(request->extra_headers.HasHeader("Resource-Freshness"));
+}
+
+TEST_F(HttpCacheStaleWhileRevalidateTest, AsyncRequestHasResourceFreshness) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ transaction_.handler = CheckResourceFreshnessHeaderPresent;
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+}
+
+// Verify that when age > max-age + stale-while-revalidate stale results are
+// not returned.
+TEST_F(HttpCacheStaleWhileRevalidateTest, NotAppliedIfTooStale) {
+ age_ = 10801;
+
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(0, open_count());
+ EXPECT_EQ(1, transaction_count());
+
+ // Reading back reads from the network.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, open_count());
+ EXPECT_EQ(2, transaction_count());
+}
+
+// HEAD requests should be able to take advantage of stale-while-revalidate.
+TEST_F(HttpCacheStaleWhileRevalidateTest, WorksForHeadMethod) {
+ // Write to the cache. This has to be a GET request; HEAD requests don't
+ // create new cache entries.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(0, open_count());
+ EXPECT_EQ(1, transaction_count());
+
+ // Read back from the cache, and trigger an asynchronous HEAD request.
+ transaction_.method = "HEAD";
+ transaction_.data = "";
+
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, open_count());
+ EXPECT_EQ(1, transaction_count());
+
+ // Let the network request proceed.
+ base::RunLoop().RunUntilIdle();
+
+ EXPECT_EQ(2, transaction_count());
+}
+
+// POST requests should not use stale-while-revalidate.
+TEST_F(HttpCacheStaleWhileRevalidateTest, NotAppliedToPost) {
+ transaction_ = ScopedMockTransaction(kSimplePOST_Transaction);
+
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(0, open_count());
+ EXPECT_EQ(1, transaction_count());
+
+ // Reading back reads from the network.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(0, open_count());
+ EXPECT_EQ(2, transaction_count());
+}
+
+static void CheckUrlMatches(const net::HttpRequestInfo* request,
+ std::string* response_status,
+ std::string* response_headers,
+ std::string* response_data) {
+ EXPECT_EQ("http://www.google.com/", request->url.spec());
+}
+
+// Async revalidation is issued to the original URL.
+TEST_F(HttpCacheStaleWhileRevalidateTest, AsyncRequestUrlMatches) {
+ transaction_.url = "http://www.google.com/";
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ transaction_.handler = CheckUrlMatches;
+
+ // Let the async request execute and perform the check.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(2, transaction_count());
+}
+
+class SyncLoadFlagTest : public HttpCacheStaleWhileRevalidateTest,
+ public ::testing::WithParamInterface<int> {};
+
+// Flags which should always cause the request to be synchronous.
+TEST_P(SyncLoadFlagTest, MustBeSynchronous) {
+ transaction_.load_flags |= GetParam();
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Reading back reads from the network.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(2, transaction_count());
+}
+
+INSTANTIATE_TEST_CASE_P(HttpCacheStaleWhileRevalidate,
+ SyncLoadFlagTest,
+ ::testing::Values(net::LOAD_VALIDATE_CACHE,
+ net::LOAD_BYPASS_CACHE,
+ net::LOAD_DISABLE_CACHE));
+
+TEST_F(HttpCacheStaleWhileRevalidateTest,
+ PreferringCacheDoesNotTriggerAsyncRequest) {
+ transaction_.load_flags |= net::LOAD_PREFERRING_CACHE;
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Reading back reads from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // If there was an async transaction created, it would run now.
+ base::RunLoop().RunUntilIdle();
+
+ // There was no async transaction.
+ EXPECT_EQ(1, transaction_count());
+}
+
+TEST_F(HttpCacheStaleWhileRevalidateTest, NotUsedWhenDisabled) {
+ cache_.http_cache()->set_use_stale_while_revalidate_for_testing(false);
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // A synchronous revalidation is performed.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(2, transaction_count());
+}
+
+TEST_F(HttpCacheStaleWhileRevalidateTest,
+ OnlyFromCacheDoesNotTriggerAsyncRequest) {
+ transaction_.load_flags |= net::LOAD_ONLY_FROM_CACHE;
+ transaction_.return_code = net::ERR_CACHE_MISS;
+
+ // Writing to the cache should fail, because we are avoiding the network.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(0, transaction_count());
+
+ base::RunLoop().RunUntilIdle();
+
+ // Still nothing.
+ EXPECT_EQ(0, transaction_count());
+}
+
+// A certificate error during an asynchronous fetch should cause the next fetch
+// to proceed synchronously.
+// TODO(ricea): In future, only certificate errors which require user
+// interaction should fail the asynchronous revalidation, and they should cause
+// the next revalidation to be synchronous rather than requiring a total
+// refetch. This test will need to be updated appropriately.
+TEST_F(HttpCacheStaleWhileRevalidateTest, CertificateErrorCausesRefetch) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Now read back. RunTransactionTestBase() expects to receive the network
+ // error back from the HttpCache::Transaction, but since the cache request
+ // will return OK we need to duplicate some of its implementation here.
+ transaction_.return_code = net::ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
+ net::TestCompletionCallback callback;
+ scoped_ptr<net::HttpTransaction> trans;
+ int rv =
+ cache_.http_cache()->CreateTransaction(net::DEFAULT_PRIORITY, &trans);
+ EXPECT_EQ(net::OK, rv);
+ ASSERT_TRUE(trans.get());
+
+ MockHttpRequest request(transaction_);
+ rv = trans->Start(&request, callback.callback(), net::BoundNetLog());
+ ASSERT_EQ(net::ERR_IO_PENDING, rv);
+ ASSERT_EQ(net::OK, callback.WaitForResult());
+ ReadAndVerifyTransaction(trans.get(), transaction_);
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Allow the asynchronous fetch to run.
+ base::RunLoop().RunUntilIdle();
+
+ EXPECT_EQ(2, transaction_count());
+
+ // Now run the transaction again. It should run synchronously.
+ transaction_.return_code = net::OK;
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(3, transaction_count());
+}
+
+// Ensure that the response cached by the asynchronous request is not truncated,
+// even if the server is slow.
+TEST_F(HttpCacheStaleWhileRevalidateTest, EntireResponseCached) {
+ transaction_.test_mode = TEST_MODE_SLOW_READ;
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ // Let the async request execute.
+ base::RunLoop().RunUntilIdle();
+
+ // The cache entry should still be complete.
+ transaction_.load_flags = net::LOAD_ONLY_FROM_CACHE;
+ RunFixtureTransactionTest();
+}
+
+// Verify that there are no race conditions in the completely synchronous case.
+TEST_F(HttpCacheStaleWhileRevalidateTest, SynchronousCaseWorks) {
+ transaction_.test_mode = TEST_MODE_SYNC_ALL;
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Let the async request execute.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(2, transaction_count());
+}
+
+static void CheckLoadFlagsAsyncRevalidation(const net::HttpRequestInfo* request,
+ std::string* response_status,
+ std::string* response_headers,
+ std::string* response_data) {
+ EXPECT_EQ(net::LOAD_ASYNC_REVALIDATION, request->load_flags);
+}
+
+// Check that the load flags on the async request are the same as the load flags
+// on the original request, plus LOAD_ASYNC_REVALIDATION.
+TEST_F(HttpCacheStaleWhileRevalidateTest, LoadFlagsAsyncRevalidation) {
+ transaction_.load_flags = net::LOAD_NORMAL;
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ transaction_.handler = CheckLoadFlagsAsyncRevalidation;
+ // Let the async request execute.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(2, transaction_count());
+}
+
+static void SimpleMockAuthHandler(const net::HttpRequestInfo* request,
+ std::string* response_status,
+ std::string* response_headers,
+ std::string* response_data) {
+ if (request->extra_headers.HasHeader("X-Require-Mock-Auth") &&
+ !request->extra_headers.HasHeader("Authorization")) {
+ response_status->assign("HTTP/1.1 401 Unauthorized");
+ response_headers->assign("WWW-Authenticate: Basic realm=\"mars\"\n");
+ return;
+ }
+ response_status->assign("HTTP/1.1 200 OK");
+}
+
+TEST_F(HttpCacheStaleWhileRevalidateTest, RestartForAuth) {
+ // Write to the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Now make the transaction require auth.
+ transaction_.request_headers = "X-Require-Mock-Auth: dummy\r\n\r\n";
+ transaction_.handler = SimpleMockAuthHandler;
+
+ // Read back from the cache.
+ RunFixtureTransactionTest();
+
+ EXPECT_EQ(1, transaction_count());
+
+ // Let the async request execute.
+ base::RunLoop().RunUntilIdle();
+
+ EXPECT_EQ(2, transaction_count());
}
// Tests that we allow multiple simultaneous, non-overlapping transactions to
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 1571ecc..3e602ae 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -73,6 +73,7 @@
host_mapping_rules(NULL),
enable_ssl_connect_job_waiting(false),
ignore_certificate_errors(false),
+ use_stale_while_revalidate(false),
testing_fixed_http_port(0),
testing_fixed_https_port(0),
enable_tcp_fast_open_for_ssl(false),
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index 51e2292..c084eda 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -79,6 +79,7 @@
HostMappingRules* host_mapping_rules;
bool enable_ssl_connect_job_waiting;
bool ignore_certificate_errors;
+ bool use_stale_while_revalidate;
uint16 testing_fixed_http_port;
uint16 testing_fixed_https_port;
bool enable_tcp_fast_open_for_ssl;
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc
index 3a9f7e0..5e0223a 100644
--- a/net/http/http_response_headers.cc
+++ b/net/http/http_response_headers.cc
@@ -956,15 +956,28 @@
// Of course, there are other factors that can force a response to always be
// validated or re-fetched.
//
-bool HttpResponseHeaders::RequiresValidation(const Time& request_time,
- const Time& response_time,
- const Time& current_time) const {
- TimeDelta lifetime =
- GetFreshnessLifetime(response_time);
- if (lifetime == TimeDelta())
- return true;
+// From RFC 5861 section 3, a stale response may be used while revalidation is
+// performed in the background if
+//
+// freshness_lifetime + stale_while_revalidate > current_age
+//
+ValidationType HttpResponseHeaders::RequiresValidation(
+ const Time& request_time,
+ const Time& response_time,
+ const Time& current_time) const {
+ FreshnessLifetimes lifetimes = GetFreshnessLifetimes(response_time);
+ if (lifetimes.fresh == TimeDelta() && lifetimes.stale == TimeDelta())
+ return VALIDATION_SYNCHRONOUS;
- return lifetime <= GetCurrentAge(request_time, response_time, current_time);
+ TimeDelta age = GetCurrentAge(request_time, response_time, current_time);
+
+ if (lifetimes.fresh > age)
+ return VALIDATION_NONE;
+
+ if (lifetimes.fresh + lifetimes.stale > age)
+ return VALIDATION_ASYNCHRONOUS;
+
+ return VALIDATION_SYNCHRONOUS;
}
// From RFC 2616 section 13.2.4:
@@ -987,25 +1000,35 @@
//
// freshness_lifetime = (date_value - last_modified_value) * 0.10
//
-TimeDelta HttpResponseHeaders::GetFreshnessLifetime(
- const Time& response_time) const {
+// If the stale-while-revalidate directive is present, then it is used to set
+// the |stale| time, unless it overridden by another directive.
+//
+HttpResponseHeaders::FreshnessLifetimes
+HttpResponseHeaders::GetFreshnessLifetimes(const Time& response_time) const {
+ FreshnessLifetimes lifetimes;
// Check for headers that force a response to never be fresh. For backwards
// compat, we treat "Pragma: no-cache" as a synonym for "Cache-Control:
// no-cache" even though RFC 2616 does not specify it.
if (HasHeaderValue("cache-control", "no-cache") ||
HasHeaderValue("cache-control", "no-store") ||
HasHeaderValue("pragma", "no-cache") ||
- HasHeaderValue("vary", "*")) // see RFC 2616 section 13.6
- return TimeDelta(); // not fresh
+ // Vary: * is never usable: see RFC 2616 section 13.6.
+ HasHeaderValue("vary", "*")) {
+ return lifetimes;
+ }
+
+ // Cache-Control directive must_revalidate overrides stale-while-revalidate.
+ bool must_revalidate = HasHeaderValue("cache-control", "must-revalidate");
+
+ if (must_revalidate || !GetStaleWhileRevalidateValue(&lifetimes.stale))
+ DCHECK(lifetimes.stale == TimeDelta());
// NOTE: "Cache-Control: max-age" overrides Expires, so we only check the
- // Expires header after checking for max-age in GetFreshnessLifetime. This
+ // Expires header after checking for max-age in GetFreshnessLifetimes. This
// is important since "Expires: <date in the past>" means not fresh, but
// it should not trump a max-age value.
-
- TimeDelta max_age_value;
- if (GetMaxAgeValue(&max_age_value))
- return max_age_value;
+ if (GetMaxAgeValue(&lifetimes.fresh))
+ return lifetimes;
// If there is no Date header, then assume that the server response was
// generated at the time when we received the response.
@@ -1016,10 +1039,13 @@
Time expires_value;
if (GetExpiresValue(&expires_value)) {
// The expires value can be a date in the past!
- if (expires_value > date_value)
- return expires_value - date_value;
+ if (expires_value > date_value) {
+ lifetimes.fresh = expires_value - date_value;
+ return lifetimes;
+ }
- return TimeDelta(); // not fresh
+ DCHECK(lifetimes.fresh == TimeDelta());
+ return lifetimes;
}
// From RFC 2616 section 13.4:
@@ -1047,24 +1073,31 @@
// experimental RFC that adds 308 permanent redirect as well, for which "any
// future references ... SHOULD use one of the returned URIs."
if ((response_code_ == 200 || response_code_ == 203 ||
- response_code_ == 206) &&
- !HasHeaderValue("cache-control", "must-revalidate")) {
+ response_code_ == 206) && !must_revalidate) {
// TODO(darin): Implement a smarter heuristic.
Time last_modified_value;
if (GetLastModifiedValue(&last_modified_value)) {
- // The last-modified value can be a date in the past!
- if (last_modified_value <= date_value)
- return (date_value - last_modified_value) / 10;
+ // The last-modified value can be a date in the future!
+ if (last_modified_value <= date_value) {
+ lifetimes.fresh = (date_value - last_modified_value) / 10;
+ return lifetimes;
+ }
}
}
// These responses are implicitly fresh (unless otherwise overruled):
if (response_code_ == 300 || response_code_ == 301 || response_code_ == 308 ||
response_code_ == 410) {
- return TimeDelta::Max();
+ lifetimes.fresh = TimeDelta::Max();
+ lifetimes.stale = TimeDelta(); // It should never be stale.
+ return lifetimes;
}
- return TimeDelta(); // not fresh
+ // Our heuristic freshness estimate for this resource is 0 seconds, in
+ // accordance with common browser behaviour. However, stale-while-revalidate
+ // may still apply.
+ DCHECK(lifetimes.fresh == TimeDelta());
+ return lifetimes;
}
// From RFC 2616 section 13.2.3:
diff --git a/net/http/http_response_headers.h b/net/http/http_response_headers.h
index ddab798..ac7c351 100644
--- a/net/http/http_response_headers.h
+++ b/net/http/http_response_headers.h
@@ -28,6 +28,12 @@
class HttpByteRange;
+enum ValidationType {
+ VALIDATION_NONE = 0, // The resource is fresh.
+ VALIDATION_ASYNCHRONOUS, // The resource requires async revalidation.
+ VALIDATION_SYNCHRONOUS // The resource requires sync revalidation.
+};
+
// HttpResponseHeaders: parses and holds HTTP response headers.
class NET_EXPORT HttpResponseHeaders
: public base::RefCountedThreadSafe<HttpResponseHeaders> {
@@ -43,6 +49,14 @@
static const PersistOptions PERSIST_SANS_RANGES = 1 << 4;
static const PersistOptions PERSIST_SANS_SECURITY_STATE = 1 << 5;
+ struct FreshnessLifetimes {
+ // How long the resource will be fresh for.
+ base::TimeDelta fresh;
+ // How long after becoming not fresh that the resource will be stale but
+ // usable (if async revalidation is enabled).
+ base::TimeDelta stale;
+ };
+
static const char kContentRange[];
// Parses the given raw_headers. raw_headers should be formatted thus:
@@ -201,19 +215,28 @@
// redirect.
static bool IsRedirectResponseCode(int response_code);
- // Returns true if the response cannot be reused without validation. The
- // result is relative to the current_time parameter, which is a parameter to
- // support unit testing. The request_time parameter indicates the time at
- // which the request was made that resulted in this response, which was
- // received at response_time.
- bool RequiresValidation(const base::Time& request_time,
- const base::Time& response_time,
- const base::Time& current_time) const;
+ // Returns VALIDATION_NONE if the response can be reused without
+ // validation. VALIDATION_ASYNCHRONOUS means the response can be re-used, but
+ // asynchronous revalidation must be performed. VALIDATION_SYNCHRONOUS means
+ // that the result cannot be reused without revalidation.
+ // The result is relative to the current_time parameter, which is
+ // a parameter to support unit testing. The request_time parameter indicates
+ // the time at which the request was made that resulted in this response,
+ // which was received at response_time.
+ ValidationType RequiresValidation(const base::Time& request_time,
+ const base::Time& response_time,
+ const base::Time& current_time) const;
- // Returns the amount of time the server claims the response is fresh from
+ // Calculates the amount of time the server claims the response is fresh from
// the time the response was generated. See section 13.2.4 of RFC 2616. See
- // RequiresValidation for a description of the response_time parameter.
- base::TimeDelta GetFreshnessLifetime(const base::Time& response_time) const;
+ // RequiresValidation for a description of the response_time parameter. Sets
+ // |FreshnessLifetimes.fresh| to the length of time the response may be used
+ // without revalidation, and |FreshnessLifetimes.stale| to the length of time
+ // the response may be used stale with asynchronous revalidation if
+ // stale-while-revalidate support is enabled. See RFC 5861 section 3 for the
+ // definition of stale-while-revalidate.
+ FreshnessLifetimes GetFreshnessLifetimes(
+ const base::Time& response_time) const;
// Returns the age of the response. See section 13.2.3 of RFC 2616.
// See RequiresValidation for a description of this method's parameters.
diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc
index 098ce73..c0e8598 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -777,9 +777,14 @@
ContentTypeTest,
testing::ValuesIn(mimetype_tests));
+using net::ValidationType;
+using net::VALIDATION_NONE;
+using net::VALIDATION_SYNCHRONOUS;
+using net::VALIDATION_ASYNCHRONOUS;
+
struct RequiresValidationTestData {
const char* headers;
- bool requires_validation;
+ ValidationType validation_type;
};
class RequiresValidationTest
@@ -800,41 +805,41 @@
scoped_refptr<net::HttpResponseHeaders> parsed(
new net::HttpResponseHeaders(headers));
- bool requires_validation =
+ ValidationType validation_type =
parsed->RequiresValidation(request_time, response_time, current_time);
- EXPECT_EQ(test.requires_validation, requires_validation);
+ EXPECT_EQ(test.validation_type, validation_type);
}
const struct RequiresValidationTestData requires_validation_tests[] = {
// No expiry info: expires immediately.
{ "HTTP/1.1 200 OK\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// No expiry info: expires immediately.
{ "HTTP/1.1 200 OK\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// Valid for a little while.
{ "HTTP/1.1 200 OK\n"
"cache-control: max-age=10000\n"
"\n",
- false
+ VALIDATION_NONE
},
// Expires in the future.
{ "HTTP/1.1 200 OK\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"expires: Wed, 28 Nov 2007 01:00:00 GMT\n"
"\n",
- false
+ VALIDATION_NONE
},
// Already expired.
{ "HTTP/1.1 200 OK\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"expires: Wed, 28 Nov 2007 00:00:00 GMT\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// Max-age trumps expires.
{ "HTTP/1.1 200 OK\n"
@@ -842,77 +847,77 @@
"expires: Wed, 28 Nov 2007 00:00:00 GMT\n"
"cache-control: max-age=10000\n"
"\n",
- false
+ VALIDATION_NONE
},
// Last-modified heuristic: modified a while ago.
{ "HTTP/1.1 200 OK\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"last-modified: Wed, 27 Nov 2007 08:00:00 GMT\n"
"\n",
- false
+ VALIDATION_NONE
},
{ "HTTP/1.1 203 Non-Authoritative Information\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"last-modified: Wed, 27 Nov 2007 08:00:00 GMT\n"
"\n",
- false
+ VALIDATION_NONE
},
{ "HTTP/1.1 206 Partial Content\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"last-modified: Wed, 27 Nov 2007 08:00:00 GMT\n"
"\n",
- false
+ VALIDATION_NONE
},
// Last-modified heuristic: modified recently.
{ "HTTP/1.1 200 OK\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"last-modified: Wed, 28 Nov 2007 00:40:10 GMT\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
{ "HTTP/1.1 203 Non-Authoritative Information\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"last-modified: Wed, 28 Nov 2007 00:40:10 GMT\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
{ "HTTP/1.1 206 Partial Content\n"
"date: Wed, 28 Nov 2007 00:40:11 GMT\n"
"last-modified: Wed, 28 Nov 2007 00:40:10 GMT\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// Cached permanent redirect.
{ "HTTP/1.1 301 Moved Permanently\n"
"\n",
- false
+ VALIDATION_NONE
},
// Another cached permanent redirect.
{ "HTTP/1.1 308 Permanent Redirect\n"
"\n",
- false
+ VALIDATION_NONE
},
// Cached redirect: not reusable even though by default it would be.
{ "HTTP/1.1 300 Multiple Choices\n"
"Cache-Control: no-cache\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// Cached forever by default.
{ "HTTP/1.1 410 Gone\n"
"\n",
- false
+ VALIDATION_NONE
},
// Cached temporary redirect: not reusable.
{ "HTTP/1.1 302 Found\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// Cached temporary redirect: reusable.
{ "HTTP/1.1 302 Found\n"
"cache-control: max-age=10000\n"
"\n",
- false
+ VALIDATION_NONE
},
// Cache-control: max-age=N overrides expires: date in the past.
{ "HTTP/1.1 200 OK\n"
@@ -920,7 +925,7 @@
"expires: Wed, 28 Nov 2007 00:20:11 GMT\n"
"cache-control: max-age=10000\n"
"\n",
- false
+ VALIDATION_NONE
},
// Cache-control: no-store overrides expires: in the future.
{ "HTTP/1.1 200 OK\n"
@@ -928,7 +933,7 @@
"expires: Wed, 29 Nov 2007 00:40:11 GMT\n"
"cache-control: no-store,private,no-cache=\"foo\"\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
},
// Pragma: no-cache overrides last-modified heuristic.
{ "HTTP/1.1 200 OK\n"
@@ -936,7 +941,60 @@
"last-modified: Wed, 27 Nov 2007 08:00:00 GMT\n"
"pragma: no-cache\n"
"\n",
- true
+ VALIDATION_SYNCHRONOUS
+ },
+ // max-age has expired, needs synchronous revalidation
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: max-age=300\n"
+ "\n",
+ VALIDATION_SYNCHRONOUS
+ },
+ // max-age has expired, stale-while-revalidate has not, eligible for
+ // asynchronous revalidation
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: max-age=300, stale-while-revalidate=3600\n"
+ "\n",
+ VALIDATION_ASYNCHRONOUS
+ },
+ // max-age and stale-while-revalidate have expired, needs synchronous
+ // revalidation
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: max-age=300, stale-while-revalidate=5\n"
+ "\n",
+ VALIDATION_SYNCHRONOUS
+ },
+ // max-age is 0, stale-while-revalidate is large enough to permit
+ // asynchronous revalidation
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: max-age=0, stale-while-revalidate=360\n"
+ "\n",
+ VALIDATION_ASYNCHRONOUS
+ },
+ // stale-while-revalidate must not override no-cache or similar directives.
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: no-cache, stale-while-revalidate=360\n"
+ "\n",
+ VALIDATION_SYNCHRONOUS
+ },
+ // max-age has not expired, so no revalidation is needed.
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: max-age=3600, stale-while-revalidate=3600\n"
+ "\n",
+ VALIDATION_NONE
+ },
+ // must-revalidate overrides stale-while-revalidate, so synchronous validation
+ // is needed.
+ { "HTTP/1.1 200 OK\n"
+ "date: Wed, 28 Nov 2007 00:40:11 GMT\n"
+ "cache-control: must-revalidate, max-age=300, stale-while-revalidate=3600\n"
+ "\n",
+ VALIDATION_SYNCHRONOUS
},
// TODO(darin): Add many many more tests here.
diff --git a/net/http/http_transaction_test_util.cc b/net/http/http_transaction_test_util.cc
index 7d031d8..dbbca6c 100644
--- a/net/http/http_transaction_test_util.cc
+++ b/net/http/http_transaction_test_util.cc
@@ -277,8 +277,13 @@
if (!request_)
return false;
- // Only mock auth when the test asks for it.
- return request_->extra_headers.HasHeader("X-Require-Mock-Auth");
+ if (!request_->extra_headers.HasHeader("X-Require-Mock-Auth"))
+ return false;
+
+ // Allow the mock server to decide whether authentication is required or not.
+ std::string status_line = response_.headers->GetStatusLine();
+ return status_line.find(" 401 ") != std::string::npos ||
+ status_line.find(" 407 ") != std::string::npos;
}
int MockNetworkTransaction::Read(net::IOBuffer* buf, int buf_len,
diff --git a/net/http/mock_gssapi_library_posix.h b/net/http/mock_gssapi_library_posix.h
index d35f7f5..faecdd4 100644
--- a/net/http/mock_gssapi_library_posix.h
+++ b/net/http/mock_gssapi_library_posix.h
@@ -15,6 +15,8 @@
MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9
// Including gssapi.h directly is deprecated in the 10.9 SDK.
#include <GSS/gssapi.h>
+#elif defined(OS_FREEBSD)
+#include <gssapi/gssapi.h>
#else
#include <gssapi.h>
#endif
diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_state.cc
index b00bc57..d1091be 100644
--- a/net/http/transport_security_state.cc
+++ b/net/http/transport_security_state.cc
@@ -270,372 +270,340 @@
return new_host;
}
-// |ReportUMAOnPinFailure| uses these to report which domain was associated
-// with the public key pinning failure.
-//
-// DO NOT CHANGE THE ORDERING OF THESE NAMES OR REMOVE ANY OF THEM. Add new
-// domains at the END of the listing (but before DOMAIN_NUM_EVENTS).
-enum SecondLevelDomainName {
- DOMAIN_NOT_PINNED,
+// BitReader is a class that allows a bytestring to be read bit-by-bit.
+class BitReader {
+ public:
+ BitReader(const uint8* bytes, size_t num_bits)
+ : bytes_(bytes),
+ num_bits_(num_bits),
+ num_bytes_((num_bits + 7) / 8),
+ current_byte_index_(0),
+ num_bits_used_(8) {}
- DOMAIN_GOOGLE_COM,
- DOMAIN_ANDROID_COM,
- DOMAIN_GOOGLE_ANALYTICS_COM,
- DOMAIN_GOOGLEPLEX_COM,
- DOMAIN_YTIMG_COM,
- DOMAIN_GOOGLEUSERCONTENT_COM,
- DOMAIN_YOUTUBE_COM,
- DOMAIN_GOOGLEAPIS_COM,
- DOMAIN_GOOGLEADSERVICES_COM,
- DOMAIN_GOOGLECODE_COM,
- DOMAIN_APPSPOT_COM,
- DOMAIN_GOOGLESYNDICATION_COM,
- DOMAIN_DOUBLECLICK_NET,
- DOMAIN_GSTATIC_COM,
- DOMAIN_GMAIL_COM,
- DOMAIN_GOOGLEMAIL_COM,
- DOMAIN_GOOGLEGROUPS_COM,
-
- DOMAIN_TORPROJECT_ORG,
-
- DOMAIN_TWITTER_COM,
- DOMAIN_TWIMG_COM,
-
- DOMAIN_AKAMAIHD_NET,
-
- DOMAIN_TOR2WEB_ORG,
-
- DOMAIN_YOUTU_BE,
- DOMAIN_GOOGLECOMMERCE_COM,
- DOMAIN_URCHIN_COM,
- DOMAIN_GOO_GL,
- DOMAIN_G_CO,
- DOMAIN_GOOGLE_AC,
- DOMAIN_GOOGLE_AD,
- DOMAIN_GOOGLE_AE,
- DOMAIN_GOOGLE_AF,
- DOMAIN_GOOGLE_AG,
- DOMAIN_GOOGLE_AM,
- DOMAIN_GOOGLE_AS,
- DOMAIN_GOOGLE_AT,
- DOMAIN_GOOGLE_AZ,
- DOMAIN_GOOGLE_BA,
- DOMAIN_GOOGLE_BE,
- DOMAIN_GOOGLE_BF,
- DOMAIN_GOOGLE_BG,
- DOMAIN_GOOGLE_BI,
- DOMAIN_GOOGLE_BJ,
- DOMAIN_GOOGLE_BS,
- DOMAIN_GOOGLE_BY,
- DOMAIN_GOOGLE_CA,
- DOMAIN_GOOGLE_CAT,
- DOMAIN_GOOGLE_CC,
- DOMAIN_GOOGLE_CD,
- DOMAIN_GOOGLE_CF,
- DOMAIN_GOOGLE_CG,
- DOMAIN_GOOGLE_CH,
- DOMAIN_GOOGLE_CI,
- DOMAIN_GOOGLE_CL,
- DOMAIN_GOOGLE_CM,
- DOMAIN_GOOGLE_CN,
- DOMAIN_CO_AO,
- DOMAIN_CO_BW,
- DOMAIN_CO_CK,
- DOMAIN_CO_CR,
- DOMAIN_CO_HU,
- DOMAIN_CO_ID,
- DOMAIN_CO_IL,
- DOMAIN_CO_IM,
- DOMAIN_CO_IN,
- DOMAIN_CO_JE,
- DOMAIN_CO_JP,
- DOMAIN_CO_KE,
- DOMAIN_CO_KR,
- DOMAIN_CO_LS,
- DOMAIN_CO_MA,
- DOMAIN_CO_MZ,
- DOMAIN_CO_NZ,
- DOMAIN_CO_TH,
- DOMAIN_CO_TZ,
- DOMAIN_CO_UG,
- DOMAIN_CO_UK,
- DOMAIN_CO_UZ,
- DOMAIN_CO_VE,
- DOMAIN_CO_VI,
- DOMAIN_CO_ZA,
- DOMAIN_CO_ZM,
- DOMAIN_CO_ZW,
- DOMAIN_COM_AF,
- DOMAIN_COM_AG,
- DOMAIN_COM_AI,
- DOMAIN_COM_AR,
- DOMAIN_COM_AU,
- DOMAIN_COM_BD,
- DOMAIN_COM_BH,
- DOMAIN_COM_BN,
- DOMAIN_COM_BO,
- DOMAIN_COM_BR,
- DOMAIN_COM_BY,
- DOMAIN_COM_BZ,
- DOMAIN_COM_CN,
- DOMAIN_COM_CO,
- DOMAIN_COM_CU,
- DOMAIN_COM_CY,
- DOMAIN_COM_DO,
- DOMAIN_COM_EC,
- DOMAIN_COM_EG,
- DOMAIN_COM_ET,
- DOMAIN_COM_FJ,
- DOMAIN_COM_GE,
- DOMAIN_COM_GH,
- DOMAIN_COM_GI,
- DOMAIN_COM_GR,
- DOMAIN_COM_GT,
- DOMAIN_COM_HK,
- DOMAIN_COM_IQ,
- DOMAIN_COM_JM,
- DOMAIN_COM_JO,
- DOMAIN_COM_KH,
- DOMAIN_COM_KW,
- DOMAIN_COM_LB,
- DOMAIN_COM_LY,
- DOMAIN_COM_MT,
- DOMAIN_COM_MX,
- DOMAIN_COM_MY,
- DOMAIN_COM_NA,
- DOMAIN_COM_NF,
- DOMAIN_COM_NG,
- DOMAIN_COM_NI,
- DOMAIN_COM_NP,
- DOMAIN_COM_NR,
- DOMAIN_COM_OM,
- DOMAIN_COM_PA,
- DOMAIN_COM_PE,
- DOMAIN_COM_PH,
- DOMAIN_COM_PK,
- DOMAIN_COM_PL,
- DOMAIN_COM_PR,
- DOMAIN_COM_PY,
- DOMAIN_COM_QA,
- DOMAIN_COM_RU,
- DOMAIN_COM_SA,
- DOMAIN_COM_SB,
- DOMAIN_COM_SG,
- DOMAIN_COM_SL,
- DOMAIN_COM_SV,
- DOMAIN_COM_TJ,
- DOMAIN_COM_TN,
- DOMAIN_COM_TR,
- DOMAIN_COM_TW,
- DOMAIN_COM_UA,
- DOMAIN_COM_UY,
- DOMAIN_COM_VC,
- DOMAIN_COM_VE,
- DOMAIN_COM_VN,
- DOMAIN_GOOGLE_CV,
- DOMAIN_GOOGLE_CZ,
- DOMAIN_GOOGLE_DE,
- DOMAIN_GOOGLE_DJ,
- DOMAIN_GOOGLE_DK,
- DOMAIN_GOOGLE_DM,
- DOMAIN_GOOGLE_DZ,
- DOMAIN_GOOGLE_EE,
- DOMAIN_GOOGLE_ES,
- DOMAIN_GOOGLE_FI,
- DOMAIN_GOOGLE_FM,
- DOMAIN_GOOGLE_FR,
- DOMAIN_GOOGLE_GA,
- DOMAIN_GOOGLE_GE,
- DOMAIN_GOOGLE_GG,
- DOMAIN_GOOGLE_GL,
- DOMAIN_GOOGLE_GM,
- DOMAIN_GOOGLE_GP,
- DOMAIN_GOOGLE_GR,
- DOMAIN_GOOGLE_GY,
- DOMAIN_GOOGLE_HK,
- DOMAIN_GOOGLE_HN,
- DOMAIN_GOOGLE_HR,
- DOMAIN_GOOGLE_HT,
- DOMAIN_GOOGLE_HU,
- DOMAIN_GOOGLE_IE,
- DOMAIN_GOOGLE_IM,
- DOMAIN_GOOGLE_INFO,
- DOMAIN_GOOGLE_IQ,
- DOMAIN_GOOGLE_IS,
- DOMAIN_GOOGLE_IT,
- DOMAIN_IT_AO,
- DOMAIN_GOOGLE_JE,
- DOMAIN_GOOGLE_JO,
- DOMAIN_GOOGLE_JOBS,
- DOMAIN_GOOGLE_JP,
- DOMAIN_GOOGLE_KG,
- DOMAIN_GOOGLE_KI,
- DOMAIN_GOOGLE_KZ,
- DOMAIN_GOOGLE_LA,
- DOMAIN_GOOGLE_LI,
- DOMAIN_GOOGLE_LK,
- DOMAIN_GOOGLE_LT,
- DOMAIN_GOOGLE_LU,
- DOMAIN_GOOGLE_LV,
- DOMAIN_GOOGLE_MD,
- DOMAIN_GOOGLE_ME,
- DOMAIN_GOOGLE_MG,
- DOMAIN_GOOGLE_MK,
- DOMAIN_GOOGLE_ML,
- DOMAIN_GOOGLE_MN,
- DOMAIN_GOOGLE_MS,
- DOMAIN_GOOGLE_MU,
- DOMAIN_GOOGLE_MV,
- DOMAIN_GOOGLE_MW,
- DOMAIN_GOOGLE_NE,
- DOMAIN_NE_JP,
- DOMAIN_GOOGLE_NET,
- DOMAIN_GOOGLE_NL,
- DOMAIN_GOOGLE_NO,
- DOMAIN_GOOGLE_NR,
- DOMAIN_GOOGLE_NU,
- DOMAIN_OFF_AI,
- DOMAIN_GOOGLE_PK,
- DOMAIN_GOOGLE_PL,
- DOMAIN_GOOGLE_PN,
- DOMAIN_GOOGLE_PS,
- DOMAIN_GOOGLE_PT,
- DOMAIN_GOOGLE_RO,
- DOMAIN_GOOGLE_RS,
- DOMAIN_GOOGLE_RU,
- DOMAIN_GOOGLE_RW,
- DOMAIN_GOOGLE_SC,
- DOMAIN_GOOGLE_SE,
- DOMAIN_GOOGLE_SH,
- DOMAIN_GOOGLE_SI,
- DOMAIN_GOOGLE_SK,
- DOMAIN_GOOGLE_SM,
- DOMAIN_GOOGLE_SN,
- DOMAIN_GOOGLE_SO,
- DOMAIN_GOOGLE_ST,
- DOMAIN_GOOGLE_TD,
- DOMAIN_GOOGLE_TG,
- DOMAIN_GOOGLE_TK,
- DOMAIN_GOOGLE_TL,
- DOMAIN_GOOGLE_TM,
- DOMAIN_GOOGLE_TN,
- DOMAIN_GOOGLE_TO,
- DOMAIN_GOOGLE_TP,
- DOMAIN_GOOGLE_TT,
- DOMAIN_GOOGLE_US,
- DOMAIN_GOOGLE_UZ,
- DOMAIN_GOOGLE_VG,
- DOMAIN_GOOGLE_VU,
- DOMAIN_GOOGLE_WS,
-
- DOMAIN_CHROMIUM_ORG,
-
- DOMAIN_CRYPTO_CAT,
- DOMAIN_LAVABIT_COM,
-
- DOMAIN_GOOGLETAGMANAGER_COM,
- DOMAIN_GOOGLETAGSERVICES_COM,
-
- DOMAIN_DROPBOX_COM,
- DOMAIN_YOUTUBE_NOCOOKIE_COM,
- DOMAIN_2MDN_NET,
-
- // Boundary value for UMA_HISTOGRAM_ENUMERATION:
- DOMAIN_NUM_EVENTS
-};
-
-// PublicKeyPins contains a number of SubjectPublicKeyInfo hashes for a site.
-// The validated certificate chain for the site must not include any of
-// |excluded_hashes| and must include one or more of |required_hashes|.
-struct PublicKeyPins {
- const char* const* required_hashes;
- const char* const* excluded_hashes;
-};
-
-struct HSTSPreload {
- uint8 length;
- bool include_subdomains;
- char dns_name[38];
- bool https_required;
- PublicKeyPins pins;
- SecondLevelDomainName second_level_domain_name;
-};
-
-static bool HasPreload(const struct HSTSPreload* entries,
- size_t num_entries,
- const std::string& canonicalized_host,
- size_t i,
- bool enable_static_pins,
- TransportSecurityState::DomainState* out,
- bool* ret) {
- for (size_t j = 0; j < num_entries; j++) {
- if (entries[j].length == canonicalized_host.size() - i &&
- memcmp(entries[j].dns_name, &canonicalized_host[i],
- entries[j].length) == 0) {
- if (!entries[j].include_subdomains && i != 0) {
- *ret = false;
- } else {
- out->sts.include_subdomains = entries[j].include_subdomains;
- out->sts.last_observed = base::GetBuildTime();
- *ret = true;
- out->sts.upgrade_mode =
- TransportSecurityState::DomainState::MODE_FORCE_HTTPS;
- if (!entries[j].https_required)
- out->sts.upgrade_mode =
- TransportSecurityState::DomainState::MODE_DEFAULT;
-
- if (enable_static_pins) {
- out->pkp.include_subdomains = entries[j].include_subdomains;
- out->pkp.last_observed = base::GetBuildTime();
- if (entries[j].pins.required_hashes) {
- const char* const* sha1_hash = entries[j].pins.required_hashes;
- while (*sha1_hash) {
- AddHash(*sha1_hash, &out->pkp.spki_hashes);
- sha1_hash++;
- }
- }
- if (entries[j].pins.excluded_hashes) {
- const char* const* sha1_hash = entries[j].pins.excluded_hashes;
- while (*sha1_hash) {
- AddHash(*sha1_hash, &out->pkp.bad_spki_hashes);
- sha1_hash++;
- }
- }
- }
+ // Next sets |*out| to the next bit from the input. It returns false if no
+ // more bits are available or true otherwise.
+ bool Next(bool* out) {
+ if (num_bits_used_ == 8) {
+ if (current_byte_index_ >= num_bytes_) {
+ return false;
}
- return true;
+ current_byte_ = bytes_[current_byte_index_++];
+ num_bits_used_ = 0;
+ }
+
+ *out = 1 & (current_byte_ >> (7 - num_bits_used_));
+ num_bits_used_++;
+ return true;
+ }
+
+ // Read sets the |num_bits| least-significant bits of |*out| to the value of
+ // the next |num_bits| bits from the input. It returns false if there are
+ // insufficient bits in the input or true otherwise.
+ bool Read(unsigned num_bits, uint32* out) {
+ DCHECK_LE(num_bits, 32u);
+
+ uint32 ret = 0;
+ for (unsigned i = 0; i < num_bits; ++i) {
+ bool bit;
+ if (!Next(&bit)) {
+ return false;
+ }
+ ret |= static_cast<uint32>(bit) << (num_bits - 1 - i);
+ }
+
+ *out = ret;
+ return true;
+ }
+
+ // Unary sets |*out| to the result of decoding a unary value from the input.
+ // It returns false if there were insufficient bits in the input and true
+ // otherwise.
+ bool Unary(size_t* out) {
+ size_t ret = 0;
+
+ for (;;) {
+ bool bit;
+ if (!Next(&bit)) {
+ return false;
+ }
+ if (!bit) {
+ break;
+ }
+ ret++;
+ }
+
+ *out = ret;
+ return true;
+ }
+
+ // Seek sets the current offest in the input to bit number |offset|. It
+ // returns true if |offset| is within the range of the input and false
+ // otherwise.
+ bool Seek(size_t offset) {
+ if (offset >= num_bits_) {
+ return false;
+ }
+ current_byte_index_ = offset / 8;
+ current_byte_ = bytes_[current_byte_index_++];
+ num_bits_used_ = offset % 8;
+ return true;
+ }
+
+ private:
+ const uint8* const bytes_;
+ const size_t num_bits_;
+ const size_t num_bytes_;
+ // current_byte_index_ contains the current byte offset in |bytes_|.
+ size_t current_byte_index_;
+ // current_byte_ contains the current byte of the input.
+ uint8 current_byte_;
+ // num_bits_used_ contains the number of bits of |current_byte_| that have
+ // been read.
+ unsigned num_bits_used_;
+};
+
+// HuffmanDecoder is a very simple Huffman reader. The input Huffman tree is
+// simply encoded as a series of two-byte structures. The first byte determines
+// the "0" pointer for that node and the second the "1" pointer. Each byte
+// either has the MSB set, in which case the bottom 7 bits are the value for
+// that position, or else the bottom seven bits contain the index of a node.
+//
+// The tree is decoded by walking rather than a table-driven approach.
+class HuffmanDecoder {
+ public:
+ HuffmanDecoder(const uint8* tree, size_t tree_bytes)
+ : tree_(tree),
+ tree_bytes_(tree_bytes) {}
+
+ bool Decode(BitReader* reader, char* out) {
+ const uint8* current = &tree_[tree_bytes_-2];
+
+ for (;;) {
+ bool bit;
+ if (!reader->Next(&bit)) {
+ return false;
+ }
+
+ uint8 b = current[bit];
+ if (b & 0x80) {
+ *out = static_cast<char>(b & 0x7f);
+ return true;
+ }
+
+ unsigned offset = static_cast<unsigned>(b) * 2;
+ DCHECK_LT(offset, tree_bytes_);
+ if (offset >= tree_bytes_) {
+ return false;
+ }
+
+ current = &tree_[offset];
}
}
- return false;
-}
+
+ private:
+ const uint8* const tree_;
+ const size_t tree_bytes_;
+};
#include "net/http/transport_security_state_static.h"
-// Returns the HSTSPreload entry for the |canonicalized_host| in |entries|,
-// or NULL if there is none. Prefers exact hostname matches to those that
-// match only because HSTSPreload.include_subdomains is true.
+// PreloadResult is the result of resolving a specific name in the preloaded
+// data.
+struct PreloadResult {
+ uint32 pinset_id;
+ uint32 domain_id;
+ // hostname_offset contains the number of bytes from the start of the given
+ // hostname where the name of the matching entry starts.
+ size_t hostname_offset;
+ bool include_subdomains;
+ bool force_https;
+ bool has_pins;
+};
+
+// DecodeHSTSPreloadRaw resolves |hostname| in the preloaded data. It returns
+// false on internal error and true otherwise. After a successful return,
+// |*out_found| is true iff a relevant entry has been found. If so, |*out|
+// contains the details.
//
-// |canonicalized_host| should be the hostname as canonicalized by
-// CanonicalizeHost.
-static const struct HSTSPreload* GetHSTSPreload(
- const std::string& canonicalized_host,
- const struct HSTSPreload* entries,
- size_t num_entries) {
- for (size_t i = 0; canonicalized_host[i]; i += canonicalized_host[i] + 1) {
- for (size_t j = 0; j < num_entries; j++) {
- const struct HSTSPreload* entry = entries + j;
+// Don't call this function, call DecodeHSTSPreload, below.
+//
+// Although this code should be robust, it never processes attacker-controlled
+// data -- it only operates on the preloaded data built into the binary.
+//
+// The preloaded data is represented as a trie and matches the hostname
+// backwards. Each node in the trie starts with a number of characters, which
+// must match exactly. After that is a dispatch table which maps the next
+// character in the hostname to another node in the trie.
+//
+// In the dispatch table, the zero character represents the "end of string"
+// (which is the *beginning* of a hostname since we process it backwards). The
+// value in that case is special -- rather than an offset to another trie node,
+// it contains the HSTS information: whether subdomains are included, pinsets
+// etc. If an "end of string" matches a period in the hostname then the
+// information is remembered because, if no more specific node is found, then
+// that information applies to the hostname.
+//
+// Dispatch tables are always given in order, but the "end of string" (zero)
+// value always comes before an entry for '.'.
+bool DecodeHSTSPreloadRaw(const std::string& hostname,
+ bool* out_found,
+ PreloadResult* out) {
+ HuffmanDecoder huffman(kHSTSHuffmanTree, sizeof(kHSTSHuffmanTree));
+ BitReader reader(kPreloadedHSTSData, kPreloadedHSTSBits);
+ size_t bit_offset = kHSTSRootPosition;
+ static const char kEndOfString = 0;
+ static const char kEndOfTable = 127;
- if (i != 0 && !entry->include_subdomains)
+ *out_found = false;
+
+ if (hostname.empty()) {
+ return true;
+ }
+ // hostname_offset contains one more than the index of the current character
+ // in the hostname that is being considered. It's one greater so that we can
+ // represent the position just before the beginning (with zero).
+ size_t hostname_offset = hostname.size();
+
+ for (;;) {
+ // Seek to the desired location.
+ if (!reader.Seek(bit_offset)) {
+ return false;
+ }
+
+ // Decode the unary length of the common prefix.
+ size_t prefix_length;
+ if (!reader.Unary(&prefix_length)) {
+ return false;
+ }
+
+ // Match each character in the prefix.
+ for (size_t i = 0; i < prefix_length; ++i) {
+ if (hostname_offset == 0) {
+ // We can't match the terminator with a prefix string.
+ return true;
+ }
+
+ char c;
+ if (!huffman.Decode(&reader, &c)) {
+ return false;
+ }
+ if (hostname[hostname_offset - 1] != c) {
+ return true;
+ }
+ hostname_offset--;
+ }
+
+ bool is_first_offset = true;
+ size_t current_offset = 0;
+
+ // Next is the dispatch table.
+ for (;;) {
+ char c;
+ if (!huffman.Decode(&reader, &c)) {
+ return false;
+ }
+ if (c == kEndOfTable) {
+ // No exact match.
+ return true;
+ }
+
+ if (c == kEndOfString) {
+ PreloadResult tmp;
+ if (!reader.Next(&tmp.include_subdomains) ||
+ !reader.Next(&tmp.force_https) ||
+ !reader.Next(&tmp.has_pins)) {
+ return false;
+ }
+
+ if (tmp.has_pins) {
+ if (!reader.Read(4, &tmp.pinset_id) ||
+ !reader.Read(9, &tmp.domain_id)) {
+ return false;
+ }
+ }
+
+ tmp.hostname_offset = hostname_offset;
+
+ if (hostname_offset == 0 || hostname[hostname_offset - 1] == '.') {
+ *out_found = tmp.include_subdomains;
+ *out = tmp;
+ }
+
+ if (hostname_offset == 0) {
+ *out_found = true;
+ return true;
+ }
+
continue;
+ }
- if (entry->length == canonicalized_host.size() - i &&
- memcmp(entry->dns_name, &canonicalized_host[i], entry->length) == 0) {
- return entry;
+ // The entries in a dispatch table are in order thus we can tell if there
+ // will be no match if the current character past the one that we want.
+ if (hostname_offset == 0 || hostname[hostname_offset-1] < c) {
+ return true;
+ }
+
+ if (is_first_offset) {
+ // The first offset is backwards from the current position.
+ uint32 jump_delta_bits;
+ uint32 jump_delta;
+ if (!reader.Read(5, &jump_delta_bits) ||
+ !reader.Read(jump_delta_bits, &jump_delta)) {
+ return false;
+ }
+
+ if (bit_offset <= jump_delta) {
+ return false;
+ }
+
+ current_offset = bit_offset - jump_delta;
+ is_first_offset = false;
+ } else {
+ // Subsequent offsets are forward from the target of the first offset.
+ uint32 is_long_jump;
+ if (!reader.Read(1, &is_long_jump)) {
+ return false;
+ }
+
+ uint32 jump_delta;
+ if (!is_long_jump) {
+ if (!reader.Read(7, &jump_delta)) {
+ return false;
+ }
+ } else {
+ uint32 jump_delta_bits;
+ if (!reader.Read(4, &jump_delta_bits) ||
+ !reader.Read(jump_delta_bits + 8, &jump_delta)) {
+ return false;
+ }
+ }
+
+ current_offset += jump_delta;
+ if (current_offset >= bit_offset) {
+ return false;
+ }
+ }
+
+ DCHECK_LT(0u, hostname_offset);
+ if (hostname[hostname_offset - 1] == c) {
+ bit_offset = current_offset;
+ hostname_offset--;
+ break;
}
}
}
+}
- return NULL;
+bool DecodeHSTSPreload(const std::string& hostname,
+ PreloadResult* out) {
+ bool found;
+ if (!DecodeHSTSPreloadRaw(hostname, &found, out)) {
+ LOG(ERROR) << "Internal error in DecodeHSTSPreloadRaw for hostname "
+ << hostname;
+ return false;
+ }
+
+ return found;
}
bool TransportSecurityState::AddHSTSHeader(const std::string& host,
@@ -732,31 +700,23 @@
// static
bool TransportSecurityState::IsGooglePinnedProperty(const std::string& host) {
- std::string canonicalized_host = CanonicalizeHost(host);
- const struct HSTSPreload* entry =
- GetHSTSPreload(canonicalized_host, kPreloadedSTS, kNumPreloadedSTS);
-
- return entry && entry->pins.required_hashes == kGoogleAcceptableCerts;
+ PreloadResult result;
+ return DecodeHSTSPreload(host, &result) && result.has_pins &&
+ kPinsets[result.pinset_id].accepted_pins == kGoogleAcceptableCerts;
}
// static
void TransportSecurityState::ReportUMAOnPinFailure(const std::string& host) {
- std::string canonicalized_host = CanonicalizeHost(host);
-
- const struct HSTSPreload* entry =
- GetHSTSPreload(canonicalized_host, kPreloadedSTS, kNumPreloadedSTS);
-
- if (!entry) {
- // We don't care to report pin failures for dynamic pins.
+ PreloadResult result;
+ if (!DecodeHSTSPreload(host, &result) ||
+ !result.has_pins) {
return;
}
- DCHECK(entry);
- DCHECK(entry->pins.required_hashes);
- DCHECK(entry->second_level_domain_name != DOMAIN_NOT_PINNED);
+ DCHECK(result.domain_id != DOMAIN_NOT_PINNED);
- UMA_HISTOGRAM_ENUMERATION("Net.PublicKeyPinFailureDomain",
- entry->second_level_domain_name, DOMAIN_NUM_EVENTS);
+ UMA_HISTOGRAM_ENUMERATION(
+ "Net.PublicKeyPinFailureDomain", result.domain_id, DOMAIN_NUM_EVENTS);
}
// static
@@ -787,31 +747,52 @@
DomainState* out) const {
DCHECK(CalledOnValidThread());
- const std::string canonicalized_host = CanonicalizeHost(host);
-
out->sts.upgrade_mode = DomainState::MODE_FORCE_HTTPS;
out->sts.include_subdomains = false;
out->pkp.include_subdomains = false;
- const bool is_build_timely = IsBuildTimely();
+ if (!IsBuildTimely())
+ return false;
- for (size_t i = 0; canonicalized_host[i]; i += canonicalized_host[i] + 1) {
- std::string host_sub_chunk(&canonicalized_host[i],
- canonicalized_host.size() - i);
- out->domain = DNSDomainToString(host_sub_chunk);
- bool ret;
- if (is_build_timely && HasPreload(kPreloadedSTS,
- kNumPreloadedSTS,
- canonicalized_host,
- i,
- enable_static_pins_,
- out,
- &ret)) {
- return ret;
+ PreloadResult result;
+ if (!DecodeHSTSPreload(host, &result))
+ return false;
+
+ out->domain = host.substr(result.hostname_offset);
+ out->sts.include_subdomains = result.include_subdomains;
+ out->sts.last_observed = base::GetBuildTime();
+ out->sts.upgrade_mode =
+ TransportSecurityState::DomainState::MODE_DEFAULT;
+ if (result.force_https) {
+ out->sts.upgrade_mode =
+ TransportSecurityState::DomainState::MODE_FORCE_HTTPS;
+ }
+
+ if (enable_static_pins_ && result.has_pins) {
+ out->pkp.include_subdomains = result.include_subdomains;
+ out->pkp.last_observed = base::GetBuildTime();
+
+ if (result.pinset_id >= arraysize(kPinsets))
+ return false;
+ const Pinset *pinset = &kPinsets[result.pinset_id];
+
+ if (pinset->accepted_pins) {
+ const char* const* sha1_hash = pinset->accepted_pins;
+ while (*sha1_hash) {
+ AddHash(*sha1_hash, &out->pkp.spki_hashes);
+ sha1_hash++;
+ }
+ }
+ if (pinset->rejected_pins) {
+ const char* const* sha1_hash = pinset->rejected_pins;
+ while (*sha1_hash) {
+ AddHash(*sha1_hash, &out->pkp.bad_spki_hashes);
+ sha1_hash++;
+ }
}
}
- return false;
+ return true;
}
bool TransportSecurityState::GetDynamicDomainState(const std::string& host,
diff --git a/net/http/transport_security_state_static.h b/net/http/transport_security_state_static.h
index 8de890a..f1bec20 100644
--- a/net/http/transport_security_state_static.h
+++ b/net/http/transport_security_state_static.h
@@ -2,11 +2,270 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file is automatically generated by transport_security_state_static_generate.go
+// This file is automatically generated by transport_security_state_static_generate.go.
+// You can find it at https://github.com/agl/transport-security-state-generate.
#ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
#define NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
+enum SecondLevelDomainName {
+ DOMAIN_NOT_PINNED,
+ DOMAIN_GOOGLE_COM,
+ DOMAIN_ANDROID_COM,
+ DOMAIN_GOOGLE_ANALYTICS_COM,
+ DOMAIN_GOOGLEPLEX_COM,
+ DOMAIN_YTIMG_COM,
+ DOMAIN_GOOGLEUSERCONTENT_COM,
+ DOMAIN_YOUTUBE_COM,
+ DOMAIN_GOOGLEAPIS_COM,
+ DOMAIN_GOOGLEADSERVICES_COM,
+ DOMAIN_GOOGLECODE_COM,
+ DOMAIN_APPSPOT_COM,
+ DOMAIN_GOOGLESYNDICATION_COM,
+ DOMAIN_DOUBLECLICK_NET,
+ DOMAIN_GSTATIC_COM,
+ DOMAIN_GMAIL_COM,
+ DOMAIN_GOOGLEMAIL_COM,
+ DOMAIN_GOOGLEGROUPS_COM,
+ DOMAIN_TORPROJECT_ORG,
+ DOMAIN_TWITTER_COM,
+ DOMAIN_TWIMG_COM,
+ DOMAIN_AKAMAIHD_NET,
+ DOMAIN_TOR2WEB_ORG,
+ DOMAIN_YOUTU_BE,
+ DOMAIN_GOOGLECOMMERCE_COM,
+ DOMAIN_URCHIN_COM,
+ DOMAIN_GOO_GL,
+ DOMAIN_G_CO,
+ DOMAIN_GOOGLE_AC,
+ DOMAIN_GOOGLE_AD,
+ DOMAIN_GOOGLE_AE,
+ DOMAIN_GOOGLE_AF,
+ DOMAIN_GOOGLE_AG,
+ DOMAIN_GOOGLE_AM,
+ DOMAIN_GOOGLE_AS,
+ DOMAIN_GOOGLE_AT,
+ DOMAIN_GOOGLE_AZ,
+ DOMAIN_GOOGLE_BA,
+ DOMAIN_GOOGLE_BE,
+ DOMAIN_GOOGLE_BF,
+ DOMAIN_GOOGLE_BG,
+ DOMAIN_GOOGLE_BI,
+ DOMAIN_GOOGLE_BJ,
+ DOMAIN_GOOGLE_BS,
+ DOMAIN_GOOGLE_BY,
+ DOMAIN_GOOGLE_CA,
+ DOMAIN_GOOGLE_CAT,
+ DOMAIN_GOOGLE_CC,
+ DOMAIN_GOOGLE_CD,
+ DOMAIN_GOOGLE_CF,
+ DOMAIN_GOOGLE_CG,
+ DOMAIN_GOOGLE_CH,
+ DOMAIN_GOOGLE_CI,
+ DOMAIN_GOOGLE_CL,
+ DOMAIN_GOOGLE_CM,
+ DOMAIN_GOOGLE_CN,
+ DOMAIN_CO_AO,
+ DOMAIN_CO_BW,
+ DOMAIN_CO_CK,
+ DOMAIN_CO_CR,
+ DOMAIN_CO_HU,
+ DOMAIN_CO_ID,
+ DOMAIN_CO_IL,
+ DOMAIN_CO_IM,
+ DOMAIN_CO_IN,
+ DOMAIN_CO_JE,
+ DOMAIN_CO_JP,
+ DOMAIN_CO_KE,
+ DOMAIN_CO_KR,
+ DOMAIN_CO_LS,
+ DOMAIN_CO_MA,
+ DOMAIN_CO_MZ,
+ DOMAIN_CO_NZ,
+ DOMAIN_CO_TH,
+ DOMAIN_CO_TZ,
+ DOMAIN_CO_UG,
+ DOMAIN_CO_UK,
+ DOMAIN_CO_UZ,
+ DOMAIN_CO_VE,
+ DOMAIN_CO_VI,
+ DOMAIN_CO_ZA,
+ DOMAIN_CO_ZM,
+ DOMAIN_CO_ZW,
+ DOMAIN_COM_AF,
+ DOMAIN_COM_AG,
+ DOMAIN_COM_AI,
+ DOMAIN_COM_AR,
+ DOMAIN_COM_AU,
+ DOMAIN_COM_BD,
+ DOMAIN_COM_BH,
+ DOMAIN_COM_BN,
+ DOMAIN_COM_BO,
+ DOMAIN_COM_BR,
+ DOMAIN_COM_BY,
+ DOMAIN_COM_BZ,
+ DOMAIN_COM_CN,
+ DOMAIN_COM_CO,
+ DOMAIN_COM_CU,
+ DOMAIN_COM_CY,
+ DOMAIN_COM_DO,
+ DOMAIN_COM_EC,
+ DOMAIN_COM_EG,
+ DOMAIN_COM_ET,
+ DOMAIN_COM_FJ,
+ DOMAIN_COM_GE,
+ DOMAIN_COM_GH,
+ DOMAIN_COM_GI,
+ DOMAIN_COM_GR,
+ DOMAIN_COM_GT,
+ DOMAIN_COM_HK,
+ DOMAIN_COM_IQ,
+ DOMAIN_COM_JM,
+ DOMAIN_COM_JO,
+ DOMAIN_COM_KH,
+ DOMAIN_COM_KW,
+ DOMAIN_COM_LB,
+ DOMAIN_COM_LY,
+ DOMAIN_COM_MT,
+ DOMAIN_COM_MX,
+ DOMAIN_COM_MY,
+ DOMAIN_COM_NA,
+ DOMAIN_COM_NF,
+ DOMAIN_COM_NG,
+ DOMAIN_COM_NI,
+ DOMAIN_COM_NP,
+ DOMAIN_COM_NR,
+ DOMAIN_COM_OM,
+ DOMAIN_COM_PA,
+ DOMAIN_COM_PE,
+ DOMAIN_COM_PH,
+ DOMAIN_COM_PK,
+ DOMAIN_COM_PL,
+ DOMAIN_COM_PR,
+ DOMAIN_COM_PY,
+ DOMAIN_COM_QA,
+ DOMAIN_COM_RU,
+ DOMAIN_COM_SA,
+ DOMAIN_COM_SB,
+ DOMAIN_COM_SG,
+ DOMAIN_COM_SL,
+ DOMAIN_COM_SV,
+ DOMAIN_COM_TJ,
+ DOMAIN_COM_TN,
+ DOMAIN_COM_TR,
+ DOMAIN_COM_TW,
+ DOMAIN_COM_UA,
+ DOMAIN_COM_UY,
+ DOMAIN_COM_VC,
+ DOMAIN_COM_VE,
+ DOMAIN_COM_VN,
+ DOMAIN_GOOGLE_CV,
+ DOMAIN_GOOGLE_CZ,
+ DOMAIN_GOOGLE_DE,
+ DOMAIN_GOOGLE_DJ,
+ DOMAIN_GOOGLE_DK,
+ DOMAIN_GOOGLE_DM,
+ DOMAIN_GOOGLE_DZ,
+ DOMAIN_GOOGLE_EE,
+ DOMAIN_GOOGLE_ES,
+ DOMAIN_GOOGLE_FI,
+ DOMAIN_GOOGLE_FM,
+ DOMAIN_GOOGLE_FR,
+ DOMAIN_GOOGLE_GA,
+ DOMAIN_GOOGLE_GE,
+ DOMAIN_GOOGLE_GG,
+ DOMAIN_GOOGLE_GL,
+ DOMAIN_GOOGLE_GM,
+ DOMAIN_GOOGLE_GP,
+ DOMAIN_GOOGLE_GR,
+ DOMAIN_GOOGLE_GY,
+ DOMAIN_GOOGLE_HK,
+ DOMAIN_GOOGLE_HN,
+ DOMAIN_GOOGLE_HR,
+ DOMAIN_GOOGLE_HT,
+ DOMAIN_GOOGLE_HU,
+ DOMAIN_GOOGLE_IE,
+ DOMAIN_GOOGLE_IM,
+ DOMAIN_GOOGLE_INFO,
+ DOMAIN_GOOGLE_IQ,
+ DOMAIN_GOOGLE_IS,
+ DOMAIN_GOOGLE_IT,
+ DOMAIN_IT_AO,
+ DOMAIN_GOOGLE_JE,
+ DOMAIN_GOOGLE_JO,
+ DOMAIN_GOOGLE_JOBS,
+ DOMAIN_GOOGLE_JP,
+ DOMAIN_GOOGLE_KG,
+ DOMAIN_GOOGLE_KI,
+ DOMAIN_GOOGLE_KZ,
+ DOMAIN_GOOGLE_LA,
+ DOMAIN_GOOGLE_LI,
+ DOMAIN_GOOGLE_LK,
+ DOMAIN_GOOGLE_LT,
+ DOMAIN_GOOGLE_LU,
+ DOMAIN_GOOGLE_LV,
+ DOMAIN_GOOGLE_MD,
+ DOMAIN_GOOGLE_ME,
+ DOMAIN_GOOGLE_MG,
+ DOMAIN_GOOGLE_MK,
+ DOMAIN_GOOGLE_ML,
+ DOMAIN_GOOGLE_MN,
+ DOMAIN_GOOGLE_MS,
+ DOMAIN_GOOGLE_MU,
+ DOMAIN_GOOGLE_MV,
+ DOMAIN_GOOGLE_MW,
+ DOMAIN_GOOGLE_NE,
+ DOMAIN_NE_JP,
+ DOMAIN_GOOGLE_NET,
+ DOMAIN_GOOGLE_NL,
+ DOMAIN_GOOGLE_NO,
+ DOMAIN_GOOGLE_NR,
+ DOMAIN_GOOGLE_NU,
+ DOMAIN_OFF_AI,
+ DOMAIN_GOOGLE_PK,
+ DOMAIN_GOOGLE_PL,
+ DOMAIN_GOOGLE_PN,
+ DOMAIN_GOOGLE_PS,
+ DOMAIN_GOOGLE_PT,
+ DOMAIN_GOOGLE_RO,
+ DOMAIN_GOOGLE_RS,
+ DOMAIN_GOOGLE_RU,
+ DOMAIN_GOOGLE_RW,
+ DOMAIN_GOOGLE_SC,
+ DOMAIN_GOOGLE_SE,
+ DOMAIN_GOOGLE_SH,
+ DOMAIN_GOOGLE_SI,
+ DOMAIN_GOOGLE_SK,
+ DOMAIN_GOOGLE_SM,
+ DOMAIN_GOOGLE_SN,
+ DOMAIN_GOOGLE_SO,
+ DOMAIN_GOOGLE_ST,
+ DOMAIN_GOOGLE_TD,
+ DOMAIN_GOOGLE_TG,
+ DOMAIN_GOOGLE_TK,
+ DOMAIN_GOOGLE_TL,
+ DOMAIN_GOOGLE_TM,
+ DOMAIN_GOOGLE_TN,
+ DOMAIN_GOOGLE_TO,
+ DOMAIN_GOOGLE_TP,
+ DOMAIN_GOOGLE_TT,
+ DOMAIN_GOOGLE_US,
+ DOMAIN_GOOGLE_UZ,
+ DOMAIN_GOOGLE_VG,
+ DOMAIN_GOOGLE_VU,
+ DOMAIN_GOOGLE_WS,
+ DOMAIN_CHROMIUM_ORG,
+ DOMAIN_CRYPTO_CAT,
+ DOMAIN_LAVABIT_COM,
+ DOMAIN_GOOGLETAGMANAGER_COM,
+ DOMAIN_GOOGLETAGSERVICES_COM,
+ DOMAIN_DROPBOX_COM,
+ DOMAIN_YOUTUBE_NOCOOKIE_COM,
+ DOMAIN_2MDN_NET,
+ // Boundary value for UMA_HISTOGRAM_ENUMERATION.
+ DOMAIN_NUM_EVENTS,
+};
+
// These are SubjectPublicKeyInfo hashes for public key pinning. The
// hashes are SHA1 digests.
@@ -270,21 +529,11 @@
kSPKIHash_TestSPKI,
NULL,
};
-#define kTestPins { \
- kTestAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kGoogleAcceptableCerts[] = {
kSPKIHash_GoogleBackup2048,
kSPKIHash_GoogleG2,
NULL,
};
-#define kGooglePins { \
- kGoogleAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kTorAcceptableCerts[] = {
kSPKIHash_RapidSSL,
kSPKIHash_DigiCertEVRoot,
@@ -293,11 +542,6 @@
kSPKIHash_Tor3,
NULL,
};
-#define kTorPins { \
- kTorAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kTwitterComAcceptableCerts[] = {
kSPKIHash_VeriSignClass1,
kSPKIHash_VeriSignClass3,
@@ -323,11 +567,6 @@
kSPKIHash_Twitter1,
NULL,
};
-#define kTwitterComPins { \
- kTwitterComAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kTwitterCDNAcceptableCerts[] = {
kSPKIHash_VeriSignClass1,
kSPKIHash_VeriSignClass3,
@@ -374,40 +613,20 @@
kSPKIHash_GlobalSignRootCA_R3,
NULL,
};
-#define kTwitterCDNPins { \
- kTwitterCDNAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kTor2webAcceptableCerts[] = {
kSPKIHash_AlphaSSL_G2,
kSPKIHash_Tor2web,
NULL,
};
-#define kTor2webPins { \
- kTor2webAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kCryptoCatAcceptableCerts[] = {
kSPKIHash_DigiCertEVRoot,
kSPKIHash_CryptoCat1,
NULL,
};
-#define kCryptoCatPins { \
- kCryptoCatAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kLavabitAcceptableCerts[] = {
kSPKIHash_Libertylavabitcom,
NULL,
};
-#define kLavabitPins { \
- kLavabitAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-
static const char* const kDropboxAcceptableCerts[] = {
kSPKIHash_DigiCertAssuredIDRoot,
kSPKIHash_DigiCertGlobalRoot,
@@ -429,1045 +648,1351 @@
kSPKIHash_ThawtePrimaryRootCA,
NULL,
};
-#define kDropboxPins { \
- kDropboxAcceptableCerts, \
- kNoRejectedPublicKeys, \
-}
-#define kNoPins {\
- NULL, NULL, \
-}
-
-static const struct HSTSPreload kPreloadedSTS[] = {
- {25, true, "\013" "pinningtest" "\007" "appspot" "\003" "com", false, kTestPins, DOMAIN_APPSPOT_COM },
- {12, true, "\006" "google" "\003" "com", false, kGooglePins, DOMAIN_GOOGLE_COM },
- {19, true, "\006" "wallet" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {21, true, "\010" "checkout" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {19, true, "\006" "chrome" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, true, "\004" "docs" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {20, true, "\007" "domains" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {18, true, "\005" "sites" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {25, true, "\014" "spreadsheets" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {22, true, "\011" "appengine" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {22, true, "\011" "encrypted" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {21, true, "\010" "accounts" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {21, true, "\010" "profiles" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, true, "\004" "mail" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {23, true, "\012" "talkgadget" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, true, "\004" "talk" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {29, true, "\020" "hostedtalkgadget" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, true, "\004" "plus" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {25, true, "\004" "plus" "\007" "sandbox" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {19, true, "\006" "script" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {20, true, "\007" "history" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {21, true, "\010" "security" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, true, "\004" "goto" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {18, true, "\005" "cloud" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {18, true, "\005" "glass" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {18, true, "\005" "admin" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {23, true, "\005" "login" "\004" "corp" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, false, "\004" "play" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {22, true, "\011" "passwords" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {11, false, "\005" "gmail" "\003" "com", true, kGooglePins, DOMAIN_GMAIL_COM },
- {16, false, "\012" "googlemail" "\003" "com", true, kGooglePins, DOMAIN_GOOGLEMAIL_COM },
- {15, false, "\003" "www" "\005" "gmail" "\003" "com", true, kGooglePins, DOMAIN_GMAIL_COM },
- {20, false, "\003" "www" "\012" "googlemail" "\003" "com", true, kGooglePins, DOMAIN_GOOGLEMAIL_COM },
- {20, true, "\006" "market" "\007" "android" "\003" "com", true, kGooglePins, DOMAIN_ANDROID_COM },
- {26, true, "\003" "ssl" "\020" "google-analytics" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_ANALYTICS_COM },
- {18, true, "\005" "drive" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {16, true, "\012" "googleplex" "\003" "com", true, kGooglePins, DOMAIN_GOOGLEPLEX_COM },
- {19, true, "\006" "groups" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {17, true, "\004" "apis" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {32, true, "\022" "chromiumcodereview" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {38, true, "\030" "chrome-devtools-frontend" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {24, true, "\012" "codereview" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {25, true, "\012" "codereview" "\010" "chromium" "\003" "org", true, kGooglePins, DOMAIN_CHROMIUM_ORG },
- {17, true, "\004" "code" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {16, true, "\012" "googlecode" "\003" "com", false, kGooglePins, DOMAIN_GOOGLECODE_COM },
- {15, true, "\002" "dl" "\006" "google" "\003" "com", true, kGooglePins, DOMAIN_GOOGLE_COM },
- {26, true, "\011" "translate" "\012" "googleapis" "\003" "com", true, kGooglePins, DOMAIN_GOOGLEAPIS_COM },
- {24, true, "\012" "webfilings" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {35, true, "\025" "webfilings-mirror-hrd" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {27, true, "\015" "webfilings-eu" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {34, true, "\024" "webfilings-eu-mirror" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {24, true, "\012" "wf-demo-eu" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {25, true, "\013" "wf-demo-hrd" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {24, true, "\012" "wf-pentest" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {26, true, "\014" "wf-trial-hrd" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {25, true, "\013" "xbrlsuccess" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {25, true, "\013" "w-spotlight" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {29, true, "\017" "wf-training-hrd" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {30, true, "\020" "wf-bigsky-master" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {27, true, "\015" "wf-staging-hr" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {32, true, "\022" "wf-training-master" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {28, true, "\016" "wf-dogfood-hrd" "\007" "appspot" "\003" "com", true, kGooglePins, DOMAIN_APPSPOT_COM },
- {23, true, "\005" "chart" "\004" "apis" "\006" "google" "\003" "com", false, kGooglePins, DOMAIN_GOOGLE_COM },
- {22, true, "\020" "google-analytics" "\003" "com", false, kGooglePins, DOMAIN_GOOGLE_ANALYTICS_COM },
- {18, true, "\014" "googlegroups" "\003" "com", false, kGooglePins, DOMAIN_GOOGLEGROUPS_COM },
- {11, true, "\005" "ytimg" "\003" "com", false, kGooglePins, DOMAIN_YTIMG_COM },
- {23, true, "\021" "googleusercontent" "\003" "com", false, kGooglePins, DOMAIN_GOOGLEUSERCONTENT_COM },
- {13, true, "\007" "youtube" "\003" "com", false, kGooglePins, DOMAIN_YOUTUBE_COM },
- {22, true, "\020" "youtube-nocookie" "\003" "com", false, kGooglePins, DOMAIN_YOUTUBE_NOCOOKIE_COM },
- {16, true, "\012" "googleapis" "\003" "com", false, kGooglePins, DOMAIN_GOOGLEAPIS_COM },
- {22, true, "\020" "googleadservices" "\003" "com", false, kGooglePins, DOMAIN_GOOGLEADSERVICES_COM },
- {13, true, "\007" "appspot" "\003" "com", false, kGooglePins, DOMAIN_APPSPOT_COM },
- {23, true, "\021" "googlesyndication" "\003" "com", false, kGooglePins, DOMAIN_GOOGLESYNDICATION_COM },
- {17, true, "\013" "doubleclick" "\003" "net", false, kGooglePins, DOMAIN_DOUBLECLICK_NET },
- {10, true, "\004" "2mdn" "\003" "net", false, kGooglePins, DOMAIN_2MDN_NET },
- {13, true, "\007" "gstatic" "\003" "com", false, kGooglePins, DOMAIN_GSTATIC_COM },
- {10, true, "\005" "youtu" "\002" "be", false, kGooglePins, DOMAIN_YOUTU_BE },
- {13, true, "\007" "android" "\003" "com", false, kGooglePins, DOMAIN_ANDROID_COM },
- {20, true, "\016" "googlecommerce" "\003" "com", false, kGooglePins, DOMAIN_GOOGLECOMMERCE_COM },
- {12, true, "\006" "urchin" "\003" "com", false, kGooglePins, DOMAIN_URCHIN_COM },
- {8, true, "\003" "goo" "\002" "gl", false, kGooglePins, DOMAIN_GOO_GL },
- {6, true, "\001" "g" "\002" "co", false, kGooglePins, DOMAIN_G_CO },
- {22, true, "\020" "googletagmanager" "\003" "com", false, kGooglePins, DOMAIN_GOOGLETAGMANAGER_COM },
- {23, true, "\021" "googletagservices" "\003" "com", false, kGooglePins, DOMAIN_GOOGLETAGSERVICES_COM },
- {11, true, "\006" "google" "\002" "ac", false, kGooglePins, DOMAIN_GOOGLE_AC },
- {11, true, "\006" "google" "\002" "ad", false, kGooglePins, DOMAIN_GOOGLE_AD },
- {11, true, "\006" "google" "\002" "ae", false, kGooglePins, DOMAIN_GOOGLE_AE },
- {11, true, "\006" "google" "\002" "af", false, kGooglePins, DOMAIN_GOOGLE_AF },
- {11, true, "\006" "google" "\002" "ag", false, kGooglePins, DOMAIN_GOOGLE_AG },
- {11, true, "\006" "google" "\002" "am", false, kGooglePins, DOMAIN_GOOGLE_AM },
- {11, true, "\006" "google" "\002" "as", false, kGooglePins, DOMAIN_GOOGLE_AS },
- {11, true, "\006" "google" "\002" "at", false, kGooglePins, DOMAIN_GOOGLE_AT },
- {11, true, "\006" "google" "\002" "az", false, kGooglePins, DOMAIN_GOOGLE_AZ },
- {11, true, "\006" "google" "\002" "ba", false, kGooglePins, DOMAIN_GOOGLE_BA },
- {11, true, "\006" "google" "\002" "be", false, kGooglePins, DOMAIN_GOOGLE_BE },
- {11, true, "\006" "google" "\002" "bf", false, kGooglePins, DOMAIN_GOOGLE_BF },
- {11, true, "\006" "google" "\002" "bg", false, kGooglePins, DOMAIN_GOOGLE_BG },
- {11, true, "\006" "google" "\002" "bi", false, kGooglePins, DOMAIN_GOOGLE_BI },
- {11, true, "\006" "google" "\002" "bj", false, kGooglePins, DOMAIN_GOOGLE_BJ },
- {11, true, "\006" "google" "\002" "bs", false, kGooglePins, DOMAIN_GOOGLE_BS },
- {11, true, "\006" "google" "\002" "by", false, kGooglePins, DOMAIN_GOOGLE_BY },
- {11, true, "\006" "google" "\002" "ca", false, kGooglePins, DOMAIN_GOOGLE_CA },
- {12, true, "\006" "google" "\003" "cat", false, kGooglePins, DOMAIN_GOOGLE_CAT },
- {11, true, "\006" "google" "\002" "cc", false, kGooglePins, DOMAIN_GOOGLE_CC },
- {11, true, "\006" "google" "\002" "cd", false, kGooglePins, DOMAIN_GOOGLE_CD },
- {11, true, "\006" "google" "\002" "cf", false, kGooglePins, DOMAIN_GOOGLE_CF },
- {11, true, "\006" "google" "\002" "cg", false, kGooglePins, DOMAIN_GOOGLE_CG },
- {11, true, "\006" "google" "\002" "ch", false, kGooglePins, DOMAIN_GOOGLE_CH },
- {11, true, "\006" "google" "\002" "ci", false, kGooglePins, DOMAIN_GOOGLE_CI },
- {11, true, "\006" "google" "\002" "cl", false, kGooglePins, DOMAIN_GOOGLE_CL },
- {11, true, "\006" "google" "\002" "cm", false, kGooglePins, DOMAIN_GOOGLE_CM },
- {11, true, "\006" "google" "\002" "cn", false, kGooglePins, DOMAIN_GOOGLE_CN },
- {14, true, "\006" "google" "\002" "co" "\002" "ao", false, kGooglePins, DOMAIN_CO_AO },
- {14, true, "\006" "google" "\002" "co" "\002" "bw", false, kGooglePins, DOMAIN_CO_BW },
- {14, true, "\006" "google" "\002" "co" "\002" "ck", false, kGooglePins, DOMAIN_CO_CK },
- {14, true, "\006" "google" "\002" "co" "\002" "cr", false, kGooglePins, DOMAIN_CO_CR },
- {14, true, "\006" "google" "\002" "co" "\002" "hu", false, kGooglePins, DOMAIN_CO_HU },
- {14, true, "\006" "google" "\002" "co" "\002" "id", false, kGooglePins, DOMAIN_CO_ID },
- {14, true, "\006" "google" "\002" "co" "\002" "il", false, kGooglePins, DOMAIN_CO_IL },
- {14, true, "\006" "google" "\002" "co" "\002" "im", false, kGooglePins, DOMAIN_CO_IM },
- {14, true, "\006" "google" "\002" "co" "\002" "in", false, kGooglePins, DOMAIN_CO_IN },
- {14, true, "\006" "google" "\002" "co" "\002" "je", false, kGooglePins, DOMAIN_CO_JE },
- {14, true, "\006" "google" "\002" "co" "\002" "jp", false, kGooglePins, DOMAIN_CO_JP },
- {14, true, "\006" "google" "\002" "co" "\002" "ke", false, kGooglePins, DOMAIN_CO_KE },
- {14, true, "\006" "google" "\002" "co" "\002" "kr", false, kGooglePins, DOMAIN_CO_KR },
- {14, true, "\006" "google" "\002" "co" "\002" "ls", false, kGooglePins, DOMAIN_CO_LS },
- {14, true, "\006" "google" "\002" "co" "\002" "ma", false, kGooglePins, DOMAIN_CO_MA },
- {14, true, "\006" "google" "\002" "co" "\002" "mz", false, kGooglePins, DOMAIN_CO_MZ },
- {14, true, "\006" "google" "\002" "co" "\002" "nz", false, kGooglePins, DOMAIN_CO_NZ },
- {14, true, "\006" "google" "\002" "co" "\002" "th", false, kGooglePins, DOMAIN_CO_TH },
- {14, true, "\006" "google" "\002" "co" "\002" "tz", false, kGooglePins, DOMAIN_CO_TZ },
- {14, true, "\006" "google" "\002" "co" "\002" "ug", false, kGooglePins, DOMAIN_CO_UG },
- {14, true, "\006" "google" "\002" "co" "\002" "uk", false, kGooglePins, DOMAIN_CO_UK },
- {14, true, "\006" "google" "\002" "co" "\002" "uz", false, kGooglePins, DOMAIN_CO_UZ },
- {14, true, "\006" "google" "\002" "co" "\002" "ve", false, kGooglePins, DOMAIN_CO_VE },
- {14, true, "\006" "google" "\002" "co" "\002" "vi", false, kGooglePins, DOMAIN_CO_VI },
- {14, true, "\006" "google" "\002" "co" "\002" "za", false, kGooglePins, DOMAIN_CO_ZA },
- {14, true, "\006" "google" "\002" "co" "\002" "zm", false, kGooglePins, DOMAIN_CO_ZM },
- {14, true, "\006" "google" "\002" "co" "\002" "zw", false, kGooglePins, DOMAIN_CO_ZW },
- {15, true, "\006" "google" "\003" "com" "\002" "af", false, kGooglePins, DOMAIN_COM_AF },
- {15, true, "\006" "google" "\003" "com" "\002" "ag", false, kGooglePins, DOMAIN_COM_AG },
- {15, true, "\006" "google" "\003" "com" "\002" "ai", false, kGooglePins, DOMAIN_COM_AI },
- {15, true, "\006" "google" "\003" "com" "\002" "ar", false, kGooglePins, DOMAIN_COM_AR },
- {15, true, "\006" "google" "\003" "com" "\002" "au", false, kGooglePins, DOMAIN_COM_AU },
- {15, true, "\006" "google" "\003" "com" "\002" "bd", false, kGooglePins, DOMAIN_COM_BD },
- {15, true, "\006" "google" "\003" "com" "\002" "bh", false, kGooglePins, DOMAIN_COM_BH },
- {15, true, "\006" "google" "\003" "com" "\002" "bn", false, kGooglePins, DOMAIN_COM_BN },
- {15, true, "\006" "google" "\003" "com" "\002" "bo", false, kGooglePins, DOMAIN_COM_BO },
- {15, true, "\006" "google" "\003" "com" "\002" "br", false, kGooglePins, DOMAIN_COM_BR },
- {15, true, "\006" "google" "\003" "com" "\002" "by", false, kGooglePins, DOMAIN_COM_BY },
- {15, true, "\006" "google" "\003" "com" "\002" "bz", false, kGooglePins, DOMAIN_COM_BZ },
- {15, true, "\006" "google" "\003" "com" "\002" "cn", false, kGooglePins, DOMAIN_COM_CN },
- {15, true, "\006" "google" "\003" "com" "\002" "co", false, kGooglePins, DOMAIN_COM_CO },
- {15, true, "\006" "google" "\003" "com" "\002" "cu", false, kGooglePins, DOMAIN_COM_CU },
- {15, true, "\006" "google" "\003" "com" "\002" "cy", false, kGooglePins, DOMAIN_COM_CY },
- {15, true, "\006" "google" "\003" "com" "\002" "do", false, kGooglePins, DOMAIN_COM_DO },
- {15, true, "\006" "google" "\003" "com" "\002" "ec", false, kGooglePins, DOMAIN_COM_EC },
- {15, true, "\006" "google" "\003" "com" "\002" "eg", false, kGooglePins, DOMAIN_COM_EG },
- {15, true, "\006" "google" "\003" "com" "\002" "et", false, kGooglePins, DOMAIN_COM_ET },
- {15, true, "\006" "google" "\003" "com" "\002" "fj", false, kGooglePins, DOMAIN_COM_FJ },
- {15, true, "\006" "google" "\003" "com" "\002" "ge", false, kGooglePins, DOMAIN_COM_GE },
- {15, true, "\006" "google" "\003" "com" "\002" "gh", false, kGooglePins, DOMAIN_COM_GH },
- {15, true, "\006" "google" "\003" "com" "\002" "gi", false, kGooglePins, DOMAIN_COM_GI },
- {15, true, "\006" "google" "\003" "com" "\002" "gr", false, kGooglePins, DOMAIN_COM_GR },
- {15, true, "\006" "google" "\003" "com" "\002" "gt", false, kGooglePins, DOMAIN_COM_GT },
- {15, true, "\006" "google" "\003" "com" "\002" "hk", false, kGooglePins, DOMAIN_COM_HK },
- {15, true, "\006" "google" "\003" "com" "\002" "iq", false, kGooglePins, DOMAIN_COM_IQ },
- {15, true, "\006" "google" "\003" "com" "\002" "jm", false, kGooglePins, DOMAIN_COM_JM },
- {15, true, "\006" "google" "\003" "com" "\002" "jo", false, kGooglePins, DOMAIN_COM_JO },
- {15, true, "\006" "google" "\003" "com" "\002" "kh", false, kGooglePins, DOMAIN_COM_KH },
- {15, true, "\006" "google" "\003" "com" "\002" "kw", false, kGooglePins, DOMAIN_COM_KW },
- {15, true, "\006" "google" "\003" "com" "\002" "lb", false, kGooglePins, DOMAIN_COM_LB },
- {15, true, "\006" "google" "\003" "com" "\002" "ly", false, kGooglePins, DOMAIN_COM_LY },
- {15, true, "\006" "google" "\003" "com" "\002" "mt", false, kGooglePins, DOMAIN_COM_MT },
- {15, true, "\006" "google" "\003" "com" "\002" "mx", false, kGooglePins, DOMAIN_COM_MX },
- {15, true, "\006" "google" "\003" "com" "\002" "my", false, kGooglePins, DOMAIN_COM_MY },
- {15, true, "\006" "google" "\003" "com" "\002" "na", false, kGooglePins, DOMAIN_COM_NA },
- {15, true, "\006" "google" "\003" "com" "\002" "nf", false, kGooglePins, DOMAIN_COM_NF },
- {15, true, "\006" "google" "\003" "com" "\002" "ng", false, kGooglePins, DOMAIN_COM_NG },
- {15, true, "\006" "google" "\003" "com" "\002" "ni", false, kGooglePins, DOMAIN_COM_NI },
- {15, true, "\006" "google" "\003" "com" "\002" "np", false, kGooglePins, DOMAIN_COM_NP },
- {15, true, "\006" "google" "\003" "com" "\002" "nr", false, kGooglePins, DOMAIN_COM_NR },
- {15, true, "\006" "google" "\003" "com" "\002" "om", false, kGooglePins, DOMAIN_COM_OM },
- {15, true, "\006" "google" "\003" "com" "\002" "pa", false, kGooglePins, DOMAIN_COM_PA },
- {15, true, "\006" "google" "\003" "com" "\002" "pe", false, kGooglePins, DOMAIN_COM_PE },
- {15, true, "\006" "google" "\003" "com" "\002" "ph", false, kGooglePins, DOMAIN_COM_PH },
- {15, true, "\006" "google" "\003" "com" "\002" "pk", false, kGooglePins, DOMAIN_COM_PK },
- {15, true, "\006" "google" "\003" "com" "\002" "pl", false, kGooglePins, DOMAIN_COM_PL },
- {15, true, "\006" "google" "\003" "com" "\002" "pr", false, kGooglePins, DOMAIN_COM_PR },
- {15, true, "\006" "google" "\003" "com" "\002" "py", false, kGooglePins, DOMAIN_COM_PY },
- {15, true, "\006" "google" "\003" "com" "\002" "qa", false, kGooglePins, DOMAIN_COM_QA },
- {15, true, "\006" "google" "\003" "com" "\002" "ru", false, kGooglePins, DOMAIN_COM_RU },
- {15, true, "\006" "google" "\003" "com" "\002" "sa", false, kGooglePins, DOMAIN_COM_SA },
- {15, true, "\006" "google" "\003" "com" "\002" "sb", false, kGooglePins, DOMAIN_COM_SB },
- {15, true, "\006" "google" "\003" "com" "\002" "sg", false, kGooglePins, DOMAIN_COM_SG },
- {15, true, "\006" "google" "\003" "com" "\002" "sl", false, kGooglePins, DOMAIN_COM_SL },
- {15, true, "\006" "google" "\003" "com" "\002" "sv", false, kGooglePins, DOMAIN_COM_SV },
- {15, true, "\006" "google" "\003" "com" "\002" "tj", false, kGooglePins, DOMAIN_COM_TJ },
- {15, true, "\006" "google" "\003" "com" "\002" "tn", false, kGooglePins, DOMAIN_COM_TN },
- {15, true, "\006" "google" "\003" "com" "\002" "tr", false, kGooglePins, DOMAIN_COM_TR },
- {15, true, "\006" "google" "\003" "com" "\002" "tw", false, kGooglePins, DOMAIN_COM_TW },
- {15, true, "\006" "google" "\003" "com" "\002" "ua", false, kGooglePins, DOMAIN_COM_UA },
- {15, true, "\006" "google" "\003" "com" "\002" "uy", false, kGooglePins, DOMAIN_COM_UY },
- {15, true, "\006" "google" "\003" "com" "\002" "vc", false, kGooglePins, DOMAIN_COM_VC },
- {15, true, "\006" "google" "\003" "com" "\002" "ve", false, kGooglePins, DOMAIN_COM_VE },
- {15, true, "\006" "google" "\003" "com" "\002" "vn", false, kGooglePins, DOMAIN_COM_VN },
- {11, true, "\006" "google" "\002" "cv", false, kGooglePins, DOMAIN_GOOGLE_CV },
- {11, true, "\006" "google" "\002" "cz", false, kGooglePins, DOMAIN_GOOGLE_CZ },
- {11, true, "\006" "google" "\002" "de", false, kGooglePins, DOMAIN_GOOGLE_DE },
- {11, true, "\006" "google" "\002" "dj", false, kGooglePins, DOMAIN_GOOGLE_DJ },
- {11, true, "\006" "google" "\002" "dk", false, kGooglePins, DOMAIN_GOOGLE_DK },
- {11, true, "\006" "google" "\002" "dm", false, kGooglePins, DOMAIN_GOOGLE_DM },
- {11, true, "\006" "google" "\002" "dz", false, kGooglePins, DOMAIN_GOOGLE_DZ },
- {11, true, "\006" "google" "\002" "ee", false, kGooglePins, DOMAIN_GOOGLE_EE },
- {11, true, "\006" "google" "\002" "es", false, kGooglePins, DOMAIN_GOOGLE_ES },
- {11, true, "\006" "google" "\002" "fi", false, kGooglePins, DOMAIN_GOOGLE_FI },
- {11, true, "\006" "google" "\002" "fm", false, kGooglePins, DOMAIN_GOOGLE_FM },
- {11, true, "\006" "google" "\002" "fr", false, kGooglePins, DOMAIN_GOOGLE_FR },
- {11, true, "\006" "google" "\002" "ga", false, kGooglePins, DOMAIN_GOOGLE_GA },
- {11, true, "\006" "google" "\002" "ge", false, kGooglePins, DOMAIN_GOOGLE_GE },
- {11, true, "\006" "google" "\002" "gg", false, kGooglePins, DOMAIN_GOOGLE_GG },
- {11, true, "\006" "google" "\002" "gl", false, kGooglePins, DOMAIN_GOOGLE_GL },
- {11, true, "\006" "google" "\002" "gm", false, kGooglePins, DOMAIN_GOOGLE_GM },
- {11, true, "\006" "google" "\002" "gp", false, kGooglePins, DOMAIN_GOOGLE_GP },
- {11, true, "\006" "google" "\002" "gr", false, kGooglePins, DOMAIN_GOOGLE_GR },
- {11, true, "\006" "google" "\002" "gy", false, kGooglePins, DOMAIN_GOOGLE_GY },
- {11, true, "\006" "google" "\002" "hk", false, kGooglePins, DOMAIN_GOOGLE_HK },
- {11, true, "\006" "google" "\002" "hn", false, kGooglePins, DOMAIN_GOOGLE_HN },
- {11, true, "\006" "google" "\002" "hr", false, kGooglePins, DOMAIN_GOOGLE_HR },
- {11, true, "\006" "google" "\002" "ht", false, kGooglePins, DOMAIN_GOOGLE_HT },
- {11, true, "\006" "google" "\002" "hu", false, kGooglePins, DOMAIN_GOOGLE_HU },
- {11, true, "\006" "google" "\002" "ie", false, kGooglePins, DOMAIN_GOOGLE_IE },
- {11, true, "\006" "google" "\002" "im", false, kGooglePins, DOMAIN_GOOGLE_IM },
- {13, true, "\006" "google" "\004" "info", false, kGooglePins, DOMAIN_GOOGLE_INFO },
- {11, true, "\006" "google" "\002" "iq", false, kGooglePins, DOMAIN_GOOGLE_IQ },
- {11, true, "\006" "google" "\002" "is", false, kGooglePins, DOMAIN_GOOGLE_IS },
- {11, true, "\006" "google" "\002" "it", false, kGooglePins, DOMAIN_GOOGLE_IT },
- {14, true, "\006" "google" "\002" "it" "\002" "ao", false, kGooglePins, DOMAIN_IT_AO },
- {11, true, "\006" "google" "\002" "je", false, kGooglePins, DOMAIN_GOOGLE_JE },
- {11, true, "\006" "google" "\002" "jo", false, kGooglePins, DOMAIN_GOOGLE_JO },
- {13, true, "\006" "google" "\004" "jobs", false, kGooglePins, DOMAIN_GOOGLE_JOBS },
- {11, true, "\006" "google" "\002" "jp", false, kGooglePins, DOMAIN_GOOGLE_JP },
- {11, true, "\006" "google" "\002" "kg", false, kGooglePins, DOMAIN_GOOGLE_KG },
- {11, true, "\006" "google" "\002" "ki", false, kGooglePins, DOMAIN_GOOGLE_KI },
- {11, true, "\006" "google" "\002" "kz", false, kGooglePins, DOMAIN_GOOGLE_KZ },
- {11, true, "\006" "google" "\002" "la", false, kGooglePins, DOMAIN_GOOGLE_LA },
- {11, true, "\006" "google" "\002" "li", false, kGooglePins, DOMAIN_GOOGLE_LI },
- {11, true, "\006" "google" "\002" "lk", false, kGooglePins, DOMAIN_GOOGLE_LK },
- {11, true, "\006" "google" "\002" "lt", false, kGooglePins, DOMAIN_GOOGLE_LT },
- {11, true, "\006" "google" "\002" "lu", false, kGooglePins, DOMAIN_GOOGLE_LU },
- {11, true, "\006" "google" "\002" "lv", false, kGooglePins, DOMAIN_GOOGLE_LV },
- {11, true, "\006" "google" "\002" "md", false, kGooglePins, DOMAIN_GOOGLE_MD },
- {11, true, "\006" "google" "\002" "me", false, kGooglePins, DOMAIN_GOOGLE_ME },
- {11, true, "\006" "google" "\002" "mg", false, kGooglePins, DOMAIN_GOOGLE_MG },
- {11, true, "\006" "google" "\002" "mk", false, kGooglePins, DOMAIN_GOOGLE_MK },
- {11, true, "\006" "google" "\002" "ml", false, kGooglePins, DOMAIN_GOOGLE_ML },
- {11, true, "\006" "google" "\002" "mn", false, kGooglePins, DOMAIN_GOOGLE_MN },
- {11, true, "\006" "google" "\002" "ms", false, kGooglePins, DOMAIN_GOOGLE_MS },
- {11, true, "\006" "google" "\002" "mu", false, kGooglePins, DOMAIN_GOOGLE_MU },
- {11, true, "\006" "google" "\002" "mv", false, kGooglePins, DOMAIN_GOOGLE_MV },
- {11, true, "\006" "google" "\002" "mw", false, kGooglePins, DOMAIN_GOOGLE_MW },
- {11, true, "\006" "google" "\002" "ne", false, kGooglePins, DOMAIN_GOOGLE_NE },
- {14, true, "\006" "google" "\002" "ne" "\002" "jp", false, kGooglePins, DOMAIN_NE_JP },
- {12, true, "\006" "google" "\003" "net", false, kGooglePins, DOMAIN_GOOGLE_NET },
- {11, true, "\006" "google" "\002" "nl", false, kGooglePins, DOMAIN_GOOGLE_NL },
- {11, true, "\006" "google" "\002" "no", false, kGooglePins, DOMAIN_GOOGLE_NO },
- {11, true, "\006" "google" "\002" "nr", false, kGooglePins, DOMAIN_GOOGLE_NR },
- {11, true, "\006" "google" "\002" "nu", false, kGooglePins, DOMAIN_GOOGLE_NU },
- {15, true, "\006" "google" "\003" "off" "\002" "ai", false, kGooglePins, DOMAIN_OFF_AI },
- {11, true, "\006" "google" "\002" "pk", false, kGooglePins, DOMAIN_GOOGLE_PK },
- {11, true, "\006" "google" "\002" "pl", false, kGooglePins, DOMAIN_GOOGLE_PL },
- {11, true, "\006" "google" "\002" "pn", false, kGooglePins, DOMAIN_GOOGLE_PN },
- {11, true, "\006" "google" "\002" "ps", false, kGooglePins, DOMAIN_GOOGLE_PS },
- {11, true, "\006" "google" "\002" "pt", false, kGooglePins, DOMAIN_GOOGLE_PT },
- {11, true, "\006" "google" "\002" "ro", false, kGooglePins, DOMAIN_GOOGLE_RO },
- {11, true, "\006" "google" "\002" "rs", false, kGooglePins, DOMAIN_GOOGLE_RS },
- {11, true, "\006" "google" "\002" "ru", false, kGooglePins, DOMAIN_GOOGLE_RU },
- {11, true, "\006" "google" "\002" "rw", false, kGooglePins, DOMAIN_GOOGLE_RW },
- {11, true, "\006" "google" "\002" "sc", false, kGooglePins, DOMAIN_GOOGLE_SC },
- {11, true, "\006" "google" "\002" "se", false, kGooglePins, DOMAIN_GOOGLE_SE },
- {11, true, "\006" "google" "\002" "sh", false, kGooglePins, DOMAIN_GOOGLE_SH },
- {11, true, "\006" "google" "\002" "si", false, kGooglePins, DOMAIN_GOOGLE_SI },
- {11, true, "\006" "google" "\002" "sk", false, kGooglePins, DOMAIN_GOOGLE_SK },
- {11, true, "\006" "google" "\002" "sm", false, kGooglePins, DOMAIN_GOOGLE_SM },
- {11, true, "\006" "google" "\002" "sn", false, kGooglePins, DOMAIN_GOOGLE_SN },
- {11, true, "\006" "google" "\002" "so", false, kGooglePins, DOMAIN_GOOGLE_SO },
- {11, true, "\006" "google" "\002" "st", false, kGooglePins, DOMAIN_GOOGLE_ST },
- {11, true, "\006" "google" "\002" "td", false, kGooglePins, DOMAIN_GOOGLE_TD },
- {11, true, "\006" "google" "\002" "tg", false, kGooglePins, DOMAIN_GOOGLE_TG },
- {11, true, "\006" "google" "\002" "tk", false, kGooglePins, DOMAIN_GOOGLE_TK },
- {11, true, "\006" "google" "\002" "tl", false, kGooglePins, DOMAIN_GOOGLE_TL },
- {11, true, "\006" "google" "\002" "tm", false, kGooglePins, DOMAIN_GOOGLE_TM },
- {11, true, "\006" "google" "\002" "tn", false, kGooglePins, DOMAIN_GOOGLE_TN },
- {11, true, "\006" "google" "\002" "to", false, kGooglePins, DOMAIN_GOOGLE_TO },
- {11, true, "\006" "google" "\002" "tt", false, kGooglePins, DOMAIN_GOOGLE_TT },
- {11, true, "\006" "google" "\002" "us", false, kGooglePins, DOMAIN_GOOGLE_US },
- {11, true, "\006" "google" "\002" "uz", false, kGooglePins, DOMAIN_GOOGLE_UZ },
- {11, true, "\006" "google" "\002" "vg", false, kGooglePins, DOMAIN_GOOGLE_VG },
- {11, true, "\006" "google" "\002" "vu", false, kGooglePins, DOMAIN_GOOGLE_VU },
- {11, true, "\006" "google" "\002" "ws", false, kGooglePins, DOMAIN_GOOGLE_WS },
- {23, true, "\005" "learn" "\013" "doubleclick" "\003" "net", false, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\003" "www" "\006" "paypal" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "paypal" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\003" "www" "\006" "elanex" "\003" "biz", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "jottit" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "sunshinepress" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, false, "\003" "www" "\013" "noisebridge" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, false, "\004" "neg9" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "riseup" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, false, "\006" "factor" "\002" "cc", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\007" "members" "\010" "mayfirst" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\007" "support" "\010" "mayfirst" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\002" "id" "\010" "mayfirst" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\005" "lists" "\010" "mayfirst" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\007" "webmail" "\010" "mayfirst" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, true, "\011" "roundcube" "\010" "mayfirst" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, false, "\016" "aladdinschools" "\007" "appspot" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "ottospora" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, false, "\003" "www" "\017" "paycheckrecords" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\010" "lastpass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "www" "\010" "lastpass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "keyerror" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\010" "entropia" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\003" "www" "\010" "entropia" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "romab" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\012" "logentries" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\003" "www" "\012" "logentries" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "stripe" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {27, true, "\025" "cloudsecurityalliance" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\005" "login" "\004" "sapo" "\002" "pt", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "mattmccutchen" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "betnet" "\002" "fr", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "uprotect" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\010" "squareup" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "square" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "cert" "\002" "se", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "crypto" "\002" "is", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\005" "simon" "\007" "butcher" "\004" "name", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\004" "linx" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "dropcam" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\003" "www" "\007" "dropcam" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\010" "ebanking" "\014" "indovinabank" "\003" "com" "\002" "vn", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "epoxate" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\012" "torproject" "\003" "org", true, kTorPins, DOMAIN_TORPROJECT_ORG },
- {21, true, "\004" "blog" "\012" "torproject" "\003" "org", true, kTorPins, DOMAIN_TORPROJECT_ORG },
- {22, true, "\005" "check" "\012" "torproject" "\003" "org", true, kTorPins, DOMAIN_TORPROJECT_ORG },
- {20, true, "\003" "www" "\012" "torproject" "\003" "org", true, kTorPins, DOMAIN_TORPROJECT_ORG },
- {21, true, "\004" "dist" "\012" "torproject" "\003" "org", true, kTorPins, DOMAIN_TORPROJECT_ORG },
- {22, true, "\003" "www" "\014" "moneybookers" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\013" "ledgerscope" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, false, "\003" "www" "\013" "ledgerscope" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "app" "\007" "recurly" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "api" "\007" "recurly" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "greplin" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\003" "www" "\007" "greplin" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {27, true, "\006" "luneta" "\016" "nearbuysystems" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "ubertt" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "pixi" "\002" "me", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "grepular" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\012" "mydigipass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\003" "www" "\012" "mydigipass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {26, false, "\011" "developer" "\012" "mydigipass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, false, "\003" "www" "\011" "developer" "\012" "mydigipass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, false, "\007" "sandbox" "\012" "mydigipass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, false, "\003" "www" "\007" "sandbox" "\012" "mydigipass" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "crypto" "\003" "cat", true, kCryptoCatPins, DOMAIN_CRYPTO_CAT },
- {25, true, "\014" "bigshinylock" "\006" "minazo" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "crate" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "twitter" "\003" "com", true, kTwitterComPins, DOMAIN_TWITTER_COM },
- {17, true, "\003" "www" "\007" "twitter" "\003" "com", true, kTwitterComPins, DOMAIN_TWITTER_COM },
- {17, true, "\003" "api" "\007" "twitter" "\003" "com", false, kTwitterCDNPins, DOMAIN_TWITTER_COM },
- {19, true, "\005" "oauth" "\007" "twitter" "\003" "com", false, kTwitterComPins, DOMAIN_TWITTER_COM },
- {20, true, "\006" "mobile" "\007" "twitter" "\003" "com", false, kTwitterComPins, DOMAIN_TWITTER_COM },
- {17, true, "\003" "dev" "\007" "twitter" "\003" "com", false, kTwitterComPins, DOMAIN_TWITTER_COM },
- {22, true, "\010" "business" "\007" "twitter" "\003" "com", false, kTwitterComPins, DOMAIN_TWITTER_COM },
- {22, true, "\010" "platform" "\007" "twitter" "\003" "com", false, kTwitterCDNPins, DOMAIN_TWITTER_COM },
- {11, true, "\005" "twimg" "\003" "com", false, kTwitterCDNPins, DOMAIN_TWIMG_COM },
- {22, true, "\020" "braintreegateway" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, false, "\021" "braintreepayments" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {27, false, "\003" "www" "\021" "braintreepayments" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, false, "\022" "emailprivacytester" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "tor2web" "\003" "org", false, kTor2webPins, DOMAIN_TOR2WEB_ORG },
- {25, true, "\010" "business" "\007" "medbank" "\003" "com" "\002" "mt", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\005" "arivo" "\003" "com" "\002" "br", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\003" "www" "\013" "apollo-auto" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\003" "www" "\005" "cueup" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, false, "\005" "jitsi" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\003" "www" "\005" "jitsi" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\010" "download" "\005" "jitsi" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, true, "\003" "sol" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\010" "irccloud" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "www" "\010" "irccloud" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\005" "alpha" "\010" "irccloud" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "passwd" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "browserid" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\005" "login" "\007" "persona" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "neonisi" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "www" "\007" "neonisi" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\005" "shops" "\007" "neonisi" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "piratenlogin" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "howrandom" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\010" "intercom" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\003" "api" "\010" "intercom" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\003" "www" "\010" "intercom" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\010" "fatzebra" "\003" "com" "\002" "au", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\007" "csawctf" "\004" "poly" "\003" "edu", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "makeyourlaws" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, false, "\003" "www" "\014" "makeyourlaws" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\003" "iop" "\006" "intuit" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\010" "surfeasy" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "www" "\010" "surfeasy" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "packagist" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\003" "www" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "mylookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, false, "\003" "www" "\011" "mylookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\002" "dm" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\010" "business" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\004" "blog" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "faq" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\010" "platform" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\005" "email" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "app" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "api" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\011" "keymaster" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\020" "mygadgetguardian" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\011" "discovery" "\007" "lookout" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "mobilethreat" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\023" "mobilethreatnetwork" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "itriskltd" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "stocktrade" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\011" "openshift" "\006" "redhat" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\014" "therapynotes" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, false, "\003" "www" "\014" "therapynotes" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\003" "wiz" "\003" "biz", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\002" "my" "\006" "onlime" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\007" "webmail" "\006" "onlime" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\003" "crm" "\006" "onlime" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\003" "www" "\003" "gov" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "silentcircle" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "silentcircle" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "serverdensity" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\002" "my" "\010" "alfresco" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\007" "webmail" "\010" "gigahost" "\002" "dk", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "paymill" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "paymill" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "gocardless" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "espra" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "zoo24" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\004" "mega" "\002" "co" "\002" "nz", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\003" "api" "\004" "mega" "\002" "co" "\002" "nz", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "lockify" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\010" "writeapp" "\002" "me", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\010" "bugzilla" "\007" "mozilla" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\007" "members" "\020" "nearlyfreespeech" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, false, "\003" "ssl" "\011" "panoramio" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "kiwiirc" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "pay" "\010" "gigahost" "\002" "dk", true, kNoPins, DOMAIN_NOT_PINNED },
- {27, true, "\015" "controlcenter" "\010" "gigahost" "\002" "dk", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "simple" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\003" "www" "\006" "simple" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\002" "fj" "\006" "simple" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\003" "api" "\006" "simple" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\004" "bank" "\006" "simple" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "bassh" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\004" "sah3" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, false, "\003" "grc" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\003" "www" "\003" "grc" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\003" "www" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\007" "manager" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\004" "blog" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\007" "library" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\005" "forum" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\001" "p" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\005" "paste" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, false, "\010" "pastebin" "\006" "linode" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "inertianetworks" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\010" "carezone" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "conformal" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "cyphertite" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "logotype" "\002" "se", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\004" "bccx" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "launchkey" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\010" "carlolly" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\003" "www" "\013" "cyveillance" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\004" "blog" "\013" "cyveillance" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "whonix" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "shodan" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "rapidresearch" "\002" "me", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "surkatty" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "securityheaders" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "haste" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "mudcrab" "\002" "us", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "mediacru" "\002" "sh", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "lolicore" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\007" "cloudns" "\003" "com" "\002" "au", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\005" "oplop" "\007" "appspot" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "bcrook" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\004" "wiki" "\006" "python" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, false, "\004" "lumi" "\002" "do", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\020" "appseccalifornia" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "crowdcurity" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\013" "saturngames" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\021" "strongest-privacy" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\011" "ecosystem" "\011" "atlassian" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\002" "id" "\011" "atlassian" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "bitbucket" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "cupcake" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "cupcake" "\002" "is", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "tent" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "cybozu" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "davidlyness" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "medium" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\007" "liberty" "\007" "lavabit" "\003" "com", true, kLavabitPins, DOMAIN_LAVABIT_COM },
- {16, true, "\012" "getlantern" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "kinsights" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\007" "simbolo" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, false, "\003" "www" "\007" "simbolo" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\012" "zenpayroll" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\003" "www" "\012" "zenpayroll" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\003" "get" "\012" "zenpayroll" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, false, "\006" "errors" "\012" "zenpayroll" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, false, "\006" "manage" "\012" "zenpayroll" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "gernert-server" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\010" "skydrive" "\004" "live" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\011" "lifeguard" "\005" "aecom" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\004" "data" "\003" "qld" "\003" "gov" "\002" "au", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, false, "\014" "publications" "\003" "qld" "\003" "gov" "\002" "au", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\002" "go" "\004" "xero" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\005" "login" "\004" "xero" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\002" "my" "\004" "xero" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\007" "payroll" "\004" "xero" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\002" "in" "\004" "xero" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\003" "api" "\004" "xero" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\003" "eff" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "mail" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\010" "passport" "\006" "yandex" "\002" "ru", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, false, "\010" "passport" "\006" "yandex" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\010" "passport" "\006" "yandex" "\002" "ua", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\010" "passport" "\006" "yandex" "\002" "by", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\010" "passport" "\006" "yandex" "\002" "kz", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, false, "\010" "passport" "\006" "yandex" "\003" "com" "\002" "tr", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "mnsure" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\010" "getcloak" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "www" "\010" "getcloak" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\020" "matteomarescotti" "\004" "name", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\003" "www" "\011" "heliosnet" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "opsmate" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "www" "\007" "opsmate" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "f-droid" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "www" "\010" "evernote" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "app" "\010" "yinxiang" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "neilwynne" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\016" "calyxinstitute" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, false, "\003" "www" "\016" "calyxinstitute" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "blacklane" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "boxcryptor" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, false, "\004" "aclu" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\003" "www" "\004" "aclu" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "prodpad" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "mailbox" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "roddis" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\003" "www" "\006" "roddis" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "fiken" "\002" "no", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "fairbill" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "nexth" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "nexth" "\002" "us", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "nexth" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "souyar" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "souyar" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "souyar" "\002" "us", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, false, "\003" "www" "\007" "banking" "\002" "co" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, false, "\003" "mbp" "\007" "banking" "\002" "co" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "feedbin" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "heha" "\002" "co", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "passwordbox" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "python" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\004" "pypi" "\006" "python" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\003" "www" "\006" "python" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\004" "docs" "\006" "python" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "encircleapp" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\010" "onedrive" "\004" "live" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "onedrive" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "keepersecurity" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "keeperapp" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "donmez" "\002" "ws", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, false, "\010" "activiti" "\010" "alfresco" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "cloudcert" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "seifried" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, false, "\005" "wepay" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\003" "www" "\005" "wepay" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\006" "static" "\005" "wepay" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\005" "stage" "\005" "wepay" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "vmoagents" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "adsfund" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, false, "\004" "pult" "\002" "co", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "dillonkorman" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "edmodo" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, false, "\003" "www" "\013" "eternalgoth" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "app" "\007" "manilla" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "harvestapp" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "anycoin" "\002" "me", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "noexpect" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\006" "airbnb" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\003" "www" "\006" "airbnb" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, false, "\004" "usaa" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\003" "www" "\004" "usaa" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, false, "\006" "mobile" "\004" "usaa" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "subrosa" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\011" "detectify" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "crbug" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "manageprojects" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, false, "\017" "tinfoilsecurity" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, false, "\003" "www" "\017" "tinfoilsecurity" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, false, "\006" "imouto" "\002" "my", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "vocaloid" "\002" "my", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\006" "sakaki" "\005" "anime" "\002" "my", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\007" "reviews" "\005" "anime" "\002" "my", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\004" "miku" "\007" "hatsune" "\002" "my", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\012" "webcollect" "\003" "org" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, false, "\003" "www" "\016" "capitainetrain" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\010" "accounts" "\007" "firefox" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {6, true, "\001" "z" "\002" "ai", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "wildbee" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\006" "portal" "\005" "tirol" "\002" "gv" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "dropbox" "\003" "com", true, kDropboxPins, DOMAIN_DROPBOX_COM },
- {17, true, "\003" "www" "\007" "dropbox" "\003" "com", true, kDropboxPins, DOMAIN_DROPBOX_COM },
- {18, true, "\012" "code-poets" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "jackyyf" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "flynn" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "hackerone" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\026" "hackerone-user-content" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, false, "\017" "gamesdepartment" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {27, true, "\003" "www" "\017" "gamesdepartment" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\012" "schokokeks" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\003" "www" "\012" "schokokeks" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\006" "config" "\012" "schokokeks" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, true, "\007" "webmail" "\012" "schokokeks" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, true, "\003" "mwe" "\002" "st", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "ub3rk1tten" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "addvocate" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "alexsexton" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "azprep" "\002" "us", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "beneathvt" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "cloudup" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "cryptopartyatx" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "cybershambles" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {7, true, "\002" "ed" "\002" "gs", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "forewordreviews" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\020" "giacomopelagatti" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "helichat" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\022" "hostinginnederland" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "isitchristmas" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "konklone" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "koop-bremen" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "kura" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {34, true, "\035" "markusueberallassetmanagement" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "mikewest" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "miskatonic" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "optimus" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "oversight" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\007" "picksin" "\004" "club", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\026" "pressfreedomfoundation" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\020" "projektzentrisch" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "rippleunion" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "robteix" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, true, "\003" "s-c" "\002" "se", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "security-carpet" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "sherbers" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "tittelbach" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "tomfisher" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "wunderlist" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "zotero" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "adamkostecki" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "archlinux" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "auf-feindgebiet" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "baruch" "\002" "me", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "bedeta" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "benjamins" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "bl4ckb0x" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "bl4ckb0x" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\010" "bl4ckb0x" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "bl4ckb0x" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "bl4ckb0x" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\020" "blocksatz-medien" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "conrad-kostecki" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "cube" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "datenkeks" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "derhil" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\024" "energy-drink-magazin" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\031" "ferienhaus-polchow-ruegen" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "fischer-its" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "freeshell" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "greensolid" "\003" "biz", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "hasilocke" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "hausverbrauch" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "helpium" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "hex2013" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "honeytracks" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "ihrlotto" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "jonas-keidel" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "jonaswitmer" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "k-dev" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "kraken" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\014" "lagerauftrag" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "lavalite" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "loenshotel" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "loftboard" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "mondwandler" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\021" "mountainroseherbs" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "movlib" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "musicgamegalaxy" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "mynigma" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\012" "nachsenden" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "netzbit" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, true, "\003" "pdf" "\002" "yt", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "pierre-schmitz" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "promecon-gmbh" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "prowhisky" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "pubkey" "\002" "is", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "qetesh" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "riccy" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "scrambl" "\002" "is", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "tageau" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "ukrainians" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "viennan" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\020" "winhistory-forum" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "y-o-w" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "explodie" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, true, "\003" "aie" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "baer" "\002" "im", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\027" "bayrisch-fuer-anfaenger" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "beastowner" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "beastowner" "\002" "li", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\023" "best-wedding-quotes" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "bitfactory" "\002" "ws", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "bohramt" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\030" "buddhistische-weisheiten" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "cartouche24" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "cartucce24" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "celltek-server" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "clapping-rhymes" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {26, true, "\025" "die-besten-weisheiten" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "edyou" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "eurotramp" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "forodeespanol" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\022" "gemeinfreie-lieder" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "getdigitized" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "globuli-info" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "guphi" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\027" "guthabenkarten-billiger" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "haufschild" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {31, true, "\032" "hoerbuecher-und-hoerspiele" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "iban" "\002" "is", true, kNoPins, DOMAIN_NOT_PINNED },
- {29, true, "\026" "irische-segenswuensche" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "it-schwerin" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\021" "janus-engineering" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "jfreitag" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "julian-kipka" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "kardize24" "\002" "pl", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "kernel-error" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\027" "kinderbuecher-kostenlos" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "kitsta" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "klatschreime" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, true, "\023" "kleidertauschpartys" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "koordinate" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "lasst-uns-beten" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "lb-toner" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\024" "mandala-ausmalbilder" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "mathiasbynens" "\002" "be", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "klaxn" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\004" "mig5" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "netzpolitik" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\003" "npw" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "otakuworld" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "pajonzeck" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "rad-route" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "raiseyourflag" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "redports" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "reserve-online" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "riesenmagnete" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "rosenkeller" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "salaervergleich" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "schwarzer" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "secuvera" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "siammedia" "\002" "co", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "simplystudio" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\031" "sprueche-zum-valentinstag" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {26, true, "\023" "sprueche-zur-geburt" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {26, true, "\025" "sprueche-zur-hochzeit" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {30, true, "\031" "sprueche-zur-konfirmation" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "studydrive" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "supplies24" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "supplies24" "\002" "es", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "tatort-fanpage" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "tektoria" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "texte-zur-taufe" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "tinte24" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "tintenfix" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\027" "tipps-fuer-den-haushalt" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "toner24" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\007" "toner24" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "toner24" "\002" "es", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "toner24" "\002" "fr", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "toner24" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "toner24" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "toner24" "\002" "pl", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "tonerdepot" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "tonerjet" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\010" "tonerjet" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "tonerklick" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "tonerkurier" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "tonermaus" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "tonermonster" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "tonex" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "tonex" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\013" "trauertexte" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\020" "unterfrankenclan" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "webandmore" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {26, true, "\025" "welches-kinderfahrrad" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "apadvantage" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\021" "apn-einstellungen" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "barcodeberlin" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "certible" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "data-abundance" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "dedimax" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "hostix" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "janoberst" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\006" "jelmer" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "jelmer" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "munich-rage" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "posteo" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\024" "stationary-traveller" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, true, "\022" "thepaymentscompany" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\007" "xps2pdf" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "ansdell" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "brunosouza" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "bugzil" "\002" "la", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "bytepark" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "ethitter" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "firemail" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "gmantra" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "mach-politik" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "malnex" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\014" "mutantmonkey" "\004" "sexy", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "ng-security" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "palava" "\002" "tv", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "reedloden" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, true, "\023" "rws-vertriebsportal" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "sdsl-speedtest" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {27, true, "\026" "servethecity-karlsruhe" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "tunebitfm" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "websenat" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "zeropush" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "ludwig" "\002" "im", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "gparent" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\004" "blog" "\007" "gparent" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, false, "\001" "m" "\007" "gparent" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\002" "ca" "\007" "gparent" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, false, "\011" "simpletax" "\002" "ca", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, false, "\004" "help" "\011" "simpletax" "\002" "ca", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, false, "\003" "app" "\011" "simpletax" "\002" "ca", true, kNoPins, DOMAIN_NOT_PINNED },
- {35, false, "\006" "daphne" "\012" "informatik" "\014" "uni-freiburg" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "bedreid" "\002" "dk", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "cotonea" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "everhome" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "fixingdns" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "flamer-scene" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "insouciant" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "kaheim" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "kevincox" "\002" "ca", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "lingolia" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "matatall" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\010" "net-safe" "\004" "info", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "okmx" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "osterkraenzchen" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "parent5446" "\002" "us", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "patt" "\002" "us", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "peercraft" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "room-checkin24" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "securify" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "shaaaaaaaaaaaaa" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "shopontarget" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "siraweb" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "spdysync" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "sylaps" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "sysctl" "\002" "se", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "tauchkater" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "theshadestore" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "tomvote" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "toshnix" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "warrencreative" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "zeplin" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "17hats" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "cdnb" "\002" "co", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "github" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "id-co" "\002" "in", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "ideaweb" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "man3s" "\002" "jp", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "meinebo" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "nmctest" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "partyvan" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "partyvan" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "partyvan" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "partyvan" "\002" "se", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "regar42" "\002" "fr", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\012" "scotthelme" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "suite73" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "wubthecaptain" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\022" "1a-diamantscheiben" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\013" "simplyfixit" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "1a-vermessung" "\002" "at", true, kNoPins, DOMAIN_NOT_PINNED },
- {24, true, "\023" "1a-werkstattgeraete" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "annahmeschluss" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "bautied" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "codepref" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\023" "encryptallthethings" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "futos" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "jonnybarnes" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\013" "miasarafina" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "mothereff" "\002" "in", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "mths" "\002" "be", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\013" "prefontaine" "\004" "name", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "redlatam" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "schachburg" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\022" "schreiber-netzwerk" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "syss" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\006" "terrax" "\006" "berlin", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "tollmanz" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "tresorit" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "vaddder" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "wikidsystems" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {28, true, "\027" "wohnungsbau-ludwigsburg" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "xtream-hosting" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "xtream-hosting" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "xtream-hosting" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\015" "xtreamhosting" "\002" "eu", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, false, "\013" "honeybadger" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, false, "\003" "www" "\013" "honeybadger" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "amigogeek" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\024" "andreasbreitenlohner" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "aprz" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\005" "arlen" "\002" "io", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "bitfarm-archiv" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\016" "bitfarm-archiv" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "bulktrade" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "buzzconcert" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "chulado" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "cimballa" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "daylightcompany" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "denh" "\002" "am", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "devh" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "evstatus" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "filedir" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\016" "frederik-braun" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "gplintegratedit" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "html5" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, true, "\003" "ian" "\002" "sh", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\015" "ilikerainbows" "\002" "co" "\002" "uk", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "ilmconpm" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "inleaked" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\005" "klaxn" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\006" "labina" "\003" "com" "\002" "tr", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "liebel" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "luxus-russen" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\020" "matteomarescotti" "\002" "it", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "minikneet" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "minikneet" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "mkcert" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "msc-seereisen" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "mykreuzfahrt" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "oscarvk" "\002" "ch", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "plothost" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "reishunger" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "salserocafe" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "samizdat" "\002" "cz", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "sslmate" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "steventress" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "tekshrek" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "temehu" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "tobias-kluge" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "vortexhobbies" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {16, true, "\012" "willnorris" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "mykolab" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\013" "semenkovich" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {8, false, "\003" "rme" "\002" "li", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, false, "\003" "www" "\003" "rme" "\002" "li", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "aiticon" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "aiticon" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "anetaben" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "annevankesteren" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "annevankesteren" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {21, true, "\017" "annevankesteren" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "barslecht" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "barslecht" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\010" "blessnet" "\002" "jp", true, kNoPins, DOMAIN_NOT_PINNED },
- {22, true, "\020" "cloudstoragemaus" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "comdurav" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "digitaldaddy" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "eldietista" "\002" "es", true, kNoPins, DOMAIN_NOT_PINNED },
- {20, true, "\017" "elnutricionista" "\002" "es", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\011" "fronteers" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "getssl" "\002" "uz", true, kNoPins, DOMAIN_NOT_PINNED },
- {18, true, "\014" "gunnarhafdal" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {14, true, "\010" "heijblok" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {9, true, "\004" "kdex" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {11, true, "\006" "limpid" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {23, true, "\021" "minez-nightswatch" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "pisidia" "\002" "de", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\004" "quuz" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "sale4ru" "\002" "ru", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "shipard" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\007" "shohruh" "\002" "uz", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\003" "sro" "\006" "center", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "standardssuck" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\011" "testsuite" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {25, true, "\023" "thecustomizewindows" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, true, "\007" "uzstyle" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {15, true, "\012" "weggeweest" "\002" "nl", true, kNoPins, DOMAIN_NOT_PINNED },
- {12, true, "\006" "whatwg" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\014" "when-release" "\002" "ru", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "xn--maraa-rta" "\003" "org", true, kNoPins, DOMAIN_NOT_PINNED },
- {19, true, "\015" "otakurepublic" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {10, true, "\004" "mqas" "\003" "net", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "dlc" "\007" "viasinc" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {17, true, "\003" "www" "\007" "viasinc" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
- {13, false, "\007" "viasinc" "\003" "com", true, kNoPins, DOMAIN_NOT_PINNED },
+struct Pinset {
+ const char *const *const accepted_pins;
+ const char *const *const rejected_pins;
};
-static const size_t kNumPreloadedSTS = ARRAYSIZE_UNSAFE(kPreloadedSTS);
+
+static const struct Pinset kPinsets[] = {
+ {kTestAcceptableCerts, kNoRejectedPublicKeys},
+ {kGoogleAcceptableCerts, kNoRejectedPublicKeys},
+ {kTorAcceptableCerts, kNoRejectedPublicKeys},
+ {kTwitterComAcceptableCerts, kNoRejectedPublicKeys},
+ {kTwitterCDNAcceptableCerts, kNoRejectedPublicKeys},
+ {kTor2webAcceptableCerts, kNoRejectedPublicKeys},
+ {kCryptoCatAcceptableCerts, kNoRejectedPublicKeys},
+ {kLavabitAcceptableCerts, kNoRejectedPublicKeys},
+ {kDropboxAcceptableCerts, kNoRejectedPublicKeys},
+};
+
+// kHSTSHuffmanTree describes a Huffman tree. The nodes of the tree are pairs
+// of uint8s. The last node in the array is the root of the tree. Each pair is
+// two uint8 values, the first is "left" and the second is "right". If a uint8
+// value has the MSB set then it represents a literal leaf value. Otherwise
+// it's a pointer to the n'th element of the array.
+static const uint8 kHSTSHuffmanTree[] = {
+ 0xad, 0xf9, 0x00, 0xf7, 0x01, 0xec, 0x02, 0x80,
+ 0xb3, 0xb1, 0xf1, 0x04, 0xb4, 0x05, 0x06, 0xf8,
+ 0xf6, 0x07, 0xeb, 0x08, 0xed, 0x09, 0xe1, 0x0a,
+ 0xe2, 0xe8, 0xe3, 0x0c, 0xe7, 0x0d, 0x0b, 0x0e,
+ 0x03, 0x0f, 0xee, 0xf3, 0xb9, 0xb6, 0x12, 0xb7,
+ 0xb5, 0x13, 0xb0, 0x14, 0x15, 0xb2, 0x16, 0xea,
+ 0xfa, 0x17, 0x18, 0xe6, 0x19, 0xf5, 0xae, 0x1a,
+ 0x11, 0x1b, 0xff, 0x1c, 0xf4, 0xe9, 0xe5, 0x1e,
+ 0xe4, 0xf0, 0x20, 0xf2, 0x21, 0xef, 0x1f, 0x22,
+ 0x1d, 0x23, 0x10, 0x24,
+};
+
+static const uint8 kPreloadedHSTSData[] = {
+ 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x25, 0x9f,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x2d, 0x9b, 0x1f, 0x2a,
+ 0x48, 0x54, 0xb9, 0x13, 0x4b, 0xc8, 0xb4, 0xfe,
+ 0xd6, 0x0f, 0x2a, 0xdd, 0x4a, 0xb1, 0xa8, 0x9f,
+ 0x9d, 0x4d, 0xae, 0xc5, 0x8e, 0x84, 0x3f, 0x3f,
+ 0x43, 0x95, 0xb1, 0x31, 0x05, 0xf8, 0x78, 0x4f,
+ 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2a, 0x29, 0xf0,
+ 0xb7, 0xfb, 0x1a, 0x2b, 0xd9, 0xf6, 0xee, 0x1a,
+ 0xf7, 0x8e, 0x95, 0xb0, 0xf7, 0x04, 0xc2, 0x7f,
+ 0xeb, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x91,
+ 0xa7, 0xff, 0x59, 0x5e, 0xeb, 0x60, 0xb7, 0xfb,
+ 0x1a, 0x27, 0x89, 0xff, 0xd6, 0x57, 0xba, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x89, 0xfe, 0x7f, 0xf5, 0x95,
+ 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x86, 0x9f,
+ 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68,
+ 0xa2, 0x27, 0xfd, 0xee, 0xb6, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0x91, 0x9f, 0xff, 0xb3, 0x8a, 0x20, 0x36,
+ 0xd7, 0x7f, 0x9a, 0xd5, 0x39, 0x2a, 0x56, 0x52,
+ 0x29, 0x17, 0xd1, 0xa7, 0xfe, 0xb7, 0xba, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x89, 0x42, 0x1e, 0x5c, 0xe9,
+ 0x74, 0x69, 0x6c, 0x62, 0x30, 0x97, 0x51, 0x35,
+ 0x13, 0x39, 0x52, 0x5e, 0x94, 0xaa, 0xa5, 0x7c,
+ 0x3d, 0xae, 0x0b, 0x27, 0xff, 0x59, 0x5e, 0xeb,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0x39, 0xff, 0xd6,
+ 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0x26,
+ 0x7f, 0xe1, 0x75, 0xa9, 0xba, 0xac, 0xed, 0xf2,
+ 0x74, 0x0a, 0x3a, 0xea, 0xa5, 0x7a, 0x94, 0xfe,
+ 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x1c, 0x9f, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0x2f, 0x9f, 0x7e, 0x9c, 0x97,
+ 0x4a, 0x95, 0xb0, 0xf6, 0x3a, 0x61, 0x3f, 0xfa,
+ 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x32,
+ 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2d, 0xe9,
+ 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
+ 0x8a, 0x4e, 0x11, 0x39, 0x97, 0x42, 0x4f, 0x09,
+ 0xea, 0xa4, 0xb8, 0xee, 0x7f, 0x5b, 0x05, 0xbf,
+ 0xd8, 0xd1, 0x0e, 0xcf, 0xfe, 0xb2, 0xbd, 0xd6,
+ 0xc1, 0x6f, 0xf6, 0x34, 0x4b, 0x13, 0xfa, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x88, 0xc2, 0x7f, 0xeb, 0x7b,
+ 0xad, 0x82, 0xdf, 0xec, 0x68, 0x8f, 0x67, 0xf5,
+ 0xb0, 0x5b, 0xfd, 0x8d, 0x16, 0x1c, 0xfe, 0xb6,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0xe7, 0x84, 0x4e, 0x29,
+ 0xe3, 0xb7, 0x29, 0x6c, 0xed, 0x49, 0x9a, 0x3b,
+ 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x43, 0xd3,
+ 0xe1, 0x6f, 0xf6, 0x34, 0x44, 0xd3, 0x69, 0x47,
+ 0x4f, 0xfe, 0xca, 0x02, 0xf5, 0x53, 0x6f, 0xe9,
+ 0x14, 0x74, 0x3e, 0x7c, 0x54, 0x16, 0x9e, 0xd5,
+ 0xfe, 0x09, 0xa2, 0x17, 0x95, 0xb1, 0x1c, 0xb5,
+ 0x84, 0x95, 0xe4, 0x73, 0xda, 0xa6, 0xf4, 0x74,
+ 0xff, 0xed, 0xac, 0xec, 0x7d, 0xc0, 0x2b, 0xff,
+ 0xa7, 0x4d, 0xf7, 0x07, 0x4a, 0xe5, 0xc4, 0x43,
+ 0x50, 0x8b, 0xd3, 0x27, 0xd4, 0xfd, 0x7b, 0x8e,
+ 0x9e, 0xdd, 0x77, 0xc9, 0xd3, 0x82, 0x10, 0x95,
+ 0x3e, 0xfe, 0xea, 0x98, 0x55, 0x8b, 0xc9, 0xf7,
+ 0xe9, 0x6c, 0xd1, 0xd1, 0xc2, 0x26, 0xf9, 0x3f,
+ 0xe9, 0xac, 0xff, 0xdc, 0xed, 0x60, 0x28, 0x9b,
+ 0x1b, 0xee, 0x67, 0x4f, 0xfb, 0x77, 0x53, 0xa9,
+ 0x54, 0xda, 0x8e, 0x9f, 0xb1, 0x75, 0xee, 0xca,
+ 0x9d, 0x3d, 0x9c, 0x63, 0xc7, 0x46, 0x27, 0x9f,
+ 0xb8, 0x60, 0xac, 0x65, 0x44, 0xce, 0x9f, 0xe8,
+ 0xbe, 0x7e, 0xc0, 0xa6, 0x71, 0xb3, 0xa7, 0xff,
+ 0xff, 0x77, 0xaf, 0xa5, 0xde, 0xe7, 0x14, 0xda,
+ 0xc0, 0x57, 0x1f, 0x70, 0xe0, 0x4e, 0x9f, 0x6f,
+ 0x57, 0xa3, 0xc7, 0x4f, 0xe7, 0xdd, 0x5b, 0xb7,
+ 0xa3, 0xe7, 0x4f, 0xef, 0x0d, 0xeb, 0x26, 0xbc,
+ 0xe8, 0xd9, 0xf5, 0xf4, 0xe2, 0x11, 0x33, 0x4c,
+ 0x7e, 0x18, 0x4a, 0x4d, 0x7b, 0x8e, 0x9d, 0xfa,
+ 0xa9, 0xd3, 0x5e, 0xf1, 0xd3, 0xc9, 0xdd, 0x2c,
+ 0xe3, 0x66, 0x23, 0x73, 0xff, 0xeb, 0xd3, 0x40,
+ 0x76, 0xfb, 0x80, 0x33, 0x4b, 0xf9, 0xa3, 0xa7,
+ 0xfe, 0xa2, 0x5d, 0x03, 0x5d, 0xfd, 0x26, 0x8e,
+ 0x9f, 0xc0, 0x3e, 0xed, 0xd2, 0xf5, 0x1d, 0x1c,
+ 0x9f, 0xef, 0x51, 0xa7, 0xfc, 0x2b, 0x01, 0x54,
+ 0xdb, 0xdf, 0xa3, 0xa1, 0x0f, 0x8e, 0xf2, 0x39,
+ 0xff, 0xff, 0xeb, 0xfb, 0x51, 0xea, 0x2c, 0x00,
+ 0x3a, 0xdb, 0xb1, 0xfd, 0x62, 0xee, 0xe5, 0x4e,
+ 0x92, 0x1d, 0x3f, 0x9d, 0xe3, 0xba, 0xa3, 0xe7,
+ 0x4f, 0xff, 0xff, 0xed, 0xf3, 0x5e, 0xe7, 0xbe,
+ 0x07, 0x14, 0xbc, 0x0e, 0xe3, 0xee, 0xcb, 0xde,
+ 0xee, 0x7b, 0xe7, 0x4e, 0xff, 0x63, 0x45, 0x31,
+ 0x18, 0x8b, 0xe6, 0x84, 0xc4, 0xff, 0xb3, 0xaf,
+ 0xba, 0xba, 0x41, 0x58, 0xe9, 0xf3, 0xfd, 0xc5,
+ 0xd8, 0x74, 0x6c, 0xfa, 0x3c, 0xfe, 0x7f, 0xbd,
+ 0x5c, 0x51, 0x1e, 0xc0, 0x9d, 0x3f, 0xff, 0xbb,
+ 0x8d, 0xad, 0x26, 0xaa, 0xb7, 0x70, 0x20, 0x22,
+ 0xf7, 0x3a, 0x7f, 0xcc, 0x8a, 0xa6, 0x57, 0x37,
+ 0xd3, 0xa1, 0x11, 0x47, 0x46, 0x79, 0xf0, 0xa2,
+ 0xe4, 0x13, 0xa7, 0xef, 0xe8, 0x1c, 0x27, 0x4e,
+ 0x8c, 0x3f, 0x6d, 0x91, 0x5e, 0x4d, 0x0f, 0x2e,
+ 0xcb, 0x70, 0x95, 0x74, 0xe1, 0xa3, 0x3f, 0x7c,
+ 0x8b, 0x70, 0x84, 0x58, 0x3c, 0x61, 0xe0, 0xa8,
+ 0x47, 0x74, 0x87, 0x51, 0xa9, 0x4f, 0x67, 0x6e,
+ 0xdc, 0xce, 0x9f, 0xff, 0xff, 0x53, 0x7a, 0xa6,
+ 0x0a, 0x2e, 0x01, 0x57, 0xdc, 0x01, 0x8f, 0xbb,
+ 0x2f, 0xef, 0x35, 0x3a, 0x5a, 0xda, 0x2d, 0x6a,
+ 0x4f, 0x3f, 0xfe, 0xcc, 0xa6, 0xda, 0x98, 0x05,
+ 0x6f, 0xa2, 0x5c, 0xce, 0x9f, 0xfa, 0xbe, 0xf8,
+ 0x0a, 0x4c, 0xee, 0x97, 0xce, 0x96, 0xfa, 0x8a,
+ 0x1d, 0x2c, 0xcf, 0x9c, 0x8f, 0xba, 0xa7, 0x4f,
+ 0xff, 0xff, 0xfb, 0x3b, 0x74, 0x0d, 0xd2, 0xfb,
+ 0x2d, 0xbd, 0x22, 0xbb, 0xf7, 0x69, 0xbb, 0x65,
+ 0x1f, 0xe5, 0x38, 0x2a, 0x7f, 0xff, 0xe6, 0xd8,
+ 0x78, 0xbc, 0x40, 0xbd, 0x1e, 0xab, 0x52, 0xfa,
+ 0x3f, 0xe1, 0x3a, 0x6b, 0xde, 0x7d, 0x34, 0x5d,
+ 0x94, 0x56, 0x14, 0xb0, 0x8a, 0x9f, 0x69, 0x0c,
+ 0xae, 0xc6, 0xdd, 0x3f, 0xf9, 0x4c, 0x05, 0x3d,
+ 0xd8, 0xaf, 0xef, 0x27, 0x4f, 0xff, 0xb7, 0xdd,
+ 0x53, 0x2e, 0x34, 0xb6, 0x5c, 0xff, 0xbc, 0x9d,
+ 0x3f, 0xf2, 0x75, 0xee, 0xe2, 0xea, 0xde, 0x8f,
+ 0x9d, 0x15, 0x45, 0x35, 0xeb, 0xd3, 0xd9, 0xac,
+ 0x5e, 0x8e, 0x9c, 0xbf, 0x94, 0x3a, 0x6c, 0xe0,
+ 0xe8, 0x79, 0x36, 0xd7, 0x43, 0xc2, 0xa4, 0x9a,
+ 0x25, 0x5c, 0x3d, 0x3f, 0x70, 0x9d, 0xa7, 0xb8,
+ 0xe9, 0xc9, 0xc2, 0x1d, 0x3f, 0x96, 0x76, 0x6a,
+ 0xbe, 0xb0, 0x07, 0x90, 0xa2, 0xd9, 0xfa, 0xe2,
+ 0x9f, 0x73, 0x4e, 0x4e, 0x9f, 0xc2, 0xb7, 0x72,
+ 0x9f, 0xa3, 0xa3, 0x0f, 0x9b, 0x66, 0x93, 0xf2,
+ 0x73, 0x9a, 0x05, 0xe3, 0xa1, 0xc7, 0xa1, 0xd2,
+ 0x19, 0xff, 0xff, 0x6b, 0xbf, 0xcd, 0x5e, 0xcd,
+ 0xf7, 0x5d, 0xc5, 0xc0, 0x54, 0x3d, 0x3a, 0x7f,
+ 0xdb, 0xc5, 0x80, 0xaa, 0x53, 0xee, 0x67, 0x4f,
+ 0xef, 0x7e, 0xb4, 0xcf, 0x13, 0xa3, 0x83, 0xf4,
+ 0xd2, 0x1c, 0x94, 0x74, 0xee, 0xe7, 0x07, 0x42,
+ 0x1a, 0xc7, 0xc4, 0x27, 0xe7, 0xeb, 0x99, 0xdb,
+ 0xa7, 0x4f, 0x28, 0x14, 0xe4, 0xe8, 0xc3, 0xd2,
+ 0xd9, 0x7c, 0x22, 0x79, 0x39, 0x0e, 0x6d, 0xa7,
+ 0x8b, 0x9c, 0xfe, 0xd6, 0xde, 0xca, 0x5f, 0xa3,
+ 0xa7, 0xb1, 0xf4, 0x58, 0xe9, 0xfa, 0x9e, 0xe5,
+ 0x0e, 0xce, 0x9f, 0x6f, 0x91, 0xc7, 0xce, 0x8b,
+ 0xa8, 0xab, 0xd9, 0xaf, 0x24, 0x57, 0x96, 0x4f,
+ 0xff, 0xc2, 0xea, 0x62, 0xd4, 0x4e, 0xdd, 0xee,
+ 0x6a, 0x97, 0x9d, 0x3f, 0xff, 0xb7, 0x8f, 0xba,
+ 0xba, 0xa2, 0x29, 0x37, 0xc0, 0x08, 0xbd, 0xce,
+ 0x9f, 0xff, 0xff, 0x5f, 0xd0, 0x03, 0xef, 0xb8,
+ 0x7f, 0x90, 0x2b, 0x7a, 0x3f, 0x4c, 0xdf, 0x72,
+ 0xe9, 0xd3, 0xff, 0xeb, 0xc4, 0x73, 0x55, 0xa6,
+ 0xf0, 0x0a, 0x72, 0x87, 0x46, 0x23, 0x86, 0x90,
+ 0x8b, 0x9f, 0xfe, 0x75, 0xc5, 0x31, 0x3a, 0xb7,
+ 0x73, 0x55, 0xf3, 0xa7, 0xff, 0xdc, 0x62, 0x80,
+ 0xb8, 0xd2, 0x55, 0x67, 0x78, 0xbc, 0x74, 0xff,
+ 0x67, 0x5e, 0x03, 0x9f, 0xf5, 0x8e, 0x9f, 0xf5,
+ 0x6f, 0xe8, 0x15, 0xbd, 0x7e, 0xf1, 0x3a, 0x7f,
+ 0xf3, 0xc0, 0x56, 0x97, 0x81, 0xaa, 0xd5, 0x04,
+ 0xe9, 0xff, 0xff, 0x63, 0xf5, 0xde, 0x04, 0x0a,
+ 0x66, 0xab, 0x8f, 0x01, 0x9b, 0xe0, 0xe8, 0xc4,
+ 0x5f, 0x6d, 0x3a, 0x1e, 0x56, 0xfe, 0xd1, 0xa5,
+ 0x3e, 0x4f, 0xb5, 0x25, 0x2d, 0xd4, 0xef, 0x51,
+ 0x82, 0x4f, 0xfb, 0xc6, 0x99, 0xa4, 0xee, 0xf9,
+ 0x3a, 0x7f, 0xb0, 0x2f, 0xba, 0xa0, 0x6b, 0x67,
+ 0x4f, 0xff, 0xf9, 0x19, 0x14, 0x02, 0xd4, 0xdf,
+ 0x78, 0x00, 0x16, 0xee, 0x53, 0x0e, 0x86, 0x47,
+ 0x3f, 0x4f, 0x6e, 0x0e, 0xe7, 0xb7, 0xad, 0xa1,
+ 0xd3, 0xff, 0xff, 0xf6, 0x91, 0x5d, 0xdd, 0xda,
+ 0x7a, 0xc0, 0x76, 0xfb, 0x80, 0x31, 0xf7, 0x65,
+ 0xfd, 0xe6, 0xa7, 0x43, 0x91, 0x6f, 0xb2, 0x18,
+ 0x45, 0xe4, 0x3c, 0x97, 0xbb, 0xb8, 0xd6, 0xbe,
+ 0x1d, 0x33, 0xda, 0xaf, 0xf2, 0x74, 0xff, 0xd4,
+ 0xd8, 0x1b, 0x1b, 0xde, 0xf1, 0x63, 0xa7, 0xed,
+ 0x78, 0xf5, 0xfd, 0x9d, 0x18, 0x89, 0x4b, 0xa4,
+ 0x5a, 0x45, 0x9e, 0x06, 0xff, 0xa9, 0xd3, 0xff,
+ 0xf6, 0xc4, 0x0c, 0xde, 0x76, 0xed, 0x37, 0x8a,
+ 0xc6, 0x3a, 0x7f, 0xff, 0xb6, 0xf0, 0xa2, 0xab,
+ 0x7a, 0x00, 0x82, 0x9c, 0x51, 0x14, 0x74, 0x62,
+ 0x30, 0x85, 0x6e, 0x7f, 0xff, 0xf0, 0x8e, 0xde,
+ 0x02, 0x99, 0xae, 0xa2, 0xd4, 0xc7, 0x91, 0xfd,
+ 0x5e, 0xc7, 0x4f, 0xff, 0xfc, 0x97, 0x68, 0x80,
+ 0x77, 0x2f, 0xba, 0x03, 0xee, 0xae, 0xfa, 0x0a,
+ 0x3c, 0x74, 0xf9, 0xfa, 0xef, 0x3a, 0x74, 0x62,
+ 0x29, 0x2f, 0x7c, 0x8d, 0xa6, 0x85, 0x48, 0xc7,
+ 0xe7, 0xfb, 0xb7, 0xad, 0xdc, 0xa7, 0xe8, 0xe9,
+ 0xfe, 0xe2, 0x88, 0x1e, 0x29, 0xea, 0x3a, 0x7f,
+ 0xff, 0xbc, 0x69, 0x9a, 0xde, 0x75, 0xea, 0xa6,
+ 0x77, 0x8a, 0x21, 0xd3, 0xda, 0x01, 0xe1, 0x3a,
+ 0x1f, 0x44, 0x47, 0xb2, 0xcf, 0xcb, 0x3e, 0xeb,
+ 0xd3, 0x47, 0x4f, 0xf5, 0x3d, 0x5d, 0xca, 0x7e,
+ 0x8e, 0x84, 0x3e, 0x7a, 0x98, 0x4f, 0xd9, 0xa1,
+ 0x1c, 0x71, 0xd3, 0xf7, 0x72, 0x9d, 0xc6, 0x3a,
+ 0x7b, 0xb9, 0x50, 0x16, 0x3d, 0x5d, 0x15, 0x47,
+ 0x0a, 0xf1, 0x1a, 0x36, 0x3d, 0x95, 0x09, 0xd5,
+ 0x21, 0x85, 0xa8, 0x45, 0x2e, 0x76, 0x9f, 0xfb,
+ 0xbd, 0xc0, 0x07, 0x29, 0xdc, 0x58, 0xe8, 0x45,
+ 0xd6, 0x4c, 0x9c, 0xa9, 0xf7, 0x79, 0xf7, 0x51,
+ 0x5f, 0xc1, 0xd3, 0xfb, 0x16, 0xa6, 0x69, 0x38,
+ 0x3a, 0x7f, 0xff, 0xfa, 0x99, 0xaa, 0xfa, 0xc0,
+ 0x77, 0x1f, 0x76, 0x5e, 0xf7, 0x73, 0x8a, 0x6d,
+ 0x63, 0xa6, 0xbe, 0xe9, 0xd0, 0x28, 0x9d, 0xd4,
+ 0x21, 0x27, 0xec, 0x7b, 0xb8, 0xfd, 0x4e, 0x9f,
+ 0xfc, 0x2f, 0xba, 0xb8, 0xa7, 0xd2, 0x94, 0x43,
+ 0xa5, 0x53, 0xa2, 0xf3, 0xda, 0x05, 0x2a, 0x7f,
+ 0x22, 0xbb, 0x94, 0xfd, 0x1d, 0x3f, 0xff, 0xed,
+ 0x75, 0x39, 0x7d, 0xd5, 0xbd, 0x35, 0xdc, 0xe3,
+ 0x78, 0x2b, 0x1d, 0x1b, 0x54, 0xd6, 0xb1, 0x3f,
+ 0xc3, 0x43, 0xa4, 0xf5, 0x84, 0x45, 0xe4, 0x80,
+ 0x98, 0xcf, 0x9d, 0xb1, 0xc7, 0xce, 0x9f, 0x65,
+ 0x5e, 0xc0, 0x9d, 0x0f, 0x9e, 0x75, 0x09, 0xe7,
+ 0xff, 0xdb, 0x7b, 0x1b, 0x8a, 0x6f, 0x2e, 0x81,
+ 0x76, 0xf4, 0x3a, 0x7a, 0xe3, 0x59, 0x43, 0xa7,
+ 0xff, 0xfe, 0xb8, 0x7d, 0xde, 0xf8, 0x1d, 0xbe,
+ 0xe0, 0x0c, 0x7d, 0xd9, 0x7f, 0x79, 0xa9, 0xd0,
+ 0xf2, 0x29, 0x70, 0x92, 0x7f, 0xff, 0xfc, 0x8f,
+ 0xd6, 0xf4, 0x7c, 0x0a, 0x67, 0x00, 0x77, 0x2f,
+ 0xba, 0x05, 0x79, 0xe7, 0x7a, 0x3a, 0x7c, 0x9d,
+ 0x7f, 0xde, 0x3a, 0x7f, 0xff, 0xff, 0xf6, 0x2b,
+ 0x19, 0x28, 0x8a, 0xd6, 0x56, 0xa8, 0x22, 0x9d,
+ 0xc7, 0xb2, 0xfa, 0xde, 0xb7, 0x51, 0x47, 0x4f,
+ 0xf7, 0x39, 0xc7, 0x72, 0x9f, 0xa3, 0xa7, 0xfe,
+ 0x7d, 0x2e, 0xdc, 0x5f, 0x9d, 0x58, 0x15, 0x1d,
+ 0x3f, 0xfd, 0x9a, 0xe3, 0x33, 0x9a, 0x80, 0x35,
+ 0xe2, 0xa7, 0x42, 0x2b, 0x7a, 0xc2, 0x3d, 0xc6,
+ 0x02, 0x24, 0x6a, 0x84, 0x85, 0x0a, 0x3e, 0x14,
+ 0x7d, 0x39, 0xaa, 0x6c, 0xee, 0x00, 0x58, 0xe9,
+ 0xff, 0xe7, 0xdd, 0xd4, 0x01, 0x5d, 0x4b, 0xba,
+ 0xdb, 0xc7, 0x46, 0x1f, 0xa6, 0xc7, 0xe7, 0xe7,
+ 0x96, 0x72, 0xf0, 0x5e, 0x3a, 0x7c, 0xad, 0xf1,
+ 0x9c, 0x1d, 0x25, 0x8e, 0x99, 0x14, 0x74, 0xb4,
+ 0x74, 0x09, 0xa5, 0xf1, 0x58, 0xe0, 0xf5, 0x68,
+ 0x6d, 0x3d, 0xaa, 0xfb, 0xe7, 0x4c, 0xb7, 0x9d,
+ 0x3f, 0xa9, 0xb1, 0x7d, 0xdd, 0x43, 0xa2, 0xe4,
+ 0x26, 0x80, 0x86, 0x98, 0xfd, 0xb2, 0x35, 0x11,
+ 0x5e, 0x2d, 0x3f, 0xab, 0xb7, 0xc3, 0xfd, 0xe4,
+ 0xe9, 0xff, 0xf2, 0x0a, 0x36, 0x29, 0x19, 0xdb,
+ 0xad, 0xea, 0x3a, 0x16, 0x44, 0x3a, 0xf9, 0xac,
+ 0xee, 0xf2, 0x87, 0x4a, 0xcb, 0xc7, 0x55, 0xf0,
+ 0x92, 0x82, 0x1e, 0x5d, 0xe2, 0x36, 0x0c, 0x9d,
+ 0xc9, 0x69, 0x7d, 0x8f, 0xc7, 0x53, 0xb8, 0x4d,
+ 0xad, 0x18, 0x18, 0xc7, 0xd6, 0xa8, 0x75, 0xd2,
+ 0x7a, 0x13, 0xe1, 0xc7, 0xd9, 0xd9, 0x5a, 0xca,
+ 0xa3, 0xd4, 0xe1, 0xd2, 0xe8, 0xc0, 0x17, 0xe3,
+ 0x61, 0x06, 0x1c, 0x97, 0x04, 0xf3, 0xfa, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x8a, 0x76, 0x7c, 0x2d, 0xfe,
+ 0xc6, 0x8a, 0x8e, 0x7f, 0xde, 0xeb, 0x60, 0xb7,
+ 0xfb, 0x1a, 0x26, 0x89, 0x5b, 0x0f, 0xd9, 0x46,
+ 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0xbe,
+ 0x7c, 0x2d, 0xfe, 0xc6, 0x8a, 0xda, 0x7f, 0x9d,
+ 0x6c, 0x16, 0xff, 0x63, 0x44, 0x83, 0x2b, 0x61,
+ 0xf8, 0xf9, 0x84, 0xff, 0xd6, 0xf7, 0x5b, 0x05,
+ 0xbf, 0xd8, 0xd1, 0x21, 0xcf, 0x85, 0xbf, 0xd8,
+ 0xd1, 0x62, 0x4f, 0xfc, 0x99, 0x5c, 0xef, 0x1b,
+ 0xe5, 0x3a, 0x74, 0xee, 0xa3, 0xc7, 0x49, 0xdd,
+ 0x3e, 0x0b, 0xd1, 0x27, 0x2f, 0xef, 0x93, 0xa7,
+ 0xde, 0xe0, 0x68, 0x87, 0x4f, 0xd5, 0xa8, 0xec,
+ 0x37, 0x33, 0xa3, 0x67, 0xb1, 0xe4, 0xf3, 0xfb,
+ 0x94, 0xcd, 0x6f, 0xa1, 0x2a, 0x31, 0x38, 0x57,
+ 0xe1, 0x21, 0xb2, 0x9a, 0x3c, 0x72, 0x43, 0x3f,
+ 0xf5, 0x36, 0x9a, 0xa7, 0xdd, 0xce, 0xf2, 0x74,
+ 0xff, 0xfe, 0xd6, 0xbd, 0xd5, 0xce, 0xa2, 0xbf,
+ 0x35, 0xa4, 0x51, 0xd3, 0xff, 0xd8, 0xfb, 0xb5,
+ 0x7b, 0xd6, 0xa7, 0xab, 0x75, 0x3a, 0x6a, 0x5b,
+ 0x11, 0xef, 0xb4, 0x6e, 0xaf, 0x45, 0x93, 0x83,
+ 0x48, 0xd2, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d,
+ 0x16, 0x6c, 0xff, 0xeb, 0x2b, 0xdd, 0x6c, 0x16,
+ 0xff, 0x63, 0x45, 0x01, 0x30, 0x15, 0x3a, 0x79,
+ 0xbf, 0xd8, 0xd1, 0x6f, 0xcf, 0xc0, 0xeb, 0xdb,
+ 0xc4, 0xe8, 0x13, 0xd6, 0xe4, 0xae, 0x7d, 0xa7,
+ 0x54, 0x1a, 0x9d, 0x3f, 0x91, 0x70, 0x3a, 0xea,
+ 0x72, 0x74, 0xee, 0xe3, 0x8e, 0x95, 0x9c, 0x98,
+ 0x4e, 0x36, 0x89, 0x15, 0x0a, 0x74, 0x6d, 0x3f,
+ 0xef, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0xa4,
+ 0xff, 0x3a, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0x3a,
+ 0x56, 0x52, 0x21, 0xfd, 0x1a, 0x11, 0xdb, 0x13,
+ 0x3d, 0x19, 0x07, 0x16, 0xae, 0xe7, 0x23, 0x92,
+ 0x68, 0x58, 0xec, 0x9e, 0xe7, 0x0a, 0xc5, 0x89,
+ 0x95, 0x2d, 0x52, 0x85, 0x3c, 0x9d, 0xd6, 0x35,
+ 0xb5, 0xd0, 0xd6, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2,
+ 0x1f, 0x9f, 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
+ 0x89, 0x4e, 0x56, 0xc3, 0xf6, 0x51, 0x84, 0xfe,
+ 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x27, 0x9f, 0xd6,
+ 0xc1, 0x6f, 0xf6, 0x34, 0x46, 0x33, 0xff, 0xac,
+ 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0xcc,
+ 0x22, 0x3b, 0xde, 0x27, 0x71, 0xdd, 0x0e, 0xe7,
+ 0xc2, 0xdf, 0xec, 0x68, 0x88, 0x27, 0xfd, 0xee,
+ 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x54, 0x95, 0xb0,
+ 0xfd, 0x94, 0x61, 0x3f, 0xad, 0x82, 0xdf, 0xec,
+ 0x68, 0x8a, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d,
+ 0x11, 0x94, 0xff, 0xeb, 0x2b, 0xdd, 0x6c, 0x16,
+ 0xff, 0x63, 0x44, 0xcb, 0x3f, 0xad, 0x82, 0xdf,
+ 0xec, 0x68, 0xa9, 0x27, 0xf5, 0xb0, 0x5b, 0xfd,
+ 0x8d, 0x15, 0xd4, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0xc5, 0x9f, 0xf9, 0x5e, 0xeb, 0x60, 0xb7,
+ 0xfb, 0x1a, 0x27, 0xa9, 0xfe, 0x0d, 0xbd, 0x36,
+ 0xbf, 0xbb, 0x83, 0xa2, 0xc8, 0x8a, 0x44, 0xc9,
+ 0xfa, 0xe4, 0xf9, 0xad, 0xdf, 0x53, 0xa7, 0x85,
+ 0x5a, 0x7c, 0xe9, 0xcd, 0x94, 0x2a, 0x7f, 0xfe,
+ 0xa7, 0x7e, 0xee, 0xc5, 0x1c, 0xec, 0xaf, 0x3c,
+ 0xa1, 0xd3, 0xff, 0xf0, 0xee, 0xe3, 0xd5, 0x64,
+ 0x11, 0xdd, 0xc3, 0x5e, 0xf1, 0xd3, 0xe6, 0xdd,
+ 0x01, 0x51, 0xd3, 0xff, 0xbe, 0xbd, 0xce, 0x6d,
+ 0x4d, 0xb7, 0x89, 0xd3, 0xed, 0x51, 0x14, 0xc7,
+ 0x4f, 0xfe, 0xe8, 0x08, 0x9d, 0x45, 0x00, 0x05,
+ 0x17, 0xce, 0x9f, 0xeb, 0xfe, 0xbf, 0x4b, 0xfa,
+ 0xf1, 0xd1, 0xb4, 0xf7, 0x45, 0x75, 0x4c, 0x14,
+ 0x28, 0xea, 0x46, 0x89, 0xae, 0x13, 0xe7, 0x77,
+ 0xf4, 0x6a, 0x85, 0xa7, 0x77, 0x75, 0x3a, 0x41,
+ 0xb9, 0x4f, 0x11, 0x0a, 0x27, 0x85, 0x77, 0xa8,
+ 0xe8, 0xc3, 0xce, 0xd9, 0x64, 0xff, 0xb7, 0x4f,
+ 0xd2, 0x2d, 0x5d, 0xa8, 0xe9, 0xfb, 0x7d, 0xbb,
+ 0xbc, 0xa9, 0xd3, 0xdd, 0xe0, 0x0b, 0xa7, 0x4f,
+ 0xd9, 0x50, 0xff, 0x5e, 0x3a, 0x3c, 0xf4, 0xfa,
+ 0x4d, 0x3e, 0xbe, 0xed, 0x78, 0x43, 0xa3, 0x11,
+ 0x9d, 0xb8, 0x41, 0x50, 0x86, 0x7f, 0xff, 0xf5,
+ 0x13, 0x62, 0x28, 0x0e, 0xb7, 0xdb, 0xdd, 0x95,
+ 0xe2, 0xff, 0x17, 0x1d, 0x3e, 0x7b, 0x81, 0xd8,
+ 0x4e, 0x9f, 0xb8, 0xf1, 0xe5, 0x7f, 0x0e, 0x9f,
+ 0xf7, 0x76, 0xed, 0x53, 0x07, 0x75, 0x3a, 0x7f,
+ 0xdf, 0x9c, 0xa7, 0x7f, 0x8c, 0xba, 0x74, 0x38,
+ 0xff, 0x79, 0x3e, 0x9e, 0xbe, 0xb4, 0x51, 0xd3,
+ 0xf5, 0xf5, 0xd5, 0x73, 0x47, 0x4e, 0x08, 0x42,
+ 0x54, 0xff, 0xed, 0x6f, 0x55, 0xa6, 0xd7, 0xc1,
+ 0x14, 0x71, 0x56, 0x2f, 0x23, 0x68, 0xa7, 0xbd,
+ 0x2a, 0x1c, 0xa9, 0x83, 0x1e, 0x76, 0x52, 0x30,
+ 0xad, 0xe9, 0x1e, 0xa1, 0x95, 0x35, 0xdc, 0x3a,
+ 0x7c, 0x1d, 0x23, 0xe1, 0x3a, 0x7f, 0x27, 0x8d,
+ 0x03, 0xfc, 0x15, 0x30, 0x42, 0x54, 0x70, 0x78,
+ 0xe1, 0x31, 0x9e, 0xae, 0xb7, 0x73, 0x2a, 0xc6,
+ 0x8e, 0x7f, 0xf5, 0xf5, 0xaf, 0x1d, 0x4e, 0x28,
+ 0x9a, 0xa9, 0xd3, 0xfe, 0xd6, 0xc7, 0xf9, 0xb8,
+ 0xd6, 0x50, 0xe8, 0x72, 0x23, 0xb6, 0x9b, 0x3e,
+ 0xc7, 0xb3, 0x62, 0x74, 0xfd, 0xa4, 0x1e, 0x33,
+ 0xa7, 0x4f, 0xee, 0x28, 0x9d, 0x0f, 0xbe, 0x74,
+ 0xff, 0xff, 0xb6, 0xaf, 0xeb, 0xee, 0xb0, 0x73,
+ 0x6b, 0xb3, 0xb9, 0xc7, 0xb8, 0xf1, 0x7a, 0xc2,
+ 0x23, 0x73, 0xcb, 0x2f, 0x34, 0x9f, 0xfe, 0xcd,
+ 0x57, 0x16, 0xa2, 0x2e, 0xca, 0x51, 0x0e, 0x9f,
+ 0xff, 0xff, 0x6f, 0x1f, 0xae, 0xf0, 0x20, 0x63,
+ 0xee, 0xae, 0xf5, 0x5d, 0xbf, 0xc7, 0x17, 0xbc,
+ 0x74, 0x75, 0x1b, 0xba, 0x50, 0x9b, 0x61, 0x3a,
+ 0x60, 0x79, 0x3a, 0x16, 0x35, 0xdc, 0x8b, 0x4e,
+ 0x77, 0xf0, 0x74, 0xc1, 0x09, 0xd1, 0xb3, 0xd5,
+ 0xa9, 0x18, 0x47, 0x27, 0x68, 0x1e, 0x4a, 0xb1,
+ 0xaf, 0x9f, 0xff, 0xfd, 0xa4, 0xe2, 0x97, 0xfd,
+ 0xd5, 0x7f, 0x19, 0x9d, 0xbb, 0x5a, 0xe7, 0x79,
+ 0x3a, 0x1f, 0x45, 0x66, 0xcb, 0xa7, 0xfb, 0x35,
+ 0x44, 0x1d, 0x63, 0x1d, 0x39, 0x05, 0x63, 0xa3,
+ 0x13, 0xf5, 0xf8, 0xe0, 0x7a, 0x48, 0xbe, 0x6b,
+ 0x3e, 0xee, 0x6b, 0xee, 0x0e, 0x9f, 0xfb, 0x04,
+ 0x71, 0x6a, 0x65, 0x7f, 0xa7, 0x4f, 0xee, 0xa0,
+ 0xde, 0xd4, 0x43, 0xa7, 0xdb, 0xbb, 0x4f, 0x71,
+ 0xd3, 0xf6, 0xd1, 0x4f, 0x60, 0x4e, 0x98, 0x21,
+ 0x3a, 0x18, 0xfb, 0x04, 0xa4, 0x25, 0xb3, 0xfd,
+ 0x8b, 0x7a, 0xde, 0xfb, 0xaa, 0x55, 0x8d, 0x6c,
+ 0xff, 0xec, 0xef, 0x39, 0x4d, 0xbf, 0x5a, 0x5f,
+ 0x53, 0xa7, 0xee, 0xff, 0x3c, 0x67, 0x4e, 0x9c,
+ 0x10, 0x84, 0xa9, 0xff, 0x90, 0x7b, 0x7f, 0x83,
+ 0x8b, 0x22, 0x8e, 0xb1, 0x79, 0x17, 0x34, 0xff,
+ 0x96, 0x86, 0x55, 0x52, 0xb4, 0x9a, 0x14, 0xa9,
+ 0xde, 0x2f, 0x1e, 0x41, 0x29, 0xe7, 0x63, 0xee,
+ 0x3c, 0x82, 0x53, 0xab, 0xbe, 0x0f, 0x20, 0x94,
+ 0xc1, 0x09, 0xe4, 0x12, 0x86, 0x45, 0x22, 0xc5,
+ 0x1a, 0x2f, 0x09, 0x54, 0xfd, 0xfd, 0xe7, 0xbf,
+ 0xa2, 0xc8, 0x25, 0x63, 0x7b, 0x3c, 0xbf, 0x9f,
+ 0x43, 0xa5, 0x97, 0x33, 0xed, 0xe5, 0x2a, 0x7f,
+ 0x2c, 0xeb, 0xde, 0xd6, 0xde, 0x2a, 0x7f, 0x6d,
+ 0xd7, 0xfd, 0x69, 0xb3, 0xa4, 0xe2, 0xa7, 0x78,
+ 0xbc, 0x54, 0x15, 0x08, 0x6d, 0x58, 0x41, 0x43,
+ 0x73, 0xdd, 0x4e, 0x58, 0xab, 0x1a, 0xc8, 0x44,
+ 0x63, 0x64, 0x25, 0x67, 0xaf, 0xf1, 0x71, 0xd2,
+ 0x51, 0xd3, 0x63, 0xb8, 0x36, 0x2b, 0x10, 0xcf,
+ 0x83, 0x8b, 0x6d, 0x47, 0x4f, 0xcc, 0x8b, 0x39,
+ 0x39, 0x2a, 0x5b, 0x3a, 0x7f, 0x9e, 0xbd, 0xdc,
+ 0x52, 0xff, 0xe9, 0xd3, 0xf6, 0xd1, 0x4f, 0x60,
+ 0x4e, 0x9f, 0x63, 0xca, 0xc5, 0x1d, 0x3a, 0xbb,
+ 0x13, 0xa3, 0xa7, 0x85, 0xa2, 0x79, 0xfb, 0xbf,
+ 0xcf, 0x37, 0xd4, 0xe9, 0xfb, 0x77, 0x41, 0x45,
+ 0x5b, 0x84, 0xc3, 0xb0, 0x40, 0x4f, 0x6a, 0xdf,
+ 0xa2, 0x28, 0xc4, 0xf4, 0xf6, 0x51, 0xd8, 0xce,
+ 0xe7, 0xbb, 0x8f, 0x5e, 0x74, 0x39, 0x5e, 0xde,
+ 0x16, 0x52, 0x1f, 0xdd, 0x57, 0xac, 0xa0, 0x1d,
+ 0x1b, 0x4e, 0x08, 0x42, 0x54, 0xe1, 0x72, 0x15,
+ 0x62, 0xf2, 0x7e, 0x79, 0x67, 0x2f, 0x05, 0xe3,
+ 0xa7, 0xa9, 0xef, 0x84, 0xe9, 0xf3, 0xc3, 0xb4,
+ 0x51, 0xd3, 0xff, 0xc8, 0x0e, 0xba, 0x9c, 0xfe,
+ 0xb9, 0x07, 0xae, 0x3a, 0x2e, 0x42, 0x34, 0x36,
+ 0x69, 0xe4, 0x5a, 0x27, 0x9c, 0xed, 0xf4, 0xe9,
+ 0xfb, 0x48, 0xb7, 0x6f, 0xa9, 0xd0, 0xe3, 0xcb,
+ 0xd0, 0xe4, 0xeb, 0xef, 0x5e, 0x8e, 0x9b, 0xec,
+ 0xbd, 0x9b, 0x77, 0x4b, 0x92, 0x36, 0xb9, 0x30,
+ 0x89, 0x23, 0xf7, 0x7a, 0x1f, 0x2e, 0x21, 0xe2,
+ 0x30, 0xdc, 0x95, 0x29, 0x75, 0x85, 0x85, 0xf7,
+ 0x09, 0x25, 0xa1, 0x88, 0x24, 0x6a, 0x8c, 0x0a,
+ 0x92, 0xc0, 0x7d, 0x17, 0xa5, 0x35, 0x94, 0x7f,
+ 0xa9, 0xd7, 0xeb, 0xe1, 0x00, 0xbf, 0x0f, 0x90,
+ 0x61, 0x1b, 0x70, 0x45, 0x3f, 0xfa, 0xca, 0xf7,
+ 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x45, 0x4f, 0xeb,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x2e, 0x89, 0xff, 0xad,
+ 0xee, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x4b, 0x9f,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5e, 0x50, 0x8d,
+ 0xe4, 0x1b, 0xc4, 0xee, 0x3b, 0xc3, 0xb6, 0x52,
+ 0x58, 0xed, 0x47, 0x74, 0x86, 0x2f, 0x6b, 0x79,
+ 0x6a, 0xc7, 0x5f, 0xa5, 0x2b, 0xce, 0xd7, 0x26,
+ 0x4f, 0xfe, 0xb2, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
+ 0x34, 0x4b, 0x33, 0xcd, 0xfe, 0xc6, 0x88, 0xce,
+ 0x7e, 0xda, 0x29, 0xec, 0x09, 0xd3, 0x75, 0xc7,
+ 0x49, 0x47, 0x4f, 0xb6, 0x34, 0xfb, 0x09, 0xe9,
+ 0xa8, 0xb4, 0x11, 0x69, 0xfb, 0xdd, 0xb1, 0xf1,
+ 0x3a, 0x75, 0x51, 0xf3, 0xa0, 0x53, 0x0f, 0x53,
+ 0xf7, 0x52, 0xf4, 0x55, 0x3f, 0xf6, 0xb6, 0x3f,
+ 0xc8, 0x0f, 0xb9, 0x14, 0x74, 0xfb, 0xa8, 0xea,
+ 0xf9, 0xd1, 0xb3, 0xec, 0x5c, 0x8d, 0x3f, 0xf6,
+ 0x2b, 0x5b, 0x0d, 0x52, 0x9f, 0x73, 0x3a, 0x7f,
+ 0xd4, 0x4d, 0xd3, 0x69, 0xd5, 0xaf, 0x3a, 0x56,
+ 0xc4, 0xd5, 0x16, 0x85, 0x4f, 0x49, 0x2a, 0x8f,
+ 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x34, 0xcf, 0xfe, 0xb2, 0xbd, 0xd6, 0xc1,
+ 0x6f, 0xf6, 0x34, 0x4e, 0x33, 0xff, 0xac, 0xaf,
+ 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0x0c, 0xf8,
+ 0x5b, 0xfd, 0x8d, 0x17, 0x04, 0xc9, 0xb3, 0xa7,
+ 0xf7, 0x5c, 0x9b, 0xe3, 0x14, 0x74, 0xad, 0x87,
+ 0xf1, 0x43, 0x0b, 0xc5, 0x67, 0xf6, 0xec, 0x0a,
+ 0x73, 0x81, 0x3a, 0x7f, 0x9d, 0x6c, 0x16, 0xff,
+ 0x63, 0x44, 0x93, 0x2b, 0x50, 0xfd, 0x7c, 0xd2,
+ 0x1e, 0x5d, 0x3d, 0x74, 0xab, 0x56, 0x49, 0x59,
+ 0x4b, 0x95, 0x2a, 0xc3, 0x2b, 0x50, 0xaa, 0x9f,
+ 0xf5, 0xdf, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xd4,
+ 0x9f, 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89,
+ 0x56, 0x0e, 0x95, 0xae, 0xa2, 0x61, 0x49, 0x17,
+ 0x08, 0xd3, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x88,
+ 0xa6, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x1a,
+ 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x29, 0xf9,
+ 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d, 0xfe, 0xc6,
+ 0x89, 0xaa, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1,
+ 0x5d, 0xcf, 0x37, 0xfb, 0x1a, 0x2b, 0xe9, 0xc1,
+ 0x08, 0x4a, 0x97, 0x4a, 0xb1, 0x79, 0x02, 0x7c,
+ 0xca, 0x47, 0x9c, 0xe4, 0x7c, 0xe9, 0xff, 0x65,
+ 0x03, 0xfa, 0xaa, 0x63, 0xc7, 0x4f, 0xfb, 0xf6,
+ 0x38, 0xf6, 0xdd, 0x9c, 0x1d, 0x2b, 0x62, 0x2e,
+ 0x16, 0x21, 0xe8, 0xe5, 0x4f, 0x67, 0xff, 0x59,
+ 0x5e, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0xb9,
+ 0xfd, 0x6c, 0x16, 0xff, 0x63, 0x45, 0xc3, 0x3f,
+ 0xf5, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x49,
+ 0xf0, 0x8a, 0xec, 0xde, 0x3b, 0x71, 0xdd, 0xd3,
+ 0xb6, 0x3b, 0x59, 0x48, 0x63, 0x59, 0xa2, 0x1d,
+ 0x54, 0x97, 0x1d, 0xcf, 0xeb, 0x60, 0xb7, 0xfb,
+ 0x1a, 0x22, 0xa9, 0xfd, 0x6c, 0x16, 0xff, 0x63,
+ 0x45, 0x33, 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05,
+ 0xbf, 0xd8, 0xd1, 0x33, 0xcf, 0xfe, 0xb2, 0xbd,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x51, 0xb0, 0xf2,
+ 0x63, 0x5c, 0x1d, 0xdd, 0x3b, 0xd2, 0x94, 0xff,
+ 0xd6, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x1d,
+ 0x4f, 0xdb, 0xce, 0xf1, 0x8f, 0x1d, 0x3e, 0x16,
+ 0xff, 0x63, 0x45, 0x35, 0x3f, 0x6d, 0x14, 0xf6,
+ 0x04, 0xe9, 0xff, 0xec, 0xd5, 0x31, 0xc3, 0xfd,
+ 0xd5, 0x3d, 0xc7, 0x4c, 0x9c, 0x9d, 0x3f, 0xd5,
+ 0xf7, 0xd1, 0xb6, 0xd6, 0x14, 0x48, 0x74, 0xb4,
+ 0x14, 0xd9, 0x5b, 0x84, 0xd2, 0xf0, 0xbb, 0x50,
+ 0xc0, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2, 0xaa, 0x9f,
+ 0xf7, 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0xb6,
+ 0x56, 0xc3, 0xf6, 0x51, 0x84, 0xfe, 0xb6, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0xbf, 0x9f, 0xd6, 0xc1, 0x6f,
+ 0xf6, 0x34, 0x58, 0xd3, 0xe1, 0x6f, 0xf6, 0x34,
+ 0x5a, 0xb3, 0xfe, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x41, 0x4a, 0xd8, 0x7e, 0xca, 0x30, 0x9f,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5c, 0x53, 0xfa,
+ 0xd8, 0x2d, 0xfe, 0xc6, 0x8b, 0xa6, 0x7f, 0xfd,
+ 0xdf, 0xb6, 0x9d, 0x82, 0x3e, 0xe7, 0xb0, 0x27,
+ 0x4f, 0xd7, 0x2f, 0x72, 0x9f, 0xa3, 0xa7, 0x9b,
+ 0xfd, 0x8d, 0x12, 0x64, 0xff, 0x0e, 0x3f, 0xad,
+ 0x7b, 0xaa, 0x74, 0x09, 0xf1, 0xa8, 0xae, 0x7e,
+ 0xe3, 0x9b, 0x96, 0xbc, 0xaf, 0x9d, 0x3e, 0xcd,
+ 0x6d, 0x5e, 0x74, 0xff, 0xfb, 0xd8, 0x52, 0x9d,
+ 0xcd, 0x65, 0x82, 0x10, 0x95, 0x0e, 0x3f, 0x8d,
+ 0x13, 0x4f, 0xfe, 0xbf, 0xbf, 0xa4, 0x1a, 0xd1,
+ 0x3b, 0xa3, 0xa7, 0x04, 0x21, 0x2a, 0x7e, 0x1f,
+ 0x79, 0x5b, 0xa9, 0x56, 0x2f, 0x27, 0xd8, 0xa1,
+ 0xcb, 0x99, 0xd3, 0xfe, 0x52, 0x35, 0x3b, 0x7e,
+ 0x92, 0xa7, 0x4f, 0xf6, 0x7f, 0x20, 0x67, 0x1e,
+ 0xe3, 0xa7, 0xff, 0x7b, 0xd4, 0xda, 0x77, 0x16,
+ 0xd8, 0xec, 0xe8, 0xc4, 0x60, 0xe8, 0xf8, 0x27,
+ 0x33, 0xf5, 0xcf, 0xb9, 0x4f, 0xd1, 0xd3, 0xda,
+ 0x7b, 0x38, 0x3a, 0x7f, 0xb7, 0x74, 0x11, 0xe5,
+ 0x5b, 0xa9, 0xd0, 0xb1, 0xf0, 0x2f, 0x91, 0xce,
+ 0x08, 0x42, 0x74, 0xff, 0xfb, 0x15, 0xae, 0xa7,
+ 0x39, 0xc5, 0x71, 0x48, 0xc5, 0x58, 0xbc, 0x8c,
+ 0x4c, 0xd7, 0x70, 0x90, 0xa2, 0x14, 0xfe, 0x11,
+ 0xf1, 0xea, 0x38, 0xe9, 0x9d, 0x65, 0xe2, 0xe6,
+ 0xde, 0x42, 0x52, 0xe9, 0x0b, 0xf0, 0xb1, 0x58,
+ 0x8b, 0xd9, 0x7a, 0x79, 0x58, 0x75, 0x6a, 0x36,
+ 0x40, 0x4d, 0x67, 0xd8, 0xa1, 0xcb, 0x99, 0xd3,
+ 0xff, 0x65, 0x3a, 0x8f, 0x03, 0x4a, 0x7d, 0xcc,
+ 0xe9, 0xfb, 0xda, 0xc1, 0x08, 0x4e, 0x95, 0x99,
+ 0x7a, 0x0b, 0xe7, 0x4b, 0xbb, 0x0b, 0x6a, 0x94,
+ 0xae, 0x49, 0x87, 0x32, 0xb6, 0xf8, 0x8e, 0x5d,
+ 0xf8, 0x59, 0x09, 0x3a, 0x8e, 0xf9, 0x85, 0x8d,
+ 0x49, 0xf4, 0x77, 0x7c, 0xf5, 0xec, 0xfe, 0xb6,
+ 0x0b, 0x7f, 0xb1, 0xa2, 0x35, 0x9f, 0x0b, 0x7f,
+ 0xb1, 0xa2, 0xa5, 0x9b, 0xd8, 0xd1, 0x0d, 0x4a,
+ 0xd8, 0x7a, 0x3e, 0x61, 0x3f, 0xf5, 0xbd, 0xd6,
+ 0xc1, 0x6f, 0xf6, 0x34, 0x47, 0xd3, 0xfa, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x8b, 0x1e, 0x7e, 0xb9, 0x7b,
+ 0x94, 0xfd, 0x1d, 0x3f, 0xdd, 0xfe, 0x6b, 0xfa,
+ 0xd7, 0x9d, 0x3d, 0xca, 0xb6, 0x27, 0x4f, 0xff,
+ 0xf2, 0x0f, 0x73, 0x8c, 0xa5, 0x36, 0xd4, 0xde,
+ 0xab, 0xef, 0x9d, 0x1b, 0x44, 0x45, 0x08, 0xa7,
+ 0xc2, 0xdf, 0xec, 0x68, 0xb4, 0x27, 0xe5, 0xc0,
+ 0xeb, 0xa9, 0xc9, 0xd3, 0xe4, 0xd6, 0x51, 0x0e,
+ 0x9f, 0xfe, 0xcd, 0x57, 0x16, 0xa2, 0x2e, 0xca,
+ 0x51, 0x0e, 0x87, 0x8f, 0xd7, 0xa4, 0xb0, 0x88,
+ 0xc9, 0xc8, 0x53, 0x4f, 0xf7, 0x73, 0x35, 0x4f,
+ 0xed, 0xd3, 0xa7, 0xf6, 0x51, 0x6d, 0xd3, 0x6a,
+ 0x3a, 0x7f, 0x3b, 0x06, 0xbd, 0x47, 0x8e, 0x9f,
+ 0xec, 0xc0, 0xe3, 0x36, 0x04, 0xe8, 0xc4, 0x4d,
+ 0x3e, 0x69, 0x53, 0x29, 0xec, 0xa7, 0xe8, 0xe9,
+ 0xfd, 0x77, 0x7d, 0xbd, 0xd9, 0x53, 0xa5, 0x65,
+ 0xe2, 0xb8, 0xc4, 0x31, 0xe2, 0x18, 0x18, 0x47,
+ 0x48, 0x7c, 0xd4, 0x9b, 0x50, 0xd3, 0x5f, 0x30,
+ 0x04, 0x82, 0x7e, 0xb8, 0xdf, 0x1d, 0x45, 0x8e,
+ 0x9e, 0xca, 0x7e, 0x8e, 0x95, 0xcb, 0x87, 0xa5,
+ 0xd3, 0x29, 0xf0, 0xb7, 0xfb, 0x1a, 0x2d, 0x69,
+ 0xff, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0xa0,
+ 0xe5, 0x65, 0xe2, 0x28, 0xb0, 0xb1, 0x46, 0x13,
+ 0xff, 0xac, 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d,
+ 0x14, 0x5c, 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2,
+ 0xea, 0x87, 0x2f, 0x8d, 0xb4, 0x23, 0x36, 0x4c,
+ 0xa4, 0xca, 0x4b, 0xc7, 0xe6, 0x39, 0x0a, 0x9c,
+ 0xe9, 0x4a, 0x7c, 0x2d, 0xfe, 0xc6, 0x88, 0x86,
+ 0x75, 0x33, 0x83, 0xa5, 0x6c, 0x3c, 0xc7, 0xcc,
+ 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x11, 0xb4,
+ 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0x9b, 0x9f,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x54, 0x13, 0xfa,
+ 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0x9a, 0x7c, 0x2d,
+ 0xfe, 0xc6, 0x8a, 0xc2, 0x7d, 0xb0, 0xf1, 0x78,
+ 0x9d, 0x3f, 0xce, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2,
+ 0x3f, 0x9d, 0x88, 0xf1, 0xd2, 0xb6, 0x22, 0xd5,
+ 0x8c, 0x3c, 0xa7, 0xa8, 0x33, 0xff, 0xac, 0xaf,
+ 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13, 0x7c, 0xff,
+ 0xca, 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x3f,
+ 0x4f, 0xcb, 0xde, 0xe4, 0x5c, 0xab, 0xf8, 0xf9,
+ 0xd3, 0xff, 0xc8, 0x88, 0x88, 0x88, 0x88, 0x8f,
+ 0xd4, 0xe9, 0xf0, 0xed, 0xef, 0x51, 0x53, 0x04,
+ 0x25, 0x46, 0x1b, 0xd0, 0x93, 0xca, 0xf2, 0xac,
+ 0x68, 0x21, 0x11, 0x8f, 0x58, 0x53, 0x4f, 0xc3,
+ 0xed, 0x4d, 0x89, 0xd3, 0xcf, 0x2b, 0x6e, 0x3a,
+ 0x7f, 0x51, 0x15, 0x6e, 0x79, 0x43, 0xa4, 0x28,
+ 0x7a, 0xfb, 0x23, 0x9d, 0xcd, 0x70, 0xe9, 0xea,
+ 0xeb, 0x6b, 0x1d, 0x08, 0x98, 0x6e, 0xc9, 0xc6,
+ 0x10, 0x3d, 0x26, 0xd0, 0xe4, 0xf7, 0xac, 0x0a,
+ 0x8e, 0x9b, 0xfa, 0x74, 0x09, 0xb8, 0x51, 0x1c,
+ 0xe0, 0x84, 0x27, 0x4f, 0x3d, 0xdd, 0xa1, 0x56,
+ 0x2f, 0x27, 0x9f, 0xd6, 0xd8, 0xe8, 0x44, 0x47,
+ 0xd0, 0xf2, 0xf3, 0x19, 0xff, 0x9e, 0xbf, 0x9c,
+ 0xed, 0xeb, 0x26, 0xbc, 0xe9, 0xe4, 0xd5, 0x58,
+ 0xd1, 0x07, 0x40, 0x9f, 0xae, 0x92, 0x26, 0x1e,
+ 0x0e, 0x98, 0x21, 0x3a, 0x1c, 0x6b, 0x02, 0x2d,
+ 0x3d, 0x54, 0xda, 0xe2, 0xac, 0x68, 0x67, 0xd5,
+ 0x07, 0x8e, 0x6a, 0x74, 0x6c, 0xf7, 0x81, 0x33,
+ 0x9c, 0x10, 0x84, 0xa8, 0x2a, 0xc5, 0xe4, 0xf6,
+ 0xc3, 0xb5, 0x8a, 0x86, 0x37, 0x9b, 0x19, 0x8d,
+ 0xa6, 0xcf, 0x48, 0x66, 0x75, 0xee, 0x7b, 0x8f,
+ 0xef, 0x27, 0x4f, 0xfc, 0x9d, 0xe7, 0xa8, 0xfa,
+ 0xc9, 0xde, 0x4e, 0x8e, 0x4f, 0xaa, 0xa4, 0x73,
+ 0xf2, 0xc9, 0x83, 0x4d, 0x9d, 0x3f, 0x6b, 0x16,
+ 0xea, 0x28, 0xf1, 0x01, 0x4f, 0xbf, 0xbc, 0x51,
+ 0x0d, 0x10, 0x15, 0x8d, 0xd4, 0xf9, 0x39, 0xdb,
+ 0xf5, 0x3a, 0x7f, 0x0a, 0xd5, 0xdf, 0x75, 0xb3,
+ 0xa7, 0x9f, 0xe4, 0x50, 0xa9, 0x82, 0x12, 0xa1,
+ 0x0d, 0xc0, 0x48, 0xa7, 0xef, 0x17, 0x3b, 0xbb,
+ 0x2a, 0xc6, 0x82, 0x11, 0x3b, 0xec, 0x23, 0xdb,
+ 0x37, 0x51, 0x34, 0x53, 0x7c, 0x23, 0x27, 0xd7,
+ 0xea, 0xff, 0x04, 0xd1, 0x03, 0xcf, 0xfa, 0x97,
+ 0xbc, 0x80, 0x26, 0x93, 0x83, 0xa7, 0x78, 0xbc,
+ 0x74, 0xc1, 0x09, 0xd3, 0xf8, 0x77, 0x8b, 0x81,
+ 0x75, 0x98, 0xd8, 0x84, 0x6e, 0x49, 0xc2, 0x2f,
+ 0x45, 0xca, 0x7f, 0xf6, 0x29, 0x5e, 0xec, 0x16,
+ 0xff, 0x63, 0x44, 0x31, 0x14, 0x3f, 0x9e, 0x94,
+ 0x4f, 0xd8, 0x2d, 0xfe, 0xc6, 0x88, 0x2a, 0x7b,
+ 0x55, 0x4e, 0x4a, 0x9d, 0xe2, 0xf1, 0x53, 0xd7,
+ 0xf7, 0xee, 0x95, 0x3f, 0xb6, 0xf6, 0x6a, 0xa9,
+ 0xc9, 0x50, 0x54, 0xfd, 0x8c, 0x94, 0x45, 0x15,
+ 0x30, 0x42, 0x54, 0xfd, 0xd4, 0xeb, 0xdb, 0x12,
+ 0xa3, 0x13, 0x0c, 0x62, 0x25, 0x0d, 0xd0, 0x93,
+ 0x93, 0x4e, 0x85, 0x04, 0xa8, 0x11, 0x69, 0xb6,
+ 0x25, 0x58, 0xfc, 0xa5, 0xee, 0x4f, 0x66, 0x91,
+ 0xd9, 0xcf, 0xf9, 0x1d, 0xfd, 0xca, 0x8a, 0x54,
+ 0xe9, 0xff, 0x26, 0xa8, 0x8b, 0xb8, 0x4e, 0x50,
+ 0xe9, 0xff, 0xf9, 0x6f, 0xf7, 0x7d, 0x00, 0xc7,
+ 0xaf, 0xd5, 0xfe, 0x09, 0xa2, 0xfb, 0x9f, 0x6f,
+ 0x5d, 0xc7, 0x1d, 0x3f, 0xee, 0xed, 0xda, 0xa6,
+ 0x0e, 0xea, 0x74, 0xfe, 0xd7, 0x20, 0xf5, 0xd4,
+ 0xc3, 0xc4, 0x03, 0x3b, 0xc5, 0xc7, 0x88, 0x06,
+ 0x30, 0xfa, 0x6f, 0x42, 0x9b, 0xdc, 0x78, 0x80,
+ 0x67, 0xbf, 0xaf, 0xb8, 0xf1, 0x00, 0xcf, 0xed,
+ 0xb5, 0x33, 0x9e, 0x50, 0xf1, 0x00, 0xce, 0xdf,
+ 0x78, 0x3c, 0x40, 0x31, 0xc2, 0x2e, 0xd4, 0x45,
+ 0x42, 0xf5, 0xc8, 0x13, 0x85, 0x34, 0x78, 0x80,
+ 0x60, 0xf1, 0x00, 0xcc, 0x8a, 0x3c, 0x40, 0x31,
+ 0xc1, 0xb9, 0xd8, 0xbc, 0xf6, 0xd5, 0xc2, 0x1e,
+ 0x20, 0x19, 0xda, 0xf6, 0x3c, 0x40, 0x33, 0xfe,
+ 0xef, 0xba, 0xd4, 0xdb, 0x78, 0x9e, 0x20, 0x19,
+ 0xbf, 0x83, 0xc4, 0x03, 0x3f, 0xbb, 0xe1, 0xad,
+ 0x53, 0x93, 0xc4, 0x03, 0x3e, 0xdd, 0xdf, 0xef,
+ 0x27, 0x88, 0x06, 0x6d, 0xd4, 0xf1, 0x00, 0xc0,
+ 0x9e, 0xd6, 0x8d, 0xe7, 0xda, 0xea, 0x3e, 0xe3,
+ 0x44, 0x03, 0x37, 0x28, 0x78, 0x80, 0x6c, 0x6d,
+ 0x67, 0xdb, 0x45, 0x7f, 0x07, 0x88, 0x06, 0x7a,
+ 0xff, 0xeb, 0x1e, 0x20, 0x19, 0xc8, 0x2c, 0x78,
+ 0x80, 0x67, 0xfd, 0x8f, 0xd7, 0x84, 0xce, 0xf3,
+ 0x53, 0xc4, 0x03, 0x3e, 0xbf, 0xdc, 0xe4, 0x3c,
+ 0x40, 0x31, 0x88, 0x81, 0xa2, 0x6c, 0xc3, 0xc9,
+ 0xe2, 0x01, 0x87, 0x2a, 0x94, 0xe0, 0x8f, 0x21,
+ 0x35, 0xb5, 0x6a, 0x19, 0xf2, 0x69, 0x52, 0xed,
+ 0x42, 0x9e, 0xf2, 0x29, 0xf6, 0x6a, 0xbe, 0xf9,
+ 0xe2, 0x01, 0x9f, 0xdc, 0x23, 0x2c, 0x29, 0xa3,
+ 0xc4, 0x03, 0xc1, 0xb4, 0x9c, 0x28, 0x13, 0xc4,
+ 0x03, 0x0c, 0x7e, 0xe2, 0xa1, 0x3d, 0xbe, 0xba,
+ 0xa7, 0x88, 0x06, 0x7e, 0xf5, 0x9d, 0x8f, 0xb8,
+ 0xf1, 0x00, 0xc6, 0x22, 0x2b, 0x92, 0x0b, 0xcb,
+ 0xe7, 0xff, 0x7b, 0xdc, 0x51, 0x2b, 0x6a, 0xde,
+ 0x3c, 0x9e, 0x20, 0x19, 0x87, 0x93, 0xc4, 0x03,
+ 0x3e, 0xfd, 0x57, 0x6f, 0x9e, 0x20, 0x19, 0xfb,
+ 0x7d, 0xbd, 0xd9, 0x53, 0xc4, 0x03, 0x08, 0x89,
+ 0x3e, 0x91, 0xe8, 0xd6, 0x38, 0x5f, 0xe0, 0xc8,
+ 0x6e, 0xac, 0x80, 0x2c, 0x14, 0x22, 0xf2, 0xfe,
+ 0x49, 0xeb, 0x2b, 0x77, 0x51, 0xe0, 0xaf, 0x98,
+ 0x83, 0x0e, 0xd9, 0xdf, 0xec, 0x68, 0x80, 0x6c,
+ 0x8b, 0x69, 0xeb, 0xb7, 0x25, 0xc2, 0x8e, 0x9b,
+ 0x94, 0x2a, 0x57, 0x4a, 0x9d, 0x44, 0x78, 0xe9,
+ 0x82, 0x12, 0xa3, 0x67, 0xb5, 0x73, 0x16, 0x58,
+ 0x48, 0x23, 0x93, 0x95, 0xba, 0x95, 0x63, 0xc1,
+ 0x9e, 0xd5, 0x6e, 0x2f, 0x3a, 0x1e, 0x65, 0x5b,
+ 0x38, 0x9d, 0xa9, 0x27, 0xbb, 0x38, 0xe6, 0x18,
+ 0xe0, 0x96, 0xcf, 0xc2, 0xb3, 0x90, 0x5e, 0x3a,
+ 0x7f, 0xce, 0xa8, 0x1d, 0xc5, 0x20, 0xdd, 0x3a,
+ 0x7e, 0x04, 0x23, 0xbc, 0xa1, 0x53, 0xcb, 0x53,
+ 0xd6, 0x3a, 0x7d, 0x8b, 0x39, 0x1f, 0x3a, 0x7b,
+ 0x3a, 0x8e, 0x2a, 0x04, 0xfa, 0xfa, 0x47, 0x70,
+ 0x51, 0x08, 0x99, 0xb6, 0x16, 0xd1, 0x03, 0xe1,
+ 0x31, 0x3d, 0xbe, 0xea, 0xa7, 0x4e, 0xbd, 0x7a,
+ 0xa9, 0xd3, 0xff, 0x6a, 0xb9, 0xc2, 0x3f, 0x5c,
+ 0x7f, 0x47, 0x42, 0x1f, 0x47, 0x91, 0x4f, 0xbd,
+ 0x77, 0x1c, 0x21, 0xd3, 0x56, 0xa7, 0x4e, 0x08,
+ 0x42, 0x74, 0xdc, 0xf9, 0x56, 0x2f, 0x20, 0x4f,
+ 0x5e, 0xa6, 0x53, 0xbf, 0x9c, 0x2a, 0x1c, 0x8b,
+ 0xd5, 0x42, 0x05, 0x7c, 0x86, 0x7f, 0x6b, 0xb8,
+ 0xff, 0x20, 0xb8, 0xe9, 0xfe, 0xee, 0x2e, 0xcb,
+ 0x04, 0x21, 0x2a, 0x72, 0xbf, 0x47, 0x45, 0x0f,
+ 0x55, 0x71, 0xd4, 0x22, 0x39, 0xf6, 0x71, 0xf0,
+ 0x8b, 0x9a, 0x9e, 0x74, 0xcb, 0x54, 0xe9, 0xfa,
+ 0xd8, 0xbb, 0x7d, 0xe3, 0x0d, 0x60, 0x22, 0xb3,
+ 0xdc, 0x65, 0x3c, 0xe9, 0xff, 0x93, 0x3a, 0xea,
+ 0x67, 0x7a, 0x81, 0x3a, 0x5b, 0x14, 0x55, 0x75,
+ 0x1f, 0x44, 0x30, 0xf3, 0x69, 0x42, 0xe8, 0xdb,
+ 0x78, 0x8f, 0xee, 0xe9, 0x7b, 0x1d, 0xed, 0x00,
+ 0x69, 0x64, 0x54, 0x8e, 0x87, 0x94, 0x0e, 0xc2,
+ 0x2b, 0x51, 0xe2, 0x2e, 0x8c, 0x26, 0x7e, 0xef,
+ 0x39, 0xc7, 0xb8, 0xe9, 0xf0, 0x2b, 0x39, 0x2e,
+ 0x65, 0x46, 0x1e, 0xd8, 0x25, 0xd3, 0xff, 0x86,
+ 0xef, 0x6f, 0xf0, 0x72, 0xbb, 0x4e, 0x9d, 0x20,
+ 0x4d, 0x10, 0x2c, 0xb4, 0x6a, 0x05, 0x25, 0xbd,
+ 0x1b, 0xb0, 0x8f, 0x4f, 0xfb, 0x6b, 0xf4, 0xd8,
+ 0x36, 0xe7, 0x94, 0x2a, 0x7f, 0xf6, 0xab, 0xef,
+ 0x80, 0xa4, 0xce, 0xe9, 0x7c, 0xe8, 0x44, 0x49,
+ 0xed, 0x16, 0x73, 0xdd, 0x71, 0xd0, 0x89, 0xc0,
+ 0x2a, 0x10, 0xf4, 0x85, 0xd5, 0xe4, 0x53, 0xf9,
+ 0xcb, 0x67, 0x7e, 0x98, 0x74, 0xff, 0xe1, 0x6e,
+ 0xe2, 0xee, 0xe2, 0x0a, 0x54, 0xe9, 0xfd, 0xeb,
+ 0x53, 0x15, 0x95, 0x3a, 0x30, 0xfe, 0x57, 0x23,
+ 0xcf, 0xff, 0xc8, 0x1a, 0xe9, 0xf6, 0xdd, 0x00,
+ 0xb8, 0xca, 0x6d, 0x47, 0x46, 0xd1, 0x07, 0xa2,
+ 0x39, 0xdc, 0x78, 0x9d, 0x3e, 0xe7, 0xfb, 0x97,
+ 0x07, 0x42, 0x1e, 0x2d, 0xe3, 0x73, 0xc8, 0xa7,
+ 0xd6, 0x3a, 0x11, 0x3d, 0xb7, 0x46, 0x5d, 0x56,
+ 0x8d, 0x11, 0x4f, 0x73, 0xef, 0xd4, 0xe9, 0x82,
+ 0x13, 0xa2, 0xa6, 0xe4, 0x24, 0x73, 0xf5, 0x77,
+ 0x4f, 0xca, 0x15, 0x63, 0x43, 0x38, 0x21, 0x09,
+ 0x53, 0xce, 0xd6, 0x31, 0x56, 0x2f, 0x27, 0xd9,
+ 0xc6, 0xf9, 0xa9, 0xd2, 0xf1, 0x3d, 0x8e, 0x97,
+ 0xcf, 0xdd, 0x7e, 0xab, 0x66, 0x8e, 0x9f, 0x3d,
+ 0x73, 0xde, 0x3e, 0x74, 0xff, 0xb1, 0xb8, 0xc1,
+ 0x0f, 0xd1, 0x63, 0xa6, 0x73, 0xc5, 0x43, 0xe7,
+ 0xa9, 0xd3, 0xd8, 0x14, 0x52, 0x7c, 0x20, 0x61,
+ 0x13, 0x1f, 0xc2, 0x6f, 0x86, 0x9c, 0xff, 0xae,
+ 0xa3, 0xfd, 0x4a, 0x52, 0xf6, 0x3a, 0x7e, 0xef,
+ 0xdd, 0xa7, 0xb8, 0xe9, 0xc1, 0x08, 0x4a, 0x9c,
+ 0x0a, 0x72, 0x55, 0x8b, 0xc9, 0xfe, 0xef, 0xf2,
+ 0x03, 0x93, 0x97, 0xce, 0x8e, 0x11, 0xe6, 0xa4,
+ 0x1e, 0x52, 0xb4, 0x59, 0x38, 0x21, 0x09, 0x62,
+ 0x10, 0x9f, 0x0b, 0x7f, 0xb1, 0x62, 0x10, 0xb1,
+ 0xa9, 0x9c, 0x10, 0x84, 0xb1, 0x07, 0xc1, 0x62,
+ 0x0f, 0xb1, 0xa9, 0x99, 0x15, 0x88, 0x90, 0x66,
+ 0x99, 0xf6, 0x93, 0x48, 0xa3, 0xa7, 0xbb, 0xb4,
+ 0xba, 0x74, 0xe0, 0x53, 0x93, 0xa1, 0xe3, 0xc0,
+ 0x51, 0x1c, 0xf9, 0x92, 0x88, 0xa2, 0xa7, 0xdd,
+ 0xfe, 0xf7, 0x0a, 0x9b, 0x18, 0xa9, 0x82, 0x12,
+ 0xa3, 0x0f, 0xd6, 0xa4, 0xba, 0x26, 0x08, 0xa4,
+ 0xfe, 0xe8, 0x29, 0xcd, 0x32, 0xe0, 0xab, 0x1b,
+ 0xb8, 0x44, 0xe0, 0x36, 0xcd, 0xf0, 0xd3, 0x9f,
+ 0xfd, 0x44, 0xe6, 0xb9, 0x9c, 0x7f, 0x7e, 0xe9,
+ 0xd3, 0xfa, 0xa0, 0xaa, 0xa1, 0xf7, 0xce, 0x84,
+ 0x56, 0xb1, 0xb8, 0x7c, 0x0c, 0x75, 0x9e, 0x69,
+ 0x54, 0xb9, 0xc1, 0x08, 0x4a, 0x9f, 0x3b, 0x9f,
+ 0xef, 0x05, 0x58, 0xbc, 0x9f, 0xfe, 0xeb, 0xe0,
+ 0x3f, 0xca, 0x75, 0xbd, 0xee, 0xf9, 0xd3, 0xff,
+ 0xe7, 0x62, 0x5b, 0x8e, 0xa5, 0xed, 0x97, 0x76,
+ 0x27, 0x4f, 0x6f, 0x8c, 0x51, 0xd0, 0x89, 0x81,
+ 0xb8, 0xe3, 0xd4, 0xef, 0x56, 0x9f, 0xf5, 0x6a,
+ 0x83, 0xa4, 0xb7, 0x1b, 0x3a, 0x7f, 0xdd, 0xf5,
+ 0xa9, 0xe2, 0x3b, 0xe0, 0xe8, 0xd9, 0xfe, 0x28,
+ 0xfa, 0x7e, 0xf1, 0xe3, 0x33, 0xa7, 0x4f, 0xff,
+ 0x66, 0xab, 0x8b, 0x51, 0x17, 0x65, 0x28, 0x87,
+ 0x4f, 0xed, 0x2f, 0x75, 0xba, 0xbd, 0x9e, 0xbc,
+ 0xe8, 0xe1, 0x17, 0xdd, 0x2b, 0xd2, 0x84, 0xff,
+ 0xfe, 0xee, 0xb2, 0x9b, 0x4d, 0x6f, 0x94, 0x75,
+ 0x82, 0x10, 0x95, 0x3d, 0xc6, 0x65, 0xd2, 0xa7,
+ 0x3b, 0xb7, 0x9a, 0x21, 0x99, 0xc1, 0x08, 0x4a,
+ 0x9d, 0x9d, 0x62, 0xac, 0x5e, 0x4f, 0xfb, 0x1e,
+ 0xce, 0x3d, 0xdd, 0x47, 0x8e, 0x8e, 0x4f, 0xa3,
+ 0xa5, 0x30, 0x89, 0xab, 0x3c, 0xc4, 0xf9, 0x18,
+ 0xc2, 0xba, 0x7b, 0x7a, 0xda, 0x1d, 0x3f, 0xaf,
+ 0xc1, 0xe7, 0x9d, 0xf4, 0xe9, 0xff, 0xf2, 0x3b,
+ 0x7c, 0x50, 0x1a, 0xe0, 0xb7, 0xfb, 0x1a, 0x20,
+ 0xc8, 0xa2, 0x25, 0x74, 0x6b, 0x3f, 0x97, 0xf2,
+ 0xab, 0xf8, 0x28, 0x74, 0x39, 0x30, 0xfd, 0xc2,
+ 0xdb, 0x44, 0x73, 0xff, 0xc9, 0xd7, 0x80, 0x5b,
+ 0x7d, 0xce, 0x33, 0xb7, 0x4e, 0x9c, 0x82, 0xb1,
+ 0xd0, 0x8b, 0x8b, 0xf9, 0x0e, 0x0d, 0xc7, 0x0f,
+ 0xf1, 0xa9, 0x5e, 0x6c, 0xbe, 0xab, 0x3f, 0xb5,
+ 0xb5, 0xdb, 0xd3, 0x90, 0xa9, 0x28, 0xe9, 0xfd,
+ 0x5c, 0xed, 0xd1, 0x4b, 0x6c, 0xf1, 0x41, 0x35,
+ 0x9e, 0x1b, 0xdf, 0x71, 0xd3, 0xfb, 0xae, 0xee,
+ 0x29, 0x18, 0xe9, 0xca, 0xe3, 0x0e, 0x84, 0x3f,
+ 0x0c, 0x23, 0xf3, 0x19, 0xff, 0x5f, 0xaa, 0x82,
+ 0x3c, 0xab, 0x75, 0x3a, 0x7f, 0xe4, 0xef, 0xd1,
+ 0x39, 0xb0, 0xd6, 0xa5, 0x47, 0x08, 0x85, 0x52,
+ 0x14, 0xfa, 0x9b, 0xdb, 0xf5, 0x3a, 0x6e, 0x50,
+ 0xe9, 0xf8, 0x7f, 0xa0, 0xa7, 0x27, 0x4d, 0xe2,
+ 0x74, 0xb6, 0x73, 0x16, 0x92, 0x63, 0xa4, 0xa3,
+ 0xa7, 0x62, 0xfd, 0xb6, 0x89, 0x41, 0x16, 0xa2,
+ 0x0f, 0x8f, 0x02, 0x1f, 0x3f, 0xfe, 0xbd, 0x00,
+ 0xf1, 0x1f, 0xe5, 0x2c, 0x10, 0x84, 0xe8, 0x72,
+ 0xb0, 0x0e, 0x21, 0x79, 0xb8, 0x58, 0xac, 0x49,
+ 0xd8, 0x5e, 0xe9, 0x76, 0x7f, 0x27, 0x75, 0xfd,
+ 0xbf, 0x0e, 0x9f, 0xc2, 0xee, 0xed, 0xd4, 0xc3,
+ 0xa7, 0xd9, 0xce, 0x62, 0xc7, 0x4f, 0xd5, 0xc5,
+ 0xdd, 0x47, 0xce, 0x92, 0x62, 0x22, 0x3a, 0x65,
+ 0xa2, 0x79, 0xeb, 0xfc, 0x5c, 0x74, 0xf2, 0x5e,
+ 0xbd, 0x54, 0xa9, 0xf3, 0xac, 0x10, 0x84, 0xe8,
+ 0xe9, 0xe7, 0xde, 0x4f, 0x1c, 0x22, 0x4f, 0x1c,
+ 0x21, 0x49, 0xd2, 0x73, 0x0b, 0xab, 0xe1, 0x8f,
+ 0x3f, 0x0d, 0xfc, 0xe7, 0x58, 0xe9, 0xee, 0x38,
+ 0x45, 0xc7, 0x4f, 0xff, 0x92, 0x88, 0xa6, 0x4d,
+ 0x60, 0xb7, 0xfb, 0x1a, 0x2f, 0x89, 0xfc, 0x1f,
+ 0xd5, 0x53, 0x1e, 0x3a, 0x7f, 0xfe, 0xcd, 0x02,
+ 0xe4, 0x5d, 0xbe, 0xf2, 0x3b, 0x45, 0x61, 0x53,
+ 0x6b, 0x0e, 0x9f, 0x0e, 0xde, 0xf5, 0x1a, 0x61,
+ 0x39, 0xed, 0x5e, 0x9e, 0x69, 0x84, 0xe6, 0xe5,
+ 0x0d, 0x40, 0x9c, 0xfe, 0xef, 0xdd, 0xd2, 0x0f,
+ 0x26, 0xa0, 0x4e, 0x7f, 0x57, 0x29, 0xba, 0xde,
+ 0xf1, 0xa6, 0x13, 0x9b, 0x38, 0x34, 0xc2, 0x73,
+ 0x04, 0x27, 0x98, 0x4e, 0x31, 0x34, 0xe7, 0xcd,
+ 0x36, 0x5c, 0xa2, 0x3a, 0xa0, 0xae, 0x42, 0x09,
+ 0x1c, 0xb4, 0x59, 0x84, 0xec, 0x7c, 0xf2, 0xdb,
+ 0xe9, 0xfc, 0x06, 0x3c, 0xa8, 0xaa, 0xa8, 0x6d,
+ 0x4a, 0x55, 0x8e, 0x15, 0xb2, 0x31, 0x2d, 0x16,
+ 0xf5, 0x2a, 0xe2, 0x7d, 0xc6, 0x0e, 0xee, 0x9d,
+ 0x3e, 0xee, 0x03, 0x8b, 0x1d, 0x3f, 0xb9, 0x07,
+ 0xae, 0x5f, 0xf7, 0x8e, 0x8e, 0x9f, 0x0e, 0x8a,
+ 0x21, 0x17, 0x20, 0xf2, 0x5c, 0x8e, 0xd1, 0xbe,
+ 0x11, 0x53, 0xff, 0x95, 0xaa, 0xef, 0xaf, 0xbb,
+ 0x5b, 0xae, 0xce, 0x9f, 0xff, 0xdd, 0xc7, 0xf2,
+ 0xbf, 0xda, 0x6d, 0x35, 0x4b, 0xfd, 0x47, 0x4e,
+ 0x1a, 0xd4, 0xf1, 0x01, 0xcf, 0xff, 0xdb, 0xd0,
+ 0x22, 0x94, 0x40, 0x30, 0x5b, 0xfd, 0x8d, 0x10,
+ 0x1d, 0x8d, 0x44, 0xff, 0xff, 0xbb, 0xee, 0xce,
+ 0xac, 0xec, 0x7d, 0xc0, 0xa7, 0x36, 0x08, 0x42,
+ 0x54, 0xfe, 0x4c, 0x16, 0xff, 0x63, 0x44, 0x13,
+ 0x3f, 0xc9, 0xac, 0x16, 0xff, 0x63, 0x45, 0xf3,
+ 0x3e, 0xda, 0xee, 0xe5, 0x78, 0x3f, 0xa6, 0x3a,
+ 0x9f, 0xf3, 0xde, 0xfa, 0xfe, 0x6b, 0xbe, 0xb8,
+ 0xe9, 0xc1, 0x08, 0x4a, 0x9f, 0xb5, 0x4c, 0x6f,
+ 0x12, 0xac, 0x5e, 0x43, 0xc8, 0x99, 0xeb, 0x04,
+ 0xff, 0xcf, 0x29, 0x1f, 0xaf, 0x71, 0xe0, 0x5c,
+ 0x74, 0xff, 0xf0, 0x2f, 0xf4, 0x06, 0xa6, 0xf9,
+ 0xe5, 0x05, 0xc7, 0x4e, 0x08, 0x42, 0x54, 0xfe,
+ 0x07, 0x94, 0xee, 0x3f, 0xa2, 0xac, 0x5e, 0x4f,
+ 0xff, 0xcb, 0xd0, 0x0d, 0x4d, 0xf1, 0xc6, 0x04,
+ 0x0d, 0x57, 0x1e, 0x3a, 0x5f, 0x44, 0x54, 0xde,
+ 0x89, 0x0e, 0x55, 0x11, 0xb8, 0x6d, 0x09, 0x22,
+ 0x92, 0x35, 0x18, 0xcc, 0xff, 0xb3, 0x48, 0x35,
+ 0xa2, 0x77, 0x47, 0x88, 0x22, 0x7f, 0x26, 0x0b,
+ 0x7f, 0xb1, 0xa2, 0x08, 0xb1, 0xe4, 0xcf, 0xee,
+ 0xfd, 0x04, 0x76, 0x13, 0xa3, 0x93, 0xfc, 0xea,
+ 0x5c, 0xff, 0x27, 0x74, 0x0e, 0x53, 0xdf, 0x3a,
+ 0x7f, 0xfb, 0xc3, 0xac, 0xa2, 0x6f, 0x5d, 0xca,
+ 0x6c, 0xe8, 0x72, 0x21, 0xfa, 0x73, 0x3f, 0xb4,
+ 0x0a, 0xaa, 0x1f, 0x7c, 0xe9, 0xed, 0xad, 0xb0,
+ 0x9d, 0x3f, 0xfe, 0xbd, 0xee, 0xa6, 0x52, 0xc9,
+ 0xac, 0xa5, 0xe2, 0x74, 0xfb, 0x35, 0x50, 0x6b,
+ 0xc1, 0xfc, 0x82, 0x47, 0x3f, 0x35, 0x36, 0xbf,
+ 0xbb, 0xa7, 0x4f, 0xca, 0x4b, 0x9d, 0x31, 0xe3,
+ 0xa3, 0x83, 0xe3, 0xd9, 0x94, 0xe1, 0x06, 0xa7,
+ 0x4f, 0xfb, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x88,
+ 0x46, 0x10, 0xf8, 0x6f, 0x1c, 0x9f, 0xfc, 0x98,
+ 0xf8, 0x3a, 0xdf, 0x6f, 0x76, 0x54, 0xe9, 0xff,
+ 0xef, 0xf7, 0x81, 0xca, 0x7a, 0xac, 0x10, 0x84,
+ 0xe9, 0x67, 0x08, 0x9c, 0x59, 0x32, 0x70, 0x42,
+ 0x12, 0xa7, 0xfb, 0x39, 0xf1, 0xc5, 0xd9, 0xc1,
+ 0x56, 0x2f, 0x26, 0x08, 0x4a, 0x9c, 0x10, 0x84,
+ 0xa9, 0xfb, 0xde, 0xe2, 0x89, 0x52, 0xac, 0x5e,
+ 0x47, 0x51, 0x6e, 0x14, 0x85, 0xf3, 0x29, 0xf3,
+ 0x6f, 0x80, 0x54, 0x55, 0x8d, 0x9c, 0xe0, 0x84,
+ 0x25, 0x4e, 0xaa, 0x09, 0x56, 0x2f, 0x25, 0xce,
+ 0xcf, 0xfb, 0x4a, 0xb3, 0xf7, 0x1d, 0x47, 0x7b,
+ 0x1d, 0x3f, 0x81, 0x1e, 0x36, 0xb9, 0x38, 0x3a,
+ 0x7f, 0x6a, 0x98, 0xbb, 0x35, 0x53, 0xa0, 0x51,
+ 0x2f, 0x42, 0xce, 0x9b, 0xc2, 0x23, 0xbf, 0x21,
+ 0x81, 0x39, 0xfb, 0x93, 0xaf, 0x73, 0xa7, 0xff,
+ 0x65, 0xcf, 0xfb, 0xce, 0x32, 0x51, 0x14, 0x74,
+ 0xfc, 0xdb, 0xad, 0x36, 0xb1, 0x53, 0xfc, 0x07,
+ 0x71, 0xf7, 0x57, 0x77, 0x4e, 0x9e, 0x4f, 0x52,
+ 0xe2, 0xa7, 0x04, 0x21, 0x2a, 0x7f, 0xf8, 0x14,
+ 0xe7, 0x33, 0xba, 0xa6, 0xd3, 0xaf, 0x15, 0x62,
+ 0xf2, 0x58, 0xc8, 0x9e, 0x51, 0xf4, 0x22, 0x74,
+ 0xce, 0x2b, 0x7d, 0x2f, 0x65, 0xd4, 0x86, 0xdc,
+ 0xff, 0xf9, 0x58, 0xc9, 0xdf, 0xd5, 0x78, 0xbf,
+ 0xc5, 0xc7, 0x4f, 0x93, 0x55, 0x5d, 0x87, 0x42,
+ 0x1f, 0xe6, 0x95, 0x27, 0xff, 0xb6, 0xbb, 0x3b,
+ 0xc7, 0x7c, 0x39, 0xdf, 0xba, 0x74, 0xff, 0xff,
+ 0x71, 0x4d, 0x87, 0x2e, 0x36, 0xaf, 0xd5, 0x6f,
+ 0x76, 0x3f, 0xa3, 0xa3, 0x11, 0x81, 0xea, 0x70,
+ 0x8c, 0xf7, 0x07, 0x93, 0x5d, 0x08, 0x9e, 0x1d,
+ 0x32, 0x5b, 0x96, 0xe3, 0x1b, 0x5a, 0x15, 0x42,
+ 0x46, 0xa8, 0x57, 0x52, 0x14, 0xbc, 0xc2, 0x13,
+ 0xb0, 0xbe, 0xac, 0xa9, 0xdd, 0x47, 0x99, 0x7c,
+ 0x33, 0x03, 0x0e, 0x19, 0xcb, 0x93, 0xa7, 0x4f,
+ 0xff, 0x67, 0x6d, 0xab, 0xbb, 0x7e, 0xb4, 0xce,
+ 0x7c, 0xe9, 0x3e, 0xe3, 0xf0, 0xe0, 0x76, 0x7e,
+ 0xa2, 0xdb, 0xa6, 0xd4, 0x74, 0xff, 0xba, 0x9a,
+ 0xa7, 0xf3, 0xef, 0xd4, 0xe9, 0xff, 0xab, 0xfb,
+ 0x1c, 0x7e, 0xc1, 0x08, 0x4e, 0x9f, 0xfe, 0xea,
+ 0x38, 0x00, 0x75, 0xbe, 0xde, 0xec, 0xa9, 0xd1,
+ 0x89, 0x82, 0xb1, 0x7d, 0x0f, 0xf9, 0x44, 0x9f,
+ 0xc9, 0xd7, 0x77, 0x33, 0x93, 0xa7, 0xf3, 0xb0,
+ 0x6b, 0xd4, 0x78, 0xe9, 0xff, 0xe4, 0x5c, 0x83,
+ 0x60, 0x75, 0xdc, 0x7b, 0x62, 0x7b, 0xbd, 0xe7,
+ 0xff, 0xb3, 0x49, 0xd6, 0xcd, 0x53, 0x63, 0xcb,
+ 0x1d, 0x3e, 0xfa, 0xe7, 0x74, 0x74, 0xed, 0x7d,
+ 0xcc, 0xe9, 0xfd, 0xaa, 0x6e, 0xdc, 0xfe, 0xce,
+ 0x87, 0x93, 0x24, 0xe1, 0x7b, 0xa9, 0xba, 0x26,
+ 0xbc, 0x7e, 0x7f, 0xfe, 0xee, 0x56, 0xf0, 0x32,
+ 0x9f, 0xdc, 0x59, 0xc8, 0xf9, 0xd3, 0xfe, 0xca,
+ 0xdf, 0x82, 0xdf, 0xec, 0x68, 0x81, 0xa7, 0xd9,
+ 0xaa, 0x7b, 0x80, 0x45, 0x27, 0x57, 0x67, 0xff,
+ 0xff, 0xec, 0xd5, 0x3f, 0xb7, 0x40, 0xa8, 0xff,
+ 0xe9, 0x76, 0x70, 0x06, 0x2b, 0xfa, 0xfb, 0x8f,
+ 0x10, 0x5c, 0xff, 0xbf, 0xee, 0xb7, 0xf0, 0x05,
+ 0xd0, 0x9e, 0x20, 0xb9, 0xff, 0xa9, 0xba, 0x6d,
+ 0x3b, 0xa0, 0x2e, 0x84, 0xf1, 0x05, 0xcf, 0xe4,
+ 0xdf, 0x74, 0x05, 0xd0, 0x9e, 0x20, 0xb9, 0xf9,
+ 0x59, 0xc0, 0x17, 0x42, 0x78, 0x82, 0xe7, 0xff,
+ 0xfb, 0xfb, 0xdd, 0xa8, 0x0a, 0xb5, 0x36, 0x3b,
+ 0xba, 0xf6, 0x04, 0xf1, 0x05, 0xcc, 0xf8, 0x1c,
+ 0x27, 0x38, 0xc9, 0xe2, 0xab, 0xe8, 0x7d, 0x3e,
+ 0x8a, 0x2a, 0x8e, 0xec, 0xa3, 0x79, 0xef, 0x1e,
+ 0x7c, 0xe9, 0xff, 0xa9, 0xba, 0x6d, 0x3b, 0xa0,
+ 0x2e, 0x84, 0xf1, 0x05, 0xcf, 0xf2, 0xd5, 0x6d,
+ 0xbc, 0x05, 0xd0, 0x9e, 0x20, 0xb9, 0xf6, 0xaa,
+ 0x8a, 0x01, 0x91, 0x40, 0x0a, 0xac, 0xff, 0xe0,
+ 0x1a, 0x9b, 0x64, 0xd5, 0x40, 0xba, 0x13, 0xc4,
+ 0x17, 0x3f, 0xff, 0xf7, 0x7b, 0xb5, 0x01, 0x7e,
+ 0x01, 0x56, 0xa6, 0xc7, 0x77, 0x5e, 0xc0, 0x9e,
+ 0x20, 0xb8, 0xc4, 0xc8, 0x1f, 0x41, 0xf5, 0xa9,
+ 0xfe, 0xa6, 0xc7, 0x77, 0x5e, 0xc0, 0x9e, 0x20,
+ 0xb9, 0xff, 0xef, 0xf7, 0xdd, 0x5a, 0x6f, 0x8e,
+ 0x10, 0x50, 0xa9, 0xff, 0x63, 0x9d, 0x7d, 0x47,
+ 0xaf, 0x2f, 0x9e, 0x20, 0xb8, 0x64, 0x74, 0x0a,
+ 0x45, 0x54, 0x27, 0xfc, 0xdb, 0x1d, 0x7f, 0x35,
+ 0x00, 0x27, 0x88, 0x2e, 0x7e, 0xa6, 0xe9, 0x4d,
+ 0xf2, 0x68, 0x02, 0xe7, 0xd9, 0xc8, 0x17, 0x42,
+ 0x78, 0x82, 0xe6, 0xcd, 0x31, 0xfa, 0x50, 0xf2,
+ 0x1f, 0x47, 0x65, 0x61, 0x81, 0x3f, 0x2b, 0x38,
+ 0x02, 0xe8, 0x4f, 0x10, 0x5c, 0xff, 0x9a, 0x9b,
+ 0x1d, 0xdd, 0x7b, 0x02, 0x78, 0x82, 0xe6, 0xc0,
+ 0x3d, 0x11, 0x75, 0x3e, 0x9f, 0xd7, 0xed, 0x5f,
+ 0xd7, 0xdc, 0x78, 0x82, 0xe7, 0xfd, 0x9b, 0x5d,
+ 0x9d, 0xce, 0x3d, 0xc7, 0x88, 0x2d, 0x47, 0x85,
+ 0x1c, 0x2e, 0xdf, 0xf2, 0x59, 0xd8, 0xf8, 0x2b,
+ 0x18, 0xc6, 0xa3, 0x1a, 0xbe, 0x16, 0x81, 0x70,
+ 0x9f, 0x73, 0x5e, 0x79, 0x43, 0x44, 0x17, 0x64,
+ 0x40, 0xcf, 0xfb, 0x1d, 0x4f, 0x75, 0xc5, 0xc5,
+ 0xef, 0x1d, 0x3f, 0x87, 0xb9, 0xc5, 0x2f, 0x09,
+ 0xd3, 0xe7, 0xf5, 0xe3, 0xc9, 0xd3, 0xf6, 0x3d,
+ 0xf4, 0x4b, 0x99, 0xd1, 0xb4, 0x46, 0x79, 0xa7,
+ 0x4a, 0x27, 0x78, 0xbc, 0x74, 0xdc, 0xa1, 0xd3,
+ 0xdb, 0x45, 0x61, 0xd0, 0x74, 0xfd, 0xf7, 0x74,
+ 0x83, 0xc9, 0xd1, 0xc1, 0xb8, 0xe8, 0x54, 0xff,
+ 0xfe, 0x4d, 0xf1, 0xd4, 0xbd, 0xb5, 0x8d, 0xc2,
+ 0x30, 0x2a, 0x3a, 0x6e, 0x50, 0xe9, 0x92, 0xe9,
+ 0xd3, 0xfd, 0x9a, 0xaa, 0x28, 0x1c, 0x58, 0xe9,
+ 0xfd, 0x5c, 0xa6, 0xeb, 0x7b, 0xc7, 0x4c, 0x10,
+ 0x95, 0x3f, 0xdd, 0xc5, 0xde, 0xea, 0xef, 0x83,
+ 0xa1, 0x93, 0xf8, 0xd8, 0xd8, 0x8b, 0x29, 0x62,
+ 0x84, 0x5c, 0xb0, 0xaf, 0x42, 0xdd, 0x17, 0xa9,
+ 0xc8, 0x4d, 0x41, 0x16, 0x9c, 0x10, 0x84, 0xa9,
+ 0x28, 0xab, 0x17, 0x93, 0xef, 0x5b, 0xfc, 0x4a,
+ 0xb2, 0x36, 0x41, 0x85, 0xd4, 0xfe, 0x7f, 0x49,
+ 0x94, 0xc7, 0x8e, 0x84, 0x6c, 0x63, 0x32, 0x32,
+ 0xfb, 0xa7, 0xaf, 0x99, 0x6e, 0x35, 0x6a, 0x43,
+ 0xcb, 0xe9, 0x21, 0xdd, 0x49, 0xac, 0x34, 0xaf,
+ 0x96, 0x00, 0xb9, 0x2a, 0x7b, 0x19, 0x34, 0x74,
+ 0xf6, 0x2b, 0x34, 0x74, 0xf7, 0xbc, 0x0b, 0x8e,
+ 0x84, 0x3e, 0x27, 0xc7, 0xee, 0x08, 0x27, 0xee,
+ 0xdf, 0xc2, 0xbd, 0xc7, 0x4f, 0xff, 0x3e, 0xee,
+ 0xa0, 0x0a, 0xea, 0x5d, 0xd6, 0xde, 0x3a, 0x11,
+ 0x10, 0x9b, 0x2f, 0x9e, 0x03, 0xc0, 0x04, 0xe9,
+ 0xf9, 0xe5, 0x9c, 0xbc, 0x17, 0x8e, 0x99, 0xcf,
+ 0x1d, 0x3e, 0xa6, 0x6d, 0xd5, 0x3a, 0x7f, 0xfa,
+ 0x88, 0x0d, 0xb5, 0xdf, 0xe6, 0xb5, 0x4e, 0x4a,
+ 0x9f, 0xdc, 0xe0, 0xb7, 0xfb, 0x1e, 0x20, 0x48,
+ 0x72, 0x2d, 0x78, 0x27, 0x15, 0x29, 0xed, 0x3d,
+ 0xfd, 0x3a, 0x79, 0xfa, 0xfe, 0x8e, 0x8c, 0x3c,
+ 0x4a, 0x11, 0x4f, 0xee, 0xf8, 0x6b, 0x54, 0xe4,
+ 0xe9, 0xc1, 0x08, 0x4f, 0x87, 0xd4, 0xef, 0xef,
+ 0x05, 0xc3, 0xea, 0xc6, 0xa6, 0x38, 0x44, 0xaf,
+ 0x2b, 0x93, 0xff, 0xec, 0xee, 0xee, 0xda, 0xba,
+ 0xa5, 0xfe, 0xe7, 0x21, 0xd0, 0xf1, 0xfe, 0xdd,
+ 0x25, 0x8b, 0x90, 0xab, 0x31, 0xc6, 0x99, 0x0c,
+ 0xcd, 0xba, 0x7c, 0x66, 0x73, 0xed, 0xe9, 0x35,
+ 0x52, 0xa7, 0x99, 0x35, 0x52, 0xa6, 0x08, 0x4a,
+ 0x87, 0x1e, 0xee, 0x13, 0x84, 0x82, 0x6c, 0x09,
+ 0x56, 0x35, 0xd3, 0xff, 0xec, 0xd2, 0x36, 0x67,
+ 0x75, 0x4d, 0xa7, 0x5e, 0x3a, 0x39, 0x3f, 0x80,
+ 0x92, 0xcf, 0xff, 0xe4, 0x5d, 0xbe, 0xf2, 0x06,
+ 0xab, 0x8d, 0x4f, 0xee, 0xaa, 0x74, 0xfe, 0x59,
+ 0xf7, 0x52, 0xf4, 0x13, 0xa7, 0x3b, 0xc4, 0xe9,
+ 0xf3, 0xb3, 0x59, 0xc1, 0x52, 0xda, 0xc7, 0x83,
+ 0xa1, 0xa9, 0xb9, 0x43, 0xa6, 0xe5, 0x0e, 0x9f,
+ 0xbb, 0x7b, 0xb3, 0xb6, 0xd9, 0xac, 0xe4, 0x5a,
+ 0x7f, 0xed, 0x53, 0x14, 0x0a, 0x73, 0x8f, 0xe8,
+ 0xe9, 0xfc, 0xfb, 0x6c, 0x41, 0x4e, 0x0e, 0x9e,
+ 0xe5, 0x5e, 0xea, 0x9f, 0xd6, 0x91, 0xa7, 0x2f,
+ 0xe3, 0xe7, 0x42, 0x1e, 0xcf, 0x9d, 0x4e, 0x08,
+ 0x42, 0x54, 0xfc, 0x99, 0x77, 0xb7, 0xd4, 0xab,
+ 0x17, 0x93, 0xc1, 0xfe, 0xb8, 0xe9, 0x9a, 0x87,
+ 0x4e, 0x08, 0x42, 0x54, 0xfd, 0xbf, 0xbb, 0x4d,
+ 0xe8, 0xab, 0x17, 0x93, 0xec, 0xe7, 0x31, 0x63,
+ 0xa5, 0x50, 0x11, 0x2c, 0x26, 0x3d, 0x3e, 0x9e,
+ 0xdf, 0x6f, 0x77, 0x08, 0xed, 0xc8, 0x5b, 0xc2,
+ 0x2e, 0x09, 0xb8, 0x8f, 0x19, 0x2e, 0xbb, 0x0a,
+ 0xad, 0x23, 0x19, 0xa9, 0xe6, 0xa3, 0x2b, 0x9f,
+ 0x91, 0x42, 0x3f, 0xa3, 0xa7, 0xff, 0xb6, 0xa7,
+ 0xdd, 0x50, 0x33, 0xbd, 0xcd, 0xf2, 0x74, 0x50,
+ 0xff, 0x74, 0x55, 0x2b, 0x2f, 0x67, 0xe7, 0xd6,
+ 0x49, 0x42, 0xcf, 0x46, 0x2a, 0xe9, 0x41, 0x9c,
+ 0x4a, 0x5e, 0xca, 0xd3, 0xf6, 0xec, 0x66, 0xcd,
+ 0x1d, 0x13, 0xf2, 0x88, 0xf7, 0x09, 0xd5, 0xa3,
+ 0xcf, 0x19, 0xc7, 0xe5, 0x46, 0xe7, 0x49, 0xd1,
+ 0x8f, 0x97, 0x63, 0xcc, 0xa0, 0xee, 0xce, 0x60,
+ 0x56, 0x9f, 0x73, 0xaa, 0xcc, 0x76, 0xf8, 0xca,
+ 0x17, 0x42, 0xd8, 0x24, 0x4b, 0xf2, 0xbc, 0x01,
+ 0x9d, 0x71, 0xb8, 0x87, 0xe4, 0x59, 0xfa, 0x8c,
+ 0x1d, 0x7d, 0x04, 0x53, 0xfa, 0xd8, 0x2d, 0xfe,
+ 0xc6, 0x8b, 0x8e, 0x7f, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x75, 0xcf, 0xfd, 0x6f, 0x75, 0xb0, 0x5b,
+ 0xfd, 0x8d, 0x12, 0x8c, 0x23, 0xf6, 0xc1, 0xb8,
+ 0xa3, 0x83, 0xbb, 0xa7, 0x6c, 0x77, 0xb8, 0x78,
+ 0x5c, 0xd0, 0x3e, 0xfa, 0xa0, 0xaa, 0x6d, 0xa3,
+ 0xbb, 0x83, 0xb9, 0xff, 0xd6, 0x57, 0xba, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x89, 0x6a, 0x7c, 0x2d, 0xfe,
+ 0xc6, 0x88, 0xde, 0x7f, 0xde, 0xeb, 0x60, 0xb7,
+ 0xfb, 0x1a, 0x25, 0xf9, 0x5b, 0x0f, 0xd9, 0x46,
+ 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8a, 0xae,
+ 0x7f, 0xae, 0xe7, 0x71, 0xfd, 0x7a, 0x8e, 0x9b,
+ 0x8d, 0x9d, 0x3f, 0x60, 0xb7, 0xfb, 0x1a, 0x24,
+ 0x08, 0x00, 0xf3, 0x2c, 0x2f, 0x3e, 0xaf, 0xf7,
+ 0xdf, 0x3a, 0x1c, 0x79, 0x4f, 0x91, 0xc5, 0xd4,
+ 0x79, 0xfc, 0x34, 0x27, 0xfe, 0xee, 0x3d, 0x65,
+ 0xf4, 0xef, 0x73, 0x47, 0x45, 0x8f, 0xc0, 0x4a,
+ 0x67, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x16, 0x44,
+ 0xfe, 0xb6, 0x0b, 0x7f, 0xb1, 0xa2, 0xd7, 0x9f,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x5c, 0x93, 0xe1,
+ 0x6f, 0xf6, 0x34, 0x5d, 0x93, 0xfe, 0xf7, 0x5b,
+ 0x05, 0xbf, 0xd8, 0xd1, 0x47, 0x4a, 0xd8, 0x7e,
+ 0xca, 0x30, 0x9f, 0x0b, 0x7f, 0xb1, 0xa2, 0x95,
+ 0x9f, 0xff, 0xfe, 0xa2, 0x3c, 0x94, 0xda, 0xef,
+ 0xe2, 0x9b, 0xb3, 0x53, 0x6b, 0x51, 0x1e, 0xc3,
+ 0xa7, 0xd6, 0x57, 0xba, 0xd8, 0x8b, 0x25, 0x8c,
+ 0x21, 0xe5, 0xce, 0xe7, 0x43, 0x21, 0xf2, 0x7d,
+ 0xc7, 0x3c, 0xa2, 0x1e, 0x4e, 0xea, 0x77, 0xa8,
+ 0x58, 0xae, 0x86, 0xcc, 0xff, 0x3a, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x88, 0xe2, 0x7f, 0xb7, 0x6c, 0x16,
+ 0xff, 0x63, 0x45, 0x6b, 0x2b, 0x7a, 0x20, 0xb4,
+ 0x83, 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05, 0xbf,
+ 0xd8, 0xd1, 0x2d, 0xcd, 0x8f, 0x9d, 0x3f, 0xb8,
+ 0xc5, 0x29, 0x37, 0x53, 0xa1, 0xf3, 0xc9, 0xd8,
+ 0xb4, 0xea, 0x70, 0xe3, 0xa7, 0x39, 0x4c, 0x74,
+ 0x1a, 0x21, 0xb9, 0xff, 0x7b, 0xad, 0x82, 0xdf,
+ 0xec, 0x68, 0x98, 0x27, 0x0d, 0xfc, 0x95, 0x2b,
+ 0x22, 0x35, 0x5e, 0x23, 0xe0, 0x75, 0x86, 0xd4,
+ 0x2f, 0xa4, 0x69, 0xca, 0xbc, 0x4a, 0x9f, 0xf7,
+ 0xba, 0xd8, 0x2d, 0xfe, 0xc6, 0x89, 0x8e, 0x56,
+ 0xd9, 0xf1, 0x28, 0x72, 0x7e, 0x4a, 0x81, 0xac,
+ 0xa1, 0xd3, 0xff, 0xff, 0xce, 0xad, 0x32, 0xf0,
+ 0xd6, 0x98, 0xd9, 0x50, 0x31, 0xf7, 0x57, 0x7d,
+ 0xd9, 0xd3, 0xcd, 0xfe, 0xc6, 0x8a, 0xc6, 0x7f,
+ 0xcb, 0xf9, 0xae, 0xe5, 0xe9, 0xdd, 0x1d, 0x17,
+ 0x53, 0x19, 0x7c, 0xb4, 0x61, 0x01, 0xa2, 0xb9,
+ 0xff, 0xc9, 0xdd, 0x5d, 0xbd, 0x3b, 0x8c, 0x82,
+ 0x74, 0xff, 0xb3, 0x8a, 0x65, 0x5f, 0x72, 0x50,
+ 0xe9, 0xff, 0xff, 0xbb, 0x7b, 0xd8, 0xc0, 0x76,
+ 0xfb, 0x80, 0x31, 0xf7, 0x65, 0xfd, 0xe6, 0xa7,
+ 0x4f, 0xeb, 0x90, 0xf2, 0xce, 0x5e, 0x0b, 0xc7,
+ 0x4e, 0xa6, 0xed, 0x89, 0xc5, 0x32, 0x2d, 0x12,
+ 0x74, 0x7e, 0xbe, 0xfb, 0x35, 0xeb, 0x1d, 0x3e,
+ 0xfe, 0xbd, 0x7d, 0x4e, 0x8e, 0x9e, 0x0d, 0x46,
+ 0x27, 0xc1, 0xad, 0x53, 0x93, 0xa7, 0xc8, 0xee,
+ 0x6f, 0x71, 0xd3, 0x93, 0xae, 0x3a, 0x16, 0x3c,
+ 0x4d, 0x14, 0xcf, 0xc8, 0xac, 0xee, 0xee, 0x9d,
+ 0x2a, 0x9d, 0x1b, 0x37, 0xde, 0x5d, 0x37, 0x28,
+ 0x54, 0xc1, 0x09, 0x51, 0xb3, 0x58, 0x11, 0x69,
+ 0xfd, 0xee, 0xee, 0x6a, 0x9b, 0x2a, 0xc6, 0x86,
+ 0x7b, 0x8f, 0x7e, 0xa7, 0x4e, 0x4e, 0xac, 0x74,
+ 0xdd, 0x43, 0xa1, 0x63, 0x62, 0x23, 0x93, 0xc3,
+ 0xce, 0x5c, 0x1d, 0x38, 0x11, 0xba, 0x74, 0x22,
+ 0x2d, 0xf1, 0x53, 0x64, 0x34, 0x24, 0x9a, 0x9a,
+ 0x3a, 0x70, 0x42, 0x12, 0xa7, 0xfe, 0xc6, 0xe1,
+ 0x1e, 0x07, 0x29, 0xef, 0x95, 0x62, 0xf2, 0x7e,
+ 0xbd, 0x5b, 0xd7, 0x3e, 0x74, 0xfe, 0x6d, 0xd7,
+ 0xb8, 0xbb, 0xce, 0x9b, 0x34, 0x74, 0x3e, 0x79,
+ 0x14, 0x33, 0x9f, 0xfe, 0xd6, 0xeb, 0x4c, 0xe3,
+ 0xb8, 0xbb, 0xb9, 0x53, 0xa5, 0x64, 0x5c, 0x02,
+ 0xe0, 0x8b, 0x1b, 0x05, 0x85, 0x4d, 0xb4, 0x87,
+ 0xcf, 0x9d, 0xf4, 0xca, 0xaa, 0x9a, 0x77, 0x04,
+ 0x8e, 0x7c, 0x2d, 0xfe, 0xc6, 0x8a, 0xde, 0x7f,
+ 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x27, 0x09,
+ 0x5b, 0x0f, 0xd9, 0x46, 0x13, 0xe1, 0x6f, 0xf6,
+ 0x34, 0x5a, 0x33, 0xd8, 0xb6, 0xee, 0x9d, 0x2b,
+ 0x61, 0xea, 0x50, 0xc2, 0x79, 0xbf, 0xd8, 0xd1,
+ 0x6d, 0x4f, 0xd4, 0x45, 0x26, 0xf8, 0x3a, 0x6b,
+ 0x60, 0x9e, 0xc6, 0x8a, 0xe7, 0xf5, 0xb0, 0x5b,
+ 0xfd, 0x8d, 0x17, 0x2c, 0xfe, 0xb6, 0x0b, 0x7f,
+ 0xb1, 0xa2, 0xed, 0x84, 0x66, 0x3c, 0xbc, 0x50,
+ 0xe8, 0xdc, 0x38, 0x85, 0xfd, 0xd9, 0x59, 0x7b,
+ 0x9c, 0xa1, 0xb9, 0xc6, 0x35, 0x47, 0xbe, 0xbf,
+ 0xd4, 0xb3, 0x47, 0x73, 0xfa, 0xd8, 0x2d, 0xfe,
+ 0xc6, 0x8a, 0x9e, 0x79, 0xbf, 0xd8, 0xd1, 0x5c,
+ 0xcf, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2c, 0xe8,
+ 0x13, 0xe6, 0xa1, 0x5c, 0xff, 0x3a, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x89, 0x0a, 0x79, 0x7b, 0x51, 0x14,
+ 0x74, 0xfe, 0xca, 0x56, 0xb8, 0x2f, 0x1d, 0x2b,
+ 0x62, 0x2e, 0xfc, 0x86, 0xa8, 0x3a, 0x27, 0x9f,
+ 0xfd, 0x65, 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68,
+ 0x9f, 0x21, 0x93, 0xef, 0xb9, 0xc6, 0xb9, 0x44,
+ 0x19, 0xf0, 0xb7, 0xfb, 0x1a, 0x2b, 0x29, 0xff,
+ 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x9b, 0xa6,
+ 0xdd, 0xb0, 0xfd, 0x94, 0x61, 0x3f, 0xfa, 0xca,
+ 0xf7, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x2b, 0x4f,
+ 0x85, 0xbf, 0xd8, 0xd1, 0x2e, 0x4f, 0x2e, 0xdf,
+ 0x50, 0xe9, 0xf5, 0x95, 0xee, 0xb6, 0x1e, 0x9f,
+ 0x98, 0x4f, 0xfd, 0x6f, 0x75, 0xb0, 0x5b, 0xfd,
+ 0x8d, 0x11, 0xdc, 0xff, 0x6a, 0x98, 0xeb, 0x7f,
+ 0x6a, 0x74, 0xfc, 0xbc, 0xea, 0x36, 0x74, 0xe9,
+ 0xfa, 0xe5, 0xee, 0x53, 0xf4, 0x74, 0xf8, 0x5b,
+ 0xfd, 0x8d, 0x15, 0x0c, 0xfb, 0x29, 0xac, 0x78,
+ 0xe9, 0x5a, 0xe5, 0x45, 0xba, 0xf0, 0xbf, 0x0c,
+ 0x74, 0x61, 0x3e, 0x16, 0xff, 0x63, 0x45, 0x51,
+ 0x3f, 0xef, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x13,
+ 0x5c, 0xad, 0x87, 0xec, 0xa3, 0x09, 0xfd, 0x6c,
+ 0x16, 0xff, 0x63, 0x45, 0x59, 0x3f, 0xf5, 0xbd,
+ 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x48, 0x93, 0xe1,
+ 0x6f, 0xf6, 0x34, 0x5a, 0x53, 0xfe, 0xf7, 0x5b,
+ 0x05, 0xbf, 0xd8, 0xd1, 0x3e, 0xca, 0xd8, 0x7e,
+ 0xca, 0x30, 0x9f, 0xfd, 0x65, 0x7b, 0xad, 0x82,
+ 0xdf, 0xec, 0x68, 0xa1, 0x27, 0xd4, 0xdb, 0xc8,
+ 0x27, 0x4f, 0x85, 0xbf, 0xd8, 0xd1, 0x47, 0xcf,
+ 0xff, 0xd9, 0xc5, 0x10, 0x1b, 0x6b, 0xbf, 0xcd,
+ 0x6a, 0x9c, 0x95, 0x3e, 0xb2, 0xbd, 0xd6, 0x44,
+ 0x5a, 0xe1, 0x3a, 0xf9, 0x84, 0x22, 0xeb, 0xf3,
+ 0xd0, 0xa5, 0x71, 0xee, 0x26, 0x5d, 0x87, 0x7b,
+ 0x43, 0x05, 0xf2, 0x75, 0x8e, 0xe9, 0x0c, 0x2e,
+ 0x49, 0xf5, 0x18, 0x3c, 0xfe, 0xb6, 0x0b, 0x7f,
+ 0xb1, 0xa2, 0x22, 0x9f, 0xb0, 0x5b, 0xfd, 0x8d,
+ 0x11, 0x5c, 0xff, 0x5c, 0xed, 0x82, 0xdf, 0xec,
+ 0x68, 0xae, 0x22, 0xc7, 0xf5, 0xe6, 0xb3, 0xd9,
+ 0x4f, 0xd1, 0xd3, 0xfb, 0x36, 0x3c, 0xf3, 0x7d,
+ 0x4e, 0x95, 0xcb, 0xd3, 0xd5, 0xa9, 0x04, 0xff,
+ 0xdf, 0xb7, 0x6f, 0xba, 0xbe, 0x83, 0x87, 0x4f,
+ 0xb3, 0x7c, 0x0e, 0x1d, 0x3b, 0x55, 0xdd, 0x0f,
+ 0xab, 0x48, 0x93, 0xe1, 0x6f, 0xf6, 0x34, 0x53,
+ 0xd0, 0xbc, 0x47, 0xda, 0x42, 0x5f, 0x0d, 0x27,
+ 0xff, 0x7b, 0xad, 0xc7, 0x7c, 0x35, 0xaa, 0x72,
+ 0x74, 0x59, 0x10, 0x5c, 0x1b, 0xce, 0xb7, 0x18,
+ 0x74, 0xf9, 0x1d, 0xcd, 0xee, 0x3a, 0x79, 0xbf,
+ 0xd8, 0xd1, 0x59, 0xc2, 0xc7, 0xa8, 0x25, 0x33,
+ 0xf3, 0xca, 0x4e, 0xba, 0xa7, 0x4e, 0x47, 0xb6,
+ 0x74, 0xfb, 0x5c, 0x83, 0xd7, 0x1d, 0x3e, 0xc5,
+ 0x9e, 0xbf, 0x93, 0xa5, 0x6c, 0x46, 0x08, 0x91,
+ 0x50, 0xbb, 0xc7, 0x01, 0x2a, 0x9f, 0xfa, 0xde,
+ 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x24, 0x59, 0xfd,
+ 0x6c, 0x16, 0xff, 0x63, 0x45, 0x93, 0x3f, 0xad,
+ 0x82, 0xdf, 0xec, 0x68, 0xb6, 0x27, 0xf5, 0xb0,
+ 0x5b, 0xfd, 0x8d, 0x16, 0xdc, 0xff, 0x97, 0x8b,
+ 0xcb, 0x92, 0xd5, 0x33, 0xa9, 0xc9, 0xd3, 0xf2,
+ 0x75, 0xdc, 0x5e, 0xa3, 0xa7, 0xc2, 0xdf, 0xec,
+ 0x68, 0xbc, 0x27, 0xb4, 0xbf, 0x94, 0x3a, 0x7d,
+ 0x9d, 0xe6, 0xe1, 0x0e, 0x9f, 0x20, 0x37, 0xfd,
+ 0x4e, 0x9d, 0xa4, 0xe4, 0xe9, 0x5a, 0xe4, 0xd4,
+ 0xcf, 0xde, 0x4e, 0xc2, 0xf7, 0xcc, 0x39, 0x24,
+ 0xe9, 0x56, 0x8a, 0x27, 0xc2, 0xdf, 0xec, 0x68,
+ 0xbd, 0x27, 0xfd, 0xdf, 0xd3, 0x92, 0xee, 0xb6,
+ 0xf1, 0xd3, 0xec, 0x55, 0x3f, 0x83, 0xa5, 0x6c,
+ 0x44, 0xc0, 0x26, 0x17, 0x08, 0x30, 0x8b, 0xf9,
+ 0xcf, 0x42, 0xd7, 0x23, 0xf3, 0x62, 0x4d, 0xc6,
+ 0x62, 0x29, 0xca, 0x4c, 0xe4, 0xef, 0xa7, 0x77,
+ 0xc6, 0xf4, 0x18, 0xc3, 0xa7, 0xb2, 0x9f, 0xa3,
+ 0xa7, 0xf6, 0x6c, 0x79, 0xe6, 0xfa, 0x9d, 0x2b,
+ 0x97, 0xa7, 0xab, 0x52, 0x09, 0xf0, 0xb7, 0xfb,
+ 0x1a, 0x22, 0x39, 0xff, 0xea, 0x5f, 0x5a, 0xe2,
+ 0xbb, 0x8b, 0x80, 0x45, 0xee, 0x74, 0xff, 0x9c,
+ 0x8f, 0x0e, 0x6b, 0x5b, 0xd1, 0xd3, 0x3c, 0xa2,
+ 0xa6, 0x08, 0x4a, 0x9f, 0xf9, 0xd6, 0x6a, 0x6d,
+ 0x6a, 0x23, 0xd6, 0xe4, 0xd6, 0x84, 0x5e, 0x7f,
+ 0x65, 0xcf, 0xb9, 0x4f, 0xd1, 0xd3, 0xff, 0xf3,
+ 0x58, 0x7f, 0xbb, 0xd5, 0x85, 0x35, 0xdf, 0xe4,
+ 0xe8, 0x5e, 0x2a, 0x0d, 0xc2, 0xd6, 0x30, 0x7d,
+ 0x67, 0xda, 0xf4, 0xbc, 0xb8, 0xd6, 0x7c, 0x2d,
+ 0xfe, 0xc6, 0x88, 0xba, 0x7d, 0xae, 0x41, 0xeb,
+ 0x8b, 0x67, 0xb4, 0xad, 0x87, 0xcf, 0xe6, 0x11,
+ 0x64, 0x7b, 0xba, 0x1a, 0x33, 0xff, 0x2b, 0xdd,
+ 0x6c, 0x16, 0xff, 0x63, 0x44, 0xcd, 0x39, 0xf4,
+ 0xa9, 0xd3, 0x9b, 0x6a, 0x3a, 0x7f, 0xf6, 0x5c,
+ 0x6f, 0x5b, 0x6d, 0xf1, 0xac, 0x63, 0xa7, 0xff,
+ 0xdc, 0x6f, 0xaf, 0x65, 0x77, 0xf4, 0xb0, 0x42,
+ 0x12, 0xa7, 0x9b, 0xfd, 0x8d, 0x16, 0x7c, 0xff,
+ 0xf6, 0xc6, 0x9e, 0x06, 0x2e, 0xee, 0x57, 0x3a,
+ 0x74, 0xe0, 0x84, 0x25, 0x4f, 0xfb, 0xdd, 0x5e,
+ 0xe3, 0x71, 0x82, 0x55, 0x8b, 0xc9, 0xfe, 0x4a,
+ 0x6f, 0x8e, 0xff, 0xac, 0x74, 0xff, 0x6f, 0xbc,
+ 0x03, 0xc5, 0xfa, 0xa9, 0xd0, 0xc9, 0xd8, 0x8a,
+ 0xc5, 0x0a, 0xf9, 0x6c, 0xd2, 0x5a, 0xe3, 0x99,
+ 0xff, 0xff, 0xfb, 0x33, 0x9a, 0xe6, 0x76, 0xe8,
+ 0x23, 0xd4, 0xca, 0x5a, 0xbd, 0xc7, 0x95, 0x8a,
+ 0x3a, 0x75, 0x51, 0xe3, 0xa7, 0x2f, 0xe5, 0x0e,
+ 0x87, 0x23, 0x12, 0xb0, 0x8a, 0xd0, 0xe4, 0xf3,
+ 0xfc, 0xde, 0xc7, 0x4f, 0xa9, 0xd4, 0xc1, 0x32,
+ 0x7f, 0xdb, 0x17, 0x60, 0xbd, 0x7f, 0xf0, 0x68,
+ 0x83, 0x6c, 0x69, 0x67, 0xde, 0xdb, 0x52, 0x1d,
+ 0x3f, 0x3a, 0x9d, 0xf7, 0xf4, 0x74, 0xb1, 0x8f,
+ 0x4f, 0xa4, 0xb3, 0xff, 0xfe, 0xf0, 0xeb, 0x29,
+ 0xa4, 0xce, 0xbf, 0xac, 0x1d, 0xbd, 0xea, 0x3a,
+ 0x1c, 0x9a, 0x06, 0x42, 0xbf, 0xa4, 0xd3, 0xf0,
+ 0xe7, 0x15, 0xa2, 0x1d, 0x3f, 0xff, 0xaf, 0xef,
+ 0xdd, 0x00, 0x1e, 0xfe, 0xab, 0xb7, 0xe9, 0xb0,
+ 0x9d, 0x3f, 0xff, 0xd5, 0xaa, 0x0e, 0x92, 0xca,
+ 0xcd, 0x54, 0x1a, 0xfb, 0xb0, 0xe9, 0xea, 0x66,
+ 0xd7, 0x1d, 0x1b, 0x44, 0x45, 0x19, 0x66, 0x55,
+ 0xca, 0x68, 0xbf, 0x27, 0xfe, 0x76, 0xaf, 0x73,
+ 0x95, 0xad, 0x22, 0x8e, 0x9f, 0xfb, 0x79, 0xdc,
+ 0xca, 0x80, 0xea, 0xa8, 0xe8, 0x7d, 0x11, 0x55,
+ 0x46, 0x9e, 0xef, 0x51, 0x8e, 0x84, 0x4c, 0x67,
+ 0x82, 0x3c, 0x85, 0x97, 0x92, 0x4f, 0xff, 0xfd,
+ 0x70, 0x94, 0xda, 0xac, 0xb3, 0xbc, 0x41, 0xa6,
+ 0xdf, 0xab, 0x6d, 0xe3, 0xa7, 0xd7, 0xe5, 0x77,
+ 0xd3, 0xa7, 0xc8, 0x0d, 0xff, 0x53, 0xa6, 0x5e,
+ 0x94, 0x74, 0xff, 0xff, 0xa9, 0xb7, 0xf5, 0x8f,
+ 0xe8, 0x45, 0x35, 0xc8, 0x3d, 0x75, 0x30, 0xe9,
+ 0xc1, 0x08, 0x4a, 0x9e, 0xe3, 0x8f, 0xe9, 0x56,
+ 0x2f, 0x21, 0x11, 0xb0, 0xc3, 0x7b, 0x84, 0x5c,
+ 0xff, 0xd9, 0xd7, 0xf5, 0x83, 0xb7, 0xbd, 0x47,
+ 0x4f, 0xb3, 0x4e, 0x55, 0x0e, 0x84, 0x3e, 0xba,
+ 0xa2, 0x4d, 0xcd, 0x0e, 0x9f, 0x9e, 0x59, 0xcb,
+ 0xc1, 0x78, 0xe9, 0xfd, 0x76, 0x99, 0xaa, 0x6f,
+ 0x47, 0x4d, 0xb1, 0x3a, 0x2e, 0x41, 0xff, 0x6c,
+ 0xd2, 0x86, 0xb3, 0xff, 0xb8, 0xe1, 0x38, 0x14,
+ 0xd6, 0xdb, 0x7c, 0x1d, 0x2b, 0x2f, 0x66, 0x59,
+ 0x85, 0xc9, 0x0e, 0x70, 0x37, 0x91, 0xfe, 0xbf,
+ 0x18, 0xee, 0xcd, 0x56, 0x8e, 0x24, 0x4d, 0x54,
+ 0x59, 0x49, 0x41, 0x3e, 0x83, 0xcb, 0xcf, 0x4a,
+ 0x2b, 0x18, 0x06, 0xa1, 0x3c, 0x12, 0x15, 0xf8,
+ 0x4a, 0x82, 0x6b, 0x16, 0x66, 0x5a, 0x52, 0x96,
+ 0xf9, 0x3f, 0xfa, 0xca, 0xf7, 0x5b, 0x05, 0xbf,
+ 0xd8, 0xd1, 0x36, 0x4f, 0xeb, 0x60, 0xb7, 0xfb,
+ 0x1a, 0x2a, 0xd9, 0xfc, 0xe7, 0x5f, 0xae, 0xa3,
+ 0x8e, 0x9e, 0xca, 0x7e, 0x8e, 0x95, 0xcb, 0x87,
+ 0xa9, 0xd3, 0x49, 0xf0, 0xb7, 0xfb, 0x1a, 0x2b,
+ 0x49, 0xff, 0xe6, 0x41, 0xce, 0x7d, 0x5e, 0xe4,
+ 0xdb, 0x1d, 0x3f, 0xfc, 0xea, 0xe7, 0x51, 0x5f,
+ 0x9a, 0xd2, 0x28, 0xe9, 0xb5, 0xa4, 0x44, 0xc7,
+ 0xa5, 0xcf, 0xe4, 0x5c, 0x0e, 0xba, 0x9c, 0x9d,
+ 0x3f, 0x3d, 0x94, 0xde, 0x28, 0xe9, 0xfe, 0xcb,
+ 0x8e, 0xa0, 0x5f, 0x75, 0x4e, 0x9f, 0xce, 0xcd,
+ 0x7f, 0x79, 0xbc, 0xe9, 0x59, 0x78, 0x9f, 0xa6,
+ 0x16, 0x6e, 0x19, 0x14, 0x2d, 0xf3, 0x6e, 0x96,
+ 0xe8, 0xf2, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1,
+ 0x60, 0x4f, 0x85, 0xbf, 0xd8, 0xd1, 0x3a, 0xcf,
+ 0xff, 0xea, 0x23, 0xdc, 0x62, 0xad, 0x5a, 0xe5,
+ 0x37, 0x5b, 0xde, 0x3a, 0x7d, 0x65, 0x7b, 0xad,
+ 0x88, 0x95, 0x58, 0xc2, 0x7c, 0x2d, 0xfe, 0xc6,
+ 0x8b, 0x66, 0x7f, 0xdc, 0xa5, 0x6d, 0x4d, 0xb7,
+ 0x89, 0xd2, 0xb6, 0x1f, 0x6f, 0x98, 0x4f, 0x37,
+ 0xfb, 0x1a, 0x2e, 0x69, 0x28, 0xe9, 0xad, 0x82,
+ 0x6e, 0xc2, 0x57, 0x3f, 0xad, 0x82, 0xdf, 0xec,
+ 0x68, 0xbb, 0xe7, 0xad, 0x77, 0x8e, 0x4e, 0x84,
+ 0x6c, 0xaf, 0x72, 0x99, 0xb8, 0xc6, 0x0f, 0xa9,
+ 0x6e, 0x54, 0x18, 0xb9, 0x2a, 0x1a, 0x1c, 0xc2,
+ 0xb6, 0xac, 0x3a, 0x2b, 0x04, 0xee, 0x7f, 0x75,
+ 0xec, 0xb8, 0xd2, 0x5d, 0x3a, 0x7c, 0x2d, 0xfe,
+ 0xc6, 0x89, 0x5e, 0x7e, 0xa7, 0x17, 0xf8, 0xb8,
+ 0xe9, 0xde, 0xeb, 0x22, 0x25, 0xb0, 0xe2, 0xa6,
+ 0x13, 0xb4, 0x9c, 0x15, 0x3f, 0xfa, 0x9f, 0xbd,
+ 0x23, 0xb6, 0x2f, 0x5f, 0xc9, 0x53, 0xfb, 0xda,
+ 0xdc, 0x0a, 0xf5, 0x64, 0x3e, 0x8a, 0x8e, 0x4a,
+ 0xca, 0x47, 0xaa, 0xe8, 0x53, 0xcf, 0xfe, 0xb2,
+ 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x4c, 0x33,
+ 0xff, 0xf6, 0x58, 0x11, 0xfe, 0x6d, 0x77, 0x4e,
+ 0x0a, 0x55, 0xc7, 0x4f, 0xfd, 0x72, 0xe3, 0xee,
+ 0xbf, 0xf5, 0xd4, 0x71, 0xd3, 0xfd, 0xd4, 0xf7,
+ 0xb5, 0x77, 0xc4, 0xe9, 0xf9, 0x49, 0x9d, 0xd2,
+ 0xf9, 0xd3, 0xe4, 0xce, 0xe9, 0x7c, 0xe9, 0xfa,
+ 0x9b, 0xd5, 0x7d, 0xf0, 0x0f, 0x61, 0x45, 0xf3,
+ 0xff, 0xfe, 0xee, 0x06, 0xe3, 0x59, 0x40, 0x3b,
+ 0x8f, 0x6f, 0x3a, 0xfb, 0xaa, 0x74, 0xfc, 0xb8,
+ 0x1d, 0x75, 0x39, 0x3a, 0x7f, 0xf2, 0x6b, 0x94,
+ 0x76, 0x3f, 0xa7, 0xaf, 0x09, 0xd0, 0x87, 0xfd,
+ 0xb3, 0x19, 0xfa, 0xbb, 0xba, 0xaf, 0xd1, 0xd3,
+ 0xff, 0xfe, 0x1c, 0x5c, 0x9d, 0xd0, 0x00, 0xf5,
+ 0x29, 0xfb, 0xd2, 0x6a, 0xa7, 0x4b, 0x1f, 0x44,
+ 0xe8, 0x97, 0xcf, 0x78, 0x3c, 0x61, 0xd2, 0xb2,
+ 0xf1, 0x58, 0xd7, 0x09, 0x4d, 0x09, 0x15, 0x91,
+ 0xe9, 0x0f, 0x0e, 0xc2, 0xfa, 0xf2, 0x89, 0xf0,
+ 0xb7, 0xfb, 0x1a, 0x2a, 0xe9, 0xfe, 0x75, 0xb0,
+ 0x5b, 0xfd, 0x8d, 0x11, 0xe4, 0xad, 0x87, 0xe3,
+ 0xe6, 0x13, 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8b,
+ 0x06, 0x7f, 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x65,
+ 0x4f, 0xeb, 0x60, 0xb7, 0xfb, 0x1a, 0x2d, 0x39,
+ 0xe6, 0xff, 0x63, 0x45, 0xb9, 0x3f, 0xf2, 0x60,
+ 0xe7, 0x40, 0xa6, 0x3e, 0x13, 0xa0, 0x4f, 0xba,
+ 0xa5, 0x73, 0xfe, 0xf7, 0x5b, 0x05, 0xbf, 0xd8,
+ 0xd1, 0x43, 0xcf, 0xdd, 0x5e, 0x60, 0xa5, 0x4e,
+ 0x9f, 0xff, 0xb3, 0x8a, 0x20, 0x36, 0xd7, 0x7f,
+ 0x9a, 0xd5, 0x39, 0x2a, 0x56, 0xc4, 0x7a, 0x28,
+ 0x86, 0xf4, 0x65, 0xf2, 0xf9, 0xfd, 0x6c, 0x16,
+ 0xff, 0x63, 0x45, 0xe7, 0x08, 0xbf, 0x4c, 0xe3,
+ 0x0e, 0x14, 0xb2, 0x5b, 0xc3, 0xf0, 0xf2, 0x12,
+ 0x65, 0x1d, 0xd0, 0xef, 0xb1, 0xce, 0xae, 0x46,
+ 0x9f, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x52, 0xd3,
+ 0xfa, 0xd8, 0x2d, 0xfe, 0xc6, 0x8b, 0x0a, 0x7f,
+ 0x5b, 0x05, 0xbf, 0xd8, 0xd1, 0x65, 0xcf, 0xfe,
+ 0xb2, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6, 0x34, 0x51,
+ 0x93, 0xfa, 0xc8, 0xb9, 0x05, 0x39, 0x3a, 0x1c,
+ 0x99, 0xb0, 0x9d, 0xa8, 0xee, 0xa7, 0x7a, 0x52,
+ 0x9f, 0xfa, 0xde, 0xeb, 0x60, 0xb7, 0xfb, 0x1a,
+ 0x23, 0x99, 0xff, 0xd6, 0x57, 0xba, 0xd8, 0x2d,
+ 0xfe, 0xc6, 0x89, 0xca, 0x7f, 0x5b, 0x05, 0xbf,
+ 0xd8, 0xd1, 0x66, 0x4f, 0xeb, 0x60, 0xb7, 0xfb,
+ 0x1a, 0x2d, 0xd9, 0xff, 0xd6, 0x57, 0xba, 0xd8,
+ 0x2d, 0xfe, 0xc6, 0x8a, 0x42, 0x7f, 0xeb, 0x7b,
+ 0xad, 0x82, 0xdf, 0xec, 0x68, 0x94, 0xa1, 0xe4,
+ 0xec, 0x96, 0x4c, 0x52, 0x97, 0x4e, 0xf4, 0x77,
+ 0x70, 0xa5, 0x3f, 0xef, 0x75, 0xb0, 0x5b, 0xfd,
+ 0x8d, 0x13, 0xb4, 0xff, 0xfb, 0x7c, 0x5e, 0xa4,
+ 0xb8, 0xfe, 0x3a, 0x9d, 0xc6, 0x3a, 0x65, 0x59,
+ 0x48, 0x9f, 0xf4, 0x69, 0xf0, 0xb7, 0xfb, 0x1a,
+ 0x22, 0xc9, 0xff, 0x7b, 0xad, 0x82, 0xdf, 0xec,
+ 0x68, 0x97, 0x67, 0xff, 0xec, 0xe2, 0x88, 0x0d,
+ 0xb5, 0xdf, 0xe6, 0xb5, 0x4e, 0x4a, 0x95, 0xb1,
+ 0x1a, 0x8a, 0x30, 0x5f, 0x46, 0x9f, 0xfd, 0x65,
+ 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x98, 0xa7,
+ 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x15, 0x4c, 0xff,
+ 0xeb, 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63, 0x44,
+ 0xe9, 0x3f, 0xb7, 0xe2, 0x8e, 0xf5, 0xc7, 0x4f,
+ 0x96, 0x45, 0x92, 0xa7, 0x4f, 0xc1, 0xcd, 0xae,
+ 0xce, 0x9d, 0x3d, 0xba, 0x25, 0xb6, 0x7a, 0xd5,
+ 0x28, 0x9f, 0xfa, 0xfa, 0xe9, 0x1f, 0xb5, 0xeb,
+ 0x6d, 0x47, 0x42, 0x91, 0x05, 0x43, 0x99, 0xff,
+ 0x7b, 0xad, 0x82, 0xdf, 0xec, 0x68, 0x9d, 0xe7,
+ 0xda, 0xbf, 0xd5, 0xb2, 0xa5, 0x6e, 0x13, 0x9b,
+ 0xc8, 0xc2, 0x94, 0x47, 0xe8, 0xd3, 0xff, 0xac,
+ 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x14, 0x2c,
+ 0xff, 0xeb, 0x2b, 0xdd, 0x6c, 0x16, 0xff, 0x63,
+ 0x45, 0x25, 0x3f, 0xff, 0xb2, 0xb6, 0x07, 0x16,
+ 0xa7, 0xab, 0x54, 0x4d, 0x5e, 0xa3, 0xa1, 0xe5,
+ 0xc0, 0x27, 0x1c, 0x32, 0x90, 0x9d, 0xaa, 0x3e,
+ 0xde, 0x52, 0x6f, 0x52, 0x5f, 0x52, 0x9f, 0xd6,
+ 0xc1, 0x6f, 0xf6, 0x34, 0x44, 0x93, 0xff, 0xac,
+ 0xaf, 0x75, 0xb0, 0x5b, 0xfd, 0x8d, 0x12, 0xf4,
+ 0xf8, 0x5b, 0xfd, 0x8d, 0x14, 0xbc, 0xfe, 0x4e,
+ 0x2e, 0x36, 0xa4, 0xa9, 0xd2, 0xb6, 0x1f, 0x36,
+ 0x8c, 0x27, 0xf5, 0xb0, 0x5b, 0xfd, 0x8d, 0x14,
+ 0xe4, 0xff, 0xb6, 0x3f, 0x5a, 0x66, 0x75, 0x8e,
+ 0x9f, 0xf6, 0x51, 0x07, 0x2c, 0x10, 0x84, 0xa9,
+ 0xb6, 0x13, 0xa6, 0x7a, 0xdc, 0x22, 0x35, 0x7c,
+ 0xee, 0xe0, 0xf2, 0x7c, 0x2d, 0xfe, 0xc6, 0x8a,
+ 0xf2, 0x7f, 0xfe, 0xce, 0x28, 0x80, 0xdb, 0x5d,
+ 0xfe, 0x6b, 0x54, 0xe4, 0xa9, 0x5b, 0x11, 0x1c,
+ 0xbe, 0x61, 0x3f, 0xf5, 0xbd, 0xd6, 0xc1, 0x6f,
+ 0xf6, 0x34, 0x48, 0xf3, 0xb7, 0xca, 0x1d, 0x39,
+ 0xb1, 0x45, 0x58, 0xbc, 0x9f, 0x0b, 0x7f, 0xb1,
+ 0xa2, 0x48, 0x9e, 0xb7, 0xba, 0xc8, 0x7b, 0x38,
+ 0x53, 0x3f, 0xf5, 0xbd, 0xd6, 0xc1, 0x6f, 0xf6,
+ 0x34, 0x49, 0x53, 0xe1, 0x6f, 0xf6, 0x34, 0x5e,
+ 0x33, 0xf5, 0xfd, 0x7f, 0xdf, 0xa9, 0xd3, 0xea,
+ 0xd7, 0x58, 0xc7, 0x4f, 0xf3, 0xad, 0x82, 0xdf,
+ 0xec, 0x68, 0x93, 0x65, 0x6c, 0x46, 0x3b, 0xe6,
+ 0x02, 0x61, 0xe4, 0xd0, 0x8b, 0xa5, 0x6f, 0x1d,
+ 0xba, 0x17, 0x1c, 0x13, 0xee, 0x19, 0x0b, 0x43,
+ 0x49, 0x45, 0x74, 0x86, 0x0e, 0x8d, 0xef, 0x8c,
+ 0x4e, 0x12, 0x33, 0xea, 0x07, 0xa3, 0x9f, 0x74,
+ 0x79, 0x3c, 0x47, 0xb5, 0x96, 0xd9, 0xfa, 0xec,
+ 0xa5, 0x76, 0xaf, 0x4d, 0x9f, 0x9e, 0x0b, 0xdc,
+ 0xe6, 0x2d, 0xce, 0x3b, 0x05, 0xa9, 0x63, 0xa3,
+ 0x3f, 0x70, 0xab, 0xee, 0x55, 0xa4, 0xed, 0x2f,
+ 0xd3, 0x65, 0xb9, 0x95, 0x64, 0xbd, 0x42, 0xc3,
+ 0xb3, 0xb5, 0x75, 0xa4, 0x43, 0x6a, 0xb6, 0xcd,
+ 0xbe, 0x93, 0xce, 0xba, 0x3d, 0x70, 0xc7, 0xf8,
+ 0xbf, 0x0f, 0xc0, 0x67, 0x41, 0x2e, 0x27, 0x6a,
+ 0x60,
+};
+
+static const unsigned kPreloadedHSTSBits = 83397;
+
+static const unsigned kHSTSRootPosition = 82825;
#endif // NET_HTTP_TRANSPORT_SECURITY_STATE_STATIC_H_
diff --git a/net/http/transport_security_state_static.json b/net/http/transport_security_state_static.json
index c13b8ca..1f163aa 100644
--- a/net/http/transport_security_state_static.json
+++ b/net/http/transport_security_state_static.json
@@ -213,8 +213,7 @@
{ "name": "glass.google.com", "include_subdomains": true, "mode": "force-https", "pins": "google" },
{ "name": "admin.google.com", "include_subdomains": true, "mode": "force-https", "pins": "google" },
{ "name": "login.corp.google.com", "include_subdomains": true, "mode": "force-https", "pins": "google" },
- // play.google.com doesn't have include_subdomains because of crbug.com/327834.
- { "name": "play.google.com", "mode": "force-https", "pins": "google" },
+ { "name": "play.google.com", "include_subdomains": true, "mode": "force-https", "pins": "google" },
{ "name": "passwords.google.com", "include_subdomains": true, "mode": "force-https", "pins": "google" },
// Other Google-related domains that must use HTTPS.
@@ -1228,6 +1227,302 @@
{ "name": "mqas.net", "include_subdomains": true, "mode": "force-https" },
{ "name": "dlc.viasinc.com", "include_subdomains": true, "mode": "force-https" },
{ "name": "www.viasinc.com", "include_subdomains": true, "mode": "force-https" },
- { "name": "viasinc.com", "mode": "force-https" }
+ { "name": "viasinc.com", "mode": "force-https" },
+ { "name": "angularjs.org", "include_subdomains": true, "mode": "force-https" },
+ { "name": "debtkit.co.uk", "include_subdomains": true, "mode": "force-https" },
+ { "name": "decibelios.li", "include_subdomains": true, "mode": "force-https" },
+ { "name": "diamante.ro", "include_subdomains": true, "mode": "force-https" },
+ { "name": "domaris.de", "include_subdomains": true, "mode": "force-https" },
+ { "name": "enorekcah.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "fedorapeople.org", "include_subdomains": true, "mode": "force-https" },
+ { "name": "gamercredo.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "garron.net", "include_subdomains": true, "mode": "force-https" },
+ { "name": "gerardozamudio.mx", "include_subdomains": true, "mode": "force-https" },
+ { "name": "gmcd.co", "include_subdomains": true, "mode": "force-https" },
+ { "name": "hack.li", "include_subdomains": true, "mode": "force-https" },
+ { "name": "hexony.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "horosho.in", "include_subdomains": true, "mode": "force-https" },
+ { "name": "howsmyssl.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "howsmytls.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "hpac-portal.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "jwilsson.me", "include_subdomains": true, "mode": "force-https" },
+ { "name": "khmath.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "knowledgehook.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "lodash.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "md5file.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "omitech.co.uk", "include_subdomains": true, "mode": "force-https" },
+ { "name": "orbograph-hrcm.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "password.codes", "include_subdomains": true, "mode": "force-https" },
+ { "name": "prakharprasad.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "ravchat.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "sciencex.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "shiinko.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "spideroak.com", "include_subdomains": true, "mode": "force-https" },
+ { "name": "thorncreek.net", "include_subdomains": true, "mode": "force-https" },
+ { "name": "tno.io", "include_subdomains": true, "mode": "force-https" },
+ { "name": "translatoruk.co.uk", "include_subdomains": true, "mode": "force-https" },
+ { "name": "wepay.in.th", "include_subdomains": true, "mode": "force-https" },
+ { "name": "zixiao.wang", "include_subdomains": true, "mode": "force-https" }
+ ],
+
+ // |ReportUMAOnPinFailure| uses these to report which domain was associated
+ // with the public key pinning failure.
+ //
+ // DO NOT CHANGE THE ORDERING OF THESE NAMES OR REMOVE ANY OF THEM. Add new
+ // domains at the END of the array.
+ "domain_ids": [
+ "NOT_PINNED",
+ "GOOGLE_COM",
+ "ANDROID_COM",
+ "GOOGLE_ANALYTICS_COM",
+ "GOOGLEPLEX_COM",
+ "YTIMG_COM",
+ "GOOGLEUSERCONTENT_COM",
+ "YOUTUBE_COM",
+ "GOOGLEAPIS_COM",
+ "GOOGLEADSERVICES_COM",
+ "GOOGLECODE_COM",
+ "APPSPOT_COM",
+ "GOOGLESYNDICATION_COM",
+ "DOUBLECLICK_NET",
+ "GSTATIC_COM",
+ "GMAIL_COM",
+ "GOOGLEMAIL_COM",
+ "GOOGLEGROUPS_COM",
+ "TORPROJECT_ORG",
+ "TWITTER_COM",
+ "TWIMG_COM",
+ "AKAMAIHD_NET",
+ "TOR2WEB_ORG",
+ "YOUTU_BE",
+ "GOOGLECOMMERCE_COM",
+ "URCHIN_COM",
+ "GOO_GL",
+ "G_CO",
+ "GOOGLE_AC",
+ "GOOGLE_AD",
+ "GOOGLE_AE",
+ "GOOGLE_AF",
+ "GOOGLE_AG",
+ "GOOGLE_AM",
+ "GOOGLE_AS",
+ "GOOGLE_AT",
+ "GOOGLE_AZ",
+ "GOOGLE_BA",
+ "GOOGLE_BE",
+ "GOOGLE_BF",
+ "GOOGLE_BG",
+ "GOOGLE_BI",
+ "GOOGLE_BJ",
+ "GOOGLE_BS",
+ "GOOGLE_BY",
+ "GOOGLE_CA",
+ "GOOGLE_CAT",
+ "GOOGLE_CC",
+ "GOOGLE_CD",
+ "GOOGLE_CF",
+ "GOOGLE_CG",
+ "GOOGLE_CH",
+ "GOOGLE_CI",
+ "GOOGLE_CL",
+ "GOOGLE_CM",
+ "GOOGLE_CN",
+ "CO_AO",
+ "CO_BW",
+ "CO_CK",
+ "CO_CR",
+ "CO_HU",
+ "CO_ID",
+ "CO_IL",
+ "CO_IM",
+ "CO_IN",
+ "CO_JE",
+ "CO_JP",
+ "CO_KE",
+ "CO_KR",
+ "CO_LS",
+ "CO_MA",
+ "CO_MZ",
+ "CO_NZ",
+ "CO_TH",
+ "CO_TZ",
+ "CO_UG",
+ "CO_UK",
+ "CO_UZ",
+ "CO_VE",
+ "CO_VI",
+ "CO_ZA",
+ "CO_ZM",
+ "CO_ZW",
+ "COM_AF",
+ "COM_AG",
+ "COM_AI",
+ "COM_AR",
+ "COM_AU",
+ "COM_BD",
+ "COM_BH",
+ "COM_BN",
+ "COM_BO",
+ "COM_BR",
+ "COM_BY",
+ "COM_BZ",
+ "COM_CN",
+ "COM_CO",
+ "COM_CU",
+ "COM_CY",
+ "COM_DO",
+ "COM_EC",
+ "COM_EG",
+ "COM_ET",
+ "COM_FJ",
+ "COM_GE",
+ "COM_GH",
+ "COM_GI",
+ "COM_GR",
+ "COM_GT",
+ "COM_HK",
+ "COM_IQ",
+ "COM_JM",
+ "COM_JO",
+ "COM_KH",
+ "COM_KW",
+ "COM_LB",
+ "COM_LY",
+ "COM_MT",
+ "COM_MX",
+ "COM_MY",
+ "COM_NA",
+ "COM_NF",
+ "COM_NG",
+ "COM_NI",
+ "COM_NP",
+ "COM_NR",
+ "COM_OM",
+ "COM_PA",
+ "COM_PE",
+ "COM_PH",
+ "COM_PK",
+ "COM_PL",
+ "COM_PR",
+ "COM_PY",
+ "COM_QA",
+ "COM_RU",
+ "COM_SA",
+ "COM_SB",
+ "COM_SG",
+ "COM_SL",
+ "COM_SV",
+ "COM_TJ",
+ "COM_TN",
+ "COM_TR",
+ "COM_TW",
+ "COM_UA",
+ "COM_UY",
+ "COM_VC",
+ "COM_VE",
+ "COM_VN",
+ "GOOGLE_CV",
+ "GOOGLE_CZ",
+ "GOOGLE_DE",
+ "GOOGLE_DJ",
+ "GOOGLE_DK",
+ "GOOGLE_DM",
+ "GOOGLE_DZ",
+ "GOOGLE_EE",
+ "GOOGLE_ES",
+ "GOOGLE_FI",
+ "GOOGLE_FM",
+ "GOOGLE_FR",
+ "GOOGLE_GA",
+ "GOOGLE_GE",
+ "GOOGLE_GG",
+ "GOOGLE_GL",
+ "GOOGLE_GM",
+ "GOOGLE_GP",
+ "GOOGLE_GR",
+ "GOOGLE_GY",
+ "GOOGLE_HK",
+ "GOOGLE_HN",
+ "GOOGLE_HR",
+ "GOOGLE_HT",
+ "GOOGLE_HU",
+ "GOOGLE_IE",
+ "GOOGLE_IM",
+ "GOOGLE_INFO",
+ "GOOGLE_IQ",
+ "GOOGLE_IS",
+ "GOOGLE_IT",
+ "IT_AO",
+ "GOOGLE_JE",
+ "GOOGLE_JO",
+ "GOOGLE_JOBS",
+ "GOOGLE_JP",
+ "GOOGLE_KG",
+ "GOOGLE_KI",
+ "GOOGLE_KZ",
+ "GOOGLE_LA",
+ "GOOGLE_LI",
+ "GOOGLE_LK",
+ "GOOGLE_LT",
+ "GOOGLE_LU",
+ "GOOGLE_LV",
+ "GOOGLE_MD",
+ "GOOGLE_ME",
+ "GOOGLE_MG",
+ "GOOGLE_MK",
+ "GOOGLE_ML",
+ "GOOGLE_MN",
+ "GOOGLE_MS",
+ "GOOGLE_MU",
+ "GOOGLE_MV",
+ "GOOGLE_MW",
+ "GOOGLE_NE",
+ "NE_JP",
+ "GOOGLE_NET",
+ "GOOGLE_NL",
+ "GOOGLE_NO",
+ "GOOGLE_NR",
+ "GOOGLE_NU",
+ "OFF_AI",
+ "GOOGLE_PK",
+ "GOOGLE_PL",
+ "GOOGLE_PN",
+ "GOOGLE_PS",
+ "GOOGLE_PT",
+ "GOOGLE_RO",
+ "GOOGLE_RS",
+ "GOOGLE_RU",
+ "GOOGLE_RW",
+ "GOOGLE_SC",
+ "GOOGLE_SE",
+ "GOOGLE_SH",
+ "GOOGLE_SI",
+ "GOOGLE_SK",
+ "GOOGLE_SM",
+ "GOOGLE_SN",
+ "GOOGLE_SO",
+ "GOOGLE_ST",
+ "GOOGLE_TD",
+ "GOOGLE_TG",
+ "GOOGLE_TK",
+ "GOOGLE_TL",
+ "GOOGLE_TM",
+ "GOOGLE_TN",
+ "GOOGLE_TO",
+ "GOOGLE_TP",
+ "GOOGLE_TT",
+ "GOOGLE_US",
+ "GOOGLE_UZ",
+ "GOOGLE_VG",
+ "GOOGLE_VU",
+ "GOOGLE_WS",
+ "CHROMIUM_ORG",
+ "CRYPTO_CAT",
+ "LAVABIT_COM",
+ "GOOGLETAGMANAGER_COM",
+ "GOOGLETAGSERVICES_COM",
+ "DROPBOX_COM",
+ "YOUTUBE_NOCOOKIE_COM",
+ "2MDN_NET"
]
}
diff --git a/net/net.gypi b/net/net.gypi
index 35ec25e..8ed69df 100644
--- a/net/net.gypi
+++ b/net/net.gypi
@@ -1274,6 +1274,7 @@
'base/net_log_unittest.h',
'base/net_util_unittest.cc',
'base/net_util_icu_unittest.cc',
+ 'base/network_change_notifier_unittest.cc',
'base/network_change_notifier_win_unittest.cc',
'base/prioritized_dispatcher_unittest.cc',
'base/priority_queue_unittest.cc',
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 9b0b731..47a4dc2 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -557,15 +557,15 @@
int init_net_error,
ProxyResolverScriptData* init_script_data,
NetLog* net_log)
- : weak_factory_(this),
- change_callback_(callback),
+ : change_callback_(callback),
config_(config),
proxy_resolver_expects_pac_bytes_(proxy_resolver_expects_pac_bytes),
proxy_script_fetcher_(proxy_script_fetcher),
dhcp_proxy_script_fetcher_(dhcp_proxy_script_fetcher),
last_error_(init_net_error),
last_script_data_(init_script_data),
- last_poll_time_(TimeTicks::Now()) {
+ last_poll_time_(TimeTicks::Now()),
+ weak_factory_(this) {
// Set the initial poll delay.
next_poll_mode_ = poll_policy()->GetNextDelay(
last_error_, TimeDelta::FromSeconds(-1), &next_poll_delay_);
@@ -694,8 +694,6 @@
change_callback_.Run(result, script_data.get(), effective_config);
}
- base::WeakPtrFactory<ProxyScriptDeciderPoller> weak_factory_;
-
ChangeCallback change_callback_;
ProxyConfig config_;
bool proxy_resolver_expects_pac_bytes_;
@@ -719,6 +717,8 @@
bool quick_check_enabled_;
+ base::WeakPtrFactory<ProxyScriptDeciderPoller> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ProxyScriptDeciderPoller);
};
diff --git a/net/quic/crypto/crypto_utils.cc b/net/quic/crypto/crypto_utils.cc
index 7e0ab75..67af2e9 100644
--- a/net/quic/crypto/crypto_utils.cc
+++ b/net/quic/crypto/crypto_utils.cc
@@ -55,7 +55,7 @@
url::CanonHostInfo host_info;
string canonicalized_host(CanonicalizeHost(sni.as_string(), &host_info));
return !host_info.IsIPAddress() &&
- IsCanonicalizedHostCompliant(canonicalized_host, std::string()) &&
+ IsCanonicalizedHostCompliant(canonicalized_host) &&
sni.find_last_of('.') != string::npos;
}
diff --git a/net/test/net_test_suite.cc b/net/test/net_test_suite.cc
index 2d13877..175cec2 100644
--- a/net/test/net_test_suite.cc
+++ b/net/test/net_test_suite.cc
@@ -1,67 +1,67 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/test/net_test_suite.h"
-
-#include "base/message_loop/message_loop.h"
-#include "net/base/network_change_notifier.h"
-#include "net/http/http_stream_factory.h"
-#include "net/spdy/spdy_session.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if defined(USE_NSS) || defined(OS_IOS)
-#include "net/ocsp/nss_ocsp.h"
-#endif
-
-class StaticReset : public ::testing::EmptyTestEventListener {
- virtual void OnTestStart(const ::testing::TestInfo& test_info) OVERRIDE {
- net::HttpStreamFactory::ResetStaticSettingsToInit();
- }
-};
-
-NetTestSuite::NetTestSuite(int argc, char** argv)
- : TestSuite(argc, argv) {
-}
-
-NetTestSuite::NetTestSuite(int argc, char** argv,
- bool create_at_exit_manager)
- : TestSuite(argc, argv, create_at_exit_manager) {
-}
-
-NetTestSuite::~NetTestSuite() {}
-
-void NetTestSuite::Initialize() {
- TestSuite::Initialize();
- ::testing::UnitTest::GetInstance()->listeners().Append(new StaticReset());
- InitializeTestThread();
-}
-
-void NetTestSuite::Shutdown() {
-#if defined(USE_NSS) || defined(OS_IOS)
- net::ShutdownNSSHttpIO();
-#endif
-
- // We want to destroy this here before the TestSuite continues to tear down
- // the environment.
- message_loop_.reset();
-
- TestSuite::Shutdown();
-}
-
-void NetTestSuite::InitializeTestThread() {
- network_change_notifier_.reset(net::NetworkChangeNotifier::CreateMock());
-
- InitializeTestThreadNoNetworkChangeNotifier();
-}
-
-void NetTestSuite::InitializeTestThreadNoNetworkChangeNotifier() {
- host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL);
- scoped_host_resolver_proc_.Init(host_resolver_proc_.get());
- // In case any attempts are made to resolve host names, force them all to
- // be mapped to localhost. This prevents DNS queries from being sent in
- // the process of running these unit tests.
- host_resolver_proc_->AddRule("*", "127.0.0.1");
-
- message_loop_.reset(new base::MessageLoopForIO());
-}
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/test/net_test_suite.h"
+
+#include "base/message_loop/message_loop.h"
+#include "net/base/network_change_notifier.h"
+#include "net/http/http_stream_factory.h"
+#include "net/spdy/spdy_session.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if defined(USE_NSS) || defined(OS_IOS)
+#include "net/ocsp/nss_ocsp.h"
+#endif
+
+class StaticReset : public ::testing::EmptyTestEventListener {
+ virtual void OnTestStart(const ::testing::TestInfo& test_info) OVERRIDE {
+ net::HttpStreamFactory::ResetStaticSettingsToInit();
+ }
+};
+
+NetTestSuite::NetTestSuite(int argc, char** argv)
+ : TestSuite(argc, argv) {
+}
+
+NetTestSuite::NetTestSuite(int argc, char** argv,
+ bool create_at_exit_manager)
+ : TestSuite(argc, argv, create_at_exit_manager) {
+}
+
+NetTestSuite::~NetTestSuite() {}
+
+void NetTestSuite::Initialize() {
+ TestSuite::Initialize();
+ ::testing::UnitTest::GetInstance()->listeners().Append(new StaticReset());
+ InitializeTestThread();
+}
+
+void NetTestSuite::Shutdown() {
+#if defined(USE_NSS) || defined(OS_IOS)
+ net::ShutdownNSSHttpIO();
+#endif
+
+ // We want to destroy this here before the TestSuite continues to tear down
+ // the environment.
+ message_loop_.reset();
+
+ TestSuite::Shutdown();
+}
+
+void NetTestSuite::InitializeTestThread() {
+ network_change_notifier_.reset(net::NetworkChangeNotifier::CreateMock());
+
+ InitializeTestThreadNoNetworkChangeNotifier();
+}
+
+void NetTestSuite::InitializeTestThreadNoNetworkChangeNotifier() {
+ host_resolver_proc_ = new net::RuleBasedHostResolverProc(NULL);
+ scoped_host_resolver_proc_.Init(host_resolver_proc_.get());
+ // In case any attempts are made to resolve host names, force them all to
+ // be mapped to localhost. This prevents DNS queries from being sent in
+ // the process of running these unit tests.
+ host_resolver_proc_->AddRule("*", "127.0.0.1");
+
+ message_loop_.reset(new base::MessageLoopForIO());
+}
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py
index 7739902..4294414 100755
--- a/net/tools/testserver/testserver.py
+++ b/net/tools/testserver/testserver.py
@@ -1536,9 +1536,8 @@
self.send_header('Content-Type', 'text/plain')
self.end_headers()
- for cipher_suite in self.server.tlsConnection.clientHello.cipher_suites:
- self.wfile.write(str(cipher_suite))
- self.wfile.write('\n')
+ cipher_suites = self.server.tlsConnection.clientHello.cipher_suites
+ self.wfile.write('\n'.join(str(c) for c in cipher_suites))
return True
def CloseSocketHandler(self):
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 11c8f57..dbf858d 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -7033,8 +7033,7 @@
// Test that ECDSA is disabled on Windows XP, where ECDSA certificates cannot be
// verified.
-// Test seems flaky, see http://crbug.com/411827.
-TEST_F(HTTPSRequestTest, DISABLED_DisableECDSAOnXP) {
+TEST_F(HTTPSRequestTest, DisableECDSAOnXP) {
if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
LOG(INFO) << "Skipping test on this version.";
return;
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json
index 0dcc605..e6fe443 100644
--- a/testing/buildbot/chromium.mac.json
+++ b/testing/buildbot/chromium.mac.json
@@ -3,21 +3,48 @@
"gtest_tests": [
"accessibility_unittests",
"app_list_unittests",
- "base_unittests",
+ {
+ "test": "base_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "browser_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 5
+ }
+ },
"cacheinvalidation_unittests",
"cast_unittests",
"cc_unittests",
"chromedriver_unittests",
"components_unittests",
- "content_browsertests",
- "content_unittests",
+ {
+ "test": "content_browsertests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "content_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"crypto_unittests",
"extensions_unittests",
"gcm_unit_tests",
"gfx_unittests",
"gpu_unittests",
"google_apis_unittests",
- "interactive_ui_tests",
+ {
+ "test": "interactive_ui_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ipc_tests",
"jingle_unittests",
"media_unittests",
@@ -32,22 +59,36 @@
"mojo_application_manager_unittests",
"mojo_shell_tests",
"mojo_system_unittests",
- "net_unittests",
+ {
+ "test": "net_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
"sandbox_mac_unittests",
"sql_unittests",
- "sync_integration_tests",
+ {
+ "test": "sync_integration_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"sync_unit_tests",
"ui_unittests",
- "unit_tests",
+ {
+ "test": "unit_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"url_unittests"
]
},
"Mac10.6 Tests (2)": {
"gtest_tests": [
- "browser_tests"
]
},
"Mac10.7 Tests (1)": {
@@ -146,21 +187,48 @@
"gtest_tests": [
"accessibility_unittests",
"app_list_unittests",
- "base_unittests",
+ {
+ "test": "base_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "browser_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true,
+ "shards": 10
+ }
+ },
"cacheinvalidation_unittests",
"cast_unittests",
"cc_unittests",
"chromedriver_unittests",
"components_unittests",
- "content_browsertests",
- "content_unittests",
+ {
+ "test": "content_browsertests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
+ {
+ "test": "content_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"crypto_unittests",
"extensions_unittests",
"gcm_unit_tests",
"gfx_unittests",
"gpu_unittests",
"google_apis_unittests",
- "interactive_ui_tests",
+ {
+ "test": "interactive_ui_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ipc_tests",
"jingle_unittests",
"media_unittests",
@@ -175,22 +243,36 @@
"mojo_application_manager_unittests",
"mojo_shell_tests",
"mojo_system_unittests",
- "net_unittests",
+ {
+ "test": "net_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"ppapi_unittests",
"printing_unittests",
"remoting_unittests",
"sandbox_mac_unittests",
"sql_unittests",
- "sync_integration_tests",
+ {
+ "test": "sync_integration_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"sync_unit_tests",
"ui_unittests",
- "unit_tests",
+ {
+ "test": "unit_tests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"url_unittests"
]
},
"Mac 10.6 Tests (dbg)(2)": {
"gtest_tests": [
- "browser_tests"
]
},
"Mac 10.7 Tests (dbg)(1)": {
diff --git a/testing/buildbot/chromium.memory.fyi.json b/testing/buildbot/chromium.memory.fyi.json
index 1108732..4daaf0e 100644
--- a/testing/buildbot/chromium.memory.fyi.json
+++ b/testing/buildbot/chromium.memory.fyi.json
@@ -2,20 +2,41 @@
"Linux MSan Tests": {
"gtest_tests": [
"accessibility_unittests",
+ "app_list_unittests",
"app_shell_browsertests",
+ "aura_unittests",
"base_unittests",
"cacheinvalidation_unittests",
+ "cast_unittests",
"cc_unittests",
+ "chromedriver_unittests",
"content_browsertests",
"content_unittests",
"crypto_unittests",
"device_unittests",
+ "display_unittests",
+ "events_unittests",
"extensions_unittests",
+ "gcm_unit_tests",
+ "gfx_unittests",
+ "google_apis_unittests",
"gpu_unittests",
"interactive_ui_tests",
+ "ipc_mojo_unittests",
"ipc_tests",
"jingle_unittests",
"media_unittests",
+ "mojo_application_manager_unittests",
+ "mojo_apps_js_unittests",
+ "mojo_common_unittests",
+ "mojo_js_unittests",
+ "mojo_public_bindings_unittests",
+ "mojo_public_environment_unittests",
+ "mojo_public_system_unittests",
+ "mojo_public_utility_unittests",
+ "mojo_shell_tests",
+ "mojo_system_unittests",
+ "nacl_loader_unittests",
"net_unittests",
"ppapi_unittests",
"printing_unittests",
@@ -25,7 +46,8 @@
"sync_unit_tests",
"ui_unittests",
"unit_tests",
- "url_unittests"
+ "url_unittests",
+ "wm_unittests"
]
},
"Linux MSan Browser (1)": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json
index f26c47a..3af9ba2 100644
--- a/testing/buildbot/chromium.memory.json
+++ b/testing/buildbot/chromium.memory.json
@@ -35,6 +35,7 @@
"crypto_unittests",
"device_unittests",
"display_unittests",
+ "extensions_unittests",
"gcm_unit_tests",
"gfx_unittests",
"google_apis_unittests",
@@ -223,7 +224,7 @@
"nacl_loader_unittests",
"sandbox_linux_unittests",
"sql_unittests",
- "sync_unittests",
+ "sync_unit_tests",
"ui_unittests",
"unit_tests",
{"test": "browser_tests", "shard_index": 2, "total_shards": 3}
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json
index 0f02193..044cb1d 100644
--- a/testing/buildbot/chromium.win.json
+++ b/testing/buildbot/chromium.win.json
@@ -9,7 +9,12 @@
}
},
"app_shell_unittests",
- "ash_unittests",
+ {
+ "test": "ash_unittests",
+ "swarming": {
+ "can_use_on_swarming_builders": true
+ }
+ },
"aura_unittests",
{
"test": "browser_tests",
diff --git a/testing/buildbot/chromium_memory_trybot.json b/testing/buildbot/chromium_memory_trybot.json
index 554cbbb..161071d 100644
--- a/testing/buildbot/chromium_memory_trybot.json
+++ b/testing/buildbot/chromium_memory_trybot.json
@@ -35,6 +35,7 @@
"test": "display_unittests",
"platforms": ["linux"]
},
+ "extensions_unittests",
"gcm_unit_tests",
"gfx_unittests",
"google_apis_unittests",
diff --git a/testing/buildbot/trybot_analyze_config.json b/testing/buildbot/trybot_analyze_config.json
index 9074b98..4d12f02 100644
--- a/testing/buildbot/trybot_analyze_config.json
+++ b/testing/buildbot/trybot_analyze_config.json
@@ -1,7 +1,7 @@
{
"base": {
"exclusions": [
- ".\\.isolate",
+ ".*isolate",
"build/.*gyp[i]?",
"build/android/pylib/.*",
"build/compiler_version.py",
diff --git a/third_party/modp_b64/OWNERS b/third_party/modp_b64/OWNERS
index fcfec1d..0144bac 100644
--- a/third_party/modp_b64/OWNERS
+++ b/third_party/modp_b64/OWNERS
@@ -1,2 +1,2 @@
-jschuh@chromium.org
-rsleevi@chromium.org
+jschuh@chromium.org
+rsleevi@chromium.org
diff --git a/third_party/zlib/google/zip_reader.cc b/third_party/zlib/google/zip_reader.cc
index 80b60b3..339eb11 100644
--- a/third_party/zlib/google/zip_reader.cc
+++ b/third_party/zlib/google/zip_reader.cc
@@ -331,8 +331,7 @@
break;
} else if (num_bytes_read > 0) {
// Some data is read. Write it to the output file descriptor.
- if (num_bytes_read !=
- base::WriteFileDescriptor(fd, buf, num_bytes_read)) {
+ if (!base::WriteFileDescriptor(fd, buf, num_bytes_read)) {
success = false;
break;
}
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 8ae4dea..5ee7c30 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -153,6 +153,18 @@
return vs_version
+def SubversionCmakeArg():
+ # Since cmake's find_program can only find .exe and .com,
+ # svn.bat in depot_tools will be ignored.
+ default_pathext = ('.com', '.exe', '.bat', '.cmd')
+ for path in os.environ.get('PATH', '').split(os.pathsep):
+ for ext in default_pathext:
+ candidate = os.path.join(path, 'svn' + ext)
+ if os.path.isfile(candidate):
+ return '-DSubversion_SVN_EXECUTABLE=%s' % candidate
+ return ''
+
+
def UpdateClang():
print 'Updating Clang to %s...' % (LLVM_WIN_REVISION)
if LLVM_WIN_REVISION != 'HEAD' and ReadStampFile() == LLVM_WIN_REVISION:
@@ -175,7 +187,7 @@
RunCommand(GetVSVersion().SetupScript('x64') +
['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release',
- '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR])
+ '-DLLVM_ENABLE_ASSERTIONS=ON', SubversionCmakeArg(), LLVM_DIR])
RunCommand(GetVSVersion().SetupScript('x64') + ['&&', 'ninja', 'all'])
# Do an x86 build of compiler-rt to get the 32-bit ASan run-time.
diff --git a/tools/valgrind/gtest_exclude/blink_heap_unittests.gtest-drmemory_win32.txt b/tools/valgrind/gtest_exclude/blink_heap_unittests.gtest-drmemory_win32.txt
index a9376e5..1a858a9 100644
--- a/tools/valgrind/gtest_exclude/blink_heap_unittests.gtest-drmemory_win32.txt
+++ b/tools/valgrind/gtest_exclude/blink_heap_unittests.gtest-drmemory_win32.txt
@@ -1,2 +1,5 @@
# crbug.com/396172: flaky under Dr. Memory
HeapTest.ThreadedWeakness
+
+# crbug.com/420699: Crash under Dr. Memory
+HeapTest.CheckAndMarkPointer
diff --git a/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt b/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt
index 9feec33..c9a1bd5 100644
--- a/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt
+++ b/tools/valgrind/gtest_exclude/content_browsertests.gtest-drmemory.txt
@@ -9,3 +9,8 @@
# crbug.com/419396
WebRtcBrowserTest.CallWithDataAndMedia
+
+# crbug.com/420827
+ServiceWorkerVersionBrowserTest.Activate_NoEventListener
+ServiceWorkerBrowserTest.ImportsBustMemcache
+
diff --git a/tools/valgrind/memcheck/suppressions_mac.txt b/tools/valgrind/memcheck/suppressions_mac.txt
index 66885a4..fe8f8a1 100644
--- a/tools/valgrind/memcheck/suppressions_mac.txt
+++ b/tools/valgrind/memcheck/suppressions_mac.txt
@@ -232,9 +232,5 @@
fun:_ZNSt3mapIPKN15tracked_objects6BirthsENS0_9DeathDataESt4lessIS3_ESaISt4pairIKS3_S4_EEEixERS8_
fun:_ZN15tracked_objects10ThreadData11TallyADeathERKNS_6BirthsEiRKNS_13TaskStopwatchE
fun:_ZN15tracked_objects10ThreadData31TallyRunOnNamedThreadIfTrackingERKN4base12TrackingInfoERKNS_13TaskStopwatchE
- fun:_ZN4base5debug13TaskAnnotator7RunTaskEPKcS3_RKNS_11PendingTaskE
- fun:_ZN4base11MessageLoop7RunTaskERKNS_11PendingTaskE
- fun:_ZN4base11MessageLoop21DeferOrRunPendingTaskERKNS_11PendingTaskE
- fun:_ZN4base11MessageLoop6DoWorkEv
}
diff --git a/ui/README.chromium b/ui/README.chromium
index 1824944..b134653 100644
--- a/ui/README.chromium
+++ b/ui/README.chromium
@@ -1,6 +1,6 @@
-This directory contains discrete components used to build Chromium's user
-interface.
-
-Each subdirectory must be an isolated component that lists its dependencies in
-a DEPS file. See subdirectory README.chromium files for specific information
-about each component.
+This directory contains discrete components used to build Chromium's user
+interface.
+
+Each subdirectory must be an isolated component that lists its dependencies in
+a DEPS file. See subdirectory README.chromium files for specific information
+about each component.
diff --git a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java b/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
index d9faa0f..8b54452 100644
--- a/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
+++ b/ui/android/java/src/org/chromium/ui/DropdownPopupWindow.java
@@ -6,6 +6,7 @@
import android.content.Context;
import android.graphics.Rect;
+import android.util.Log;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.View.OnLayoutChangeListener;
@@ -15,8 +16,11 @@
import android.widget.ListPopupWindow;
import android.widget.PopupWindow;
+import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.ui.base.ViewAndroidDelegate;
+import java.lang.reflect.Method;
+
/**
* The dropdown list popup window.
*/
@@ -29,6 +33,7 @@
private float mAnchorHeight;
private float mAnchorX;
private float mAnchorY;
+ private boolean mRtl;
private OnLayoutChangeListener mLayoutChangeListener;
private PopupWindow.OnDismissListener mOnDismissListener;
ListAdapter mAdapter;
@@ -117,6 +122,22 @@
mAnchorHeight);
super.show();
getListView().setDividerHeight(0);
+ ApiCompatibilityUtils.setLayoutDirection(getListView(),
+ mRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
+
+ // HACK: The ListPopupWindow's mPopup automatically dismisses on an outside tap. There's
+ // no way to override it or prevent it, except reaching into ListPopupWindow's hidden
+ // API. This allows the C++ controller to completely control showing/hiding the popup.
+ // See http://crbug.com/400601
+ try {
+ Method setForceIgnoreOutsideTouch = ListPopupWindow.class.getMethod(
+ "setForceIgnoreOutsideTouch", new Class[] { boolean.class });
+ setForceIgnoreOutsideTouch.invoke(this, new Object[] { true });
+ } catch (Exception e) {
+ Log.e("AutofillPopup",
+ "ListPopupWindow.setForceIgnoreOutsideTouch not found",
+ e);
+ }
}
@Override
@@ -125,6 +146,14 @@
}
/**
+ * Sets the text direction in the dropdown. Should be called before show().
+ * @param isRtl If true, then dropdown text direciton is right to left.
+ */
+ protected void setRtl(boolean isRtl) {
+ mRtl = isRtl;
+ }
+
+ /**
* Measures the width of the list content.
* @return The popup window width in pixels.
*/
diff --git a/ui/android/java/src/org/chromium/ui/VSyncMonitor.java b/ui/android/java/src/org/chromium/ui/VSyncMonitor.java
index af8f87b..e717851 100644
--- a/ui/android/java/src/org/chromium/ui/VSyncMonitor.java
+++ b/ui/android/java/src/org/chromium/ui/VSyncMonitor.java
@@ -26,6 +26,10 @@
private boolean mInsideVSync = false;
+ // Conservative guess about vsync's consecutivity.
+ // If true, next tick is guaranteed to be consecutive.
+ private boolean mConsecutiveVSync = false;
+
/**
* VSync listener class
*/
@@ -41,7 +45,7 @@
private Listener mListener;
// Display refresh rate as reported by the system.
- private final long mRefreshPeriodNano;
+ private long mRefreshPeriodNano;
private boolean mHaveRequestInFlight;
@@ -79,6 +83,8 @@
mListener = listener;
float refreshRate = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay().getRefreshRate();
+ final boolean useEstimatedRefreshPeriod = refreshRate < 30;
+
if (refreshRate <= 0) refreshRate = 60;
mRefreshPeriodNano = (long) (NANOSECONDS_PER_SECOND / refreshRate);
@@ -89,6 +95,15 @@
@Override
public void doFrame(long frameTimeNanos) {
TraceEvent.begin("VSync");
+ if (useEstimatedRefreshPeriod && mConsecutiveVSync) {
+ // Display.getRefreshRate() is unreliable on some platforms.
+ // Adjust refresh period- initial value is based on Display.getRefreshRate()
+ // after that it asymptotically approaches the real value.
+ long lastRefreshDurationNano = frameTimeNanos - mGoodStartingPointNano;
+ float lastRefreshDurationWeight = 0.1f;
+ mRefreshPeriodNano += (long) (lastRefreshDurationWeight *
+ (lastRefreshDurationNano - mRefreshPeriodNano));
+ }
mGoodStartingPointNano = frameTimeNanos;
onVSyncCallback(frameTimeNanos, getCurrentNanoTime());
TraceEvent.end("VSync");
@@ -186,6 +201,7 @@
mHaveRequestInFlight = true;
if (postSyntheticVSync()) return;
if (isVSyncSignalAvailable()) {
+ mConsecutiveVSync = mInsideVSync;
mChoreographer.postFrameCallback(mVSyncFrameCallback);
} else {
postRunnableCallback();
diff --git a/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java b/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
index 2433426..7b9f3fb 100644
--- a/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
+++ b/ui/android/java/src/org/chromium/ui/autofill/AutofillPopup.java
@@ -6,19 +6,15 @@
import android.annotation.SuppressLint;
import android.content.Context;
-import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
-import android.widget.ListPopupWindow;
import android.widget.PopupWindow;
-import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.ui.DropdownAdapter;
import org.chromium.ui.DropdownItem;
import org.chromium.ui.DropdownPopupWindow;
import org.chromium.ui.base.ViewAndroidDelegate;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
@@ -93,23 +89,8 @@
}
setAdapter(new DropdownAdapter(mContext, cleanedData, separators));
+ setRtl(isRtl);
show();
- ApiCompatibilityUtils.setLayoutDirection(getListView(),
- isRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
-
- // HACK: The ListPopupWindow's mPopup automatically dismisses on an outside tap. There's
- // no way to override it or prevent it, except reaching into ListPopupWindow's hidden
- // API. This allows the C++ controller to completely control showing/hiding the popup.
- // See http://crbug.com/400601
- try {
- Method setForceIgnoreOutsideTouch = ListPopupWindow.class.getMethod(
- "setForceIgnoreOutsideTouch", new Class[] { boolean.class });
- setForceIgnoreOutsideTouch.invoke(this, new Object[] { true });
- } catch (Exception e) {
- Log.e("AutofillPopup",
- "ListPopupWindow.setForceIgnoreOutsideTouch not found",
- e);
- }
}
/**
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
index 6d3f3a6..71d3f7e 100644
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -51,7 +51,9 @@
@Override
public void onVSync(VSyncMonitor monitor, long vsyncTimeMicros) {
if (mNativeWindowAndroid != 0) {
- nativeOnVSync(mNativeWindowAndroid, vsyncTimeMicros);
+ nativeOnVSync(mNativeWindowAndroid,
+ vsyncTimeMicros,
+ mVSyncMonitor.getVSyncPeriodInMicroseconds());
}
}
};
@@ -282,13 +284,15 @@
*/
public long getNativePointer() {
if (mNativeWindowAndroid == 0) {
- mNativeWindowAndroid = nativeInit(mVSyncMonitor.getVSyncPeriodInMicroseconds());
+ mNativeWindowAndroid = nativeInit();
}
return mNativeWindowAndroid;
}
- private native long nativeInit(long vsyncPeriod);
- private native void nativeOnVSync(long nativeWindowAndroid, long vsyncTimeMicros);
+ private native long nativeInit();
+ private native void nativeOnVSync(long nativeWindowAndroid,
+ long vsyncTimeMicros,
+ long vsyncPeriodMicros);
private native void nativeDestroy(long nativeWindowAndroid);
}
diff --git a/ui/app_list/BUILD.gn b/ui/app_list/BUILD.gn
index 4f97f80..aefca57 100644
--- a/ui/app_list/BUILD.gn
+++ b/ui/app_list/BUILD.gn
@@ -38,6 +38,17 @@
"search_provider.h",
"search_result.cc",
"search_result.h",
+ "search/dictionary_data_store.cc",
+ "search/dictionary_data_store.h",
+ "search/history.cc",
+ "search/history.h",
+ "search/history_data.cc",
+ "search/history_data.h",
+ "search/history_data_store.cc",
+ "search/history_data_store.h",
+ "search/history_types.h",
+ "search/mixer.cc",
+ "search/mixer.h",
"search/term_break_iterator.cc",
"search/term_break_iterator.h",
"search/tokenized_string.cc",
@@ -57,6 +68,7 @@
"//base",
"//base:i18n",
"//base/third_party/dynamic_annotations",
+ "//components/keyed_service/core",
"//skia",
"//sync",
"//third_party/icu",
@@ -198,6 +210,8 @@
"app_list_item_list_unittest.cc",
"app_list_model_unittest.cc",
"pagination_model_unittest.cc",
+ "search/history_data_store_unittest.cc",
+ "search/mixer_unittest.cc",
"search/term_break_iterator_unittest.cc",
"search/tokenized_string_char_iterator_unittest.cc",
"search/tokenized_string_match_unittest.cc",
diff --git a/ui/app_list/DEPS b/ui/app_list/DEPS
index 1ee82ca..184859b 100644
--- a/ui/app_list/DEPS
+++ b/ui/app_list/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+components/keyed_service/core",
"+skia",
"+sync",
"+third_party/google_toolbox_for_mac/src",
diff --git a/ui/app_list/app_list.gyp b/ui/app_list/app_list.gyp
index c15be36..3f10aec 100644
--- a/ui/app_list/app_list.gyp
+++ b/ui/app_list/app_list.gyp
@@ -15,6 +15,7 @@
'../../base/base.gyp:base',
'../../base/base.gyp:base_i18n',
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
+ '../../components/components.gyp:keyed_service_core',
'../../skia/skia.gyp:skia',
'../base/ui_base.gyp:ui_base',
'../compositor/compositor.gyp:compositor',
@@ -85,6 +86,17 @@
'search_provider.h',
'search_result.cc',
'search_result.h',
+ 'search/dictionary_data_store.cc',
+ 'search/dictionary_data_store.h',
+ 'search/history.cc',
+ 'search/history.h',
+ 'search/history_data.cc',
+ 'search/history_data.h',
+ 'search/history_data_store.cc',
+ 'search/history_data_store.h',
+ 'search/history_types.h',
+ 'search/mixer.cc',
+ 'search/mixer.h',
'search/term_break_iterator.cc',
'search/term_break_iterator.h',
'search/tokenized_string.cc',
@@ -236,6 +248,8 @@
'cocoa/apps_search_results_controller_unittest.mm',
'cocoa/test/apps_grid_controller_test_helper.h',
'cocoa/test/apps_grid_controller_test_helper.mm',
+ 'search/history_data_store_unittest.cc',
+ 'search/mixer_unittest.cc',
'search/term_break_iterator_unittest.cc',
'search/tokenized_string_char_iterator_unittest.cc',
'search/tokenized_string_match_unittest.cc',
diff --git a/ui/app_list/app_list_constants.cc b/ui/app_list/app_list_constants.cc
index b917954..0ce093a 100644
--- a/ui/app_list/app_list_constants.cc
+++ b/ui/app_list/app_list_constants.cc
@@ -8,8 +8,8 @@
const SkColor kContentsBackgroundColor = SkColorSetRGB(0xFA, 0xFA, 0xFA);
const SkColor kSearchBoxBackground = SK_ColorWHITE;
-const SkColor kTopSeparatorColor = SkColorSetARGB(0x40, 0x00, 0x00, 0x00);
-const SkColor kBottomSeparatorColor = SkColorSetARGB(0x40, 0x00, 0x00, 0x00);
+const SkColor kTopSeparatorColor = SkColorSetRGB(0xC0, 0xC0, 0xC0);
+const SkColor kBottomSeparatorColor = SkColorSetRGB(0xC0, 0xC0, 0xC0);
// The color of the separator used inside dialogs in the app list.
const SkColor kDialogSeparatorColor = SkColorSetRGB(0xD1, 0xD1, 0xD1);
diff --git a/ui/app_list/app_list_item.cc b/ui/app_list/app_list_item.cc
index a87d27d..0cac35a 100644
--- a/ui/app_list/app_list_item.cc
+++ b/ui/app_list/app_list_item.cc
@@ -27,16 +27,6 @@
FOR_EACH_OBSERVER(AppListItemObserver, observers_, ItemIconChanged());
}
-void AppListItem::SetHighlighted(bool highlighted) {
- if (highlighted_ == highlighted)
- return;
-
- highlighted_ = highlighted;
- FOR_EACH_OBSERVER(AppListItemObserver,
- observers_,
- ItemHighlightedChanged());
-}
-
void AppListItem::SetIsInstalling(bool is_installing) {
if (is_installing_ == is_installing)
return;
diff --git a/ui/app_list/app_list_item.h b/ui/app_list/app_list_item.h
index dd92b95..ab5632f 100644
--- a/ui/app_list/app_list_item.h
+++ b/ui/app_list/app_list_item.h
@@ -45,7 +45,7 @@
// Should only be used in tests; otheriwse use GetDisplayName().
const std::string& short_name() const { return short_name_; }
- void SetHighlighted(bool highlighted);
+ void set_highlighted(bool highlighted) { highlighted_ = highlighted; }
bool highlighted() const { return highlighted_; }
void SetIsInstalling(bool is_installing);
diff --git a/ui/app_list/app_list_item_list.cc b/ui/app_list/app_list_item_list.cc
index e7c9350..82a17c0 100644
--- a/ui/app_list/app_list_item_list.cc
+++ b/ui/app_list/app_list_item_list.cc
@@ -124,6 +124,28 @@
OnListItemMoved(from_index, to_index, item));
}
+void AppListItemList::HighlightItemInstalledFromUI(const std::string& id) {
+ // Items within folders are not highlighted (apps are never installed to a
+ // folder initially). So just search the top-level list.
+ size_t index;
+ if (FindItemIndex(highlighted_id_, &index)) {
+ item_at(index)->set_highlighted(false);
+ FOR_EACH_OBSERVER(AppListItemListObserver,
+ observers_,
+ OnAppListItemHighlight(index, false));
+ }
+ highlighted_id_ = id;
+ if (!FindItemIndex(highlighted_id_, &index)) {
+ // If the item isin't in the app list yet, it will be highlighted later, in
+ // AddItem().
+ return;
+ }
+
+ item_at(index)->set_highlighted(true);
+ FOR_EACH_OBSERVER(
+ AppListItemListObserver, observers_, OnAppListItemHighlight(index, true));
+}
+
// AppListItemList private
syncer::StringOrdinal AppListItemList::CreatePositionBefore(
@@ -159,6 +181,14 @@
FOR_EACH_OBSERVER(AppListItemListObserver,
observers_,
OnListItemAdded(index, item));
+
+ if (item->id() == highlighted_id_) {
+ // Item not present when highlight requested, so highlight it now.
+ item->set_highlighted(true);
+ FOR_EACH_OBSERVER(AppListItemListObserver,
+ observers_,
+ OnAppListItemHighlight(index, true));
+ }
return item;
}
diff --git a/ui/app_list/app_list_item_list.h b/ui/app_list/app_list_item_list.h
index 2e67f1c..c4ad1d5 100644
--- a/ui/app_list/app_list_item_list.h
+++ b/ui/app_list/app_list_item_list.h
@@ -48,6 +48,10 @@
// invalid, move the item to the end of the list.
void SetItemPosition(AppListItem* item, syncer::StringOrdinal new_position);
+ // Highlights the given item in the app list. If not present and it is later
+ // added, the item will be highlighted after being added.
+ void HighlightItemInstalledFromUI(const std::string& id);
+
AppListItem* item_at(size_t index) {
DCHECK_LT(index, app_list_items_.size());
return app_list_items_[index];
@@ -103,6 +107,7 @@
ScopedVector<AppListItem> app_list_items_;
ObserverList<AppListItemListObserver, true> observers_;
+ std::string highlighted_id_;
DISALLOW_COPY_AND_ASSIGN(AppListItemList);
};
diff --git a/ui/app_list/app_list_item_list_observer.h b/ui/app_list/app_list_item_list_observer.h
index 640be28..32344ea 100644
--- a/ui/app_list/app_list_item_list_observer.h
+++ b/ui/app_list/app_list_item_list_observer.h
@@ -27,6 +27,10 @@
size_t to_index,
AppListItem* item) {}
+ // Triggered after the item at the corresponding index in the top level has
+ // started or completed installing and should be highlighted.
+ virtual void OnAppListItemHighlight(size_t index, bool highlight) {}
+
protected:
virtual ~AppListItemListObserver() {}
};
diff --git a/ui/app_list/app_list_item_observer.h b/ui/app_list/app_list_item_observer.h
index 1bc466e..e74e127 100644
--- a/ui/app_list/app_list_item_observer.h
+++ b/ui/app_list/app_list_item_observer.h
@@ -17,9 +17,6 @@
// Invoked after item's name is changed.
virtual void ItemNameChanged() {}
- // Invoked after item's highlighted state is changed.
- virtual void ItemHighlightedChanged() {}
-
// Invoked after item begins or finishes installing.
virtual void ItemIsInstallingChanged() {}
diff --git a/ui/app_list/cocoa/apps_grid_controller.mm b/ui/app_list/cocoa/apps_grid_controller.mm
index 360254c..f2df08d 100644
--- a/ui/app_list/cocoa/apps_grid_controller.mm
+++ b/ui/app_list/cocoa/apps_grid_controller.mm
@@ -111,6 +111,15 @@
[parent_ listItemMovedFromIndex:from_index
toModelIndex:to_index];
}
+ virtual void OnAppListItemHighlight(size_t index, bool highlight) OVERRIDE {
+ // NSCollectionView (or -[AppsGridController scrollToPage]) ensures only one
+ // item is highlighted, so clearing a highlight isn't necessary.
+ if (!highlight)
+ return;
+
+ [parent_ selectItemAtIndex:index];
+ [parent_ scrollToPage:index / kItemsPerPage];
+ }
AppsGridController* parent_; // Weak, owns us.
diff --git a/ui/app_list/cocoa/apps_grid_controller_unittest.mm b/ui/app_list/cocoa/apps_grid_controller_unittest.mm
index 316a1e6..756bb3f 100644
--- a/ui/app_list/cocoa/apps_grid_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_grid_controller_unittest.mm
@@ -556,26 +556,22 @@
ReplaceTestModel(kItemsPerPage + 1);
EXPECT_EQ(2u, [apps_grid_controller_ pageCount]);
EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]);
+ // The single item on the second page.
+ int kTestItemIndex = kItemsPerPage;
app_list::AppListItem* item_model =
- model()->top_level_item_list()->item_at(kItemsPerPage);
+ model()->top_level_item_list()->item_at(kTestItemIndex);
// Highlighting an item should activate the page it is on.
- item_model->SetHighlighted(true);
+ model()->HighlightItemAt(kTestItemIndex);
EXPECT_EQ(1u, [apps_grid_controller_ visiblePage]);
- // Clearing a highlight stays on the current page.
- [apps_grid_controller_ scrollToPage:0];
- EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]);
- item_model->SetHighlighted(false);
- EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]);
-
// Starting install should add a progress bar, and temporarily clear the
// button title.
- NSButton* button = GetItemViewAt(kItemsPerPage);
+ NSButton* button = GetItemViewAt(kTestItemIndex);
NSView* containerView = [button superview];
EXPECT_EQ(1u, [[containerView subviews] count]);
EXPECT_NSEQ(@"Item 16", [button title]);
- item_model->SetHighlighted(true);
+ model()->HighlightItemAt(kTestItemIndex);
item_model->SetIsInstalling(true);
EXPECT_EQ(1u, [apps_grid_controller_ visiblePage]);
@@ -592,10 +588,8 @@
// Two things can be installing simultaneously. When one starts or completes
// the model builder will ask for the item to be highlighted.
- app_list::AppListItem* alternate_item_model =
- model()->top_level_item_list()->item_at(0);
- item_model->SetHighlighted(false);
- alternate_item_model->SetHighlighted(true);
+ const int kAlternateTestItemIndex = 0;
+ model()->HighlightItemAt(kAlternateTestItemIndex);
EXPECT_EQ(0u, [apps_grid_controller_ visiblePage]);
// Update the first item (page doesn't change on updates).
@@ -611,8 +605,7 @@
// Completing install removes the progress bar, and restores the title.
// ExtensionAppModelBuilder will reload the ExtensionAppItem, which also
// highlights. Do the same here.
- alternate_item_model->SetHighlighted(false);
- item_model->SetHighlighted(true);
+ model()->HighlightItemAt(kTestItemIndex);
item_model->SetIsInstalling(false);
EXPECT_EQ(1u, [[containerView subviews] count]);
EXPECT_NSEQ(@"Item 16", [button title]);
diff --git a/ui/app_list/cocoa/apps_grid_view_item.mm b/ui/app_list/cocoa/apps_grid_view_item.mm
index c61b38c..fc37ff3 100644
--- a/ui/app_list/cocoa/apps_grid_view_item.mm
+++ b/ui/app_list/cocoa/apps_grid_view_item.mm
@@ -50,9 +50,6 @@
// Update the button image after ensuring its dimensions are |kIconSize|.
- (void)updateButtonImage;
-// Ensure the page this item is on is the visible page in the grid.
-- (void)ensureVisible;
-
// Add or remove a progress bar from the view.
- (void)setItemIsInstalling:(BOOL)isInstalling;
@@ -74,7 +71,6 @@
virtual void ItemIconChanged() OVERRIDE;
virtual void ItemNameChanged() OVERRIDE;
- virtual void ItemHighlightedChanged() OVERRIDE;
virtual void ItemIsInstallingChanged() OVERRIDE;
virtual void ItemPercentDownloadedChanged() OVERRIDE;
@@ -118,11 +114,6 @@
[parent_ updateButtonTitle];
}
-void ItemModelObserverBridge::ItemHighlightedChanged() {
- if (model_->highlighted())
- [parent_ ensureVisible];
-}
-
void ItemModelObserverBridge::ItemIsInstallingChanged() {
[parent_ setItemIsInstalling:model_->is_installing()];
}
@@ -357,19 +348,10 @@
return imageRep;
}
-- (void)ensureVisible {
- NSCollectionView* collectionView = [self collectionView];
- AppsGridController* gridController =
- base::mac::ObjCCastStrict<AppsGridController>([collectionView delegate]);
- size_t pageIndex = [gridController pageIndexForCollectionView:collectionView];
- [gridController scrollToPage:pageIndex];
-}
-
- (void)setItemIsInstalling:(BOOL)isInstalling {
if (!isInstalling == !progressIndicator_)
return;
- [self ensureVisible];
if (!isInstalling) {
[progressIndicator_ removeFromSuperview];
progressIndicator_.reset();
diff --git a/ui/app_list/search/dictionary_data_store.cc b/ui/app_list/search/dictionary_data_store.cc
new file mode 100644
index 0000000..41ac884
--- /dev/null
+++ b/ui/app_list/search/dictionary_data_store.cc
@@ -0,0 +1,88 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/search/dictionary_data_store.h"
+
+#include "base/callback.h"
+#include "base/json/json_file_value_serializer.h"
+#include "base/json/json_string_value_serializer.h"
+#include "base/logging.h"
+#include "base/sequenced_task_runner.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/task_runner_util.h"
+#include "base/threading/sequenced_worker_pool.h"
+#include "base/values.h"
+
+namespace app_list {
+
+DictionaryDataStore::DictionaryDataStore(const base::FilePath& data_file,
+ base::SequencedWorkerPool* worker_pool)
+ : data_file_(data_file), worker_pool_(worker_pool) {
+ std::string token("app-launcher-data-store");
+ token.append(data_file.AsUTF8Unsafe());
+
+ // Uses a SKIP_ON_SHUTDOWN file task runner because losing a couple
+ // associations is better than blocking shutdown.
+ file_task_runner_ = worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
+ worker_pool->GetNamedSequenceToken(token),
+ base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
+ writer_.reset(
+ new base::ImportantFileWriter(data_file, file_task_runner_.get()));
+
+ cached_dict_.reset(new base::DictionaryValue);
+}
+
+DictionaryDataStore::~DictionaryDataStore() {
+ Flush(OnFlushedCallback());
+}
+
+void DictionaryDataStore::Flush(const OnFlushedCallback& on_flushed) {
+ if (writer_->HasPendingWrite())
+ writer_->DoScheduledWrite();
+
+ if (on_flushed.is_null())
+ return;
+
+ file_task_runner_->PostTaskAndReply(
+ FROM_HERE, base::Bind(&base::DoNothing), on_flushed);
+}
+
+void DictionaryDataStore::Load(
+ const DictionaryDataStore::OnLoadedCallback& on_loaded) {
+ base::PostTaskAndReplyWithResult(
+ file_task_runner_.get(),
+ FROM_HERE,
+ base::Bind(&DictionaryDataStore::LoadOnBlockingPool, this),
+ on_loaded);
+}
+
+void DictionaryDataStore::ScheduleWrite() {
+ writer_->ScheduleWrite(this);
+}
+
+scoped_ptr<base::DictionaryValue> DictionaryDataStore::LoadOnBlockingPool() {
+ DCHECK(worker_pool_->RunsTasksOnCurrentThread());
+
+ int error_code = JSONFileValueSerializer::JSON_NO_ERROR;
+ std::string error_message;
+ JSONFileValueSerializer serializer(data_file_);
+ base::Value* value = serializer.Deserialize(&error_code, &error_message);
+ base::DictionaryValue* dict_value = NULL;
+ if (error_code != JSONFileValueSerializer::JSON_NO_ERROR || !value ||
+ !value->GetAsDictionary(&dict_value) || !dict_value) {
+ return scoped_ptr<base::DictionaryValue>();
+ }
+
+ base::DictionaryValue* return_dict = dict_value->DeepCopy();
+ cached_dict_.reset(dict_value);
+ return make_scoped_ptr(return_dict).Pass();
+}
+
+bool DictionaryDataStore::SerializeData(std::string* data) {
+ JSONStringValueSerializer serializer(data);
+ serializer.set_pretty_print(true);
+ return serializer.Serialize(*cached_dict_.get());
+}
+
+} // namespace app_list
diff --git a/ui/app_list/search/dictionary_data_store.h b/ui/app_list/search/dictionary_data_store.h
new file mode 100644
index 0000000..6ebe1bf
--- /dev/null
+++ b/ui/app_list/search/dictionary_data_store.h
@@ -0,0 +1,79 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
+#define UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/callback_forward.h"
+#include "base/files/file_path.h"
+#include "base/files/important_file_writer.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/app_list/app_list_export.h"
+
+namespace base {
+class DictionaryValue;
+class SequencedTaskRunner;
+class SequencedWorkerPool;
+}
+
+namespace app_list {
+
+// A simple JSON store to persist a dictionary.
+class APP_LIST_EXPORT DictionaryDataStore
+ : public base::RefCountedThreadSafe<DictionaryDataStore>,
+ public base::ImportantFileWriter::DataSerializer {
+ public:
+ typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)>
+ OnLoadedCallback;
+ typedef base::Closure OnFlushedCallback;
+
+ DictionaryDataStore(const base::FilePath& data_file,
+ base::SequencedWorkerPool* worker_pool);
+
+ // Flushes pending writes.
+ void Flush(const OnFlushedCallback& on_flushed);
+
+ // Reads the persisted data from disk asynchronously. |on_read| is called
+ // with the loaded and parsed data. If there is an error, |on_read| is called
+ // without data.
+ void Load(const OnLoadedCallback& on_loaded);
+
+ // Schedule a job to persist the cached dictionary.
+ void ScheduleWrite();
+
+ // Used to get a pointer to the cached dictionary. Changes to this dictionary
+ // will not be persisted unless ScheduleWrite() is called.
+ base::DictionaryValue* cached_dict() { return cached_dict_.get(); }
+
+ private:
+ friend class base::RefCountedThreadSafe<DictionaryDataStore>;
+
+ virtual ~DictionaryDataStore();
+
+ // Reads data from backing file.
+ scoped_ptr<base::DictionaryValue> LoadOnBlockingPool();
+
+ // ImportantFileWriter::DataSerializer overrides:
+ virtual bool SerializeData(std::string* data) override;
+
+ base::FilePath data_file_;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
+ scoped_ptr<base::ImportantFileWriter> writer_;
+
+ // Cached JSON dictionary to serve read and incremental change calls.
+ scoped_ptr<base::DictionaryValue> cached_dict_;
+
+ base::SequencedWorkerPool* worker_pool_;
+
+ DISALLOW_COPY_AND_ASSIGN(DictionaryDataStore);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
diff --git a/ui/app_list/search/history.cc b/ui/app_list/search/history.cc
new file mode 100644
index 0000000..6c54024
--- /dev/null
+++ b/ui/app_list/search/history.cc
@@ -0,0 +1,59 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/search/history.h"
+
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+#include "ui/app_list/search/history_data.h"
+#include "ui/app_list/search/history_data_store.h"
+#include "ui/app_list/search/tokenized_string.h"
+
+namespace app_list {
+
+namespace {
+
+// Normalize the given string by joining all its tokens with a space.
+std::string NormalizeString(const std::string& utf8) {
+ TokenizedString tokenized(base::UTF8ToUTF16(utf8));
+ return base::UTF16ToUTF8(JoinString(tokenized.tokens(), ' '));
+}
+
+} // namespace
+
+History::History(scoped_refptr<HistoryDataStore> store)
+ : store_(store), data_loaded_(false) {
+ const size_t kMaxQueryEntries = 1000;
+ const size_t kMaxSecondaryQueries = 5;
+
+ data_.reset(
+ new HistoryData(store_.get(), kMaxQueryEntries, kMaxSecondaryQueries));
+ data_->AddObserver(this);
+}
+
+History::~History() {
+ data_->RemoveObserver(this);
+}
+
+bool History::IsReady() const {
+ return data_loaded_;
+}
+
+void History::AddLaunchEvent(const std::string& query,
+ const std::string& result_id) {
+ DCHECK(IsReady());
+ data_->Add(NormalizeString(query), result_id);
+}
+
+scoped_ptr<KnownResults> History::GetKnownResults(
+ const std::string& query) const {
+ DCHECK(IsReady());
+ return data_->GetKnownResults(NormalizeString(query)).Pass();
+}
+
+void History::OnHistoryDataLoadedFromStore() {
+ data_loaded_ = true;
+}
+
+} // namespace app_list
diff --git a/ui/app_list/search/history.h b/ui/app_list/search/history.h
new file mode 100644
index 0000000..2a87813
--- /dev/null
+++ b/ui/app_list/search/history.h
@@ -0,0 +1,65 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_HISTORY_H_
+#define UI_APP_LIST_SEARCH_HISTORY_H_
+
+#include <map>
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/keyed_service/core/keyed_service.h"
+#include "ui/app_list/app_list_export.h"
+#include "ui/app_list/search/history_data_observer.h"
+#include "ui/app_list/search/history_types.h"
+
+namespace app_list {
+
+class HistoryData;
+class HistoryDataStore;
+
+namespace test {
+class SearchHistoryTest;
+}
+
+// History tracks the launch events of the search results and uses HistoryData
+// to build user learning data out of these events. The learning data is stored
+// as associations between user typed query and launched result id. There are
+// primary and secondary associations. See HistoryData comments to see how
+// they are built. The learning data is sent to the mixer to boost results that
+// have been launched before.
+class APP_LIST_EXPORT History : public KeyedService,
+ public HistoryDataObserver {
+ public:
+ explicit History(scoped_refptr<HistoryDataStore> store);
+ virtual ~History();
+
+ // Returns true if the service is ready.
+ bool IsReady() const;
+
+ // Adds a launch event to the learning data.
+ void AddLaunchEvent(const std::string& query, const std::string& result_id);
+
+ // Gets all known search results that were launched using the given |query|
+ // or using queries that |query| is a prefix of.
+ scoped_ptr<KnownResults> GetKnownResults(const std::string& query) const;
+
+ private:
+ friend class app_list::test::SearchHistoryTest;
+
+ // HistoryDataObserver overrides:
+ virtual void OnHistoryDataLoadedFromStore() override;
+
+ scoped_ptr<HistoryData> data_;
+ scoped_refptr<HistoryDataStore> store_;
+ bool data_loaded_;
+
+ DISALLOW_COPY_AND_ASSIGN(History);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_HISTORY_H_
diff --git a/ui/app_list/search/history_data.cc b/ui/app_list/search/history_data.cc
new file mode 100644
index 0000000..636d60f
--- /dev/null
+++ b/ui/app_list/search/history_data.cc
@@ -0,0 +1,175 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/search/history_data.h"
+
+#include <algorithm>
+#include <vector>
+
+#include "base/bind.h"
+#include "ui/app_list/search/history_data_observer.h"
+#include "ui/app_list/search/history_data_store.h"
+
+namespace app_list {
+
+namespace {
+
+// A struct used to sort query entries by time.
+struct EntrySortData {
+ EntrySortData() : query(NULL), update_time(NULL) {}
+ EntrySortData(const std::string* query, const base::Time* update_time)
+ : query(query), update_time(update_time) {}
+
+ const std::string* query;
+ const base::Time* update_time;
+};
+
+bool EntrySortByTimeAscending(const EntrySortData& entry1,
+ const EntrySortData& entry2) {
+ return *entry1.update_time < *entry2.update_time;
+}
+
+} // namespace
+
+HistoryData::Data::Data() {
+}
+HistoryData::Data::~Data() {
+}
+
+HistoryData::HistoryData(HistoryDataStore* store,
+ size_t max_primary,
+ size_t max_secondary)
+ : store_(store), max_primary_(max_primary), max_secondary_(max_secondary) {
+ store_->Load(base::Bind(&HistoryData::OnStoreLoaded, AsWeakPtr()));
+}
+
+HistoryData::~HistoryData() {
+}
+
+void HistoryData::Add(const std::string& query, const std::string& result_id) {
+ Associations::iterator assoc_it = associations_.find(query);
+
+ // Creates a primary association if query is seen for the first time.
+ if (assoc_it == associations_.end()) {
+ Data& data = associations_[query];
+ data.primary = result_id;
+ data.update_time = base::Time::Now();
+
+ store_->SetPrimary(query, result_id);
+ store_->SetUpdateTime(query, data.update_time);
+
+ TrimEntries();
+ return;
+ }
+
+ Data& data = assoc_it->second;
+ data.update_time = base::Time::Now();
+ store_->SetUpdateTime(query, data.update_time);
+
+ SecondaryDeque& secondary = data.secondary;
+ if (!secondary.empty() && secondary.back() == result_id) {
+ // Nothing to do if the last secondary is the current primary.
+ if (data.primary == result_id)
+ return;
+
+ // If |result_id| is the last (the most recent) secondary and it's not the
+ // current primary, promote it and demote the primary.
+ secondary.pop_back();
+ secondary.push_back(data.primary);
+ data.primary = result_id;
+
+ store_->SetPrimary(query, result_id);
+ store_->SetSecondary(query, secondary);
+ return;
+ }
+
+ // Otherwise, append to secondary list.
+ SecondaryDeque::iterator secondary_it =
+ std::find(secondary.begin(), secondary.end(), result_id);
+ if (secondary_it != secondary.end())
+ secondary.erase(secondary_it);
+
+ secondary.push_back(result_id);
+ if (secondary.size() > max_secondary_)
+ secondary.pop_front();
+ store_->SetSecondary(query, secondary);
+}
+
+scoped_ptr<KnownResults> HistoryData::GetKnownResults(
+ const std::string& query) const {
+ scoped_ptr<KnownResults> results(new KnownResults);
+ for (Associations::const_iterator assoc_it = associations_.lower_bound(query);
+ assoc_it != associations_.end();
+ ++assoc_it) {
+ // Break out of the loop if |query| is no longer a prefix.
+ if (assoc_it->first.size() < query.size() ||
+ strncmp(assoc_it->first.c_str(), query.c_str(), query.length()) != 0) {
+ break;
+ }
+
+ const bool perfect = assoc_it->first == query;
+ // Primary match should always be returned.
+ (*results)[assoc_it->second.primary] =
+ perfect ? PERFECT_PRIMARY : PREFIX_PRIMARY;
+
+ const KnownResultType secondary_type =
+ perfect ? PERFECT_SECONDARY : PREFIX_SECONDARY;
+ const HistoryData::SecondaryDeque& secondary = assoc_it->second.secondary;
+ for (HistoryData::SecondaryDeque::const_iterator secondary_it =
+ secondary.begin();
+ secondary_it != secondary.end();
+ ++secondary_it) {
+ const std::string& secondary_result_id = (*secondary_it);
+
+ // Secondary match only gets added if there there is no primary match.
+ if (results->find(secondary_result_id) != results->end())
+ continue;
+ (*results)[secondary_result_id] = secondary_type;
+ }
+ }
+
+ return results.Pass();
+}
+
+void HistoryData::AddObserver(HistoryDataObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void HistoryData::RemoveObserver(HistoryDataObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void HistoryData::OnStoreLoaded(scoped_ptr<Associations> loaded_data) {
+ if (loaded_data)
+ loaded_data->swap(associations_);
+
+ FOR_EACH_OBSERVER(
+ HistoryDataObserver, observers_, OnHistoryDataLoadedFromStore());
+}
+
+void HistoryData::TrimEntries() {
+ if (associations_.size() <= max_primary_)
+ return;
+
+ std::vector<EntrySortData> entries;
+ for (Associations::const_iterator it = associations_.begin();
+ it != associations_.end();
+ ++it) {
+ entries.push_back(EntrySortData(&it->first, &it->second.update_time));
+ }
+
+ const size_t entries_to_remove = associations_.size() - max_primary_;
+ std::partial_sort(entries.begin(),
+ entries.begin() + entries_to_remove,
+ entries.end(),
+ &EntrySortByTimeAscending);
+
+ for (size_t i = 0; i < entries_to_remove; ++i) {
+ const std::string& query = *entries[i].query;
+ store_->Delete(query);
+ associations_.erase(query);
+ }
+}
+
+} // namespace app_list
diff --git a/ui/app_list/search/history_data.h b/ui/app_list/search/history_data.h
new file mode 100644
index 0000000..f0932fc
--- /dev/null
+++ b/ui/app_list/search/history_data.h
@@ -0,0 +1,94 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_H_
+#define UI_APP_LIST_SEARCH_HISTORY_DATA_H_
+
+#include <deque>
+#include <map>
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
+#include "base/time/time.h"
+#include "ui/app_list/app_list_export.h"
+#include "ui/app_list/search/history_types.h"
+
+namespace app_list {
+
+class HistoryDataObserver;
+class HistoryDataStore;
+
+// HistoryData stores the associations of the user typed queries and launched
+// search result id. There are two types of association: primary and secondary.
+// Primary is a 1-to-1 mapping between the query and result id. Secondary
+// is a 1-to-many mapping and only kept the last 5 to limit the data size.
+// If an association is added for the first time, it is added as a primary
+// association. Further associations added to the same query are added as
+// secondary. However, if a secondary association is added twice in a row, it
+// is promoted to primary and the current primary mapping is demoted into
+// secondary.
+class APP_LIST_EXPORT HistoryData : public base::SupportsWeakPtr<HistoryData> {
+ public:
+ typedef std::deque<std::string> SecondaryDeque;
+
+ // Defines data to be associated with a query.
+ struct APP_LIST_EXPORT Data {
+ Data();
+ ~Data();
+
+ // Primary result associated with the query.
+ std::string primary;
+
+ // Secondary results associated with the query from oldest to latest.
+ SecondaryDeque secondary;
+
+ // Last update time.
+ base::Time update_time;
+ };
+ typedef std::map<std::string, Data> Associations;
+
+ // Constructor of HistoryData. |store| is the storage to persist the data.
+ // |max_primary| is the maximum number of the most recent primary associations
+ // to keep. |max_secondary| is the maximum number of secondary associations to
+ // keep.
+ HistoryData(HistoryDataStore* store,
+ size_t max_primary,
+ size_t max_secondary);
+ ~HistoryData();
+
+ // Adds an association.
+ void Add(const std::string& query, const std::string& result_id);
+
+ // Gets all known search results that were launched using the given |query|
+ // or the queries that |query| is a prefix of.
+ scoped_ptr<KnownResults> GetKnownResults(const std::string& query) const;
+
+ void AddObserver(HistoryDataObserver* observer);
+ void RemoveObserver(HistoryDataObserver* observer);
+
+ const Associations& associations() const { return associations_; }
+
+ private:
+ // Invoked from |store| with loaded data.
+ void OnStoreLoaded(scoped_ptr<Associations> loaded_data);
+
+ // Trims the data to keep the most recent |max_primary_| queries.
+ void TrimEntries();
+
+ HistoryDataStore* store_; // Not owned.
+ const size_t max_primary_;
+ const size_t max_secondary_;
+ ObserverList<HistoryDataObserver, true> observers_;
+
+ Associations associations_;
+
+ DISALLOW_COPY_AND_ASSIGN(HistoryData);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_H_
diff --git a/ui/app_list/search/history_data_observer.h b/ui/app_list/search/history_data_observer.h
new file mode 100644
index 0000000..cf77cd6
--- /dev/null
+++ b/ui/app_list/search/history_data_observer.h
@@ -0,0 +1,23 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
+#define UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
+
+#include "ui/app_list/app_list_export.h"
+
+namespace app_list {
+
+class APP_LIST_EXPORT HistoryDataObserver {
+ public:
+ // Invoked when the data is loaded from underlying store.
+ virtual void OnHistoryDataLoadedFromStore() = 0;
+
+ protected:
+ virtual ~HistoryDataObserver() {}
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
diff --git a/ui/app_list/search/history_data_store.cc b/ui/app_list/search/history_data_store.cc
new file mode 100644
index 0000000..996adc4
--- /dev/null
+++ b/ui/app_list/search/history_data_store.cc
@@ -0,0 +1,221 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/search/history_data_store.h"
+
+#include "base/callback.h"
+#include "base/json/json_file_value_serializer.h"
+#include "base/json/json_string_value_serializer.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/values.h"
+
+namespace app_list {
+
+namespace {
+
+const char kKeyVersion[] = "version";
+const char kCurrentVersion[] = "1";
+
+const char kKeyAssociations[] = "associations";
+const char kKeyPrimary[] = "p";
+const char kKeySecondary[] = "s";
+const char kKeyUpdateTime[] = "t";
+
+// Extracts strings from ListValue.
+void GetSecondary(const base::ListValue* list,
+ HistoryData::SecondaryDeque* secondary) {
+ HistoryData::SecondaryDeque results;
+ for (base::ListValue::const_iterator it = list->begin(); it != list->end();
+ ++it) {
+ std::string str;
+ if (!(*it)->GetAsString(&str))
+ return;
+
+ results.push_back(str);
+ }
+
+ secondary->swap(results);
+}
+
+// V1 format json dictionary:
+// {
+// "version": "1",
+// "associations": {
+// "user typed query": {
+// "p" : "result id of primary association",
+// "s" : [
+// "result id of 1st (oldest) secondary association",
+// ...
+// "result id of the newest secondary association"
+// ],
+// "t" : "last_update_timestamp"
+// },
+// ...
+// }
+// }
+scoped_ptr<HistoryData::Associations> Parse(
+ scoped_ptr<base::DictionaryValue> dict) {
+ std::string version;
+ if (!dict->GetStringWithoutPathExpansion(kKeyVersion, &version) ||
+ version != kCurrentVersion) {
+ return scoped_ptr<HistoryData::Associations>();
+ }
+
+ const base::DictionaryValue* assoc_dict = NULL;
+ if (!dict->GetDictionaryWithoutPathExpansion(kKeyAssociations, &assoc_dict) ||
+ !assoc_dict) {
+ return scoped_ptr<HistoryData::Associations>();
+ }
+
+ scoped_ptr<HistoryData::Associations> data(new HistoryData::Associations);
+ for (base::DictionaryValue::Iterator it(*assoc_dict); !it.IsAtEnd();
+ it.Advance()) {
+ const base::DictionaryValue* entry_dict = NULL;
+ if (!it.value().GetAsDictionary(&entry_dict))
+ continue;
+
+ std::string primary;
+ std::string update_time_string;
+ if (!entry_dict->GetStringWithoutPathExpansion(kKeyPrimary, &primary) ||
+ !entry_dict->GetStringWithoutPathExpansion(kKeyUpdateTime,
+ &update_time_string)) {
+ continue;
+ }
+
+ const base::ListValue* secondary_list = NULL;
+ HistoryData::SecondaryDeque secondary;
+ if (entry_dict->GetListWithoutPathExpansion(kKeySecondary, &secondary_list))
+ GetSecondary(secondary_list, &secondary);
+
+ const std::string& query = it.key();
+ HistoryData::Data& association_data = (*data.get())[query];
+ association_data.primary = primary;
+ association_data.secondary.swap(secondary);
+
+ int64 update_time_val;
+ base::StringToInt64(update_time_string, &update_time_val);
+ association_data.update_time =
+ base::Time::FromInternalValue(update_time_val);
+ }
+
+ return data.Pass();
+}
+
+} // namespace
+
+HistoryDataStore::HistoryDataStore()
+ : cached_dict_(new base::DictionaryValue()) {
+ Init(cached_dict_.get());
+}
+
+HistoryDataStore::HistoryDataStore(
+ scoped_refptr<DictionaryDataStore> data_store)
+ : data_store_(data_store) {
+ Init(data_store_->cached_dict());
+}
+
+HistoryDataStore::~HistoryDataStore() {
+}
+
+void HistoryDataStore::Init(base::DictionaryValue* cached_dict) {
+ DCHECK(cached_dict);
+ cached_dict->SetString(kKeyVersion, kCurrentVersion);
+ cached_dict->Set(kKeyAssociations, new base::DictionaryValue);
+}
+
+void HistoryDataStore::Flush(
+ const DictionaryDataStore::OnFlushedCallback& on_flushed) {
+ if (data_store_.get())
+ data_store_->Flush(on_flushed);
+ else
+ on_flushed.Run();
+}
+
+void HistoryDataStore::Load(
+ const HistoryDataStore::OnLoadedCallback& on_loaded) {
+ if (data_store_.get()) {
+ data_store_->Load(base::Bind(
+ &HistoryDataStore::OnDictionaryLoadedCallback, this, on_loaded));
+ } else {
+ OnDictionaryLoadedCallback(on_loaded,
+ make_scoped_ptr(cached_dict_->DeepCopy()));
+ }
+}
+
+void HistoryDataStore::SetPrimary(const std::string& query,
+ const std::string& result) {
+ base::DictionaryValue* entry_dict = GetEntryDict(query);
+ entry_dict->SetWithoutPathExpansion(kKeyPrimary,
+ new base::StringValue(result));
+ if (data_store_.get())
+ data_store_->ScheduleWrite();
+}
+
+void HistoryDataStore::SetSecondary(
+ const std::string& query,
+ const HistoryData::SecondaryDeque& results) {
+ scoped_ptr<base::ListValue> results_list(new base::ListValue);
+ for (size_t i = 0; i < results.size(); ++i)
+ results_list->AppendString(results[i]);
+
+ base::DictionaryValue* entry_dict = GetEntryDict(query);
+ entry_dict->SetWithoutPathExpansion(kKeySecondary, results_list.release());
+ if (data_store_.get())
+ data_store_->ScheduleWrite();
+}
+
+void HistoryDataStore::SetUpdateTime(const std::string& query,
+ const base::Time& update_time) {
+ base::DictionaryValue* entry_dict = GetEntryDict(query);
+ entry_dict->SetWithoutPathExpansion(kKeyUpdateTime,
+ new base::StringValue(base::Int64ToString(
+ update_time.ToInternalValue())));
+ if (data_store_.get())
+ data_store_->ScheduleWrite();
+}
+
+void HistoryDataStore::Delete(const std::string& query) {
+ base::DictionaryValue* assoc_dict = GetAssociationDict();
+ assoc_dict->RemoveWithoutPathExpansion(query, NULL);
+ if (data_store_.get())
+ data_store_->ScheduleWrite();
+}
+
+base::DictionaryValue* HistoryDataStore::GetAssociationDict() {
+ base::DictionaryValue* cached_dict =
+ cached_dict_ ? cached_dict_.get() : data_store_->cached_dict();
+ DCHECK(cached_dict);
+
+ base::DictionaryValue* assoc_dict = NULL;
+ CHECK(cached_dict->GetDictionary(kKeyAssociations, &assoc_dict) &&
+ assoc_dict);
+
+ return assoc_dict;
+}
+
+base::DictionaryValue* HistoryDataStore::GetEntryDict(
+ const std::string& query) {
+ base::DictionaryValue* assoc_dict = GetAssociationDict();
+
+ base::DictionaryValue* entry_dict = NULL;
+ if (!assoc_dict->GetDictionaryWithoutPathExpansion(query, &entry_dict)) {
+ // Creates one if none exists. Ownership is taken in the set call after.
+ entry_dict = new base::DictionaryValue;
+ assoc_dict->SetWithoutPathExpansion(query, entry_dict);
+ }
+
+ return entry_dict;
+}
+
+void HistoryDataStore::OnDictionaryLoadedCallback(
+ OnLoadedCallback callback,
+ scoped_ptr<base::DictionaryValue> dict) {
+ if (!dict) {
+ callback.Run(scoped_ptr<HistoryData::Associations>());
+ } else {
+ callback.Run(Parse(dict.Pass()).Pass());
+ }
+}
+
+} // namespace app_list
diff --git a/ui/app_list/search/history_data_store.h b/ui/app_list/search/history_data_store.h
new file mode 100644
index 0000000..beda4b8
--- /dev/null
+++ b/ui/app_list/search/history_data_store.h
@@ -0,0 +1,87 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
+#define UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/app_list/app_list_export.h"
+#include "ui/app_list/search/dictionary_data_store.h"
+#include "ui/app_list/search/history_data.h"
+
+namespace base {
+class DictionaryValue;
+class SequencedTaskRunner;
+}
+
+namespace app_list {
+
+namespace test {
+class HistoryDataStoreTest;
+}
+
+// A simple json store to persist HistoryData.
+class APP_LIST_EXPORT HistoryDataStore
+ : public base::RefCountedThreadSafe<HistoryDataStore> {
+ public:
+ typedef base::Callback<void(scoped_ptr<HistoryData::Associations>)>
+ OnLoadedCallback;
+
+ // A data store with no storage backend.
+ HistoryDataStore();
+
+ // |data_store| stores the history into the file.
+ explicit HistoryDataStore(scoped_refptr<DictionaryDataStore> data_store);
+
+ // Flushes pending writes. |on_flushed| is invoked when disk write is
+ // finished.
+ void Flush(const DictionaryDataStore::OnFlushedCallback& on_flushed);
+
+ // Reads the persisted data from disk asynchronously. |on_read| is called
+ // with the loaded and parsed data. If there is an error, |on_read| is called
+ // without data.
+ void Load(const OnLoadedCallback& on_loaded);
+
+ // Incremental changes allowed on the data store.
+ void SetPrimary(const std::string& query, const std::string& result);
+ void SetSecondary(const std::string& query,
+ const HistoryData::SecondaryDeque& results);
+ void SetUpdateTime(const std::string& query, const base::Time& update_time);
+ void Delete(const std::string& query);
+
+ private:
+ friend class base::RefCountedThreadSafe<HistoryDataStore>;
+ friend class app_list::test::HistoryDataStoreTest;
+
+ virtual ~HistoryDataStore();
+
+ void Init(base::DictionaryValue* cached_dict);
+
+ // Gets the dictionary for "associations" key.
+ base::DictionaryValue* GetAssociationDict();
+
+ // Gets entry dictionary for given |query|. Creates one if necessary.
+ base::DictionaryValue* GetEntryDict(const std::string& query);
+
+ void OnDictionaryLoadedCallback(OnLoadedCallback callback,
+ scoped_ptr<base::DictionaryValue> dict);
+
+ // |cached_dict_| and |data_store_| is mutually exclusive. |data_store_| is
+ // used if it's backed by a file storage, otherwise |cache_dict_| keeps
+ // on-memory data.
+ scoped_ptr<base::DictionaryValue> cached_dict_;
+ scoped_refptr<DictionaryDataStore> data_store_;
+
+ DISALLOW_COPY_AND_ASSIGN(HistoryDataStore);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
diff --git a/ui/app_list/search/history_data_store_unittest.cc b/ui/app_list/search/history_data_store_unittest.cc
new file mode 100644
index 0000000..4e7c2a7
--- /dev/null
+++ b/ui/app_list/search/history_data_store_unittest.cc
@@ -0,0 +1,181 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/basictypes.h"
+#include "base/bind.h"
+#include "base/files/file_util.h"
+#include "base/files/scoped_temp_dir.h"
+#include "base/memory/ref_counted.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+#include "base/threading/sequenced_worker_pool.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/app_list/search/dictionary_data_store.h"
+#include "ui/app_list/search/history_data.h"
+#include "ui/app_list/search/history_data_store.h"
+
+namespace app_list {
+namespace test {
+
+namespace {
+
+std::string GetDataContent(const HistoryData::Data& data) {
+ std::string str = std::string("p:") + data.primary + ";s:";
+ bool first = true;
+ for (HistoryData::SecondaryDeque::const_iterator it = data.secondary.begin();
+ it != data.secondary.end();
+ ++it) {
+ if (first)
+ first = false;
+ else
+ str += ',';
+
+ str += *it;
+ }
+
+ return str;
+}
+
+} // namespace
+
+class HistoryDataStoreTest : public testing::Test {
+ public:
+ HistoryDataStoreTest() {}
+ virtual ~HistoryDataStoreTest() {}
+
+ // testing::Test overrides:
+ virtual void SetUp() override {
+ worker_pool_ = new base::SequencedWorkerPool(1, "AppLauncherTest");
+ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+ }
+ virtual void TearDown() override {
+ // Release |store_| while ui loop is still running.
+ store_ = NULL;
+ }
+
+ void OpenStore(const std::string& file_name) {
+ data_file_ = temp_dir_.path().AppendASCII(file_name);
+ store_ = new HistoryDataStore(scoped_refptr<DictionaryDataStore>(
+ new DictionaryDataStore(data_file_, worker_pool_.get())));
+ Load();
+ }
+
+ void Flush() { store_->Flush(DictionaryDataStore::OnFlushedCallback()); }
+
+ void Load() {
+ store_->Load(
+ base::Bind(&HistoryDataStoreTest::OnRead, base::Unretained(this)));
+ run_loop_.reset(new base::RunLoop);
+ run_loop_->Run();
+ run_loop_.reset();
+ }
+
+ void WriteDataFile(const std::string& file_name, const std::string& data) {
+ base::WriteFile(
+ temp_dir_.path().AppendASCII(file_name), data.c_str(), data.size());
+ }
+
+ HistoryDataStore* store() { return store_.get(); }
+ const HistoryData::Associations& associations() const {
+ return associations_;
+ }
+
+ private:
+ void OnRead(scoped_ptr<HistoryData::Associations> associations) {
+ associations_.clear();
+ if (associations)
+ associations->swap(associations_);
+
+ if (run_loop_)
+ run_loop_->Quit();
+ }
+
+ base::MessageLoopForUI message_loop_;
+ base::ScopedTempDir temp_dir_;
+ base::FilePath data_file_;
+ scoped_ptr<base::RunLoop> run_loop_;
+ scoped_refptr<base::SequencedWorkerPool> worker_pool_;
+
+ scoped_refptr<HistoryDataStore> store_;
+ HistoryData::Associations associations_;
+
+ DISALLOW_COPY_AND_ASSIGN(HistoryDataStoreTest);
+};
+
+TEST_F(HistoryDataStoreTest, NewFile) {
+ OpenStore("new_data_file.json");
+ EXPECT_TRUE(associations().empty());
+}
+
+TEST_F(HistoryDataStoreTest, BadFile) {
+ const char kDataFile[] = "invalid_data_file";
+ WriteDataFile(kDataFile, "invalid json");
+
+ OpenStore(kDataFile);
+ EXPECT_TRUE(associations().empty());
+}
+
+TEST_F(HistoryDataStoreTest, GoodFile) {
+ const char kDataFile[] = "good_data_file.json";
+ const char kGoodJson[] =
+ "{"
+ "\"version\": \"1\","
+ "\"associations\": {"
+ "\"query\": {"
+ "\"p\": \"primary\","
+ "\"s\": [\"secondary1\",\"secondary2\"],"
+ "\"t\": \"123\""
+ "}"
+ "}"
+ "}";
+ WriteDataFile(kDataFile, kGoodJson);
+
+ OpenStore(kDataFile);
+ EXPECT_FALSE(associations().empty());
+ EXPECT_EQ(1u, associations().size());
+
+ HistoryData::Associations::const_iterator it = associations().find("query");
+ EXPECT_TRUE(it != associations().end());
+ EXPECT_EQ("p:primary;s:secondary1,secondary2", GetDataContent(it->second));
+}
+
+TEST_F(HistoryDataStoreTest, Change) {
+ const char kDataFile[] = "change_test.json";
+
+ OpenStore(kDataFile);
+ EXPECT_TRUE(associations().empty());
+
+ const char kQuery[] = "query";
+ const base::Time now = base::Time::Now();
+ store()->SetPrimary(kQuery, "primary");
+ store()->SetUpdateTime(kQuery, now);
+ Flush();
+ Load();
+ EXPECT_EQ(1u, associations().size());
+ HistoryData::Associations::const_iterator it = associations().find(kQuery);
+ EXPECT_TRUE(it != associations().end());
+ EXPECT_EQ("primary", it->second.primary);
+ EXPECT_EQ(0u, it->second.secondary.size());
+ EXPECT_EQ(now, it->second.update_time);
+
+ HistoryData::SecondaryDeque secondary;
+ secondary.push_back("s1");
+ secondary.push_back("s2");
+ store()->SetSecondary(kQuery, secondary);
+ Flush();
+ Load();
+ EXPECT_EQ(1u, associations().size());
+ it = associations().find(kQuery);
+ EXPECT_TRUE(it != associations().end());
+ EXPECT_EQ("p:primary;s:s1,s2", GetDataContent(it->second));
+ EXPECT_EQ(now, it->second.update_time);
+
+ store()->Delete(kQuery);
+ Flush();
+ Load();
+ EXPECT_TRUE(associations().empty());
+}
+
+} // namespace test
+} // namespace app_list
diff --git a/ui/app_list/search/history_types.h b/ui/app_list/search/history_types.h
new file mode 100644
index 0000000..dae8e19
--- /dev/null
+++ b/ui/app_list/search/history_types.h
@@ -0,0 +1,27 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
+#define UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
+
+#include <map>
+#include <string>
+
+namespace app_list {
+
+// An enum that indicates how a search result id matches a query in history.
+enum KnownResultType {
+ UNKNOWN_RESULT = 0,
+ PERFECT_PRIMARY, // Exactly the same query and in primary association
+ PERFECT_SECONDARY, // Exactly the same query and in secondary association
+ PREFIX_PRIMARY, // Query is a prefix and in primary association
+ PREFIX_SECONDARY, // Query is a prefix and in secondary association
+};
+
+// KnownResults maps a result id to a KnownResultType.
+typedef std::map<std::string, KnownResultType> KnownResults;
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
diff --git a/ui/app_list/search/mixer.cc b/ui/app_list/search/mixer.cc
new file mode 100644
index 0000000..d430290
--- /dev/null
+++ b/ui/app_list/search/mixer.cc
@@ -0,0 +1,256 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/app_list/search/mixer.h"
+
+#include <algorithm>
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "ui/app_list/search_provider.h"
+#include "ui/app_list/search_result.h"
+
+namespace app_list {
+
+namespace {
+
+// Maximum number of results to show.
+const size_t kMaxResults = 6;
+const size_t kMaxMainGroupResults = 4;
+const size_t kMaxWebstoreResults = 2;
+const size_t kMaxPeopleResults = 2;
+
+// A value to indicate no max number of results limit.
+const size_t kNoMaxResultsLimit = 0;
+
+void UpdateResult(const SearchResult& source, SearchResult* target) {
+ target->set_title(source.title());
+ target->set_title_tags(source.title_tags());
+ target->set_details(source.details());
+ target->set_details_tags(source.details_tags());
+}
+
+} // namespace
+
+Mixer::SortData::SortData() : result(NULL), score(0.0) {
+}
+
+Mixer::SortData::SortData(SearchResult* result, double score)
+ : result(result), score(score) {
+}
+
+bool Mixer::SortData::operator<(const SortData& other) const {
+ // This data precedes (less than) |other| if it has higher score.
+ return score > other.score;
+}
+
+// Used to group relevant providers together fox mixing their results.
+class Mixer::Group {
+ public:
+ Group(size_t max_results, double boost)
+ : max_results_(max_results), boost_(boost) {}
+ ~Group() {}
+
+ void AddProvider(SearchProvider* provider) { providers_.push_back(provider); }
+
+ void FetchResults(const KnownResults& known_results) {
+ results_.clear();
+
+ for (Providers::const_iterator provider_it = providers_.begin();
+ provider_it != providers_.end();
+ ++provider_it) {
+ for (SearchProvider::Results::const_iterator result_it =
+ (*provider_it)->results().begin();
+ result_it != (*provider_it)->results().end();
+ ++result_it) {
+ DCHECK_GE((*result_it)->relevance(), 0.0);
+ DCHECK_LE((*result_it)->relevance(), 1.0);
+ DCHECK(!(*result_it)->id().empty());
+
+ double boost = boost_;
+ KnownResults::const_iterator known_it =
+ known_results.find((*result_it)->id());
+ if (known_it != known_results.end()) {
+ switch (known_it->second) {
+ case PERFECT_PRIMARY:
+ boost = 4.0;
+ break;
+ case PREFIX_PRIMARY:
+ boost = 3.75;
+ break;
+ case PERFECT_SECONDARY:
+ boost = 3.25;
+ break;
+ case PREFIX_SECONDARY:
+ boost = 3.0;
+ break;
+ case UNKNOWN_RESULT:
+ NOTREACHED() << "Unknown result in KnownResults?";
+ break;
+ }
+ }
+
+ results_.push_back(
+ SortData(*result_it, (*result_it)->relevance() + boost));
+ }
+ }
+
+ std::sort(results_.begin(), results_.end());
+ if (max_results_ != kNoMaxResultsLimit && results_.size() > max_results_)
+ results_.resize(max_results_);
+ }
+
+ const SortedResults& results() const { return results_; }
+
+ private:
+ typedef std::vector<SearchProvider*> Providers;
+ const size_t max_results_;
+ const double boost_;
+
+ Providers providers_; // Not owned.
+ SortedResults results_;
+
+ DISALLOW_COPY_AND_ASSIGN(Group);
+};
+
+Mixer::Mixer(AppListModel::SearchResults* ui_results)
+ : ui_results_(ui_results) {
+}
+Mixer::~Mixer() {
+}
+
+void Mixer::Init() {
+ groups_.push_back(new Group(kMaxMainGroupResults, 3.0));
+ groups_.push_back(new Group(kNoMaxResultsLimit, 2.0));
+ groups_.push_back(new Group(kMaxWebstoreResults, 1.0));
+ groups_.push_back(new Group(kMaxPeopleResults, 0.0));
+}
+
+void Mixer::AddProviderToGroup(GroupId group, SearchProvider* provider) {
+ size_t group_index = static_cast<size_t>(group);
+ groups_[group_index]->AddProvider(provider);
+}
+
+void Mixer::MixAndPublish(const KnownResults& known_results) {
+ FetchResults(known_results);
+
+ SortedResults results;
+ results.reserve(kMaxResults);
+
+ // Adds main group and web store results first.
+ results.insert(results.end(),
+ groups_[MAIN_GROUP]->results().begin(),
+ groups_[MAIN_GROUP]->results().end());
+ results.insert(results.end(),
+ groups_[WEBSTORE_GROUP]->results().begin(),
+ groups_[WEBSTORE_GROUP]->results().end());
+ results.insert(results.end(),
+ groups_[PEOPLE_GROUP]->results().begin(),
+ groups_[PEOPLE_GROUP]->results().end());
+
+ // Collapse duplicate apps from local and web store.
+ RemoveDuplicates(&results);
+
+ DCHECK_GE(kMaxResults, results.size());
+ size_t remaining_slots = kMaxResults - results.size();
+
+ // Reserves at least one slot for the omnibox result. If there is no available
+ // slot for omnibox results, removes the last one from web store.
+ const size_t omnibox_results = groups_[OMNIBOX_GROUP]->results().size();
+ if (!remaining_slots && omnibox_results)
+ results.pop_back();
+
+ remaining_slots = std::min(kMaxResults - results.size(), omnibox_results);
+ results.insert(results.end(),
+ groups_[OMNIBOX_GROUP]->results().begin(),
+ groups_[OMNIBOX_GROUP]->results().begin() + remaining_slots);
+
+ std::sort(results.begin(), results.end());
+ RemoveDuplicates(&results);
+ if (results.size() > kMaxResults)
+ results.resize(kMaxResults);
+
+ Publish(results, ui_results_);
+}
+
+void Mixer::Publish(const SortedResults& new_results,
+ AppListModel::SearchResults* ui_results) {
+ typedef std::map<std::string, SearchResult*> IdToResultMap;
+
+ // The following algorithm is used:
+ // 1. Transform the |ui_results| list into an unordered map from result ID
+ // to item.
+ // 2. Use the order of items in |new_results| to build an ordered list. If the
+ // result IDs exist in the map, update and use the item in the map and delete
+ // it from the map afterwards. Otherwise, clone new items from |new_results|.
+ // 3. Delete the objects remaining in the map as they are unused.
+
+ // A map of the items in |ui_results| that takes ownership of the items.
+ IdToResultMap ui_results_map;
+ for (size_t i = 0; i < ui_results->item_count(); ++i) {
+ SearchResult* ui_result = ui_results->GetItemAt(i);
+ ui_results_map[ui_result->id()] = ui_result;
+ }
+ // We have to erase all results at once so that observers are notified with
+ // meaningful indexes.
+ ui_results->RemoveAll();
+
+ // Add items back to |ui_results| in the order of |new_results|.
+ for (size_t i = 0; i < new_results.size(); ++i) {
+ SearchResult* new_result = new_results[i].result;
+ IdToResultMap::const_iterator ui_result_it =
+ ui_results_map.find(new_result->id());
+ if (ui_result_it != ui_results_map.end()) {
+ // Update and use the old result if it exists.
+ SearchResult* ui_result = ui_result_it->second;
+ UpdateResult(*new_result, ui_result);
+
+ // |ui_results| takes back ownership from |ui_results_map| here.
+ ui_results->Add(ui_result);
+
+ // Remove the item from the map so that it ends up only with unused
+ // results.
+ ui_results_map.erase(ui_result->id());
+ } else {
+ // Copy the result from |new_results| otherwise.
+ ui_results->Add(new_result->Duplicate().release());
+ }
+ }
+
+ // Delete the results remaining in the map as they are not in the new results.
+ for (IdToResultMap::const_iterator ui_result_it = ui_results_map.begin();
+ ui_result_it != ui_results_map.end();
+ ++ui_result_it) {
+ delete ui_result_it->second;
+ }
+}
+
+void Mixer::RemoveDuplicates(SortedResults* results) {
+ SortedResults final;
+ final.reserve(results->size());
+
+ std::set<std::string> id_set;
+ for (SortedResults::iterator it = results->begin(); it != results->end();
+ ++it) {
+ const std::string& id = it->result->id();
+ if (id_set.find(id) != id_set.end())
+ continue;
+
+ id_set.insert(id);
+ final.push_back(*it);
+ }
+
+ results->swap(final);
+}
+
+void Mixer::FetchResults(const KnownResults& known_results) {
+ for (Groups::iterator group_it = groups_.begin(); group_it != groups_.end();
+ ++group_it) {
+ (*group_it)->FetchResults(known_results);
+ }
+}
+
+} // namespace app_list
diff --git a/ui/app_list/search/mixer.h b/ui/app_list/search/mixer.h
new file mode 100644
index 0000000..171d4a1
--- /dev/null
+++ b/ui/app_list/search/mixer.h
@@ -0,0 +1,90 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_APP_LIST_SEARCH_MIXER_H_
+#define UI_APP_LIST_SEARCH_MIXER_H_
+
+#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_vector.h"
+#include "ui/app_list/app_list_export.h"
+#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/search/history_types.h"
+
+namespace app_list {
+
+namespace test {
+FORWARD_DECLARE_TEST(MixerTest, Publish);
+}
+
+class SearchProvider;
+class SearchResult;
+
+// Mixer collects results from providers, sorts them and publishes them to the
+// SearchResults UI model. The targeted results have 6 slots to hold the
+// result. These slots could be viewed as having three groups: main group
+// (local apps and contacts), omnibox group and web store group. The
+// main group takes no more than 4 slots. The web store takes no more than 2
+// slots. The omnibox group takes all the remaining slots.
+class APP_LIST_EXPORT Mixer {
+ public:
+ // The enum represents mixer groups. Note this must matches the order
+ // of group creation in Init().
+ enum GroupId {
+ MAIN_GROUP = 0,
+ OMNIBOX_GROUP = 1,
+ WEBSTORE_GROUP = 2,
+ PEOPLE_GROUP = 3,
+ };
+
+ explicit Mixer(AppListModel::SearchResults* ui_results);
+ ~Mixer();
+
+ // Creates mixer groups.
+ void Init();
+
+ // Associates a provider with a mixer group.
+ void AddProviderToGroup(GroupId group, SearchProvider* provider);
+
+ // Collects the results, sorts and publishes them.
+ void MixAndPublish(const KnownResults& known_results);
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish);
+
+ // Used for sorting and mixing results.
+ struct APP_LIST_EXPORT SortData {
+ SortData();
+ SortData(SearchResult* result, double score);
+
+ bool operator<(const SortData& other) const;
+
+ SearchResult* result; // Not owned.
+ double score;
+ };
+ typedef std::vector<Mixer::SortData> SortedResults;
+
+ class Group;
+ typedef ScopedVector<Group> Groups;
+
+ // Publishes the given |new_results| to |ui_results|, deleting any existing
+ // results that are not in |new_results|. Results that already exist in
+ // |ui_results| are reused to avoid flickering caused by icon reload.
+ static void Publish(const SortedResults& results,
+ AppListModel::SearchResults* ui_results);
+
+ // Removes duplicates from |results|.
+ static void RemoveDuplicates(SortedResults* results);
+
+ void FetchResults(const KnownResults& known_results);
+
+ AppListModel::SearchResults* ui_results_; // Not owned.
+ Groups groups_;
+
+ DISALLOW_COPY_AND_ASSIGN(Mixer);
+};
+
+} // namespace app_list
+
+#endif // UI_APP_LIST_SEARCH_MIXER_H_
diff --git a/ui/app_list/search/mixer_unittest.cc b/ui/app_list/search/mixer_unittest.cc
new file mode 100644
index 0000000..aa3799d
--- /dev/null
+++ b/ui/app_list/search/mixer_unittest.cc
@@ -0,0 +1,282 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <string>
+
+#include "base/memory/scoped_vector.h"
+#include "base/strings/string16.h"
+#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/search/history_types.h"
+#include "ui/app_list/search/mixer.h"
+#include "ui/app_list/search_provider.h"
+#include "ui/app_list/search_result.h"
+
+namespace app_list {
+namespace test {
+
+class TestSearchResult : public SearchResult {
+ public:
+ TestSearchResult(const std::string& id, double relevance)
+ : instance_id_(instantiation_count++) {
+ set_id(id);
+ set_title(base::UTF8ToUTF16(id));
+ set_relevance(relevance);
+ }
+ virtual ~TestSearchResult() {}
+
+ // SearchResult overrides:
+ virtual void Open(int event_flags) override {}
+ virtual void InvokeAction(int action_index, int event_flags) override {}
+ virtual scoped_ptr<SearchResult> Duplicate() override {
+ return scoped_ptr<SearchResult>(new TestSearchResult(id(), relevance()));
+ }
+
+ // For reference equality testing. (Addresses cannot be used to test reference
+ // equality because it is possible that an object will be allocated at the
+ // same address as a previously deleted one.)
+ static int GetInstanceId(SearchResult* result) {
+ return static_cast<const TestSearchResult*>(result)->instance_id_;
+ }
+
+ private:
+ static int instantiation_count;
+
+ int instance_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestSearchResult);
+};
+int TestSearchResult::instantiation_count = 0;
+
+class TestSearchProvider : public SearchProvider {
+ public:
+ explicit TestSearchProvider(const std::string& prefix)
+ : prefix_(prefix), count_(0) {}
+ virtual ~TestSearchProvider() {}
+
+ // SearchProvider overrides:
+ virtual void Start(const base::string16& query) override {
+ ClearResults();
+ for (size_t i = 0; i < count_; ++i) {
+ const std::string id =
+ base::StringPrintf("%s%d", prefix_.c_str(), static_cast<int>(i));
+ const double relevance = 1.0 - i / 10.0;
+ Add(scoped_ptr<SearchResult>(new TestSearchResult(id, relevance)).Pass());
+ }
+ }
+ virtual void Stop() override {}
+
+ void set_prefix(const std::string& prefix) { prefix_ = prefix; }
+ void set_count(size_t count) { count_ = count; }
+
+ private:
+ std::string prefix_;
+ size_t count_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestSearchProvider);
+};
+
+class MixerTest : public testing::Test {
+ public:
+ MixerTest() {}
+ virtual ~MixerTest() {}
+
+ // testing::Test overrides:
+ virtual void SetUp() override {
+ results_.reset(new AppListModel::SearchResults);
+
+ providers_.push_back(new TestSearchProvider("app"));
+ providers_.push_back(new TestSearchProvider("omnibox"));
+ providers_.push_back(new TestSearchProvider("webstore"));
+ providers_.push_back(new TestSearchProvider("people"));
+
+ mixer_.reset(new Mixer(results_.get()));
+ mixer_->Init();
+ mixer_->AddProviderToGroup(Mixer::MAIN_GROUP, providers_[0]);
+ mixer_->AddProviderToGroup(Mixer::OMNIBOX_GROUP, providers_[1]);
+ mixer_->AddProviderToGroup(Mixer::WEBSTORE_GROUP, providers_[2]);
+ mixer_->AddProviderToGroup(Mixer::PEOPLE_GROUP, providers_[3]);
+ }
+
+ void RunQuery() {
+ const base::string16 query;
+
+ for (size_t i = 0; i < providers_.size(); ++i) {
+ providers_[i]->Start(query);
+ providers_[i]->Stop();
+ }
+
+ mixer_->MixAndPublish(KnownResults());
+ }
+
+ std::string GetResults() const {
+ std::string result;
+ for (size_t i = 0; i < results_->item_count(); ++i) {
+ if (!result.empty())
+ result += ',';
+
+ result += base::UTF16ToUTF8(results_->GetItemAt(i)->title());
+ }
+
+ return result;
+ }
+
+ Mixer* mixer() { return mixer_.get(); }
+ TestSearchProvider* app_provider() { return providers_[0]; }
+ TestSearchProvider* omnibox_provider() { return providers_[1]; }
+ TestSearchProvider* webstore_provider() { return providers_[2]; }
+
+ private:
+ scoped_ptr<Mixer> mixer_;
+ scoped_ptr<AppListModel::SearchResults> results_;
+
+ ScopedVector<TestSearchProvider> providers_;
+
+ DISALLOW_COPY_AND_ASSIGN(MixerTest);
+};
+
+TEST_F(MixerTest, Basic) {
+ struct TestCase {
+ const size_t app_results;
+ const size_t omnibox_results;
+ const size_t webstore_results;
+ const char* expected;
+ } kTestCases[] = {
+ {0, 0, 0, ""},
+ {4, 6, 2, "app0,app1,app2,app3,omnibox0,webstore0"},
+ {10, 10, 10, "app0,app1,app2,app3,omnibox0,webstore0"},
+ {0, 10, 0, "omnibox0,omnibox1,omnibox2,omnibox3,omnibox4,omnibox5"},
+ {0, 10, 1, "omnibox0,omnibox1,omnibox2,omnibox3,omnibox4,webstore0"},
+ {0, 10, 2, "omnibox0,omnibox1,omnibox2,omnibox3,webstore0,webstore1"},
+ {1, 10, 0, "app0,omnibox0,omnibox1,omnibox2,omnibox3,omnibox4"},
+ {2, 10, 0, "app0,app1,omnibox0,omnibox1,omnibox2,omnibox3"},
+ {2, 10, 1, "app0,app1,omnibox0,omnibox1,omnibox2,webstore0"},
+ {2, 10, 2, "app0,app1,omnibox0,omnibox1,webstore0,webstore1"},
+ {2, 0, 2, "app0,app1,webstore0,webstore1"},
+ {0, 0, 0, ""},
+ };
+
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
+ app_provider()->set_count(kTestCases[i].app_results);
+ omnibox_provider()->set_count(kTestCases[i].omnibox_results);
+ webstore_provider()->set_count(kTestCases[i].webstore_results);
+ RunQuery();
+
+ EXPECT_EQ(kTestCases[i].expected, GetResults()) << "Case " << i;
+ }
+}
+
+TEST_F(MixerTest, RemoveDuplicates) {
+ const std::string dup = "dup";
+
+ // This gives "dup0,dup1,dup2".
+ app_provider()->set_prefix(dup);
+ app_provider()->set_count(3);
+
+ // This gives "dup0,dup1".
+ omnibox_provider()->set_prefix(dup);
+ omnibox_provider()->set_count(2);
+
+ // This gives "dup0".
+ webstore_provider()->set_prefix(dup);
+ webstore_provider()->set_count(1);
+
+ RunQuery();
+
+ // Only three results with unique id are kept.
+ EXPECT_EQ("dup0,dup1,dup2", GetResults());
+}
+
+TEST_F(MixerTest, Publish) {
+ scoped_ptr<SearchResult> result1(new TestSearchResult("app1", 0));
+ scoped_ptr<SearchResult> result2(new TestSearchResult("app2", 0));
+ scoped_ptr<SearchResult> result3(new TestSearchResult("app3", 0));
+ scoped_ptr<SearchResult> result3_copy = result3->Duplicate();
+ scoped_ptr<SearchResult> result4(new TestSearchResult("app4", 0));
+ scoped_ptr<SearchResult> result5(new TestSearchResult("app5", 0));
+
+ AppListModel::SearchResults ui_results;
+
+ // Publish the first three results to |ui_results|.
+ Mixer::SortedResults new_results;
+ new_results.push_back(Mixer::SortData(result1.get(), 1.0f));
+ new_results.push_back(Mixer::SortData(result2.get(), 1.0f));
+ new_results.push_back(Mixer::SortData(result3.get(), 1.0f));
+
+ Mixer::Publish(new_results, &ui_results);
+ EXPECT_EQ(3u, ui_results.item_count());
+ // The objects in |ui_results| should be new copies because the input results
+ // are owned and |ui_results| needs to own its results as well.
+ EXPECT_NE(TestSearchResult::GetInstanceId(new_results[0].result),
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(0)));
+ EXPECT_NE(TestSearchResult::GetInstanceId(new_results[1].result),
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(1)));
+ EXPECT_NE(TestSearchResult::GetInstanceId(new_results[2].result),
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(2)));
+
+ // Save the current |ui_results| instance ids for comparison later.
+ std::vector<int> old_ui_result_ids;
+ for (size_t i = 0; i < ui_results.item_count(); ++i) {
+ old_ui_result_ids.push_back(
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(i)));
+ }
+
+ // Change the first result to a totally new object (with a new ID).
+ new_results[0] = Mixer::SortData(result4.get(), 1.0f);
+
+ // Change the second result's title, but keep the same id. (The result will
+ // keep the id "app2" but change its title to "New App 2 Title".)
+ const base::string16 kNewAppTitle = base::UTF8ToUTF16("New App 2 Title");
+ new_results[1].result->set_title(kNewAppTitle);
+
+ // Change the third result's object address (it points to an object with the
+ // same data).
+ new_results[2] = Mixer::SortData(result3_copy.get(), 1.0f);
+
+ Mixer::Publish(new_results, &ui_results);
+ EXPECT_EQ(3u, ui_results.item_count());
+
+ // The first result will be a new object, as the ID has changed.
+ EXPECT_NE(old_ui_result_ids[0],
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(0)));
+
+ // The second result will still use the original object, but have a different
+ // title, since the ID did not change.
+ EXPECT_EQ(old_ui_result_ids[1],
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(1)));
+ EXPECT_EQ(kNewAppTitle, ui_results.GetItemAt(1)->title());
+
+ // The third result will use the original object as the ID did not change.
+ EXPECT_EQ(old_ui_result_ids[2],
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(2)));
+
+ // Save the current |ui_results| order which should is app4, app2, app3.
+ old_ui_result_ids.clear();
+ for (size_t i = 0; i < ui_results.item_count(); ++i) {
+ old_ui_result_ids.push_back(
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(i)));
+ }
+
+ // Reorder the existing results and add a new one in the second place.
+ new_results[0] = Mixer::SortData(result2.get(), 1.0f);
+ new_results[1] = Mixer::SortData(result5.get(), 1.0f);
+ new_results[2] = Mixer::SortData(result3.get(), 1.0f);
+ new_results.push_back(Mixer::SortData(result4.get(), 1.0f));
+
+ Mixer::Publish(new_results, &ui_results);
+ EXPECT_EQ(4u, ui_results.item_count());
+
+ // The reordered results should use the original objects.
+ EXPECT_EQ(old_ui_result_ids[0],
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(3)));
+ EXPECT_EQ(old_ui_result_ids[1],
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(0)));
+ EXPECT_EQ(old_ui_result_ids[2],
+ TestSearchResult::GetInstanceId(ui_results.GetItemAt(2)));
+}
+
+} // namespace test
+} // namespace app_list
diff --git a/ui/app_list/test/app_list_test_model.cc b/ui/app_list/test/app_list_test_model.cc
index d6da48e..9ec5258 100644
--- a/ui/app_list/test/app_list_test_model.cc
+++ b/ui/app_list/test/app_list_test_model.cc
@@ -151,7 +151,7 @@
}
void AppListTestModel::HighlightItemAt(int index) {
AppListItem* item = top_level_item_list()->item_at(index);
- item->SetHighlighted(true);
+ top_level_item_list()->HighlightItemInstalledFromUI(item->id());
}
void AppListTestModel::ItemActivated(AppListTestItem* item) {
diff --git a/ui/app_list/views/app_list_background.cc b/ui/app_list/views/app_list_background.cc
index 008897a..509d01a 100644
--- a/ui/app_list/views/app_list_background.cc
+++ b/ui/app_list/views/app_list_background.cc
@@ -58,17 +58,17 @@
!app_list::switches::IsExperimentalAppListEnabled()) {
const gfx::Rect search_box_view_bounds =
search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds());
- gfx::Rect search_box_rect(
- bounds.x(),
- bounds.y(),
- bounds.width(),
- search_box_view_bounds.bottom() - bounds.y() + kTopSeparatorSize);
+ gfx::Rect search_box_rect(bounds.x(),
+ bounds.y(),
+ bounds.width(),
+ search_box_view_bounds.bottom() - bounds.y());
paint.setColor(kSearchBoxBackground);
canvas->DrawRect(search_box_rect, paint);
gfx::Rect separator_rect(search_box_rect);
- separator_rect.Inset(0, search_box_rect.height() - kTopSeparatorSize, 0, 0);
+ separator_rect.set_y(separator_rect.bottom());
+ separator_rect.set_height(kTopSeparatorSize);
canvas->FillRect(separator_rect, kTopSeparatorColor);
contents_top = separator_rect.bottom();
}
diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc
index a696995..072e4b3 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -274,15 +274,11 @@
void AppListItemView::SetItemIsHighlighted(bool is_highlighted) {
is_highlighted_ = is_highlighted;
- apps_grid_view_->EnsureViewVisible(this);
SchedulePaint();
}
void AppListItemView::SetItemIsInstalling(bool is_installing) {
is_installing_ = is_installing;
- if (is_installing_)
- apps_grid_view_->EnsureViewVisible(this);
-
if (ui_state_ == UI_STATE_NORMAL) {
title_->SetVisible(!is_installing);
progress_bar_->SetVisible(is_installing);
@@ -390,9 +386,9 @@
} else {
if (!is_folder_ui_enabled)
apps_grid_view_->ClearSelectedView(this);
- is_highlighted_ = false;
+ SetItemIsHighlighted(false);
if (item_weak_)
- item_weak_->SetHighlighted(false);
+ item_weak_->set_highlighted(false);
title_->SetEnabledColor(kGridTitleColor);
}
title_->Invalidate();
@@ -543,10 +539,6 @@
base::UTF8ToUTF16(item_weak_->name()));
}
-void AppListItemView::ItemHighlightedChanged() {
- SetItemIsHighlighted(item_weak_->highlighted());
-}
-
void AppListItemView::ItemIsInstallingChanged() {
SetItemIsInstalling(item_weak_->is_installing());
}
diff --git a/ui/app_list/views/app_list_item_view.h b/ui/app_list/views/app_list_item_view.h
index 9fc4d17..8c7945b 100644
--- a/ui/app_list/views/app_list_item_view.h
+++ b/ui/app_list/views/app_list_item_view.h
@@ -134,7 +134,6 @@
// AppListItemObserver overrides:
virtual void ItemIconChanged() OVERRIDE;
virtual void ItemNameChanged() OVERRIDE;
- virtual void ItemHighlightedChanged() OVERRIDE;
virtual void ItemIsInstallingChanged() OVERRIDE;
virtual void ItemPercentDownloadedChanged() OVERRIDE;
virtual void ItemBeingDestroyed() OVERRIDE;
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 7c4a06f..53b365d 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -492,15 +492,6 @@
return selected_view_ == view;
}
-void AppsGridView::EnsureViewVisible(const AppListItemView* view) {
- if (pagination_model_.has_transition())
- return;
-
- Index index = GetIndexOfView(view);
- if (IsValidIndex(index))
- pagination_model_.SelectPage(index.page, false);
-}
-
void AppsGridView::InitiateDrag(AppListItemView* view,
Pointer pointer,
const ui::LocatedEvent& event) {
@@ -1089,6 +1080,14 @@
return index.page * tiles_per_page() + index.slot;
}
+void AppsGridView::EnsureViewVisible(const Index& index) {
+ if (pagination_model_.has_transition())
+ return;
+
+ if (IsValidIndex(index))
+ pagination_model_.SelectPage(index.page, false);
+}
+
void AppsGridView::SetSelectedItemByIndex(const Index& index) {
if (GetIndexOfView(selected_view_) == index)
return;
@@ -1100,7 +1099,7 @@
if (selected_view_)
selected_view_->SchedulePaint();
- EnsureViewVisible(new_selection);
+ EnsureViewVisible(index);
selected_view_ = new_selection;
selected_view_->SchedulePaint();
selected_view_->NotifyAccessibilityEvent(
@@ -2026,6 +2025,13 @@
AnimateToIdealBounds();
}
+void AppsGridView::OnAppListItemHighlight(size_t index, bool highlight) {
+ AppListItemView* view = GetItemViewAt(index);
+ view->SetItemIsHighlighted(highlight);
+ if (highlight)
+ EnsureViewVisible(GetIndexFromModelIndex(index));
+}
+
void AppsGridView::TotalPagesChanged() {
}
diff --git a/ui/app_list/views/apps_grid_view.h b/ui/app_list/views/apps_grid_view.h
index b6781f1..08a11f6 100644
--- a/ui/app_list/views/apps_grid_view.h
+++ b/ui/app_list/views/apps_grid_view.h
@@ -94,10 +94,6 @@
void ClearAnySelectedView();
bool IsSelectedView(const AppListItemView* view) const;
- // Ensures the view is visible. Note that if there is a running page
- // transition, this does nothing.
- void EnsureViewVisible(const AppListItemView* view);
-
void InitiateDrag(AppListItemView* view,
Pointer pointer,
const ui::LocatedEvent& event);
@@ -269,6 +265,10 @@
Index GetIndexFromModelIndex(int model_index) const;
int GetModelIndexFromIndex(const Index& index) const;
+ // Ensures the view is visible. Note that if there is a running page
+ // transition, this does nothing.
+ void EnsureViewVisible(const Index& index);
+
void SetSelectedItemByIndex(const Index& index);
bool IsValidIndex(const Index& index) const;
@@ -377,6 +377,7 @@
virtual void OnListItemMoved(size_t from_index,
size_t to_index,
AppListItem* item) OVERRIDE;
+ virtual void OnAppListItemHighlight(size_t index, bool highlight) OVERRIDE;
// Overridden from PaginationModelObserver:
virtual void TotalPagesChanged() OVERRIDE;
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 4f9a4a8..8b22fbb 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -142,8 +142,6 @@
}
}
-if (false) {
-
source_set("test_support") {
testonly = true
sources = [
@@ -305,5 +303,3 @@
]
}
}
-
-} # if (false)
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index fb25f62..a6c3226 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -1312,7 +1312,9 @@
void Window::NotifyWindowVisibilityChangedUp(aura::Window* target,
bool visible) {
- for (Window* window = this; window; window = window->parent()) {
+ // Start with the parent as we already notified |this|
+ // in NotifyWindowVisibilityChangedDown.
+ for (Window* window = parent(); window; window = window->parent()) {
bool ret = window->NotifyWindowVisibilityChangedAtReceiver(target, visible);
DCHECK(ret);
}
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index f1a7abf..bdc0c7e 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -1665,6 +1665,7 @@
struct VisibilityInfo {
bool window_visible;
bool visible_param;
+ int changed_count;
};
WindowObserverTest()
@@ -1730,9 +1731,13 @@
virtual void OnWindowVisibilityChanged(Window* window,
bool visible) OVERRIDE {
- visibility_info_.reset(new VisibilityInfo);
+ if (!visibility_info_) {
+ visibility_info_.reset(new VisibilityInfo);
+ visibility_info_->changed_count = 0;
+ }
visibility_info_->window_visible = window->IsVisible();
visibility_info_->visible_param = visible;
+ visibility_info_->changed_count++;
}
virtual void OnWindowDestroyed(Window* window) OVERRIDE {
@@ -1804,6 +1809,7 @@
return;
EXPECT_FALSE(GetVisibilityInfo()->window_visible);
EXPECT_FALSE(GetVisibilityInfo()->visible_param);
+ EXPECT_EQ(1, GetVisibilityInfo()->changed_count);
// If parent isn't visible, showing window won't make the window visible, but
// passed visible value must be true.
@@ -1816,6 +1822,7 @@
return;
EXPECT_FALSE(GetVisibilityInfo()->window_visible);
EXPECT_TRUE(GetVisibilityInfo()->visible_param);
+ EXPECT_EQ(1, GetVisibilityInfo()->changed_count);
// If parent is visible, showing window will make the window
// visible and the passed visible value is true.
@@ -1828,6 +1835,15 @@
return;
EXPECT_TRUE(GetVisibilityInfo()->window_visible);
EXPECT_TRUE(GetVisibilityInfo()->visible_param);
+ EXPECT_EQ(1, GetVisibilityInfo()->changed_count);
+
+ // Verify that the OnWindowVisibilityChanged only once
+ // per visibility change.
+ w2->Hide();
+ EXPECT_EQ(2, GetVisibilityInfo()->changed_count);
+
+ w2->Hide();
+ EXPECT_EQ(2, GetVisibilityInfo()->changed_count);
}
// Test if OnWindowDestroyed is invoked as expected.
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index a98de66..d32a9ec 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -895,7 +895,7 @@
"//ui/aura:test_support",
"//ui/events:gesture_detection",
"//ui/chromeos:ui_chromeos",
- #'../chromeos/chromeos.gyp:chromeos', TODO(GYP)
+ #'../../chromeos/chromeos.gyp:chromeos', TODO(GYP)
]
}
}
diff --git a/ui/base/android/window_android.cc b/ui/base/android/window_android.cc
index 490c6f3..2fea4f1 100644
--- a/ui/base/android/window_android.cc
+++ b/ui/base/android/window_android.cc
@@ -17,10 +17,8 @@
using base::android::AttachCurrentThread;
using base::android::ScopedJavaLocalRef;
-WindowAndroid::WindowAndroid(JNIEnv* env, jobject obj, jlong vsync_period)
- : weak_java_window_(env, obj),
- compositor_(NULL),
- vsync_period_(base::TimeDelta::FromInternalValue(vsync_period)) {
+WindowAndroid::WindowAndroid(JNIEnv* env, jobject obj)
+ : weak_java_window_(env, obj), compositor_(NULL) {
}
void WindowAndroid::Destroy(JNIEnv* env, jobject obj) {
@@ -87,22 +85,27 @@
WindowAndroidObserver, observer_list_, OnAnimate(begin_frame_time));
}
-void WindowAndroid::OnVSync(JNIEnv* env, jobject obj, jlong time_micros) {
+void WindowAndroid::OnVSync(JNIEnv* env,
+ jobject obj,
+ jlong time_micros,
+ jlong period_micros) {
base::TimeTicks frame_time(base::TimeTicks::FromInternalValue(time_micros));
+ base::TimeDelta vsync_period(
+ base::TimeDelta::FromMicroseconds(period_micros));
FOR_EACH_OBSERVER(
WindowAndroidObserver,
observer_list_,
- OnVSync(frame_time, vsync_period_));
+ OnVSync(frame_time, vsync_period));
if (compositor_)
- compositor_->OnVSync(frame_time, vsync_period_);
+ compositor_->OnVSync(frame_time, vsync_period);
}
// ----------------------------------------------------------------------------
// Native JNI methods
// ----------------------------------------------------------------------------
-jlong Init(JNIEnv* env, jobject obj, jlong vsync_period) {
- WindowAndroid* window = new WindowAndroid(env, obj, vsync_period);
+jlong Init(JNIEnv* env, jobject obj) {
+ WindowAndroid* window = new WindowAndroid(env, obj);
return reinterpret_cast<intptr_t>(window);
}
diff --git a/ui/base/android/window_android.h b/ui/base/android/window_android.h
index cd8ae34..4652f75 100644
--- a/ui/base/android/window_android.h
+++ b/ui/base/android/window_android.h
@@ -22,7 +22,7 @@
// Android implementation of the activity window.
class UI_BASE_EXPORT WindowAndroid {
public:
- WindowAndroid(JNIEnv* env, jobject obj, jlong vsync_period);
+ WindowAndroid(JNIEnv* env, jobject obj);
void Destroy(JNIEnv* env, jobject obj);
@@ -53,7 +53,10 @@
void RequestVSyncUpdate();
void SetNeedsAnimate();
- void OnVSync(JNIEnv* env, jobject obj, jlong time_micros);
+ void OnVSync(JNIEnv* env,
+ jobject obj,
+ jlong time_micros,
+ jlong period_micros);
void Animate(base::TimeTicks begin_frame_time);
private:
@@ -62,7 +65,6 @@
JavaObjectWeakGlobalRef weak_java_window_;
gfx::Vector2dF content_offset_;
WindowAndroidCompositor* compositor_;
- base::TimeDelta vsync_period_;
ObserverList<WindowAndroidObserver> observer_list_;
diff --git a/ui/base/resource/data_pack_unittest.cc b/ui/base/resource/data_pack_unittest.cc
index 8a88e02..4ab4faa 100644
--- a/ui/base/resource/data_pack_unittest.cc
+++ b/ui/base/resource/data_pack_unittest.cc
@@ -102,8 +102,8 @@
const char kPadding[5678] = {0};
ASSERT_EQ(static_cast<int>(sizeof(kPadding)),
base::WriteFile(data_path, kPadding, sizeof(kPadding)));
- ASSERT_EQ(static_cast<int>(kSamplePakSize),
- base::AppendToFile(data_path, kSamplePakContents, kSamplePakSize));
+ ASSERT_TRUE(base::AppendToFile(
+ data_path, kSamplePakContents, kSamplePakSize));
base::File file(data_path, base::File::FLAG_OPEN | base::File::FLAG_READ);
ASSERT_TRUE(file.IsValid());
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index 6e89292..ada7f9e 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -77,8 +77,6 @@
}
}
-if (false) {
-
source_set("test_support") {
testonly = true
sources = [
@@ -134,8 +132,6 @@
}
}
-} # if (false)
-
# TODO(GYP) enable this when all dependencies are complete and it links.
#test("compositor_unittests") {
# sources = [
diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
index 8550c23..e13abd9 100644
--- a/ui/display/BUILD.gn
+++ b/ui/display/BUILD.gn
@@ -44,6 +44,9 @@
deps += [
"//ui/events/platform",
]
+ if (is_chromeos) {
+ sources -= [ "chromeos/ozone/display_configurator_ozone.cc" ]
+ }
}
if (is_chromeos) {
@@ -52,6 +55,19 @@
if (use_ozone) {
deps += [ "//ui/ozone" ]
+ sources -= [
+ "chromeos/x11/display_configurator_x11.cc",
+ "chromeos/x11/display_mode_x11.cc",
+ "chromeos/x11/display_mode_x11.h",
+ "chromeos/x11/display_snapshot_x11.cc",
+ "chromeos/x11/display_snapshot_x11.h",
+ "chromeos/x11/display_util_x11.cc",
+ "chromeos/x11/display_util_x11.h",
+ "chromeos/x11/native_display_delegate_x11.cc",
+ "chromeos/x11/native_display_delegate_x11.h",
+ "chromeos/x11/native_display_event_dispatcher_x11.cc",
+ "chromeos/x11/native_display_event_dispatcher_x11.h",
+ ]
}
}
diff --git a/ui/events/keycodes/keyboard_code_conversion_x.cc b/ui/events/keycodes/keyboard_code_conversion_x.cc
index 4311a96..daba811 100644
--- a/ui/events/keycodes/keyboard_code_conversion_x.cc
+++ b/ui/events/keycodes/keyboard_code_conversion_x.cc
@@ -545,8 +545,11 @@
}
keycode = KeyboardCodeFromXKeysym(keysym);
- if (keycode == VKEY_UNKNOWN)
+ if (keycode == VKEY_UNKNOWN && !IsModifierKey(keysym)) {
+ // Modifier keys should not fall back to the hardware-keycode-based US
+ // layout. See crbug.com/402320
keycode = DefaultKeyboardCodeFromHardwareKeycode(xkey->keycode);
+ }
return keycode;
}
@@ -824,6 +827,8 @@
return VKEY_WLAN;
case XF86XK_PowerOff:
return VKEY_POWER;
+ case XF86XK_Sleep:
+ return VKEY_SLEEP;
case XF86XK_MonBrightnessDown:
return VKEY_BRIGHTNESS_DOWN;
case XF86XK_MonBrightnessUp:
diff --git a/ui/events/ozone/evdev/event_device_info.cc b/ui/events/ozone/evdev/event_device_info.cc
index 2734b9d..6d75ea9 100644
--- a/ui/events/ozone/evdev/event_device_info.cc
+++ b/ui/events/ozone/evdev/event_device_info.cc
@@ -32,10 +32,6 @@
return true;
}
-bool BitIsSet(const unsigned long* bits, unsigned int bit) {
- return (bits[bit / EVDEV_LONG_BITS] & (1UL << (bit % EVDEV_LONG_BITS)));
-}
-
bool GetAbsInfo(int fd, int code, struct input_absinfo* absinfo) {
if (ioctl(fd, EVIOCGABS(code), absinfo)) {
DLOG(ERROR) << "failed EVIOCGABS(" << code << ") on fd " << fd;
@@ -96,49 +92,49 @@
bool EventDeviceInfo::HasEventType(unsigned int type) const {
if (type > EV_MAX)
return false;
- return BitIsSet(ev_bits_, type);
+ return EvdevBitIsSet(ev_bits_, type);
}
bool EventDeviceInfo::HasKeyEvent(unsigned int code) const {
if (code > KEY_MAX)
return false;
- return BitIsSet(key_bits_, code);
+ return EvdevBitIsSet(key_bits_, code);
}
bool EventDeviceInfo::HasRelEvent(unsigned int code) const {
if (code > REL_MAX)
return false;
- return BitIsSet(rel_bits_, code);
+ return EvdevBitIsSet(rel_bits_, code);
}
bool EventDeviceInfo::HasAbsEvent(unsigned int code) const {
if (code > ABS_MAX)
return false;
- return BitIsSet(abs_bits_, code);
+ return EvdevBitIsSet(abs_bits_, code);
}
bool EventDeviceInfo::HasMscEvent(unsigned int code) const {
if (code > MSC_MAX)
return false;
- return BitIsSet(msc_bits_, code);
+ return EvdevBitIsSet(msc_bits_, code);
}
bool EventDeviceInfo::HasSwEvent(unsigned int code) const {
if (code > SW_MAX)
return false;
- return BitIsSet(sw_bits_, code);
+ return EvdevBitIsSet(sw_bits_, code);
}
bool EventDeviceInfo::HasLedEvent(unsigned int code) const {
if (code > LED_MAX)
return false;
- return BitIsSet(led_bits_, code);
+ return EvdevBitIsSet(led_bits_, code);
}
bool EventDeviceInfo::HasProp(unsigned int code) const {
if (code > INPUT_PROP_MAX)
return false;
- return BitIsSet(prop_bits_, code);
+ return EvdevBitIsSet(prop_bits_, code);
}
int32 EventDeviceInfo::GetAbsMinimum(unsigned int code) const {
diff --git a/ui/events/ozone/evdev/event_device_info.h b/ui/events/ozone/evdev/event_device_info.h
index 492539b..3217114 100644
--- a/ui/events/ozone/evdev/event_device_info.h
+++ b/ui/events/ozone/evdev/event_device_info.h
@@ -9,11 +9,9 @@
#include <linux/input.h>
#include "base/basictypes.h"
+#include "ui/events/ozone/evdev/event_device_util.h"
#include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
-#define EVDEV_LONG_BITS (CHAR_BIT * sizeof(long))
-#define EVDEV_BITS_TO_LONGS(x) (((x) + EVDEV_LONG_BITS - 1) / EVDEV_LONG_BITS)
-
namespace ui {
// Device information for Linux input devices
diff --git a/ui/events/ozone/evdev/event_device_util.h b/ui/events/ozone/evdev/event_device_util.h
new file mode 100644
index 0000000..ddb7b80
--- /dev/null
+++ b/ui/events/ozone/evdev/event_device_util.h
@@ -0,0 +1,21 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
+#define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
+
+#include <limits.h>
+
+namespace ui {
+
+#define EVDEV_LONG_BITS (CHAR_BIT * sizeof(long))
+#define EVDEV_BITS_TO_LONGS(x) (((x) + EVDEV_LONG_BITS - 1) / EVDEV_LONG_BITS)
+
+static inline int EvdevBitIsSet(const unsigned long* data, int bit) {
+ return data[bit / EVDEV_LONG_BITS] & (1UL << (bit % EVDEV_LONG_BITS));
+}
+
+} // namespace ui
+
+#endif // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
diff --git a/ui/file_manager/file_manager/background/js/background.js b/ui/file_manager/file_manager/background/js/background.js
index 19b5e01..37a07ae 100644
--- a/ui/file_manager/file_manager/background/js/background.js
+++ b/ui/file_manager/file_manager/background/js/background.js
@@ -25,7 +25,7 @@
/**
* Map of all currently open file dialogs. The key is an app ID.
- * @type {Object.<string, DOMWindow>}
+ * @type {Object.<string, Window>}
*/
this.dialogs = {};
@@ -390,7 +390,7 @@
/**
* Registers dialog window to the background page.
*
- * @param {DOMWindow} dialogWindow Window of the dialog.
+ * @param {Window} dialogWindow Window of the dialog.
*/
function registerDialog(dialogWindow) {
var id = DIALOG_ID_PREFIX + (nextFileManagerDialogID++);
diff --git a/ui/file_manager/file_manager/background/js/background_base.js b/ui/file_manager/file_manager/background/js/background_base.js
index 588b349..bb65302 100644
--- a/ui/file_manager/file_manager/background/js/background_base.js
+++ b/ui/file_manager/file_manager/background/js/background_base.js
@@ -11,7 +11,7 @@
function BackgroundBase() {
/**
* Map of all currently open app windows. The key is an app ID.
- * @type {Object.<string, AppWindow>}
+ * @type {Object.<string, chrome.app.window.AppWindow>}
*/
this.appWindows = {};
}
@@ -35,7 +35,7 @@
/**
* Gets similar windows, it means with the same initial url.
* @param {string} url URL that the obtained windows have.
- * @return {Array.<AppWindow>} List of similar windows.
+ * @return {Array.<chrome.app.window.AppWindow>} List of similar windows.
*/
BackgroundBase.prototype.getSimilarWindows = function(url) {
var result = [];
diff --git a/ui/file_manager/file_manager/background/js/compiled_resources.gyp b/ui/file_manager/file_manager/background/js/compiled_resources.gyp
index a44b1e0..3a91168 100644
--- a/ui/file_manager/file_manager/background/js/compiled_resources.gyp
+++ b/ui/file_manager/file_manager/background/js/compiled_resources.gyp
@@ -7,15 +7,19 @@
'target_name': 'background',
'variables': {
'depends': [
- '../../common/js/error_util.js',
+ '../../../../../third_party/jstemplate/compiled_resources.gyp:jstemplate',
'../../../../webui/resources/js/load_time_data.js',
'../../../../webui/resources/js/cr.js',
'../../../../webui/resources/js/cr/event_target.js',
'../../../../webui/resources/js/cr/ui/array_data_model.js',
+ '../../../../webui/resources/js/cr/ui/dialogs.js',
+ '../../common/js/error_util.js',
'../../common/js/async_util.js',
'../../common/js/progress_center_common.js',
'../../common/js/util.js',
'../../common/js/volume_manager_common.js',
+ '../../foreground/js/ui/progress_center_panel.js',
+ '../../foreground/js/progress_center_item_group.js',
'device_handler.js',
'drive_sync_handler.js',
'file_operation_handler.js',
@@ -23,7 +27,7 @@
'progress_center.js',
'test_util.js',
'volume_manager.js',
- '../../../../webui/resources/js/cr/ui/dialogs.js',
+ 'background_base.js',
],
'externs': [
'<(CLOSURE_DIR)/externs/chrome_send_externs.js',
diff --git a/ui/file_manager/file_manager/background/js/device_handler.js b/ui/file_manager/file_manager/background/js/device_handler.js
index d0f5b62..bf79b40 100644
--- a/ui/file_manager/file_manager/background/js/device_handler.js
+++ b/ui/file_manager/file_manager/background/js/device_handler.js
@@ -193,7 +193,7 @@
/**
* Shows the notificaiton without using AsyncQueue.
* @param {string} notificaitonId Notification ID.
- * @param {?message} message Message overriding the normal message.
+ * @param {?string} message Message overriding the normal message.
* @param {function()} callback Callback to be invoked when the notification is
* created.
* @private
diff --git a/ui/file_manager/file_manager/background/js/file_operation_handler.js b/ui/file_manager/file_manager/background/js/file_operation_handler.js
index 152f98b..1610bd0 100644
--- a/ui/file_manager/file_manager/background/js/file_operation_handler.js
+++ b/ui/file_manager/file_manager/background/js/file_operation_handler.js
@@ -6,13 +6,13 @@
/**
* An event handler of the background page for file operations.
- * @param {Background} background Background page.
+ * @param {Window} background Background page.
* @constructor
*/
var FileOperationHandler = function(background) {
/**
* Background page.
- * @type {Background}
+ * @type {Window}
* @private
*/
this.background_ = background;
@@ -26,7 +26,7 @@
/**
* Progress center.
- * @type {progressCenter}
+ * @type {ProgressCenter}
* @private
*/
this.progressCenter_ = background.progressCenter;
diff --git a/ui/file_manager/file_manager/background/js/file_operation_manager.js b/ui/file_manager/file_manager/background/js/file_operation_manager.js
index e36ebbe..a4727ca 100644
--- a/ui/file_manager/file_manager/background/js/file_operation_manager.js
+++ b/ui/file_manager/file_manager/background/js/file_operation_manager.js
@@ -97,7 +97,7 @@
return targetPromise.then(function(entry) {
return Promise.reject(new FileOperationManager.Error(
util.FileOperationErrorType.TARGET_EXISTS, entry));
- }, function(inError) {
+ }, function(/** (Error|DOMError) */ inError) {
if (inError instanceof Error)
return Promise.reject(inError);
return Promise.reject(new FileOperationManager.Error(
@@ -117,7 +117,7 @@
* @param {Entry} entry The root Entry for traversing.
* @param {function(Array.<Entry>)} successCallback Called when the traverse
* is successfully done with the array of the entries.
- * @param {function(FileError)} errorCallback Called on error with the first
+ * @param {function(DOMError)} errorCallback Called on error with the first
* occurred error (i.e. following errors will just be discarded).
*/
fileOperationUtil.resolveRecursively = function(
@@ -204,7 +204,7 @@
* processed bytes of it.
* @param {function(Entry)} successCallback Callback invoked when the copy
* is successfully done with the Entry of the created entry.
- * @param {function(FileError)} errorCallback Callback invoked when an error
+ * @param {function(DOMError)} errorCallback Callback invoked when an error
* is found.
* @return {function()} Callback to cancel the current file copy operation.
* When the cancel is done, errorCallback will be called. The returned
@@ -305,7 +305,8 @@
// Unsubscribe the progress listener.
chrome.fileManagerPrivate.onCopyProgress.removeListener(
onCopyProgress);
- errorCallback(util.createDOMError(chrome.runtime.lastError));
+ errorCallback(util.createDOMError(
+ chrome.runtime.lastError.message || ''));
return;
}
@@ -337,7 +338,7 @@
* @param {string} newName The name of the archive to be created.
* @param {function(FileEntry)} successCallback Callback invoked when the
* operation is successfully done with the entry of the created archive.
- * @param {function(FileError)} errorCallback Callback invoked when an error
+ * @param {function(DOMError)} errorCallback Callback invoked when an error
* is found.
*/
fileOperationUtil.zipSelection = function(
@@ -465,7 +466,7 @@
*
* @param {string} reason Event type. One of "BEGIN", "PROGRESS", "SUCCESS",
* or "ERROR". TODO(hidehiko): Use enum.
- * @param {DeleteTask} task Delete task related with the event.
+ * @param {FileOperationManager.Task} task Delete task related with the event.
*/
FileOperationManager.EventRouter.prototype.sendDeleteEvent = function(
reason, task) {
@@ -579,7 +580,7 @@
/**
* Get states of the task.
* TOOD(hirono): Removes this method and sets a task to progress events.
- * @return {object} Status object.
+ * @return {Object} Status object.
*/
FileOperationManager.Task.prototype.getStatus = function() {
var processingEntry = this.sourceEntries[this.processingSourceIndex_];
@@ -817,7 +818,7 @@
* @param {Entry} sourceEntry An entry to be copied.
* @param {DirectoryEntry} destinationEntry The entry which will contain the
* copied entry.
- * @param {function(Entry, Entry} entryChangedCallback
+ * @param {function(Entry, Entry)} entryChangedCallback
* Callback invoked when an entry is created with the source Entry and
* the destination Entry.
* @param {function(Entry, number)} progressCallback Callback invoked
@@ -1098,7 +1099,7 @@
* If the code is FILESYSTEM_ERROR, data should be the FileError.
*
* @param {util.FileOperationErrorType} code Error type.
- * @param {string|Entry|FileError} data Additional data.
+ * @param {string|Entry|DOMError} data Additional data.
* @constructor
*/
FileOperationManager.Error = function(code, data) {
diff --git a/ui/file_manager/file_manager/background/js/progress_center.js b/ui/file_manager/file_manager/background/js/progress_center.js
index e1f4b88..f19fe9e 100644
--- a/ui/file_manager/file_manager/background/js/progress_center.js
+++ b/ui/file_manager/file_manager/background/js/progress_center.js
@@ -11,7 +11,7 @@
var ProgressCenter = function() {
/**
* Current items managed by the progress center.
- * @type {Array.<ProgressItem>}
+ * @type {Array.<ProgressCenterItem>}
* @private
*/
this.items_ = [];
diff --git a/ui/file_manager/file_manager/background/js/volume_manager.js b/ui/file_manager/file_manager/background/js/volume_manager.js
index a51d3d9..64300d2 100644
--- a/ui/file_manager/file_manager/background/js/volume_manager.js
+++ b/ui/file_manager/file_manager/background/js/volume_manager.js
@@ -10,7 +10,7 @@
*
* @param {VolumeManagerCommon.VolumeType} volumeType The type of the volume.
* @param {string} volumeId ID of the volume.
- * @param {DOMFileSystem} fileSystem The file system object for this volume.
+ * @param {FileSystem} fileSystem The file system object for this volume.
* @param {string} error The error if an error is found.
* @param {?string} deviceType The type of device ('usb'|'sd'|'optical'|'mobile'
* |'unknown') (as defined in chromeos/disks/disk_mount_manager.cc).
@@ -91,7 +91,7 @@
return this.volumeId_;
},
/**
- * @return {DOMFileSystem} File system object.
+ * @return {FileSystem} File system object.
*/
get fileSystem() {
return this.fileSystem_;
@@ -157,15 +157,16 @@
* Starts resolving the display root and obtains it. It may take long time for
* Drive. Once resolved, it is cached.
*
- * @param {function(DirectoryEntry)} onSuccess Success callback with the
+ * @param {function(DirectoryEntry)=} opt_onSuccess Success callback with the
* display root directory as an argument.
- * @param {function(FileError)} onFailure Failure callback.
+ * @param {function(*)=} opt_onFailure Failure callback.
* @return {Promise}
*/
-VolumeInfo.prototype.resolveDisplayRoot = function(onSuccess, onFailure) {
+VolumeInfo.prototype.resolveDisplayRoot = function(opt_onSuccess,
+ opt_onFailure) {
if (!this.displayRootPromise_) {
// TODO(mtomasz): Do not add VolumeInfo which failed to resolve root, and
- // remove this if logic. Call onSuccess() always, instead.
+ // remove this if logic. Call opt_onSuccess() always, instead.
if (this.volumeType !== VolumeManagerCommon.VolumeType.DRIVE) {
if (this.fileSystem_)
this.displayRootPromise_ = Promise.resolve(this.fileSystem_.root);
@@ -183,8 +184,8 @@
this.displayRoot_ = displayRoot;
}.bind(this));
}
- if (onSuccess)
- this.displayRootPromise_.then(onSuccess, onFailure);
+ if (opt_onSuccess)
+ this.displayRootPromise_.then(opt_onSuccess, opt_onFailure);
return this.displayRootPromise_;
};
@@ -826,7 +827,7 @@
/**
* @param {string} key Key produced by |makeRequestKey_|.
- * @param {VolumeManagerCommon.VolumeError|'success'} status Status received
+ * @param {VolumeManagerCommon.VolumeError|string} status Status received
* from the API.
* @param {VolumeInfo=} opt_volumeInfo Volume info of the mounted volume.
* @private
diff --git a/ui/file_manager/file_manager/common/js/async_util.js b/ui/file_manager/file_manager/common/js/async_util.js
index f2bf6f8..dcd03e3 100644
--- a/ui/file_manager/file_manager/common/js/async_util.js
+++ b/ui/file_manager/file_manager/common/js/async_util.js
@@ -17,7 +17,7 @@
* sequentially done.
*
* @param {Array.<T>} array The array to be iterated.
- * @param {function(function(), T, number, Array.<T>} callback The iteration
+ * @param {function(function(), T, number, Array.<T>)} callback The iteration
* callback. The first argument is a callback to notify the completion of
* the iteration.
* @param {function()} completionCallback Called when all iterations are
@@ -75,7 +75,7 @@
};
/**
- * @return {boolean} Number of running tasks.
+ * @return {number} Number of running tasks.
*/
AsyncUtil.ConcurrentQueue.prototype.getRunningTasksCount = function() {
return this.pendingTasks_.length;
diff --git a/ui/file_manager/file_manager/common/js/error_util.js b/ui/file_manager/file_manager/common/js/error_util.js
index 67a393c..15cbc6f 100644
--- a/ui/file_manager/file_manager/common/js/error_util.js
+++ b/ui/file_manager/file_manager/common/js/error_util.js
@@ -17,7 +17,7 @@
// Overrides console.error() to count errors.
/**
- * @param {...Object} var_args Message to be logged.
+ * @param {...*} var_args Message to be logged.
*/
console.error = (function() {
var orig = console.error;
@@ -30,7 +30,7 @@
// Overrides console.assert() to count errors.
/**
* @param {boolean} condition If false, log a message and stack trace.
- * @param {...Object} var_args Objects to.
+ * @param {...*} var_args Objects to.
*/
console.assert = (function() {
var orig = console.assert;
@@ -48,7 +48,7 @@
* - Bind this object
*
* @param {Object} thisObject Object to be used as this.
- * @return {function} Wrapped function.
+ * @return {Function} Wrapped function.
*/
Function.prototype.wrap = function(thisObject) {
var func = this;
diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js
index 480b417..f5bf344 100644
--- a/ui/file_manager/file_manager/common/js/util.js
+++ b/ui/file_manager/file_manager/common/js/util.js
@@ -100,11 +100,13 @@
* @param {string} newName The new name.
* @param {function(Entry)} successCallback Callback invoked when the rename
* is successfully done.
- * @param {function(FileError)} errorCallback Callback invoked when an error
+ * @param {function(DOMError)} errorCallback Callback invoked when an error
* is found.
*/
util.rename = function(entry, newName, successCallback, errorCallback) {
- entry.getParent(function(parent) {
+ entry.getParent(function(parentEntry) {
+ var parent = /** @type {!DirectoryEntry} */ (parentEntry);
+
// Before moving, we need to check if there is an existing entry at
// parent/newName, since moveTo will overwrite it.
// Note that this way has some timing issue. After existing check,
@@ -134,7 +136,7 @@
* Remove a file or a directory.
* @param {Entry} entry The entry to remove.
* @param {function()} onSuccess The success callback.
- * @param {function(FileError)} onError The error callback.
+ * @param {function(DOMError)} onError The error callback.
*/
util.removeFileOrDirectory = function(entry, onSuccess, onError) {
if (entry.isDirectory)
@@ -205,11 +207,13 @@
* @param {number} begin Starting byte(included).
* @param {number} end Last byte(excluded).
* @param {function(File, Uint8Array)} callback Callback to invoke.
- * @param {function(FileError)} onError Error handler.
+ * @param {function(string)} onError Error handler.
*/
util.readFileBytes = function(file, begin, end, callback, onError) {
var fileReader = new FileReader();
- fileReader.onerror = onError;
+ fileReader.onerror = function(event) {
+ onError(event.type);
+ };
fileReader.onloadend = function() {
callback(file, new ByteReader(fileReader.result));
};
@@ -246,7 +250,7 @@
/**
* Extracts path from filesystem: URL.
* @param {string} url Filesystem URL.
- * @return {string} The path.
+ * @return {?string} The path.
*/
util.extractFilePath = function(url) {
var match =
@@ -423,7 +427,7 @@
var json = values[util.AppCache.KEY];
if (json) {
try {
- callback(JSON.parse(json));
+ callback(/** @type {Object} */ (JSON.parse(json)));
} catch (e) {
// The local storage item somehow got messed up, start fresh.
}
@@ -542,7 +546,7 @@
/**
* Checks, if the Files.app's window is in a full screen mode.
*
- * @param {AppWindow} appWindow App window to be maximized.
+ * @param {chrome.app.window.AppWindow} appWindow App window to be maximized.
* @return {boolean} True if the full screen mode is enabled.
*/
util.isFullScreen = function(appWindow) {
@@ -558,7 +562,7 @@
/**
* Toggles the full screen mode.
*
- * @param {AppWindow} appWindow App window to be maximized.
+ * @param {chrome.app.window.AppWindow} appWindow App window to be maximized.
* @param {boolean} enabled True for enabling, false for disabling.
*/
util.toggleFullScreen = function(appWindow, enabled) {
@@ -622,10 +626,8 @@
* Creates an instance of UserDOMError with given error name that looks like a
* FileError except that it does not have the deprecated FileError.code member.
*
- * TODO(uekawa): remove reference to FileError.
- *
* @param {string} name Error name for the file error.
- * @return {UserDOMError} FileError instance
+ * @return {DOMError} DOMError instance
*/
util.createDOMError = function(name) {
return new util.UserDOMError(name);
@@ -635,6 +637,7 @@
* Creates a DOMError-like object to be used in place of returning file errors.
*
* @param {string} name Error name for the file error.
+ * @extends {DOMError}
* @constructor
*/
util.UserDOMError = function(name) {
@@ -671,8 +674,8 @@
/**
* Compares two file systems.
- * @param {DOMFileSystem} fileSystem1 The file system to be compared.
- * @param {DOMFileSystem} fileSystem2 The file system to be compared.
+ * @param {FileSystem} fileSystem1 The file system to be compared.
+ * @param {FileSystem} fileSystem2 The file system to be compared.
* @return {boolean} True if the both file systems are equal. Also, returns true
* if both file systems are null.
*/
@@ -782,7 +785,7 @@
*/
util.URLsToEntries = function(urls, opt_callback) {
var promises = urls.map(function(url) {
- return new Promise(webkitResolveLocalFileSystemURL.bind(null, url)).
+ return new Promise(window.webkitResolveLocalFileSystemURL.bind(null, url)).
then(function(entry) {
return {entry: entry};
}, function(failureUrl) {
@@ -824,7 +827,7 @@
/**
* Returns whether the window is teleported or not.
- * @param {DOMWindow} window Window.
+ * @param {Window} window Window.
* @return {Promise.<boolean>} Whether the window is teleported or not.
*/
util.isTeleported = function(window) {
@@ -841,7 +844,7 @@
* desktop of the running profile.
*
* TODO(hirono): Move the function from the util namespace.
- * @param {cr.ui.AlertDialog} alertDialog Alert dialog to be shown.
+ * @param {cr.ui.dialogs.AlertDialog} alertDialog Alert dialog to be shown.
* @param {Array.<Entry>} entries List of opened entries.
*/
util.showOpenInOtherDesktopAlert = function(alertDialog, entries) {
@@ -862,16 +865,16 @@
return;
}
- var title = entries.size > 1 ?
+ var title = entries.length > 1 ?
entries[0].name + '\u2026' /* ellipsis */ : entries[0].name;
- var message = strf(entries.size > 1 ?
+ var message = strf(entries.length > 1 ?
'OPEN_IN_OTHER_DESKTOP_MESSAGE_PLURAL' :
'OPEN_IN_OTHER_DESKTOP_MESSAGE',
displayName,
currentId);
// Show the dialog.
- alertDialog.showWithTitle(title, message);
+ alertDialog.showWithTitle(title, message, null, null, null);
}.bind(this));
};
@@ -998,7 +1001,7 @@
name,
function(valid) {
if (valid)
- fulfill();
+ fulfill(null);
else
reject(str('ERROR_LONG_NAME'));
});
diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css
index 32145cb..1db9324 100644
--- a/ui/file_manager/file_manager/foreground/css/file_manager.css
+++ b/ui/file_manager/file_manager/foreground/css/file_manager.css
@@ -1683,6 +1683,7 @@
#progress-center-close-view {
opacity: 1;
+ padding-top: 10px;
transition: opacity 300ms linear;
}
diff --git a/ui/file_manager/file_manager/foreground/js/app_installer.js b/ui/file_manager/file_manager/foreground/js/app_installer.js
index 3722480..9508676 100644
--- a/ui/file_manager/file_manager/foreground/js/app_installer.js
+++ b/ui/file_manager/file_manager/foreground/js/app_installer.js
@@ -9,7 +9,6 @@
*
* @param {string} itemId Item id to be installed.
* @constructor
- * @extends {cr.EventType}
*/
function AppInstaller(itemId) {
this.itemId_ = itemId;
diff --git a/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp b/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp
index 57ff0ac..504f041 100644
--- a/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp
+++ b/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp
@@ -7,7 +7,14 @@
'target_name': 'main_scripts',
'variables': {
'depends': [
+ '../../../../../third_party/jstemplate/compiled_resources.gyp:jstemplate',
'../../../../../ui/webui/resources/js/cr/ui/dialogs.js',
+ '../../common/js/util.js',
+ '../../common/js/async_util.js',
+ '../../common/js/volume_manager_common.js',
+ '../../background/js/file_operation_manager.js',
+ '../../background/js/volume_manager.js',
+ '../../background/js/progress_center.js',
],
'externs': [
'<(CLOSURE_DIR)/externs/chrome_send_externs.js',
diff --git a/ui/file_manager/file_manager/foreground/js/cws_container_client.js b/ui/file_manager/file_manager/foreground/js/cws_container_client.js
index a775976..616617c 100644
--- a/ui/file_manager/file_manager/foreground/js/cws_container_client.js
+++ b/ui/file_manager/file_manager/foreground/js/cws_container_client.js
@@ -205,7 +205,7 @@
* Send a message to the widget. This method shouldn't be called directly,
* should from more specified posting function (eg. postXyzMessage_()).
*
- * @param {object} message Message object to be posted.
+ * @param {Object} message Message object to be posted.
* @private
*/
CWSContainerClient.prototype.postMessage_ = function(message) {
diff --git a/ui/file_manager/file_manager/foreground/js/directory_contents.js b/ui/file_manager/file_manager/foreground/js/directory_contents.js
index 2565a0e..4bcbea2 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_contents.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_contents.js
@@ -22,7 +22,7 @@
* completion.
* @param {function()} successCallback Called when the scan is completed
* successfully.
- * @param {function(FileError)} errorCallback Called an error occurs.
+ * @param {function(DOMError)} errorCallback Called an error occurs.
*/
ContentScanner.prototype.scan = function(
entriesCallback, successCallback, errorCallback) {
diff --git a/ui/file_manager/file_manager/foreground/js/directory_model.js b/ui/file_manager/file_manager/foreground/js/directory_model.js
index b06971f..eb7828e 100644
--- a/ui/file_manager/file_manager/foreground/js/directory_model.js
+++ b/ui/file_manager/file_manager/foreground/js/directory_model.js
@@ -20,6 +20,7 @@
* @param {MetadataCache} metadataCache The metadata cache service.
* @param {VolumeManagerWrapper} volumeManager The volume manager.
* @constructor
+ * @extends {cr.EventTarget}
*/
function DirectoryModel(singleSelection, fileFilter, fileWatcher,
metadataCache, volumeManager) {
@@ -375,7 +376,7 @@
*
* This should be used when changing directory or initiating a new search.
*
- * @param {DirectoryContentes} newDirContents New DirectoryContents instance to
+ * @param {DirectoryContents} newDirContents New DirectoryContents instance to
* replace currentDirContents_.
* @param {function(boolean)} callback Callback with result. True if the scan
* is completed successfully, false if the scan is failed.
@@ -741,7 +742,7 @@
*
* @param {string} name Directory name.
* @param {function(DirectoryEntry)} successCallback Callback on success.
- * @param {function(FileError)} errorCallback Callback on failure.
+ * @param {function(DOMError)} errorCallback Callback on failure.
* @param {function()} abortCallback Callback on abort (cancelled by user).
*/
DirectoryModel.prototype.createDirectory = function(name,
@@ -793,7 +794,7 @@
successCallback(newEntry);
}
}.bind(this), function(reason) {
- errorCallback(reason);
+ errorCallback(/** @type {DOMError} */ (reason));
});
};
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js
index dc66f71..eebb3ea 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -19,7 +19,7 @@
/**
* Volume manager.
- * @type {VolumeManager}
+ * @type {VolumeManagerWrapper}
* @private
*/
this.volumeManager_ = null;
@@ -88,7 +88,7 @@
/**
* Handler for the change of file selection.
- * @type {SelectionHandler}
+ * @type {FileSelectionHandler}
* @private
*/
this.selectionHandler_ = null;
@@ -104,7 +104,7 @@
/**
* Current list type.
- * @type {ListType}
+ * @type {FileManager.ListType}
* @private
*/
this.listType_ = null;
@@ -169,11 +169,11 @@
this.directoryTree_ = null;
/**
- * Auto-complete list.
- * @type {AutocompleteList}
+ * Controller for search UI.
+ * @type {SearchController}
* @private
*/
- this.autocompleteList_ = null;
+ this.searchController_ = null;
/**
* Banners in the file list.
@@ -218,7 +218,7 @@
/**
* Default task picker.
- * @type {DefaultActionDialog}
+ * @type {cr.filebrowser.DefaultActionDialog}
*/
this.defaultTaskPicker = null;
@@ -387,13 +387,6 @@
this.listContainer_ = null;
/**
- * The input element in the search box.
- * @type {HTMLInputElement}
- * @private
- */
- this.searchBox_ = null;
-
- /**
* The file type selector.
* @type {HTMLSelectElement}
* @private
@@ -412,21 +405,21 @@
/**
* Bound function for onCopyProgress_.
- * @type {this:FileManager, function(Event)}
+ * @type {function(this:FileManager, Event)}
* @private
*/
this.onCopyProgressBound_ = null;
/**
* Bound function for onEntriesChanged_.
- * @type {this:FileManager, function(Event)}
+ * @type {function(this:FileManager, Event)}
* @private
*/
this.onEntriesChangedBound_ = null;
/**
* Bound function for onCancel_.
- * @type {this:FileManager, function(Event)}
+ * @type {function(this:FileManager, Event)}
* @private
*/
this.onCancelBound_ = null;
@@ -751,8 +744,10 @@
}
};
- // Public statics.
-
+ /**
+ * @enum {string}
+ * @const
+ */
FileManager.ListType = {
DETAIL: 'detail',
THUMBNAIL: 'thumb'
@@ -1320,11 +1315,12 @@
this.table_, this.metadataCache_, this.volumeManager_, fullPage);
FileGrid.decorate(this.grid_, this.metadataCache_, this.volumeManager_);
- this.ui_.locationBreadcrumbs = new BreadcrumbsController(
+ this.ui_.locationLine = new LocationLine(
dom.querySelector('#location-breadcrumbs'),
+ dom.querySelector('#location-volume-icon'),
this.metadataCache_,
this.volumeManager_);
- this.ui_.locationBreadcrumbs.addEventListener(
+ this.ui_.locationLine.addEventListener(
'pathclick', this.onBreadcrumbClick_.bind(this));
this.previewPanel_ = new PreviewPanel(
@@ -1402,29 +1398,6 @@
this.dialogDom_.ownerDocument.defaultView.addEventListener(
'resize', this.onResize_.bind(this));
- this.searchBox_ = this.ui_.searchBox.inputElement;
- this.searchBox_.addEventListener(
- 'input', this.onSearchBoxUpdate_.bind(this));
- this.ui_.searchBox.clearButton.addEventListener(
- 'click', this.onSearchClearButtonClick_.bind(this));
-
- this.autocompleteList_ = this.ui_.searchBox.autocompleteList;
- this.autocompleteList_.requestSuggestions =
- this.requestAutocompleteSuggestions_.bind(this);
-
- // Instead, open the suggested item when Enter key is pressed or
- // mouse-clicked.
- this.autocompleteList_.handleEnterKeydown = function(event) {
- this.openAutocompleteSuggestion_();
- this.lastAutocompleteQuery_ = '';
- this.autocompleteList_.suggestions = [];
- }.bind(this);
- this.autocompleteList_.addEventListener('mousedown', function(event) {
- this.openAutocompleteSuggestion_();
- this.lastAutocompleteQuery_ = '';
- this.autocompleteList_.suggestions = [];
- }.bind(this));
-
this.defaultActionMenuItem_ =
this.dialogDom_.querySelector('#default-action');
@@ -1554,6 +1527,31 @@
this.onExternallyUnmounted_.bind(this));
}
+ // Create search controller.
+ this.searchController_ = new SearchController(
+ this.ui_.searchBox,
+ this.ui_.locationLine,
+ this.directoryModel_,
+ this.volumeManager_,
+ {
+ // TODO (hirono): Make the real task controller and pass it here.
+ doAction: function(entry) {
+ if (this.dialogType == DialogType.FULL_PAGE) {
+ this.metadataCache_.get([entry], 'external', function(props) {
+ var tasks = new FileTasks(this);
+ tasks.init([entry], [props[0].contentMimeType || '']);
+ tasks.executeDefault();
+ }.bind(this));
+ } else {
+ var selection = this.getSelection();
+ if (selection.entries.length === 1 &&
+ util.isSameEntry(selection.entries[0], entry)) {
+ this.onOk_();
+ }
+ }
+ }.bind(this)
+ });
+
// Update metadata to change 'Today' and 'Yesterday' dates.
var today = new Date();
today.setHours(0);
@@ -1885,7 +1883,7 @@
if (this.directoryTree_)
this.directoryTree_.relayout();
- this.ui_.locationBreadcrumbs.truncate();
+ this.ui_.locationLine.truncate();
};
/**
@@ -1981,8 +1979,9 @@
// If this dialog attempts to open file(s) and the selection is a
// directory, the selection should be the current directory.
if (DialogType.isOpenFileDialog(this.dialogType) &&
- inEntry.isDirectory)
+ inEntry.isDirectory) {
nextCurrentDirEntry = inEntry;
+ }
// By default, the selection should be selected entry and the
// parent directory of it should be the current directory.
@@ -2027,6 +2026,45 @@
}.bind(this));
}.bind(this));
+ // Check if the next current directory is not a virtual directory which is
+ // not available in UI. This may happen to shared on Drive.
+ queue.run(function(callback) {
+ if (!nextCurrentDirEntry) {
+ callback();
+ return;
+ }
+ var locationInfo = this.volumeManager_.getLocationInfo(
+ nextCurrentDirEntry);
+ // If we can't check, assume that the directory is illegal.
+ if (!locationInfo) {
+ nextCurrentDirEntry = null;
+ callback();
+ return;
+ }
+ // Having root directory of DRIVE_OTHER here should be only for shared
+ // with me files. Fallback to Drive root in such case.
+ if (locationInfo.isRootEntry && locationInfo.rootType ===
+ VolumeManagerCommon.RootType.DRIVE_OTHER) {
+ var volumeInfo = this.volumeManager_.getVolumeInfo(nextCurrentDirEntry);
+ if (!volumeInfo) {
+ nextCurrentDirEntry = null;
+ callback();
+ return;
+ }
+ volumeInfo.resolveDisplayRoot().then(
+ function(entry) {
+ nextCurrentDirEntry = entry;
+ callback();
+ }).catch(function(error) {
+ console.error(error.stack || error);
+ nextCurrentDirEntry = null;
+ callback();
+ });
+ } else {
+ callback();
+ }
+ }.bind(this));
+
// If the directory to be changed to is still not resolved, then fallback
// to the default display root.
queue.run(function(callback) {
@@ -2070,7 +2108,6 @@
}.bind(this));
}.bind(this));
-
// Finalize.
queue.run(function(callback) {
// Check directory change.
@@ -2745,7 +2782,7 @@
}
this.selectionHandler_.onFileSelectionChanged();
- this.ui_.searchBox.clear();
+ this.searchController_.clear();
// TODO(mtomasz): Consider remembering the selection.
util.updateAppState(
this.getCurrentDirectoryEntry() ?
@@ -2758,10 +2795,9 @@
this.updateUnformattedVolumeStatus_();
this.updateTitle_();
- this.ui_.updateLocationLine(
- this.volumeManager_, this.getCurrentDirectoryEntry());
var currentEntry = this.getCurrentDirectoryEntry();
+ this.ui_.locationLine.show(currentEntry);
this.previewPanel_.currentEntry = util.isFakeEntry(currentEntry) ?
null : currentEntry;
};
@@ -3745,7 +3781,7 @@
*
* @param {DirectoryEntry} parentEntry The URL of the parent directory entry.
* @param {string} name New file or folder name.
- * @param {function} onDone Function to invoke when user closes the
+ * @param {function(boolean)} onDone Function to invoke when user closes the
* warning box or immediatelly if file name is correct. If the name was
* valid it is passed true, and false otherwise.
* @private
@@ -3788,244 +3824,6 @@
chrome.fileManagerPrivate.setPreferences(changeInfo);
};
- /**
- * Invoked when the search box is changed.
- *
- * @param {Event} event The changed event.
- * @private
- */
- FileManager.prototype.onSearchBoxUpdate_ = function(event) {
- var searchString = this.searchBox_.value;
-
- if (this.isOnDrive()) {
- // When the search text is changed, finishes the search and showes back
- // the last directory by passing an empty string to
- // {@code DirectoryModel.search()}.
- if (this.directoryModel_.isSearching() &&
- this.lastSearchQuery_ != searchString) {
- this.doSearch('');
- }
-
- // On drive, incremental search is not invoked since we have an auto-
- // complete suggestion instead.
- return;
- }
-
- this.search_(searchString);
- };
-
- /**
- * Handle the search clear button click.
- * @private
- */
- FileManager.prototype.onSearchClearButtonClick_ = function() {
- this.ui_.searchBox.clear();
- this.onSearchBoxUpdate_();
- };
-
- /**
- * Search files and update the list with the search result.
- *
- * @param {string} searchString String to be searched with.
- * @private
- */
- FileManager.prototype.search_ = function(searchString) {
- var noResultsDiv = this.document_.getElementById('no-search-results');
-
- var reportEmptySearchResults = function() {
- if (this.directoryModel_.getFileList().length === 0) {
- // The string 'SEARCH_NO_MATCHING_FILES_HTML' may contain HTML tags,
- // hence we escapes |searchString| here.
- var html = strf('SEARCH_NO_MATCHING_FILES_HTML',
- util.htmlEscape(searchString));
- noResultsDiv.innerHTML = html;
- noResultsDiv.setAttribute('show', 'true');
- } else {
- noResultsDiv.removeAttribute('show');
- }
-
- // If the current location is somewhere in Drive, all files in Drive can
- // be listed as search results regardless of current location.
- // In this case, showing current location is confusing, so use the Drive
- // root "My Drive" as the current location.
- var entry = this.getCurrentDirectoryEntry();
- var locationInfo = this.volumeManager_.getLocationInfo(entry);
- if (locationInfo && locationInfo.isDriveBased) {
- var rootEntry = locationInfo.volumeInfo.displayRoot;
- if (rootEntry)
- this.ui_.updateLocationLine(this.volumeManager_, rootEntry);
- }
- };
-
- var hideNoResultsDiv = function() {
- noResultsDiv.removeAttribute('show');
- this.ui_.updateLocationLine(
- this.volumeManager_, this.getCurrentDirectoryEntry());
- };
-
- this.doSearch(searchString,
- reportEmptySearchResults.bind(this),
- hideNoResultsDiv.bind(this));
- };
-
- /**
- * Performs search and displays results.
- *
- * @param {string} searchString Query that will be searched for.
- * @param {function()=} opt_onSearchRescan Function that will be called when
- * the search directory is rescanned (i.e. search results are displayed).
- * @param {function()=} opt_onClearSearch Function to be called when search
- * state gets cleared.
- */
- FileManager.prototype.doSearch = function(
- searchString, opt_onSearchRescan, opt_onClearSearch) {
- var onSearchRescan = opt_onSearchRescan || function() {};
- var onClearSearch = opt_onClearSearch || function() {};
-
- this.lastSearchQuery_ = searchString;
- this.directoryModel_.search(searchString, onSearchRescan, onClearSearch);
- };
-
- /**
- * Requests autocomplete suggestions for files on Drive.
- * Once the suggestions are returned, the autocomplete popup will show up.
- *
- * @param {string} query The text to autocomplete from.
- * @private
- */
- FileManager.prototype.requestAutocompleteSuggestions_ = function(query) {
- query = query.trimLeft();
-
- // Only Drive supports auto-compelete
- if (!this.isOnDrive())
- return;
-
- // Remember the most recent query. If there is an other request in progress,
- // then it's result will be discarded and it will call a new request for
- // this query.
- this.lastAutocompleteQuery_ = query;
- if (this.autocompleteSuggestionsBusy_)
- return;
-
- if (!query) {
- this.autocompleteList_.suggestions = [];
- return;
- }
-
- var headerItem = {isHeaderItem: true, searchQuery: query};
- if (!this.autocompleteList_.dataModel ||
- this.autocompleteList_.dataModel.length == 0)
- this.autocompleteList_.suggestions = [headerItem];
- else
- // Updates only the head item to prevent a flickering on typing.
- this.autocompleteList_.dataModel.splice(0, 1, headerItem);
-
- // The autocomplete list should be resized and repositioned here as the
- // search box is resized when it's focused.
- this.autocompleteList_.syncWidthAndPositionToInput();
-
- this.autocompleteSuggestionsBusy_ = true;
-
- var searchParams = {
- 'query': query,
- 'types': 'ALL',
- 'maxResults': 4
- };
- chrome.fileManagerPrivate.searchDriveMetadata(
- searchParams,
- function(suggestions) {
- this.autocompleteSuggestionsBusy_ = false;
-
- // Discard results for previous requests and fire a new search
- // for the most recent query.
- if (query != this.lastAutocompleteQuery_) {
- this.requestAutocompleteSuggestions_(this.lastAutocompleteQuery_);
- return;
- }
-
- // Keeps the items in the suggestion list.
- this.autocompleteList_.suggestions = [headerItem].concat(suggestions);
- }.bind(this));
- };
-
- /**
- * Opens the currently selected suggestion item.
- * @private
- */
- FileManager.prototype.openAutocompleteSuggestion_ = function() {
- var selectedItem = this.autocompleteList_.selectedItem;
-
- // If the entry is the search item or no entry is selected, just change to
- // the search result.
- if (!selectedItem || selectedItem.isHeaderItem) {
- var query = selectedItem ?
- selectedItem.searchQuery : this.searchBox_.value;
- this.search_(query);
- return;
- }
-
- var entry = selectedItem.entry;
- // If the entry is a directory, just change the directory.
- if (entry.isDirectory) {
- this.onDirectoryAction_(entry);
- return;
- }
-
- var entries = [entry];
- var self = this;
-
- // To open a file, first get the mime type.
- this.metadataCache_.get(entries, 'external', function(props) {
- var mimeType = props[0].contentMimeType || '';
- var mimeTypes = [mimeType];
- var openIt = function() {
- if (self.dialogType == DialogType.FULL_PAGE) {
- var tasks = new FileTasks(self);
- tasks.init(entries, mimeTypes);
- tasks.executeDefault();
- } else {
- self.onOk_();
- }
- };
-
- // Change the current directory to the directory that contains the
- // selected file. Note that this is necessary for an image or a video,
- // which should be opened in the gallery mode, as the gallery mode
- // requires the entry to be in the current directory model. For
- // consistency, the current directory is always changed regardless of
- // the file type.
- entry.getParent(function(parentEntry) {
- // Check if the parent entry points /drive/other or not.
- // If so it just opens the file.
- var locationInfo = self.volumeManager_.getLocationInfo(parentEntry);
- if (!locationInfo ||
- (locationInfo.isRootEntry &&
- locationInfo.rootType ===
- VolumeManagerCommon.RootType.DRIVE_OTHER)) {
- openIt();
- return;
- }
- var onDirectoryChanged = function(event) {
- self.directoryModel_.removeEventListener('scan-completed',
- onDirectoryChanged);
- self.directoryModel_.selectEntry(entry);
- openIt();
- };
- // changeDirectoryEntry() returns immediately. We should wait until the
- // directory scan is complete.
- self.directoryModel_.addEventListener('scan-completed',
- onDirectoryChanged);
- self.directoryModel_.changeDirectoryEntry(
- parentEntry,
- function() {
- // Remove the listner if the change directory failed.
- self.directoryModel_.removeEventListener('scan-completed',
- onDirectoryChanged);
- });
- });
- });
- };
-
FileManager.prototype.decorateSplitter = function(splitterElement) {
var self = this;
@@ -4100,7 +3898,7 @@
};
/**
- * @return {ArrayDataModel} File list.
+ * @return {cr.ui.ArrayDataModel} File list.
*/
FileManager.prototype.getFileList = function() {
return this.directoryModel_.getFileList();
diff --git a/ui/file_manager/file_manager/foreground/js/file_selection.js b/ui/file_manager/file_manager/foreground/js/file_selection.js
index 6b957b3..c236acd 100644
--- a/ui/file_manager/file_manager/foreground/js/file_selection.js
+++ b/ui/file_manager/file_manager/foreground/js/file_selection.js
@@ -59,7 +59,7 @@
/**
* Computes data required to get file tasks and requests the tasks.
*
- * @param {function} callback The callback.
+ * @param {function()} callback The callback.
*/
FileSelection.prototype.createTasks = function(callback) {
if (!this.fileManager_.isOnDrive()) {
@@ -88,7 +88,7 @@
/**
* Computes the total size of selected files.
*
- * @param {function} callback Completion callback. Not called when cancelled,
+ * @param {function()} callback Completion callback. Not called when cancelled,
* or a new call has been invoked in the meantime.
*/
FileSelection.prototype.computeBytes = function(callback) {
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks.js b/ui/file_manager/file_manager/foreground/js/file_tasks.js
index 4d459d8..1ed2818 100644
--- a/ui/file_manager/file_manager/foreground/js/file_tasks.js
+++ b/ui/file_manager/file_manager/foreground/js/file_tasks.js
@@ -454,7 +454,7 @@
/**
* Checks whether the remote files are available right now.
*
- * @param {function} callback The callback.
+ * @param {function()} callback The callback.
* @private
*/
FileTasks.prototype.checkAvailability_ = function(callback) {
@@ -710,7 +710,8 @@
/**
* Shows modal action picker dialog with currently available list of tasks.
*
- * @param {DefaultActionDialog} actionDialog Action dialog to show and update.
+ * @param {cr.filebrowser.DefaultActionDialog} actionDialog Action dialog to
+ * show and update.
* @param {string} title Title to use.
* @param {string} message Message to use.
* @param {function(Object)} onSuccess Callback to pass selected task.
diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
index 630b1ce..e3b4c2f 100644
--- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
@@ -256,7 +256,7 @@
/**
* Obtains entries that need to share with me.
* The method also observers child entries of the given entries.
- * @param {Array.<Entries>} entries Entries.
+ * @param {Array.<Entry>} entries Entries.
* @return {Promise} Promise to be fulfilled with the entries that need to
* share.
*/
@@ -950,7 +950,7 @@
*
* @this {FileTransferController}
* @param {string} command 'copy', 'cut' or 'paste'.
- * @param {function} handler Event handler.
+ * @param {function(Event)} handler Event handler.
*/
simulateCommand_: function(command, handler) {
var iframe = this.document_.querySelector('#command-dispatcher');
diff --git a/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js b/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js
index 19d9207..ca21d09 100644
--- a/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js
+++ b/ui/file_manager/file_manager/foreground/js/folder_shortcuts_data_model.js
@@ -409,8 +409,8 @@
* Creates a permutation array for 'permuted' event, which is compatible with
* a permutation array used in cr/ui/array_data_model.js.
*
- * @param {array} oldArray Previous array before changing.
- * @param {array} newArray New array after changing.
+ * @param {Array.<Entry>} oldArray Previous array before changing.
+ * @param {Array.<Entry>} newArray New array after changing.
* @return {Array.<number>} Created permutation array.
* @private
*/
diff --git a/ui/file_manager/file_manager/foreground/js/main_scripts.js b/ui/file_manager/file_manager/foreground/js/main_scripts.js
index 7264ecb..8fd4a36 100644
--- a/ui/file_manager/file_manager/foreground/js/main_scripts.js
+++ b/ui/file_manager/file_manager/foreground/js/main_scripts.js
@@ -93,9 +93,9 @@
//<include src="metadata/metadata_cache.js">
//<include src="navigation_list_model.js">
//<include src="progress_center_item_group.js">
+//<include src="search_controller.js">
//<include src="share_client.js">
//<include src="thumbnail_loader.js">
-//<include src="ui/breadcrumbs_controller.js">
//<include src="ui/conflict_dialog.js">
//<include src="ui/default_action_dialog.js">
//<include src="ui/directory_tree.js">
@@ -105,6 +105,7 @@
//<include src="ui/file_grid.js">
//<include src="ui/file_manager_ui.js">
//<include src="ui/file_table.js">
+//<include src="ui/location_line.js">
//<include src="ui/multi_profile_share_dialog.js">
//<include src="ui/preview_panel.js">
//<include src="ui/progress_center_panel.js">
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/id3_parser.js b/ui/file_manager/file_manager/foreground/js/metadata/id3_parser.js
index 05626b9..05a541d 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/id3_parser.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/id3_parser.js
@@ -252,7 +252,7 @@
* @param {File} file File object to parse.
* @param {Object} metadata Metadata object of the file.
* @param {function(Object)} callback Success callback.
- * @param {function(etring)} onError Error callback.
+ * @param {function(string)} onError Error callback.
*/
Id3Parser.prototype.parse = function(file, metadata, callback, onError) {
var self = this;
@@ -270,7 +270,7 @@
*/
function readTail(file) {
util.readFileBytes(file, file.size - 128, file.size,
- this.nextStep, this.onError, this);
+ this.nextStep, this.onError);
},
/**
@@ -313,8 +313,7 @@
'id3v2parser',
[
function readHead(file) {
- util.readFileBytes(file, 0, 10, this.nextStep, this.onError,
- this);
+ util.readFileBytes(file, 0, 10, this.nextStep, this.onError);
},
/**
@@ -333,7 +332,7 @@
id3v2.size = Id3Parser.readSynchSafe_(reader, 4);
util.readFileBytes(file, 10, 10 + id3v2.size, this.nextStep,
- this.onError, this);
+ this.onError);
} else {
this.finish();
}
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
index c9dbd7c..0d1b468 100644
--- a/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
+++ b/ui/file_manager/file_manager/foreground/js/metadata/metadata_cache.js
@@ -495,13 +495,20 @@
MetadataCache.prototype.addObserver = function(
entry, relation, type, observer) {
var entryURL = entry.toURL();
+
+ // Escape following regexp special characters:
+ // \^$.*+?|&{}[]()<>
+ var escapedEntryURL = entryURL.replace(
+ /([\\\^\$\.\*\+\?\|\&\{\}\[\]\(\)\<\>])/g,
+ '\\$1');
+
var re;
if (relation === MetadataCache.CHILDREN)
- re = entryURL + '(/[^/]*)?';
+ re = escapedEntryURL + '(/[^/]*)?';
else if (relation === MetadataCache.DESCENDANTS)
- re = entryURL + '(/.*)?';
+ re = escapedEntryURL + '(/.*)?';
else
- re = entryURL;
+ re = escapedEntryURL;
var id = ++this.observerId_;
this.observers_.push({
diff --git a/ui/file_manager/file_manager/foreground/js/search_controller.js b/ui/file_manager/file_manager/foreground/js/search_controller.js
new file mode 100644
index 0000000..faa8172
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/js/search_controller.js
@@ -0,0 +1,269 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+/**
+ * Controller for searching.
+ * @param {SearchBox} ui Search box UI element.
+ * @param {LocationLine} locationLine Location line UI element.
+ * @param {DirectoryModel} directoryModel Directory model.
+ * @param {{doAction: function(FileEntry)}} taskController Task controller to
+ * execute the selected item.
+ * @constructor
+ */
+function SearchController(
+ searchBox, locationLine, directoryModel, volumeManager, taskController) {
+ /**
+ * @type {SearchBox}
+ * @private
+ */
+ this.searchBox_ = searchBox;
+
+ /**
+ * @type {FileManagerUI}
+ * @private
+ */
+ this.locationLine_ = locationLine;
+
+ /**
+ * @type {DirectoryModel}
+ * @private
+ */
+ this.directoryModel_ = directoryModel;
+
+ /**
+ * @type {VolumeManager}
+ * @private
+ */
+ this.volumeManager_ = volumeManager;
+
+ /**
+ * @type {{doAction: function(FileEntry)}}
+ * @private
+ */
+ this.taskController_ = taskController;
+
+ searchBox.addEventListener(
+ SearchBox.EventType.TEXT_CHANGE, this.onTextChange_.bind(this));
+ searchBox.addEventListener(
+ SearchBox.EventType.ITEM_SELECT, this.onItemSelect_.bind(this));
+}
+
+SearchController.prototype = {
+ /**
+ * Obtains current directory's locaiton info.
+ * @type {LocationInfo}
+ * @private
+ */
+ get currentLocationInfo_() {
+ var entry = this.directoryModel_.getCurrentDirEntry();
+ return entry && this.volumeManager_.getLocationInfo(entry);
+ },
+
+ /**
+ * Whether the current directory is on drive or not.
+ * @private
+ */
+ get isOnDrive_() {
+ var currentLocationInfo = this.currentLocationInfo_;
+ return currentLocationInfo && currentLocationInfo.isDriveBased;
+ }
+};
+
+/**
+ * Clears the search state.
+ */
+SearchController.prototype.clear = function() {
+ this.lastSearchQuery_ = '';
+ this.searchBox_.clear();
+};
+
+/**
+ * Handles text change event.
+ * @private
+ */
+SearchController.prototype.onTextChange_ = function() {
+ var searchString = this.searchBox_.inputElement.value.trimLeft();
+
+ // On drive, incremental search is not invoked since we have an auto-
+ // complete suggestion instead.
+ if (!this.isOnDrive_) {
+ this.search_(searchString);
+ return;
+ }
+
+ // When the search text is changed, finishes the search and showes back
+ // the last directory by passing an empty string to
+ // {@code DirectoryModel.search()}.
+ if (this.directoryModel_.isSearching() &&
+ this.lastSearchQuery_ != searchString) {
+ this.lastSearchQuery_ = '';
+ this.directoryModel_.search('', function() {}, function() {});
+ }
+
+ this.requestAutocompleteSuggestions_();
+};
+
+/**
+ * Updates autocompletion items.
+ * @private
+ */
+SearchController.prototype.requestAutocompleteSuggestions_ = function() {
+ // Remember the most recent query. If there is an other request in progress,
+ // then it's result will be discarded and it will call a new request for
+ // this query.
+ var searchString = this.searchBox_.inputElement.value.trimLeft();
+ this.lastAutocompleteQuery_ = searchString;
+ if (this.autocompleteSuggestionsBusy_)
+ return;
+
+ // Clear search if the query empty.
+ if (!searchString) {
+ this.searchBox_.autocompleteList.suggestions = [];
+ return;
+ }
+
+ // Add header item.
+ var headerItem = {isHeaderItem: true, searchQuery: searchString};
+ if (!this.searchBox_.autocompleteList.dataModel ||
+ this.searchBox_.autocompleteList.dataModel.length == 0) {
+ this.searchBox_.autocompleteList.suggestions = [headerItem];
+ } else {
+ // Updates only the head item to prevent a flickering on typing.
+ this.searchBox_.autocompleteList.dataModel.splice(0, 1, headerItem);
+ }
+
+ // The autocomplete list should be resized and repositioned here as the
+ // search box is resized when it's focused.
+ this.searchBox_.autocompleteList.syncWidthAndPositionToInput();
+ this.autocompleteSuggestionsBusy_ = true;
+
+ chrome.fileManagerPrivate.searchDriveMetadata(
+ {
+ query: searchString,
+ types: 'ALL',
+ maxResults: 4
+ },
+ function(suggestions) {
+ this.autocompleteSuggestionsBusy_ = false;
+
+ // Discard results for previous requests and fire a new search
+ // for the most recent query.
+ if (searchString != this.lastAutocompleteQuery_) {
+ this.requestAutocompleteSuggestions_(this.lastAutocompleteQuery_);
+ return;
+ }
+
+ // Keeps the items in the suggestion list.
+ this.searchBox_.autocompleteList.suggestions =
+ [headerItem].concat(suggestions);
+ }.bind(this));
+};
+
+/**
+ * Opens the currently selected suggestion item.
+ * @private
+ */
+SearchController.prototype.onItemSelect_ = function() {
+ var selectedItem = this.searchBox_.autocompleteList.selectedItem;
+
+ // Clear the current auto complete list.
+ this.lastAutocompleteQuery_ = '';
+ this.searchBox_.autocompleteList.suggestions = [];
+
+ // If the entry is the search item or no entry is selected, just change to
+ // the search result.
+ if (!selectedItem || selectedItem.isHeaderItem) {
+ var query = selectedItem ?
+ selectedItem.searchQuery : this.searchBox_.inputElement.value;
+ this.search_(query);
+ return;
+ }
+
+ // Clear the search box if an item except for the search item is
+ // selected. Eventually the following directory change clears the search box,
+ // but if the selected item is located just under /drive/other, the current
+ // directory will not changed. For handling the case, and for improving
+ // response time, clear the text manually here.
+ this.clear();
+
+ // If the entry is a directory, just change the directory.
+ var entry = selectedItem.entry;
+ if (entry.isDirectory) {
+ this.directoryModel_.changeDirectoryEntry(entry);
+ return;
+ }
+
+ // Change the current directory to the directory that contains the
+ // selected file. Note that this is necessary for an image or a video,
+ // which should be opened in the gallery mode, as the gallery mode
+ // requires the entry to be in the current directory model. For
+ // consistency, the current directory is always changed regardless of
+ // the file type.
+ entry.getParent(function(parentEntry) {
+ // Check if the parent entry points /drive/other or not.
+ // If so it just opens the file.
+ var locationInfo = this.volumeManager_.getLocationInfo(parentEntry);
+ if (!locationInfo ||
+ (locationInfo.isRootEntry &&
+ locationInfo.rootType === VolumeManagerCommon.RootType.DRIVE_OTHER)) {
+ this.taskController_.doAction(entry);
+ return;
+ }
+ // If the parent entry can be /drive/other.
+ this.directoryModel_.changeDirectoryEntry(
+ parentEntry,
+ function() {
+ this.directoryModel_.selectEntry(entry);
+ this.taskController_.doAction(entry);
+ }.bind(this));
+ }.bind(this));
+};
+
+/**
+ * Search files and update the list with the search result.
+ * @param {string} searchString String to be searched with.
+ * @private
+ */
+SearchController.prototype.search_ = function(searchString) {
+ var noResultsDiv = this.searchBox_.noResultMessage;
+
+ var reportEmptySearchResults = function() {
+ if (this.directoryModel_.getFileList().length === 0) {
+ // The string 'SEARCH_NO_MATCHING_FILES_HTML' may contain HTML tags,
+ // hence we escapes |searchString| here.
+ var html = strf(
+ 'SEARCH_NO_MATCHING_FILES_HTML',
+ util.htmlEscape(searchString));
+ noResultsDiv.innerHTML = html;
+ noResultsDiv.setAttribute('show', 'true');
+ } else {
+ noResultsDiv.removeAttribute('show');
+ }
+
+ // If the current location is somewhere in Drive, all files in Drive can
+ // be listed as search results regardless of current location.
+ // In this case, showing current location is confusing, so use the Drive
+ // root "My Drive" as the current location.
+ if (this.isOnDrive_) {
+ var locationInfo = this.currentLocationInfo_;
+ var rootEntry = locationInfo.volumeInfo.displayRoot;
+ if (rootEntry)
+ this.locationLine_.show(rootEntry);
+ }
+ };
+
+ var hideNoResultsDiv = function() {
+ noResultsDiv.removeAttribute('show');
+ this.locationLine_.show(
+ this.directoryModel_.getCurrentDirEntry());
+ };
+
+ this.lastSearchQuery_ = searchString;
+ this.directoryModel_.search(
+ searchString,
+ reportEmptySearchResults.bind(this),
+ hideNoResultsDiv.bind(this));
+};
diff --git a/ui/file_manager/file_manager/foreground/js/ui/drag_selector.js b/ui/file_manager/file_manager/foreground/js/ui/drag_selector.js
index 3288004..986ccf9 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/drag_selector.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/drag_selector.js
@@ -19,7 +19,7 @@
/**
* Border element of drag handle.
- * @type {HtmlElement}
+ * @type {HTMLElement}
* @private
*/
this.border_ = null;
@@ -75,7 +75,7 @@
*
* @param {HTMLElement} element Element that has the scroll bars.
* @param {Event} event The mouse event.
- * @return {object} Scrolled position.
+ * @return {Object} Scrolled position.
*/
DragSelector.getScrolledPosition = function(element, event) {
if (!element.cachedBounds) {
diff --git a/ui/file_manager/file_manager/foreground/js/ui/error_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/error_dialog.js
index 5dd3545..96bb4e1 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/error_dialog.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/error_dialog.js
@@ -7,6 +7,7 @@
/**
* @param {HTMLElement} parentNode Node to be parent for this dialog.
* @constructor
+ * @extends {cr.ui.dialogs.BaseDialog}
*/
function ErrorDialog(parentNode) {
cr.ui.dialogs.BaseDialog.call(this, parentNode);
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
index c162d77..20e6897 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,7 +11,7 @@
* @param {DialogType} dialogType Dialog type.
* @constructor.
*/
-var FileManagerUI = function(element, dialogType) {
+function FileManagerUI(element, dialogType) {
/**
* Top level element of Files.app.
* @type {HTMLElement}
@@ -70,7 +70,7 @@
/**
* Default task picker.
- * @type {DefaultActionDialog}
+ * @type {cr.filebrowser.DefaultActionDialog}
*/
this.defaultTaskPicker = null;
@@ -87,22 +87,10 @@
this.conflictDialog = null;
/**
- * Volume icon of location information on the toolbar.
- * @type {HTMLElement}
+ * Location line.
+ * @type {LocationLine}
*/
- this.locationVolumeIcon = null;
-
- /**
- * Breadcrumbs of location information on the toolbar.
- * @type {BreadcrumbsController}
- */
- this.locationBreadcrumbs = null;
-
- /**
- * Search button.
- * @type {HTMLElement}
- */
- this.searchButton = null;
+ this.locationLine = null;
/**
* Search box.
@@ -145,7 +133,7 @@
// Pre-populate the static localized strings.
i18nTemplate.process(this.element_.ownerDocument, loadTimeData);
-};
+}
/**
* Tweak the UI to become a particular kind of dialog, as determined by the
@@ -224,45 +212,10 @@
* or hidden in the beginning.
*/
FileManagerUI.prototype.initAdditionalUI = function() {
- this.locationVolumeIcon =
- this.element_.querySelector('#location-volume-icon');
-
- this.searchButton = this.element_.querySelector('#search-button');
- this.searchButton.addEventListener('click',
- this.onSearchButtonClick_.bind(this));
- this.searchBox = new SearchBox(this.element_.querySelector('#search-box'));
+ this.searchBox = new SearchBox(
+ this.element_.querySelector('#search-box'),
+ this.element_.querySelector('#search-button'),
+ this.element_.querySelector('#no-search-results'));
this.toggleViewButton = this.element_.querySelector('#view-button');
};
-
-/**
- * Updates the location information displayed on the toolbar.
- * @param {DirectoryEntry=} opt_entry Directory entry to be displayed as
- * current location. Default entry is the current directory.
- */
-FileManagerUI.prototype.updateLocationLine = function(volumeManager, entry) {
- // Updates volume icon.
- var location = volumeManager.getLocationInfo(entry);
- if (location && location.rootType && location.isRootEntry) {
- this.locationVolumeIcon.setAttribute(
- 'volume-type-icon', location.rootType);
- this.locationVolumeIcon.removeAttribute('volume-subtype');
- } else {
- this.locationVolumeIcon.setAttribute(
- 'volume-type-icon', location.volumeInfo.volumeType);
- this.locationVolumeIcon.setAttribute(
- 'volume-subtype', location.volumeInfo.deviceType);
- }
-
- // Updates breadcrumbs.
- this.locationBreadcrumbs.show(entry);
-};
-
-/**
- * Handles click event on the search button.
- * @param {Event} event Click event.
- * @private
- */
-FileManagerUI.prototype.onSearchButtonClick_ = function(event) {
- this.searchBox.inputElement.focus();
-};
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_table.js b/ui/file_manager/file_manager/foreground/js/ui/file_table.js
index f15674e..1a6e6f6 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_table.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_table.js
@@ -212,6 +212,7 @@
/**
* File list Table View.
* @constructor
+ * @extends {cr.ui.Table}
*/
function FileTable() {
throw new Error('Designed to decorate elements');
@@ -294,7 +295,7 @@
/**
* @this {FileTableColumnModel}
* @param {number} x Horizontal position.
- * @return {object} The object that contains column index, column width,
+ * @return {Object} The object that contains column index, column width,
* and hitPosition where the horizontal position is hit in the column.
*/
value: function(x) {
@@ -681,7 +682,7 @@
* Renders table row.
* @param {function(Entry, cr.ui.Table)} baseRenderFunction Base renderer.
* @param {Entry} entry Corresponding entry.
- * @return {HTMLLiElement} Created element.
+ * @return {HTMLLIElement} Created element.
* @private
*/
FileTable.prototype.renderTableRow_ = function(baseRenderFunction, entry) {
@@ -737,7 +738,7 @@
/**
* Common item decoration for table's and grid's items.
- * @param {ListItem} li List item.
+ * @param {cr.ui.ListItem} li List item.
* @param {Entry} entry The entry.
* @param {MetadataCache} metadataCache Cache to retrieve metadada.
*/
@@ -756,7 +757,7 @@
Object.defineProperty(li, 'selected', {
/**
- * @this {ListItem}
+ * @this {cr.ui.ListItem}
* @return {boolean} True if the list item is selected.
*/
get: function() {
@@ -764,7 +765,7 @@
},
/**
- * @this {ListItem}
+ * @this {cr.ui.ListItem}
*/
set: function(v) {
if (v)
diff --git a/ui/file_manager/file_manager/foreground/js/ui/breadcrumbs_controller.js b/ui/file_manager/file_manager/foreground/js/ui/location_line.js
similarity index 77%
rename from ui/file_manager/file_manager/foreground/js/ui/breadcrumbs_controller.js
rename to ui/file_manager/file_manager/foreground/js/ui/location_line.js
index 99d242c..97a8715 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/breadcrumbs_controller.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/location_line.js
@@ -1,18 +1,22 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
/**
+ * TODO(hirono): Remove metadataCache and volumeManager dependencies from the UI
+ * class.
* @extends {cr.EventTarget}
- * @param {HTMLDivElement} div Div container for breadcrumbs.
+ * @param {HTMLElement} breadcrumbs Container element for breadcrumbs.
+ * @param {HTMLElement} volumeIcon Volume icon.
* @param {MetadataCache} metadataCache To retrieve metadata.
* @param {VolumeManagerWrapper} volumeManager Volume manager.
* @constructor
*/
-function BreadcrumbsController(div, metadataCache, volumeManager) {
- this.bc_ = div;
+function LocationLine(breadcrumbs, volumeIcon, metadataCache, volumeManager) {
+ this.breadcrumbs_ = breadcrumbs;
+ this.volumeIcon_ = volumeIcon;
this.metadataCache_ = metadataCache;
this.volumeManager_ = volumeManager;
this.entry_ = null;
@@ -25,26 +29,39 @@
this.showSequence_ = 0;
// Register events and seql the object.
- div.addEventListener('click', this.onClick_.bind(this));
+ breadcrumbs.addEventListener('click', this.onClick_.bind(this));
}
/**
* Extends cr.EventTarget.
*/
-BreadcrumbsController.prototype.__proto__ = cr.EventTarget.prototype;
+LocationLine.prototype.__proto__ = cr.EventTarget.prototype;
/**
* Shows breadcrumbs.
*
* @param {Entry} entry Target entry.
*/
-BreadcrumbsController.prototype.show = function(entry) {
+LocationLine.prototype.show = function(entry) {
if (entry === this.entry_)
return;
this.entry_ = entry;
this.showSequence_++;
+ // Updates volume icon.
+ var location = this.volumeManager_.getLocationInfo(entry);
+ if (location && location.rootType && location.isRootEntry) {
+ this.volumeIcon_.setAttribute(
+ 'volume-type-icon', location.rootType);
+ this.volumeIcon_.removeAttribute('volume-subtype');
+ } else {
+ this.volumeIcon_.setAttribute(
+ 'volume-type-icon', location.volumeInfo.volumeType);
+ this.volumeIcon_.setAttribute(
+ 'volume-subtype', location.volumeInfo.deviceType);
+ }
+
var queue = new AsyncUtil.Queue();
var entries = [];
var error = false;
@@ -116,8 +133,8 @@
queue.run(function(sequence, callback) {
// Check the sequence number to skip requests that are out of date.
if (this.showSequence_ === sequence) {
- this.bc_.hidden = false;
- this.bc_.textContent = '';
+ this.breadcrumbs_.hidden = false;
+ this.breadcrumbs_.textContent = '';
if (!error)
this.updateInternal_(entries);
}
@@ -130,9 +147,9 @@
* @param {Array.<Entry>} entries Entries on the target path.
* @private
*/
-BreadcrumbsController.prototype.updateInternal_ = function(entries) {
+LocationLine.prototype.updateInternal_ = function(entries) {
// Make elements.
- var doc = this.bc_.ownerDocument;
+ var doc = this.breadcrumbs_.ownerDocument;
for (var i = 0; i < entries.length; i++) {
// Add a component.
var entry = entries[i];
@@ -140,7 +157,7 @@
div.className = 'breadcrumb-path entry-name';
div.textContent = util.getEntryLabel(this.volumeManager_, entry);
div.entry = entry;
- this.bc_.appendChild(div);
+ this.breadcrumbs_.appendChild(div);
// If this is the last component, break here.
if (i === entries.length - 1) {
@@ -151,7 +168,7 @@
// Add a separator.
var separator = doc.createElement('div');
separator.className = 'separator';
- this.bc_.appendChild(separator);
+ this.breadcrumbs_.appendChild(separator);
}
this.truncate();
@@ -160,23 +177,23 @@
/**
* Updates breadcrumbs widths in order to truncate it properly.
*/
-BreadcrumbsController.prototype.truncate = function() {
- if (!this.bc_.firstChild)
+LocationLine.prototype.truncate = function() {
+ if (!this.breadcrumbs_.firstChild)
return;
// Assume style.width == clientWidth (items have no margins or paddings).
- for (var item = this.bc_.firstChild; item; item = item.nextSibling) {
+ for (var item = this.breadcrumbs_.firstChild; item; item = item.nextSibling) {
item.removeAttribute('style');
item.removeAttribute('collapsed');
}
- var containerWidth = this.bc_.clientWidth;
+ var containerWidth = this.breadcrumbs_.clientWidth;
var pathWidth = 0;
var currentWidth = 0;
var lastSeparator;
- for (var item = this.bc_.firstChild; item; item = item.nextSibling) {
+ for (var item = this.breadcrumbs_.firstChild; item; item = item.nextSibling) {
if (item.className == 'separator') {
pathWidth += currentWidth;
currentWidth = item.clientWidth;
@@ -188,7 +205,7 @@
if (pathWidth + currentWidth <= containerWidth)
return;
if (!lastSeparator) {
- this.bc_.lastChild.style.width =
+ this.breadcrumbs_.lastChild.style.width =
Math.min(currentWidth, containerWidth) + 'px';
return;
}
@@ -219,7 +236,7 @@
}
pathWidth = 0;
- for (var item = this.bc_.firstChild; item != lastSeparator;
+ for (var item = this.breadcrumbs_.firstChild; item != lastSeparator;
item = item.nextSibling) {
// TODO(serya): Mixing access item.clientWidth and modifying style and
// attributes could cause multiple layout reflows.
@@ -240,15 +257,15 @@
currentWidth = Math.min(currentWidth,
containerWidth - pathWidth - collapsedWidth);
- this.bc_.lastChild.style.width =
+ this.breadcrumbs_.lastChild.style.width =
(currentWidth - lastCrumbSeparatorWidth) + 'px';
};
/**
* Hide breadcrumbs div.
*/
-BreadcrumbsController.prototype.hide = function() {
- this.bc_.hidden = true;
+LocationLine.prototype.hide = function() {
+ this.breadcrumbs_.hidden = true;
};
/**
@@ -256,7 +273,7 @@
* @param {Event} event The click event.
* @private
*/
-BreadcrumbsController.prototype.onClick_ = function(event) {
+LocationLine.prototype.onClick_ = function(event) {
if (!event.target.classList.contains('breadcrumb-path') ||
event.target.classList.contains('breadcrumb-last'))
return;
diff --git a/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js b/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
index 9dda1cb..449bdca 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/preview_panel.js
@@ -27,7 +27,7 @@
/**
* Visibility type of the preview panel.
- * @type {PreviewPanel.VisiblityType}
+ * @type {PreviewPanel.VisibilityType}
* @private
*/
this.visibilityType_ = visibilityType;
@@ -110,24 +110,30 @@
/**
* Visibility type of the preview panel.
+ * @enum {string}
+ * @const
*/
-PreviewPanel.VisibilityType = Object.freeze({
+PreviewPanel.VisibilityType = {
// Preview panel always shows.
ALWAYS_VISIBLE: 'alwaysVisible',
// Preview panel shows when the selection property are set.
AUTO: 'auto',
// Preview panel does not show.
ALWAYS_HIDDEN: 'alwaysHidden'
-});
+};
+Object.freeze(PreviewPanel.VisibilityType);
/**
+ * @enum {string}
+ * @const
* @private
*/
-PreviewPanel.Visibility_ = Object.freeze({
+PreviewPanel.Visibility_ = {
VISIBLE: 'visible',
HIDING: 'hiding',
HIDDEN: 'hidden'
-});
+};
+Object.freeze(PreviewPanel.Visibility_);
PreviewPanel.prototype = {
__proto__: cr.EventTarget.prototype,
@@ -465,7 +471,7 @@
* zoomed image.
*
* @param {Image} image Image to be source of the zoomed image.
- * @param {transform} transform Transformation to be applied to the image.
+ * @param {Object} transform Transformation to be applied to the image.
* @private
*/
PreviewPanel.Thumbnails.prototype.setZoomedImage_ = function(image, transform) {
diff --git a/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js b/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js
index 3d65e9e..698576b 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/progress_center_panel.js
@@ -194,7 +194,7 @@
/**
* Toggle animation rule of the progress center.
- * @type {CSSKeyFrameRule}
+ * @type {CSSKeyframeRule}
* @private
*/
this.toggleAnimation_ = ProgressCenterPanel.getToggleAnimation_(
@@ -254,7 +254,7 @@
/**
* Obtains the toggle animation keyframes rule from the document.
* @param {HTMLDocument} document Document containing the rule.
- * @return {CSSKeyFrameRules} Animation rule.
+ * @return {CSSKeyframeRule} Animation rule.
* @private
*/
ProgressCenterPanel.getToggleAnimation_ = function(document) {
diff --git a/ui/file_manager/file_manager/foreground/js/ui/search_box.js b/ui/file_manager/file_manager/foreground/js/ui/search_box.js
index 8ca1040..86f4969 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/search_box.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/search_box.js
@@ -7,13 +7,18 @@
/**
* Search box.
*
- * @param {element} element Root element of the search box.
+ * @param {HTMLElement} element Root element of the search box.
+ * @param {HTMLElement} searchButton Search button.
+ * @param {HTMLElement} noResultMessage Message element for the empty result.
+ * @extends {cr.EventTarget}
* @constructor
*/
-function SearchBox(element) {
+function SearchBox(element, searchButton, noResultMessage) {
+ cr.EventTarget.call(this);
+
/**
* Autocomplete List.
- * @type {AutocompleteList}
+ * @type {SearchBox.AutocompleteList}
*/
this.autocompleteList = new SearchBox.AutocompleteList(element.ownerDocument);
@@ -24,6 +29,18 @@
this.element = element;
/**
+ * Search button.
+ * @type {HTMLElement}
+ */
+ this.searchButton = searchButton;
+
+ /**
+ * No result message.
+ * @type {HTMLElement}
+ */
+ this.noResultMessage = noResultMessage;
+
+ /**
* Text input of the search box.
* @type {HTMLElement}
*/
@@ -35,22 +52,48 @@
*/
this.clearButton = element.querySelector('.clear');
- Object.freeze(this);
-
// Register events.
- this.inputElement.addEventListener('input', this.updateStyles_.bind(this));
+ this.inputElement.addEventListener('input', this.onInput_.bind(this));
this.inputElement.addEventListener('keydown', this.onKeyDown_.bind(this));
this.inputElement.addEventListener('focus', this.onFocus_.bind(this));
this.inputElement.addEventListener('blur', this.onBlur_.bind(this));
- this.inputElement.ownerDocument.addEventListener('dragover',
- this.onDragEnter_.bind(this),
- true);
- this.inputElement.ownerDocument.addEventListener('dragend',
- this.onDragEnd_.bind(this),
- true);
+ this.inputElement.ownerDocument.addEventListener(
+ 'dragover',
+ this.onDragEnter_.bind(this),
+ true);
+ this.inputElement.ownerDocument.addEventListener(
+ 'dragend',
+ this.onDragEnd_.bind(this));
+ this.searchButton.addEventListener(
+ 'click',
+ this.onSearchButtonClick_.bind(this));
+ this.clearButton.addEventListener(
+ 'click',
+ this.onClearButtonClick_.bind(this));
+ var dispatchItemSelect =
+ cr.dispatchSimpleEvent.bind(cr, this, SearchBox.EventType.ITEM_SELECT);
+ this.autocompleteList.handleEnterKeydown = dispatchItemSelect;
+ this.autocompleteList.addEventListener('mouseDown', dispatchItemSelect);
+
+ // Append dynamically created element.
element.parentNode.appendChild(this.autocompleteList);
}
+SearchBox.prototype = {
+ __proto__: cr.EventTarget.prototype
+};
+
+/**
+ * Event type.
+ * @enum {string}
+ */
+SearchBox.EventType = {
+ // Dispatched when the text in the search box is changed.
+ TEXT_CHANGE: 'textchange',
+ // Dispatched when the item in the auto complete list is selected.
+ ITEM_SELECT: 'itemselect'
+};
+
/**
* Autocomplete list for search box.
* @param {HTMLDocument} document Document.
@@ -138,6 +181,14 @@
};
/**
+ * @private
+ */
+SearchBox.prototype.onInput_ = function() {
+ this.updateStyles_();
+ cr.dispatchSimpleEvent(this, SearchBox.EventType.TEXT_CHANGE);
+};
+
+/**
* Handles a focus event of the search box.
* @private
*/
@@ -197,3 +248,18 @@
this.element.classList.toggle('has-text',
!!this.inputElement.value);
};
+
+/**
+ * @private
+ */
+SearchBox.prototype.onSearchButtonClick_ = function() {
+ this.inputElement.focus();
+};
+
+/**
+ * @private
+ */
+SearchBox.prototype.onClearButtonClick_ = function() {
+ this.inputElement.value = '';
+ this.onInput_();
+};
diff --git a/ui/file_manager/file_manager/foreground/js/ui/share_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/share_dialog.js
index f4a3824..b390fce 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/share_dialog.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/share_dialog.js
@@ -47,7 +47,7 @@
/**
* Wraps a Web View element and adds authorization headers to it.
* @param {string} urlPattern Pattern of urls to be authorized.
- * @param {WebView} webView Web View element to be wrapped.
+ * @param {Element} webView Web View element to be wrapped.
* @constructor
*/
ShareDialog.WebViewAuthorizer = function(urlPattern, webView) {
diff --git a/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js b/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
index 8a279fe..b6f8085 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/suggest_apps_dialog.js
@@ -496,60 +496,74 @@
/**
* Utility methods and constants to record histograms.
*/
-SuggestAppsDialog.Metrics = Object.freeze({
- LOAD: Object.freeze({
- SUCCEEDED: 0,
- CANCELLED: 1,
- FAILED: 2,
- }),
+SuggestAppsDialog.Metrics = {};
- /**
- * @param {SuggestAppsDialog.Metrics.LOAD} result Result of load.
- */
- recordLoad: function(result) {
- if (0 <= result && result < 3)
- metrics.recordEnum('SuggestApps.Load', result, 3);
- },
+/**
+ * @enum {number}
+ * @const
+ */
+SuggestAppsDialog.Metrics.LOAD = {
+ SUCCEEDED: 0,
+ CANCELLED: 1,
+ FAILED: 2,
+};
- CLOSE_DIALOG: Object.freeze({
- UNKOWN_ERROR: 0,
- ITEM_INSTALLED: 1,
- USER_CANCELLED: 2,
- WEBSTORE_LINK_OPENED: 3,
- }),
+/**
+ * @enum {number}
+ * @const
+ */
+SuggestAppsDialog.Metrics.CLOSE_DIALOG = {
+ UNKOWN_ERROR: 0,
+ ITEM_INSTALLED: 1,
+ USER_CANCELLED: 2,
+ WEBSTORE_LINK_OPENED: 3,
+};
- /**
- * @param {SuggestAppsDialog.Metrics.CLOSE_DIALOG} reason Reason of closing
- * dialog.
- */
- recordCloseDialog: function(reason) {
- if (0 <= reason && reason < 4)
- metrics.recordEnum('SuggestApps.CloseDialog', reason, 4);
- },
+/**
+ * @enum {number}
+ * @const
+ */
+SuggestAppsDialog.Metrics.INSTALL = {
+ SUCCEEDED: 0,
+ CANCELLED: 1,
+ FAILED: 2,
+};
- INSTALL: Object.freeze({
- SUCCEEDED: 0,
- CANCELLED: 1,
- FAILED: 2,
- }),
+/**
+ * @param {number} result Result of load, which must be defined in
+ * SuggestAppsDialog.Metrics.LOAD.
+ */
+SuggestAppsDialog.Metrics.recordLoad = function(result) {
+ if (0 <= result && result < 3)
+ metrics.recordEnum('SuggestApps.Load', result, 3);
+};
- /**
- * @param {SuggestAppsDialog.Metrics.INSTALL} result Result of installation.
- */
- recordInstall: function(result) {
- if (0 <= result && result < 3)
- metrics.recordEnum('SuggestApps.Install', result, 3);
- },
+/**
+ * @param {number} eason Reason of closing dialog, which must be defined in
+ * SuggestAppsDialog.Metrics.CLOSE_DIALOG.
+ */
+SuggestAppsDialog.Metrics.recordCloseDialog = function(reason) {
+ if (0 <= reason && reason < 4)
+ metrics.recordEnum('SuggestApps.CloseDialog', reason, 4);
+};
- recordShowDialog: function() {
- metrics.recordUserAction('SuggestApps.ShowDialog');
- },
+/**
+ * @param {number} result Result of installation, which must be defined in
+ * SuggestAppsDialog.Metrics.INSTALL.
+ */
+SuggestAppsDialog.Metrics.recordInstall = function(result) {
+ if (0 <= result && result < 3)
+ metrics.recordEnum('SuggestApps.Install', result, 3);
+};
- startLoad: function() {
- metrics.startInterval('SuggestApps.LoadTime');
- },
+SuggestAppsDialog.Metrics.recordShowDialog = function() {
+ metrics.recordUserAction('SuggestApps.ShowDialog');
+};
- finishLoad: function() {
- metrics.recordInterval('SuggestApps.LoadTime');
- },
-});
+SuggestAppsDialog.Metrics.startLoad = function() {
+ metrics.startInterval('SuggestApps.LoadTime');
+};
+
+SuggestAppsDialog.Metrics.finishLoad = function() {
+ metrics.recordInterval('SuggestApps.LoadTime');
+};
diff --git a/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js b/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
index 214fe13..6812b86 100644
--- a/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
+++ b/ui/file_manager/file_manager/foreground/js/volume_manager_wrapper.js
@@ -10,7 +10,7 @@
* @param {VolumeManagerWrapper.DriveEnabledStatus} driveEnabled DRIVE_ENABLED
* if drive should be available. DRIVE_DISABLED if drive related
* data/events should be hidden.
- * @param {DOMWindow=} opt_backgroundPage Window object of the background
+ * @param {Window=} opt_backgroundPage Window object of the background
* page. If this is specified, the class skips to get background page.
* TOOD(hirono): Let all clients of the class pass the background page and
* make the argument not optional.
diff --git a/ui/file_manager/file_manager/main.html b/ui/file_manager/file_manager/main.html
index 3bd4287..fa6d025 100644
--- a/ui/file_manager/file_manager/main.html
+++ b/ui/file_manager/file_manager/main.html
@@ -107,9 +107,9 @@
<script src="foreground/js/metadata/metadata_cache.js"></script>
<script src="foreground/js/navigation_list_model.js"></script>
<script src="foreground/js/progress_center_item_group.js"></script>
+ <script src="foreground/js/search_controller.js"></script>
<script src="foreground/js/share_client.js"></script>
<script src="foreground/js/thumbnail_loader.js"></script>
- <script src="foreground/js/ui/breadcrumbs_controller.js"></script>
<script src="foreground/js/ui/conflict_dialog.js"></script>
<script src="foreground/js/ui/default_action_dialog.js"></script>
<script src="foreground/js/ui/directory_tree.js"></script>
@@ -119,6 +119,7 @@
<script src="foreground/js/ui/file_grid.js"></script>
<script src="foreground/js/ui/file_manager_ui.js"></script>
<script src="foreground/js/ui/file_table.js"></script>
+ <script src="foreground/js/ui/location_line.js"></script>
<script src="foreground/js/ui/multi_profile_share_dialog.js"></script>
<script src="foreground/js/ui/preview_panel.js"></script>
<script src="foreground/js/ui/progress_center_panel.js"></script>
diff --git a/ui/file_manager/gallery/gallery.html b/ui/file_manager/gallery/gallery.html
index 2dbc5ef..80090cf 100644
--- a/ui/file_manager/gallery/gallery.html
+++ b/ui/file_manager/gallery/gallery.html
@@ -67,6 +67,7 @@
<script src="js/gallery.js"></script>
<script src="js/gallery_item.js"></script>
+ <script src="js/error_banner.js"></script>
<script src="js/mosaic_mode.js"></script>
<script src="js/slide_mode.js"></script>
<script src="js/ribbon.js"></script>
@@ -91,6 +92,9 @@
<button class="share"></button>
</div>
</div>
+ <div class="prompt-wrapper" pos="center">
+ <div class="error-banner"></div>
+ </div>
</div>
</body>
</html>
diff --git a/ui/file_manager/gallery/js/compiled_resources.gyp b/ui/file_manager/gallery/js/compiled_resources.gyp
index 1461d61..f6ce039 100644
--- a/ui/file_manager/gallery/js/compiled_resources.gyp
+++ b/ui/file_manager/gallery/js/compiled_resources.gyp
@@ -7,9 +7,11 @@
'target_name': 'background',
'variables': {
'depends': [
+ '../../../../third_party/jstemplate/compiled_resources.gyp:jstemplate',
'../../../webui/resources/js/cr.js',
'../../../webui/resources/js/cr/event_target.js',
'../../../webui/resources/js/cr/ui/array_data_model.js',
+ '../../../webui/resources/js/cr/ui/dialogs.js',
'../../../webui/resources/js/load_time_data.js',
'../../file_manager/common/js/util.js',
'../../file_manager/common/js/async_util.js',
@@ -32,6 +34,10 @@
'target_name': 'gallery_scripts',
'variables': {
'depends': [
+ '../../../../third_party/jstemplate/compiled_resources.gyp:jstemplate',
+ '../../file_manager/background/js/volume_manager.js',
+ '../../file_manager/common/js/volume_manager_common.js',
+ '../../file_manager/common/js/async_util.js',
],
'externs': [
'<(CLOSURE_DIR)/externs/chrome_send_externs.js',
diff --git a/ui/file_manager/gallery/js/error_banner.js b/ui/file_manager/gallery/js/error_banner.js
new file mode 100644
index 0000000..ec63c98
--- /dev/null
+++ b/ui/file_manager/gallery/js/error_banner.js
@@ -0,0 +1,30 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+/**
+ * @param {Element} container Content container.
+ * @constructor
+ */
+function ErrorBanner(container) {
+ this.container_ = container;
+ this.errorBanner_ = this.container_.querySelector('.error-banner');
+}
+
+/**
+ * Shows an error message.
+ * @param {string} message Message.
+ */
+ErrorBanner.prototype.show = function(message) {
+ this.errorBanner_.textContent = str(message);
+ this.container_.setAttribute('error', true);
+};
+
+/**
+ * Hides an error message.
+ */
+ErrorBanner.prototype.clear = function() {
+ this.container_.removeAttribute('error');
+};
diff --git a/ui/file_manager/gallery/js/gallery.js b/ui/file_manager/gallery/js/gallery.js
index 011fa33..0a7a067 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -67,7 +67,7 @@
*
* @param {VolumeManager} volumeManager Volume manager instance.
* @param {Gallery.Item} item Original gallery item.
- * @param {Canvas} canvas Canvas containing new image.
+ * @param {HTMLCanvasElement} canvas Canvas containing new image.
* @param {boolean} overwrite Whether to overwrite the image to the item or not.
* @return {Promise} Promise to be fulfilled with when the operation completes.
*/
@@ -370,10 +370,13 @@
this.prompt_ = new ImageEditor.Prompt(this.container_, strf);
+ this.errorBanner_ = new ErrorBanner(this.container_);
+
this.modeButton_ = this.toolbar_.querySelector('button.mode');
this.modeButton_.addEventListener('click', this.toggleMode_.bind(this, null));
this.mosaicMode_ = new MosaicMode(content,
+ this.errorBanner_,
this.dataModel_,
this.selectionModel_,
this.volumeManager_,
@@ -383,6 +386,7 @@
content,
this.toolbar_,
this.prompt_,
+ this.errorBanner_,
this.dataModel_,
this.selectionModel_,
this.context_,
@@ -590,7 +594,7 @@
/**
* Executes a function when the editor is done with the modifications.
- * @param {function} callback Function to execute.
+ * @param {function()} callback Function to execute.
*/
Gallery.prototype.executeWhenReady = function(callback) {
this.currentMode_.executeWhenReady(callback);
@@ -637,7 +641,7 @@
/**
* Mode toggle event handler.
- * @param {function=} opt_callback Callback.
+ * @param {function()=} opt_callback Callback.
* @param {Event=} opt_event Event that caused this call.
* @private
*/
diff --git a/ui/file_manager/gallery/js/gallery_item.js b/ui/file_manager/gallery/js/gallery_item.js
index 6f11799..f5c2b6f 100644
--- a/ui/file_manager/gallery/js/gallery_item.js
+++ b/ui/file_manager/gallery/js/gallery_item.js
@@ -44,7 +44,7 @@
* The content cache is used for prefetching the next image when going through
* the images sequentially. The real life photos can be large (18Mpix = 72Mb
* pixel array) so we want only the minimum amount of caching.
- * @type {Canvas}
+ * @type {HTMLCanvasElement}
*/
this.screenImage = null;
@@ -53,7 +53,7 @@
* recently loaded image looks instant even if the image is not in the content
* cache any more. Screen-scale images are small (~1Mpix) so we can afford to
* cache more of them.
- * @type {Canvas}
+ * @type {HTMLCanvasElement}
*/
this.contentImage = null;
@@ -170,7 +170,7 @@
* Creates a name for an edited copy of the file.
*
* @param {DirectoryEntry} dirEntry Entry.
- * @param {function} callback Callback.
+ * @param {function(string)} callback Callback.
* @private
*/
Gallery.Item.prototype.createCopyName_ = function(dirEntry, callback) {
diff --git a/ui/file_manager/gallery/js/gallery_scripts.js b/ui/file_manager/gallery/js/gallery_scripts.js
index 9baad53..4873657 100644
--- a/ui/file_manager/gallery/js/gallery_scripts.js
+++ b/ui/file_manager/gallery/js/gallery_scripts.js
@@ -59,6 +59,7 @@
//<include src="gallery.js">
//<include src="gallery_item.js">
+//<include src="error_banner.js">
//<include src="mosaic_mode.js">
//<include src="slide_mode.js">
//<include src="ribbon.js">
diff --git a/ui/file_manager/gallery/js/image_editor/commands.js b/ui/file_manager/gallery/js/image_editor/commands.js
index 30b3d3a..8635505 100644
--- a/ui/file_manager/gallery/js/image_editor/commands.js
+++ b/ui/file_manager/gallery/js/image_editor/commands.js
@@ -11,7 +11,7 @@
*
* @param {Document} document Document to create canvases in.
* @param {HTMLCanvasElement} canvas The canvas with the original image.
- * @param {function(callback)} saveFunction Function to save the image.
+ * @param {function(function())} saveFunction Function to save the image.
* @constructor
*/
function CommandQueue(document, canvas, saveFunction) {
@@ -61,7 +61,7 @@
/**
* Execute the action when the queue is not busy.
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
*/
CommandQueue.prototype.executeWhenReady = function(callback) {
if (this.isBusy())
@@ -126,7 +126,7 @@
*
* @param {Command} command The command to execute.
* @param {Object} uiContext The UI context.
- * @param {function} callback Completion callback.
+ * @param {function(number=)} callback Completion callback.
* @private
*/
CommandQueue.prototype.doExecute_ = function(command, uiContext, callback) {
diff --git a/ui/file_manager/gallery/js/image_editor/image_editor.js b/ui/file_manager/gallery/js/image_editor/image_editor.js
index 41ffeca..37a3bb7 100644
--- a/ui/file_manager/gallery/js/image_editor/image_editor.js
+++ b/ui/file_manager/gallery/js/image_editor/image_editor.js
@@ -13,7 +13,8 @@
* @param {ImageEditor.Prompt} prompt Prompt instance.
* @param {Object} DOMContainers Various DOM containers required for the editor.
* @param {Array.<ImageEditor.Mode>} modes Available editor modes.
- * @param {function} displayStringFunction String formatting function.
+ * @param {function(string, ...[string])} displayStringFunction String
+ * formatting function.
* @param {function()} onToolsVisibilityChanged Callback to be called, when
* some of the UI elements have been dimmed or revealed.
* @constructor
@@ -104,9 +105,9 @@
*
* @param {Gallery.Item} item Gallery item.
* @param {Object} effect Transition effect object.
- * @param {function(function)} saveFunction Image save function.
- * @param {function} displayCallback Display callback.
- * @param {function} loadCallback Load callback.
+ * @param {function(function())} saveFunction Image save function.
+ * @param {function(number)} displayCallback Display callback.
+ * @param {function(number, number, *=)} loadCallback Load callback.
*/
ImageEditor.prototype.openSession = function(
item, effect, saveFunction, displayCallback, loadCallback) {
@@ -132,7 +133,7 @@
/**
* Close the current image editing session.
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
*/
ImageEditor.prototype.closeSession = function(callback) {
this.getPrompt().hide();
@@ -160,7 +161,7 @@
/**
* Commit the current operation and execute the action.
*
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
*/
ImageEditor.prototype.executeWhenReady = function(callback) {
if (this.commandQueue_) {
@@ -713,7 +714,7 @@
* Returns touch position or null if there is more than one touch position.
*
* @param {TouchEvent} e Event.
- * @return {object?} A pair of x,y in page coordinates.
+ * @return {Object?} A pair of x,y in page coordinates.
* @private
*/
ImageEditor.MouseControl.prototype.getTouchPosition_ = function(e) {
@@ -893,8 +894,9 @@
/**
* A toolbar for the ImageEditor.
* @param {HTMLElement} parent The parent element.
- * @param {function} displayStringFunction A string formatting function.
- * @param {function} updateCallback The callback called when controls change.
+ * @param {function(string)} displayStringFunction A string formatting function.
+ * @param {function(Object)} updateCallback The callback called when controls
+ * change.
* @constructor
*/
ImageEditor.Toolbar = function(parent, displayStringFunction, updateCallback) {
@@ -953,7 +955,7 @@
*
* @param {string} name Button name.
* @param {string} title Button title.
- * @param {function} handler onClick handler.
+ * @param {function(Event)} handler onClick handler.
* @param {string=} opt_class Extra class name.
* @return {HTMLElement} The added button.
*/
@@ -1080,7 +1082,8 @@
/** A prompt panel for the editor.
*
* @param {HTMLElement} container Container element.
- * @param {function} displayStringFunction A formatting function.
+ * @param {function(string, ...[string])} displayStringFunction A formatting
+ * function.
* @constructor
*/
ImageEditor.Prompt = function(container, displayStringFunction) {
@@ -1112,7 +1115,7 @@
/**
* Schedule the delayed action.
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
* @param {number} timeout Timeout.
*/
ImageEditor.Prompt.prototype.setTimer = function(callback, timeout) {
diff --git a/ui/file_manager/gallery/js/image_editor/image_util.js b/ui/file_manager/gallery/js/image_editor/image_util.js
index b06d524..eaa1608 100644
--- a/ui/file_manager/gallery/js/image_editor/image_util.js
+++ b/ui/file_manager/gallery/js/image_editor/image_util.js
@@ -515,8 +515,8 @@
* attribute.
*
* @param {function()} onSuccess Success callback.
- * @param {function(opt_string)} onError Failure callback with an optional
- * error identifier.
+ * @param {function(string=)} onError Failure callback with an optional error
+ * identifier.
* @private
*/
ImageUtil.ImageLoader.prototype.resetImage_ = function(onSuccess, onError) {
@@ -556,7 +556,8 @@
};
/**
- * @param {function} callback To be called when the image loaded.
+ * @param {function(HTMLCanvasElement, string=)} callback To be called when the
+ * image loaded.
*/
ImageUtil.ImageLoader.prototype.setCallback = function(callback) {
this.callback_ = callback;
diff --git a/ui/file_manager/gallery/js/image_editor/image_view.js b/ui/file_manager/gallery/js/image_editor/image_view.js
index e260978..2f1f6b6 100644
--- a/ui/file_manager/gallery/js/image_editor/image_view.js
+++ b/ui/file_manager/gallery/js/image_editor/image_view.js
@@ -251,10 +251,10 @@
*
* @param {Gallery.Item} item Gallery item to be loaded.
* @param {Object} effect Transition effect object.
- * @param {function(number} displayCallback Called when the image is displayed
- * (possibly as a preview).
- * @param {function(number} loadCallback Called when the image is fully loaded.
- * The parameter is the load type.
+ * @param {function(number)} displayCallback Called when the image is displayed
+ * (possibly as a preview).
+ * @param {function(number, number, *=)} loadCallback Called when the image is
+ * fully loaded. The first parameter is the load type.
*/
ImageView.prototype.load =
function(item, effect, displayCallback, loadCallback) {
@@ -480,7 +480,7 @@
/**
* Adds a listener for content changes.
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
*/
ImageView.prototype.addContentCallback = function(callback) {
this.contentCallbacks_.push(callback);
@@ -696,7 +696,8 @@
/**
* Obtains the CSS transformation string of the effect.
- * @param {DOMCanvas} element Canvas element to be applied the transformation.
+ * @param {HTMLCanvasElement} element Canvas element to be applied the
+ * transformation.
* @param {Viewport} viewport Current viewport.
* @return {string} CSS transformation description.
*/
diff --git a/ui/file_manager/gallery/js/mosaic_mode.js b/ui/file_manager/gallery/js/mosaic_mode.js
index 077d579..a19b50a 100644
--- a/ui/file_manager/gallery/js/mosaic_mode.js
+++ b/ui/file_manager/gallery/js/mosaic_mode.js
@@ -6,16 +6,18 @@
/**
* @param {Element} container Content container.
+ * @param {ErrorBanner} errorBanner Error banner.
* @param {cr.ui.ArrayDataModel} dataModel Data model.
* @param {cr.ui.ListSelectionModel} selectionModel Selection model.
* @param {VolumeManagerWrapper} volumeManager Volume manager.
- * @param {function} toggleMode Function to switch to the Slide mode.
+ * @param {function()} toggleMode Function to switch to the Slide mode.
* @constructor
*/
function MosaicMode(
- container, dataModel, selectionModel, volumeManager, toggleMode) {
- this.mosaic_ = new Mosaic(
- container.ownerDocument, dataModel, selectionModel, volumeManager);
+ container, errorBanner, dataModel, selectionModel, volumeManager,
+ toggleMode) {
+ this.mosaic_ = new Mosaic(container.ownerDocument, errorBanner,
+ dataModel, selectionModel, volumeManager);
container.appendChild(this.mosaic_);
this.toggleMode_ = toggleMode;
@@ -40,7 +42,7 @@
/**
* Execute an action (this mode has no busy state).
- * @param {function} action Action to execute.
+ * @param {function()} action Action to execute.
*/
MosaicMode.prototype.executeWhenReady = function(action) { action(); };
@@ -73,15 +75,17 @@
* Mosaic control.
*
* @param {Document} document Document.
+ * @param {ErrorBanner} errorBanner Error banner.
* @param {cr.ui.ArrayDataModel} dataModel Data model.
* @param {cr.ui.ListSelectionModel} selectionModel Selection model.
* @param {VolumeManagerWrapper} volumeManager Volume manager.
* @return {Element} Mosaic element.
* @constructor
*/
-function Mosaic(document, dataModel, selectionModel, volumeManager) {
+function Mosaic(document, errorBanner, dataModel, selectionModel,
+ volumeManager) {
var self = document.createElement('div');
- Mosaic.decorate(self, dataModel, selectionModel, volumeManager);
+ Mosaic.decorate(self, errorBanner, dataModel, selectionModel, volumeManager);
return self;
}
@@ -109,18 +113,20 @@
* Decorates a Mosaic instance.
*
* @param {Mosaic} self Self pointer.
+ * @param {ErrorBanner} errorBanner Error banner.
* @param {cr.ui.ArrayDataModel} dataModel Data model.
* @param {cr.ui.ListSelectionModel} selectionModel Selection model.
* @param {VolumeManagerWrapper} volumeManager Volume manager.
*/
Mosaic.decorate = function(
- self, dataModel, selectionModel, volumeManager) {
+ self, errorBanner, dataModel, selectionModel, volumeManager) {
self.__proto__ = Mosaic.prototype;
self.className = 'mosaic';
self.dataModel_ = dataModel;
self.selectionModel_ = selectionModel;
self.volumeManager_ = volumeManager;
+ self.errorBanner_ = errorBanner;
// Initialization is completed lazily on the first call to |init|.
};
@@ -427,6 +433,11 @@
}
this.tiles_.splice(index, event.removed.length);
+
+ // No items left, show the banner.
+ if (this.getItemCount_() === 0)
+ this.errorBanner_.show('GALLERY_NO_IMAGES');
+
this.scheduleLayout(Mosaic.LAYOUT_DELAY);
}
@@ -495,6 +506,10 @@
* Shows the mosaic.
*/
Mosaic.prototype.show = function() {
+ // If the items are empty, just show the error message.
+ if (this.getItemCount_() === 0)
+ this.errorBanner_.show('GALLERY_NO_IMAGES');
+
var duration = ImageView.MODE_TRANSITION_DURATION;
if (this.canZoom()) {
// Fade in in parallel with the zoom effect.
@@ -517,6 +532,8 @@
* Hides the mosaic.
*/
Mosaic.prototype.hide = function() {
+ this.errorBanner_.clear();
+
if (this.showingTimeoutID_ !== null) {
clearTimeout(this.showingTimeoutID_);
this.showingTimeoutID_ = null;
@@ -633,6 +650,14 @@
}
};
+/**
+ * @return {number} Item count
+ * @private
+ */
+Mosaic.prototype.getItemCount_ = function() {
+ return this.dataModel_.length;
+};
+
////////////////////////////////////////////////////////////////////////////////
/**
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index 627d5b6..9de3d88 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -12,6 +12,7 @@
* @param {Element} content Content container element.
* @param {Element} toolbar Toolbar element.
* @param {ImageEditor.Prompt} prompt Prompt.
+ * @param {ErrorBanner} errorBanner Error banner.
* @param {cr.ui.ArrayDataModel} dataModel Data model.
* @param {cr.ui.ListSelectionModel} selectionModel Selection model.
* @param {Object} context Context.
@@ -21,13 +22,14 @@
* function.
* @constructor
*/
-function SlideMode(container, content, toolbar, prompt, dataModel,
+function SlideMode(container, content, toolbar, prompt, errorBanner, dataModel,
selectionModel, context, volumeManager, toggleMode, displayStringFunction) {
this.container_ = container;
this.document_ = container.ownerDocument;
this.content = content;
this.toolbar_ = toolbar;
this.prompt_ = prompt;
+ this.errorBanner_ = errorBanner;
this.dataModel_ = dataModel;
this.selectionModel_ = selectionModel;
this.context_ = context;
@@ -177,12 +179,6 @@
this.document_, this.dataModel_, this.selectionModel_);
this.ribbonSpacer_.appendChild(this.ribbon_);
- // Error indicator.
- var errorWrapper = util.createChild(this.container_, 'prompt-wrapper');
- errorWrapper.setAttribute('pos', 'center');
-
- this.errorBanner_ = util.createChild(errorWrapper, 'error-banner');
-
util.createChild(this.container_, 'spinner');
var slideShowButton = this.toolbar_.querySelector('button.slideshow');
@@ -244,8 +240,8 @@
/**
* Load items, display the selected item.
* @param {ImageRect} zoomFromRect Rectangle for zoom effect.
- * @param {function} displayCallback Called when the image is displayed.
- * @param {function} loadCallback Called when the image is displayed.
+ * @param {function()} displayCallback Called when the image is displayed.
+ * @param {function()} loadCallback Called when the image is displayed.
*/
SlideMode.prototype.enter = function(
zoomFromRect, displayCallback, loadCallback) {
@@ -275,7 +271,7 @@
if (this.getItemCount_() === 0) {
this.displayedIndex_ = -1;
//TODO(hirono) Show this message in the grid mode too.
- this.showErrorBanner_('GALLERY_NO_IMAGES');
+ this.errorBanner_.show('GALLERY_NO_IMAGES');
fulfill();
return;
}
@@ -330,7 +326,7 @@
/**
* Leave the mode.
* @param {ImageRect} zoomToRect Rectangle for zoom effect.
- * @param {function} callback Called when the image is committed and
+ * @param {function()} callback Called when the image is committed and
* the zoom-out animation has started.
*/
SlideMode.prototype.leave = function(zoomToRect, callback) {
@@ -351,7 +347,7 @@
this.viewport_.resetView();
if (this.getItemCount_() === 0) {
- this.showErrorBanner_(false);
+ this.errorBanner_.clear();
commitDone();
} else {
this.commitItem_(commitDone);
@@ -369,7 +365,7 @@
/**
* Execute an action when the editor is not busy.
*
- * @param {function} action Function to execute.
+ * @param {function()} action Function to execute.
*/
SlideMode.prototype.executeWhenReady = function(action) {
this.editor_.executeWhenReady(action);
@@ -588,7 +584,7 @@
// No items left. Unload the image and show the banner.
this.commitItem_(function() {
this.unloadImage_();
- this.showErrorBanner_('GALLERY_NO_IMAGES');
+ this.errorBanner_.show('GALLERY_NO_IMAGES');
}.bind(this));
}
}.bind(this), 0);
@@ -673,9 +669,10 @@
*
* @param {Gallery.Item} item Item.
* @param {Object} effect Transition effect object.
- * @param {function} displayCallback Called when the image is displayed
+ * @param {function()} displayCallback Called when the image is displayed
* (which can happen before the image load due to caching).
- * @param {function} loadCallback Called when the image is fully loaded.
+ * @param {function(number, number)} loadCallback Called when the image is fully
+ * loaded.
* @private
*/
SlideMode.prototype.loadItem_ = function(
@@ -689,13 +686,13 @@
if (loadType === ImageView.LOAD_TYPE_ERROR) {
// if we have a specific error, then display it
if (error) {
- this.showErrorBanner_(error);
+ this.errorBanner_.show(error);
} else {
// otherwise try to infer general error
- this.showErrorBanner_('GALLERY_IMAGE_ERROR');
+ this.errorBanner_.show('GALLERY_IMAGE_ERROR');
}
} else if (loadType === ImageView.LOAD_TYPE_OFFLINE) {
- this.showErrorBanner_('GALLERY_IMAGE_OFFLINE');
+ this.errorBanner_.show('GALLERY_IMAGE_OFFLINE');
}
ImageUtil.metrics.recordUserAction(ImageUtil.getMetricName('View'));
@@ -763,12 +760,12 @@
/**
* Commit changes to the current item and reset all messages/indicators.
*
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
* @private
*/
SlideMode.prototype.commitItem_ = function(callback) {
this.showSpinner_(false);
- this.showErrorBanner_(false);
+ this.errorBanner_.clear();
this.editor_.getPrompt().hide();
this.editor_.closeSession(callback);
};
@@ -962,7 +959,7 @@
* Save the current image to a file.
*
* @param {Gallery.Item} item Item to save the image.
- * @param {function} callback Callback.
+ * @param {function()} callback Callback.
* @private
*/
SlideMode.prototype.saveCurrentImage_ = function(item, callback) {
@@ -1277,18 +1274,6 @@
};
/**
- * Displays the error banner.
- * @param {string} message Message.
- * @private
- */
-SlideMode.prototype.showErrorBanner_ = function(message) {
- if (message) {
- this.errorBanner_.textContent = this.displayStringFunction_(message);
- }
- ImageUtil.setAttribute(this.container_, 'error', !!message);
-};
-
-/**
* Shows/hides the busy spinner.
*
* @param {boolean} on True if show, false if hide.
@@ -1319,14 +1304,14 @@
/**
* Touch handlers of the slide mode.
- * @param {DOMElement} targetElement Event source.
+ * @param {Element} targetElement Event source.
* @param {SlideMode} slideMode Slide mode to be operated by the handler.
* @constructor
*/
function TouchHandler(targetElement, slideMode) {
/**
* Event source.
- * @type {DOMElement}
+ * @type {Element}
* @private
*/
this.targetElement_ = targetElement;
diff --git a/ui/file_manager/image_loader/cache.js b/ui/file_manager/image_loader/cache.js
index a9223c4..5bdb2be 100644
--- a/ui/file_manager/image_loader/cache.js
+++ b/ui/file_manager/image_loader/cache.js
@@ -196,7 +196,7 @@
}.bind(this);
metadataStore.openCursor().onsuccess = function(e) {
- var cursor = event.target.result;
+ var cursor = e.target.result;
if (cursor) {
metadataEntries.push(cursor.value);
cursor.continue();
@@ -255,7 +255,7 @@
* @param {string} key Cache key.
* @param {number} timestamp Last modification timestamp. If different
* that the one in cache, then the entry will be invalidated.
- * @param {function(<string>)} onSuccess Success callback with the image's data.
+ * @param {function(string)} onSuccess Success callback with the image's data.
* @param {function()} onFailure Failure callback.
*/
Cache.prototype.loadImage = function(key, timestamp, onSuccess, onFailure) {
@@ -367,7 +367,7 @@
// an error.
if (cacheSize === null || !metadataEntry) {
if (opt_onFailure)
- onFailure();
+ opt_onFailure();
return;
}
diff --git a/ui/file_manager/image_loader/image_loader.js b/ui/file_manager/image_loader/image_loader.js
index 269b1aa..e45c084 100644
--- a/ui/file_manager/image_loader/image_loader.js
+++ b/ui/file_manager/image_loader/image_loader.js
@@ -34,7 +34,9 @@
});
return requestPromise;
});
- initPromises.push(new Promise(this.cache_.initialize.bind(this.cache_)));
+ initPromises.push(new Promise(function(resolve, reject) {
+ this.cache_.initialize(resolve);
+ }.bind(this)));
// After all initialization promises are done, start the scheduler.
Promise.all(initPromises).then(this.scheduler_.start.bind(this.scheduler_));
@@ -50,7 +52,7 @@
}.bind(this));
// Listen for incoming requests.
- chrome.extension.onMessageExternal.addListener(
+ chrome.runtime.onMessageExternal.addListener(
function(request, sender, sendResponse) {
if (ImageLoader.ALLOWED_CLIENTS.indexOf(sender.id) !== -1) {
// Sending a response may fail if the receiver already went offline.
@@ -63,7 +65,9 @@
// Ignore the error.
}
};
- return this.onMessage_(sender.id, request, failSafeSendResponse);
+ return this.onMessage_(sender.id,
+ /** @type {LoadImageRequest} */ (request),
+ failSafeSendResponse);
}
}.bind(this));
}
@@ -84,8 +88,8 @@
* an image task.
*
* @param {string} senderId Sender's extension id.
- * @param {Object} request Request message as a hash array.
- * @param {function} callback Callback to be called to return response.
+ * @param {LoadImageRequest} request Request message as a hash array.
+ * @param {function(Object)} callback Callback to be called to return response.
* @return {boolean} True if the message channel should stay alive until the
* callback is called.
* @private
diff --git a/ui/file_manager/image_loader/image_loader_client.js b/ui/file_manager/image_loader/image_loader_client.js
index 6e2ba13..703a5a0 100644
--- a/ui/file_manager/image_loader/image_loader_client.js
+++ b/ui/file_manager/image_loader/image_loader_client.js
@@ -17,7 +17,7 @@
function ImageLoaderClient() {
/**
* Hash array with active tasks.
- * @type {Object}
+ * @type {!Object}
* @private
*/
this.tasks_ = {};
@@ -45,7 +45,7 @@
/**
* Returns a singleton instance.
- * @return {Client} Client instance.
+ * @return {ImageLoaderClient} Client instance.
*/
ImageLoaderClient.getInstance = function() {
if (!ImageLoaderClient.instance_)
@@ -87,9 +87,8 @@
*/
ImageLoaderClient.sendMessage_ = function(request, opt_callback) {
opt_callback = opt_callback || function(response) {};
- var sendMessage = chrome.runtime ? chrome.runtime.sendMessage :
- chrome.extension.sendMessage;
- sendMessage(ImageLoaderClient.EXTENSION_ID, request, opt_callback);
+ chrome.runtime.sendMessage(
+ ImageLoaderClient.EXTENSION_ID, request, opt_callback);
};
/**
@@ -120,7 +119,7 @@
* which are not valid anymore, which will reduce cpu consumption.
*
* @param {string} url Url of the requested image.
- * @param {function} callback Callback used to return response.
+ * @param {function(Object)} callback Callback used to return response.
* @param {Object=} opt_options Loader options, such as: scale, maxHeight,
* width, height and/or cache.
* @param {function(): boolean=} opt_isValid Function returning false in case
@@ -158,18 +157,18 @@
var cacheKey = ImageLoaderClient.Cache.createKey(url, opt_options);
if (opt_options.cache) {
// Load from cache.
- ImageLoaderClient.recordBinary('Cached', 1);
+ ImageLoaderClient.recordBinary('Cached', true);
var cachedData = this.cache_.loadImage(cacheKey, opt_options.timestamp);
if (cachedData) {
- ImageLoaderClient.recordBinary('Cache.HitMiss', 1);
+ ImageLoaderClient.recordBinary('Cache.HitMiss', true);
callback({status: 'success', data: cachedData});
return null;
} else {
- ImageLoaderClient.recordBinary('Cache.HitMiss', 0);
+ ImageLoaderClient.recordBinary('Cache.HitMiss', false);
}
} else {
// Remove from cache.
- ImageLoaderClient.recordBinary('Cached', 0);
+ ImageLoaderClient.recordBinary('Cached', false);
this.cache_.removeImage(cacheKey);
}
@@ -275,10 +274,10 @@
this.removeImage(key);
if (ImageLoaderClient.Cache.MEMORY_LIMIT - this.size_ < data.length) {
- ImageLoaderClient.recordBinary('Evicted', 1);
+ ImageLoaderClient.recordBinary('Evicted', true);
this.evictCache_(data.length);
} else {
- ImageLoaderClient.recordBinary('Evicted', 0);
+ ImageLoaderClient.recordBinary('Evicted', false);
}
if (ImageLoaderClient.Cache.MEMORY_LIMIT - this.size_ >= data.length) {
@@ -347,9 +346,9 @@
* @param {Image} image Image node to load the requested picture into.
* @param {Object} options Loader options, such as: orientation, scale,
* maxHeight, width, height and/or cache.
- * @param {function} onSuccess Callback for success.
- * @param {function} onError Callback for failure.
- * @param {function=} opt_isValid Function returning false in case
+ * @param {function()} onSuccess Callback for success.
+ * @param {function()} onError Callback for failure.
+ * @param {function(): boolean=} opt_isValid Function returning false in case
* a request is not valid anymore, eg. parent node has been detached.
* @return {?number} Remote task id or null if loaded from cache.
*/
diff --git a/ui/file_manager/image_loader/request.js b/ui/file_manager/image_loader/request.js
index cc7c84d..1b1f0df 100644
--- a/ui/file_manager/image_loader/request.js
+++ b/ui/file_manager/image_loader/request.js
@@ -5,13 +5,24 @@
'use strict';
/**
+ * @typedef {{
+ * cache: (boolean|undefined),
+ * priority: (number|undefined),
+ * taskId: number,
+ * timestamp: (number|undefined),
+ * url: string
+ * }}
+ */
+var LoadImageRequest;
+
+/**
* Creates and starts downloading and then resizing of the image. Finally,
* returns the image using the callback.
*
* @param {string} id Request ID.
* @param {Cache} cache Cache object.
- * @param {Object} request Request message as a hash array.
- * @param {function} callback Callback used to send the response.
+ * @param {LoadImageRequest} request Request message as a hash array.
+ * @param {function(Object)} callback Callback used to send the response.
* @constructor
*/
function Request(id, cache, request, callback) {
@@ -28,13 +39,13 @@
this.cache_ = cache;
/**
- * @type {Object}
+ * @type {LoadImageRequest}
* @private
*/
this.request_ = request;
/**
- * @type {function}
+ * @type {function(Object)}
* @private
*/
this.sendResponse_ = callback;
@@ -48,7 +59,7 @@
/**
* MIME type of the fetched image.
- * @type {string}
+ * @type {?string}
* @private
*/
this.contentType_ = null;
@@ -65,17 +76,19 @@
* @type {HTMLCanvasElement}
* @private
*/
- this.canvas_ = document.createElement('canvas');
+ this.canvas_ =
+ /** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
/**
* @type {CanvasRenderingContext2D}
* @private
*/
- this.context_ = this.canvas_.getContext('2d');
+ this.context_ =
+ /** @type {CanvasRenderingContext2D} */ (this.canvas_.getContext('2d'));
/**
* Callback to be called once downloading is finished.
- * @type {function()}
+ * @type {?function()}
* @private
*/
this.downloadCallback_ = null;
@@ -130,7 +143,7 @@
/**
* Fetches the image from the persistent cache.
*
- * @param {function()} onSuccess Success callback.
+ * @param {function(string)} onSuccess Success callback.
* @param {function()} onFailure Failure callback.
* @private
*/
@@ -233,7 +246,7 @@
* a refreshed OAuth2 token.
*
* @param {string} url URL to the resource to be fetched.
- * @param {function(string, Blob}) onSuccess Success callback with the content
+ * @param {function(string, Blob)} onSuccess Success callback with the content
* type and the fetched data.
* @param {function()} onFailure Failure callback.
*/
@@ -241,14 +254,17 @@
this.aborted_ = false;
// Do not call any callbacks when aborting.
- var onMaybeSuccess = function(contentType, response) {
- if (!this.aborted_)
- onSuccess(contentType, response);
- }.bind(this);
- var onMaybeFailure = function(opt_code) {
- if (!this.aborted_)
- onFailure();
- }.bind(this);
+ var onMaybeSuccess = /** @type {function(string, Blob)} */ (
+ function(contentType, response) {
+ if (!this.aborted_)
+ onSuccess(contentType, response);
+ }.bind(this));
+
+ var onMaybeFailure = /** @type {function(number=)} */ (
+ function(opt_code) {
+ if (!this.aborted_)
+ onFailure();
+ }.bind(this));
// Fetches the access token and makes an authorized call. If refresh is true,
// then forces refreshing the access token.
@@ -296,11 +312,11 @@
* @param {?string} token OAuth2 token to be injected to the request. Null for
* no token.
* @param {string} url URL to the resource to be fetched.
- * @param {function(string, Blob}) onSuccess Success callback with the content
+ * @param {function(string, Blob)} onSuccess Success callback with the content
* type and the fetched data.
* @param {function(number=)} onFailure Failure callback with the error code
* if available.
- * @return {AuthorizedXHR} XHR instance.
+ * @return {XMLHttpRequest} XHR instance.
* @private
*/
AuthorizedXHR.load_ = function(token, url, onSuccess, onFailure) {
@@ -315,7 +331,7 @@
return;
}
var contentType = xhr.getResponseHeader('Content-Type');
- onSuccess(contentType, xhr.response);
+ onSuccess(contentType, /** @type {Blob} */ (xhr.response));
}.bind(this);
// Perform a xhr request.
@@ -378,11 +394,9 @@
/**
* Handler, when contents are loaded into the image element. Performs resizing
* and finalizes the request process.
- *
- * @param {function()} callback Completion callback.
* @private
*/
-Request.prototype.onImageLoad_ = function(callback) {
+Request.prototype.onImageLoad_ = function() {
// Perform processing if the url is not a data url, or if there are some
// operations requested.
if (!this.request_.url.match(/^data/) ||
@@ -401,11 +415,9 @@
/**
* Handler, when loading of the image fails. Sends a failure response and
* finalizes the request process.
- *
- * @param {function()} callback Completion callback.
* @private
*/
-Request.prototype.onImageError_ = function(callback) {
+Request.prototype.onImageError_ = function() {
this.sendResponse_(
{status: 'error', taskId: this.request_.taskId});
this.cleanup_();
diff --git a/ui/gfx/image/image_skia.cc b/ui/gfx/image/image_skia.cc
index 737d9f4..bba6c47 100644
--- a/ui/gfx/image/image_skia.cc
+++ b/ui/gfx/image/image_skia.cc
@@ -55,6 +55,20 @@
float scale_;
};
+ImageSkiaRep ScaleImageSkiaRep(const ImageSkiaRep& rep, float target_scale) {
+ DCHECK_NE(rep.scale(), target_scale);
+ if (rep.is_null())
+ return rep;
+
+ gfx::Size scaled_size = ToCeiledSize(
+ gfx::ScaleSize(rep.pixel_size(), target_scale / rep.scale()));
+ return ImageSkiaRep(skia::ImageOperations::Resize(
+ rep.sk_bitmap(),
+ skia::ImageOperations::RESIZE_LANCZOS3,
+ scaled_size.width(),
+ scaled_size.height()), target_scale);
+}
+
} // namespace
// A helper class such that ImageSkia can be cheaply copied. ImageSkia holds a
@@ -175,7 +189,7 @@
ImageSkiaRep image;
float resource_scale = scale;
- if (ImageSkia::IsDSFScalingInImageSkiaEnabled() && g_supported_scales) {
+ if (g_supported_scales) {
if (g_supported_scales->back() <= scale) {
resource_scale = g_supported_scales->back();
} else {
@@ -188,31 +202,18 @@
}
}
}
- if (ImageSkia::IsDSFScalingInImageSkiaEnabled() &&
- scale != resource_scale) {
+ if (scale != resource_scale) {
std::vector<ImageSkiaRep>::iterator iter = FindRepresentation(
resource_scale, fetch_new_image);
-
DCHECK(iter != image_reps_.end());
-
- if (!iter->unscaled()) {
- SkBitmap scaled_image;
- gfx::Size unscaled_size(iter->pixel_width(), iter->pixel_height());
- gfx::Size scaled_size = ToCeiledSize(
- gfx::ScaleSize(unscaled_size, scale / iter->scale()));
-
- image = ImageSkiaRep(skia::ImageOperations::Resize(
- iter->sk_bitmap(),
- skia::ImageOperations::RESIZE_LANCZOS3,
- scaled_size.width(),
- scaled_size.height()), scale);
- DCHECK_EQ(image.pixel_width(), scaled_size.width());
- DCHECK_EQ(image.pixel_height(), scaled_size.height());
- } else {
- image = *iter;
- }
+ image = iter->unscaled() ? (*iter) : ScaleImageSkiaRep(*iter, scale);
} else {
image = source_->GetImageForScale(scale);
+ // Image may be missing for the specified scale in some cases, such like
+ // looking up 2x resources but the 2x resource pack is missing. Falls
+ // back to 1x and re-scale it.
+ if (image.is_null() && scale != 1.0f)
+ image = ScaleImageSkiaRep(source_->GetImageForScale(1.0f), scale);
}
// If the source returned the new image, store it.
@@ -317,12 +318,6 @@
return ImageSkia(ImageSkiaRep(bitmap, 0.0f));
}
-bool ImageSkia::IsDSFScalingInImageSkiaEnabled() {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- return !command_line->HasSwitch(
- switches::kDisableArbitraryScaleFactorInImageSkia);
-}
-
scoped_ptr<ImageSkia> ImageSkia::DeepCopy() const {
ImageSkia* copy = new ImageSkia;
if (isNull())
diff --git a/ui/gfx/image/image_skia.h b/ui/gfx/image/image_skia.h
index 8765457..fa5d070 100644
--- a/ui/gfx/image/image_skia.h
+++ b/ui/gfx/image/image_skia.h
@@ -78,10 +78,6 @@
// density display.
static ImageSkia CreateFrom1xBitmap(const SkBitmap& bitmap);
- // Returns true when ImageSkia looks up the resource pack with the closest
- // scale factor and rescale the fetched image.
- static bool IsDSFScalingInImageSkiaEnabled();
-
// Returns a deep copy of this ImageSkia which has its own storage with
// the ImageSkiaRep instances that this ImageSkia currently has.
// This can be safely passed to and manipulated by another thread.
diff --git a/ui/gfx/image/image_skia_unittest.cc b/ui/gfx/image/image_skia_unittest.cc
index b178a04..1029ddb 100644
--- a/ui/gfx/image/image_skia_unittest.cc
+++ b/ui/gfx/image/image_skia_unittest.cc
@@ -28,12 +28,12 @@
class FixedSource : public ImageSkiaSource {
public:
- FixedSource(const ImageSkiaRep& image) : image_(image) {}
+ explicit FixedSource(const ImageSkiaRep& image) : image_(image) {}
virtual ~FixedSource() {
}
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
return image_;
}
@@ -43,16 +43,35 @@
DISALLOW_COPY_AND_ASSIGN(FixedSource);
};
+class FixedScaleSource : public ImageSkiaSource {
+ public:
+ explicit FixedScaleSource(const ImageSkiaRep& image) : image_(image) {}
+
+ virtual ~FixedScaleSource() {
+ }
+
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
+ if (!image_.unscaled() && image_.scale() != scale)
+ return ImageSkiaRep();
+ return image_;
+ }
+
+ private:
+ ImageSkiaRep image_;
+
+ DISALLOW_COPY_AND_ASSIGN(FixedScaleSource);
+};
+
class DynamicSource : public ImageSkiaSource {
public:
- DynamicSource(const gfx::Size& size)
+ explicit DynamicSource(const gfx::Size& size)
: size_(size),
last_requested_scale_(0.0f) {}
virtual ~DynamicSource() {
}
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
last_requested_scale_ = scale;
return gfx::ImageSkiaRep(size_, scale);
}
@@ -78,7 +97,7 @@
virtual ~NullSource() {
}
- virtual ImageSkiaRep GetImageForScale(float scale) OVERRIDE {
+ virtual ImageSkiaRep GetImageForScale(float scale) override {
return gfx::ImageSkiaRep();
}
@@ -98,7 +117,7 @@
can_modify_(false) {
}
- virtual void Run() OVERRIDE {
+ virtual void Run() override {
can_read_ = image_skia_->CanRead();
can_modify_ = image_skia_->CanModify();
if (can_read_)
@@ -173,6 +192,60 @@
EXPECT_EQ(1U, image_skia.image_reps().size());
}
+TEST_F(ImageSkiaTest, FixedScaledSource) {
+ ImageSkiaRep image(Size(100, 200), 1.0f);
+ ImageSkia image_skia(new FixedScaleSource(image), Size(100, 200));
+ EXPECT_EQ(0U, image_skia.image_reps().size());
+
+ const ImageSkiaRep& result_100p = image_skia.GetRepresentation(1.0f);
+ EXPECT_EQ(100, result_100p.GetWidth());
+ EXPECT_EQ(200, result_100p.GetHeight());
+ EXPECT_EQ(1.0f, result_100p.scale());
+ EXPECT_EQ(1U, image_skia.image_reps().size());
+
+ // 2.0f data doesn't exist, then it falls back to 1.0f and rescale it.
+ const ImageSkiaRep& result_200p = image_skia.GetRepresentation(2.0f);
+
+ EXPECT_EQ(100, result_200p.GetWidth());
+ EXPECT_EQ(200, result_200p.GetHeight());
+ EXPECT_EQ(200, result_200p.pixel_width());
+ EXPECT_EQ(400, result_200p.pixel_height());
+ EXPECT_EQ(2.0f, result_200p.scale());
+ EXPECT_EQ(2U, image_skia.image_reps().size());
+
+ // Get the representation again and make sure it doesn't
+ // generate new image skia rep.
+ image_skia.GetRepresentation(1.0f);
+ image_skia.GetRepresentation(2.0f);
+ EXPECT_EQ(2U, image_skia.image_reps().size());
+}
+
+TEST_F(ImageSkiaTest, FixedUnscaledSource) {
+ ImageSkiaRep image(Size(100, 200), 0.0f);
+ ImageSkia image_skia(new FixedScaleSource(image), Size(100, 200));
+ EXPECT_EQ(0U, image_skia.image_reps().size());
+
+ const ImageSkiaRep& result_100p = image_skia.GetRepresentation(1.0f);
+ EXPECT_EQ(100, result_100p.pixel_width());
+ EXPECT_EQ(200, result_100p.pixel_height());
+ EXPECT_TRUE(result_100p.unscaled());
+ EXPECT_EQ(1U, image_skia.image_reps().size());
+
+ // 2.0f data doesn't exist, but unscaled ImageSkiaRep shouldn't be rescaled.
+ const ImageSkiaRep& result_200p = image_skia.GetRepresentation(2.0f);
+
+ EXPECT_EQ(100, result_200p.pixel_width());
+ EXPECT_EQ(200, result_200p.pixel_height());
+ EXPECT_TRUE(result_200p.unscaled());
+ EXPECT_EQ(1U, image_skia.image_reps().size());
+
+ // Get the representation again and make sure it doesn't
+ // generate new image skia rep.
+ image_skia.GetRepresentation(1.0f);
+ image_skia.GetRepresentation(2.0f);
+ EXPECT_EQ(1U, image_skia.image_reps().size());
+}
+
TEST_F(ImageSkiaTest, DynamicSource) {
ImageSkia image_skia(new DynamicSource(Size(100, 200)), Size(100, 200));
EXPECT_EQ(0U, image_skia.image_reps().size());
@@ -438,10 +511,6 @@
} // namespace
TEST_F(ImageSkiaTest, ArbitraryScaleFactor) {
- // Do not test if the ImageSkia doesn't support arbitrary scale factors.
- if (!ImageSkia::IsDSFScalingInImageSkiaEnabled())
- return;
-
// source is owned by |image|
DynamicSource* source = new DynamicSource(Size(100, 200));
ImageSkia image(source, gfx::Size(100, 200));
@@ -516,29 +585,22 @@
}
TEST_F(ImageSkiaTest, ArbitraryScaleFactorWithMissingResource) {
- // Do not test if the ImageSkia doesn't support arbitrary scale factors.
- if (!ImageSkia::IsDSFScalingInImageSkiaEnabled())
- return;
-
- ImageSkia image(new FixedSource(
+ ImageSkia image(new FixedScaleSource(
ImageSkiaRep(Size(100, 200), 1.0f)), Size(100, 200));
// Requesting 1.5f -- falls back to 2.0f, but couldn't find. It should
- // look up 1.0f and then rescale it.
+ // look up 1.0f and then rescale it. Note that the rescaled ImageSkiaRep will
+ // have 2.0f scale.
const ImageSkiaRep& rep = image.GetRepresentation(1.5f);
EXPECT_EQ(1.5f, rep.scale());
EXPECT_EQ(2U, image.image_reps().size());
- EXPECT_EQ(1.0f, image.image_reps()[0].scale());
+ EXPECT_EQ(2.0f, image.image_reps()[0].scale());
EXPECT_EQ(1.5f, image.image_reps()[1].scale());
}
TEST_F(ImageSkiaTest, UnscaledImageForArbitraryScaleFactor) {
- // Do not test if the ImageSkia doesn't support arbitrary scale factors.
- if (!ImageSkia::IsDSFScalingInImageSkiaEnabled())
- return;
-
// 0.0f means unscaled.
- ImageSkia image(new FixedSource(
+ ImageSkia image(new FixedScaleSource(
ImageSkiaRep(Size(100, 200), 0.0f)), Size(100, 200));
// Requesting 2.0f, which should return 1.0f unscaled image.
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index bf98bc0..d5d4011 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -1093,7 +1093,8 @@
void RenderText::ApplyFadeEffects(internal::SkiaTextRenderer* renderer) {
const int width = display_rect().width();
- if (multiline() || elide_behavior_ != FADE_TAIL || GetContentWidth() <= width)
+ if (multiline() || elide_behavior_ != FADE_TAIL ||
+ static_cast<int>(GetContentWidth()) <= width)
return;
const int gradient_width = CalculateFadeGradientWidth(font_list(), width);
@@ -1198,8 +1199,10 @@
}
}
- if (elide_behavior_ != NO_ELIDE && elide_behavior_ != FADE_TAIL &&
- !layout_text_.empty() && GetContentWidth() > display_rect_.width()) {
+ if (elide_behavior_ != NO_ELIDE &&
+ elide_behavior_ != FADE_TAIL &&
+ !layout_text_.empty() &&
+ static_cast<int>(GetContentWidth()) > display_rect_.width()) {
// This doesn't trim styles so ellipsis may get rendered as a different
// style than the preceding text. See crbug.com/327850.
layout_text_.assign(
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index f3f3294..ad7c9b9 100644
--- a/ui/gfx/switches.cc
+++ b/ui/gfx/switches.cc
@@ -6,12 +6,6 @@
namespace switches {
-// The ImageSkia looks up the resource pack with the closest available scale
-// factor instead of the actual device scale factor and then rescale on
-// ImageSkia side. This switch disables this feature.
-const char kDisableArbitraryScaleFactorInImageSkia[] =
- "disable-arbitrary-scale-factor-in-image-skia";
-
// Disables the HarfBuzz port of RenderText on all platforms.
const char kDisableHarfBuzzRenderText[] = "disable-harfbuzz-rendertext";
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
index e968a49..1fb28a1 100644
--- a/ui/gfx/switches.h
+++ b/ui/gfx/switches.h
@@ -10,7 +10,6 @@
namespace switches {
GFX_EXPORT extern const char kAllowArbitraryScaleFactorInImageSkia[];
-GFX_EXPORT extern const char kDisableArbitraryScaleFactorInImageSkia[];
GFX_EXPORT extern const char kDisableHarfBuzzRenderText[];
GFX_EXPORT extern const char kEnableHarfBuzzRenderText[];
GFX_EXPORT extern const char kEnableWebkitTextSubpixelPositioning[];
diff --git a/ui/gl/gl_image_surface_texture.cc b/ui/gl/gl_image_surface_texture.cc
index 78cab65..4fed45b 100644
--- a/ui/gl/gl_image_surface_texture.cc
+++ b/ui/gl/gl_image_surface_texture.cc
@@ -15,18 +15,18 @@
}
GLImageSurfaceTexture::~GLImageSurfaceTexture() {
- DCHECK(!surface_texture_);
+ DCHECK(!surface_texture_.get());
DCHECK_EQ(0, texture_id_);
}
bool GLImageSurfaceTexture::Initialize(
const gfx::GpuMemoryBufferHandle& handle) {
- DCHECK(!surface_texture_);
+ DCHECK(!surface_texture_.get());
surface_texture_ =
SurfaceTextureTracker::GetInstance()->AcquireSurfaceTexture(
handle.surface_texture_id.primary_id,
handle.surface_texture_id.secondary_id);
- return !!surface_texture_;
+ return !!surface_texture_.get();
}
void GLImageSurfaceTexture::Destroy(bool have_context) {
@@ -54,7 +54,7 @@
return false;
}
- DCHECK(surface_texture_);
+ DCHECK(surface_texture_.get());
if (texture_id != texture_id_) {
// Note: Surface textures used as gpu memory buffers are created with an
// initial dummy texture id of 0. We need to call DetachFromGLContext() here
diff --git a/ui/keyboard/keyboard.gyp b/ui/keyboard/keyboard.gyp
index 1177aa6..db251ec 100644
--- a/ui/keyboard/keyboard.gyp
+++ b/ui/keyboard/keyboard.gyp
@@ -55,10 +55,10 @@
'../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'../../content/content.gyp:content_browser',
'../../ipc/ipc.gyp:ipc',
- '../../mojo/mojo_base.gyp:mojo_cpp_bindings',
+ '../../mojo/edk/mojo_edk.gyp:mojo_system_impl',
'../../mojo/mojo_base.gyp:mojo_environment_chromium',
- '../../mojo/mojo_base.gyp:mojo_js_bindings',
- '../../mojo/mojo_base.gyp:mojo_system_impl',
+ '../../mojo/public/mojo_public.gyp:mojo_cpp_bindings',
+ '../../mojo/public/mojo_public.gyp:mojo_js_bindings',
'../../skia/skia.gyp:skia',
'../../url/url.gyp:url_lib',
'../aura/aura.gyp:aura',
diff --git a/ui/keyboard/resources/keyboard_mojo.js b/ui/keyboard/resources/keyboard_mojo.js
index eddf866..ea681c7 100644
--- a/ui/keyboard/resources/keyboard_mojo.js
+++ b/ui/keyboard/resources/keyboard_mojo.js
@@ -18,7 +18,8 @@
mojo_api = this;
}
- KeyboardImpl.prototype = Object.create(keyboard.KeyboardAPIStub.prototype);
+ KeyboardImpl.prototype = Object.create(
+ keyboard.KeyboardAPI.stubClass.prototype);
KeyboardImpl.prototype.onTextInputTypeChanged = function(input_type) {
console.log('Text input changed: ' + input_type);
@@ -30,9 +31,9 @@
return function() {
connection = new connector.Connection(
serviceProvider.connectToService(
- keyboard.KeyboardUIHandlerMojoProxy.NAME_),
+ keyboard.KeyboardUIHandlerMojo.name),
KeyboardImpl,
- keyboard.KeyboardUIHandlerMojoProxy);
+ keyboard.KeyboardUIHandlerMojo.proxyClass);
};
});
diff --git a/ui/login/account_picker/user_pod_row.css b/ui/login/account_picker/user_pod_row.css
index bb52a3e..b8c764d 100644
--- a/ui/login/account_picker/user_pod_row.css
+++ b/ui/login/account_picker/user_pod_row.css
@@ -416,6 +416,14 @@
width: 220px;
}
+.action-box-area.active ~ .action-box-menu.left-edge-offset {
+ left: 0 !important;
+}
+
+.action-box-area.active ~ .action-box-menu.right-edge-offset {
+ right: 0 !important;
+}
+
.action-box-area.active ~ .action-box-menu:not(.menu-moved-up) {
top: 18px;
}
diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js
index c6af9a8..96d678f 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -949,6 +949,19 @@
this.userTypeBubbleElement.classList.remove('bubble-shown');
this.actionBoxAreaElement.classList.add('active');
+
+ // If the user pod is on either edge of the screen, then the menu
+ // could be displayed partially ofscreen.
+ this.actionBoxMenu.classList.remove('left-edge-offset');
+ this.actionBoxMenu.classList.remove('right-edge-offset');
+
+ var offsetLeft =
+ cr.ui.login.DisplayManager.getOffset(this.actionBoxMenu).left;
+ var menuWidth = this.actionBoxMenu.offsetWidth;
+ if (offsetLeft < 0)
+ this.actionBoxMenu.classList.add('left-edge-offset');
+ else if (offsetLeft + menuWidth > window.innerWidth)
+ this.actionBoxMenu.classList.add('right-edge-offset');
} else {
this.actionBoxAreaElement.classList.remove('active');
this.actionBoxAreaElement.classList.remove('menu-moved-up');
diff --git a/ui/login/display_manager.js b/ui/login/display_manager.js
index d2c0b6f..8f8c60d 100644
--- a/ui/login/display_manager.js
+++ b/ui/login/display_manager.js
@@ -46,10 +46,6 @@
/** @const */ var ACCELERATOR_APP_LAUNCH_BAILOUT = 'app_launch_bailout';
/** @const */ var ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG =
'app_launch_network_config';
-/** @const */ var ACCELERATOR_SHOW_ROLLBACK_ON_RESET =
- 'show_rollback_on_reset_screen';
-/** @const */ var ACCELERATOR_HIDE_ROLLBACK_ON_RESET =
- 'hide_rollback_on_reset_screen';
/* Signin UI state constants. Used to control header bar UI. */
/** @const */ var SIGNIN_UI_STATE = {
@@ -357,7 +353,9 @@
if (this.allowToggleVersion_)
$('version-labels').hidden = !$('version-labels').hidden;
} else if (name == ACCELERATOR_RESET) {
- if (RESET_AVAILABLE_SCREEN_GROUP.indexOf(currentStepId) != -1)
+ if (currentStepId == SCREEN_OOBE_RESET)
+ chrome.send('toggleRollbackOnResetScreen');
+ else if (RESET_AVAILABLE_SCREEN_GROUP.indexOf(currentStepId) != -1)
chrome.send('toggleResetScreen');
} else if (name == ACCELERATOR_DEVICE_REQUISITION) {
if (this.isOobeUI())
@@ -376,12 +374,6 @@
} else if (name == ACCELERATOR_APP_LAUNCH_NETWORK_CONFIG) {
if (currentStepId == SCREEN_APP_LAUNCH_SPLASH)
chrome.send('networkConfigRequest');
- } else if (name == ACCELERATOR_SHOW_ROLLBACK_ON_RESET) {
- if (currentStepId == SCREEN_OOBE_RESET)
- chrome.send('showRollbackOnResetScreen');
- } else if (name == ACCELERATOR_HIDE_ROLLBACK_ON_RESET) {
- if (currentStepId == SCREEN_OOBE_RESET)
- chrome.send('hideRollbackOnResetScreen');
}
if (!this.forceKeyboardFlow_)
diff --git a/ui/login/oobe.css b/ui/login/oobe.css
index d4fe4bf..f124f89 100644
--- a/ui/login/oobe.css
+++ b/ui/login/oobe.css
@@ -129,67 +129,10 @@
max-width: 250px;
}
-#installation-settings-popup {
- background: white;
- border: 1px solid rgb(188, 193, 208);
- border-radius: 2px;
- box-shadow: 0 5px 80px #505050;
- min-height: 250px;
- position: relative;
- width: 460px;
- z-index: 10;
-}
-
-#installation-settings-popup h1 {
- -webkit-padding-end: 24px;
- -webkit-user-select: none;
- background: linear-gradient(white, #F8F8F8);
- color: rgb(83, 99, 125);
- font-size: 105%;
- font-weight: bold;
- margin: 0;
- padding: 10px 15px 8px 15px;
- text-shadow: white 0 1px 2px;
-}
-
-.popup-content-area {
- padding: 0 20px 60px 20px;
-}
-
-#installation-settings-popup button {
- bottom: 20px;
- position: absolute;
- right: 20px;
-}
-
-#tpm-busy {
- text-align: center;
-}
-
-#tpm-password {
- font-weight: bold;
- text-align: center;
-}
-
[hidden] {
display: none !important;
}
-#popup-overlay {
- -webkit-box-align: center;
- -webkit-box-pack: center;
- -webkit-transition: 250ms opacity;
- background: rgba(255, 255, 255, .75);
- bottom: 0;
- display: -webkit-box;
- left: 0;
- padding: 20px;
- position: fixed;
- right: 0;
- top: 0;
- z-index: 5;
-}
-
#bubble {
-webkit-transition: 250ms opacity;
}
diff --git a/ui/message_center/notification.cc b/ui/message_center/notification.cc
index 479beaa..48c8489 100644
--- a/ui/message_center/notification.cc
+++ b/ui/message_center/notification.cc
@@ -70,6 +70,21 @@
is_read_(false),
delegate_(delegate) {}
+Notification::Notification(const std::string& id, const Notification& other)
+ : type_(other.type_),
+ id_(id),
+ title_(other.title_),
+ message_(other.message_),
+ icon_(other.icon_),
+ display_source_(other.display_source_),
+ notifier_id_(other.notifier_id_),
+ serial_number_(other.serial_number_),
+ optional_fields_(other.optional_fields_),
+ shown_as_popup_(other.shown_as_popup_),
+ is_read_(other.is_read_),
+ delegate_(other.delegate_) {
+}
+
Notification::Notification(const Notification& other)
: type_(other.type_),
id_(other.id_),
diff --git a/ui/message_center/notification.h b/ui/message_center/notification.h
index 7a58363..ecd51c8 100644
--- a/ui/message_center/notification.h
+++ b/ui/message_center/notification.h
@@ -64,6 +64,8 @@
const RichNotificationData& optional_fields,
NotificationDelegate* delegate);
+ Notification(const std::string& id, const Notification& other);
+
Notification(const Notification& other);
virtual ~Notification();
diff --git a/ui/ozone/ozone.gyp b/ui/ozone/ozone.gyp
index a0280e0..f965c61 100644
--- a/ui/ozone/ozone.gyp
+++ b/ui/ozone/ozone.gyp
@@ -5,10 +5,14 @@
{
'variables': {
'chromium_code': 1,
- 'external_ozone_platforms': [],
- 'external_ozone_platform_files': [],
- 'external_ozone_platform_deps': [],
- 'external_ozone_platform_unittest_deps': [],
+ # Normally, the external_ozone_platform* variables below can be
+ # overridden by supplement.gypi which must exist exactly one level
+ # below the top-level src directory. They can now also be set in
+ # $GYP_DEFINES
+ 'external_ozone_platforms%': [],
+ 'external_ozone_platform_files%': [],
+ 'external_ozone_platform_deps%': [],
+ 'external_ozone_platform_unittest_deps%': [],
'internal_ozone_platforms': [],
'internal_ozone_platform_deps': [],
'internal_ozone_platform_unittest_deps': [],
diff --git a/ui/ozone/platform/dri/BUILD.gn b/ui/ozone/platform/dri/BUILD.gn
index 61d2baf..857e59f 100644
--- a/ui/ozone/platform/dri/BUILD.gn
+++ b/ui/ozone/platform/dri/BUILD.gn
@@ -11,8 +11,9 @@
source_set("dri_common") {
sources = [
- "crtc_state.cc",
- "crtc_state.h",
+ "channel_observer.h",
+ "crtc_controller.cc",
+ "crtc_controller.h",
"display_mode_dri.cc",
"display_mode_dri.h",
"display_snapshot_dri.cc",
@@ -23,6 +24,10 @@
"dri_cursor.h",
"dri_buffer.cc",
"dri_buffer.h",
+ "dri_gpu_platform_support.cc",
+ "dri_gpu_platform_support_.h",
+ "dri_gpu_platform_support_host.cc",
+ "dri_gpu_platform_support_host.h",
"dri_surface.cc",
"dri_surface.h",
"dri_surface_factory.cc",
@@ -46,6 +51,8 @@
"hardware_display_controller.h",
"native_display_delegate_dri.cc",
"native_display_delegate_dri.h",
+ "overlay_plane.cc",
+ "overlay_plane.h",
"scoped_drm_types.cc",
"scoped_drm_types.h",
"screen_manager.cc",
@@ -113,9 +120,6 @@
source_set("gbm") {
sources = [
- "channel_observer.h",
- "dri_window_delegate_proxy.cc",
- "dri_window_delegate_proxy.h",
"gbm_buffer.cc",
"gbm_buffer.h",
"gbm_buffer_base.cc",
@@ -126,10 +130,6 @@
"gbm_surfaceless.h",
"gbm_surface_factory.cc",
"gbm_surface_factory.h",
- "gpu_platform_support_gbm.cc",
- "gpu_platform_support_gbm.h",
- "gpu_platform_support_host_gbm.cc",
- "gpu_platform_support_host_gbm.h",
"native_display_delegate_proxy.cc",
"native_display_delegate_proxy.h",
"ozone_platform_gbm.cc",
diff --git a/ui/ozone/platform/dri/crtc_controller.cc b/ui/ozone/platform/dri/crtc_controller.cc
new file mode 100644
index 0000000..f605e5f
--- /dev/null
+++ b/ui/ozone/platform/dri/crtc_controller.cc
@@ -0,0 +1,139 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/dri/crtc_controller.h"
+
+#include "base/logging.h"
+#include "base/time/time.h"
+#include "ui/ozone/platform/dri/dri_wrapper.h"
+#include "ui/ozone/platform/dri/scanout_buffer.h"
+
+namespace ui {
+
+CrtcController::CrtcController(DriWrapper* drm,
+ uint32_t crtc,
+ uint32_t connector)
+ : drm_(drm),
+ crtc_(crtc),
+ connector_(connector),
+ saved_crtc_(drm->GetCrtc(crtc)),
+ is_disabled_(true),
+ page_flip_pending_(false),
+ time_of_last_flip_(0) {
+}
+
+CrtcController::~CrtcController() {
+ if (!is_disabled_) {
+ drm_->SetCrtc(saved_crtc_.get(), std::vector<uint32_t>(1, connector_));
+ UnsetCursor();
+ }
+}
+
+bool CrtcController::Modeset(const OverlayPlane& plane, drmModeModeInfo mode) {
+ if (!drm_->SetCrtc(crtc_,
+ plane.buffer->GetFramebufferId(),
+ std::vector<uint32_t>(1, connector_),
+ &mode)) {
+ LOG(ERROR) << "Failed to modeset: error='" << strerror(errno)
+ << "' crtc=" << crtc_ << " connector=" << connector_
+ << " framebuffer_id=" << plane.buffer->GetFramebufferId()
+ << " mode=" << mode.hdisplay << "x" << mode.vdisplay << "@"
+ << mode.vrefresh;
+ return false;
+ }
+
+ current_planes_ = std::vector<OverlayPlane>(1, plane);
+ mode_ = mode;
+ pending_planes_.clear();
+ is_disabled_ = false;
+ page_flip_pending_ = false;
+
+ return true;
+}
+
+bool CrtcController::Disable() {
+ if (is_disabled_)
+ return true;
+
+ is_disabled_ = true;
+ page_flip_pending_ = false;
+ return drm_->DisableCrtc(crtc_);
+}
+
+bool CrtcController::SchedulePageFlip(const OverlayPlaneList& overlays) {
+ DCHECK(!page_flip_pending_);
+ DCHECK(!is_disabled_);
+ const OverlayPlane& primary = OverlayPlane::GetPrimaryPlane(overlays);
+ DCHECK(primary.buffer.get());
+
+ if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) {
+ LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected "
+ << mode_.hdisplay << "x" << mode_.vdisplay << " got "
+ << primary.buffer->GetSize().ToString() << " for"
+ << " crtc=" << crtc_ << " connector=" << connector_;
+ return true;
+ }
+
+ if (!drm_->PageFlip(crtc_, primary.buffer->GetFramebufferId(), this)) {
+ LOG(ERROR) << "Cannot page flip: error='" << strerror(errno) << "'"
+ << " crtc=" << crtc_
+ << " framebuffer=" << primary.buffer->GetFramebufferId()
+ << " size=" << primary.buffer->GetSize().ToString();
+ return false;
+ }
+
+ page_flip_pending_ = true;
+ pending_planes_ = overlays;
+
+ for (size_t i = 0; i < overlays.size(); i++) {
+ const OverlayPlane& plane = overlays[i];
+ if (!plane.overlay_plane)
+ continue;
+
+ const gfx::Size& size = plane.buffer->GetSize();
+ gfx::RectF crop_rect = plane.crop_rect;
+ crop_rect.Scale(size.width(), size.height());
+ if (!drm_->PageFlipOverlay(crtc_,
+ plane.buffer->GetFramebufferId(),
+ plane.display_bounds,
+ crop_rect,
+ plane.overlay_plane)) {
+ LOG(ERROR) << "Cannot display on overlay: " << strerror(errno);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+void CrtcController::OnPageFlipEvent(unsigned int frame,
+ unsigned int seconds,
+ unsigned int useconds) {
+ page_flip_pending_ = false;
+ time_of_last_flip_ =
+ static_cast<uint64_t>(seconds) * base::Time::kMicrosecondsPerSecond +
+ useconds;
+
+ current_planes_.clear();
+ current_planes_.swap(pending_planes_);
+}
+
+bool CrtcController::SetCursor(const scoped_refptr<ScanoutBuffer>& buffer) {
+ DCHECK(!is_disabled_);
+ cursor_buffer_ = buffer;
+ return drm_->SetCursor(crtc_, buffer->GetHandle(), buffer->GetSize());
+}
+
+bool CrtcController::UnsetCursor() {
+ bool state = drm_->SetCursor(crtc_, 0, gfx::Size());
+ cursor_buffer_ = NULL;
+ return state;
+}
+
+bool CrtcController::MoveCursor(const gfx::Point& location) {
+ DCHECK(!is_disabled_);
+ return drm_->MoveCursor(crtc_, location);
+}
+
+} // namespace ui
diff --git a/ui/ozone/platform/dri/crtc_controller.h b/ui/ozone/platform/dri/crtc_controller.h
new file mode 100644
index 0000000..eefe926
--- /dev/null
+++ b/ui/ozone/platform/dri/crtc_controller.h
@@ -0,0 +1,96 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_DRI_CRTC_CONTROLLER_H_
+#define UI_OZONE_PLATFORM_DRI_CRTC_CONTROLLER_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <xf86drmMode.h>
+
+#include "ui/ozone/platform/dri/overlay_plane.h"
+#include "ui/ozone/platform/dri/scoped_drm_types.h"
+
+namespace ui {
+
+class DriWrapper;
+
+// Wrapper around a CRTC.
+//
+// One CRTC can be paired up with one or more connectors. The simplest
+// configuration represents one CRTC driving one monitor, while pairing up a
+// CRTC with multiple connectors results in hardware mirroring.
+class CrtcController {
+ public:
+ CrtcController(DriWrapper* drm, uint32_t crtc, uint32_t connector);
+ ~CrtcController();
+
+ uint32_t crtc() const { return crtc_; }
+ uint32_t connector() const { return connector_; }
+ DriWrapper* drm() const { return drm_; }
+ bool is_disabled() const { return is_disabled_; }
+ bool page_flip_pending() const { return page_flip_pending_; }
+ uint64_t time_of_last_flip() const { return time_of_last_flip_; }
+
+ // Perform the initial modesetting operation using |plane| as the buffer for
+ // the primary plane. The CRTC configuration is specified by |mode|.
+ bool Modeset(const OverlayPlane& plane, drmModeModeInfo mode);
+
+ // Disables the controller.
+ bool Disable();
+
+ // Schedule a page flip event and present the overlays in |planes|.
+ bool SchedulePageFlip(const OverlayPlaneList& planes);
+
+ // Called when the page flip event occurred. The event is provided by the
+ // kernel when a VBlank event finished. This allows the controller to
+ // update internal state and propagate the update to the surface.
+ // The tuple (seconds, useconds) represents the event timestamp. |seconds|
+ // represents the number of seconds while |useconds| represents the
+ // microseconds (< 1 second) in the timestamp.
+ void OnPageFlipEvent(unsigned int frame,
+ unsigned int seconds,
+ unsigned int useconds);
+
+ bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer);
+ bool UnsetCursor();
+ bool MoveCursor(const gfx::Point& location);
+
+ private:
+ DriWrapper* drm_; // Not owned.
+
+ // Buffers need to be declared first so that they are destroyed last. Needed
+ // since the controllers may reference the buffers.
+ OverlayPlaneList current_planes_;
+ OverlayPlaneList pending_planes_;
+ scoped_refptr<ScanoutBuffer> cursor_buffer_;
+
+ uint32_t crtc_;
+
+ // TODO(dnicoara) Add support for hardware mirroring (multiple connectors).
+ uint32_t connector_;
+
+ drmModeModeInfo mode_;
+
+ // Store the state of the CRTC before we took over. Used to restore the CRTC
+ // once we no longer need it.
+ ScopedDrmCrtcPtr saved_crtc_;
+
+ // Keeps track of the CRTC state. If a surface has been bound, then the value
+ // is set to false. Otherwise it is true.
+ bool is_disabled_;
+
+ // True if a successful SchedulePageFlip occurred. Reset to false by a modeset
+ // operation or when the OnPageFlipEvent callback is triggered.
+ bool page_flip_pending_;
+
+ // The time of the last page flip event as reported by the kernel callback.
+ uint64_t time_of_last_flip_;
+
+ DISALLOW_COPY_AND_ASSIGN(CrtcController);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRI_CRTC_CONTROLLER_H_
diff --git a/ui/ozone/platform/dri/crtc_state.cc b/ui/ozone/platform/dri/crtc_state.cc
deleted file mode 100644
index ff2e137..0000000
--- a/ui/ozone/platform/dri/crtc_state.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/ozone/platform/dri/crtc_state.h"
-
-#include "ui/ozone/platform/dri/dri_wrapper.h"
-
-namespace ui {
-
-CrtcState::CrtcState(DriWrapper* drm,
- uint32_t crtc,
- uint32_t connector)
- : drm_(drm),
- crtc_(crtc),
- connector_(connector),
- saved_crtc_(drm->GetCrtc(crtc)),
- is_disabled_(true) {}
-
-CrtcState::~CrtcState() {
- if (!is_disabled_) {
- drm_->SetCrtc(saved_crtc_.get(), std::vector<uint32_t>(1, connector_));
- drm_->SetCursor(crtc_, 0, gfx::Size());
- }
-}
-
-} // namespace ui
diff --git a/ui/ozone/platform/dri/crtc_state.h b/ui/ozone/platform/dri/crtc_state.h
deleted file mode 100644
index e4ad391..0000000
--- a/ui/ozone/platform/dri/crtc_state.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_OZONE_PLATFORM_DRI_CRTC_STATE_H_
-#define UI_OZONE_PLATFORM_DRI_CRTC_STATE_H_
-
-#include <stdint.h>
-
-#include "ui/ozone/platform/dri/scoped_drm_types.h"
-
-namespace ui {
-
-class DriWrapper;
-
-// Represents the state of a CRTC.
-//
-// One CRTC can be paired up with one or more connectors. The simplest
-// configuration represents one CRTC driving one monitor, while pairing up a
-// CRTC with multiple connectors results in hardware mirroring.
-class CrtcState {
- public:
- CrtcState(DriWrapper* drm, uint32_t crtc, uint32_t connector);
- ~CrtcState();
-
- uint32_t crtc() const { return crtc_; }
- uint32_t connector() const { return connector_; }
- bool is_disabled() const { return is_disabled_; }
-
- void set_is_disabled(bool state) { is_disabled_ = state; }
-
- private:
- DriWrapper* drm_; // Not owned.
-
- uint32_t crtc_;
-
- // TODO(dnicoara) Add support for hardware mirroring (multiple connectors).
- uint32_t connector_;
-
- // Store the state of the CRTC before we took over. Used to restore the CRTC
- // once we no longer need it.
- ScopedDrmCrtcPtr saved_crtc_;
-
- // Keeps track of the CRTC state. If a surface has been bound, then the value
- // is set to false. Otherwise it is true.
- bool is_disabled_;
-
- DISALLOW_COPY_AND_ASSIGN(CrtcState);
-};
-
-} // namespace ui
-
-#endif // UI_OZONE_PLATFORM_DRI_CRTC_STATE_H_
diff --git a/ui/ozone/platform/dri/dri.gypi b/ui/ozone/platform/dri/dri.gypi
index 9c74b7f..9f7f2bd 100644
--- a/ui/ozone/platform/dri/dri.gypi
+++ b/ui/ozone/platform/dri/dri.gypi
@@ -35,8 +35,9 @@
'OZONE_IMPLEMENTATION',
],
'sources': [
- 'crtc_state.cc',
- 'crtc_state.h',
+ 'channel_observer.h',
+ 'crtc_controller.cc',
+ 'crtc_controller.h',
'display_mode_dri.cc',
'display_mode_dri.h',
'display_snapshot_dri.cc',
@@ -47,6 +48,10 @@
'dri_buffer.h',
'dri_cursor.cc',
'dri_cursor.h',
+ 'dri_gpu_platform_support.cc',
+ 'dri_gpu_platform_support.h',
+ 'dri_gpu_platform_support_host.cc',
+ 'dri_gpu_platform_support_host.h',
'dri_surface.cc',
'dri_surface.h',
'dri_surface_factory.cc',
@@ -70,6 +75,8 @@
'hardware_display_controller.h',
'native_display_delegate_dri.cc',
'native_display_delegate_dri.h',
+ 'overlay_plane.cc',
+ 'overlay_plane.h',
'ozone_platform_dri.cc',
'ozone_platform_dri.h',
'scoped_drm_types.cc',
diff --git a/ui/ozone/platform/dri/gpu_platform_support_gbm.cc b/ui/ozone/platform/dri/dri_gpu_platform_support.cc
similarity index 86%
rename from ui/ozone/platform/dri/gpu_platform_support_gbm.cc
rename to ui/ozone/platform/dri/dri_gpu_platform_support.cc
index 9bcd094..4a19469 100644
--- a/ui/ozone/platform/dri/gpu_platform_support_gbm.cc
+++ b/ui/ozone/platform/dri/dri_gpu_platform_support.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/ozone/platform/dri/gpu_platform_support_gbm.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support.h"
#include "ipc/ipc_message_macros.h"
#include "ui/display/types/display_mode.h"
@@ -33,7 +33,7 @@
} // namespace
-GpuPlatformSupportGbm::GpuPlatformSupportGbm(
+DriGpuPlatformSupport::DriGpuPlatformSupport(
DriSurfaceFactory* dri,
DriWindowDelegateManager* window_manager,
ScreenManager* screen_manager,
@@ -45,23 +45,24 @@
ndd_(ndd.Pass()) {
}
-GpuPlatformSupportGbm::~GpuPlatformSupportGbm() {}
+DriGpuPlatformSupport::~DriGpuPlatformSupport() {
+}
-void GpuPlatformSupportGbm::AddHandler(scoped_ptr<GpuPlatformSupport> handler) {
+void DriGpuPlatformSupport::AddHandler(scoped_ptr<GpuPlatformSupport> handler) {
handlers_.push_back(handler.release());
}
-void GpuPlatformSupportGbm::OnChannelEstablished(IPC::Sender* sender) {
+void DriGpuPlatformSupport::OnChannelEstablished(IPC::Sender* sender) {
sender_ = sender;
for (size_t i = 0; i < handlers_.size(); ++i)
handlers_[i]->OnChannelEstablished(sender);
}
-bool GpuPlatformSupportGbm::OnMessageReceived(const IPC::Message& message) {
+bool DriGpuPlatformSupport::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(GpuPlatformSupportGbm, message)
+ IPC_BEGIN_MESSAGE_MAP(DriGpuPlatformSupport, message)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_CreateWindowDelegate, OnCreateWindowDelegate)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_DestroyWindowDelegate,
OnDestroyWindowDelegate)
@@ -87,7 +88,7 @@
return false;
}
-void GpuPlatformSupportGbm::OnCreateWindowDelegate(
+void DriGpuPlatformSupport::OnCreateWindowDelegate(
gfx::AcceleratedWidget widget) {
// Due to how the GPU process starts up this IPC call may happen after the IPC
// to create a surface. Since a surface wants to know the window associated
@@ -101,35 +102,35 @@
}
}
-void GpuPlatformSupportGbm::OnDestroyWindowDelegate(
+void DriGpuPlatformSupport::OnDestroyWindowDelegate(
gfx::AcceleratedWidget widget) {
scoped_ptr<DriWindowDelegate> delegate =
window_manager_->RemoveWindowDelegate(widget);
delegate->Shutdown();
}
-void GpuPlatformSupportGbm::OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
+void DriGpuPlatformSupport::OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
const gfx::Rect& bounds) {
window_manager_->GetWindowDelegate(widget)->OnBoundsChanged(bounds);
}
-void GpuPlatformSupportGbm::OnCursorSet(gfx::AcceleratedWidget widget,
+void DriGpuPlatformSupport::OnCursorSet(gfx::AcceleratedWidget widget,
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& location,
int frame_delay_ms) {
dri_->SetHardwareCursor(widget, bitmaps, location, frame_delay_ms);
}
-void GpuPlatformSupportGbm::OnCursorMove(gfx::AcceleratedWidget widget,
+void DriGpuPlatformSupport::OnCursorMove(gfx::AcceleratedWidget widget,
const gfx::Point& location) {
dri_->MoveHardwareCursor(widget, location);
}
-void GpuPlatformSupportGbm::OnForceDPMSOn() {
+void DriGpuPlatformSupport::OnForceDPMSOn() {
ndd_->ForceDPMSOn();
}
-void GpuPlatformSupportGbm::OnRefreshNativeDisplays(
+void DriGpuPlatformSupport::OnRefreshNativeDisplays(
const std::vector<DisplaySnapshot_Params>& cached_displays) {
std::vector<DisplaySnapshot_Params> displays;
std::vector<DisplaySnapshot*> native_displays = ndd_->GetDisplays();
@@ -157,7 +158,7 @@
sender_->Send(new OzoneHostMsg_UpdateNativeDisplays(displays));
}
-void GpuPlatformSupportGbm::OnConfigureNativeDisplay(
+void DriGpuPlatformSupport::OnConfigureNativeDisplay(
int64_t id,
const DisplayMode_Params& mode_param,
const gfx::Point& origin) {
@@ -195,7 +196,7 @@
ndd_->Configure(*display, mode, origin);
}
-void GpuPlatformSupportGbm::OnDisableNativeDisplay(int64_t id) {
+void DriGpuPlatformSupport::OnDisableNativeDisplay(int64_t id) {
DisplaySnapshot* display = ndd_->FindDisplaySnapshot(id);
if (display)
ndd_->Configure(*display, NULL, gfx::Point());
diff --git a/ui/ozone/platform/dri/gpu_platform_support_gbm.h b/ui/ozone/platform/dri/dri_gpu_platform_support.h
similarity index 87%
rename from ui/ozone/platform/dri/gpu_platform_support_gbm.h
rename to ui/ozone/platform/dri/dri_gpu_platform_support.h
index 8fa4cc3..65a8ee5 100644
--- a/ui/ozone/platform/dri/gpu_platform_support_gbm.h
+++ b/ui/ozone/platform/dri/dri_gpu_platform_support.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_
-#define UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_
+#ifndef UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_
+#define UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/scoped_ptr.h"
@@ -29,13 +29,13 @@
struct DisplayMode_Params;
struct DisplaySnapshot_Params;
-class GpuPlatformSupportGbm : public GpuPlatformSupport {
+class DriGpuPlatformSupport : public GpuPlatformSupport {
public:
- GpuPlatformSupportGbm(DriSurfaceFactory* dri,
+ DriGpuPlatformSupport(DriSurfaceFactory* dri,
DriWindowDelegateManager* window_manager,
ScreenManager* screen_manager,
scoped_ptr<NativeDisplayDelegateDri> ndd);
- virtual ~GpuPlatformSupportGbm();
+ virtual ~DriGpuPlatformSupport();
void AddHandler(scoped_ptr<GpuPlatformSupport> handler);
@@ -76,4 +76,4 @@
} // namespace ui
-#endif // UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_
+#endif // UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_H_
diff --git a/ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc b/ui/ozone/platform/dri/dri_gpu_platform_support_host.cc
similarity index 71%
rename from ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc
rename to ui/ozone/platform/dri/dri_gpu_platform_support_host.cc
index f5a369a..287f53d 100644
--- a/ui/ozone/platform/dri/gpu_platform_support_host_gbm.cc
+++ b/ui/ozone/platform/dri/dri_gpu_platform_support_host.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
#include "base/debug/trace_event.h"
#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
@@ -11,22 +11,23 @@
namespace ui {
-GpuPlatformSupportHostGbm::GpuPlatformSupportHostGbm()
+DriGpuPlatformSupportHost::DriGpuPlatformSupportHost()
: host_id_(-1), sender_(NULL) {
}
-GpuPlatformSupportHostGbm::~GpuPlatformSupportHostGbm() {}
+DriGpuPlatformSupportHost::~DriGpuPlatformSupportHost() {
+}
-bool GpuPlatformSupportHostGbm::IsConnected() const {
+bool DriGpuPlatformSupportHost::IsConnected() const {
return sender_ != NULL;
}
-void GpuPlatformSupportHostGbm::RegisterHandler(
+void DriGpuPlatformSupportHost::RegisterHandler(
GpuPlatformSupportHost* handler) {
handlers_.push_back(handler);
}
-void GpuPlatformSupportHostGbm::UnregisterHandler(
+void DriGpuPlatformSupportHost::UnregisterHandler(
GpuPlatformSupportHost* handler) {
std::vector<GpuPlatformSupportHost*>::iterator it =
std::find(handlers_.begin(), handlers_.end(), handler);
@@ -34,22 +35,22 @@
handlers_.erase(it);
}
-void GpuPlatformSupportHostGbm::AddChannelObserver(ChannelObserver* observer) {
+void DriGpuPlatformSupportHost::AddChannelObserver(ChannelObserver* observer) {
channel_observers_.AddObserver(observer);
if (sender_)
observer->OnChannelEstablished();
}
-void GpuPlatformSupportHostGbm::RemoveChannelObserver(
+void DriGpuPlatformSupportHost::RemoveChannelObserver(
ChannelObserver* observer) {
channel_observers_.RemoveObserver(observer);
}
-void GpuPlatformSupportHostGbm::OnChannelEstablished(int host_id,
+void DriGpuPlatformSupportHost::OnChannelEstablished(int host_id,
IPC::Sender* sender) {
TRACE_EVENT1("dri",
- "GpuPlatformSupportHostGbm::OnChannelEstablished",
+ "DriGpuPlatformSupportHost::OnChannelEstablished",
"host_id",
host_id);
host_id_ = host_id;
@@ -67,9 +68,9 @@
ChannelObserver, channel_observers_, OnChannelEstablished());
}
-void GpuPlatformSupportHostGbm::OnChannelDestroyed(int host_id) {
+void DriGpuPlatformSupportHost::OnChannelDestroyed(int host_id) {
TRACE_EVENT1("dri",
- "GpuPlatformSupportHostGbm::OnChannelDestroyed",
+ "DriGpuPlatformSupportHost::OnChannelDestroyed",
"host_id",
host_id);
if (host_id_ == host_id) {
@@ -84,7 +85,7 @@
handlers_[i]->OnChannelDestroyed(host_id);
}
-bool GpuPlatformSupportHostGbm::OnMessageReceived(const IPC::Message& message) {
+bool DriGpuPlatformSupportHost::OnMessageReceived(const IPC::Message& message) {
for (size_t i = 0; i < handlers_.size(); ++i)
if (handlers_[i]->OnMessageReceived(message))
return true;
@@ -92,7 +93,7 @@
return false;
}
-bool GpuPlatformSupportHostGbm::Send(IPC::Message* message) {
+bool DriGpuPlatformSupportHost::Send(IPC::Message* message) {
if (sender_)
return sender_->Send(message);
@@ -100,7 +101,7 @@
return true;
}
-void GpuPlatformSupportHostGbm::SetHardwareCursor(
+void DriGpuPlatformSupportHost::SetHardwareCursor(
gfx::AcceleratedWidget widget,
const std::vector<SkBitmap>& bitmaps,
const gfx::Point& location,
@@ -108,7 +109,7 @@
Send(new OzoneGpuMsg_CursorSet(widget, bitmaps, location, frame_delay_ms));
}
-void GpuPlatformSupportHostGbm::MoveHardwareCursor(
+void DriGpuPlatformSupportHost::MoveHardwareCursor(
gfx::AcceleratedWidget widget,
const gfx::Point& location) {
Send(new OzoneGpuMsg_CursorMove(widget, location));
diff --git a/ui/ozone/platform/dri/gpu_platform_support_host_gbm.h b/ui/ozone/platform/dri/dri_gpu_platform_support_host.h
similarity index 86%
rename from ui/ozone/platform/dri/gpu_platform_support_host_gbm.h
rename to ui/ozone/platform/dri/dri_gpu_platform_support_host.h
index a0e06f4..0315b54 100644
--- a/ui/ozone/platform/dri/gpu_platform_support_host_gbm.h
+++ b/ui/ozone/platform/dri/dri_gpu_platform_support_host.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_HOST_GBM_H_
-#define UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_HOST_GBM_H_
+#ifndef UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_HOST_H_
+#define UI_OZONE_PLATFORM_DRI_DRI_GPU_PLATFORM_SUPPORT_HOST_H_
#include <queue>
#include <vector>
@@ -23,12 +23,12 @@
class ChannelObserver;
-class GpuPlatformSupportHostGbm : public GpuPlatformSupportHost,
+class DriGpuPlatformSupportHost : public GpuPlatformSupportHost,
public HardwareCursorDelegate,
public IPC::Sender {
public:
- GpuPlatformSupportHostGbm();
- virtual ~GpuPlatformSupportHostGbm();
+ DriGpuPlatformSupportHost();
+ virtual ~DriGpuPlatformSupportHost();
bool IsConnected() const;
@@ -69,4 +69,4 @@
} // namespace ui
-#endif // UI_OZONE_GPU_GPU_PLATFORM_SUPPORT_HOST_GBM_H_
+#endif // UI_OZONE_GPU_DRI_GPU_PLATFORM_SUPPORT_HOST_H_
diff --git a/ui/ozone/platform/dri/dri_surface_factory.h b/ui/ozone/platform/dri/dri_surface_factory.h
index 6800128..c51847e 100644
--- a/ui/ozone/platform/dri/dri_surface_factory.h
+++ b/ui/ozone/platform/dri/dri_surface_factory.h
@@ -6,6 +6,7 @@
#define UI_OZONE_PLATFORM_DRI_DRI_SURFACE_FACTORY_H_
#include <map>
+#include <vector>
#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
diff --git a/ui/ozone/platform/dri/dri_surface_unittest.cc b/ui/ozone/platform/dri/dri_surface_unittest.cc
index 0d64728..427911e 100644
--- a/ui/ozone/platform/dri/dri_surface_unittest.cc
+++ b/ui/ozone/platform/dri/dri_surface_unittest.cc
@@ -7,7 +7,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkDevice.h"
-#include "ui/ozone/platform/dri/crtc_state.h"
+#include "ui/ozone/platform/dri/crtc_controller.h"
#include "ui/ozone/platform/dri/dri_buffer.h"
#include "ui/ozone/platform/dri/dri_surface.h"
#include "ui/ozone/platform/dri/dri_window_delegate.h"
@@ -26,10 +26,8 @@
class MockDriWindowDelegate : public ui::DriWindowDelegate {
public:
MockDriWindowDelegate(ui::DriWrapper* drm) {
- controller_.reset(new ui::HardwareDisplayController(
- drm,
- make_scoped_ptr(
- new ui::CrtcState(drm, kDefaultCrtc, kDefaultConnector))));
+ controller_.reset(new ui::HardwareDisplayController(make_scoped_ptr(
+ new ui::CrtcController(drm, kDefaultCrtc, kDefaultConnector))));
scoped_refptr<ui::DriBuffer> buffer(new ui::DriBuffer(drm));
SkImageInfo info = SkImageInfo::MakeN32Premul(kDefaultMode.hdisplay,
kDefaultMode.vdisplay);
diff --git a/ui/ozone/platform/dri/dri_vsync_provider.cc b/ui/ozone/platform/dri/dri_vsync_provider.cc
index 3888d40..bf88c5d 100644
--- a/ui/ozone/platform/dri/dri_vsync_provider.cc
+++ b/ui/ozone/platform/dri/dri_vsync_provider.cc
@@ -22,13 +22,13 @@
return;
// The value is invalid, so we can't update the parameters.
- if (controller->get_time_of_last_flip() == 0 ||
+ if (controller->GetTimeOfLastFlip() == 0 ||
controller->get_mode().vrefresh == 0)
return;
// Stores the time of the last refresh.
base::TimeTicks timebase =
- base::TimeTicks::FromInternalValue(controller->get_time_of_last_flip());
+ base::TimeTicks::FromInternalValue(controller->GetTimeOfLastFlip());
// Stores the refresh rate.
base::TimeDelta interval =
base::TimeDelta::FromSeconds(1) / controller->get_mode().vrefresh;
diff --git a/ui/ozone/platform/dri/dri_window.cc b/ui/ozone/platform/dri/dri_window.cc
index 7e60bd7..cce1dd6 100644
--- a/ui/ozone/platform/dri/dri_window.cc
+++ b/ui/ozone/platform/dri/dri_window.cc
@@ -9,9 +9,9 @@
#include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/events/ozone/events_ozone.h"
#include "ui/events/platform/platform_event_source.h"
+#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
#include "ui/ozone/platform/dri/dri_cursor.h"
-#include "ui/ozone/platform/dri/dri_window_delegate.h"
-#include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
#include "ui/ozone/platform/dri/dri_window_manager.h"
#include "ui/platform_window/platform_window_delegate.h"
@@ -19,32 +19,31 @@
DriWindow::DriWindow(PlatformWindowDelegate* delegate,
const gfx::Rect& bounds,
- scoped_ptr<DriWindowDelegate> dri_window_delegate,
+ DriGpuPlatformSupportHost* sender,
EventFactoryEvdev* event_factory,
- DriWindowDelegateManager* window_delegate_manager,
DriWindowManager* window_manager)
: delegate_(delegate),
- bounds_(bounds),
- widget_(dri_window_delegate->GetAcceleratedWidget()),
- dri_window_delegate_(dri_window_delegate.get()),
+ sender_(sender),
event_factory_(event_factory),
- window_delegate_manager_(window_delegate_manager),
- window_manager_(window_manager) {
- window_delegate_manager_->AddWindowDelegate(widget_,
- dri_window_delegate.Pass());
+ window_manager_(window_manager),
+ bounds_(bounds),
+ widget_(window_manager->NextAcceleratedWidget()) {
window_manager_->AddWindow(widget_, this);
}
DriWindow::~DriWindow() {
PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
- dri_window_delegate_->Shutdown();
window_manager_->RemoveWindow(widget_);
- window_delegate_manager_->RemoveWindowDelegate(widget_);
+
+ sender_->RemoveChannelObserver(this);
+ if (!sender_->IsConnected())
+ return;
+
+ sender_->Send(new OzoneGpuMsg_DestroyWindowDelegate(widget_));
}
void DriWindow::Initialize() {
- dri_window_delegate_->Initialize();
- dri_window_delegate_->OnBoundsChanged(bounds_);
+ sender_->AddChannelObserver(this);
delegate_->OnAcceleratedWidgetAvailable(widget_);
PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
}
@@ -58,10 +57,14 @@
void DriWindow::SetBounds(const gfx::Rect& bounds) {
bounds_ = bounds;
delegate_->OnBoundsChanged(bounds);
+
+ if (!sender_->IsConnected())
+ return;
+
if (window_manager_->cursor()->GetCursorWindow() == widget_)
window_manager_->cursor()->HideCursor();
- dri_window_delegate_->OnBoundsChanged(bounds);
+ sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds));
if (window_manager_->cursor()->GetCursorWindow() == widget_)
window_manager_->cursor()->ShowCursor();
@@ -108,4 +111,12 @@
return POST_DISPATCH_STOP_PROPAGATION;
}
+void DriWindow::OnChannelEstablished() {
+ sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_));
+ sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds_));
+}
+
+void DriWindow::OnChannelDestroyed() {
+}
+
} // namespace ui
diff --git a/ui/ozone/platform/dri/dri_window.h b/ui/ozone/platform/dri/dri_window.h
index 799b1ee..825c6a0 100644
--- a/ui/ozone/platform/dri/dri_window.h
+++ b/ui/ozone/platform/dri/dri_window.h
@@ -9,23 +9,24 @@
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/ozone/platform/dri/channel_observer.h"
#include "ui/platform_window/platform_window.h"
namespace ui {
class DriWindowDelegate;
-class DriWindowDelegateManager;
class DriWindowManager;
class EventFactoryEvdev;
+class DriGpuPlatformSupportHost;
class DriWindow : public PlatformWindow,
- public PlatformEventDispatcher {
+ public PlatformEventDispatcher,
+ public ChannelObserver {
public:
DriWindow(PlatformWindowDelegate* delegate,
const gfx::Rect& bounds,
- scoped_ptr<DriWindowDelegate> dri_window_delegate,
+ DriGpuPlatformSupportHost* sender,
EventFactoryEvdev* event_factory,
- DriWindowDelegateManager* window_delegate_manager,
DriWindowManager* window_manager);
virtual ~DriWindow();
@@ -50,14 +51,18 @@
virtual bool CanDispatchEvent(const PlatformEvent& event) OVERRIDE;
virtual uint32_t DispatchEvent(const PlatformEvent& event) OVERRIDE;
+ // ChannelObserver:
+ virtual void OnChannelEstablished() OVERRIDE;
+ virtual void OnChannelDestroyed() OVERRIDE;
+
private:
- PlatformWindowDelegate* delegate_;
+ PlatformWindowDelegate* delegate_; // Not owned.
+ DriGpuPlatformSupportHost* sender_; // Not owned.
+ EventFactoryEvdev* event_factory_; // Not owned.
+ DriWindowManager* window_manager_; // Not owned.
+
gfx::Rect bounds_;
gfx::AcceleratedWidget widget_;
- DriWindowDelegate* dri_window_delegate_;
- EventFactoryEvdev* event_factory_;
- DriWindowDelegateManager* window_delegate_manager_;
- DriWindowManager* window_manager_;
DISALLOW_COPY_AND_ASSIGN(DriWindow);
};
diff --git a/ui/ozone/platform/dri/dri_window_delegate_proxy.cc b/ui/ozone/platform/dri/dri_window_delegate_proxy.cc
deleted file mode 100644
index 8d875f4..0000000
--- a/ui/ozone/platform/dri/dri_window_delegate_proxy.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/ozone/platform/dri/dri_window_delegate_proxy.h"
-
-#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
-#include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
-
-namespace ui {
-
-DriWindowDelegateProxy::DriWindowDelegateProxy(
- gfx::AcceleratedWidget widget,
- GpuPlatformSupportHostGbm* sender)
- : widget_(widget), sender_(sender) {
-}
-
-DriWindowDelegateProxy::~DriWindowDelegateProxy() {
-}
-
-void DriWindowDelegateProxy::Initialize() {
- TRACE_EVENT1("dri", "DriWindowDelegateProxy::Initialize", "widget", widget_);
- sender_->AddChannelObserver(this);
-}
-
-void DriWindowDelegateProxy::Shutdown() {
- TRACE_EVENT1("dri", "DriWindowDelegateProxy::Shutdown", "widget", widget_);
- sender_->RemoveChannelObserver(this);
- if (!sender_->IsConnected())
- return;
-
- bool status = sender_->Send(new OzoneGpuMsg_DestroyWindowDelegate(widget_));
- DCHECK(status);
-}
-
-gfx::AcceleratedWidget DriWindowDelegateProxy::GetAcceleratedWidget() {
- return widget_;
-}
-
-HardwareDisplayController* DriWindowDelegateProxy::GetController() {
- NOTREACHED();
- return NULL;
-}
-
-void DriWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) {
- TRACE_EVENT2("dri",
- "DriWindowDelegateProxy::OnBoundsChanged",
- "widget",
- widget_,
- "bounds",
- bounds.ToString());
- bounds_ = bounds;
- if (!sender_->IsConnected())
- return;
-
- bool status =
- sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds));
- DCHECK(status);
-}
-
-void DriWindowDelegateProxy::OnChannelEstablished() {
- TRACE_EVENT1(
- "dri", "DriWindowDelegateProxy::OnChannelEstablished", "widget", widget_);
- bool status = sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_));
- DCHECK(status);
- OnBoundsChanged(bounds_);
-}
-
-void DriWindowDelegateProxy::OnChannelDestroyed() {
- TRACE_EVENT1(
- "dri", "DriWindowDelegateProxy::OnChannelDestroyed", "widget", widget_);
-}
-
-} // namespace ui
diff --git a/ui/ozone/platform/dri/dri_window_delegate_proxy.h b/ui/ozone/platform/dri/dri_window_delegate_proxy.h
deleted file mode 100644
index ef95c4c..0000000
--- a/ui/ozone/platform/dri/dri_window_delegate_proxy.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
-#define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
-
-#include "ui/gfx/geometry/rect.h"
-#include "ui/ozone/platform/dri/channel_observer.h"
-#include "ui/ozone/platform/dri/dri_window_delegate.h"
-
-namespace ui {
-
-class GpuPlatformSupportHostGbm;
-
-// This is used when running with a GPU process (or with the in-process GPU) to
-// IPC the native window configuration from the browser to the GPU.
-class DriWindowDelegateProxy : public DriWindowDelegate,
- public ChannelObserver {
- public:
- DriWindowDelegateProxy(gfx::AcceleratedWidget widget,
- GpuPlatformSupportHostGbm* sender);
- virtual ~DriWindowDelegateProxy();
-
- // DriWindowDelegate:
- virtual void Initialize() OVERRIDE;
- virtual void Shutdown() OVERRIDE;
- virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
- virtual HardwareDisplayController* GetController() OVERRIDE;
- virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
-
- // ChannelObserver:
- virtual void OnChannelEstablished() OVERRIDE;
- virtual void OnChannelDestroyed() OVERRIDE;
-
- private:
- gfx::AcceleratedWidget widget_;
- GpuPlatformSupportHostGbm* sender_; // Not owned.
-
- // Cached state for the window. If the GPU process crashes, this state is used
- // to update the GPU side when it comes back.
- gfx::Rect bounds_;
-
- DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateProxy);
-};
-
-} // namespace ui
-
-#endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
diff --git a/ui/ozone/platform/dri/gbm.gypi b/ui/ozone/platform/dri/gbm.gypi
index b5af8bd..088ecce 100644
--- a/ui/ozone/platform/dri/gbm.gypi
+++ b/ui/ozone/platform/dri/gbm.gypi
@@ -30,9 +30,6 @@
'OZONE_IMPLEMENTATION',
],
'sources': [
- 'channel_observer.h',
- 'dri_window_delegate_proxy.cc',
- 'dri_window_delegate_proxy.h',
'gbm_buffer.cc',
'gbm_buffer.h',
'gbm_buffer_base.cc',
@@ -43,10 +40,6 @@
'gbm_surfaceless.h',
'gbm_surface_factory.cc',
'gbm_surface_factory.h',
- 'gpu_platform_support_gbm.cc',
- 'gpu_platform_support_gbm.h',
- 'gpu_platform_support_host_gbm.cc',
- 'gpu_platform_support_host_gbm.h',
'native_display_delegate_proxy.cc',
'native_display_delegate_proxy.h',
'ozone_platform_gbm.cc',
diff --git a/ui/ozone/platform/dri/hardware_cursor_delegate.h b/ui/ozone/platform/dri/hardware_cursor_delegate.h
index 17cea44..ed2a348 100644
--- a/ui/ozone/platform/dri/hardware_cursor_delegate.h
+++ b/ui/ozone/platform/dri/hardware_cursor_delegate.h
@@ -5,6 +5,8 @@
#ifndef UI_OZONE_PLATFORM_DRI_HARDWARE_CURSOR_DELEGATE_H_
#define UI_OZONE_PLATFORM_DRI_HARDWARE_CURSOR_DELEGATE_H_
+#include <vector>
+
#include "ui/gfx/native_widget_types.h"
class SkBitmap;
diff --git a/ui/ozone/platform/dri/hardware_display_controller.cc b/ui/ozone/platform/dri/hardware_display_controller.cc
index 7d41188..716ec38 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller.cc
@@ -12,11 +12,10 @@
#include "base/basictypes.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
-#include "base/time/time.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/size.h"
-#include "ui/ozone/platform/dri/crtc_state.h"
+#include "ui/ozone/platform/dri/crtc_controller.h"
#include "ui/ozone/platform/dri/dri_buffer.h"
#include "ui/ozone/platform/dri/dri_wrapper.h"
#include "ui/ozone/public/native_pixmap.h"
@@ -40,52 +39,16 @@
unsigned int seconds,
unsigned int useconds,
void* controller) {
- static_cast<HardwareDisplayController*>(controller)
+ static_cast<CrtcController*>(controller)
->OnPageFlipEvent(frame, seconds, useconds);
}
-const OverlayPlane& GetPrimaryPlane(const OverlayPlaneList& overlays) {
- for (size_t i = 0; i < overlays.size(); ++i) {
- if (overlays[i].z_order == 0)
- return overlays[i];
- }
-
- NOTREACHED();
- return overlays[0];
-}
-
} // namespace
-OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer)
- : buffer(buffer),
- z_order(0),
- display_bounds(gfx::Point(), buffer->GetSize()),
- crop_rect(0, 0, 1, 1),
- overlay_plane(0) {}
-
-OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer,
- int z_order,
- gfx::OverlayTransform plane_transform,
- const gfx::Rect& display_bounds,
- const gfx::RectF& crop_rect)
- : buffer(buffer),
- z_order(z_order),
- plane_transform(plane_transform),
- display_bounds(display_bounds),
- crop_rect(crop_rect),
- overlay_plane(0) {
-}
-
-OverlayPlane::~OverlayPlane() {}
-
HardwareDisplayController::HardwareDisplayController(
- DriWrapper* drm,
- scoped_ptr<CrtcState> state)
- : drm_(drm),
- is_disabled_(true),
- time_of_last_flip_(0),
- pending_page_flips_(0) {
- crtc_states_.push_back(state.release());
+ scoped_ptr<CrtcController> controller)
+ : is_disabled_(true) {
+ crtc_controllers_.push_back(controller.release());
}
HardwareDisplayController::~HardwareDisplayController() {
@@ -97,15 +60,10 @@
drmModeModeInfo mode) {
TRACE_EVENT0("dri", "HDC::Modeset");
DCHECK(primary.buffer.get());
- pending_page_flips_ = 0;
bool status = true;
- for (size_t i = 0; i < crtc_states_.size(); ++i) {
- status &= ModesetCrtc(primary.buffer, mode, crtc_states_[i]);
- crtc_states_[i]->set_is_disabled(false);
- }
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ status &= crtc_controllers_[i]->Modeset(primary, mode);
- // Since a subset of controllers may be actively using |primary|, just keep
- // track of it.
current_planes_ = std::vector<OverlayPlane>(1, primary);
pending_planes_.clear();
is_disabled_ = false;
@@ -116,23 +74,19 @@
bool HardwareDisplayController::Enable() {
TRACE_EVENT0("dri", "HDC::Enable");
DCHECK(!current_planes_.empty());
- OverlayPlane primary = GetPrimaryPlane(current_planes_);
+ OverlayPlane primary = OverlayPlane::GetPrimaryPlane(current_planes_);
DCHECK(primary.buffer.get());
- pending_page_flips_ = 0;
bool status = true;
- for (size_t i = 0; i < crtc_states_.size(); ++i)
- status &= ModesetCrtc(primary.buffer, mode_, crtc_states_[i]);
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ status &= crtc_controllers_[i]->Modeset(primary, mode_);
return status;
}
void HardwareDisplayController::Disable() {
TRACE_EVENT0("dri", "HDC::Disable");
- pending_page_flips_ = 0;
- for (size_t i = 0; i < crtc_states_.size(); ++i) {
- drm_->DisableCrtc(crtc_states_[i]->crtc());
- crtc_states_[i]->set_is_disabled(true);
- }
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ crtc_controllers_[i]->Disable();
is_disabled_ = true;
}
@@ -143,31 +97,33 @@
bool HardwareDisplayController::SchedulePageFlip() {
DCHECK(!pending_planes_.empty());
- DCHECK_EQ(0u, pending_page_flips_);
if (is_disabled_)
return true;
bool status = true;
- for (size_t i = 0; i < crtc_states_.size(); ++i)
- status &= SchedulePageFlipOnCrtc(pending_planes_, crtc_states_[i]);
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ status &= crtc_controllers_[i]->SchedulePageFlip(pending_planes_);
return status;
}
void HardwareDisplayController::WaitForPageFlipEvent() {
- TRACE_EVENT1("dri", "HDC::WaitForPageFlipEvent",
- "pending_pageflips", pending_page_flips_);
+ TRACE_EVENT0("dri", "HDC::WaitForPageFlipEvent");
- bool has_pending_page_flips = pending_page_flips_ != 0;
drmEventContext drm_event;
drm_event.version = DRM_EVENT_CONTEXT_VERSION;
drm_event.page_flip_handler = HandlePageFlipEvent;
drm_event.vblank_handler = NULL;
+ bool has_pending_page_flips = false;
// Wait for the page-flips to complete.
- while (pending_page_flips_ > 0)
- drm_->HandleEvent(drm_event);
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i) {
+ if (crtc_controllers_[i]->page_flip_pending()) {
+ has_pending_page_flips = true;
+ crtc_controllers_[i]->drm()->HandleEvent(drm_event);
+ }
+ }
// In case there are no pending pageflips do not replace the current planes
// since they are still being used.
@@ -177,37 +133,23 @@
pending_planes_.clear();
}
-void HardwareDisplayController::OnPageFlipEvent(unsigned int frame,
- unsigned int seconds,
- unsigned int useconds) {
- TRACE_EVENT0("dri", "HDC::OnPageFlipEvent");
-
- --pending_page_flips_;
- time_of_last_flip_ =
- static_cast<uint64_t>(seconds) * base::Time::kMicrosecondsPerSecond +
- useconds;
-}
-
-bool HardwareDisplayController::SetCursor(scoped_refptr<ScanoutBuffer> buffer) {
+bool HardwareDisplayController::SetCursor(
+ const scoped_refptr<ScanoutBuffer>& buffer) {
bool status = true;
- cursor_buffer_ = buffer;
if (is_disabled_)
return true;
- for (size_t i = 0; i < crtc_states_.size(); ++i) {
- status &= drm_->SetCursor(
- crtc_states_[i]->crtc(), buffer->GetHandle(), buffer->GetSize());
- }
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ status &= crtc_controllers_[i]->SetCursor(buffer);
return status;
}
bool HardwareDisplayController::UnsetCursor() {
bool status = true;
- cursor_buffer_ = NULL;
- for (size_t i = 0; i < crtc_states_.size(); ++i)
- status &= drm_->SetCursor(crtc_states_[i]->crtc(), 0, gfx::Size());
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ status &= crtc_controllers_[i]->UnsetCursor();
return status;
}
@@ -217,41 +159,41 @@
return true;
bool status = true;
- for (size_t i = 0; i < crtc_states_.size(); ++i)
- status &= drm_->MoveCursor(crtc_states_[i]->crtc(), location);
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ status &= crtc_controllers_[i]->MoveCursor(location);
return status;
}
-void HardwareDisplayController::AddCrtc(
- scoped_ptr<CrtcState> state) {
- crtc_states_.push_back(state.release());
+void HardwareDisplayController::AddCrtc(scoped_ptr<CrtcController> controller) {
+ crtc_controllers_.push_back(controller.release());
}
-scoped_ptr<CrtcState> HardwareDisplayController::RemoveCrtc(uint32_t crtc) {
- for (ScopedVector<CrtcState>::iterator it = crtc_states_.begin();
- it != crtc_states_.end();
+scoped_ptr<CrtcController> HardwareDisplayController::RemoveCrtc(
+ uint32_t crtc) {
+ for (ScopedVector<CrtcController>::iterator it = crtc_controllers_.begin();
+ it != crtc_controllers_.end();
++it) {
if ((*it)->crtc() == crtc) {
- scoped_ptr<CrtcState> controller(*it);
- crtc_states_.weak_erase(it);
+ scoped_ptr<CrtcController> controller(*it);
+ crtc_controllers_.weak_erase(it);
return controller.Pass();
}
}
- return scoped_ptr<CrtcState>();
+ return scoped_ptr<CrtcController>();
}
bool HardwareDisplayController::HasCrtc(uint32_t crtc) const {
- for (size_t i = 0; i < crtc_states_.size(); ++i)
- if (crtc_states_[i]->crtc() == crtc)
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ if (crtc_controllers_[i]->crtc() == crtc)
return true;
return false;
}
bool HardwareDisplayController::IsMirrored() const {
- return crtc_states_.size() > 1;
+ return crtc_controllers_.size() > 1;
}
bool HardwareDisplayController::IsDisabled() const {
@@ -262,72 +204,13 @@
return gfx::Size(mode_.hdisplay, mode_.vdisplay);
}
-bool HardwareDisplayController::ModesetCrtc(
- const scoped_refptr<ScanoutBuffer>& buffer,
- drmModeModeInfo mode,
- CrtcState* state) {
- if (!drm_->SetCrtc(state->crtc(),
- buffer->GetFramebufferId(),
- std::vector<uint32_t>(1, state->connector()),
- &mode)) {
- LOG(ERROR) << "Failed to modeset: error='" << strerror(errno)
- << "' crtc=" << state->crtc()
- << " connector=" << state->connector()
- << " framebuffer_id=" << buffer->GetFramebufferId()
- << " mode=" << mode.hdisplay << "x" << mode.vdisplay << "@"
- << mode.vrefresh;
- return false;
- }
+uint64_t HardwareDisplayController::GetTimeOfLastFlip() const {
+ uint64_t time = 0;
+ for (size_t i = 0; i < crtc_controllers_.size(); ++i)
+ if (time < crtc_controllers_[i]->time_of_last_flip())
+ time = crtc_controllers_[i]->time_of_last_flip();
- return true;
-}
-
-bool HardwareDisplayController::SchedulePageFlipOnCrtc(
- const OverlayPlaneList& overlays,
- CrtcState* state) {
- const OverlayPlane& primary = GetPrimaryPlane(overlays);
- DCHECK(primary.buffer.get());
-
- if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) {
- LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected "
- << mode_.hdisplay << "x" << mode_.vdisplay
- << " got " << primary.buffer->GetSize().ToString() << " for"
- << " crtc=" << state->crtc()
- << " connector=" << state->connector();
- return true;
- }
-
- if (!drm_->PageFlip(state->crtc(),
- primary.buffer->GetFramebufferId(),
- this)) {
- LOG(ERROR) << "Cannot page flip: error='" << strerror(errno) << "'"
- << " crtc=" << state->crtc()
- << " framebuffer=" << primary.buffer->GetFramebufferId()
- << " size=" << primary.buffer->GetSize().ToString();
- return false;
- }
-
- ++pending_page_flips_;
-
- for (size_t i = 0; i < overlays.size(); i++) {
- const OverlayPlane& plane = overlays[i];
- if (!plane.overlay_plane)
- continue;
-
- const gfx::Size& size = plane.buffer->GetSize();
- gfx::RectF crop_rect = plane.crop_rect;
- crop_rect.Scale(size.width(), size.height());
- if (!drm_->PageFlipOverlay(state->crtc(),
- plane.buffer->GetFramebufferId(),
- plane.display_bounds,
- crop_rect,
- plane.overlay_plane)) {
- LOG(ERROR) << "Cannot display on overlay: " << strerror(errno);
- return false;
- }
- }
-
- return true;
+ return time;
}
} // namespace ui
diff --git a/ui/ozone/platform/dri/hardware_display_controller.h b/ui/ozone/platform/dri/hardware_display_controller.h
index b26654d..3a948f6 100644
--- a/ui/ozone/platform/dri/hardware_display_controller.h
+++ b/ui/ozone/platform/dri/hardware_display_controller.h
@@ -14,7 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
-#include "ui/ozone/platform/dri/dri_wrapper.h"
+#include "ui/ozone/platform/dri/overlay_plane.h"
namespace gfx {
class Point;
@@ -22,31 +22,9 @@
namespace ui {
-class CrtcState;
+class CrtcController;
class ScanoutBuffer;
-struct OverlayPlane {
- // Simpler constructor for the primary plane.
- explicit OverlayPlane(scoped_refptr<ScanoutBuffer> buffer);
-
- OverlayPlane(scoped_refptr<ScanoutBuffer> buffer,
- int z_order,
- gfx::OverlayTransform plane_transform,
- const gfx::Rect& display_bounds,
- const gfx::RectF& crop_rect);
-
- ~OverlayPlane();
-
- scoped_refptr<ScanoutBuffer> buffer;
- int z_order;
- gfx::OverlayTransform plane_transform;
- gfx::Rect display_bounds;
- gfx::RectF crop_rect;
- int overlay_plane;
-};
-
-typedef std::vector<OverlayPlane> OverlayPlaneList;
-
// The HDCOz will handle modesettings and scannout operations for hardware
// devices.
//
@@ -104,9 +82,7 @@
class HardwareDisplayController
: public base::SupportsWeakPtr<HardwareDisplayController> {
public:
- HardwareDisplayController(DriWrapper* drm,
- scoped_ptr<CrtcState> state);
-
+ explicit HardwareDisplayController(scoped_ptr<CrtcController> controller);
~HardwareDisplayController();
// Performs the initial CRTC configuration. If successful, it will display the
@@ -144,26 +120,16 @@
// BeginFrame can be triggered explicitly by Ozone.
void WaitForPageFlipEvent();
- // Called when the page flip event occurred. The event is provided by the
- // kernel when a VBlank event finished. This allows the controller to
- // update internal state and propagate the update to the surface.
- // The tuple (seconds, useconds) represents the event timestamp. |seconds|
- // represents the number of seconds while |useconds| represents the
- // microseconds (< 1 second) in the timestamp.
- void OnPageFlipEvent(unsigned int frame,
- unsigned int seconds,
- unsigned int useconds);
-
// Set the hardware cursor to show the contents of |surface|.
- bool SetCursor(scoped_refptr<ScanoutBuffer> buffer);
+ bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer);
bool UnsetCursor();
// Moves the hardware cursor to |location|.
bool MoveCursor(const gfx::Point& location);
- void AddCrtc(scoped_ptr<CrtcState> state);
- scoped_ptr<CrtcState> RemoveCrtc(uint32_t crtc);
+ void AddCrtc(scoped_ptr<CrtcController> controller);
+ scoped_ptr<CrtcController> RemoveCrtc(uint32_t crtc);
bool HasCrtc(uint32_t crtc) const;
bool IsMirrored() const;
bool IsDisabled() const;
@@ -173,43 +139,27 @@
void set_origin(const gfx::Point& origin) { origin_ = origin; }
const drmModeModeInfo& get_mode() const { return mode_; };
- uint64_t get_time_of_last_flip() const {
- return time_of_last_flip_;
- };
+
+ uint64_t GetTimeOfLastFlip() const;
private:
- bool ModesetCrtc(const scoped_refptr<ScanoutBuffer>& buffer,
- drmModeModeInfo mode,
- CrtcState* state);
-
- bool SchedulePageFlipOnCrtc(const OverlayPlaneList& overlays,
- CrtcState* state);
-
// Buffers need to be declared first so that they are destroyed last. Needed
// since the controllers may reference the buffers.
OverlayPlaneList current_planes_;
OverlayPlaneList pending_planes_;
scoped_refptr<ScanoutBuffer> cursor_buffer_;
- // Object containing the connection to the graphics device and wraps the API
- // calls to control it.
- DriWrapper* drm_;
-
// Stores the CRTC configuration. This is used to identify monitors and
// configure them.
- ScopedVector<CrtcState> crtc_states_;
- gfx::Point origin_;
- drmModeModeInfo mode_;
- bool is_disabled_;
- uint64_t time_of_last_flip_;
+ ScopedVector<CrtcController> crtc_controllers_;
- // Keeps track of the number of page flips scheduled but not yet serviced (in
- // mirror mode each CRTC schedules its own page flip event). This value is
- // changed as follows:
- // 1) incremented when a successful SchedulePageFlipOnController() occurrs,
- // 2) decremented when the page flip callback is triggered,
- // 3) reset to 0 when a drmModeSetCrtc is called (via the DriWrapper).
- uint32_t pending_page_flips_;
+ // Location of the controller on the screen.
+ gfx::Point origin_;
+
+ // The mode used by the last modesetting operation.
+ drmModeModeInfo mode_;
+
+ bool is_disabled_;
DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController);
};
diff --git a/ui/ozone/platform/dri/hardware_display_controller_unittest.cc b/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
index 998ccca..bde4d5a 100644
--- a/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
+++ b/ui/ozone/platform/dri/hardware_display_controller_unittest.cc
@@ -4,7 +4,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
-#include "ui/ozone/platform/dri/crtc_state.h"
+#include "ui/ozone/platform/dri/crtc_controller.h"
#include "ui/ozone/platform/dri/dri_buffer.h"
#include "ui/ozone/platform/dri/dri_wrapper.h"
#include "ui/ozone/platform/dri/hardware_display_controller.h"
@@ -62,9 +62,8 @@
void HardwareDisplayControllerTest::SetUp() {
drm_.reset(new ui::MockDriWrapper(3));
controller_.reset(new ui::HardwareDisplayController(
- drm_.get(),
- scoped_ptr<ui::CrtcState>(
- new ui::CrtcState(drm_.get(), kPrimaryCrtc, kPrimaryConnector))));
+ scoped_ptr<ui::CrtcController>(new ui::CrtcController(
+ drm_.get(), kPrimaryCrtc, kPrimaryConnector))));
}
void HardwareDisplayControllerTest::TearDown() {
@@ -170,9 +169,8 @@
}
TEST_F(HardwareDisplayControllerTest, PageflipMirroredControllers) {
- controller_->AddCrtc(
- scoped_ptr<ui::CrtcState>(
- new ui::CrtcState(drm_.get(), kSecondaryCrtc, kSecondaryConnector)));
+ controller_->AddCrtc(scoped_ptr<ui::CrtcController>(
+ new ui::CrtcController(drm_.get(), kSecondaryCrtc, kSecondaryConnector)));
ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>(
new MockScanoutBuffer(kDefaultModeSize)));
diff --git a/ui/ozone/platform/dri/native_display_delegate_dri.cc b/ui/ozone/platform/dri/native_display_delegate_dri.cc
index 6e06d2b..6f679b6 100644
--- a/ui/ozone/platform/dri/native_display_delegate_dri.cc
+++ b/ui/ozone/platform/dri/native_display_delegate_dri.cc
@@ -328,8 +328,8 @@
DisplaySnapshotComparator(new_displays[i]));
if (it == old_displays.end())
- screen_manager_->AddDisplayController(new_displays[i]->crtc(),
- new_displays[i]->connector());
+ screen_manager_->AddDisplayController(
+ dri_, new_displays[i]->crtc(), new_displays[i]->connector());
}
}
diff --git a/ui/ozone/platform/dri/native_display_delegate_proxy.cc b/ui/ozone/platform/dri/native_display_delegate_proxy.cc
index f6cbba3..95600d2 100644
--- a/ui/ozone/platform/dri/native_display_delegate_proxy.cc
+++ b/ui/ozone/platform/dri/native_display_delegate_proxy.cc
@@ -12,12 +12,12 @@
#include "ui/ozone/common/display_snapshot_proxy.h"
#include "ui/ozone/common/display_util.h"
#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
-#include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
namespace ui {
NativeDisplayDelegateProxy::NativeDisplayDelegateProxy(
- GpuPlatformSupportHostGbm* proxy,
+ DriGpuPlatformSupportHost* proxy,
DeviceManager* device_manager)
: proxy_(proxy), device_manager_(device_manager) {
proxy_->RegisterHandler(this);
diff --git a/ui/ozone/platform/dri/native_display_delegate_proxy.h b/ui/ozone/platform/dri/native_display_delegate_proxy.h
index ae80f4e..098c514 100644
--- a/ui/ozone/platform/dri/native_display_delegate_proxy.h
+++ b/ui/ozone/platform/dri/native_display_delegate_proxy.h
@@ -15,7 +15,7 @@
namespace ui {
class DeviceManager;
-class GpuPlatformSupportHostGbm;
+class DriGpuPlatformSupportHost;
struct DisplaySnapshot_Params;
@@ -23,7 +23,7 @@
public DeviceEventObserver,
public GpuPlatformSupportHost {
public:
- NativeDisplayDelegateProxy(GpuPlatformSupportHostGbm* proxy,
+ NativeDisplayDelegateProxy(DriGpuPlatformSupportHost* proxy,
DeviceManager* device_manager);
virtual ~NativeDisplayDelegateProxy();
@@ -68,7 +68,7 @@
void OnUpdateNativeDisplays(
const std::vector<DisplaySnapshot_Params>& displays);
- GpuPlatformSupportHostGbm* proxy_; // Not owned.
+ DriGpuPlatformSupportHost* proxy_; // Not owned.
DeviceManager* device_manager_; // Not owned.
ScopedVector<DisplaySnapshot> displays_;
ObserverList<NativeDisplayObserver> observers_;
diff --git a/ui/ozone/platform/dri/overlay_plane.cc b/ui/ozone/platform/dri/overlay_plane.cc
new file mode 100644
index 0000000..5f48fdd
--- /dev/null
+++ b/ui/ozone/platform/dri/overlay_plane.cc
@@ -0,0 +1,48 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/dri/overlay_plane.h"
+
+#include "base/logging.h"
+#include "ui/ozone/platform/dri/scanout_buffer.h"
+
+namespace ui {
+
+OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer)
+ : buffer(buffer),
+ z_order(0),
+ display_bounds(gfx::Point(), buffer->GetSize()),
+ crop_rect(0, 0, 1, 1),
+ overlay_plane(0) {
+}
+
+OverlayPlane::OverlayPlane(scoped_refptr<ScanoutBuffer> buffer,
+ int z_order,
+ gfx::OverlayTransform plane_transform,
+ const gfx::Rect& display_bounds,
+ const gfx::RectF& crop_rect)
+ : buffer(buffer),
+ z_order(z_order),
+ plane_transform(plane_transform),
+ display_bounds(display_bounds),
+ crop_rect(crop_rect),
+ overlay_plane(0) {
+}
+
+OverlayPlane::~OverlayPlane() {
+}
+
+// static
+const OverlayPlane& OverlayPlane::GetPrimaryPlane(
+ const OverlayPlaneList& overlays) {
+ for (size_t i = 0; i < overlays.size(); ++i) {
+ if (overlays[i].z_order == 0)
+ return overlays[i];
+ }
+
+ NOTREACHED();
+ return overlays[0];
+}
+
+} // namespace ui
diff --git a/ui/ozone/platform/dri/overlay_plane.h b/ui/ozone/platform/dri/overlay_plane.h
new file mode 100644
index 0000000..e1aeee0
--- /dev/null
+++ b/ui/ozone/platform/dri/overlay_plane.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_DRI_OVERLAY_PLANE_H_
+#define UI_OZONE_PLATFORM_DRI_OVERLAY_PLANE_H_
+
+#include <vector>
+
+#include "base/memory/ref_counted.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/overlay_transform.h"
+
+namespace ui {
+
+class ScanoutBuffer;
+
+struct OverlayPlane;
+typedef std::vector<OverlayPlane> OverlayPlaneList;
+
+struct OverlayPlane {
+ // Simpler constructor for the primary plane.
+ explicit OverlayPlane(scoped_refptr<ScanoutBuffer> buffer);
+
+ OverlayPlane(scoped_refptr<ScanoutBuffer> buffer,
+ int z_order,
+ gfx::OverlayTransform plane_transform,
+ const gfx::Rect& display_bounds,
+ const gfx::RectF& crop_rect);
+
+ ~OverlayPlane();
+
+ // Returns the primary plane in |overlays|.
+ static const OverlayPlane& GetPrimaryPlane(const OverlayPlaneList& overlays);
+
+ scoped_refptr<ScanoutBuffer> buffer;
+ int z_order;
+ gfx::OverlayTransform plane_transform;
+ gfx::Rect display_bounds;
+ gfx::RectF crop_rect;
+ int overlay_plane;
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRI_OVERLAY_PLANE_H_
diff --git a/ui/ozone/platform/dri/ozone_platform_dri.cc b/ui/ozone/platform/dri/ozone_platform_dri.cc
index e4a1324..f4f0914 100644
--- a/ui/ozone/platform/dri/ozone_platform_dri.cc
+++ b/ui/ozone/platform/dri/ozone_platform_dri.cc
@@ -11,6 +11,8 @@
#include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/ozone/platform/dri/dri_buffer.h"
#include "ui/ozone/platform/dri/dri_cursor.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
#include "ui/ozone/platform/dri/dri_surface_factory.h"
#include "ui/ozone/platform/dri/dri_window.h"
#include "ui/ozone/platform/dri/dri_window_delegate_impl.h"
@@ -21,6 +23,7 @@
#include "ui/ozone/platform/dri/screen_manager.h"
#include "ui/ozone/platform/dri/virtual_terminal_manager.h"
#include "ui/ozone/public/ozone_platform.h"
+#include "ui/ozone/public/ui_thread_gpu.h"
namespace ui {
@@ -54,22 +57,20 @@
return cursor_factory_ozone_.get();
}
virtual GpuPlatformSupport* GetGpuPlatformSupport() OVERRIDE {
- return NULL; // no GPU support
+ return gpu_platform_support_.get();
}
virtual GpuPlatformSupportHost* GetGpuPlatformSupportHost() OVERRIDE {
- return NULL; // no GPU support
+ return gpu_platform_support_host_.get();
}
virtual scoped_ptr<PlatformWindow> CreatePlatformWindow(
PlatformWindowDelegate* delegate,
const gfx::Rect& bounds) OVERRIDE {
- scoped_ptr<DriWindow> platform_window(new DriWindow(
- delegate,
- bounds,
- scoped_ptr<DriWindowDelegate>(new DriWindowDelegateImpl(
- window_manager_->NextAcceleratedWidget(), screen_manager_.get())),
- event_factory_ozone_.get(),
- &window_delegate_manager_,
- window_manager_.get()));
+ scoped_ptr<DriWindow> platform_window(
+ new DriWindow(delegate,
+ bounds,
+ gpu_platform_support_host_.get(),
+ event_factory_ozone_.get(),
+ window_manager_.get()));
platform_window->Initialize();
return platform_window.PassAs<PlatformWindow>();
}
@@ -82,14 +83,22 @@
dri_->Initialize();
surface_factory_ozone_.reset(new DriSurfaceFactory(
dri_.get(), screen_manager_.get(), &window_delegate_manager_));
+ gpu_platform_support_.reset(
+ new DriGpuPlatformSupport(surface_factory_ozone_.get(),
+ &window_delegate_manager_,
+ screen_manager_.get(),
+ scoped_ptr<NativeDisplayDelegateDri>()));
+ gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost());
cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
window_manager_.reset(new DriWindowManager(surface_factory_ozone_.get()));
event_factory_ozone_.reset(new EventFactoryEvdev(window_manager_->cursor(),
device_manager_.get()));
if (surface_factory_ozone_->InitializeHardware() !=
DriSurfaceFactory::INITIALIZED)
- LOG(FATAL) << "failed to initialize display hardware";
+ LOG(FATAL) << "Failed to initialize display hardware.";
+ if (!ui_thread_gpu_.Initialize())
+ LOG(FATAL) << "Failed to initialize dummy channel.";
}
virtual void InitializeGPU() OVERRIDE {}
@@ -106,8 +115,14 @@
scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
scoped_ptr<DriWindowManager> window_manager_;
+
+ scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_;
+ scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_;
+
DriWindowDelegateManager window_delegate_manager_;
+ UiThreadGpu ui_thread_gpu_;
+
DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
};
diff --git a/ui/ozone/platform/dri/ozone_platform_gbm.cc b/ui/ozone/platform/dri/ozone_platform_gbm.cc
index 8c467a4..e8f0bef 100644
--- a/ui/ozone/platform/dri/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc
@@ -14,16 +14,15 @@
#include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/ozone/platform/dri/dri_cursor.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support.h"
+#include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
#include "ui/ozone/platform/dri/dri_window.h"
#include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
-#include "ui/ozone/platform/dri/dri_window_delegate_proxy.h"
#include "ui/ozone/platform/dri/dri_window_manager.h"
#include "ui/ozone/platform/dri/dri_wrapper.h"
#include "ui/ozone/platform/dri/gbm_buffer.h"
#include "ui/ozone/platform/dri/gbm_surface.h"
#include "ui/ozone/platform/dri/gbm_surface_factory.h"
-#include "ui/ozone/platform/dri/gpu_platform_support_gbm.h"
-#include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
#include "ui/ozone/platform/dri/native_display_delegate_dri.h"
#include "ui/ozone/platform/dri/native_display_delegate_proxy.h"
#include "ui/ozone/platform/dri/scanout_buffer.h"
@@ -101,11 +100,8 @@
scoped_ptr<DriWindow> platform_window(
new DriWindow(delegate,
bounds,
- scoped_ptr<DriWindowDelegate>(new DriWindowDelegateProxy(
- window_manager_->NextAcceleratedWidget(),
- gpu_platform_support_host_.get())),
+ gpu_platform_support_host_.get(),
event_factory_ozone_.get(),
- ui_window_delegate_manager_.get(),
window_manager_.get()));
platform_window->Initialize();
return platform_window.PassAs<PlatformWindow>();
@@ -117,12 +113,11 @@
}
virtual void InitializeUI() OVERRIDE {
vt_manager_.reset(new VirtualTerminalManager());
- ui_window_delegate_manager_.reset(new DriWindowDelegateManager());
// Needed since the browser process creates the accelerated widgets and that
// happens through SFO.
surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_));
device_manager_ = CreateDeviceManager();
- gpu_platform_support_host_.reset(new GpuPlatformSupportHostGbm());
+ gpu_platform_support_host_.reset(new DriGpuPlatformSupportHost());
cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
window_manager_.reset(
new DriWindowManager(gpu_platform_support_host_.get()));
@@ -136,17 +131,17 @@
buffer_generator_.reset(new GbmBufferGenerator(dri_.get()));
screen_manager_.reset(new ScreenManager(dri_.get(),
buffer_generator_.get()));
- gpu_window_delegate_manager_.reset(new DriWindowDelegateManager());
+ window_delegate_manager_.reset(new DriWindowDelegateManager());
if (!surface_factory_ozone_)
surface_factory_ozone_.reset(new GbmSurfaceFactory(use_surfaceless_));
surface_factory_ozone_->InitializeGpu(dri_.get(),
buffer_generator_->device(),
screen_manager_.get(),
- gpu_window_delegate_manager_.get());
- gpu_platform_support_.reset(new GpuPlatformSupportGbm(
+ window_delegate_manager_.get());
+ gpu_platform_support_.reset(new DriGpuPlatformSupport(
surface_factory_ozone_.get(),
- gpu_window_delegate_manager_.get(),
+ window_delegate_manager_.get(),
screen_manager_.get(),
scoped_ptr<NativeDisplayDelegateDri>(new NativeDisplayDelegateDri(
dri_.get(), screen_manager_.get(), NULL))));
@@ -167,14 +162,10 @@
scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_;
scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
- scoped_ptr<GpuPlatformSupportGbm> gpu_platform_support_;
- scoped_ptr<GpuPlatformSupportHostGbm> gpu_platform_support_host_;
+ scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_;
+ scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_;
- scoped_ptr<DriWindowDelegateManager> gpu_window_delegate_manager_;
- // TODO(dnicoara) Once we have a mock channel for the software path the window
- // can own the delegates on the browser side. Remove this then.
- scoped_ptr<DriWindowDelegateManager> ui_window_delegate_manager_;
-
+ scoped_ptr<DriWindowDelegateManager> window_delegate_manager_;
// Browser side object only.
scoped_ptr<DriWindowManager> window_manager_;
diff --git a/ui/ozone/platform/dri/screen_manager.cc b/ui/ozone/platform/dri/screen_manager.cc
index 6330387..10f38c3 100644
--- a/ui/ozone/platform/dri/screen_manager.cc
+++ b/ui/ozone/platform/dri/screen_manager.cc
@@ -9,8 +9,9 @@
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
-#include "ui/ozone/platform/dri/crtc_state.h"
+#include "ui/ozone/platform/dri/crtc_controller.h"
#include "ui/ozone/platform/dri/dri_util.h"
+#include "ui/ozone/platform/dri/dri_wrapper.h"
#include "ui/ozone/platform/dri/hardware_display_controller.h"
#include "ui/ozone/platform/dri/scanout_buffer.h"
@@ -24,7 +25,9 @@
ScreenManager::~ScreenManager() {
}
-void ScreenManager::AddDisplayController(uint32_t crtc, uint32_t connector) {
+void ScreenManager::AddDisplayController(DriWrapper* dri,
+ uint32_t crtc,
+ uint32_t connector) {
HardwareDisplayControllers::iterator it = FindDisplayController(crtc);
// TODO(dnicoara): Turn this into a DCHECK when async display configuration is
// properly supported. (When there can't be a race between forcing initial
@@ -36,7 +39,7 @@
}
controllers_.push_back(new HardwareDisplayController(
- dri_, scoped_ptr<CrtcState>(new CrtcState(dri_, crtc, connector))));
+ scoped_ptr<CrtcController>(new CrtcController(dri, crtc, connector))));
}
void ScreenManager::RemoveDisplayController(uint32_t crtc) {
@@ -72,8 +75,7 @@
// mirror mode, subsequent calls configuring the other controllers will
// restore mirror mode.
if (controller->IsMirrored()) {
- controller =
- new HardwareDisplayController(dri_, controller->RemoveCrtc(crtc));
+ controller = new HardwareDisplayController(controller->RemoveCrtc(crtc));
controllers_.push_back(controller);
it = controllers_.end() - 1;
}
@@ -92,7 +94,7 @@
if (it != controllers_.end()) {
if ((*it)->IsMirrored()) {
HardwareDisplayController* controller =
- new HardwareDisplayController(dri_, (*it)->RemoveCrtc(crtc));
+ new HardwareDisplayController((*it)->RemoveCrtc(crtc));
controllers_.push_back(controller);
}
@@ -161,7 +163,8 @@
dpms->prop_id,
DRM_MODE_DPMS_ON);
- AddDisplayController(displays[0]->crtc()->crtc_id,
+ AddDisplayController(dri_,
+ displays[0]->crtc()->crtc_id,
displays[0]->connector()->connector_id);
ConfigureDisplayController(displays[0]->crtc()->crtc_id,
displays[0]->connector()->connector_id,
diff --git a/ui/ozone/platform/dri/screen_manager.h b/ui/ozone/platform/dri/screen_manager.h
index 72278db..6b95516 100644
--- a/ui/ozone/platform/dri/screen_manager.h
+++ b/ui/ozone/platform/dri/screen_manager.h
@@ -31,7 +31,7 @@
// Register a display controller. This must be called before trying to
// configure it.
- void AddDisplayController(uint32_t crtc, uint32_t connector);
+ void AddDisplayController(DriWrapper* dri, uint32_t crtc, uint32_t connector);
// Remove a display controller from the list of active controllers. The
// controller is removed since it was disconnected.
diff --git a/ui/ozone/platform/dri/screen_manager_unittest.cc b/ui/ozone/platform/dri/screen_manager_unittest.cc
index 8eda243..843553f 100644
--- a/ui/ozone/platform/dri/screen_manager_unittest.cc
+++ b/ui/ozone/platform/dri/screen_manager_unittest.cc
@@ -75,7 +75,8 @@
}
TEST_F(ScreenManagerTest, CheckWithValidController) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
@@ -88,7 +89,8 @@
}
TEST_F(ScreenManagerTest, CheckWithInvalidBounds) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
@@ -99,12 +101,14 @@
}
TEST_F(ScreenManagerTest, CheckForSecondValidController) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
kDefaultMode);
- screen_manager_->AddDisplayController(kSecondaryCrtc, kSecondaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kSecondaryCrtc, kSecondaryConnector);
screen_manager_->ConfigureDisplayController(kSecondaryCrtc,
kSecondaryConnector,
GetSecondaryBounds().origin(),
@@ -115,7 +119,8 @@
}
TEST_F(ScreenManagerTest, CheckControllerAfterItIsRemoved) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
@@ -129,7 +134,8 @@
}
TEST_F(ScreenManagerTest, CheckDuplicateConfiguration) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
@@ -144,7 +150,8 @@
}
TEST_F(ScreenManagerTest, CheckChangingMode) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
@@ -164,12 +171,14 @@
}
TEST_F(ScreenManagerTest, CheckForControllersInMirroredMode) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
kDefaultMode);
- screen_manager_->AddDisplayController(kSecondaryCrtc, kSecondaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kSecondaryCrtc, kSecondaryConnector);
screen_manager_->ConfigureDisplayController(kSecondaryCrtc,
kSecondaryConnector,
GetPrimaryBounds().origin(),
@@ -180,12 +189,14 @@
}
TEST_F(ScreenManagerTest, CheckMirrorModeTransitions) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
kDefaultMode);
- screen_manager_->AddDisplayController(kSecondaryCrtc, kSecondaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kSecondaryCrtc, kSecondaryConnector);
screen_manager_->ConfigureDisplayController(kSecondaryCrtc,
kSecondaryConnector,
GetSecondaryBounds().origin(),
@@ -218,12 +229,14 @@
}
TEST_F(ScreenManagerTest, MonitorGoneInMirrorMode) {
- screen_manager_->AddDisplayController(kPrimaryCrtc, kPrimaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kPrimaryCrtc, kPrimaryConnector);
screen_manager_->ConfigureDisplayController(kPrimaryCrtc,
kPrimaryConnector,
GetPrimaryBounds().origin(),
kDefaultMode);
- screen_manager_->AddDisplayController(kSecondaryCrtc, kSecondaryConnector);
+ screen_manager_->AddDisplayController(
+ dri_.get(), kSecondaryCrtc, kSecondaryConnector);
screen_manager_->ConfigureDisplayController(kSecondaryCrtc,
kSecondaryConnector,
GetPrimaryBounds().origin(),
diff --git a/ui/ozone/platform/dri/test/mock_dri_wrapper.cc b/ui/ozone/platform/dri/test/mock_dri_wrapper.cc
index 1ac5215..b3f0100 100644
--- a/ui/ozone/platform/dri/test/mock_dri_wrapper.cc
+++ b/ui/ozone/platform/dri/test/mock_dri_wrapper.cc
@@ -7,8 +7,9 @@
#include <xf86drm.h>
#include <xf86drmMode.h>
+#include "base/logging.h"
#include "third_party/skia/include/core/SkCanvas.h"
-#include "ui/ozone/platform/dri/hardware_display_controller.h"
+#include "ui/ozone/platform/dri/crtc_controller.h"
namespace ui {
@@ -87,7 +88,7 @@
void* data) {
page_flip_call_count_++;
current_framebuffer_ = framebuffer;
- controllers_.push(static_cast<ui::HardwareDisplayController*>(data));
+ controllers_.push(static_cast<ui::CrtcController*>(data));
return page_flip_expectation_;
}
diff --git a/ui/ozone/platform/dri/test/mock_dri_wrapper.h b/ui/ozone/platform/dri/test/mock_dri_wrapper.h
index 9ffb868..3d4517b 100644
--- a/ui/ozone/platform/dri/test/mock_dri_wrapper.h
+++ b/ui/ozone/platform/dri/test/mock_dri_wrapper.h
@@ -14,7 +14,7 @@
namespace ui {
-class HardwareDisplayController;
+class CrtcController;
// The real DriWrapper makes actual DRM calls which we can't use in unit tests.
class MockDriWrapper : public ui::DriWrapper {
@@ -113,7 +113,7 @@
std::vector<skia::RefPtr<SkSurface> > buffers_;
- std::queue<HardwareDisplayController*> controllers_;
+ std::queue<CrtcController*> controllers_;
DISALLOW_COPY_AND_ASSIGN(MockDriWrapper);
};
diff --git a/ui/ozone/platform/egltest/eglplatform_shim_xeleven.cc b/ui/ozone/platform/egltest/eglplatform_shim_xeleven.cc
index af1228d..c7e0080 100644
--- a/ui/ozone/platform/egltest/eglplatform_shim_xeleven.cc
+++ b/ui/ozone/platform/egltest/eglplatform_shim_xeleven.cc
@@ -17,8 +17,8 @@
const int kDefaultX = 0;
const int kDefaultY = 0;
-const int kDefaultWidth = 800;
-const int kDefaultHeight = 600;
+const int kDefaultWidth = 1280;
+const int kDefaultHeight = 720;
const int kDefaultBorderWidth = 0;
const char* ShimQueryString(int name) {
diff --git a/ui/v2/OWNERS b/ui/v2/OWNERS
index f2f5774..9c070a5 100644
--- a/ui/v2/OWNERS
+++ b/ui/v2/OWNERS
@@ -1 +1 @@
-ben@chromium.org
+ben@chromium.org
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 93abc4d..1b1b6bf 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -104,8 +104,6 @@
}
}
-if (false) {
-
static_library("test_support") {
testonly = true
sources = gypi_values.views_test_support_sources
@@ -115,6 +113,7 @@
]
deps = [
"//base",
+ "//ipc:test_support",
"//skia",
"//testing/gtest",
"//ui/aura",
@@ -263,5 +262,3 @@
]
}
}
-
-} # if (false)
diff --git a/ui/views/OWNERS b/ui/views/OWNERS
index 8e95571..bcc5cf9 100644
--- a/ui/views/OWNERS
+++ b/ui/views/OWNERS
@@ -1,3 +1,3 @@
-ben@chromium.org
-sadrul@chromium.org
-sky@chromium.org
+ben@chromium.org
+sadrul@chromium.org
+sky@chromium.org
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index d89aef8..531da17 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -57,12 +57,6 @@
// static
const char BubbleFrameView::kViewClassName[] = "BubbleFrameView";
-// static
-gfx::Insets BubbleFrameView::GetTitleInsets() {
- return gfx::Insets(kTitleTopInset, kTitleLeftInset,
- kTitleBottomInset, kTitleRightInset);
-}
-
BubbleFrameView::BubbleFrameView(const gfx::Insets& content_margins)
: bubble_border_(NULL),
content_margins_(content_margins),
@@ -75,21 +69,34 @@
title_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(title_);
- close_ = new LabelButton(this, base::string16());
- close_->SetImage(CustomButton::STATE_NORMAL,
- *rb.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
- close_->SetImage(CustomButton::STATE_HOVERED,
- *rb.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
- close_->SetImage(CustomButton::STATE_PRESSED,
- *rb.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
- close_->SetBorder(scoped_ptr<Border>());
- close_->SetSize(close_->GetPreferredSize());
+ close_ = CreateCloseButton(this);
close_->SetVisible(false);
AddChildView(close_);
}
BubbleFrameView::~BubbleFrameView() {}
+// static
+gfx::Insets BubbleFrameView::GetTitleInsets() {
+ return gfx::Insets(
+ kTitleTopInset, kTitleLeftInset, kTitleBottomInset, kTitleRightInset);
+}
+
+// static
+LabelButton* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ LabelButton* close = new LabelButton(listener, base::string16());
+ close->SetImage(CustomButton::STATE_NORMAL,
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG).ToImageSkia());
+ close->SetImage(CustomButton::STATE_HOVERED,
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG_H).ToImageSkia());
+ close->SetImage(CustomButton::STATE_PRESSED,
+ *rb.GetImageNamed(IDR_CLOSE_DIALOG_P).ToImageSkia());
+ close->SetBorder(scoped_ptr<Border>());
+ close->SetSize(close->GetPreferredSize());
+ return close;
+}
+
gfx::Rect BubbleFrameView::GetBoundsForClientView() const {
gfx::Rect client_bounds = GetLocalBounds();
client_bounds.Inset(GetInsets());
@@ -288,6 +295,14 @@
rect.CenterPoint()).work_area();
}
+bool BubbleFrameView::IsCloseButtonVisible() const {
+ return close_->visible();
+}
+
+gfx::Rect BubbleFrameView::GetCloseButtonBounds() const {
+ return close_->bounds();
+}
+
void BubbleFrameView::MirrorArrowIfOffScreen(
bool vertical,
const gfx::Rect& anchor_rect,
diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h
index 1bf9f35..f14ca1e 100644
--- a/ui/views/bubble/bubble_frame_view.h
+++ b/ui/views/bubble/bubble_frame_view.h
@@ -29,12 +29,15 @@
// Internal class name.
static const char kViewClassName[];
+ explicit BubbleFrameView(const gfx::Insets& content_margins);
+ virtual ~BubbleFrameView();
+
// Insets to make bubble contents align horizontal with the bubble title.
// NOTE: this does not take into account whether a title actually exists.
static gfx::Insets GetTitleInsets();
- explicit BubbleFrameView(const gfx::Insets& content_margins);
- virtual ~BubbleFrameView();
+ // Creates a close button used in the corner of the dialog.
+ static LabelButton* CreateCloseButton(ButtonListener* listener);
// NonClientFrameView overrides:
virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
@@ -84,6 +87,9 @@
// Returns the available screen bounds if the frame were to show in |rect|.
virtual gfx::Rect GetAvailableScreenBounds(const gfx::Rect& rect);
+ bool IsCloseButtonVisible() const;
+ gfx::Rect GetCloseButtonBounds() const;
+
private:
FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewTest, GetBoundsForClientView);
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 4bf1016..1078d0b 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -182,9 +182,14 @@
}
void Label::SetTooltipText(const base::string16& tooltip_text) {
+ DCHECK(handles_tooltips_);
tooltip_text_ = tooltip_text;
}
+void Label::SetHandlesTooltips(bool enabled) {
+ handles_tooltips_ = enabled;
+}
+
void Label::SizeToFit(int max_width) {
DCHECK(multi_line_);
@@ -280,7 +285,8 @@
}
View* Label::GetTooltipHandlerForPoint(const gfx::Point& point) {
- if (tooltip_text_.empty() && !ShouldShowDefaultTooltip())
+ if (!handles_tooltips_ ||
+ (tooltip_text_.empty() && !ShouldShowDefaultTooltip()))
return NULL;
return HitTestPoint(point) ? this : NULL;
@@ -298,6 +304,9 @@
}
bool Label::GetTooltipText(const gfx::Point& p, base::string16* tooltip) const {
+ if (!handles_tooltips_)
+ return false;
+
if (!tooltip_text_.empty()) {
tooltip->assign(tooltip_text_);
return true;
@@ -389,6 +398,7 @@
obscured_ = false;
allow_character_break_ = false;
elide_behavior_ = gfx::ELIDE_TAIL;
+ handles_tooltips_ = true;
collapse_when_hidden_ = false;
cached_heights_.resize(kCachedSizeLimit);
ResetCachedSize();
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 8b2081e..755ca14 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -99,6 +99,12 @@
// default behavior, call this with an empty string.
void SetTooltipText(const base::string16& tooltip_text);
+ // Get or set whether this label can act as a tooltip handler; the default is
+ // true. Set to false whenever an ancestor view should handle tooltips
+ // instead.
+ bool handles_tooltips() const { return handles_tooltips_; }
+ void SetHandlesTooltips(bool enabled);
+
// Resizes the label so its width is set to the width of the longest line and
// its height deduced accordingly.
// This is only intended for multi-line labels and is useful when the label's
@@ -206,6 +212,7 @@
gfx::ElideBehavior elide_behavior_;
gfx::HorizontalAlignment horizontal_alignment_;
base::string16 tooltip_text_;
+ bool handles_tooltips_;
// Whether to collapse the label when it's not visible.
bool collapse_when_hidden_;
gfx::ShadowValues shadows_;
diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
index b60a7b9..076ec46 100644
--- a/ui/views/controls/label_unittest.cc
+++ b/ui/views/controls/label_unittest.cc
@@ -147,19 +147,40 @@
Label label;
label.SetText(ASCIIToUTF16("My cool string."));
+ // Initially, label has no bounds, its text does not fit, and therefore its
+ // text should be returned as the tooltip text.
base::string16 tooltip;
EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
EXPECT_EQ(label.text(), tooltip);
+ // While tooltip handling is disabled, GetTooltipText() should fail.
+ label.SetHandlesTooltips(false);
+ EXPECT_FALSE(label.GetTooltipText(gfx::Point(), &tooltip));
+ label.SetHandlesTooltips(true);
+
+ // When set, custom tooltip text should be returned instead of the label's
+ // text.
base::string16 tooltip_text(ASCIIToUTF16("The tooltip!"));
label.SetTooltipText(tooltip_text);
EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
EXPECT_EQ(tooltip_text, tooltip);
+ // While tooltip handling is disabled, GetTooltipText() should fail.
+ label.SetHandlesTooltips(false);
+ EXPECT_FALSE(label.GetTooltipText(gfx::Point(), &tooltip));
+ label.SetHandlesTooltips(true);
+
+ // When the tooltip text is set to an empty string, the original behavior is
+ // restored.
label.SetTooltipText(base::string16());
EXPECT_TRUE(label.GetTooltipText(gfx::Point(), &tooltip));
EXPECT_EQ(label.text(), tooltip);
+ // While tooltip handling is disabled, GetTooltipText() should fail.
+ label.SetHandlesTooltips(false);
+ EXPECT_FALSE(label.GetTooltipText(gfx::Point(), &tooltip));
+ label.SetHandlesTooltips(true);
+
// Make the label big enough to hold the text
// and expect there to be no tooltip.
label.SetBounds(0, 0, 1000, 40);
@@ -895,9 +916,18 @@
label.SetBounds(0, 0, 10, 10);
widget.SetContentsView(&label);
+ // By default, labels start out as tooltip handlers.
+ ASSERT_TRUE(label.handles_tooltips());
+
// There's a default tooltip if the text is too big to fit.
EXPECT_EQ(&label, label.GetTooltipHandlerForPoint(gfx::Point(2, 2)));
+ // If tooltip handling is disabled, the label should not provide a tooltip
+ // handler.
+ label.SetHandlesTooltips(false);
+ EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 2)));
+ label.SetHandlesTooltips(true);
+
// If there's no default tooltip, this should return NULL.
label.SetBounds(0, 0, 500, 50);
EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 2)));
@@ -912,6 +942,14 @@
EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 51)));
EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(-1, 20)));
+ // Again, if tooltip handling is disabled, the label should not provide a
+ // tooltip handler.
+ label.SetHandlesTooltips(false);
+ EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 2)));
+ EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(2, 51)));
+ EXPECT_FALSE(label.GetTooltipHandlerForPoint(gfx::Point(-1, 20)));
+ label.SetHandlesTooltips(true);
+
// GetTooltipHandlerForPoint works should work in child bounds.
label.SetBounds(2, 2, 10, 10);
EXPECT_EQ(&label, label.GetTooltipHandlerForPoint(gfx::Point(1, 5)));
diff --git a/ui/views/corewm/README.chromium b/ui/views/corewm/README.chromium
index a5513c4..cfb2b6a 100644
--- a/ui/views/corewm/README.chromium
+++ b/ui/views/corewm/README.chromium
@@ -1,2 +1,2 @@
-This directory contains window-manager code that is shared by Ash and the
-Desktop Aura implementation.
+This directory contains window-manager code that is shared by Ash and the
+Desktop Aura implementation.
diff --git a/ui/views/widget/desktop_aura/README.chromium b/ui/views/widget/desktop_aura/README.chromium
index 5e0ff71..a81055f 100644
--- a/ui/views/widget/desktop_aura/README.chromium
+++ b/ui/views/widget/desktop_aura/README.chromium
@@ -1,2 +1,2 @@
-This directory contains the views::NativeWidget implementation used for the
-Desktop Aura port, and required supporting infrastructure.
+This directory contains the views::NativeWidget implementation used for the
+Desktop Aura port, and required supporting infrastructure.
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.cc b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
index 695e418..ee90cbc 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -138,13 +138,11 @@
void X11DesktopHandler::ProcessXEvent(XEvent* event) {
switch (event->type) {
case FocusIn:
- if (!wm_supports_active_window_ &&
- current_window_ != event->xfocus.window)
+ if (current_window_ != event->xfocus.window)
OnActiveWindowChanged(event->xfocus.window, ACTIVE);
break;
case FocusOut:
- if (!wm_supports_active_window_ &&
- current_window_ == event->xfocus.window)
+ if (current_window_ == event->xfocus.window)
OnActiveWindowChanged(None, NOT_ACTIVE);
break;
default:
diff --git a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
index afef9ab..e0840cc 100644
--- a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
+++ b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
@@ -4,6 +4,7 @@
#include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h"
+#include <X11/keysym.h>
#include <X11/Xlib.h>
#include "base/bind.h"
@@ -23,6 +24,18 @@
namespace views {
+// XGrabKey requires the modifier mask to explicitly be specified.
+const unsigned int kModifiersMasks[] = {
+ 0, // No additional modifier.
+ Mod2Mask, // Num lock
+ LockMask, // Caps lock
+ Mod5Mask, // Scroll lock
+ Mod2Mask | LockMask,
+ Mod2Mask | Mod5Mask,
+ LockMask | Mod5Mask,
+ Mod2Mask | LockMask | Mod5Mask
+};
+
X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate)
: delegate_(delegate),
in_move_loop_(false),
@@ -160,10 +173,7 @@
}
}
- if (!GrabKeyboard()) {
- XDestroyWindow(gfx::GetXDisplay(), grab_input_window_);
- return false;
- }
+ GrabEscKey();
scoped_ptr<ui::ScopedEventDispatcher> old_dispatcher =
nested_dispatcher_.Pass();
@@ -227,7 +237,10 @@
else
UpdateCursor(initial_cursor_);
- XUngrabKeyboard(display, CurrentTime);
+ unsigned int esc_keycode = XKeysymToKeycode(display, XK_Escape);
+ for (size_t i = 0; i < arraysize(kModifiersMasks); ++i) {
+ XUngrabKey(display, esc_keycode, kModifiersMasks[i], grab_input_window_);
+ }
// Restore the previous dispatcher.
nested_dispatcher_.reset();
@@ -264,20 +277,13 @@
return ret == GrabSuccess;
}
-bool X11WholeScreenMoveLoop::GrabKeyboard() {
+void X11WholeScreenMoveLoop::GrabEscKey() {
XDisplay* display = gfx::GetXDisplay();
- int ret = XGrabKeyboard(display,
- grab_input_window_,
- False,
- GrabModeAsync,
- GrabModeAsync,
- CurrentTime);
- if (ret != GrabSuccess) {
- DLOG(ERROR) << "Grabbing keyboard for dragging failed: "
- << ui::GetX11ErrorString(display, ret);
- return false;
+ unsigned int esc_keycode = XKeysymToKeycode(display, XK_Escape);
+ for (size_t i = 0; i < arraysize(kModifiersMasks); ++i) {
+ XGrabKey(display, esc_keycode, kModifiersMasks[i], grab_input_window_,
+ False, GrabModeAsync, GrabModeAsync);
}
- return true;
}
Window X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) {
diff --git a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h
index dd8276d..08cb71a 100644
--- a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h
+++ b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h
@@ -53,8 +53,7 @@
// successful.
bool GrabPointer(gfx::NativeCursor cursor);
- // Grabs the keyboard. Returns true if successful.
- bool GrabKeyboard();
+ void GrabEscKey();
// Creates an input-only window to be used during the drag.
Window CreateDragInputWindow(XDisplay* display);
diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc
index ab14337..b8f1ce0 100644
--- a/ui/views/window/non_client_view.cc
+++ b/ui/views/window/non_client_view.cc
@@ -309,9 +309,6 @@
return can_resize ? component : HTBORDER;
}
-////////////////////////////////////////////////////////////////////////////////
-// NonClientFrameView, protected:
-
void NonClientFrameView::GetAccessibleState(ui::AXViewState* state) {
state->role = ui::AX_ROLE_CLIENT;
}
@@ -320,10 +317,8 @@
return kViewClassName;
}
-void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
- // Overridden to do nothing. The NonClientView manually calls Layout on the
- // FrameView when it is itself laid out, see comment in NonClientView::Layout.
-}
+////////////////////////////////////////////////////////////////////////////////
+// NonClientFrameView, protected:
NonClientFrameView::NonClientFrameView() : inactive_rendering_disabled_(false) {
SetEventTargeter(
@@ -340,4 +335,9 @@
return !GetWidget()->client_view()->bounds().Intersects(rect);
}
+void NonClientFrameView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
+ // Overridden to do nothing. The NonClientView manually calls Layout on the
+ // FrameView when it is itself laid out, see comment in NonClientView::Layout.
+}
+
} // namespace views
diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h
index 0ddc5f6..434b782 100644
--- a/ui/views/window/non_client_view.h
+++ b/ui/views/window/non_client_view.h
@@ -86,15 +86,16 @@
virtual const char* GetClassName() const OVERRIDE;
protected:
- virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
-
NonClientFrameView();
- private:
// ViewTargeterDelegate:
virtual bool DoesIntersectRect(const View* target,
const gfx::Rect& rect) const OVERRIDE;
+ // View:
+ virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+
+ private:
// Prevents the non-client frame view from being rendered as inactive when
// true.
bool inactive_rendering_disabled_;
diff --git a/ui/wm/BUILD.gn b/ui/wm/BUILD.gn
index e01ee94..67248f4 100644
--- a/ui/wm/BUILD.gn
+++ b/ui/wm/BUILD.gn
@@ -88,8 +88,6 @@
]
}
-if (false) {
-
static_library("test_support") {
testonly = true
sources = [
@@ -142,5 +140,3 @@
"//ui/gl",
]
}
-
-} # if (false)
diff --git a/ui/wm/core/transient_window_manager.cc b/ui/wm/core/transient_window_manager.cc
index 120af84..9a2ba38 100644
--- a/ui/wm/core/transient_window_manager.cc
+++ b/ui/wm/core/transient_window_manager.cc
@@ -18,9 +18,12 @@
using aura::Window;
namespace wm {
+namespace {
DEFINE_OWNED_WINDOW_PROPERTY_KEY(TransientWindowManager, kPropertyKey, NULL);
+} // namespace
+
TransientWindowManager::~TransientWindowManager() {
}
@@ -97,7 +100,10 @@
TransientWindowManager::TransientWindowManager(Window* window)
: window_(window),
transient_parent_(NULL),
- stacking_target_(NULL) {
+ stacking_target_(NULL),
+ parent_controls_visibility_(false),
+ show_on_parent_visible_(false),
+ ignore_visibility_changed_event_(false) {
window_->AddObserver(this);
}
@@ -134,18 +140,44 @@
}
}
+void TransientWindowManager::UpdateTransientChildVisibility(
+ bool parent_visible) {
+ base::AutoReset<bool> reset(&ignore_visibility_changed_event_, true);
+ if (!parent_visible) {
+ show_on_parent_visible_ = window_->TargetVisibility();
+ window_->Hide();
+ } else {
+ if (show_on_parent_visible_ && parent_controls_visibility_)
+ window_->Show();
+ show_on_parent_visible_ = false;
+ }
+}
+
void TransientWindowManager::OnWindowVisibilityChanging(Window* window,
bool visible) {
- // TODO(sky): move handling of becoming visible here.
- if (!visible) {
- std::for_each(transient_children_.begin(), transient_children_.end(),
- std::mem_fun(&Window::Hide));
+ DCHECK_EQ(window_, window);
+
+ for (auto* child : transient_children_)
+ Get(child)->UpdateTransientChildVisibility(visible);
+}
+
+void TransientWindowManager::OnWindowVisibilityChanged(Window* window,
+ bool visible) {
+ if (window_ != window || ignore_visibility_changed_event_ ||
+ !transient_parent_ || !parent_controls_visibility_) {
+ return;
+ }
+ if (!transient_parent_->TargetVisibility() && visible) {
+ base::AutoReset<bool> reset(&ignore_visibility_changed_event_, true);
+ show_on_parent_visible_ = true;
+ window_->Hide();
+ } else if (!visible) {
+ DCHECK(!show_on_parent_visible_);
}
}
void TransientWindowManager::OnWindowStackingChanged(Window* window) {
DCHECK_EQ(window_, window);
-
// Do nothing if we initiated the stacking change.
const TransientWindowManager* transient_manager =
Get(static_cast<const Window*>(window));
diff --git a/ui/wm/core/transient_window_manager.h b/ui/wm/core/transient_window_manager.h
index 7d37679..7a7ee46 100644
--- a/ui/wm/core/transient_window_manager.h
+++ b/ui/wm/core/transient_window_manager.h
@@ -23,6 +23,8 @@
// or transient parent is destroyed.
// . If a transient child and its transient parent share the same parent, then
// transient children are always ordered above the transient parent.
+// . If a transient parent is hidden, it hides all transient children.
+// For show operation, please refer to |set_parent_controls_visibility(bool)|.
// Transient windows are typically used for popups and menus.
// TODO(sky): when we nuke TransientWindowClient rename this to
// TransientWindowController.
@@ -46,6 +48,14 @@
void AddTransientChild(aura::Window* child);
void RemoveTransientChild(aura::Window* child);
+ // Setting true lets the transient parent show this transient
+ // child when the parent is shown. If this was shown when the
+ // transient parent is hidden, it remains hidden and gets shown
+ // when the transient parent is shown. This is false by default.
+ void set_parent_controls_visibility(bool parent_controls_visibility) {
+ parent_controls_visibility_ = parent_controls_visibility;
+ }
+
const Windows& transient_children() const { return transient_children_; }
aura::Window* transient_parent() { return transient_parent_; }
@@ -65,11 +75,17 @@
// above it.
void RestackTransientDescendants();
+ // Update the window's visibility following the transient parent's
+ // visibility. See |set_parent_controls_visibility(bool)| for more details.
+ void UpdateTransientChildVisibility(bool visible);
+
// WindowObserver:
virtual void OnWindowParentChanged(aura::Window* window,
aura::Window* parent) OVERRIDE;
virtual void OnWindowVisibilityChanging(aura::Window* window,
bool visible) OVERRIDE;
+ virtual void OnWindowVisibilityChanged(aura::Window* window,
+ bool visible) OVERRIDE;
virtual void OnWindowStackingChanged(aura::Window* window) OVERRIDE;
virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
@@ -81,6 +97,10 @@
// transient ancestor changing.
aura::Window* stacking_target_;
+ bool parent_controls_visibility_;
+ bool show_on_parent_visible_;
+ bool ignore_visibility_changed_event_;
+
ObserverList<TransientWindowObserver> observers_;
DISALLOW_COPY_AND_ASSIGN(TransientWindowManager);
diff --git a/ui/wm/core/transient_window_manager_unittest.cc b/ui/wm/core/transient_window_manager_unittest.cc
index 05b8e88..eaac027 100644
--- a/ui/wm/core/transient_window_manager_unittest.cc
+++ b/ui/wm/core/transient_window_manager_unittest.cc
@@ -116,6 +116,47 @@
EXPECT_TRUE(w2->IsVisible());
w1->Hide();
EXPECT_FALSE(w2->IsVisible());
+
+ // And they should stay hidden even after the parent became visible.
+ w1->Show();
+ EXPECT_FALSE(w2->IsVisible());
+
+ // Hidden transient child should stay hidden regardless of
+ // parent's visibility.
+ w2->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Show();
+ EXPECT_FALSE(w2->IsVisible());
+
+ // Transient child can be shown even if the transient parent is hidden.
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w2->Show();
+ EXPECT_TRUE(w2->IsVisible());
+ w1->Show();
+ EXPECT_TRUE(w2->IsVisible());
+
+ // When the parent_controls_visibility is true, TransientWindowManager
+ // controls the children's visibility. It stays invisible even if
+ // Window::Show() is called, and gets shown when the parent becomes visible.
+ wm::TransientWindowManager::Get(w2)->set_parent_controls_visibility(true);
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w2->Show();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Show();
+ EXPECT_TRUE(w2->IsVisible());
+
+ // Hiding a transient child that is hidden by the transient parent
+ // is not currently handled and will be shown anyway.
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w2->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Show();
+ EXPECT_TRUE(w2->IsVisible());
}
// Tests that transient children are stacked as a unit when using stack above.
diff --git a/url/url_canon_icu.h b/url/url_canon_icu.h
index c963289..18b1f09 100644
--- a/url/url_canon_icu.h
+++ b/url/url_canon_icu.h
@@ -28,7 +28,7 @@
virtual void ConvertFromUTF16(const base::char16* input,
int input_len,
- CanonOutput* output) OVERRIDE;
+ CanonOutput* output) override;
private:
// The ICU converter, not owned by this class.
diff --git a/url/url_canon_stdstring.h b/url/url_canon_stdstring.h
index e859fe2..62622b4 100644
--- a/url/url_canon_stdstring.h
+++ b/url/url_canon_stdstring.h
@@ -41,7 +41,7 @@
// Must be called after writing has completed but before the string is used.
void Complete();
- virtual void Resize(int sz) OVERRIDE;
+ virtual void Resize(int sz) override;
protected:
std::string* str_;