diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/crash/CrashReceiverServiceTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/crash/CrashReceiverServiceTest.java new file mode 100644 index 0000000..c6a9c465 --- /dev/null +++ b/android_webview/javatests/src/org/chromium/android_webview/test/crash/CrashReceiverServiceTest.java
@@ -0,0 +1,56 @@ +// Copyright 2017 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. + +package org.chromium.android_webview.test.crash; + +import android.os.ParcelFileDescriptor; +import android.support.test.filters.MediumTest; +import android.test.InstrumentationTestCase; + +import org.chromium.android_webview.crash.CrashReceiverService; +import org.chromium.base.ContextUtils; + +import java.io.File; +import java.io.IOException; + +/** + * Instrumentation tests for CrashReceiverService. + */ +public class CrashReceiverServiceTest extends InstrumentationTestCase { + protected void setUp() throws Exception { + ContextUtils.initApplicationContextForTests( + getInstrumentation().getTargetContext().getApplicationContext()); + } + + /** + * Ensure that the minidump copying doesn't trigger when we pass it invalid file descriptors. + */ + @MediumTest + public void testCopyingAbortsForInvalidFds() throws IOException { + assertFalse(CrashReceiverService.copyMinidumps(0 /* uid */, null)); + assertFalse(CrashReceiverService.copyMinidumps( + 0 /* uid */, new ParcelFileDescriptor[] {null, null})); + assertFalse(CrashReceiverService.copyMinidumps(0 /* uid */, new ParcelFileDescriptor[0])); + } + + /** + * Ensure deleting temporary files used when copying minidumps works correctly. + */ + @MediumTest + public void testDeleteFilesInDir() throws IOException { + File webviewTmpDir = CrashReceiverService.getWebViewTmpCrashDir(); + if (!webviewTmpDir.isDirectory()) { + assertTrue(webviewTmpDir.mkdir()); + } + File testFile1 = new File(webviewTmpDir, "testFile1"); + File testFile2 = new File(webviewTmpDir, "testFile2"); + assertTrue(testFile1.createNewFile()); + assertTrue(testFile2.createNewFile()); + assertTrue(testFile1.exists()); + assertTrue(testFile2.exists()); + CrashReceiverService.deleteFilesInWebViewTmpDirIfExists(); + assertFalse(testFile1.exists()); + assertFalse(testFile2.exists()); + } +}
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/crash/MinidumpUploaderTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/crash/MinidumpUploaderTest.java index 20d4d70..0cbf835 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/crash/MinidumpUploaderTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/crash/MinidumpUploaderTest.java
@@ -524,37 +524,6 @@ } /** - * Ensure that the minidump copying doesn't trigger when we pass it invalid file descriptors. - */ - @MediumTest - public void testCopyingAbortsForInvalidFds() throws IOException { - assertFalse(CrashReceiverService.copyMinidumps(0 /* uid */, null)); - assertFalse(CrashReceiverService.copyMinidumps( - 0 /* uid */, new ParcelFileDescriptor[] {null, null})); - assertFalse(CrashReceiverService.copyMinidumps(0 /* uid */, new ParcelFileDescriptor[0])); - } - - /** - * Ensure deleting temporary files used when copying minidumps works correctly. - */ - @MediumTest - public void testDeleteFilesInDir() throws IOException { - File webviewTmpDir = CrashReceiverService.getWebViewTmpCrashDir(); - if (!webviewTmpDir.isDirectory()) { - assertTrue(webviewTmpDir.mkdir()); - } - File testFile1 = new File(webviewTmpDir, "testFile1"); - File testFile2 = new File(webviewTmpDir, "testFile2"); - assertTrue(testFile1.createNewFile()); - assertTrue(testFile2.createNewFile()); - assertTrue(testFile1.exists()); - assertTrue(testFile2.exists()); - CrashReceiverService.deleteFilesInWebViewTmpDirIfExists(); - assertFalse(testFile1.exists()); - assertFalse(testFile2.exists()); - } - - /** * Ensure we can copy and upload several batches of files (i.e. emulate several copying-calls in * a row without the copying-service being destroyed in between). */
diff --git a/android_webview/test/BUILD.gn b/android_webview/test/BUILD.gn index 40c94260..6a38130 100644 --- a/android_webview/test/BUILD.gn +++ b/android_webview/test/BUILD.gn
@@ -202,6 +202,7 @@ "../javatests/src/org/chromium/android_webview/test/WebViewAsynchronousFindApisTest.java", "../javatests/src/org/chromium/android_webview/test/WebViewFindApisTestBase.java", "../javatests/src/org/chromium/android_webview/test/WebViewModalDialogOverrideTest.java", + "../javatests/src/org/chromium/android_webview/test/crash/CrashReceiverServiceTest.java", "../javatests/src/org/chromium/android_webview/test/crash/MinidumpUploaderTest.java", "../javatests/src/org/chromium/android_webview/test/crash/VisualStateCallbackTest.java", "../javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java",
diff --git a/ash/mus/app_launch_unittest.cc b/ash/mus/app_launch_unittest.cc index e9a3e60..157e492d 100644 --- a/ash/mus/app_launch_unittest.cc +++ b/ash/mus/app_launch_unittest.cc
@@ -10,6 +10,7 @@ #include "services/service_manager/public/cpp/service_test.h" #include "services/ui/public/interfaces/constants.mojom.h" #include "services/ui/public/interfaces/window_server_test.mojom.h" +#include "ui/views/layout/layout_provider.h" namespace ash { namespace mus { @@ -30,6 +31,8 @@ ServiceTest::SetUp(); } + views::LayoutProvider layout_provider_; + DISALLOW_COPY_AND_ASSIGN(AppLaunchTest); };
diff --git a/ash/mus/non_client_frame_controller_unittest.cc b/ash/mus/non_client_frame_controller_unittest.cc index 938f234..8357e3f 100644 --- a/ash/mus/non_client_frame_controller_unittest.cc +++ b/ash/mus/non_client_frame_controller_unittest.cc
@@ -120,7 +120,7 @@ // Without the window visible, there should be a tile for the wallpaper at // (tile_x, tile_y) of size |tile_size|. compositor->ScheduleDraw(); - ui::DrawWaiterForTest::WaitForCompositingStarted(compositor); + ui::DrawWaiterForTest::WaitForCompositingEnded(compositor); { const cc::CompositorFrame& frame = GetLastCompositorFrame(); ASSERT_EQ(1u, frame.render_pass_list.size()); @@ -133,7 +133,7 @@ widget->SetBounds(widget_bound); widget->Show(); compositor->ScheduleDraw(); - ui::DrawWaiterForTest::WaitForCompositingStarted(compositor); + ui::DrawWaiterForTest::WaitForCompositingEnded(compositor); { // This time, that tile for the wallpaper will not be drawn. const cc::CompositorFrame& frame = GetLastCompositorFrame();
diff --git a/ash/system/ime/tray_ime_chromeos.cc b/ash/system/ime/tray_ime_chromeos.cc index 3ecbe7f..ee3524b2 100644 --- a/ash/system/ime/tray_ime_chromeos.cc +++ b/ash/system/ime/tray_ime_chromeos.cc
@@ -103,9 +103,10 @@ void HandleButtonPressed(views::Button* sender, const ui::Event& event) override { - ImeListView::HandleButtonPressed(sender, event); if (sender == settings_button_) ShowSettings(); + else + ImeListView::HandleButtonPressed(sender, event); } void CreateExtraTitleRowButtons() override {
diff --git a/ash/system/ime_menu/ime_list_view.cc b/ash/system/ime_menu/ime_list_view.cc index 2fa68ac..9833811 100644 --- a/ash/system/ime_menu/ime_list_view.cc +++ b/ash/system/ime_menu/ime_list_view.cc
@@ -309,11 +309,11 @@ void ImeListView::HandleButtonPressed(views::Button* sender, const ui::Event& event) { - if (keyboard_status_row_ && sender == keyboard_status_row_->toggle()) { - ShellPort::Get()->ToggleIgnoreExternalKeyboard(); - last_selected_item_id_.clear(); - last_item_selected_with_keyboard_ = false; - } + DCHECK_EQ(sender, keyboard_status_row_->toggle()); + + ShellPort::Get()->ToggleIgnoreExternalKeyboard(); + last_selected_item_id_.clear(); + last_item_selected_with_keyboard_ = false; } void ImeListView::VisibilityChanged(View* starting_from, bool is_visible) {
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/tablet_power_button_controller.cc index 0347bbd..a2b2528 100644 --- a/ash/system/power/tablet_power_button_controller.cc +++ b/ash/system/power/tablet_power_button_controller.cc
@@ -162,6 +162,12 @@ last_resume_time_ = tick_clock_->NowTicks(); } +void TabletPowerButtonController::LidEventReceived( + chromeos::PowerManagerClient::LidState state, + const base::TimeTicks& timestamp) { + SetDisplayForcedOff(false); +} + void TabletPowerButtonController::OnMaximizeModeStarted() { shutdown_timer_.Stop(); if (controller_->CanCancelShutdownAnimation())
diff --git a/ash/system/power/tablet_power_button_controller.h b/ash/system/power/tablet_power_button_controller.h index e3d74745..ef07c397 100644 --- a/ash/system/power/tablet_power_button_controller.h +++ b/ash/system/power/tablet_power_button_controller.h
@@ -62,6 +62,8 @@ void PowerManagerRestarted() override; void BrightnessChanged(int level, bool user_initiated) override; void SuspendDone(const base::TimeDelta& sleep_duration) override; + void LidEventReceived(chromeos::PowerManagerClient::LidState state, + const base::TimeTicks& timestamp) override; // Overridden from ShellObserver: void OnMaximizeModeStarted() override;
diff --git a/ash/system/power/tablet_power_button_controller_unittest.cc b/ash/system/power/tablet_power_button_controller_unittest.cc index 2805f9ff..ea5cb6b1 100644 --- a/ash/system/power/tablet_power_button_controller_unittest.cc +++ b/ash/system/power/tablet_power_button_controller_unittest.cc
@@ -484,5 +484,30 @@ EXPECT_TRUE(GetBacklightsForcedOff()); } +// Tests that lid closed/open events stop forcing off backlights. +TEST_F(TabletPowerButtonControllerTest, LidEventsStopForcingOff) { + // Pressing/releasing power button to set backlights forced off. + PressPowerButton(); + ReleasePowerButton(); + ASSERT_TRUE(GetBacklightsForcedOff()); + + // A lid closed event is received, we should stop forcing off backlights. + power_manager_client_->SetLidState( + chromeos::PowerManagerClient::LidState::CLOSED, tick_clock_->NowTicks()); + EXPECT_FALSE(GetBacklightsForcedOff()); + + // Pressing/releasing power button again to set backlights forced off. This is + // for testing purpose. In real life, powerd would not repond to this event + // with lid closed state. + PressPowerButton(); + ReleasePowerButton(); + ASSERT_TRUE(GetBacklightsForcedOff()); + + // A lid open event is received, we should stop forcing off backlights. + power_manager_client_->SetLidState( + chromeos::PowerManagerClient::LidState::OPEN, tick_clock_->NowTicks()); + EXPECT_FALSE(GetBacklightsForcedOff()); +} + } // namespace test } // namespace ash
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 54a50bf..ac80264 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc
@@ -88,7 +88,7 @@ // WindowManager creates WMState for mash. if (config_ == Config::CLASSIC) wm_state_ = base::MakeUnique<::wm::WMState>(); - views_delegate_ = ash_test_environment_->CreateViewsDelegate(); + test_views_delegate_ = ash_test_environment_->CreateViewsDelegate(); // Disable animations during tests. zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( @@ -217,7 +217,7 @@ ui::ShutdownInputMethodForTesting(); zero_duration_mode_.reset(); - views_delegate_.reset(); + test_views_delegate_.reset(); wm_state_.reset(); // WindowManager owns the CaptureController for mus/mash.
diff --git a/ash/test/ash_test_helper.h b/ash/test/ash_test_helper.h index 0743b29c..9e61a5f 100644 --- a/ash/test/ash_test_helper.h +++ b/ash/test/ash_test_helper.h
@@ -92,7 +92,9 @@ TestScreenshotDelegate* test_screenshot_delegate() { return test_screenshot_delegate_; } - AshTestViewsDelegate* views_delegate() { return views_delegate_.get(); } + AshTestViewsDelegate* test_views_delegate() { + return test_views_delegate_.get(); + } AshTestEnvironment* ash_test_environment() { return ash_test_environment_; } @@ -148,7 +150,7 @@ TestScreenshotDelegate* test_screenshot_delegate_; std::unique_ptr<::wm::WMState> wm_state_; - std::unique_ptr<AshTestViewsDelegate> views_delegate_; + std::unique_ptr<AshTestViewsDelegate> test_views_delegate_; // Check if DBus Thread Manager was initialized here. bool dbus_thread_manager_initialized_;
diff --git a/build/android/gyp/create_test_runner_script.py b/build/android/gyp/create_test_runner_script.py index b2d08b8..69c821f4 100755 --- a/build/android/gyp/create_test_runner_script.py +++ b/build/android/gyp/create_test_runner_script.py
@@ -60,6 +60,7 @@ "the action's first output.") parser.add_argument('--test-runner-path', help='Path to test_runner.py (optional).') + # We need to intercept any test runner path arguments and make all # of the paths relative to the output script directory. group = parser.add_argument_group('Test runner path arguments.') @@ -78,6 +79,9 @@ group.add_argument('--test-jar') group.add_argument('--test-apk-incremental-install-script') group.add_argument('--coverage-dir') + group.add_argument('--android-manifest-path') + group.add_argument('--resource-zips') + group.add_argument('--robolectric-runtime-deps-dir') args, test_runner_args = parser.parse_known_args( build_utils.ExpandFileArgs(args)) @@ -136,6 +140,18 @@ if args.coverage_dir: test_runner_path_args.append( ('--coverage-dir', RelativizePathToScript(args.coverage_dir))) + if args.android_manifest_path: + test_runner_path_args.append( + ('--android-manifest-path', + RelativizePathToScript(args.android_manifest_path))) + if args.resource_zips: + test_runner_path_args.extend( + ('--resource-zip', RelativizePathToScript(r)) + for r in build_utils.ParseGnList(args.resource_zips)) + if args.robolectric_runtime_deps_dir: + test_runner_path_args.append( + ('--robolectric-runtime-deps-dir', + RelativizePathToScript(args.robolectric_runtime_deps_dir))) with open(args.script_output_path, 'w') as script: script.write(SCRIPT_TEMPLATE.format(
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py index 2303dc54..2da62f84 100755 --- a/build/android/gyp/write_build_config.py +++ b/build/android/gyp/write_build_config.py
@@ -344,6 +344,7 @@ 'dist_jar': ['build_config'], 'resource_rewriter': ['build_config'], 'group': ['build_config'], + 'junit_binary': ['build_config'], } required_options = required_options_map.get(options.type) if not required_options: @@ -540,7 +541,8 @@ deps_info['owned_resources_dirs'] = list(owned_resource_dirs) deps_info['owned_resources_zips'] = list(owned_resource_zips) - if options.type in ('android_resources','android_apk', 'resource_rewriter'): + if options.type in ( + 'android_resources', 'android_apk', 'junit_binary', 'resource_rewriter'): config['resources'] = {} config['resources']['dependency_zips'] = [ c['resources_zip'] for c in all_resources_deps]
diff --git a/build/android/pylib/junit/junit_test_instance.py b/build/android/pylib/junit/junit_test_instance.py index 5fd6af99..1baf8fc 100644 --- a/build/android/pylib/junit/junit_test_instance.py +++ b/build/android/pylib/junit/junit_test_instance.py
@@ -10,8 +10,12 @@ def __init__(self, args, _): super(JunitTestInstance, self).__init__() + self._android_manifest_path = args.android_manifest_path self._coverage_dir = args.coverage_dir self._package_filter = args.package_filter + self._package_name = args.package_name + self._resource_zips = args.resource_zips + self._robolectric_runtime_deps_dir = args.robolectric_runtime_deps_dir self._runner_filter = args.runner_filter self._test_filter = args.test_filter self._test_suite = args.test_suite @@ -29,6 +33,10 @@ pass @property + def android_manifest_path(self): + return self._android_manifest_path + + @property def coverage_dir(self): return self._coverage_dir @@ -37,6 +45,18 @@ return self._package_filter @property + def package_name(self): + return self._package_name + + @property + def resource_zips(self): + return self._resource_zips + + @property + def robolectric_runtime_deps_dir(self): + return self._robolectric_runtime_deps_dir + + @property def runner_filter(self): return self._runner_filter
diff --git a/build/android/pylib/local/machine/local_machine_junit_test_run.py b/build/android/pylib/local/machine/local_machine_junit_test_run.py index b4ce4a9..1a7c55c 100644 --- a/build/android/pylib/local/machine/local_machine_junit_test_run.py +++ b/build/android/pylib/local/machine/local_machine_junit_test_run.py
@@ -4,13 +4,15 @@ import json import os -import tempfile +import zipfile from devil.utils import cmd_helper +from devil.utils import reraiser_thread from pylib import constants from pylib.base import base_test_result from pylib.base import test_run from pylib.results import json_results +from py_utils import tempfile_ext class LocalMachineJunitTestRun(test_run.TestRun): @@ -27,14 +29,33 @@ #override def RunTests(self): - with tempfile.NamedTemporaryFile() as json_file: - java_script = os.path.join(constants.GetOutDirectory(), 'bin', 'helper', - self._test_instance.suite) + with tempfile_ext.NamedTemporaryDirectory() as temp_dir: + json_file_path = os.path.join(temp_dir, 'results.json') + + # Extract resources needed for test. + # TODO(mikecase): Investigate saving md5sums of zipfiles, and only + # extract zipfiles when they change. + def extract_resource_zip(resource_zip): + def helper(): + extract_dest = os.path.join( + temp_dir, os.path.splitext(os.path.basename(resource_zip))[0]) + with zipfile.ZipFile(resource_zip, 'r') as zf: + zf.extractall(extract_dest) + return extract_dest + return helper + + resource_dirs = reraiser_thread.RunAsync( + [extract_resource_zip(resource_zip) + for resource_zip in self._test_instance.resource_zips]) + + java_script = os.path.join( + constants.GetOutDirectory(), 'bin', 'helper', + self._test_instance.suite) command = [java_script] # Add Jar arguments. jar_args = ['-test-jars', self._test_instance.suite + '.jar', - '-json-results-file', json_file.name] + '-json-results-file', json_file_path] if self._test_instance.test_filter: jar_args.extend(['-gtest-filter', self._test_instance.test_filter]) if self._test_instance.package_filter: @@ -45,15 +66,22 @@ command.extend(['--jar-args', '"%s"' % ' '.join(jar_args)]) # Add JVM arguments. - jvm_args = [] - # TODO(mikecase): Add a --robolectric-dep-dir arg to test runner. - # Have this arg set by GN in the generated test runner scripts. - jvm_args += [ - '-Drobolectric.dependency.dir=%s' % os.path.join( - constants.GetOutDirectory(), 'lib.java', 'third_party', - 'robolectric'), - '-Ddir.source.root=%s' % constants.DIR_SOURCE_ROOT, - ] + jvm_args = ['-Drobolectric.dependency.dir=%s' % + self._test_instance.robolectric_runtime_deps_dir, + '-Ddir.source.root=%s' % constants.DIR_SOURCE_ROOT,] + + if self._test_instance.android_manifest_path: + jvm_args += ['-Dchromium.robolectric.manifest=%s' % + self._test_instance.android_manifest_path] + + if self._test_instance.package_name: + jvm_args += ['-Dchromium.robolectric.package.name=%s' % + self._test_instance.package_name] + + if resource_dirs: + jvm_args += ['-Dchromium.robolectric.resource.dirs=%s' % + ':'.join(resource_dirs)] + if self._test_instance.coverage_dir: if not os.path.exists(self._test_instance.coverage_dir): os.makedirs(self._test_instance.coverage_dir) @@ -62,12 +90,14 @@ jvm_args.append('-Demma.coverage.out.file=%s' % os.path.join( self._test_instance.coverage_dir, '%s.ec' % self._test_instance.suite)) + if jvm_args: command.extend(['--jvm-args', '"%s"' % ' '.join(jvm_args)]) cmd_helper.RunCmd(command) - results_list = json_results.ParseResultsFromJson( - json.loads(json_file.read())) + with open(json_file_path, 'r') as f: + results_list = json_results.ParseResultsFromJson( + json.loads(f.read())) test_run_results = base_test_result.TestRunResults() test_run_results.AddResults(results_list)
diff --git a/build/android/test_runner.py b/build/android/test_runner.py index cb2767e6..f7eb5c10 100755 --- a/build/android/test_runner.py +++ b/build/android/test_runner.py
@@ -469,6 +469,21 @@ dest='test_suite', required=True, help='JUnit test suite to run.') + # These arguments are for Android Robolectric tests. + parser.add_argument( + '--android-manifest-path', + help='Path to Android Manifest to configure Robolectric.') + parser.add_argument( + '--package-name', + help='Default app package name for Robolectric tests.') + parser.add_argument( + '--resource-zip', + action='append', dest='resource_zips', default=[], + help='Path to resource zips to configure Robolectric.') + parser.add_argument( + '--robolectric-runtime-deps-dir', + help='Path to runtime deps for Robolectric.') + def AddLinkerTestOptions(parser):
diff --git a/build/android/test_runner.pydeps b/build/android/test_runner.pydeps index 31b3ef53..bf1bb42 100644 --- a/build/android/test_runner.pydeps +++ b/build/android/test_runner.pydeps
@@ -13,6 +13,7 @@ ../../third_party/catapult/common/py_utils/py_utils/cloud_storage_global_lock.py ../../third_party/catapult/common/py_utils/py_utils/contextlib_ext.py ../../third_party/catapult/common/py_utils/py_utils/lock.py +../../third_party/catapult/common/py_utils/py_utils/tempfile_ext.py ../../third_party/catapult/dependency_manager/dependency_manager/__init__.py ../../third_party/catapult/dependency_manager/dependency_manager/archive_info.py ../../third_party/catapult/dependency_manager/dependency_manager/base_config.py
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 51d68cf..890785c3 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn
@@ -282,6 +282,9 @@ if (is_win) { configs += _windows_linker_configs + + # Currently only turn on linker CFI for executables. + configs += [ "//build/config/win:cfi_linker" ] } else if (is_mac) { configs += [ "//build/config/mac:mac_dynamic_flags",
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index e4a4e2d..609feba 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -87,7 +87,7 @@ type == "android_resources" || type == "deps_dex" || type == "dist_jar" || type == "android_assets" || type == "resource_rewriter" || type == "java_binary" || - type == "group" || type == "java_prebuilt") + type == "group" || type == "java_prebuilt" || type == "junit_binary") forward_variables_from(invoker, [ @@ -564,10 +564,40 @@ } } else if (_test_type == "junit") { assert(defined(invoker.test_suite)) + test_runner_args += [ "--test-suite", invoker.test_suite, ] + if (defined(invoker.android_manifest_path)) { + test_runner_args += [ + "--android-manifest-path", + rebase_path(invoker.android_manifest_path, root_build_dir), + ] + } + + if (defined(invoker.package_name)) { + test_runner_args += [ + "--package-name", + invoker.package_name, + ] + + deps += [ ":${invoker.test_suite}__build_config" ] + _junit_binary_build_config = + "${target_gen_dir}/${invoker.test_suite}.build_config" + _rebased_build_config = + rebase_path("$_junit_binary_build_config", root_build_dir) + test_runner_args += [ + "--resource-zips", + "@FileArg($_rebased_build_config:resources:dependency_zips)", + ] + } + + test_runner_args += [ + "--robolectric-runtime-deps-dir", + rebase_path("$root_build_dir/lib.java/third_party/robolectric", + root_build_dir), + ] } else if (_test_type == "linker") { test_runner_args += [ "--test-apk",
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index ba8930f..31d36735 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -898,6 +898,7 @@ grit_target_name = "${target_name}__grit" grit_output_dir = "$target_gen_dir/$extra_output_path" + grit(grit_target_name) { forward_variables_from(invoker, [ "deps" ]) grit_flags = [ @@ -1058,11 +1059,27 @@ _java_binary_target_name = "${target_name}__java_binary" _test_runner_target_name = "${target_name}__test_runner_script" + _build_config = "$target_gen_dir/$target_name.build_config" + _build_config_target_name = "${target_name}__build_config" + + write_build_config(_build_config_target_name) { + type = "junit_binary" + build_config = _build_config + if (defined(invoker.deps)) { + possible_config_deps = invoker.deps + } + } + test_runner_script(_test_runner_target_name) { test_name = invoker.target_name test_suite = invoker.target_name test_type = "junit" ignore_all_data_deps = true + forward_variables_from(invoker, + [ + "android_manifest_path", + "package_name", + ]) } java_binary(_java_binary_target_name) { @@ -1082,6 +1099,7 @@ } group(target_name) { public_deps = [ + ":$_build_config_target_name", ":$_java_binary_target_name", ":$_test_runner_target_name", ]
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn index 3161b3e7..2156313 100644 --- a/build/config/win/BUILD.gn +++ b/build/config/win/BUILD.gn
@@ -252,6 +252,15 @@ ldflags += [ "/DYNAMICBASE" ] } + if (win_linker_timing) { + ldflags += [ + "/time", + "/verbose:incr", + ] + } +} + +config("cfi_linker") { # Control Flow Guard (CFG) # https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065.aspx # /DYNAMICBASE (ASLR) is turned off in debug builds, therefore CFG can’t be @@ -259,14 +268,7 @@ # TODO(thakis): Turn this on with lld once supported, https://crbug.com/693709 if (!is_debug && !use_lld) { # Turn on CFG in msvc linker, regardless of compiler used. - ldflags += [ "/guard:cf" ] - } - - if (win_linker_timing) { - ldflags += [ - "/time", - "/verbose:incr", - ] + ldflags = [ "/guard:cf" ] } }
diff --git a/cc/input/main_thread_scrolling_reason.h b/cc/input/main_thread_scrolling_reason.h index 9746d942..a8c586e 100644 --- a/cc/input/main_thread_scrolling_reason.h +++ b/cc/input/main_thread_scrolling_reason.h
@@ -37,12 +37,14 @@ // These *AndLCDText reasons are due to subpixel text rendering which can // only be applied by blending glyphs with the background at a specific // screen position; transparency and transforms break this. + kNonCompositedReasonsFirst = 16, kHasOpacityAndLCDText = 1 << 16, kHasTransformAndLCDText = 1 << 17, kBackgroundNotOpaqueInRectAndLCDText = 1 << 18, kHasBorderRadius = 1 << 19, kHasClipRelatedProperty = 1 << 20, kHasBoxShadowFromNonRootLayer = 1 << 21, + kNonCompositedReasonsLast = 21, // Transient scrolling reasons. These are computed for each scroll begin. kNonFastScrollableRegion = 1 << 5, @@ -60,6 +62,11 @@ kMainThreadScrollingReasonCount = 22, }; + static const uint32_t kNonCompositedReasons = + kHasOpacityAndLCDText | kHasTransformAndLCDText | + kBackgroundNotOpaqueInRectAndLCDText | kHasBorderRadius | + kHasClipRelatedProperty | kHasBoxShadowFromNonRootLayer; + // Returns true if the given MainThreadScrollingReason can be set by the main // thread. static bool MainThreadCanSetScrollReasons(uint32_t reasons) { @@ -67,10 +74,7 @@ kNotScrollingOnMain | kHasBackgroundAttachmentFixedObjects | kHasNonLayerViewportConstrainedObjects | kThreadedScrollingDisabled | kScrollbarScrolling | kPageOverlay | kHandlingScrollFromMainThread | - kCustomScrollbarScrolling | kHasOpacityAndLCDText | - kHasTransformAndLCDText | kBackgroundNotOpaqueInRectAndLCDText | - kHasBorderRadius | kHasClipRelatedProperty | - kHasBoxShadowFromNonRootLayer; + kCustomScrollbarScrolling; return (reasons & reasons_set_by_main_thread) == reasons; } @@ -84,6 +88,12 @@ return (reasons & reasons_set_by_compositor) == reasons; } + // Returns true if there are any reasons that prevented the scroller + // from being composited. + static bool HasNonCompositedScrollReasons(uint32_t reasons) { + return (reasons & kNonCompositedReasons) != 0; + } + static std::string mainThreadScrollingReasonsAsText(uint32_t reasons) { base::trace_event::TracedValue tracedValue; mainThreadScrollingReasonsAsTracedValue(reasons, &tracedValue); @@ -148,20 +158,6 @@ tracedValue->AppendString("Page-based scrolling"); tracedValue->EndArray(); } - - // For a given reason, return its index in enum - static int getReasonIndex(uint32_t reason) { - // Multiple reasons provided - if (reason & (reason - 1)) - return -1; - - int index = -1; - while (reason > 0) { - reason = reason >> 1; - ++index; - } - return index; - } }; } // namespace cc
diff --git a/cc/tiles/gpu_image_decode_cache_unittest.cc b/cc/tiles/gpu_image_decode_cache_unittest.cc index 6be5cca..91a08d1f 100644 --- a/cc/tiles/gpu_image_decode_cache_unittest.cc +++ b/cc/tiles/gpu_image_decode_cache_unittest.cc
@@ -117,7 +117,7 @@ cache.UnrefImage(another_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageLowerQuality DISABLED_GetTaskForImageLowerQuality #else @@ -155,7 +155,7 @@ cache.UnrefImage(another_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageDifferentImage \ DISABLED_GetTaskForImageDifferentImage @@ -202,7 +202,7 @@ cache.UnrefImage(second_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageLargerScale DISABLED_GetTaskForImageLargerScale #else @@ -259,7 +259,7 @@ cache.UnrefImage(third_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageLargerScaleNoReuse \ DISABLED_GetTaskForImageLargerScaleNoReuse @@ -316,7 +316,7 @@ cache.UnrefImage(third_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageHigherQuality DISABLED_GetTaskForImageHigherQuality #else @@ -360,7 +360,7 @@ cache.UnrefImage(second_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageAlreadyDecodedAndLocked \ DISABLED_GetTaskForImageAlreadyDecodedAndLocked @@ -414,7 +414,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageAlreadyDecodedNotLocked \ DISABLED_GetTaskForImageAlreadyDecodedNotLocked @@ -468,7 +468,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageAlreadyUploaded \ DISABLED_GetTaskForImageAlreadyUploaded @@ -511,7 +511,15 @@ cache.UnrefImage(draw_image); } -TEST(GpuImageDecodeCacheTest, GetTaskForImageCanceledGetsNewTask) { +// crbug.com/709341. +#if defined(MEMORY_SANITIZER) +#define MAYBE_GetTaskForImageCanceledGetsNewTask \ + DISABLED_GetTaskForImageCanceledGetsNewTask +#else +#define MAYBE_GetTaskForImageCanceledGetsNewTask \ + GetTaskForImageCanceledGetsNewTask +#endif +TEST(GpuImageDecodeCacheTest, MAYBE_GetTaskForImageCanceledGetsNewTask) { auto context_provider = TestContextProvider::Create(); context_provider->BindToCurrentThread(); TestGpuImageDecodeCache cache(context_provider.get()); @@ -559,7 +567,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetTaskForImageCanceledWhileReffedGetsNewTask \ DISABLED_GetTaskForImageCanceledWhileReffedGetsNewTask @@ -620,7 +628,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_NoTaskForImageAlreadyFailedDecoding \ DISABLED_NoTaskForImageAlreadyFailedDecoding @@ -662,7 +670,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetDecodedImageForDraw DISABLED_GetDecodedImageForDraw #else @@ -773,7 +781,7 @@ cache.DrawWithImageFinished(draw_image, decoded_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetDecodedImageForDrawLargerScale \ DISABLED_GetDecodedImageForDrawLargerScale @@ -840,7 +848,7 @@ cache.UnrefImage(larger_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetDecodedImageForDrawHigherQuality \ DISABLED_GetDecodedImageForDrawHigherQuality @@ -905,7 +913,7 @@ cache.UnrefImage(higher_quality_draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetDecodedImageForDrawNegative \ DISABLED_GetDecodedImageForDrawNegative @@ -949,7 +957,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetLargeScaledDecodedImageForDraw \ DISABLED_GetLargeScaledDecodedImageForDraw @@ -996,7 +1004,7 @@ EXPECT_FALSE(cache.DiscardableIsLockedForTesting(draw_image)); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_AtRasterUsedDirectlyIfSpaceAllows \ DISABLED_AtRasterUsedDirectlyIfSpaceAllows @@ -1049,7 +1057,7 @@ cache.UnrefImage(draw_image); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_GetDecodedImageForDrawAtRasterDecodeMultipleTimes \ DISABLED_GetDecodedImageForDrawAtRasterDecodeMultipleTimes @@ -1217,7 +1225,7 @@ EXPECT_EQ(0u, cache.GetBytesUsedForTesting()); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_ShouldAggressivelyFreeResources \ DISABLED_ShouldAggressivelyFreeResources @@ -1288,7 +1296,7 @@ } } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_OrphanedImagesFreeOnReachingZeroRefs \ DISABLED_OrphanedImagesFreeOnReachingZeroRefs @@ -1353,7 +1361,7 @@ cache.GetDrawImageSizeForTesting(second_draw_image)); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_OrphanedZeroRefImagesImmediatelyDeleted \ DISABLED_OrphanedZeroRefImagesImmediatelyDeleted @@ -1411,7 +1419,7 @@ cache.GetDrawImageSizeForTesting(second_draw_image)); } -// crbug.com/697171. +// crbug.com/709341. #if defined(MEMORY_SANITIZER) #define MAYBE_QualityCappedAtMedium DISABLED_QualityCappedAtMedium #else
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 57b41d5d..ea4f52a 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -373,6 +373,8 @@ google_play_services_library, ] srcjar_deps = [ "//base:base_build_config_gen" ] + + package_name = manifest_package } chrome_version_java_dir = "$root_gen_dir/templates/chrome_version_java"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java index b6351a6..1157436 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -63,13 +63,14 @@ import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabDelegateFactory; -import org.chromium.chrome.browser.tab.TabIdManager; +import org.chromium.chrome.browser.tabmodel.AsyncTabParamsManager; import org.chromium.chrome.browser.tabmodel.ChromeTabCreator; import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; import org.chromium.chrome.browser.tabmodel.TabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorImpl; +import org.chromium.chrome.browser.tabmodel.TabReparentingParams; import org.chromium.chrome.browser.toolbar.ToolbarControlContainer; import org.chromium.chrome.browser.util.ColorUtils; import org.chromium.chrome.browser.util.UrlUtilities; @@ -77,7 +78,6 @@ import org.chromium.components.dom_distiller.core.DomDistillerUrlUtils; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.WebContents; -import org.chromium.content_public.common.Referrer; import org.chromium.ui.base.PageTransition; import org.chromium.ui.base.WindowAndroid; @@ -113,16 +113,21 @@ private boolean mHasCreatedTabEarly; private boolean mIsInitialResume = true; - // Whether there is any prerender associated with the session. - private boolean mHasPrerender; + // Whether there is any speculative page loading associated with the session. + private boolean mHasSpeculated; private CustomTabObserver mTabObserver; - private String mPrerenderedUrl; - // Whether a prerender is being used. - private boolean mHasPrerendered; + private String mSpeculatedUrl; + + private boolean mUsingPrerender; + private boolean mUsingHiddenTab; private boolean mIsClosing; + // This boolean is used to do a hack in navigation history for + // prerender and hidden tab loads with unmatching fragments. + private boolean mIsFirstLoad; + private static class PageLoadMetricsObserver implements PageLoadMetrics.Observer { private final CustomTabsConnection mConnection; private final CustomTabsSessionToken mSession; @@ -313,12 +318,15 @@ super.preInflationStartup(); mSession = mIntentDataProvider.getSession(); supportRequestWindowFeature(Window.FEATURE_ACTION_MODE_OVERLAY); - mHasPrerender = !TextUtils.isEmpty( - CustomTabsConnection.getInstance(getApplication()).getPrerenderedUrl(mSession)); + CustomTabsConnection connection = CustomTabsConnection.getInstance(getApplication()); + mSpeculatedUrl = connection.getSpeculatedUrl(mSession); + mHasSpeculated = !TextUtils.isEmpty(mSpeculatedUrl); if (getSavedInstanceState() == null && CustomTabsConnection.hasWarmUpBeenFinished(getApplication())) { initializeTabModels(); - mMainTab = createMainTab(); + mMainTab = getHiddenTab(connection); + if (mMainTab == null) mMainTab = createMainTab(); + mIsFirstLoad = true; loadUrlInTab(mMainTab, new LoadUrlParams(getUrlToLoad()), IntentHandler.getTimestampFromIntent(getIntent())); mHasCreatedTabEarly = true; @@ -327,7 +335,7 @@ @Override public boolean shouldAllocateChildConnection() { - return !mHasCreatedTabEarly && !mHasPrerender + return !mHasCreatedTabEarly && !mHasSpeculated && !WarmupManager.getInstance().hasSpareWebContents(); } @@ -424,6 +432,16 @@ getTabModelSelector().getModel(false).addTab(mMainTab, 0, mMainTab.getLaunchType()); } + // This cannot be done before because we want to do the reparenting only + // when we have compositor related controllers. + if (mUsingHiddenTab) { + mMainTab.attachAndFinishReparenting(this, + new CustomTabDelegateFactory(mIntentDataProvider.shouldEnableUrlBarHiding(), + mIntentDataProvider.isOpenedByChrome(), + getFullscreenManager().getBrowserVisibilityDelegate()), + (TabReparentingParams) AsyncTabParamsManager.remove(mMainTab.getId())); + } + LayoutManagerDocument layoutDriver = new CustomTabLayoutManager(getCompositorViewHolder()); initializeCompositorContent(layoutDriver, findViewById(R.id.url_bar), (ViewGroup) findViewById(android.R.id.content), @@ -514,28 +532,39 @@ super.finishNativeInitialization(); } - private Tab createMainTab() { - CustomTabsConnection customTabsConnection = - CustomTabsConnection.getInstance(getApplication()); + /** + * Encapsulates CustomTabsConnection#takeHiddenTab() + * with additional initialization logic. + */ + private Tab getHiddenTab(CustomTabsConnection connection) { String url = getUrlToLoad(); - // Get any referrer that has been explicitly set by the app. - String referrerUrl = IntentHandler.getReferrerUrlIncludingExtraHeaders(getIntent()); - if (referrerUrl == null) { - Referrer referrer = customTabsConnection.getReferrerForSession(mSession); - if (referrer != null) referrerUrl = referrer.getUrl(); + String referrerUrl = connection.getReferrer(mSession, getIntent()); + Tab tab = connection.takeHiddenTab(mSession, url, referrerUrl); + mUsingHiddenTab = tab != null; + if (!mUsingHiddenTab) return null; + RecordHistogram.recordEnumeratedHistogram("CustomTabs.WebContentsStateOnLaunch", + WEBCONTENTS_STATE_PRERENDERED_WEBCONTENTS, WEBCONTENTS_STATE_MAX); + tab.setAppAssociatedWith(connection.getClientPackageNameForSession(mSession)); + if (mIntentDataProvider.shouldEnableEmbeddedMediaExperience()) { + tab.enableEmbeddedMediaExperience(true); } - Tab tab = new Tab(TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID), - Tab.INVALID_TAB_ID, false, this, getWindowAndroid(), - TabLaunchType.FROM_EXTERNAL_APP, null, null); - tab.setAppAssociatedWith(customTabsConnection.getClientPackageNameForSession(mSession)); + initializeMainTab(tab); + return tab; + } - mPrerenderedUrl = customTabsConnection.getPrerenderedUrl(mSession); + private Tab createMainTab() { + CustomTabsConnection connection = CustomTabsConnection.getInstance(getApplication()); + String url = getUrlToLoad(); + String referrerUrl = connection.getReferrer(mSession, getIntent()); + Tab tab = new Tab(Tab.INVALID_TAB_ID, Tab.INVALID_TAB_ID, false, this, getWindowAndroid(), + TabLaunchType.FROM_EXTERNAL_APP, null, null); + tab.setAppAssociatedWith(connection.getClientPackageNameForSession(mSession)); + int webContentsStateOnLaunch = WEBCONTENTS_STATE_NO_WEBCONTENTS; - WebContents webContents = - customTabsConnection.takePrerenderedUrl(mSession, url, referrerUrl); - mHasPrerendered = webContents != null; - if (mHasPrerendered) webContentsStateOnLaunch = WEBCONTENTS_STATE_PRERENDERED_WEBCONTENTS; - if (!mHasPrerendered) { + WebContents webContents = connection.takePrerenderedUrl(mSession, url, referrerUrl); + mUsingPrerender = webContents != null; + if (mUsingPrerender) webContentsStateOnLaunch = WEBCONTENTS_STATE_PRERENDERED_WEBCONTENTS; + if (!mUsingPrerender) { webContents = WarmupManager.getInstance().takeSpareWebContents(false, false); if (webContents != null) webContentsStateOnLaunch = WEBCONTENTS_STATE_SPARE_WEBCONTENTS; } @@ -544,8 +573,8 @@ if (webContents == null) { webContents = WebContentsFactory.createWebContentsWithWarmRenderer(false, false); } - if (!mHasPrerendered) { - customTabsConnection.resetPostMessageHandlerForSession(mSession, webContents); + if (!mUsingPrerender) { + connection.resetPostMessageHandlerForSession(mSession, webContents); } tab.initialize( webContents, getTabContentManager(), @@ -666,14 +695,36 @@ private void loadUrlInTab(final Tab tab, final LoadUrlParams params, long timeStamp) { Intent intent = getIntent(); String url = getUrlToLoad(); - if (mHasPrerendered && UrlUtilities.urlsFragmentsDiffer(mPrerenderedUrl, url)) { - mHasPrerendered = false; - LoadUrlParams temporaryParams = new LoadUrlParams(mPrerenderedUrl); - IntentHandler.addReferrerAndHeaders(temporaryParams, intent); - tab.loadUrl(temporaryParams); + + // Caching isFirstLoad value to deal with multiple return points. + boolean isFirstLoad = mIsFirstLoad; + mIsFirstLoad = false; + + // The following block is a hack that deals with urls preloaded with + // the wrong fragment. Does an extra pageload and replaces history. + if (mHasSpeculated && isFirstLoad + && UrlUtilities.urlsFragmentsDiffer(mSpeculatedUrl, url)) { + if (mUsingPrerender) { + LoadUrlParams temporaryParams = new LoadUrlParams(mSpeculatedUrl); + IntentHandler.addReferrerAndHeaders(temporaryParams, intent); + tab.loadUrl(temporaryParams); + } params.setShouldReplaceCurrentEntry(true); } + mTabObserver.trackNextPageLoadFromTimestamp(tab, timeStamp); + + // Manually generating metrics in case the hidden tab has completely finished loading. + if (mUsingHiddenTab && !tab.isLoading() && !tab.isShowingErrorPage()) { + mTabObserver.onPageLoadStarted(tab, params.getUrl()); + mTabObserver.onPageLoadFinished(tab); + } + + // No actual load to do if tab already has the exact correct url. + if (TextUtils.equals(mSpeculatedUrl, params.getUrl()) && mUsingHiddenTab && isFirstLoad) { + return; + } + IntentHandler.addReferrerAndHeaders(params, intent); if (params.getReferrer() == null) { params.setReferrer(CustomTabsConnection.getInstance(getApplication()) @@ -683,7 +734,6 @@ // from an external intent (unless otherwise specified by an extra in the intent). params.setTransitionType(IntentHandler.getTransitionTypeFromIntent(intent, PageTransition.LINK | PageTransition.FROM_API)); - mTabObserver.trackNextPageLoadFromTimestamp(timeStamp); tab.loadUrl(params); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java index 4950262..ffa2d894 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
@@ -199,14 +199,17 @@ @Override public BrowserControlsVisibilityDelegate createBrowserControlsVisibilityDelegate(Tab tab) { - return new ComposedBrowserControlsVisibilityDelegate( + TabStateBrowserControlsVisibilityDelegate tabDelegate = new TabStateBrowserControlsVisibilityDelegate(tab) { @Override public boolean isHidingBrowserControlsEnabled() { return mShouldHideBrowserControls && super.isHidingBrowserControlsEnabled(); } - }, - mBrowserStateVisibilityDelegate); + }; + + if (mBrowserStateVisibilityDelegate == null) return tabDelegate; + return new ComposedBrowserControlsVisibilityDelegate( + tabDelegate, mBrowserStateVisibilityDelegate); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java index 02489ed7c..4588d84 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabObserver.java
@@ -78,10 +78,17 @@ /** * Tracks the next page load, with timestamp as the origin of time. + * If a load is already happening, we track its PLT. + * If not, we track NavigationCommit timing + PLT for the next load. */ - public void trackNextPageLoadFromTimestamp(long timestamp) { + public void trackNextPageLoadFromTimestamp(Tab tab, long timestamp) { mIntentReceivedTimestamp = timestamp; - mCurrentState = STATE_WAITING_LOAD_START; + if (tab.isLoading()) { + mPageLoadStartedTimestamp = -1; + mCurrentState = STATE_WAITING_LOAD_FINISH; + } else { + mCurrentState = STATE_WAITING_LOAD_START; + } } @Override @@ -133,22 +140,22 @@ mCustomTabsConnection.notifyNavigationEvent( mSession, CustomTabsCallback.NAVIGATION_FINISHED); } - // Both histograms (commit and PLT) are reported here, to make sure - // that they are always recorded together, and that we only record - // commits for successful navigations. - if (mCurrentState == STATE_WAITING_LOAD_FINISH && mIntentReceivedTimestamp > 0) { - long timeToPageLoadStartedMs = mPageLoadStartedTimestamp - mIntentReceivedTimestamp; - long timeToPageLoadFinishedMs = - pageLoadFinishedTimestamp - mIntentReceivedTimestamp; + if (mCurrentState == STATE_WAITING_LOAD_FINISH && mIntentReceivedTimestamp > 0) { String histogramPrefix = mOpenedByChrome ? "ChromeGeneratedCustomTab" : "CustomTabs"; - RecordHistogram.recordCustomTimesHistogram( - histogramPrefix + ".IntentToFirstCommitNavigationTime2.ZoomedOut", - timeToPageLoadStartedMs, - 50, TimeUnit.MINUTES.toMillis(10), TimeUnit.MILLISECONDS, 50); - RecordHistogram.recordCustomTimesHistogram( - histogramPrefix + ".IntentToFirstCommitNavigationTime2.ZoomedIn", - timeToPageLoadStartedMs, 200, 1000, TimeUnit.MILLISECONDS, 100); + long timeToPageLoadFinishedMs = pageLoadFinishedTimestamp - mIntentReceivedTimestamp; + if (mPageLoadStartedTimestamp > 0) { + long timeToPageLoadStartedMs = mPageLoadStartedTimestamp - mIntentReceivedTimestamp; + // Intent to Load Start is recorded here to make sure we do not record + // failed/aborted page loads. + RecordHistogram.recordCustomTimesHistogram( + histogramPrefix + ".IntentToFirstCommitNavigationTime2.ZoomedOut", + timeToPageLoadStartedMs, 50, TimeUnit.MINUTES.toMillis(10), + TimeUnit.MILLISECONDS, 50); + RecordHistogram.recordCustomTimesHistogram( + histogramPrefix + ".IntentToFirstCommitNavigationTime2.ZoomedIn", + timeToPageLoadStartedMs, 200, 1000, TimeUnit.MILLISECONDS, 100); + } // Same bounds and bucket count as PLT histograms. RecordHistogram.recordCustomTimesHistogram(histogramPrefix + ".IntentToPageLoadedTime", timeToPageLoadFinishedMs, 10, TimeUnit.MINUTES.toMillis(10),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java index 3d5d0632..41e9313 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
@@ -50,9 +50,11 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.prerender.ExternalPrerenderHandler; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.chrome.browser.util.UrlUtilities; import org.chromium.content.browser.ChildProcessLauncher; +import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.common.Referrer; @@ -87,6 +89,8 @@ static final int NO_PRERENDERING = 1; @VisibleForTesting static final int PREFETCH_ONLY = 2; + @VisibleForTesting + static final int HIDDEN_TAB = 3; private static AtomicReference<CustomTabsConnection> sInstance = new AtomicReference<>(); @@ -99,6 +103,8 @@ static final int PREFETCH = 1; @VisibleForTesting static final int PRERENDER = 2; + @VisibleForTesting + static final int HIDDEN_TAB = 3; public final CustomTabsSessionToken session; public final String url; @@ -106,26 +112,39 @@ // Only for prerender. public final WebContents webContents; + + // Only for hidden tab. + public final Tab tab; + @VisibleForTesting + boolean mDidFinishLoad; + + // For both hidden tab and prerender public final String referrer; public final Bundle extras; static SpeculationParams forPrefetch(CustomTabsSessionToken session, String url) { - return new SpeculationParams(session, url, PREFETCH, null, null, null); + return new SpeculationParams(session, url, PREFETCH, null, null, null, null); } static SpeculationParams forPrerender(CustomTabsSessionToken session, String url, WebContents webcontents, String referrer, Bundle extras) { - return new SpeculationParams(session, url, PRERENDER, webcontents, referrer, extras); + return new SpeculationParams( + session, url, PRERENDER, webcontents, referrer, extras, null); + } + static SpeculationParams forHiddenTab(CustomTabsSessionToken session, String url, Tab tab, + String referrer, Bundle extras) { + return new SpeculationParams(session, url, HIDDEN_TAB, null, referrer, extras, tab); } private SpeculationParams(CustomTabsSessionToken session, String url, int speculationMode, - WebContents webContents, String referrer, Bundle extras) { + WebContents webContents, String referrer, Bundle extras, Tab tab) { this.session = session; this.url = url; this.speculationMode = speculationMode; this.webContents = webContents; this.referrer = referrer; this.extras = extras; + this.tab = tab; } } @@ -601,12 +620,57 @@ return result; } - /** Returns the URL prerendered for a session, or null. */ - String getPrerenderedUrl(CustomTabsSessionToken session) { + String getSpeculatedUrl(CustomTabsSessionToken session) { if (mSpeculation == null || session == null || !session.equals(mSpeculation.session)) { return null; } - return mSpeculation.webContents != null ? mSpeculation.url : null; + switch (mSpeculation.speculationMode) { + case SpeculationParams.PRERENDER: + return mSpeculation.webContents != null ? mSpeculation.url : null; + case SpeculationParams.HIDDEN_TAB: + return mSpeculation.tab != null ? mSpeculation.url : null; + default: + return null; + } + } + + /** + * Returns a {@link Tab} that was preloaded as a hidden tab if it exists. + * + * If one exists but either URL matching or referer matching fails, + * null is returned and the existing tab is discarded. + * + * @param session The Binder object identifying a session. + * @param url The URL the tab is for. + * @param referrer The referrer to use for |url|. + * @return The hidden tab, or null. + */ + Tab takeHiddenTab(CustomTabsSessionToken session, String url, String referrer) { + try { + TraceEvent.begin("CustomTabsConnection.takeHiddenTab"); + if (mSpeculation == null || session == null) return null; + if (session.equals(mSpeculation.session) && mSpeculation.tab != null) { + Tab tab = mSpeculation.tab; + String speculatedUrl = mSpeculation.url; + String speculationReferrer = mSpeculation.referrer; + mSpeculation = null; + + boolean ignoreFragments = mClientManager.getIgnoreFragmentsForSession(session); + boolean isExactSameUrl = TextUtils.equals(speculatedUrl, url); + boolean urlsMatch = isExactSameUrl + || (ignoreFragments + && UrlUtilities.urlsMatchIgnoringFragments(speculatedUrl, url)); + if (referrer == null) referrer = ""; + if (urlsMatch && TextUtils.equals(speculationReferrer, referrer)) { + return tab; + } else { + tab.destroy(); + } + } + } finally { + TraceEvent.end("CustomTabsConnection.takeHiddenTab"); + } + return null; } /** See {@link ClientManager#getReferrerForSession(CustomTabsSessionToken)} */ @@ -933,6 +997,9 @@ boolean didPrerender = prerenderUrl(session, url, extras, uid); createSpareWebContents = !didPrerender; break; + case SpeculationParams.HIDDEN_TAB: + launchUrlInHiddenTab(session, url, extras); + break; default: break; } @@ -967,11 +1034,8 @@ mExternalPrerenderHandler = new ExternalPrerenderHandler(); } Rect contentBounds = ExternalPrerenderHandler.estimateContentSize(mApplication, true); - String referrer = IntentHandler.getReferrerUrlIncludingExtraHeaders(extrasIntent); - if (referrer == null && getReferrerForSession(session) != null) { - referrer = getReferrerForSession(session).getUrl(); - } - if (referrer == null) referrer = ""; + String referrer = getReferrer(session, extrasIntent); + Pair<WebContents, WebContents> webContentsPair = mExternalPrerenderHandler.addPrerender(Profile.getLastUsedProfile(), url, referrer, contentBounds, shouldPrerenderOnCellularForSession(session)); @@ -990,6 +1054,36 @@ return true; } + /** + * Creates a hidden tab and initiates a navigation. + */ + private void launchUrlInHiddenTab( + final CustomTabsSessionToken session, final String url, final Bundle extras) { + ThreadUtils.postOnUiThread(new Runnable() { + @Override + public void run() { + Intent extrasIntent = new Intent(); + if (extras != null) extrasIntent.putExtras(extras); + if (IntentHandler.getExtraHeadersFromIntent(extrasIntent) != null) return; + + Tab tab = Tab.createDetached(new CustomTabDelegateFactory(false, false, null)); + + // Updating post message as soon as we have a valid WebContents. + mClientManager.resetPostMessageHandlerForSession( + session, tab.getContentViewCore().getWebContents()); + + LoadUrlParams loadParams = new LoadUrlParams(url); + String referrer = getReferrer(session, extrasIntent); + if (referrer != null && !referrer.isEmpty()) { + loadParams.setReferrer( + new Referrer(referrer, Referrer.REFERRER_POLICY_DEFAULT)); + } + mSpeculation = SpeculationParams.forHiddenTab(session, url, tab, referrer, extras); + mSpeculation.tab.loadUrl(loadParams); + } + }); + } + @VisibleForTesting void resetThrottling(Context context, int uid) { mClientManager.resetThrottling(uid); @@ -1015,4 +1109,24 @@ return getSpeculationModeForSession(session); } } + + /** + * Get any referrer that has been explicitly set. + * + * Inspects the two possible sources for the referrer: + * - A session for which the referrer might have been set. + * - An intent for a navigation that contains a referer in the headers. + * + * @param session session to inspect for referrer settings. + * @param intent intent to inspect for referrer header. + * @return referrer URL as a string if any was found, empty string otherwise. + */ + String getReferrer(CustomTabsSessionToken session, Intent intent) { + String referrer = IntentHandler.getReferrerUrlIncludingExtraHeaders(intent); + if (referrer == null && getReferrerForSession(session) != null) { + referrer = getReferrerForSession(session).getUrl(); + } + if (referrer == null) referrer = ""; + return referrer; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java index 29a51c0..26e30c3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
@@ -8,6 +8,7 @@ import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; import org.chromium.chrome.browser.AppHooks; +import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.datausage.DataUseTabUIManager; import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler; import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler.OverrideUrlLoadingResult; @@ -75,6 +76,9 @@ @Override public boolean shouldIgnoreNavigation(NavigationParams navigationParams) { String url = navigationParams.url; + ChromeActivity associatedActivity = mTab.getActivity(); + long lastUserInteractionTime = + (associatedActivity == null) ? -1 : associatedActivity.getLastUserInteractionTime(); if (mAuthenticatorHelper != null && mAuthenticatorHelper.handleAuthenticatorUrl(url)) { return true; @@ -94,7 +98,7 @@ // not covering the case where a gesture is carried over via a redirect. This is // currently not feasible because we do not see all navigations for iframes and it is // better to error on the side of caution and require direct user gestures for iframes. - tabRedirectHandler = new TabRedirectHandler(mTab.getActivity()); + tabRedirectHandler = new TabRedirectHandler(associatedActivity); } else { assert false; return false; @@ -102,7 +106,7 @@ tabRedirectHandler.updateNewUrlLoading(navigationParams.pageTransitionType, navigationParams.isRedirect, navigationParams.hasUserGesture || navigationParams.hasUserGestureCarryover, - mTab.getActivity().getLastUserInteractionTime(), getLastCommittedEntryIndex()); + lastUserInteractionTime, getLastCommittedEntryIndex()); boolean shouldCloseTab = shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent(); ExternalNavigationParams params = buildExternalNavigationParams(navigationParams,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java index 7155450..060df42bb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java
@@ -1340,23 +1340,7 @@ IntentHandler.addTrustedIntentExtras(intent); if (ChromeFeatureList.isEnabled(ChromeFeatureList.TAB_REPARENTING)) { - TabModelSelector tabModelSelector = getTabModelSelector(); - if (tabModelSelector == null) return false; - mIsDetachedForReparenting = true; - - // Add the tab to AsyncTabParamsManager before removing it from the current model to - // ensure the global count of tabs is correct. See crbug.com/611806. - intent.putExtra(IntentHandler.EXTRA_TAB_ID, mId); - AsyncTabParamsManager.add(mId, - new TabReparentingParams(this, intent, finalizeCallback)); - - tabModelSelector.getModel(mIncognito).removeTab(this); - - // TODO(yusufo): We can't call updateWindowAndroid here and set mWindowAndroid to null - // because many code paths (including navigation) expect the tab to always be associated - // with an activity, and will crash. crbug.com/657007 - if (mContentViewCore != null) mContentViewCore.updateWindowAndroid(null); - attachTabContentManager(null); + detach(intent, finalizeCallback); } activity.startActivity(intent, startActivityOptions); @@ -1364,6 +1348,37 @@ } /** + * Detaches a tab from its current activity if any. + * + * In details, this function: + * - Tags the tab using mIsDetachedForReparenting. + * - Registers some information for later reparenting in {@link AsyncTabParamsManager}. + * - Removes the tab from its current {@link TabModelSelector}, effectively severing + * the {@link Activity} to {@link Tab} link. + * + * @param intent to be stored within a {@link TabReparentingParams} + * @param finalizeCallback to be stored within a {@link TabReparentingParams} + */ + private void detach(Intent intent, Runnable finalizeCallback) { + mIsDetachedForReparenting = true; + // Add the tab to AsyncTabParamsManager before removing it from the current model to + // ensure the global count of tabs is correct. See crbug.com/611806. + if (intent == null) intent = new Intent(); + intent.putExtra(IntentHandler.EXTRA_TAB_ID, mId); + AsyncTabParamsManager.add(mId, new TabReparentingParams(this, intent, finalizeCallback)); + + TabModelSelector tabModelSelector = getTabModelSelector(); + if (tabModelSelector != null) { + tabModelSelector.getModel(mIncognito).removeTab(this); + } + // TODO(yusufo): We can't call updateWindowAndroid here and set mWindowAndroid to null + // because many code paths (including navigation) expect the tab to always be associated + // with an activity, and will crash. crbug.com/657007 + if (mContentViewCore != null) mContentViewCore.updateWindowAndroid(null); + attachTabContentManager(null); + } + + /** * Finishes the tab reparenting process. Attaches the tab to the new activity, and updates the * tab and related objects to reference the new activity. This updates many delegates inside the * tab and {@link ContentViewCore} both on java and native sides. @@ -1383,7 +1398,6 @@ attachTabContentManager(activity.getTabContentManager()); mFullscreenManager = activity.getFullscreenManager(); activity.getCompositorViewHolder().prepareForTabReparenting(); - // Update the delegate factory, then recreate and propagate all delegates. mDelegateFactory = tabDelegateFactory; mWebContentsDelegate = mDelegateFactory.createWebContentsDelegate(this); @@ -2900,6 +2914,31 @@ } /** + * Creates an instance of a {@link Tab} that is fully detached from any activity. + * Also performs general tab initialization as well as detached specifics. + * + * The current application context must allow the creation of a WindowAndroid. + * + * @return The newly created and initialized tab. + */ + public static Tab createDetached(TabDelegateFactory delegateFactory) { + Context context = ContextUtils.getApplicationContext(); + WindowAndroid windowAndroid = new WindowAndroid(context); + Tab tab = new Tab(INVALID_TAB_ID, INVALID_TAB_ID, false, context, windowAndroid, + TabLaunchType.FROM_DETACHED, null, null); + tab.initialize(null, null, delegateFactory, true, false); + + // Resize the webContent to avoid expensive post load resize when attaching the tab. + Rect bounds = ExternalPrerenderHandler.estimateContentSize((Application) context, false); + int width = bounds.right - bounds.left; + int height = bounds.bottom - bounds.top; + tab.getContentViewCore().onSizeChanged(width, height, 0, 0); + + tab.detach(null, null); + return tab; + } + + /** * @return Whether the theme color for this tab is the default color. */ public boolean isDefaultThemeColor() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java index 5843304..d0c2114 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/AsyncTabParamsManager.java
@@ -62,4 +62,4 @@ private AsyncTabParamsManager() { } -} \ No newline at end of file +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModel.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModel.java index 29b52a8..48d445bd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModel.java
@@ -59,6 +59,11 @@ /** Opened from a launcher shortcut. */ FROM_LAUNCHER_SHORTCUT, + + /** + * The tab is initially detached. + */ + FROM_DETACHED, } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java index 08f5be6..1b1acce 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -1376,6 +1376,48 @@ requestTime, CustomTabsConnection.SpeculationParams.PRERENDER); } + /** + * Tests a postMessage request chain can start while loading a hidden tab and continue + * afterwards. Request sent before the hidden tab start. + */ + @SmallTest + @RetryOnFailure + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + public void testPostMessageThroughHiddenTabWithRequestBeforeMayLaunchUrl() + throws InterruptedException { + sendPostMessageDuringHiddenTabTransition(BEFORE_MAY_LAUNCH_URL); + } + + /** + * Tests a postMessage request chain can start while loading a hidden tab and continue + * afterwards. Request sent after the hidden tab start and before intent launched. + */ + @SmallTest + @RetryOnFailure + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + public void testPostMessageThroughHiddenTabWithRequestBeforeIntent() + throws InterruptedException { + sendPostMessageDuringHiddenTabTransition(BEFORE_INTENT); + } + + /** + * Tests a postMessage request chain can start while loading a hidden tab and continue + * afterwards. Request sent after intent received. + */ + @SmallTest + @RetryOnFailure + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + public void testPostMessageThroughHiddenTabWithRequestAfterIntent() + throws InterruptedException { + sendPostMessageDuringHiddenTabTransition(AFTER_INTENT); + } + + private void sendPostMessageDuringHiddenTabTransition(int requestTime) + throws InterruptedException { + sendPostMessageDuringSpeculationTransition( + requestTime, CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + private void sendPostMessageDuringSpeculationTransition(int requestTime, int speculationMode) throws InterruptedException { final CallbackHelper messageChannelHelper = new CallbackHelper(); @@ -1532,6 +1574,13 @@ mayLaunchUrlWithoutWarmup(CustomTabsConnection.SpeculationParams.PRERENDER); } + /** Tests that calling mayLaunchUrl() without warmup() succeeds. */ + @SmallTest + @RetryOnFailure + public void testMayLaunchUrlWithoutWarmupHiddenTab() { + mayLaunchUrlWithoutWarmup(CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + /** * Tests that launching a regular Chrome tab after warmup() gives the right layout. * @@ -1634,6 +1683,60 @@ ignoreFragments, wait, CustomTabsConnection.SpeculationParams.PRERENDER); } + /** + * Tests the following scenario: + * - warmup() + mayLaunchUrl("http://example.com/page.html#first-fragment") + * - loadUrl("http://example.com/page.html#other-fragment") + * + * The expected behavior is that the hidden tab shouldn't be dropped, and that the fragment is + * updated. + */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabAndChangingFragmentIgnoreFragments() throws Exception { + startHiddenTabAndChangeFragment(true, true); + } + + /** Same as above, but the hidden tab matching should not ignore the fragment. */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabAndChangingFragmentDontIgnoreFragments() throws Exception { + startHiddenTabAndChangeFragment(false, true); + } + + /** Same as above, hidden tab matching ignores the fragment, don't wait. */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabAndChangingFragmentDontWait() throws Exception { + startHiddenTabAndChangeFragment(true, false); + } + + /** Same as above, hidden tab matching doesn't ignore the fragment, don't wait. */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabAndChangingFragmentDontWaitDrop() throws Exception { + startHiddenTabAndChangeFragment(false, false); + } + + /** + * Tests the following scenario: + * - warmup() + mayLaunchUrl("http://example.com/page.html#first-fragment") + * - loadUrl("http://example.com/page.html#other-fragment") + * + * There are two parameters changing the bahavior: + * @param ignoreFragments Whether the hidden tab should be kept. + * @param wait Whether to wait for the hidden tab to load. + */ + private void startHiddenTabAndChangeFragment(boolean ignoreFragments, boolean wait) + throws Exception { + speculateAndChangeFragment( + ignoreFragments, wait, CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + private void speculateAndChangeFragment( boolean ignoreFragments, boolean wait, int speculationMode) throws Exception { String testUrl = mTestServer.getURL(FRAGMENT_TEST_PAGE); @@ -1685,7 +1788,7 @@ } /** - * Test whether the url shown on prerender gets updated from about:blank when the prerender + * Test whether the url shown on prerender gets updated from about:blank when it * completes in the background. * Non-regression test for crbug.com/554236. */ @@ -1696,6 +1799,17 @@ testSpeculateCorrectUrl(CustomTabsConnection.SpeculationParams.PRERENDER); } + /** + * Test whether the url shown on hidden tab gets updated from about:blank when it + * completes in the background. + */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabCorrectUrl() throws Exception { + testSpeculateCorrectUrl(CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + private void testSpeculateCorrectUrl(int speculationMode) throws Exception { Context context = getInstrumentation().getTargetContext().getApplicationContext(); final CustomTabsConnection connection = warmUpAndWait(); @@ -1726,6 +1840,16 @@ testSpeculateInvalidUrl(CustomTabsConnection.SpeculationParams.PRERENDER); } + /** + * Test whether invalid urls are avoided for hidden tab. + */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabInvalidUrl() throws Exception { + testSpeculateInvalidUrl(CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + private void testSpeculateInvalidUrl(int speculationMode) throws Exception { final CustomTabsConnection connection = warmUpAndWait(); CustomTabsSessionToken token = CustomTabsSessionToken.createDummySessionTokenForTesting(); @@ -1861,6 +1985,17 @@ testSpeculatingWithReferrer(CustomTabsConnection.SpeculationParams.PRERENDER); } + /** + * Tests that hidden tab accepts a referrer, and that this is not lost when launching the + * Custom Tab. + */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabWithReferrer() throws Exception { + testSpeculatingWithReferrer(CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + private void testSpeculatingWithReferrer(int speculationMode) throws Exception { String referrer = "android-app://com.foo.me/"; maybeSpeculateAndLaunchWithReferrers( @@ -1878,7 +2013,7 @@ } /** - * Tests that prerendering accepts a referrer, and that the prerender is dropped when the tab + * Tests that prerendering accepts a referrer, and that this is dropped when the tab * is launched with a mismatched referrer. */ @SmallTest @@ -1888,6 +2023,17 @@ testSpeculatingWithMismatchedReferrers(CustomTabsConnection.SpeculationParams.PRERENDER); } + /** + * Tests that hidden tab accepts a referrer, and that this is dropped when the tab + * is launched with a mismatched referrer. + */ + @SmallTest + @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) + @RetryOnFailure + public void testHiddenTabWithMismatchedReferrers() throws Exception { + testSpeculatingWithMismatchedReferrers(CustomTabsConnection.SpeculationParams.HIDDEN_TAB); + } + private void testSpeculatingWithMismatchedReferrers(int speculationMode) throws Exception { String prerenderReferrer = "android-app://com.foo.me/"; String launchReferrer = "android-app://com.foo.me.i.changed.my.mind/"; @@ -2248,6 +2394,16 @@ } }, LONG_TIMEOUT_MS, CriteriaHelper.DEFAULT_POLLING_INTERVAL); } + if (speculationMode == CustomTabsConnection.SpeculationParams.HIDDEN_TAB) { + CriteriaHelper.pollUiThread(new Criteria("No Prerender") { + @Override + public boolean isSatisfied() { + return connection.mSpeculation != null && connection.mSpeculation.tab != null + && !connection.mSpeculation.tab.isLoading() + && !connection.mSpeculation.tab.isShowingErrorPage(); + } + }, LONG_TIMEOUT_MS, CriteriaHelper.DEFAULT_POLLING_INTERVAL); + } } private CustomTabsSession bindWithCallback(final CustomTabsCallback callback) { @@ -2340,6 +2496,8 @@ switch (speculationMode) { case CustomTabsConnection.SpeculationParams.PRERENDER: return "prerender"; + case CustomTabsConnection.SpeculationParams.HIDDEN_TAB: + return "hidden"; default: return "visible"; }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java index 4d2bec2a..41da10b 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
@@ -7,7 +7,6 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; -import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; @@ -19,14 +18,8 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import android.content.Context; -import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.Color; -import android.support.annotation.ColorRes; -import android.support.annotation.DimenRes; -import android.support.annotation.LayoutRes; -import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; @@ -43,12 +36,8 @@ import org.mockito.stubbing.Answer; import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; -import org.robolectric.annotation.Implementation; -import org.robolectric.annotation.Implements; -import org.robolectric.shadows.ShadowResources; import org.chromium.base.Callback; -import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.Features; import org.chromium.chrome.browser.favicon.LargeIconBridge.LargeIconCallback; @@ -60,9 +49,7 @@ * Unit tests for {@link TileGroup}. */ @RunWith(LocalRobolectricTestRunner.class) -@Config(manifest = Config.NONE, sdk = 21, - shadows = {TileGroupTest.TileShadowResources.class, - TileGroupTest.ShadowLayoutInflater.class}) +@Config(manifest = Config.NONE) @Features(@Features.Register(ChromeFeatureList.NTP_OFFLINE_PAGES_FEATURE_NAME)) public class TileGroupTest { private static final int MAX_TILES_TO_FETCH = 4; @@ -430,46 +417,4 @@ @Override public void destroy() {} } - - /** - * Replacement for the {@link Resources} to allow loading resources used by {@link TileGroup} in - * unit tests. - * TODO(https://crbug.com/693573): Needed until unit tests can pick up resources themselves. - */ - @Implements(Resources.class) - public static class TileShadowResources extends ShadowResources { - @Implementation - public int getDimensionPixelSize(@DimenRes int id) { - if (id == R.dimen.tile_view_icon_size) return 48; - - throw new IllegalArgumentException(); - } - - @Implementation - public int getColor(@ColorRes int id) { - if (id == R.color.default_favicon_background_color) return Color.BLACK; - - throw new IllegalArgumentException(); - } - } - - /** Intercepts calls to inflate views to replace them with mocks. */ - @Implements(LayoutInflater.class) - public static class ShadowLayoutInflater { - @Implementation - public static LayoutInflater from(Context context) { - LayoutInflater layoutInflater = mock(LayoutInflater.class); - when(layoutInflater.inflate(anyInt(), any(ViewGroup.class), anyBoolean())) - .thenAnswer(new Answer<View>() { - @Override - public View answer(InvocationOnMock invocation) throws Throwable { - @LayoutRes - int layoutId = invocation.getArgument(0); - if (layoutId != R.layout.tile_view) fail("Unexpected resource id."); - return createMockTileView(); - } - }); - return layoutInflater; - } - } }
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index 0e806fa..c05d022 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -3128,7 +3128,7 @@ TestHelper("testFindAPI", "web_view/shim", NO_TEST_SERVER); } -// crbug.com/697171 +// crbug.com/710486 #if defined(MEMORY_SANITIZER) #define MAYBE_Shim_TestFindAPI_findupdate DISABLED_Shim_TestFindAPI_findupdate #else
diff --git a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc index e166838..20167745 100644 --- a/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc +++ b/chrome/browser/chromeos/accessibility/select_to_speak_event_handler_unittest.cc
@@ -85,8 +85,9 @@ void SetUp() override { ash::test::AshTestBase::SetUp(); event_delegate_.reset(new SelectToSpeakAccessibilityEventDelegate()); - ash_test_helper()->views_delegate()->set_test_accessibility_event_delegate( - event_delegate_.get()); + ash_test_helper() + ->test_views_delegate() + ->set_test_accessibility_event_delegate(event_delegate_.get()); generator_ = &AshTestBase::GetEventGenerator(); CurrentContext()->AddPreTargetHandler(select_to_speak_event_handler_.get()); CurrentContext()->AddPreTargetHandler(&event_capturer_);
diff --git a/chrome/browser/chromeos/options/DEPS b/chrome/browser/chromeos/options/DEPS deleted file mode 100644 index afb80e1b..0000000 --- a/chrome/browser/chromeos/options/DEPS +++ /dev/null
@@ -1,5 +0,0 @@ -include_rules = [ - # TODO(xdai): Remove these rules after bugs 687340 and 687349 are fixed. - "!chrome/browser/ui/views/harmony/layout_delegate.h", -] -
diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc index b45875f..f4bd758 100644 --- a/chrome/browser/chromeos/options/vpn_config_view.cc +++ b/chrome/browser/chromeos/options/vpn_config_view.cc
@@ -17,7 +17,6 @@ #include "chrome/browser/chromeos/enrollment_dialog_view.h" #include "chrome/browser/chromeos/net/shill_error.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "chrome/common/net/x509_certificate_model.h" #include "chrome/grit/generated_resources.h" #include "chromeos/login/login_state.h" @@ -38,6 +37,7 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_client_view.h" @@ -506,8 +506,9 @@ GetNetworkState(service_path_); DCHECK(vpn && vpn->type() == shill::kTypeVPN); } + layout_ = views::GridLayout::CreatePanel(this); - LayoutDelegate* delegate = LayoutDelegate::Get(); + views::LayoutProvider* provider = views::LayoutProvider::Get(); // Observer any changes to the certificate list. CertLibrary::Get()->AddObserver(this); @@ -517,15 +518,15 @@ column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); // Textfield, combobox. column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, ChildNetworkConfigView::kInputFieldMinWidth); column_set->AddPaddingColumn( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); // Policy indicator. column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); @@ -551,8 +552,7 @@ server_textfield_->set_controller(this); layout_->AddView(server_textfield_); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); if (!service_path_.empty()) { server_label->SetEnabled(false); server_textfield_->SetEnabled(false); @@ -574,8 +574,7 @@ service_textfield_ = NULL; } layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Provider type label and select. layout_->StartRow(0, 0); @@ -596,8 +595,7 @@ provider_type_combobox_ = NULL; } layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // PSK passphrase label, input and visible button. layout_->StartRow(0, 0); @@ -610,8 +608,7 @@ layout_->AddView( new ControlledSettingIndicatorView(psk_passphrase_ui_data_)); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Server CA certificate if (service_path_.empty()) { @@ -625,9 +622,8 @@ server_ca_cert_combobox_model_.get()); layout_->AddView(server_ca_cert_combobox_); layout_->AddView(new ControlledSettingIndicatorView(ca_cert_ui_data_)); - layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout_->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } else { server_ca_cert_label_ = NULL; server_ca_cert_combobox_ = NULL; @@ -645,8 +641,7 @@ layout_->AddView(user_cert_combobox_); layout_->AddView(new ControlledSettingIndicatorView(user_cert_ui_data_)); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Username label and input. layout_->StartRow(0, 0); @@ -658,8 +653,7 @@ layout_->AddView(username_textfield_); layout_->AddView(new ControlledSettingIndicatorView(username_ui_data_)); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // User passphrase label, input and visble button. layout_->StartRow(0, 0); @@ -672,8 +666,7 @@ layout_->AddView( new ControlledSettingIndicatorView(user_passphrase_ui_data_)); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // OTP label and input. layout_->StartRow(0, 0); @@ -684,8 +677,7 @@ otp_textfield_->set_controller(this); layout_->AddView(otp_textfield_); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Group Name label and input. layout_->StartRow(0, 0); @@ -698,8 +690,7 @@ layout_->AddView(group_name_textfield_); layout_->AddView(new ControlledSettingIndicatorView(group_name_ui_data_)); layout_->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Save credentials layout_->StartRow(0, 0);
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index 2ce524b..c1a5cd0 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -17,7 +17,6 @@ #include "chrome/browser/chromeos/net/shill_error.h" #include "chrome/browser/chromeos/options/passphrase_textfield.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" #include "chromeos/login/login_state.h" @@ -43,6 +42,7 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_client_view.h" @@ -939,7 +939,7 @@ } views::GridLayout* layout = views::GridLayout::CreatePanel(this); - LayoutDelegate* delegate = LayoutDelegate::Get(); + views::LayoutProvider* provider = views::LayoutProvider::Get(); const int column_view_set_id = 0; views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); @@ -956,15 +956,15 @@ 1, views::GridLayout::USE_PREF, 0, 0); } column_set->AddPaddingColumn( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); // Textfield, combobox. column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, ChildNetworkConfigView::kInputFieldMinWidth); column_set->AddPaddingColumn( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); // Password visible button / policy indicator. column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 0, views::GridLayout::FIXED, kPasswordVisibleWidth, 0); @@ -992,9 +992,8 @@ label->SetHorizontalAlignment(gfx::ALIGN_LEFT); layout->AddView(label); } - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } // Security select @@ -1015,9 +1014,8 @@ layout->AddView(security_combobox_); } layout->AddView(security_combobox_); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } // Only enumerate certificates in the data model for 802.1X networks. @@ -1044,9 +1042,8 @@ layout->AddView(eap_method_combobox_); } layout->AddView(new ControlledSettingIndicatorView(eap_method_ui_data_)); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Phase 2 authentication layout->StartRow(0, column_view_set_id); @@ -1070,9 +1067,8 @@ layout->AddView(phase_2_auth_combobox_); } layout->AddView(new ControlledSettingIndicatorView(phase_2_auth_ui_data_)); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Server CA certificate layout->StartRow(0, column_view_set_id); @@ -1098,9 +1094,8 @@ } layout->AddView( new ControlledSettingIndicatorView(server_ca_cert_ui_data_)); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Subject Match layout->StartRow(0, column_view_set_id); @@ -1118,9 +1113,8 @@ } else { layout->AddView(subject_match_textfield_); } - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); // User certificate layout->StartRow(0, column_view_set_id); @@ -1142,9 +1136,8 @@ layout->AddView(user_cert_combobox_); } layout->AddView(new ControlledSettingIndicatorView(user_cert_ui_data_)); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Identity layout->StartRow(0, column_view_set_id); @@ -1164,9 +1157,8 @@ layout->AddView(identity_textfield_); } layout->AddView(new ControlledSettingIndicatorView(identity_ui_data_)); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } // Passphrase input @@ -1226,8 +1218,7 @@ } layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); if (show_8021x) { // Anonymous identity @@ -1249,16 +1240,14 @@ } layout->AddView( new ControlledSettingIndicatorView(identity_anonymous_ui_data_)); - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { // We need a little bit more padding above Checkboxes. - layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } // Checkboxes. @@ -1287,8 +1276,7 @@ layout->AddView(share_network_checkbox_); } layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Create an error label. layout->StartRow(0, column_view_set_id);
diff --git a/chrome/browser/chromeos/options/wimax_config_view.cc b/chrome/browser/chromeos/options/wimax_config_view.cc index b92f35f0..ec0cf562 100644 --- a/chrome/browser/chromeos/options/wimax_config_view.cc +++ b/chrome/browser/chromeos/options/wimax_config_view.cc
@@ -11,7 +11,6 @@ #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/net/shill_error.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" #include "chromeos/login/login_state.h" @@ -33,6 +32,7 @@ #include "ui/views/controls/label.h" #include "ui/views/controls/textfield/textfield.h" #include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_client_view.h" @@ -210,7 +210,7 @@ &passphrase_ui_data_, wimax, ::onc::wifi::kPassphrase); views::GridLayout* layout = views::GridLayout::CreatePanel(this); - LayoutDelegate* delegate = LayoutDelegate::Get(); + views::LayoutProvider* provider = views::LayoutProvider::Get(); const int column_view_set_id = 0; views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); @@ -219,15 +219,15 @@ column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); // Textfield, combobox. column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, ChildNetworkConfigView::kInputFieldMinWidth); column_set->AddPaddingColumn( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); // Password visible button / policy indicator. column_set->AddColumn(views::GridLayout::CENTER, views::GridLayout::FILL, 1, views::GridLayout::USE_PREF, 0, kPasswordVisibleWidth); @@ -240,8 +240,7 @@ label->SetHorizontalAlignment(gfx::ALIGN_LEFT); layout->AddView(label); layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Identity layout->StartRow(0, column_view_set_id); @@ -256,8 +255,7 @@ layout->AddView(identity_textfield_); layout->AddView(new ControlledSettingIndicatorView(identity_ui_data_)); layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Passphrase input layout->StartRow(0, column_view_set_id); @@ -308,8 +306,7 @@ } layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Checkboxes. @@ -347,8 +344,7 @@ layout->AddView(share_network_checkbox_); } layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); // Create an error label. layout->StartRow(0, column_view_set_id);
diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc index f4333d3..c564797 100644 --- a/chrome/browser/extensions/extension_management.cc +++ b/chrome/browser/extensions/extension_management.cc
@@ -198,6 +198,30 @@ return default_settings_->blocked_permissions; } +const URLPatternSet& ExtensionManagement::GetRuntimeBlockedHosts( + const Extension* extension) const { + auto iter_id = settings_by_id_.find(extension->id()); + if (iter_id != settings_by_id_.end()) + return iter_id->second->runtime_blocked_hosts; + return default_settings_->runtime_blocked_hosts; +} + +const URLPatternSet& ExtensionManagement::GetRuntimeAllowedHosts( + const Extension* extension) const { + auto iter_id = settings_by_id_.find(extension->id()); + if (iter_id != settings_by_id_.end()) + return iter_id->second->runtime_allowed_hosts; + return default_settings_->runtime_allowed_hosts; +} + +bool ExtensionManagement::IsBlockedHost(const Extension* extension, + const GURL& url) const { + auto iter_id = settings_by_id_.find(extension->id()); + if (iter_id != settings_by_id_.end()) + return iter_id->second->runtime_blocked_hosts.MatchesURL(url); + return default_settings_->runtime_blocked_hosts.MatchesURL(url); +} + std::unique_ptr<const PermissionSet> ExtensionManagement::GetBlockedPermissions( const Extension* extension) const { // Only api permissions are supported currently.
diff --git a/chrome/browser/extensions/extension_management.h b/chrome/browser/extensions/extension_management.h index a686f34..1dca6061 100644 --- a/chrome/browser/extensions/extension_management.h +++ b/chrome/browser/extensions/extension_management.h
@@ -114,6 +114,16 @@ // Returns the list of blocked API permissions for |extension|. APIPermissionSet GetBlockedAPIPermissions(const Extension* extension) const; + // Returns the list of hosts blocked by policy for |extension|. + const URLPatternSet& GetRuntimeBlockedHosts(const Extension* extension) const; + + // Returns the list of hosts |extension| is limited to by policy. + const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const; + + // Checks if a URL is on the blocked host permissions list for a specific + // extension. + bool IsBlockedHost(const Extension* extension, const GURL& url) const; + // Returns blocked permission set for |extension|. std::unique_ptr<const PermissionSet> GetBlockedPermissions( const Extension* extension) const;
diff --git a/chrome/browser/extensions/extension_management_constants.cc b/chrome/browser/extensions/extension_management_constants.cc index b86b552b..11747e58 100644 --- a/chrome/browser/extensions/extension_management_constants.cc +++ b/chrome/browser/extensions/extension_management_constants.cc
@@ -20,6 +20,9 @@ const char kBlockedPermissions[] = "blocked_permissions"; const char kAllowedPermissions[] = "allowed_permissions"; +const char kRuntimeBlockedHosts[] = "runtime_blocked_hosts"; +const char kRuntimeAllowedHosts[] = "runtime_allowed_hosts"; + const char kUpdateUrl[] = "update_url"; const char kInstallSources[] = "install_sources"; const char kAllowedTypes[] = "allowed_types";
diff --git a/chrome/browser/extensions/extension_management_constants.h b/chrome/browser/extensions/extension_management_constants.h index 39a33bf..a5485721 100644 --- a/chrome/browser/extensions/extension_management_constants.h +++ b/chrome/browser/extensions/extension_management_constants.h
@@ -25,6 +25,9 @@ extern const char kBlockedPermissions[]; extern const char kAllowedPermissions[]; +extern const char kRuntimeBlockedHosts[]; +extern const char kRuntimeAllowedHosts[]; + extern const char kUpdateUrl[]; extern const char kInstallSources[]; extern const char kAllowedTypes[];
diff --git a/chrome/browser/extensions/extension_management_internal.cc b/chrome/browser/extensions/extension_management_internal.cc index 5d317f827..a2596ae 100644 --- a/chrome/browser/extensions/extension_management_internal.cc +++ b/chrome/browser/extensions/extension_management_internal.cc
@@ -84,52 +84,64 @@ const base::ListValue* list_value = nullptr; base::string16 error; - // If applicable, inherit from global block list and remove all explicitly - // allowed permissions. - if (scope != SCOPE_DEFAULT && - dict->GetListWithoutPathExpansion(schema_constants::kAllowedPermissions, + // Set default blocked permissions, or replace with extension specific blocks. + APIPermissionSet parsed_blocked_permissions; + APIPermissionSet explicitly_allowed_permissions; + if (dict->GetListWithoutPathExpansion(schema_constants::kAllowedPermissions, &list_value)) { - // It is assumed that Parse() is already called for SCOPE_DEFAULT and - // settings specified for |this| is initialized by copying from default - // settings, including the |blocked_permissions| setting here. - // That is, |blocked_permissions| should be the default block permissions - // list settings here. - APIPermissionSet globally_blocked_permissions = blocked_permissions; - APIPermissionSet explicitly_allowed_permissions; - // Reuses code for parsing API permissions from manifest. But note that we - // only support list of strings type. if (!APIPermissionSet::ParseFromJSON( - list_value, - APIPermissionSet::kDisallowInternalPermissions, - &explicitly_allowed_permissions, - &error, - nullptr)) { - // There might be unknown permissions, warn and just ignore them; + list_value, APIPermissionSet::kDisallowInternalPermissions, + &explicitly_allowed_permissions, &error, nullptr)) { LOG(WARNING) << error; } - APIPermissionSet::Difference(globally_blocked_permissions, - explicitly_allowed_permissions, - &blocked_permissions); } - - // Then add all newly blocked permissions to the list. if (dict->GetListWithoutPathExpansion(schema_constants::kBlockedPermissions, &list_value)) { - // The |blocked_permissions| might be the result of the routines above, - // or remains the same as default block permissions settings. - APIPermissionSet permissions_to_merge_from = blocked_permissions; - APIPermissionSet permissions_parsed; if (!APIPermissionSet::ParseFromJSON( - list_value, - APIPermissionSet::kDisallowInternalPermissions, - &permissions_parsed, - &error, - nullptr)) { + list_value, APIPermissionSet::kDisallowInternalPermissions, + &parsed_blocked_permissions, &error, nullptr)) { LOG(WARNING) << error; } - APIPermissionSet::Union( - permissions_to_merge_from, permissions_parsed, &blocked_permissions); } + APIPermissionSet::Difference(parsed_blocked_permissions, + explicitly_allowed_permissions, + &blocked_permissions); + + // Parses list of Match Patterns into a URLPatternSet. + auto parse_url_pattern_set = [](const base::DictionaryValue* dict, + const char key[], URLPatternSet* out_value) { + const base::ListValue* host_list_value = nullptr; + + // Get the list of URLPatterns. + if (dict->GetListWithoutPathExpansion(key, + &host_list_value)) { + out_value->ClearPatterns(); + const int extension_scheme_mask = + URLPattern::GetValidSchemeMaskForExtensions(); + for (size_t i = 0; i < host_list_value->GetSize(); ++i) { + std::string unparsed_str; + host_list_value->GetString(i, &unparsed_str); + URLPattern pattern = URLPattern(extension_scheme_mask); + URLPattern::ParseResult parse_result = pattern.Parse(unparsed_str); + if (parse_result != URLPattern::PARSE_SUCCESS) { + LOG(WARNING) << kMalformedPreferenceWarning; + LOG(WARNING) << "Invalid URL pattern '" + unparsed_str + + "' for attribute " + key; + return false; + } + out_value->AddPattern(pattern); + } + } + return true; + }; + + if (!parse_url_pattern_set(dict, schema_constants::kRuntimeBlockedHosts, + &runtime_blocked_hosts)) + return false; + + if (!parse_url_pattern_set(dict, schema_constants::kRuntimeAllowedHosts, + &runtime_allowed_hosts)) + return false; // Parses the minimum version settings. std::string minimum_version_required_str; @@ -154,6 +166,8 @@ installation_mode = ExtensionManagement::INSTALLATION_ALLOWED; update_url.clear(); blocked_permissions.clear(); + runtime_blocked_hosts.ClearPatterns(); + runtime_allowed_hosts.ClearPatterns(); } GlobalSettings::GlobalSettings() {
diff --git a/chrome/browser/extensions/extension_management_internal.h b/chrome/browser/extensions/extension_management_internal.h index d3d63be..53e37dc 100644 --- a/chrome/browser/extensions/extension_management_internal.h +++ b/chrome/browser/extensions/extension_management_internal.h
@@ -30,12 +30,12 @@ // The settings applied to all extensions are the default settings and can be // overridden by per-extension or per-update-url settings. // There are multiple fields in this class. Unspecified fields in per-extension -// and per-update-url settings will take value from default settings (or merge -// from that, see per-field comments below for details). Unspecified fields in -// default extensions will take the default fall back value instead. +// and per-update-url settings will take the default fallback value, and do not +// inherit from default settings. // Since update URL is not directly associated to extension ID, per-extension // and per-update-url settings might be enforced at the same time, see per-field // comments below for details. +// Some features do not support per-update-url setttings. struct IndividualSettings { enum ParsingScope { // Parses the default settings. @@ -67,8 +67,9 @@ // be specified, containing the update URL for this extension. // Note that |update_url| will be ignored for INSTALLATION_ALLOWED and // INSTALLATION_BLOCKED installation mode. - // This setting will override the default settings, and unspecified - // setting will take value from default settings. + // This setting will NOT merge from the default settings. Any settings from + // the default settings that should be applied to an individual extension + // should be re-declared. // In case this setting is specified in both per-extensions and // per-update-url settings, per-extension settings will override // per-update-url settings. @@ -81,13 +82,45 @@ // permission which has been blacklisted, this extension will not be allowed // to load. And if it contains a blocked permission as optional requirement, // it will be allowed to load (of course, with permission granted from user if - // necessary), but conflicting permissions will be dropped. This setting will - // merge from the default settings, and unspecified settings will take value - // from default settings. + // necessary), but conflicting permissions will be dropped. + // This setting will NOT merge from the default settings. Any settings from + // the default settings that should be applied to an individual extension + // should be re-declared. // In case this setting is specified in both per-extensions and per-update-url // settings, both settings will be enforced. APIPermissionSet blocked_permissions; + // This setting will provide a list of hosts that are blocked for each + // extension at runtime. That is, if an extension attempts to use an API + // call which requires a host permission specified in runtime_blocked_hosts + // it will fail no matter which host permissions are declared in the + // extension manifest. This setting will NOT merge from the default settings. + // Either the default settings will be applied, or an extension specific + // setting. + // If a URL is specified in the runtime_allowed_hosts, and in the + // runtime_blocked_hosts, the runtime_allowed_hosts wins and the call will be + // allowed. + // This setting is only supported per-extensions or default + // (per-update-url not supported) + URLPatternSet runtime_blocked_hosts; + + // This setting will provide a list of hosts that are exempted from the + // runtime_blocked_hosts setting and may be used at runtime. That is, + // if an extension attempts to use an API call which requires a host + // permission that was blocked using runtime_blocked_hosts it will + // fail unless also declared here. + // A generic pattern may be declared in runtime_blocked_hosts and a + // more specific pattern declared here. For example, if we block + // "*://*.example.com/*" with runtime_blocked_hosts we can then + // allow "http://good.example.com/*" in runtime_allowed_hosts. + // This setting will NOT merge from the default settings. Either the + // default settings will be applied, or an extension specific setting. + // If a URL is specified in runtime_blocked_hosts, and in + // runtime_allowed_hosts, the allowed list wins. + // This setting is only supported per-extensions or default + // (per-update-url not supported) + URLPatternSet runtime_allowed_hosts; + // Minimum version required for an extensions, applies to per-extension // settings only. Extension (with specified extension ID) with version older // than the specified minimum version will be disabled.
diff --git a/chrome/browser/extensions/extension_management_test_util.cc b/chrome/browser/extensions/extension_management_test_util.cc index 7733efe..cd2c3a5 100644 --- a/chrome/browser/extensions/extension_management_test_util.cc +++ b/chrome/browser/extensions/extension_management_test_util.cc
@@ -161,6 +161,34 @@ permission); } +// Helper functions for 'runtime_blocked_hosts' manipulation ------------------ + +void ExtensionManagementPrefUpdaterBase::UnsetRuntimeBlockedHosts( + const std::string& prefix) { + DCHECK(prefix == schema::kWildcard || crx_file::id_util::IdIsValid(prefix)); + pref_->Remove(make_path(prefix, schema::kRuntimeBlockedHosts), nullptr); +} + +void ExtensionManagementPrefUpdaterBase::ClearRuntimeBlockedHosts( + const std::string& prefix) { + DCHECK(prefix == schema::kWildcard || crx_file::id_util::IdIsValid(prefix)); + ClearList(make_path(prefix, schema::kRuntimeBlockedHosts)); +} + +void ExtensionManagementPrefUpdaterBase::AddRuntimeBlockedHost( + const std::string& prefix, + const std::string& host) { + DCHECK(prefix == schema::kWildcard || crx_file::id_util::IdIsValid(prefix)); + AddStringToList(make_path(prefix, schema::kRuntimeBlockedHosts), host); +} + +void ExtensionManagementPrefUpdaterBase::RemoveRuntimeBlockedHost( + const std::string& prefix, + const std::string& host) { + DCHECK(prefix == schema::kWildcard || crx_file::id_util::IdIsValid(prefix)); + RemoveStringFromList(make_path(prefix, schema::kRuntimeBlockedHosts), host); +} + // Helper functions for 'allowed_permissions' manipulation --------------------- void ExtensionManagementPrefUpdaterBase::UnsetAllowedPermissions(
diff --git a/chrome/browser/extensions/extension_management_test_util.h b/chrome/browser/extensions/extension_management_test_util.h index 30b1cd1..f339c293 100644 --- a/chrome/browser/extensions/extension_management_test_util.h +++ b/chrome/browser/extensions/extension_management_test_util.h
@@ -61,6 +61,15 @@ void RemoveBlockedPermission(const std::string& prefix, const std::string& permission); + // Helper functions for 'runtime_blocked_hosts' manipulation. |prefix| can be + // kWildCard or a valid extension ID. + void UnsetRuntimeBlockedHosts(const std::string& prefix); + void ClearRuntimeBlockedHosts(const std::string& prefix); + void AddRuntimeBlockedHost(const std::string& prefix, + const std::string& host); + void RemoveRuntimeBlockedHost(const std::string& prefix, + const std::string& host); + // Helper functions for 'allowed_permissions' manipulation. |id| must be a // valid extension ID. void UnsetAllowedPermissions(const std::string& id);
diff --git a/chrome/browser/extensions/extension_management_unittest.cc b/chrome/browser/extensions/extension_management_unittest.cc index a5a65c8..37b3362 100644 --- a/chrome/browser/extensions/extension_management_unittest.cc +++ b/chrome/browser/extensions/extension_management_unittest.cc
@@ -43,33 +43,40 @@ "{" " \"abcdefghijklmnopabcdefghijklmnop\": {" // kTargetExtension " \"installation_mode\": \"allowed\"," - " \"blocked_permissions\": [\"fileSystem\", \"bookmarks\"]," + " \"blocked_permissions\": [\"fileSystem\", " + " \"bookmarks\", " + " \"downloads\"]," " \"minimum_version_required\": \"1.1.0\"," + " \"runtime_allowed_hosts\": [\"<all_urls>\"]," " }," " \"bcdefghijklmnopabcdefghijklmnopa\": {" // kTargetExtension2 " \"installation_mode\": \"force_installed\"," " \"update_url\": \"http://example.com/update_url\"," - " \"allowed_permissions\": [\"fileSystem\", \"bookmarks\"]," + " \"blocked_permissions\": [\"downloads\"]," " }," " \"cdefghijklmnopabcdefghijklmnopab\": {" // kTargetExtension3 " \"installation_mode\": \"normal_installed\"," " \"update_url\": \"http://example.com/update_url\"," - " \"allowed_permissions\": [\"fileSystem\", \"downloads\"]," " \"blocked_permissions\": [\"fileSystem\", \"history\"]," " }," " \"defghijklmnopabcdefghijklmnopabc\": {" // kTargetExtension4 " \"installation_mode\": \"blocked\"," + " \"runtime_blocked_hosts\": [\"*://*.foo.com/*\", " + "\"https://bar.org/test\"]," + " }," + " \"jdkrmdirkjskemfioeesiofoielsmroi\": {" // kTargetExtension5 + " \"installation_mode\": \"normal_installed\"," " }," " \"update_url:http://example.com/update_url\": {" // kExampleUpdateUrl " \"installation_mode\": \"allowed\"," - " \"allowed_permissions\": [\"downloads\"]," - " \"blocked_permissions\": [\"bookmarks\"]," + " \"blocked_permissions\": [\"fileSystem\", \"bookmarks\"]," " }," " \"*\": {" " \"installation_mode\": \"blocked\"," " \"install_sources\": [\"*://foo.com/*\"]," " \"allowed_types\": [\"theme\", \"user_script\"]," " \"blocked_permissions\": [\"fileSystem\", \"downloads\"]," + " \"runtime_blocked_hosts\": [\"*://*.example.com/default*\"]," " }," "}"; @@ -171,6 +178,14 @@ return extension_management_->GetInstallationMode(extension.get()); } + // Wrapper of ExtensionManagement::GetRuntimeBlockedHosts, |id| is used + // to construct an Extension for testing. + URLPatternSet GetRuntimeBlockedHosts(const std::string& id) { + scoped_refptr<const Extension> extension = + CreateExtension(Manifest::UNPACKED, "0.1", id, kNonExistingUpdateUrl); + return extension_management_->GetRuntimeBlockedHosts(extension.get()); + } + // Wrapper of ExtensionManagement::GetBlockedAPIPermissions, |id| and // |update_url| are used to construct an Extension for testing. APIPermissionSet GetBlockedAPIPermissions(const std::string& id, @@ -429,6 +444,11 @@ ExtensionManagement::INSTALLATION_BLOCKED); EXPECT_EQ(GetInstallationModeByUpdateUrl(kExampleUpdateUrl), ExtensionManagement::INSTALLATION_ALLOWED); + EXPECT_TRUE(GetRuntimeBlockedHosts(kTargetExtension).is_empty()); + EXPECT_TRUE(GetRuntimeBlockedHosts(kTargetExtension4) + .MatchesURL(GURL("http://test.foo.com/test"))); + EXPECT_TRUE(GetRuntimeBlockedHosts(kTargetExtension4) + .MatchesURL(GURL("https://bar.org/test"))); // Verifies global settings. EXPECT_TRUE(ReadGlobalSettings()->has_restricted_install_sources); @@ -436,6 +456,8 @@ EXPECT_EQ(allowed_sites.size(), 1u); EXPECT_TRUE(allowed_sites.MatchesURL(GURL("http://foo.com/entry"))); EXPECT_FALSE(allowed_sites.MatchesURL(GURL("http://bar.com/entry"))); + EXPECT_TRUE(GetRuntimeBlockedHosts(kNonExistingExtension) + .MatchesURL(GURL("http://example.com/default"))); EXPECT_TRUE(ReadGlobalSettings()->has_restricted_allowed_types); const std::vector<Manifest::Type>& allowed_types =
diff --git a/chrome/browser/extensions/permissions_based_management_policy_provider_unittest.cc b/chrome/browser/extensions/permissions_based_management_policy_provider_unittest.cc index 806d14f0..da3db1f 100644 --- a/chrome/browser/extensions/permissions_based_management_policy_provider_unittest.cc +++ b/chrome/browser/extensions/permissions_based_management_policy_provider_unittest.cc
@@ -140,17 +140,17 @@ EXPECT_TRUE(provider_.UserMayLoad(extension.get(), &error16)); EXPECT_TRUE(error16.empty()); - // Explictly blocks kCookie for test extension. It should be blocked again. + // Explictly blocks kCookie for test extension. It should still be allowed. { PrefUpdater pref(pref_service_.get()); pref.AddBlockedPermission(extension->id(), GetAPIPermissionName(APIPermission::kCookie)); } error16.clear(); - EXPECT_FALSE(provider_.UserMayLoad(extension.get(), &error16)); - EXPECT_FALSE(error16.empty()); + EXPECT_TRUE(provider_.UserMayLoad(extension.get(), &error16)); + EXPECT_TRUE(error16.empty()); - // Blocks kDownloads by default. It should be blocked. + // Any extension specific definition overrides all defaults, even if blank. { PrefUpdater pref(pref_service_.get()); pref.UnsetBlockedPermissions(extension->id()); @@ -160,6 +160,19 @@ GetAPIPermissionName(APIPermission::kDownloads)); } error16.clear(); + EXPECT_TRUE(provider_.UserMayLoad(extension.get(), &error16)); + EXPECT_TRUE(error16.empty()); + + // Blocks kDownloads by default. It should be blocked. + { + PrefUpdater pref(pref_service_.get()); + pref.UnsetPerExtensionSettings(extension->id()); + pref.UnsetPerExtensionSettings(extension->id()); + pref.ClearBlockedPermissions("*"); + pref.AddBlockedPermission("*", + GetAPIPermissionName(APIPermission::kDownloads)); + } + error16.clear(); EXPECT_FALSE(provider_.UserMayLoad(extension.get(), &error16)); EXPECT_FALSE(error16.empty()); }
diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc index b0f9379..4696d13 100644 --- a/chrome/browser/first_run/try_chrome_dialog_view.cc +++ b/chrome/browser/first_run/try_chrome_dialog_view.cc
@@ -34,7 +34,7 @@ #include "ui/views/controls/separator.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_constants.h" -#include "ui/views/views_delegate.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/widget/widget.h" namespace { @@ -134,9 +134,8 @@ columns->AddPaddingColumn(0, icon_size.width()); columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, views::GridLayout::USE_PREF, 0, 0); - columns->AddPaddingColumn( - 0, views::ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_BUTTON_HORIZONTAL)); + columns->AddPaddingColumn(0, views::LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_BUTTON_HORIZONTAL)); columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 0, views::GridLayout::USE_PREF, 0, 0);
diff --git a/chrome/browser/installable/installable_logging.cc b/chrome/browser/installable/installable_logging.cc index 926dd2a..00903a71 100644 --- a/chrome/browser/installable/installable_logging.cc +++ b/chrome/browser/installable/installable_logging.cc
@@ -50,9 +50,9 @@ "a %spx square icon is required, but no supplied icon meets this " "requirement"; static const char kCannotDownloadIconMessage[] = - "could not download the specified icon"; + "could not download a required icon from the manifest"; static const char kNoIconAvailableMessage[] = - "no icon available to display"; + "icon downloaded from the manifest was empty or corrupted"; static const char kPlatformNotSupportedOnAndroidMessage[] = "the specified application platform is not supported on Android"; static const char kNoIdSpecifiedMessage[] =
diff --git a/chrome/browser/installable/installable_manager.cc b/chrome/browser/installable/installable_manager.cc index 16f73b2e..0fbb0af 100644 --- a/chrome/browser/installable/installable_manager.cc +++ b/chrome/browser/installable/installable_manager.cc
@@ -230,7 +230,16 @@ return icon.error; } - // Do not report badge icon's error because badge icon is optional. + if (params.fetch_valid_badge_icon) { + IconProperty& icon = icons_[ParamsForBadgeIcon(params)]; + + // If the error is NO_ACCEPTABLE_ICON, there is no icon suitable as a badge + // in the manifest. Ignore this case since we only want to fail the check if + // there was a suitable badge icon specified and we couldn't fetch it. + if (icon.error != NO_ERROR_DETECTED && icon.error != NO_ACCEPTABLE_ICON) + return icon.error; + } + return NO_ERROR_DETECTED; }
diff --git a/chrome/browser/installable/installable_manager_browsertest.cc b/chrome/browser/installable/installable_manager_browsertest.cc index 4ddc397..06c2938 100644 --- a/chrome/browser/installable/installable_manager_browsertest.cc +++ b/chrome/browser/installable/installable_manager_browsertest.cc
@@ -480,6 +480,31 @@ EXPECT_EQ(NO_ERROR_DETECTED, tester->error_code()); EXPECT_EQ(GetStatus(), InstallabilityCheckStatus::NOT_STARTED); } + + // Navigate to a page with a bad badge icon. This should now fail with + // NO_ICON_AVAILABLE, but still have the manifest and primary icon. + { + base::RunLoop run_loop; + std::unique_ptr<CallbackTester> tester( + new CallbackTester(run_loop.QuitClosure())); + + NavigateAndRunInstallableManager(tester.get(), + GetPrimaryIconAndBadgeIconParams(), + GetURLOfPageWithServiceWorkerAndManifest( + "/banners/manifest_bad_badge.json")); + run_loop.Run(); + + EXPECT_FALSE(tester->manifest().IsEmpty()); + EXPECT_FALSE(tester->manifest_url().is_empty()); + + EXPECT_FALSE(tester->primary_icon_url().is_empty()); + EXPECT_NE(nullptr, tester->primary_icon()); + EXPECT_TRUE(tester->badge_icon_url().is_empty()); + EXPECT_EQ(nullptr, tester->badge_icon()); + EXPECT_FALSE(tester->is_installable()); + EXPECT_EQ(NO_ICON_AVAILABLE, tester->error_code()); + EXPECT_EQ(GetStatus(), InstallabilityCheckStatus::NOT_STARTED); + } } IN_PROC_BROWSER_TEST_F(InstallableManagerBrowserTest, CheckWebapp) { @@ -745,7 +770,7 @@ new CallbackTester(run_loop.QuitClosure())); // Dial up the primary icon size requirements to something that isn't - // available. This should now fail with NoIconMatchingRequirements. + // available. This should now fail with NO_ACCEPTABLE_ICON. InstallableParams params = GetWebAppParams(); params.ideal_primary_icon_size_in_px = 2000; params.minimum_primary_icon_size_in_px = 2000; @@ -769,7 +794,7 @@ std::unique_ptr<CallbackTester> tester( new CallbackTester(run_loop.QuitClosure())); - // This should fail with NoIconMatchingRequirements. + // This should fail with NO_ACCEPTABLE_ICON. InstallableParams params = GetWebAppParams(); params.ideal_primary_icon_size_in_px = 2000; params.minimum_primary_icon_size_in_px = 2000;
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc b/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc index 6a54c097..fa5aaa6 100644 --- a/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc +++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos.cc
@@ -4,45 +4,25 @@ #include "chrome/browser/notifications/login_state_notification_blocker_chromeos.h" -#include "ash/root_window_controller.h" -#include "ash/shell.h" #include "ash/system/system_notifier.h" -#include "ash/wm/window_properties.h" -#include "chrome/browser/chrome_notification_types.h" -#include "content/public/browser/notification_service.h" -#include "ui/aura/window.h" -#include "ui/aura/window_event_dispatcher.h" +#include "components/session_manager/core/session_manager.h" #include "ui/message_center/message_center.h" +using session_manager::SessionManager; +using session_manager::SessionState; + LoginStateNotificationBlockerChromeOS::LoginStateNotificationBlockerChromeOS( message_center::MessageCenter* message_center) - : NotificationBlocker(message_center), - locked_(false), - observing_(true) { - // This class is created in the ctor of NotificationUIManager which is created - // when a notification is created, so ash::Shell should be initialized, except - // when running as a mus client (ash::Shell is not initialized when that is - // the case). - if (ash::Shell::HasInstance()) - ash::Shell::Get()->AddShellObserver(this); - - // LoginState may not exist in some tests. - if (chromeos::LoginState::IsInitialized()) - chromeos::LoginState::Get()->AddObserver(this); - chromeos::UserAddingScreen::Get()->AddObserver(this); + : NotificationBlocker(message_center) { + // SessionManager may not exist in some tests. + if (SessionManager::Get()) + SessionManager::Get()->AddObserver(this); } LoginStateNotificationBlockerChromeOS:: ~LoginStateNotificationBlockerChromeOS() { - // In some tests, the notification blockers may be removed without calling - // OnAppTerminating(). - if (chromeos::LoginState::IsInitialized()) - chromeos::LoginState::Get()->RemoveObserver(this); - if (observing_) { - if (ash::Shell::HasInstance()) - ash::Shell::Get()->RemoveShellObserver(this); - chromeos::UserAddingScreen::Get()->RemoveObserver(this); - } + if (SessionManager::Get()) + SessionManager::Get()->RemoveObserver(this); } bool LoginStateNotificationBlockerChromeOS::ShouldShowNotificationAsPopup( @@ -50,38 +30,12 @@ if (ash::system_notifier::ShouldAlwaysShowPopups(notification.notifier_id())) return true; - if (locked_) - return false; - - if (chromeos::UserAddingScreen::Get()->IsRunning()) - return false; - - if (chromeos::LoginState::IsInitialized()) - return chromeos::LoginState::Get()->IsUserLoggedIn(); + if (SessionManager::Get()) + return SessionManager::Get()->session_state() == SessionState::ACTIVE; return true; } -void LoginStateNotificationBlockerChromeOS::OnLockStateChanged(bool locked) { - locked_ = locked; - NotifyBlockingStateChanged(); -} - -void LoginStateNotificationBlockerChromeOS::OnAppTerminating() { - if (ash::Shell::HasInstance()) - ash::Shell::Get()->RemoveShellObserver(this); - chromeos::UserAddingScreen::Get()->RemoveObserver(this); - observing_ = false; -} - -void LoginStateNotificationBlockerChromeOS::LoggedInStateChanged() { - NotifyBlockingStateChanged(); -} - -void LoginStateNotificationBlockerChromeOS::OnUserAddingStarted() { - NotifyBlockingStateChanged(); -} - -void LoginStateNotificationBlockerChromeOS::OnUserAddingFinished() { +void LoginStateNotificationBlockerChromeOS::OnSessionStateChanged() { NotifyBlockingStateChanged(); }
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos.h b/chrome/browser/notifications/login_state_notification_blocker_chromeos.h index 4d24bb5..848da5b 100644 --- a/chrome/browser/notifications/login_state_notification_blocker_chromeos.h +++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos.h
@@ -5,10 +5,8 @@ #ifndef CHROME_BROWSER_NOTIFICATIONS_LOGIN_STATE_NOTIFICATION_BLOCKER_CHROMEOS_H_ #define CHROME_BROWSER_NOTIFICATIONS_LOGIN_STATE_NOTIFICATION_BLOCKER_CHROMEOS_H_ -#include "ash/shell_observer.h" #include "base/macros.h" -#include "chrome/browser/chromeos/login/ui/user_adding_screen.h" -#include "chromeos/login/login_state.h" +#include "components/session_manager/core/session_manager_observer.h" #include "ui/message_center/notification_blocker.h" // A notification blocker which checks screen lock / login state for ChromeOS. @@ -16,13 +14,12 @@ // - ScreenLockNotificationBlocker only cares about lock status but ChromeOS // needs to care about login-screen. // - ScreenLockNotificationBlocker needs a timer to check the screen lock state -// periodically, but ash::ShellObserver gets the events directly in ChromeOS. +// periodically, but SessionManagerObserver gets the events directly in +// ChromeOS. // - In ChromeOS, some system notifications are allowed to be shown as popups. class LoginStateNotificationBlockerChromeOS : public message_center::NotificationBlocker, - public ash::ShellObserver, - public chromeos::LoginState::Observer, - public chromeos::UserAddingScreen::Observer { + public session_manager::SessionManagerObserver { public: explicit LoginStateNotificationBlockerChromeOS( message_center::MessageCenter* message_center); @@ -33,19 +30,8 @@ bool ShouldShowNotificationAsPopup( const message_center::Notification& notification) const override; - // ash::ShellObserver overrides: - void OnLockStateChanged(bool locked) override; - void OnAppTerminating() override; - - // chromeos::LoginState::Observer overrides: - void LoggedInStateChanged() override; - - // chromeos::UserAddingScreen::Observer overrides: - void OnUserAddingStarted() override; - void OnUserAddingFinished() override; - - bool locked_; - bool observing_; + // session_manager::SessionManagerObserver overrides: + void OnSessionStateChanged() override; DISALLOW_COPY_AND_ASSIGN(LoginStateNotificationBlockerChromeOS); };
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc b/chrome/browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc index 0fa930da..73a66e6 100644 --- a/chrome/browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc +++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos_browsertest.cc
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/shell.h" #include "ash/system/system_notifier.h" #include "base/command_line.h" #include "base/macros.h" @@ -65,11 +64,6 @@ state_changed_count_(0) {} ~LoginStateNotificationBlockerChromeOSBrowserTest() override {} - void SetUpOnMainThread() override { - chromeos::LoginState::Get()->set_always_logged_in(false); - chromeos::LoginManagerTest::SetUpOnMainThread(); - } - void TearDownOnMainThread() override { if (blocker_) blocker_->RemoveObserver(this); @@ -128,7 +122,9 @@ // Logged in as a normal user. LoginUser(kTestUsers[0]); - EXPECT_EQ(1, GetStateChangedCountAndReset()); + // Two session state changes for login: + // LOGIN_PRIMARY -> LOGGED_IN_NOT_ACTIVE -> ACTIVE. + EXPECT_EQ(2, GetStateChangedCountAndReset()); EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); // Multi-login user switch. @@ -164,7 +160,9 @@ // Logged in as a normal user. LoginUser(kTestUsers[0]); - EXPECT_EQ(1, GetStateChangedCountAndReset()); + // Two session state changes for login: + // LOGIN_PRIMARY -> LOGGED_IN_NOT_ACTIVE -> ACTIVE. + EXPECT_EQ(2, GetStateChangedCountAndReset()); EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); // Multi-login user switch.
diff --git a/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc b/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc index 76c2a7d..7c32d54d 100644 --- a/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc +++ b/chrome/browser/notifications/login_state_notification_blocker_chromeos_unittest.cc
@@ -6,17 +6,19 @@ #include <memory> -#include "ash/shell.h" #include "ash/system/system_notifier.h" #include "ash/test/ash_test_base.h" #include "base/command_line.h" #include "base/macros.h" +#include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" -#include "chromeos/login/login_state.h" +#include "components/session_manager/core/session_manager.h" #include "ui/message_center/message_center.h" #include "ui/message_center/notification.h" using base::UTF8ToUTF16; +using session_manager::SessionManager; +using session_manager::SessionState; class LoginStateNotificationBlockerChromeOSTest : public ash::test::AshTestBase, @@ -28,8 +30,9 @@ // ash::tests::AshTestBase overrides: void SetUp() override { - chromeos::LoginState::Initialize(); - chromeos::LoginState::Get()->set_always_logged_in(false); + session_manager_ = base::MakeUnique<SessionManager>(); + session_manager_->SetSessionState(SessionState::LOGIN_PRIMARY); + ash::test::AshTestBase::SetUp(); blocker_.reset(new LoginStateNotificationBlockerChromeOS( message_center::MessageCenter::Get())); @@ -40,7 +43,6 @@ blocker_->RemoveObserver(this); blocker_.reset(); ash::test::AshTestBase::TearDown(); - chromeos::LoginState::Shutdown(); } // message_center::NotificationBlocker::Observer overrides: @@ -66,14 +68,14 @@ } void SetLockedState(bool locked) { - // TODO(xiyuan): Use SessionManager and not call ash. - static_cast<ash::SessionStateObserver*>(ash::Shell::Get()) - ->LockStateChanged(locked); + SessionManager::Get()->SetSessionState(locked ? SessionState::LOCKED + : SessionState::ACTIVE); } private: int state_changed_count_; std::unique_ptr<message_center::NotificationBlocker> blocker_; + std::unique_ptr<session_manager::SessionManager> session_manager_; DISALLOW_COPY_AND_ASSIGN(LoginStateNotificationBlockerChromeOSTest); }; @@ -85,16 +87,12 @@ EXPECT_FALSE(ShouldShowNotificationAsPopup(notifier_id)); // Login screen. - chromeos::LoginState::Get()->SetLoggedInState( - chromeos::LoginState::LOGGED_IN_NONE, - chromeos::LoginState::LOGGED_IN_USER_NONE); + SessionManager::Get()->SetSessionState(SessionState::LOGIN_PRIMARY); EXPECT_EQ(0, GetStateChangedCountAndReset()); EXPECT_FALSE(ShouldShowNotificationAsPopup(notifier_id)); // Logged in as a normal user. - chromeos::LoginState::Get()->SetLoggedInState( - chromeos::LoginState::LOGGED_IN_ACTIVE, - chromeos::LoginState::LOGGED_IN_USER_REGULAR); + SessionManager::Get()->SetSessionState(SessionState::ACTIVE); EXPECT_EQ(1, GetStateChangedCountAndReset()); EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); @@ -119,16 +117,12 @@ EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); // Login screen. - chromeos::LoginState::Get()->SetLoggedInState( - chromeos::LoginState::LOGGED_IN_NONE, - chromeos::LoginState::LOGGED_IN_USER_NONE); + SessionManager::Get()->SetSessionState(SessionState::LOGIN_PRIMARY); EXPECT_EQ(0, GetStateChangedCountAndReset()); EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id)); // Logged in as a normal user. - chromeos::LoginState::Get()->SetLoggedInState( - chromeos::LoginState::LOGGED_IN_ACTIVE, - chromeos::LoginState::LOGGED_IN_USER_REGULAR); + SessionManager::Get()->SetSessionState(SessionState::ACTIVE); EXPECT_EQ(1, GetStateChangedCountAndReset()); EXPECT_TRUE(ShouldShowNotificationAsPopup(notifier_id));
diff --git a/chrome/browser/notifications/non_persistent_notification_handler.cc b/chrome/browser/notifications/non_persistent_notification_handler.cc index e40b79c..84ec780 100644 --- a/chrome/browser/notifications/non_persistent_notification_handler.cc +++ b/chrome/browser/notifications/non_persistent_notification_handler.cc
@@ -42,7 +42,6 @@ void NonPersistentNotificationHandler::RegisterNotification( const std::string& notification_id, NotificationDelegate* delegate) { - DCHECK_EQ(notifications_.count(notification_id), 0u); notifications_[notification_id] = scoped_refptr<NotificationDelegate>(delegate); }
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.mm b/chrome/browser/notifications/notification_platform_bridge_mac.mm index 291d8bc..410eed0 100644 --- a/chrome/browser/notifications/notification_platform_bridge_mac.mm +++ b/chrome/browser/notifications/notification_platform_bridge_mac.mm
@@ -182,6 +182,7 @@ [builder setTitle:base::SysUTF16ToNSString(CreateNotificationTitle(notification))]; + [builder setContextMessage:base::SysUTF16ToNSString(notification.message())]; bool requires_attribution = @@ -246,7 +247,8 @@ // Send persistent notifications to the XPC service so they // can be displayed as alerts. Chrome itself can only display // banners. - if (notification.never_timeout()) { + // Progress Notifications are always considered persistent. + if (notification.never_timeout() || notification.progress() > 0) { NSDictionary* dict = [builder buildDictionary]; [alert_dispatcher_ dispatchNotification:dict]; } else {
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm index e7bbd4d..41effda35 100644 --- a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm +++ b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm
@@ -255,15 +255,17 @@ alert_dispatcher())); bridge->Display(NotificationCommon::PERSISTENT, "notification_id", "profile_id", false, *notification); - NSArray* notifications = [notification_center() deliveredNotifications]; - EXPECT_EQ(1u, [notifications count]); + // Progress notifications are considered alerts + EXPECT_EQ(0u, [[notification_center() deliveredNotifications] count]); + NSArray* displayedAlerts = [alert_dispatcher() alerts]; + ASSERT_EQ(1u, [displayedAlerts count]); - NSUserNotification* delivered_notification = [notifications objectAtIndex:0]; + NSDictionary* deliveredNotification = [displayedAlerts objectAtIndex:0]; base::string16 expected = base::FormatPercent(kSamplePercent) + base::UTF8ToUTF16(" - Title"); EXPECT_NSEQ(base::SysUTF16ToNSString(expected), - [delivered_notification title]); + [deliveredNotification objectForKey:@"title"]); } TEST_F(NotificationPlatformBridgeMacTest, TestCloseNotification) {
diff --git a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc index ed94a38..e6b63a3 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
@@ -888,14 +888,25 @@ TEST_F(NativeBackendGnomeTest, FetchFederatedCredentialOnHTTPS) { other_auth_.signon_realm = "federation://www.example.com/google.com"; + other_auth_.origin = GURL("https://www.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_TRUE(CheckCredentialAvailability(other_auth_, GURL("https://www.example.com/"), PasswordForm::SCHEME_HTML, nullptr)); } +TEST_F(NativeBackendGnomeTest, FetchFederatedCredentialOnLocalhost) { + other_auth_.signon_realm = "federation://localhost/google.com"; + other_auth_.origin = GURL("http://localhost:8080/"); + other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); + EXPECT_TRUE(CheckCredentialAvailability(other_auth_, + GURL("http://localhost:8080/"), + PasswordForm::SCHEME_HTML, nullptr)); +} + TEST_F(NativeBackendGnomeTest, DontFetchFederatedCredentialOnHTTP) { other_auth_.signon_realm = "federation://www.example.com/google.com"; + other_auth_.origin = GURL("https://www.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_FALSE(CheckCredentialAvailability(other_auth_, GURL("http://www.example.com/"), @@ -904,6 +915,7 @@ TEST_F(NativeBackendGnomeTest, FetchPSLMatchedFederatedCredentialOnHTTPS) { other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; + other_auth_.origin = GURL("https://www.sub.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_TRUE(CheckCredentialAvailability(other_auth_, GURL("https://www.example.com/"), @@ -912,6 +924,7 @@ TEST_F(NativeBackendGnomeTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) { other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; + other_auth_.origin = GURL("https://www.sub.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_FALSE(CheckCredentialAvailability(other_auth_, GURL("http://www.example.com/"),
diff --git a/chrome/browser/password_manager/native_backend_libsecret_unittest.cc b/chrome/browser/password_manager/native_backend_libsecret_unittest.cc index 220966d8..fe5fc86 100644 --- a/chrome/browser/password_manager/native_backend_libsecret_unittest.cc +++ b/chrome/browser/password_manager/native_backend_libsecret_unittest.cc
@@ -695,14 +695,25 @@ TEST_F(NativeBackendLibsecretTest, FetchFederatedCredentialOnHTTPS) { other_auth_.signon_realm = "federation://www.example.com/google.com"; + other_auth_.origin = GURL("https://www.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_TRUE(CheckCredentialAvailability(other_auth_, GURL("https://www.example.com/"), PasswordForm::SCHEME_HTML, nullptr)); } +TEST_F(NativeBackendLibsecretTest, FetchFederatedCredentialOnLocalhost) { + other_auth_.signon_realm = "federation://localhost/google.com"; + other_auth_.origin = GURL("http://localhost:8080/"); + other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); + EXPECT_TRUE(CheckCredentialAvailability(other_auth_, + GURL("http://localhost:8080/"), + PasswordForm::SCHEME_HTML, nullptr)); +} + TEST_F(NativeBackendLibsecretTest, DontFetchFederatedCredentialOnHTTP) { other_auth_.signon_realm = "federation://www.example.com/google.com"; + other_auth_.origin = GURL("https://www.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_FALSE(CheckCredentialAvailability(other_auth_, GURL("http://www.example.com/"), @@ -711,6 +722,7 @@ TEST_F(NativeBackendLibsecretTest, FetchPSLMatchedFederatedCredentialOnHTTPS) { other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; + other_auth_.origin = GURL("https://www.sub.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_TRUE(CheckCredentialAvailability(other_auth_, GURL("https://www.example.com/"), @@ -720,6 +732,7 @@ TEST_F(NativeBackendLibsecretTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) { other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; + other_auth_.origin = GURL("https://www.sub.example.com/"); other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); EXPECT_FALSE(CheckCredentialAvailability(other_auth_, GURL("http://www.example.com/"),
diff --git a/chrome/browser/payments/DEPS b/chrome/browser/payments/DEPS new file mode 100644 index 0000000..be3cab72 --- /dev/null +++ b/chrome/browser/payments/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+third_party/libaddressinput", +]
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.cc b/chrome/browser/payments/chrome_payment_request_delegate.cc index 57604ce2..bd23df5 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.cc +++ b/chrome/browser/payments/chrome_payment_request_delegate.cc
@@ -5,11 +5,15 @@ #include "chrome/browser/payments/chrome_payment_request_delegate.h" #include "chrome/browser/autofill/personal_data_manager_factory.h" +#include "chrome/browser/autofill/validation_rules_storage_factory.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_dialogs.h" +#include "components/autofill/core/browser/personal_data_manager.h" #include "components/payments/content/payment_request_dialog.h" #include "content/public/browser/web_contents.h" +#include "third_party/libaddressinput/chromium/chrome_metadata_source.h" +#include "third_party/libaddressinput/chromium/chrome_storage_impl.h" namespace payments { @@ -58,4 +62,15 @@ dialog_->ShowCvcUnmaskPrompt(credit_card, result_delegate, web_contents_); } +std::unique_ptr<const ::i18n::addressinput::Source> +ChromePaymentRequestDelegate::GetAddressInputSource() { + return base::WrapUnique(new autofill::ChromeMetadataSource( + I18N_ADDRESS_VALIDATION_DATA_URL, + GetPersonalDataManager()->GetURLRequestContextGetter())); +} +std::unique_ptr<::i18n::addressinput::Storage> +ChromePaymentRequestDelegate::GetAddressInputStorage() { + return autofill::ValidationRulesStorageFactory::CreateStorage(); +} + } // namespace payments
diff --git a/chrome/browser/payments/chrome_payment_request_delegate.h b/chrome/browser/payments/chrome_payment_request_delegate.h index d2d6925..499958c 100644 --- a/chrome/browser/payments/chrome_payment_request_delegate.h +++ b/chrome/browser/payments/chrome_payment_request_delegate.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ #define CHROME_BROWSER_PAYMENTS_CHROME_PAYMENT_REQUEST_DELEGATE_H_ +#include <memory> #include <string> #include "base/macros.h" @@ -34,6 +35,10 @@ const autofill::CreditCard& credit_card, base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> result_delegate) override; + std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource() + override; + std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() + override; protected: // Reference to the dialog so that we can satisfy calls to CloseDialog(). This
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index f22a347..0a43bf42 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1505,14 +1505,14 @@ "views/frame/native_widget_mac_frameless_nswindow.mm", "views/global_error_bubble_view.cc", "views/global_error_bubble_view.h", + "views/harmony/chrome_layout_provider.cc", + "views/harmony/chrome_layout_provider.h", "views/harmony/chrome_typography.cc", "views/harmony/chrome_typography.h", - "views/harmony/harmony_layout_delegate.cc", - "views/harmony/harmony_layout_delegate.h", + "views/harmony/harmony_layout_provider.cc", + "views/harmony/harmony_layout_provider.h", "views/harmony/harmony_typography_provider.cc", "views/harmony/harmony_typography_provider.h", - "views/harmony/layout_delegate.cc", - "views/harmony/layout_delegate.h", "views/location_bar/location_bar_bubble_delegate_view.cc", "views/location_bar/location_bar_bubble_delegate_view.h", "views/login_handler_views.cc",
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc index 71208cbf..6ffb884 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_ash_unittest.cc
@@ -3,10 +3,13 @@ // found in the LICENSE file. #include "ash/test/ash_test_base.h" +#include "ash/test/ash_test_helper.h" +#include "ash/test/ash_test_views_delegate.h" #include "base/macros.h" #include "chrome/browser/extensions/test_extension_environment.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/test/base/testing_profile.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/widget/widget.h" @@ -26,6 +29,8 @@ // Overridden from testing::Test: void SetUp() override { ash::test::AshTestBase::SetUp(); + ash_test_helper()->test_views_delegate()->set_layout_provider( + base::MakeUnique<ChromeLayoutProvider>()); widget_ = views::DialogDelegate::CreateDialogWidget( new views::DialogDelegateView(), CurrentContext(), NULL); dialog_ = new AppInfoDialog(
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc index 57453f8..56cd08f 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/features.h" @@ -137,8 +137,8 @@ views::View* dialog_body_contents = new views::View(); dialog_body_contents->SetLayoutManager(new views::BoxLayout( views::BoxLayout::kVertical, views::kButtonHEdgeMarginNew, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN), views::kUnrelatedControlVerticalSpacing)); dialog_body_contents->AddChildView(new AppInfoSummaryPanel(profile, app)); dialog_body_contents->AddChildView(new AppInfoPermissionsPanel(profile, app));
diff --git a/chrome/browser/ui/views/arc_app_dialog_view.cc b/chrome/browser/ui/views/arc_app_dialog_view.cc index bdb73fe..0f9c1af 100644 --- a/chrome/browser/ui/views/arc_app_dialog_view.cc +++ b/chrome/browser/ui/views/arc_app_dialog_view.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" #include "chrome/browser/ui/native_window_tracker.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "components/strings/grit/components_strings.h" @@ -140,8 +140,8 @@ SetLayoutManager(new views::BoxLayout( views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN), views::kRelatedControlHorizontalSpacing)); icon_view_ = new FixedBoundarySizeImageView();
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index 0e8c261..0608c37 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -19,7 +19,7 @@ #include "chrome/browser/ui/bookmarks/bookmark_editor.h" #include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/sync/sync_promo_ui.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" @@ -187,7 +187,7 @@ // buttons at the bottom. const int cs_id = 0; ColumnSet* cs = layout->AddColumnSet(cs_id); - cs->AddColumn(LayoutDelegate::Get()->GetControlLabelGridAlignment(), + cs->AddColumn(ChromeLayoutProvider::Get()->GetControlLabelGridAlignment(), GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); cs->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc index 8753767f..654d52a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/ui/bookmarks/bookmark_utils.h" #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" #include "chrome/browser/ui/browser_dialogs.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/locale_settings.h" #include "components/bookmarks/browser/bookmark_model.h" @@ -341,19 +341,18 @@ } GridLayout* layout = GridLayout::CreatePanel(this); - LayoutDelegate* delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); const int labels_column_set_id = 0; const int single_column_view_set_id = 1; const int buttons_column_set_id = 2; views::ColumnSet* column_set = layout->AddColumnSet(labels_column_set_id); - column_set->AddColumn(delegate->GetControlLabelGridAlignment(), + column_set->AddColumn(provider->GetControlLabelGridAlignment(), GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); @@ -366,14 +365,12 @@ GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( 1, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); column_set->LinkColumnSizes(0, 2, 4, -1); @@ -392,10 +389,8 @@ url_tf_->SetAccessibleName( l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_URL_LABEL)); - layout->AddPaddingRow( - 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); layout->StartRow(0, labels_column_set_id); layout->AddView(url_label_); @@ -403,19 +398,15 @@ } if (show_tree_) { - layout->AddPaddingRow( - 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); layout->StartRow(1, single_column_view_set_id); layout->AddView(tree_view_->CreateParentIfNecessary()); } - if (delegate->UseExtraDialogPadding()) { - layout->AddPaddingRow( - 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + if (provider->UseExtraDialogPadding()) { + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } if (!show_tree_ || bb_model_->loaded())
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc index ef959af..ea7a0888 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_editor_view_unittest.cc
@@ -10,6 +10,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/test/base/testing_profile.h" #include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/test/bookmark_test_helpers.h" @@ -36,6 +37,9 @@ profile_.reset(new TestingProfile()); profile_->CreateBookmarkModel(true); + views_delegate_.set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); + model_ = BookmarkModelFactory::GetForBrowserContext(profile_.get()); bookmarks::test::WaitForBookmarkModelToLoad(model_);
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc index 4890eba..556bd75 100644 --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -9,6 +9,7 @@ #include "base/memory/ptr_util.h" #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" #include "chrome/browser/ui/views/chrome_views_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" #include "components/constrained_window/constrained_window_views.h" @@ -70,7 +71,10 @@ // The delegate needs to be set before any UI is created so that windows // display the correct icon. if (!views::ViewsDelegate::GetInstance()) - views_delegate_.reset(new ChromeViewsDelegate); + views_delegate_ = base::MakeUnique<ChromeViewsDelegate>(); + + if (!views::LayoutProvider::Get()) + layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider(); SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient());
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h index 4eb51881..7b9d92a 100644 --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "chrome/browser/chrome_browser_main_extra_parts.h" +#include "ui/views/layout/layout_provider.h" namespace ui { class InputDeviceClient; @@ -41,6 +42,7 @@ private: std::unique_ptr<views::ViewsDelegate> views_delegate_; + std::unique_ptr<views::LayoutProvider> layout_provider_; #if defined(USE_AURA) // Not created when running in ash::Config::MUS.
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc index 42f242b..3b668726 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.cc +++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -16,7 +16,6 @@ #include "chrome/browser/lifetime/scoped_keep_alive.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser_window_state.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/version_info/version_info.h" @@ -57,32 +56,15 @@ return profile->GetPrefs(); } -ChromeViewsDelegate* views_delegate = nullptr; - } // namespace // ChromeViewsDelegate -------------------------------------------------------- -#if defined(OS_WIN) -ChromeViewsDelegate::ChromeViewsDelegate() - : in_autohide_edges_callback_(false), weak_factory_(this) { -#else -ChromeViewsDelegate::ChromeViewsDelegate() { -#endif - DCHECK(!views_delegate); - views_delegate = this; -} +ChromeViewsDelegate::ChromeViewsDelegate() {} ChromeViewsDelegate::~ChromeViewsDelegate() { DCHECK_EQ(0u, ref_count_); - - DCHECK_EQ(this, views_delegate); - views_delegate = nullptr; -} - -ChromeViewsDelegate* ChromeViewsDelegate::GetInstance() { - return views_delegate; } void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, @@ -209,83 +191,6 @@ return content::BrowserThread::GetBlockingPool(); } -gfx::Insets ChromeViewsDelegate::GetInsetsMetric( - views::InsetsMetric metric) const { - const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - switch (metric) { - case views::InsetsMetric::BUBBLE_CONTENTS: - return gfx::Insets(layout_delegate->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); - case views::InsetsMetric::DIALOG_BUTTON: { - const int top = layout_delegate->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_TOP_SPACING); - const int margin = layout_delegate->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); - return gfx::Insets(top, margin, margin, margin); - } - case views::InsetsMetric::DIALOG_TITLE: { - const int top = layout_delegate->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); - const int side = layout_delegate->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); - // Titles are inset at the top and sides, but not at the bottom. - return gfx::Insets(top, side, 0, side); - } - case views::InsetsMetric::PANEL: - return gfx::Insets(layout_delegate->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), - layout_delegate->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN)); - case views::InsetsMetric::VECTOR_IMAGE_BUTTON_PADDING: - return gfx::Insets(layout_delegate->GetMetric( - LayoutDelegate::Metric::VECTOR_IMAGE_BUTTON_PADDING)); - } - NOTREACHED(); - return gfx::Insets(); -} - -int ChromeViewsDelegate::GetDistanceMetric(views::DistanceMetric metric) const { - switch (metric) { - case views::DistanceMetric::CLOSE_BUTTON_MARGIN: - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::DIALOG_CLOSE_BUTTON_MARGIN); - case views::DistanceMetric::RELATED_BUTTON_HORIZONTAL: - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING); - case views::DistanceMetric::RELATED_CONTROL_HORIZONTAL: - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING); - case views::DistanceMetric::RELATED_CONTROL_VERTICAL: - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); - case views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH: - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_MINIMUM_WIDTH); - case views::DistanceMetric::BUTTON_HORIZONTAL_PADDING: - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::BUTTON_HORIZONTAL_PADDING); - } - NOTREACHED(); - return 0; -} - -const views::TypographyProvider& ChromeViewsDelegate::GetTypographyProvider() - const { - return LayoutDelegate::Get()->GetTypographyProvider(); -} - -int ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric metric) { - return views_delegate - ? views_delegate->InternalGetDefaultDistanceMetric(metric) - : views::ViewsDelegate::GetInstance()->GetDistanceMetric(metric); -} - -int ChromeViewsDelegate::InternalGetDefaultDistanceMetric( - views::DistanceMetric metric) const { - return views::ViewsDelegate::GetDistanceMetric(metric); -} - #if !defined(OS_CHROMEOS) views::Widget::InitParams::WindowOpacity ChromeViewsDelegate::GetOpacityForInitParams(
diff --git a/chrome/browser/ui/views/chrome_views_delegate.h b/chrome/browser/ui/views/chrome_views_delegate.h index 80ad6b37..867d5b7d 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.h +++ b/chrome/browser/ui/views/chrome_views_delegate.h
@@ -20,8 +20,6 @@ ChromeViewsDelegate(); ~ChromeViewsDelegate() override; - static ChromeViewsDelegate* GetInstance(); - // views::ViewsDelegate: void SaveWindowPlacement(const views::Widget* window, const std::string& window_name, @@ -60,12 +58,6 @@ std::string GetApplicationName() override; scoped_refptr<base::TaskRunner> GetBlockingPoolTaskRunner() override; - gfx::Insets GetInsetsMetric(views::InsetsMetric metric) const override; - int GetDistanceMetric(views::DistanceMetric metric) const override; - const views::TypographyProvider& GetTypographyProvider() const override; - - static int GetDefaultDistanceMetric(views::DistanceMetric metric); - private: #if defined(OS_WIN) typedef std::map<HMONITOR, int> AppbarAutohideEdgeMap; @@ -84,8 +76,6 @@ gfx::Rect* bounds) const; #endif - int InternalGetDefaultDistanceMetric(views::DistanceMetric metric) const; - // Function to retrieve default opacity value mainly based on platform // and desktop context. views::Widget::InitParams::WindowOpacity GetOpacityForInitParams( @@ -106,9 +96,9 @@ AppbarAutohideEdgeMap appbar_autohide_edge_map_; // If true we're in the process of notifying a callback from // GetAutohideEdges().start a new query. - bool in_autohide_edges_callback_; + bool in_autohide_edges_callback_ = false; - base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_; + base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_{this}; #endif DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate);
diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc index 81e80176..ee8a34d 100644 --- a/chrome/browser/ui/views/collected_cookies_views.cc +++ b/chrome/browser/ui/views/collected_cookies_views.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" #include "chrome/browser/ui/views/cookie_info_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/locale_settings.h" @@ -71,11 +71,11 @@ // Starts a new row with the added ColumnSet. void StartNewButtonColumnSet(views::GridLayout* layout, const int column_layout_id) { - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - const int button_padding = layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING); - const int button_size_limit = layout_delegate->GetMetric( - LayoutDelegate::Metric::BUTTON_MAX_LINKABLE_WIDTH); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + const int button_padding = + provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL); + const int button_size_limit = + provider->GetDistanceMetric(DISTANCE_BUTTON_MAX_LINKABLE_WIDTH); views::ColumnSet* column_set = layout->AddColumnSet(column_layout_id); column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 0, @@ -291,8 +291,8 @@ } gfx::Size CollectedCookiesViews::GetPreferredSize() const { - int preferred = LayoutDelegate::Get()->GetDialogPreferredWidth( - LayoutDelegate::DialogWidth::MEDIUM); + int preferred = + ChromeLayoutProvider::Get()->GetDialogPreferredWidth(DialogWidth::MEDIUM); return gfx::Size(preferred ? preferred : View::GetPreferredSize().width(), View::GetPreferredSize().height()); } @@ -316,7 +316,8 @@ using views::GridLayout; GridLayout* layout = new GridLayout(this); - if (LayoutDelegate::Get()->UseExtraDialogPadding()) + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + if (provider->UseExtraDialogPadding()) layout->SetInsets(gfx::Insets(kTabbedPaneTopPadding, 0, 0, 0)); SetLayoutManager(layout); @@ -338,17 +339,15 @@ tabbed_pane->AddTab(label_blocked, CreateBlockedPane()); tabbed_pane->SelectTabAt(0); tabbed_pane->set_listener(this); - if (LayoutDelegate::Get()->UseExtraDialogPadding()) { - layout->AddPaddingRow( - 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + if (ChromeLayoutProvider::Get()->UseExtraDialogPadding()) { + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } layout->StartRow(0, single_column_layout_id); cookie_info_view_ = new CookieInfoView(); layout->AddView(cookie_info_view_); - if (LayoutDelegate::Get()->UseExtraDialogPadding()) + if (provider->UseExtraDialogPadding()) layout->AddPaddingRow(0, kCookieInfoBottomPadding); layout->StartRow(0, single_column_layout_id); @@ -389,6 +388,9 @@ views::View* pane = new views::View(); GridLayout* layout = GridLayout::CreatePanel(pane); + int unrelated_vertical_distance = + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_UNRELATED_CONTROL_VERTICAL); const int single_column_layout_id = 0; views::ColumnSet* column_set = layout->AddColumnSet(single_column_layout_id); @@ -397,18 +399,13 @@ layout->StartRow(0, single_column_layout_id); layout->AddView(allowed_label_); - layout->AddPaddingRow( - 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, unrelated_vertical_distance); layout->StartRow(1, single_column_layout_id); layout->AddView(CreateScrollView(allowed_cookies_tree_), 1, 1, GridLayout::FILL, GridLayout::FILL, kTreeViewWidth, kTreeViewHeight); - layout->AddPaddingRow( - 0, LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, unrelated_vertical_distance); StartNewButtonColumnSet(layout, single_column_layout_id + 1); layout->AddView(block_allowed_button_); @@ -455,6 +452,9 @@ views::View* pane = new views::View(); GridLayout* layout = GridLayout::CreatePanel(pane); + int unrelated_vertical_distance = + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_UNRELATED_CONTROL_VERTICAL); const int single_column_layout_id = 0; views::ColumnSet* column_set = layout->AddColumnSet(single_column_layout_id); @@ -463,18 +463,13 @@ layout->StartRow(0, single_column_layout_id); layout->AddView(blocked_label_, 1, 1, GridLayout::FILL, GridLayout::FILL); - layout->AddPaddingRow( - 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, unrelated_vertical_distance); layout->StartRow(1, single_column_layout_id); layout->AddView( CreateScrollView(blocked_cookies_tree_), 1, 1, GridLayout::FILL, GridLayout::FILL, kTreeViewWidth, kTreeViewHeight); - layout->AddPaddingRow( - 0, LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, unrelated_vertical_distance); StartNewButtonColumnSet(layout, single_column_layout_id + 1); layout->AddView(allow_blocked_button_);
diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 5e4b044..f6bcb96 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc
@@ -18,8 +18,8 @@ #include "chrome/browser/plugins/plugin_metadata.h" #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" #include "chrome/browser/ui/layout_constants.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "chrome/grit/generated_resources.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/strings/grit/components_strings.h" @@ -186,8 +186,8 @@ gfx::Size ContentSettingBubbleContents::GetPreferredSize() const { gfx::Size preferred_size(views::View::GetPreferredSize()); - int preferred_width = LayoutDelegate::Get()->GetDialogPreferredWidth( - LayoutDelegate::DialogWidth::SMALL); + int preferred_width = + ChromeLayoutProvider::Get()->GetDialogPreferredWidth(DialogWidth::SMALL); if (!preferred_width) preferred_width = (!content_setting_bubble_model_->bubble_content() .domain_lists.empty() && @@ -210,13 +210,13 @@ GridLayout* layout = new views::GridLayout(this); SetLayoutManager(layout); - const LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - const int related_control_horizontal_spacing = layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING); - const int related_control_vertical_spacing = layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); - const int unrelated_control_vertical_spacing = layout_delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING); + const ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + const int related_control_horizontal_spacing = + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL); + const int related_control_vertical_spacing = + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL); + const int unrelated_control_vertical_spacing = + provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL); const int kSingleColumnSetId = 0; views::ColumnSet* column_set = layout->AddColumnSet(kSingleColumnSetId); @@ -232,7 +232,7 @@ if (!bubble_content.title.empty()) { const int title_context = - layout_delegate->IsHarmonyMode() + provider->IsHarmonyMode() ? static_cast<int>(views::style::CONTEXT_DIALOG_TITLE) : CONTEXT_BODY_TEXT_SMALL; views::Label* title_label = @@ -303,9 +303,7 @@ views::ColumnSet* indented_single_column_set = layout->AddColumnSet(indented_kSingleColumnSetId); indented_single_column_set->AddPaddingColumn( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::SUBSECTION_HORIZONTAL_INDENT)); + 0, provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT)); indented_single_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 1, GridLayout::USE_PREF, 0, 0); @@ -320,7 +318,7 @@ views::RadioButton* radio = new views::RadioButton(*i, 0); radio->SetEnabled(bubble_content.radio_group_enabled); radio->set_listener(this); - if (layout_delegate->IsHarmonyMode()) { + if (provider->IsHarmonyMode()) { std::unique_ptr<views::LabelButtonBorder> border = radio->CreateDefaultBorder(); gfx::Insets insets = border->GetInsets(); @@ -345,9 +343,7 @@ views::ColumnSet* menu_column_set = layout->AddColumnSet(kMediaMenuColumnSetId); menu_column_set->AddPaddingColumn( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::SUBSECTION_HORIZONTAL_INDENT)); + 0, provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT)); menu_column_set->AddColumn(GridLayout::LEADING, GridLayout::FILL, 0, GridLayout::USE_PREF, 0, 0); menu_column_set->AddPaddingColumn(0, related_control_horizontal_spacing); @@ -421,7 +417,7 @@ } if (!bubble_content_empty) { - if (!layout_delegate->IsHarmonyMode()) { + if (!provider->IsHarmonyMode()) { layout->AddPaddingRow(0, related_control_vertical_spacing); layout->StartRow(0, kSingleColumnSetId); layout->AddView(new views::Separator(), 1, 1, GridLayout::FILL,
diff --git a/chrome/browser/ui/views/cookie_info_view.cc b/chrome/browser/ui/views/cookie_info_view.cc index cd736fe..e0638f7 100644 --- a/chrome/browser/ui/views/cookie_info_view.cc +++ b/chrome/browser/ui/views/cookie_info_view.cc
@@ -12,7 +12,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/browsing_data/cookies_tree_model.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "net/cookies/canonical_cookie.h" #include "third_party/skia/include/core/SkColor.h" @@ -147,23 +147,20 @@ expires_value_field_ = new views::Textfield; views::GridLayout* layout = new views::GridLayout(this); - layout->SetInsets(0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN), - 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN)); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + int dialog_button_margin = + provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN); + layout->SetInsets(0, dialog_button_margin, 0, dialog_button_margin); SetLayoutManager(layout); int three_column_layout_id = 0; views::ColumnSet* column_set = layout->AddColumnSet(three_column_layout_id); - column_set->AddColumn(LayoutDelegate::Get()->GetControlLabelGridAlignment(), + column_set->AddColumn(provider->GetControlLabelGridAlignment(), views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER,
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc index 8667fee..d66e7cc4 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h" #include "chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" @@ -66,8 +66,8 @@ pane_(new views::TabbedPane()) { SetLayoutManager(new views::BoxLayout( views::BoxLayout::kVertical, views::kButtonHEdgeMarginNew, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN), views::kLabelToControlVerticalSpacing)); description_label_->SetMultiLine(true);
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc index 7238e8e0..4c3b109d 100644 --- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc +++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views_unittest.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/media/webrtc/fake_desktop_media_list.h" #include "chrome/browser/ui/views/desktop_capture/desktop_media_list_view.h" #include "chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "components/web_modal/test_web_contents_modal_dialog_host.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gmock/include/gmock/gmock.h" @@ -22,6 +23,7 @@ #include "ui/views/controls/button/checkbox.h" #include "ui/views/controls/tabbed_pane/tabbed_pane.h" #include "ui/views/test/scoped_views_test_helper.h" +#include "ui/views/test/test_views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_client_view.h" #include "ui/views/window/dialog_delegate.h" @@ -40,6 +42,8 @@ ~DesktopMediaPickerViewsTest() override {} void SetUp() override { + test_helper_.test_views_delegate()->set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); media_lists_[DesktopMediaID::TYPE_SCREEN] = new FakeDesktopMediaList(); media_lists_[DesktopMediaID::TYPE_WINDOW] = new FakeDesktopMediaList(); media_lists_[DesktopMediaID::TYPE_WEB_CONTENTS] =
diff --git a/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc b/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc index 47e050d..25037710 100644 --- a/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc +++ b/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc
@@ -7,7 +7,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_controller.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -27,11 +27,11 @@ entry_point)) { int bubble_width = ManagePasswordsBubbleView::kDesiredBubbleWidth; views::GridLayout* layout = new views::GridLayout(this); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); layout->set_minimum_size(gfx::Size(bubble_width, 0)); layout->SetInsets( 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN) + + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN) + desktop_ios_promotion::GetPromoImage( GetNativeTheme()->GetSystemColor( ui::NativeTheme::kColorId_TextfieldDefaultColor)) @@ -51,8 +51,8 @@ column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 1, views::GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( - 0, LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_BUTTON_HORIZONTAL_SPACING)); + 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL)); column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0); promotion_text_label_->SetEnabledColor(SK_ColorGRAY); @@ -61,8 +61,7 @@ layout->StartRow(0, kLabelColumnSet); layout->AddView(promotion_text_label_); layout->AddPaddingRow( - 0, LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL)); layout->StartRow(0, kDoubleButtonColumnSet); layout->AddView(send_sms_button_); layout->AddView(no_button_);
diff --git a/chrome/browser/ui/views/device_chooser_content_view.cc b/chrome/browser/ui/views/device_chooser_content_view.cc index c37bf36..6cc81fd 100644 --- a/chrome/browser/ui/views/device_chooser_content_view.cc +++ b/chrome/browser/ui/views/device_chooser_content_view.cc
@@ -7,7 +7,7 @@ #include "base/memory/ptr_util.h" #include "base/numerics/safe_conversions.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -114,8 +114,8 @@ gfx::Size DeviceChooserContentView::GetPreferredSize() const { constexpr int kHeight = 320; constexpr int kDefaultWidth = 402; - int width = LayoutDelegate::Get()->GetDialogPreferredWidth( - LayoutDelegate::DialogWidth::MEDIUM); + int width = + ChromeLayoutProvider::Get()->GetDialogPreferredWidth(DialogWidth::MEDIUM); if (!width) width = kDefaultWidth; return gfx::Size(width, kHeight);
diff --git a/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc b/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc index bbe258d4..4b67043 100644 --- a/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc +++ b/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc
@@ -8,7 +8,7 @@ #include "base/strings/string16.h" #include "base/strings/string_util.h" #include "build/build_config.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "components/strings/grit/components_strings.h" @@ -74,14 +74,13 @@ callback_(callback), open_as_window_checkbox_(nullptr), title_tf_(nullptr) { - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); // Align the contents with the dialog buttons. views::BoxLayout* layout = new views::BoxLayout( views::BoxLayout::kHorizontal, - layout_delegate->GetMetric(LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN), - layout_delegate->GetMetric(LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), - layout_delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE)); + provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN), + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN), + provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE)); layout->set_cross_axis_alignment( views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); SetLayoutManager(layout);
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc index bda54fc..59837e1 100644 --- a/chrome/browser/ui/views/extensions/chooser_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view.cc
@@ -11,7 +11,7 @@ #include "chrome/browser/extensions/chrome_extension_chooser_dialog.h" #include "chrome/browser/extensions/device_permissions_dialog_controller.h" #include "chrome/browser/ui/views/device_chooser_content_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "components/constrained_window/constrained_window_views.h" #include "components/web_modal/web_contents_modal_dialog_manager.h" #include "content/public/browser/browser_thread.h" @@ -75,11 +75,17 @@ views::DialogClientView* client = new views::DialogClientView(widget, GetContentsView()); - LayoutDelegate* delegate = LayoutDelegate::Get(); + constexpr int kMinWidth = 402; + constexpr int kMinHeight = 320; + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + int min_width = provider->GetDialogPreferredWidth(DialogWidth::MEDIUM); + if (!min_width) + min_width = kMinWidth; + client->set_minimum_size(gfx::Size(min_width, kMinHeight)); + client->set_button_row_insets(gfx::Insets( - delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING), - 0, 0, 0)); + provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL), 0, 0, + 0)); return client; } @@ -89,8 +95,8 @@ // always be true. DCHECK(ShouldUseCustomFrame()); return views::DialogDelegate::CreateDialogFrameView( - widget, gfx::Insets(LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN))); + widget, gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN))); } bool ChooserDialogView::Accept() {
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc index f63b11ca..c2e0000 100644 --- a/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc
@@ -11,6 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/chooser_controller/mock_chooser_controller.h" #include "chrome/browser/ui/views/device_chooser_content_view.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "testing/gmock/include/gmock/gmock.h" #include "ui/base/l10n/l10n_util.h" @@ -30,6 +31,8 @@ // views::ViewsTestBase: void SetUp() override { views::ViewsTestBase::SetUp(); + test_views_delegate()->set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); auto mock_chooser_controller = base::MakeUnique<MockChooserController>(); mock_chooser_controller_ = mock_chooser_controller.get(); std::unique_ptr<ChooserDialogView> chooser_dialog_view(
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index e36d5b6..0491b93 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -25,8 +25,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" @@ -86,8 +86,8 @@ // its parent. Therefore increase the indentation by one more unit to show that // it is in fact a child item (with no missing bullet) and not a sibling. int GetLeftPaddingForBulletedItems(bool parent_bulleted) { - return LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING) * + return ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_HORIZONTAL) * (parent_bulleted ? 2 : 1); } @@ -236,6 +236,7 @@ int column_set_id = 0; views::GridLayout* layout = CreateLayout(left_column_width, column_set_id); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); @@ -248,7 +249,7 @@ prompt_->AppendRatingStars(AddResourceIcon, rating); int rating_text_context, user_count_text_context; - if (LayoutDelegate::Get()->IsHarmonyMode()) { + if (provider->IsHarmonyMode()) { rating_text_context = CONTEXT_BODY_TEXT_LARGE; user_count_text_context = CONTEXT_BODY_TEXT_SMALL; } else { @@ -269,9 +270,8 @@ layout->AddView(user_count); } - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - const int vertical_padding = layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); + const int vertical_padding = + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL); if (prompt_->ShouldShowPermissions()) { layout->AddPaddingRow(0, vertical_padding); layout->StartRow(0, column_set_id); @@ -281,8 +281,7 @@ const int content_width = left_column_width + - layout_delegate->GetMetric(LayoutDelegate::Metric::PANEL_CONTENT_MARGIN) + - kIconSize; + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN) + kIconSize; // Create the scrollable view which will contain the permissions and retained // files/devices. It will span the full content width. @@ -300,7 +299,7 @@ // Pad to the very right of the dialog, so the scrollbar will be on the edge. const int button_margin = - layout_delegate->GetMetric(LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); + provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN); scrollable_column_set->AddPaddingColumn(0, button_margin); layout->StartRow(0, column_set_id); @@ -401,8 +400,8 @@ if (prompt_->GetPermissionCount(perm_type) == 0) return false; - const int vertical_padding = LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); + const int vertical_padding = ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL); layout->AddPaddingRow(0, vertical_padding); layout->StartRow(0, column_set_id); @@ -442,11 +441,11 @@ int left_column_width, int column_set_id) { container_ = new views::View(); - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); const int horizontal_margin = - layout_delegate->GetMetric(LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN); + provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN); const int bottom_margin = - layout_delegate->GetMetric(LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN); // This is views::GridLayout::CreatePanel(), but without a top or right // margin. The empty dialog title will then become the top margin, and a @@ -466,8 +465,7 @@ 0, // no fixed width left_column_width); column_set->AddPaddingColumn( - 0, layout_delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING)); + 0, provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL)); column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::LEADING, 0, // no resizing views::GridLayout::USE_PREF, @@ -652,10 +650,9 @@ void ExpandableContainerView::DetailsView::AddDetail( const base::string16& detail) { - layout_->StartRowWithPadding( - 0, 0, 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING_SMALL)); + layout_->StartRowWithPadding(0, 0, 0, + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_RELATED_CONTROL_VERTICAL_SMALL)); views::Label* detail_label = new views::Label(PrepareForDisplay(detail, false)); detail_label->SetMultiLine(true);
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc index 2873928..19a0014 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ui/singleton_tabs.h" #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/location_bar/location_icon_view.h" #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h" @@ -207,18 +207,16 @@ // or a link to configure the keybinding shortcut (if one exists). // Extra info can include a promo for signing into sync. - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); std::unique_ptr<views::BoxLayout> layout(new views::BoxLayout( views::BoxLayout::kVertical, 0, 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING))); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL))); layout->set_minimum_cross_axis_size(kRightColumnWidth); // Indent by the size of the icon. layout->set_inside_border_insets(gfx::Insets( 0, GetIconSize().width() + - layout_delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING), + provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL), 0, 0)); layout->set_cross_axis_alignment( views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc index 4a80cf6..21746f13 100644 --- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
@@ -11,7 +11,7 @@ #include "chrome/browser/extensions/extension_uninstall_dialog.h" #include "chrome/browser/ui/app_list/app_list_service.h" #include "chrome/browser/ui/native_window_tracker.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "components/strings/grit/components_strings.h" @@ -168,13 +168,12 @@ : dialog_(dialog_view), triggered_by_extension_(triggered_by_extension), report_abuse_checkbox_(nullptr) { - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); SetLayoutManager(new views::BoxLayout( views::BoxLayout::kHorizontal, - layout_delegate->GetMetric(LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN), - layout_delegate->GetMetric(LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING))); + provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN), + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN), + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL))); icon_ = new views::ImageView(); DCHECK_GE(image->width(), kIconSize); @@ -213,8 +212,8 @@ bool ExtensionUninstallDialogDelegateView::GetExtraViewPadding(int* padding) { // We want a little more padding between the "report abuse" checkbox and the // buttons. - *padding = LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE); + *padding = ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE); return true; }
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc index 970afd6..51218d08 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/locale_settings.h" #include "components/constrained_window/constrained_window_views.h" @@ -110,9 +110,9 @@ 0); // Message text. - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - const int vertical_padding = layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + const int vertical_padding = + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL); views::Label* subtext = new views::Label(controller_->GetSubtext()); subtext->SetMultiLine(true); subtext->SetHorizontalAlignment(gfx::ALIGN_LEFT); @@ -124,8 +124,8 @@ layout->AddPaddingRow(0, vertical_padding); // Scrollable area for checkboxes. - const int small_vertical_padding = LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING_SMALL); + const int small_vertical_padding = + provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_VERTICAL_SMALL); ScrollableView* scroll_container = new ScrollableView(); scroll_container->SetLayoutManager(new views::BoxLayout( views::BoxLayout::kVertical, 0, 0, small_vertical_padding)); @@ -148,8 +148,7 @@ header->SetHorizontalAlignment(gfx::ALIGN_LEFT); header->SetBorder(views::CreateEmptyBorder( vertical_padding, - layout_delegate->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN), vertical_padding, 0)); scroll_container->AddChildView(header); }
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc index 4853d07..44081bd122 100644 --- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc +++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views_unittest.cc
@@ -10,6 +10,7 @@ #include "chrome/browser/media_galleries/media_galleries_dialog_controller_mock.h" #include "chrome/browser/ui/views/extensions/media_galleries_dialog_views.h" #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "components/storage_monitor/storage_info.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/views/controls/button/checkbox.h" @@ -48,6 +49,8 @@ WillByDefault(Return(headers)); EXPECT_CALL(controller_, GetSectionEntries(_)). Times(AnyNumber()); + test_views_delegate_.set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); } void TearDown() override { @@ -61,7 +64,7 @@ private: // TODO(gbillock): Get rid of this mock; make something specialized. NiceMock<MediaGalleriesDialogControllerMock> controller_; - views::TestViewsDelegate views_delegate_; + views::TestViewsDelegate test_views_delegate_; DISALLOW_COPY_AND_ASSIGN(MediaGalleriesDialogTest); };
diff --git a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc index 0f36191..51ef7401 100644 --- a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc +++ b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/ui/views/extensions/media_gallery_checkbox_view.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/border.h" @@ -30,9 +30,9 @@ DCHECK(button_listener != NULL); SetLayoutManager( new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0)); - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); const int border_horiz_margin = - layout_delegate->GetMetric(LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); + provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN); SetBorder(views::CreateEmptyBorder( 0, border_horiz_margin, trailing_vertical_space, border_horiz_margin)); if (menu_controller) @@ -55,9 +55,7 @@ secondary_text_->SetElideBehavior(gfx::ELIDE_HEAD); secondary_text_->SetTooltipText(tooltip_text); secondary_text_->SetBorder(views::CreateEmptyBorder( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING_SMALL), + 0, provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL), 0, 0)); AddChildView(checkbox_);
diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc index 948885a..eed9dce 100644 --- a/chrome/browser/ui/views/global_error_bubble_view.cc +++ b/chrome/browser/ui/views/global_error_bubble_view.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/views/elevation_icon_setter.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/toolbar/app_menu_button.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" #include "ui/base/resource/resource_bundle.h" @@ -26,7 +26,6 @@ #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/grid_layout.h" -#include "ui/views/views_delegate.h" #include "ui/views/window/dialog_client_view.h" #if !defined(OS_MACOSX) || BUILDFLAG(MAC_VIEWS_BROWSER) @@ -90,7 +89,7 @@ } bool GlobalErrorBubbleView::ShouldShowWindowIcon() const { - return LayoutDelegate::Get()->ShouldShowWindowIcon(); + return ChromeLayoutProvider::Get()->ShouldShowWindowIcon(); } void GlobalErrorBubbleView::WindowClosing() { @@ -127,9 +126,8 @@ layout->StartRow(1, 0); layout->AddView(message_labels[i]); if (i < message_labels.size() - 1) - layout->AddPaddingRow( - 0, views::ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_CONTROL_VERTICAL)); + layout->AddPaddingRow(0, ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); } // These bubbles show at times where activation is sporadic (like at startup,
diff --git a/chrome/browser/ui/views/global_error_bubble_view_unittest.cc b/chrome/browser/ui/views/global_error_bubble_view_unittest.cc index 4c2c545..70dcb05 100644 --- a/chrome/browser/ui/views/global_error_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/global_error_bubble_view_unittest.cc
@@ -8,6 +8,7 @@ #include <vector> #include "chrome/browser/ui/global_error/global_error.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/codec/png_codec.h" @@ -87,8 +88,14 @@ nullptr, mock_global_error_with_standard_bubble_->AsWeakPtr())) {} + void SetUp() override { + testing::Test::SetUp(); + test_views_delegate_.set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); + } + protected: - views::TestViewsDelegate views_delegate_; + views::TestViewsDelegate test_views_delegate_; std::unique_ptr<StrictMock<MockGlobalErrorWithStandardBubble>> mock_global_error_with_standard_bubble_; views::View arg_view_;
diff --git a/chrome/browser/ui/views/harmony/chrome_layout_provider.cc b/chrome/browser/ui/views/harmony/chrome_layout_provider.cc new file mode 100644 index 0000000..accebc7 --- /dev/null +++ b/chrome/browser/ui/views/harmony/chrome_layout_provider.cc
@@ -0,0 +1,87 @@ +// Copyright 2017 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 "chrome/browser/ui/views/harmony/chrome_layout_provider.h" + +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "chrome/browser/ui/views/harmony/chrome_typography.h" +#include "chrome/browser/ui/views/harmony/harmony_layout_provider.h" +#include "ui/base/material_design/material_design_controller.h" +#include "ui/views/layout/layout_constants.h" + +// static +ChromeLayoutProvider* ChromeLayoutProvider::Get() { + return static_cast<ChromeLayoutProvider*>(views::LayoutProvider::Get()); +} + +// static +std::unique_ptr<views::LayoutProvider> +ChromeLayoutProvider::CreateLayoutProvider() { + return ui::MaterialDesignController::IsSecondaryUiMaterial() + ? base::MakeUnique<HarmonyLayoutProvider>() + : base::MakeUnique<ChromeLayoutProvider>(); +} + +int ChromeLayoutProvider::GetDistanceMetric(int metric) const { + switch (metric) { + case DISTANCE_BUTTON_MAX_LINKABLE_WIDTH: + return 0; + case DISTANCE_BUTTON_MINIMUM_WIDTH: + return views::kMinimumButtonWidth; + case DISTANCE_DIALOG_BUTTON_MARGIN: + return views::kButtonHEdgeMarginNew; + case DISTANCE_DIALOG_BUTTON_TOP: + return 0; + case DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL: + return views::kRelatedControlSmallHorizontalSpacing; + case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL: + return views::kRelatedControlSmallVerticalSpacing; + case DISTANCE_RELATED_LABEL_HORIZONTAL: + return views::kItemLabelSpacing; + case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: + return views::kCheckboxIndent; + case DISTANCE_PANEL_CONTENT_MARGIN: + return views::kPanelHorizMargin; + case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: + return views::kUnrelatedControlHorizontalSpacing; + case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: + return views::kUnrelatedControlLargeHorizontalSpacing; + case DISTANCE_UNRELATED_CONTROL_VERTICAL: + return views::kUnrelatedControlVerticalSpacing; + case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: + return views::kUnrelatedControlLargeVerticalSpacing; + default: + return views::LayoutProvider::GetDistanceMetric(metric); + } +} + +const views::TypographyProvider& ChromeLayoutProvider::GetTypographyProvider() + const { + // This is not a data member because then HarmonyLayoutProvider would inherit + // it, even when it provides its own. + CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); + return legacy_provider; +} + +views::GridLayout::Alignment +ChromeLayoutProvider::GetControlLabelGridAlignment() const { + return views::GridLayout::TRAILING; +} + +bool ChromeLayoutProvider::UseExtraDialogPadding() const { + return true; +} + +bool ChromeLayoutProvider::ShouldShowWindowIcon() const { + return true; +} + +bool ChromeLayoutProvider::IsHarmonyMode() const { + return false; +} + +int ChromeLayoutProvider::GetDialogPreferredWidth(DialogWidth width) const { + return 0; +}
diff --git a/chrome/browser/ui/views/harmony/chrome_layout_provider.h b/chrome/browser/ui/views/harmony/chrome_layout_provider.h new file mode 100644 index 0000000..d2168de --- /dev/null +++ b/chrome/browser/ui/views/harmony/chrome_layout_provider.h
@@ -0,0 +1,101 @@ +// Copyright 2016 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 CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ +#define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ + +#include <memory> + +#include "base/macros.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/layout_provider.h" + +enum ChromeDistanceMetric { + // The maximum width a button can have and still influence the sizes of + // other linked buttons. This allows short buttons to have linked widths + // without long buttons making things overly wide. + DISTANCE_BUTTON_MAX_LINKABLE_WIDTH = views::VIEWS_DISTANCE_END, + // Default minimum width of a button. + DISTANCE_BUTTON_MINIMUM_WIDTH, + // Margin between the edge of a dialog and the left, right, or bottom of a + // contained button. + DISTANCE_DIALOG_BUTTON_MARGIN, + // Spacing between a dialog button and the content above it. + DISTANCE_DIALOG_BUTTON_TOP, + // Horizontal or vertical margin between the edge of a panel and the + // contained content. + DISTANCE_PANEL_CONTENT_MARGIN, + // Smaller horizontal spacing between other controls that are logically + // related. + DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL, + // Smaller vertical spacing between controls that are logically related. + DISTANCE_RELATED_CONTROL_VERTICAL_SMALL, + // Horizontal spacing between an item such as an icon or checkbox and a + // label related to it. + DISTANCE_RELATED_LABEL_HORIZONTAL, + // Horizontal indent of a subsection relative to related items above, e.g. + // checkboxes below explanatory text/headings. + DISTANCE_SUBSECTION_HORIZONTAL_INDENT, + // Horizontal spacing between controls that are logically unrelated. + DISTANCE_UNRELATED_CONTROL_HORIZONTAL, + // Larger horizontal spacing between unrelated controls. + DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE, + // Vertical spacing between controls that are logically unrelated. + DISTANCE_UNRELATED_CONTROL_VERTICAL, + // Larger vertical spacing between unrelated controls. + DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE, +}; + +enum class DialogWidth { + SMALL, + MEDIUM, + LARGE, +}; + +class ChromeLayoutProvider : public views::LayoutProvider { + public: + ChromeLayoutProvider() {} + ~ChromeLayoutProvider() override {} + + static ChromeLayoutProvider* Get(); + static std::unique_ptr<views::LayoutProvider> CreateLayoutProvider(); + + int GetDistanceMetric(int metric) const override; + + const views::TypographyProvider& GetTypographyProvider() const override; + + // Returns the alignment used for control labels in a GridLayout; for example, + // in this GridLayout: + // --------------------------- + // | Label 1 Checkbox 1 | + // | Label 2 Checkbox 2 | + // --------------------------- + // This value controls the alignment used for "Label 1" and "Label 2". + virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; + + // Returns whether to use extra padding on dialogs. If this is false, content + // Views for dialogs should not insert extra padding at their own edges. + virtual bool UseExtraDialogPadding() const; + + // Returns whether to show the icon next to the title text on a dialog. + virtual bool ShouldShowWindowIcon() const; + + // DEPRECATED. Returns whether Harmony mode is enabled. + // + // Instead of using this, create a generic solution that works for all UI + // types, e.g. by adding a new LayoutDistance value that means what you need. + // + // TODO(pkasting): Fix callers and remove this. + virtual bool IsHarmonyMode() const; + + // Returns the preferred width in DIPs for a dialog of the specified |width|. + // May return 0 if the dialog has no preferred width. + virtual int GetDialogPreferredWidth(DialogWidth width) const; + + private: + DISALLOW_COPY_AND_ASSIGN(ChromeLayoutProvider); +}; + +#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc deleted file mode 100644 index 5e333acc..0000000 --- a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc +++ /dev/null
@@ -1,103 +0,0 @@ -// Copyright 2016 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 "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" - -#include "base/lazy_instance.h" -#include "base/logging.h" - -static base::LazyInstance<HarmonyLayoutDelegate>::DestructorAtExit - harmony_layout_delegate_ = LAZY_INSTANCE_INITIALIZER; - -// static -HarmonyLayoutDelegate* HarmonyLayoutDelegate::Get() { - return harmony_layout_delegate_.Pointer(); -} - -int HarmonyLayoutDelegate::GetMetric(Metric metric) const { - switch (metric) { - case Metric::BUTTON_HORIZONTAL_PADDING: - return kHarmonyLayoutUnit; - case Metric::DIALOG_BUTTON_MARGIN: - return kHarmonyLayoutUnit; - case Metric::BUTTON_MAX_LINKABLE_WIDTH: - return kHarmonyLayoutUnit * 8; - case Metric::BUTTON_MINIMUM_WIDTH: - case Metric::DIALOG_BUTTON_MINIMUM_WIDTH: - // Minimum label size plus padding. - return 2 * kHarmonyLayoutUnit + - 2 * GetMetric(Metric::BUTTON_HORIZONTAL_PADDING); - case Metric::DIALOG_BUTTON_TOP_SPACING: - return kHarmonyLayoutUnit; - case Metric::DIALOG_CLOSE_BUTTON_MARGIN: { - constexpr int kVisibleMargin = kHarmonyLayoutUnit / 2; - // The visible margin is based on the unpadded size, so to get the actual - // margin we need to subtract out the padding. - return kVisibleMargin - GetMetric(Metric::VECTOR_IMAGE_BUTTON_PADDING); - } - case Metric::PANEL_CONTENT_MARGIN: - return kHarmonyLayoutUnit; - case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: - return kHarmonyLayoutUnit / 2; - case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: - return kHarmonyLayoutUnit; - case Metric::RELATED_CONTROL_HORIZONTAL_SPACING_SMALL: - return kHarmonyLayoutUnit; - case Metric::RELATED_CONTROL_VERTICAL_SPACING: - return kHarmonyLayoutUnit / 2; - case Metric::RELATED_CONTROL_VERTICAL_SPACING_SMALL: - return kHarmonyLayoutUnit / 2; - case Metric::RELATED_LABEL_HORIZONTAL_SPACING: - return kHarmonyLayoutUnit; - case Metric::SUBSECTION_HORIZONTAL_INDENT: - return 0; - case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING: - return kHarmonyLayoutUnit; - case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE: - return kHarmonyLayoutUnit; - case Metric::UNRELATED_CONTROL_VERTICAL_SPACING: - return kHarmonyLayoutUnit; - case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE: - return kHarmonyLayoutUnit; - case Metric::VECTOR_IMAGE_BUTTON_PADDING: - return 4; - } - NOTREACHED(); - return 0; -} - -views::GridLayout::Alignment -HarmonyLayoutDelegate::GetControlLabelGridAlignment() const { - return views::GridLayout::LEADING; -} - -bool HarmonyLayoutDelegate::UseExtraDialogPadding() const { - return false; -} - -bool HarmonyLayoutDelegate::ShouldShowWindowIcon() const { - return false; -} - -bool HarmonyLayoutDelegate::IsHarmonyMode() const { - return true; -} - -int HarmonyLayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { - switch (width) { - case DialogWidth::SMALL: - return 320; - case DialogWidth::MEDIUM: - return 448; - case DialogWidth::LARGE: - return 512; - } - NOTREACHED(); - return 0; -} - -const views::TypographyProvider& HarmonyLayoutDelegate::GetTypographyProvider() - const { - return typography_provider_; -}
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_delegate.h b/chrome/browser/ui/views/harmony/harmony_layout_delegate.h deleted file mode 100644 index 3fd0907..0000000 --- a/chrome/browser/ui/views/harmony/harmony_layout_delegate.h +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2016 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 CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_ -#define CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_ - -#include "chrome/browser/ui/views/harmony/harmony_typography_provider.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" - -class HarmonyLayoutDelegate : public LayoutDelegate { - public: - // The Harmony layout unit. All distances are in terms of this unit. - static constexpr int kHarmonyLayoutUnit = 16; - - HarmonyLayoutDelegate() {} - ~HarmonyLayoutDelegate() override {} - - // Returns the singleton HarmonyLayoutDelegate instance. - static HarmonyLayoutDelegate* Get(); - - // views::LayoutDelegate: - int GetMetric(Metric metric) const override; - views::GridLayout::Alignment GetControlLabelGridAlignment() const override; - bool UseExtraDialogPadding() const override; - bool IsHarmonyMode() const override; - int GetDialogPreferredWidth(DialogWidth width) const override; - bool ShouldShowWindowIcon() const override; - const views::TypographyProvider& GetTypographyProvider() const override; - - private: - const HarmonyTypographyProvider typography_provider_; - - DISALLOW_COPY_AND_ASSIGN(HarmonyLayoutDelegate); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_DELEGATE_H_
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_provider.cc b/chrome/browser/ui/views/harmony/harmony_layout_provider.cc new file mode 100644 index 0000000..9e1c85e --- /dev/null +++ b/chrome/browser/ui/views/harmony/harmony_layout_provider.cc
@@ -0,0 +1,111 @@ +// Copyright 2017 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 "chrome/browser/ui/views/harmony/harmony_layout_provider.h" + +gfx::Insets HarmonyLayoutProvider::GetInsetsMetric(int metric) const { + DCHECK_LT(metric, views::VIEWS_INSETS_MAX); + switch (metric) { + case views::INSETS_DIALOG_BUTTON: + case views::INSETS_PANEL: + case views::INSETS_BUBBLE_CONTENTS: + return gfx::Insets(kHarmonyLayoutUnit); + case views::INSETS_DIALOG_TITLE: { + constexpr int top = kHarmonyLayoutUnit; + constexpr int side = kHarmonyLayoutUnit; + // Titles are inset at the top and sides, but not at the bottom. + return gfx::Insets(top, side, 0, side); + } + case views::INSETS_VECTOR_IMAGE_BUTTON: + return gfx::Insets(kHarmonyLayoutUnit / 4); + } + NOTREACHED(); + return gfx::Insets(); +} + +int HarmonyLayoutProvider::GetDistanceMetric(int metric) const { + DCHECK_GE(metric, views::VIEWS_INSETS_MAX); + switch (metric) { + case views::DISTANCE_CLOSE_BUTTON_MARGIN: { + constexpr int kVisibleMargin = kHarmonyLayoutUnit / 2; + // The visible margin is based on the unpadded size, so to get the actual + // margin we need to subtract out the padding. + return kVisibleMargin - kHarmonyLayoutUnit / 4; + } + case views::DISTANCE_RELATED_BUTTON_HORIZONTAL: + return kHarmonyLayoutUnit / 2; + case views::DISTANCE_RELATED_CONTROL_HORIZONTAL: + return kHarmonyLayoutUnit; + case DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL: + return kHarmonyLayoutUnit; + case views::DISTANCE_RELATED_CONTROL_VERTICAL: + return kHarmonyLayoutUnit / 2; + case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL: + return kHarmonyLayoutUnit / 2; + case DISTANCE_DIALOG_BUTTON_MARGIN: + return kHarmonyLayoutUnit; + case DISTANCE_DIALOG_BUTTON_TOP: + return kHarmonyLayoutUnit; + case views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: + case DISTANCE_BUTTON_MINIMUM_WIDTH: + // Minimum label size plus padding. + return 2 * kHarmonyLayoutUnit + + 2 * GetDistanceMetric(views::DISTANCE_BUTTON_HORIZONTAL_PADDING); + case views::DISTANCE_BUTTON_HORIZONTAL_PADDING: + return kHarmonyLayoutUnit; + case DISTANCE_BUTTON_MAX_LINKABLE_WIDTH: + return kHarmonyLayoutUnit * 8; + case DISTANCE_RELATED_LABEL_HORIZONTAL: + return kHarmonyLayoutUnit; + case DISTANCE_SUBSECTION_HORIZONTAL_INDENT: + return 0; + case DISTANCE_PANEL_CONTENT_MARGIN: + return kHarmonyLayoutUnit; + case DISTANCE_UNRELATED_CONTROL_HORIZONTAL: + return kHarmonyLayoutUnit; + case DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE: + return kHarmonyLayoutUnit; + case DISTANCE_UNRELATED_CONTROL_VERTICAL: + return kHarmonyLayoutUnit; + case DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE: + return kHarmonyLayoutUnit; + } + NOTREACHED(); + return 0; +} + +views::GridLayout::Alignment +HarmonyLayoutProvider::GetControlLabelGridAlignment() const { + return views::GridLayout::LEADING; +} + +bool HarmonyLayoutProvider::UseExtraDialogPadding() const { + return false; +} + +bool HarmonyLayoutProvider::ShouldShowWindowIcon() const { + return false; +} + +bool HarmonyLayoutProvider::IsHarmonyMode() const { + return true; +} + +int HarmonyLayoutProvider::GetDialogPreferredWidth(DialogWidth width) const { + switch (width) { + case DialogWidth::SMALL: + return 320; + case DialogWidth::MEDIUM: + return 448; + case DialogWidth::LARGE: + return 512; + } + NOTREACHED(); + return 0; +} + +const views::TypographyProvider& HarmonyLayoutProvider::GetTypographyProvider() + const { + return typography_provider_; +}
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_provider.h b/chrome/browser/ui/views/harmony/harmony_layout_provider.h new file mode 100644 index 0000000..a96c5b2e --- /dev/null +++ b/chrome/browser/ui/views/harmony/harmony_layout_provider.h
@@ -0,0 +1,35 @@ +// Copyright 2017 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 CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_PROVIDER_H_ +#define CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_PROVIDER_H_ + +#include "base/macros.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" +#include "chrome/browser/ui/views/harmony/harmony_typography_provider.h" + +class HarmonyLayoutProvider : public ChromeLayoutProvider { + public: + // The Harmony layout unit. All distances are in terms of this unit. + static constexpr int kHarmonyLayoutUnit = 16; + + HarmonyLayoutProvider() {} + ~HarmonyLayoutProvider() override {} + + gfx::Insets GetInsetsMetric(int metric) const override; + int GetDistanceMetric(int metric) const override; + views::GridLayout::Alignment GetControlLabelGridAlignment() const override; + bool UseExtraDialogPadding() const override; + bool ShouldShowWindowIcon() const override; + bool IsHarmonyMode() const override; + int GetDialogPreferredWidth(DialogWidth width) const override; + const views::TypographyProvider& GetTypographyProvider() const override; + + private: + const HarmonyTypographyProvider typography_provider_; + + DISALLOW_COPY_AND_ASSIGN(HarmonyLayoutProvider); +}; + +#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_HARMONY_LAYOUT_PROVIDER_H_
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.cc b/chrome/browser/ui/views/harmony/layout_delegate.cc deleted file mode 100644 index 71d0721..0000000 --- a/chrome/browser/ui/views/harmony/layout_delegate.cc +++ /dev/null
@@ -1,104 +0,0 @@ -// Copyright 2016 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 "chrome/browser/ui/views/harmony/layout_delegate.h" - -#include "base/lazy_instance.h" -#include "base/logging.h" -#include "chrome/browser/ui/views/chrome_views_delegate.h" -#include "chrome/browser/ui/views/harmony/chrome_typography.h" -#include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h" -#include "ui/base/material_design/material_design_controller.h" -#include "ui/views/layout/layout_constants.h" - -static base::LazyInstance<LayoutDelegate>::DestructorAtExit layout_delegate_ = - LAZY_INSTANCE_INITIALIZER; - -// static -LayoutDelegate* LayoutDelegate::Get() { - return ui::MaterialDesignController::IsSecondaryUiMaterial() - ? HarmonyLayoutDelegate::Get() - : layout_delegate_.Pointer(); -} - -int LayoutDelegate::GetMetric(Metric metric) const { - switch (metric) { - case Metric::BUTTON_HORIZONTAL_PADDING: - return ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric::BUTTON_HORIZONTAL_PADDING); - case Metric::BUTTON_MAX_LINKABLE_WIDTH: - return 0; // Buttons never expand during layout (add padding instead). - case Metric::BUTTON_MINIMUM_WIDTH: - return views::kMinimumButtonWidth; - case Metric::DIALOG_BUTTON_MARGIN: - return views::kButtonHEdgeMarginNew; - case Metric::DIALOG_BUTTON_MINIMUM_WIDTH: - return ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH); - case Metric::DIALOG_BUTTON_TOP_SPACING: - return 0; - case Metric::DIALOG_CLOSE_BUTTON_MARGIN: - return ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric::CLOSE_BUTTON_MARGIN); - case Metric::PANEL_CONTENT_MARGIN: - return views::kPanelHorizMargin; - case Metric::RELATED_BUTTON_HORIZONTAL_SPACING: - return ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric::RELATED_BUTTON_HORIZONTAL); - case Metric::RELATED_CONTROL_HORIZONTAL_SPACING: - return ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric::RELATED_CONTROL_HORIZONTAL); - case Metric::RELATED_CONTROL_HORIZONTAL_SPACING_SMALL: - return views::kRelatedControlSmallVerticalSpacing; - case Metric::RELATED_CONTROL_VERTICAL_SPACING: - return ChromeViewsDelegate::GetDefaultDistanceMetric( - views::DistanceMetric::RELATED_CONTROL_VERTICAL); - case Metric::RELATED_CONTROL_VERTICAL_SPACING_SMALL: - return views::kRelatedControlSmallVerticalSpacing; - case Metric::RELATED_LABEL_HORIZONTAL_SPACING: - return views::kItemLabelSpacing; - case Metric::SUBSECTION_HORIZONTAL_INDENT: - return views::kCheckboxIndent; - case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING: - return views::kUnrelatedControlHorizontalSpacing; - case Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE: - return views::kUnrelatedControlLargeHorizontalSpacing; - case Metric::UNRELATED_CONTROL_VERTICAL_SPACING: - return views::kUnrelatedControlVerticalSpacing; - case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE: - return views::kUnrelatedControlLargeVerticalSpacing; - case Metric::VECTOR_IMAGE_BUTTON_PADDING: - return views::kVectorButtonExtraTouchSize; - } - NOTREACHED(); - return 0; -} - -views::GridLayout::Alignment LayoutDelegate::GetControlLabelGridAlignment() - const { - return views::GridLayout::TRAILING; -} - -bool LayoutDelegate::UseExtraDialogPadding() const { - return true; -} - -bool LayoutDelegate::ShouldShowWindowIcon() const { - return true; -} - -bool LayoutDelegate::IsHarmonyMode() const { - return false; -} - -int LayoutDelegate::GetDialogPreferredWidth(DialogWidth width) const { - return 0; -} - -const views::TypographyProvider& LayoutDelegate::GetTypographyProvider() const { - // This is not a data member because then HarmonyLayoutDelegate would inherit - // it, even when it provides its own. - CR_DEFINE_STATIC_LOCAL(LegacyTypographyProvider, legacy_provider, ()); - return legacy_provider; -}
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.h b/chrome/browser/ui/views/harmony/layout_delegate.h deleted file mode 100644 index f0ad07d..0000000 --- a/chrome/browser/ui/views/harmony/layout_delegate.h +++ /dev/null
@@ -1,122 +0,0 @@ -// Copyright 2016 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 CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ -#define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ - -#include "ui/views/layout/grid_layout.h" - -namespace views { -class TypographyProvider; -} - -class LayoutDelegate { - public: - enum class Metric { - // Padding on the left and right side of a button's label. - BUTTON_HORIZONTAL_PADDING, - // The maximum width a button can have and still influence the sizes of - // other linked buttons. This allows short buttons to have linked widths - // without long buttons making things overly wide. - BUTTON_MAX_LINKABLE_WIDTH, - // Default minimum width of a button. - BUTTON_MINIMUM_WIDTH, - // Margin between the edge of a dialog and the left, right, or bottom of a - // contained button. - DIALOG_BUTTON_MARGIN, - // Minimum width of a dialog button. - DIALOG_BUTTON_MINIMUM_WIDTH, - // Spacing between a dialog button and the content above it. - DIALOG_BUTTON_TOP_SPACING, - // Horizontal or vertical margin between the edge of a dialog and the close - // button in the upper trailing corner. - DIALOG_CLOSE_BUTTON_MARGIN, - // Horizontal or vertical margin between the edge of a panel and the - // contained content. - PANEL_CONTENT_MARGIN, - // Horizontal spacing between buttons that are logically related, e.g. - // for a button set. - RELATED_BUTTON_HORIZONTAL_SPACING, - // Horizontal spacing between other controls that are logically related. - RELATED_CONTROL_HORIZONTAL_SPACING, - // Smaller horizontal spacing between other controls that are logically - // related. - RELATED_CONTROL_HORIZONTAL_SPACING_SMALL, - // Vertical spacing between controls that are logically related. - RELATED_CONTROL_VERTICAL_SPACING, - // Smaller vertical spacing between controls that are logically related. - RELATED_CONTROL_VERTICAL_SPACING_SMALL, - // Horizontal spacing between an item such as an icon or checkbox and a - // label related to it. - RELATED_LABEL_HORIZONTAL_SPACING, - // Horizontal indent of a subsection relative to related items above, e.g. - // checkboxes below explanatory text/headings. - SUBSECTION_HORIZONTAL_INDENT, - // Horizontal spacing between controls that are logically unrelated. - UNRELATED_CONTROL_HORIZONTAL_SPACING, - // Larger horizontal spacing between unrelated controls. - UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE, - // Vertical spacing between controls that are logically unrelated. - UNRELATED_CONTROL_VERTICAL_SPACING, - // Larger vertical spacing between unrelated controls. - UNRELATED_CONTROL_VERTICAL_SPACING_LARGE, - // Padding to add to vector image buttons to increase their click and touch - // target size. - VECTOR_IMAGE_BUTTON_PADDING, - }; - - enum class DialogWidth { - SMALL, - MEDIUM, - LARGE, - }; - - LayoutDelegate() {} - virtual ~LayoutDelegate() {} - - // Returns the active LayoutDelegate singleton, depending on UI configuration. - // This may be an instance of this class or a subclass, e.g. a - // HarmonyLayoutDelegate. - static LayoutDelegate* Get(); - - // Returns the requested metric in DIPs. - virtual int GetMetric(Metric metric) const; - - // Returns the alignment used for control labels in a GridLayout; for example, - // in this GridLayout: - // --------------------------- - // | Label 1 Checkbox 1 | - // | Label 2 Checkbox 2 | - // --------------------------- - // This value controls the alignment used for "Label 1" and "Label 2". - virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; - - // Returns whether to use extra padding on dialogs. If this is false, content - // Views for dialogs should not insert extra padding at their own edges. - virtual bool UseExtraDialogPadding() const; - - // Returns whether to show the icon next to the title text on a dialog. - virtual bool ShouldShowWindowIcon() const; - - // DEPRECATED. Returns whether Harmony mode is enabled. - // - // Instead of using this, create a generic solution that works for all UI - // types, e.g. by adding a new LayoutDistance value that means what you need. - // - // TODO(pkasting): Fix callers and remove this. - virtual bool IsHarmonyMode() const; - - // Returns the preferred width in DIPs for a dialog of the specified |width|. - // May return 0 if the dialog has no preferred width. - virtual int GetDialogPreferredWidth(DialogWidth width) const; - - // Returns the class that maps views::style values (TextContext and TextStyle) - // to specific font properties (e.g. typeface, size, color, line spacing). - virtual const views::TypographyProvider& GetTypographyProvider() const; - - private: - DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
diff --git a/chrome/browser/ui/views/harmony/layout_delegate_unittest.cc b/chrome/browser/ui/views/harmony/layout_provider_unittest.cc similarity index 94% rename from chrome/browser/ui/views/harmony/layout_delegate_unittest.cc rename to chrome/browser/ui/views/harmony/layout_provider_unittest.cc index a265ae7d..aaa4ab2 100644 --- a/chrome/browser/ui/views/harmony/layout_delegate_unittest.cc +++ b/chrome/browser/ui/views/harmony/layout_provider_unittest.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 "chrome/browser/ui/views/chrome_views_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/default_style.h" @@ -20,7 +20,7 @@ // these tests ever fail it probably means something in the old UI will have // changed by mistake. // Disabled since this relies on machine configuration. http://crbug.com/701241. -TEST(LayoutDelegateTest, DISABLED_LegacyFontSizeConstants) { +TEST(LayoutProviderTest, DISABLED_LegacyFontSizeConstants) { ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); gfx::FontList label_font = rb.GetFontListWithDelta(ui::kLabelFontSizeDelta); @@ -108,7 +108,7 @@ // TypographyProvider must add 4 instead. We do this so that Chrome adapts // correctly to _non-standard_ system font configurations on user machines. // Disabled since this relies on machine configuration. http://crbug.com/701241. -TEST(LayoutDelegateTest, DISABLED_RequestFontBySize) { +TEST(LayoutProviderTest, DISABLED_RequestFontBySize) { #if defined(OS_MACOSX) constexpr int kBase = 13; #else @@ -188,13 +188,14 @@ // to the "base" font in the manner that legacy toolkit-views code expects. This // reads the base font configuration at runtime, and only tests font sizes, so // should be robust against platform changes. -TEST(LayoutDelegateTest, FontSizeRelativeToBase) { +TEST(LayoutProviderTest, FontSizeRelativeToBase) { using views::style::GetFont; constexpr int kStyle = views::style::STYLE_PRIMARY; - // Typography described in chrome_typography.h requires a ChromeViewsDelegate. - ChromeViewsDelegate views_delegate; + // Typography described in chrome_typography.h requires a + // ChromeLayoutProvider. + ChromeLayoutProvider layout_provider; // Legacy code measures everything relative to a default-constructed FontList. // On Mac, subtract one since that is 13pt instead of 12pt. @@ -236,7 +237,7 @@ // configuration. Generally, for a particular platform configuration, there // should be a consistent increase in line height when compared to the height of // a given font. -TEST(LayoutDelegateTest, TypographyLineHeight) { +TEST(LayoutProviderTest, TypographyLineHeight) { constexpr int kStyle = views::style::STYLE_PRIMARY; // Only MD overrides the default line spacing. @@ -244,7 +245,8 @@ ui::MaterialDesignController::MATERIAL_NORMAL); md_test_api.SetSecondaryUiMaterial(true); - ChromeViewsDelegate views_delegate; + std::unique_ptr<views::LayoutProvider> layout_provider = + ChromeLayoutProvider::CreateLayoutProvider(); constexpr struct { int context;
diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 76180b9..d08f1e8a 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc
@@ -14,7 +14,7 @@ #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" #include "chrome/browser/ui/tab_contents/core_tab_helper.h" #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/crash_keys.h" #include "chrome/common/logging_chrome.h" @@ -422,7 +422,7 @@ using views::ColumnSet; GridLayout* layout = GridLayout::CreatePanel(this); - LayoutDelegate* delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); const int double_column_set_id = 0; ColumnSet* column_set = layout->AddColumnSet(double_column_set_id); @@ -430,8 +430,7 @@ GridLayout::FIXED, frozen_icon_->width(), 0); column_set->AddPaddingColumn( 0, - delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_HORIZONTAL_SPACING_LARGE)); + provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE)); column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, GridLayout::USE_PREF, 0, 0); @@ -443,8 +442,7 @@ info_label_, 1, 1, GridLayout::FILL, GridLayout::LEADING, 1, 0); layout->AddPaddingRow( - 0, delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); layout->StartRow(1, double_column_set_id); layout->SkipColumns(1);
diff --git a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc index 71392b59..9ead0c6 100644 --- a/chrome/browser/ui/views/importer/import_lock_dialog_view.cc +++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.cc
@@ -11,7 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" #include "chrome/browser/importer/importer_lock_dialog.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/locale_settings.h" @@ -62,8 +62,8 @@ void ImportLockDialogView::Layout() { gfx::Rect bounds(GetLocalBounds()); bounds.Inset(views::kButtonHEdgeMarginNew, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN)); + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN)); description_label_->SetBoundsRect(bounds); }
diff --git a/chrome/browser/ui/views/login_view.cc b/chrome/browser/ui/views/login_view.cc index a638b70..f77b16a 100644 --- a/chrome/browser/ui/views/login_view.cc +++ b/chrome/browser/ui/views/login_view.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/ui/views/login_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/controls/label.h" @@ -32,7 +32,7 @@ authority_label_(new views::Label(authority)), message_label_(nullptr), login_model_(login_model_data ? login_model_data->model : nullptr) { - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); authority_label_->SetMultiLine(true); @@ -53,17 +53,16 @@ // Add the column set for the user name and password fields and labels. const int labels_column_set_id = 1; column_set = layout->AddColumnSet(labels_column_set_id); - if (layout_delegate->UseExtraDialogPadding()) + if (provider->UseExtraDialogPadding()) column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing); - column_set->AddColumn(layout_delegate->GetControlLabelGridAlignment(), + column_set->AddColumn(provider->GetControlLabelGridAlignment(), GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn( 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING)); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); - if (layout_delegate->UseExtraDialogPadding()) + if (provider->UseExtraDialogPadding()) column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing); layout->StartRow(0, single_column_view_set_id); @@ -73,37 +72,29 @@ message_label_->SetMultiLine(true); message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); message_label_->SetAllowCharacterBreak(true); - layout->AddPaddingRow( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); layout->StartRow(0, single_column_view_set_id); layout->AddView(message_label_); } - layout->AddPaddingRow( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE)); + layout->AddPaddingRow(0, provider->GetDistanceMetric( + DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE)); layout->StartRow(0, labels_column_set_id); layout->AddView(username_label_); layout->AddView(username_field_); layout->AddPaddingRow( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)); layout->StartRow(0, labels_column_set_id); layout->AddView(password_label_); layout->AddView(password_field_); - if (layout_delegate->UseExtraDialogPadding()) { + if (provider->UseExtraDialogPadding()) { layout->AddPaddingRow( - 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::UNRELATED_CONTROL_VERTICAL_SPACING)); + 0, provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL)); } if (login_model_data) {
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc index 193734a..2281bca 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
@@ -23,8 +23,8 @@ #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/page_info/page_info.h" #include "chrome/browser/ui/views/collected_cookies_views.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "chrome/browser/ui/views/page_info/chosen_object_row.h" #include "chrome/browser/ui/views/page_info/non_accessible_image_view.h" #include "chrome/browser/ui/views/page_info/permission_selector_row.h" @@ -310,7 +310,7 @@ SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, kSpacing, kSpacing, kSpacing)); set_margins(gfx::Insets()); - if (LayoutDelegate::Get()->ShouldShowWindowIcon()) { + if (ChromeLayoutProvider::Get()->ShouldShowWindowIcon()) { views::ImageView* icon_view = new NonAccessibleImageView(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); icon_view->SetImage(rb.GetImageSkiaNamed(icon)); @@ -438,8 +438,8 @@ // In non-material, titles are inset from the dialog margin. Ensure the // horizontal insets match. set_title_margins( - gfx::Insets(LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN), side_margin, 0, side_margin)); } views::BubbleDialogDelegateView::CreateBubble(this);
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc index 0f73de7168..22586d2 100644 --- a/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/page_info/chosen_object_row.h" #include "chrome/browser/ui/views/page_info/permission_selector_row.h" #include "chrome/browser/usb/usb_chooser_context.h" @@ -24,6 +25,7 @@ #include "ui/views/controls/combobox/combobox.h" #include "ui/views/controls/label.h" #include "ui/views/test/scoped_views_test_helper.h" +#include "ui/views/test/test_views_delegate.h" const char* kUrl = "http://www.example.com/index.html"; @@ -130,6 +132,8 @@ // testing::Test: void SetUp() override { + views_helper_.test_views_delegate()->set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); views::Widget::InitParams parent_params; parent_params.context = views_helper_.GetContext(); parent_window_ = new views::Widget();
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc index 31b70da..cdf2f6eaf 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/ui/passwords/password_dialog_prompts.h" #include "chrome/browser/ui/passwords/passwords_model_delegate.h" #include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/passwords/credentials_item_view.h" #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" @@ -770,10 +770,9 @@ mouse_handler_.reset(new WebContentMouseHandler(this, this->web_contents())); // Set title margins to make the title and the content left aligned. const int side_margin = margins().left(); - set_title_margins( - gfx::Insets(LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), - side_margin, 0, side_margin)); + set_title_margins(gfx::Insets(ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN), + side_margin, 0, side_margin)); } ManagePasswordsBubbleView::~ManagePasswordsBubbleView() {
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h index 3ee16784..3744c8b3 100644 --- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h +++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
@@ -72,6 +72,7 @@ // ValidationDelegate: bool ValidateTextfield(views::Textfield* textfield) override; bool ValidateCombobox(views::Combobox* combobox) override; + void ComboboxModelChanged(views::Combobox* combobox) override {} private: // Validates a specific |value|.
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h index 4bfc61d..c1ba75a 100644 --- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.h +++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.h
@@ -180,6 +180,12 @@ PaymentRequestDialogView* dialog_view() { return delegate_->dialog_view(); } + void SetAddressInputOverride( + TestChromePaymentRequestDelegate::AddressInputProvider* + address_input_provider) { + delegate_->SetAddressInputOverride(address_input_provider); + } + // Various events that can be waited on by the DialogEventObserver. enum DialogEvent : int { DIALOG_OPENED,
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc index 194984d..d0378734 100644 --- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc +++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.cc
@@ -17,7 +17,6 @@ #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/autofill/validation_rules_storage_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" #include "chrome/browser/ui/views/payments/validating_combobox.h" @@ -35,8 +34,6 @@ #include "components/payments/content/payment_request_state.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_contents.h" -#include "third_party/libaddressinput/chromium/chrome_metadata_source.h" -#include "third_party/libaddressinput/chromium/chrome_storage_impl.h" #include "third_party/libaddressinput/messages.h" #include "ui/base/l10n/l10n_util.h" #include "ui/views/controls/textfield/textfield.h" @@ -78,7 +75,10 @@ PaymentRequestState* state, PaymentRequestDialogView* dialog, autofill::AutofillProfile* profile) - : EditorViewController(spec, state, dialog), profile_to_edit_(profile) { + : EditorViewController(spec, state, dialog), + profile_to_edit_(profile), + chosen_country_index_(0), + failed_to_load_region_data_(false) { UpdateEditorFields(); } @@ -188,17 +188,23 @@ else country_codes_.push_back(""); // Separator. } - return std::unique_ptr<ui::ComboboxModel>(model.release()); + return std::move(model); } case autofill::ADDRESS_HOME_STATE: { - return std::unique_ptr< - ui::ComboboxModel>(new autofill::RegionComboboxModel( - base::WrapUnique(new autofill::ChromeMetadataSource( - I18N_ADDRESS_VALIDATION_DATA_URL, - state()->GetPersonalDataManager()->GetURLRequestContextGetter())), - autofill::ValidationRulesStorageFactory::CreateStorage(), - state()->GetApplicationLocale(), - country_codes_[chosen_country_index_])); + std::unique_ptr<autofill::RegionComboboxModel> model = + base::MakeUnique<autofill::RegionComboboxModel>( + state()->GetAddressInputSource(), + state()->GetAddressInputStorage(), + state()->GetApplicationLocale(), + country_codes_[chosen_country_index_]); + // If the data was already pre-loaded, the observer won't get notified so + // we have to check for failure here. + if (!model->pending_region_data_load()) { + failed_to_load_region_data_ = model->failed_to_load_data(); + if (failed_to_load_region_data_) + OnDataChanged(); + } + return std::move(model); } default: NOTREACHED(); @@ -215,7 +221,8 @@ DCHECK_GE(sender->selected_index(), 0); if (chosen_country_index_ != static_cast<size_t>(sender->selected_index())) { chosen_country_index_ = sender->selected_index(); - OnCountryChanged(sender); + failed_to_load_region_data_ = false; + OnDataChanged(); } } @@ -245,7 +252,6 @@ autofill::GetAddressComponents(chosen_country_code, state()->GetApplicationLocale(), components.get(), &unused); - for (size_t line_index = 0; line_index < components->GetSize(); ++line_index) { const base::ListValue* line = nullptr; @@ -286,7 +292,8 @@ EditorField::ControlType control_type = EditorField::ControlType::TEXTFIELD; if (server_field_type == autofill::ADDRESS_HOME_COUNTRY || - server_field_type == autofill::ADDRESS_HOME_STATE) { + (server_field_type == autofill::ADDRESS_HOME_STATE && + !failed_to_load_region_data_)) { control_type = EditorField::ControlType::COMBOBOX; } editor_fields_.emplace_back( @@ -312,8 +319,7 @@ EditorField::ControlType::TEXTFIELD); } -void ShippingAddressEditorViewController::OnCountryChanged( - views::Combobox* combobox) { +void ShippingAddressEditorViewController::OnDataChanged() { // TODO(crbug.com/703764): save the current state so we can map it to the new // country fields as best we can. UpdateEditorFields(); @@ -325,6 +331,20 @@ base::Unretained(this))); } +void ShippingAddressEditorViewController::OnComboboxModelChanged( + views::Combobox* combobox) { + if (combobox->id() != autofill::ADDRESS_HOME_STATE) + return; + autofill::RegionComboboxModel* model = + static_cast<autofill::RegionComboboxModel*>(combobox->model()); + if (model->pending_region_data_load()) + return; + if (model->failed_to_load_data()) { + failed_to_load_region_data_ = true; + OnDataChanged(); + } +} + ShippingAddressEditorViewController::ShippingAddressValidationDelegate:: ShippingAddressValidationDelegate( ShippingAddressEditorViewController* controller, @@ -344,6 +364,11 @@ return ValidateValue(combobox->GetTextForRow(combobox->selected_index())); } +void ShippingAddressEditorViewController::ShippingAddressValidationDelegate:: + ComboboxModelChanged(views::Combobox* combobox) { + controller_->OnComboboxModelChanged(combobox); +} + bool ShippingAddressEditorViewController::ShippingAddressValidationDelegate:: ValidateValue(const base::string16& value) { if (!value.empty()) {
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h index 271b46f4..bca043d 100644 --- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h +++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
@@ -60,11 +60,13 @@ // ValidationDelegate: bool ValidateTextfield(views::Textfield* textfield) override; bool ValidateCombobox(views::Combobox* combobox) override; + void ComboboxModelChanged(views::Combobox* combobox) override; private: bool ValidateValue(const base::string16& value); EditorField field_; + // Raw pointer back to the owner of this class, therefore will not be null. ShippingAddressEditorViewController* controller_; @@ -83,16 +85,23 @@ // combobox, which is the generated default value received from // autofill::CountryComboboxModel::countries() which is documented to always // have the default country at the top as well as within the sorted list. - size_t chosen_country_index_{0}; + size_t chosen_country_index_; // The list of country codes as ordered in the country combobox model. std::vector<std::string> country_codes_; + // Identifies whether we tried and failed to load region data. + bool failed_to_load_region_data_; + // Updates |editor_fields_| based on the current country. void UpdateEditorFields(); - // Called by the validation delegate when the country combobox changed. - void OnCountryChanged(views::Combobox* combobox); + // Called when data changes need to force a view update. + void OnDataChanged(); + + // When a combobox model has changed, a view update might be needed, e.g., if + // there is no data in the combobox and it must be converted to a text field. + void OnComboboxModelChanged(views::Combobox* combobox); DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); };
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc new file mode 100644 index 0000000..0031312 --- /dev/null +++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc
@@ -0,0 +1,298 @@ +// Copyright 2017 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 <algorithm> + +#include "base/memory/ptr_util.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h" +#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" +#include "chrome/browser/ui/views/payments/validating_textfield.h" +#include "components/autofill/core/browser/autofill_country.h" +#include "components/autofill/core/browser/country_combobox_model.h" +#include "components/autofill/core/browser/personal_data_manager.h" +#include "components/autofill/core/browser/region_combobox_model.h" +#include "components/payments/content/payment_request_spec.h" +#include "content/public/test/browser_test_utils.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/libaddressinput/src/cpp/include/libaddressinput/null_storage.h" +#include "third_party/libaddressinput/src/cpp/include/libaddressinput/source.h" +#include "ui/views/controls/combobox/combobox.h" + +namespace payments { + +namespace { + +const char kNameFull[] = "Bob Jones"; +const char kHomeAddress[] = "42 Answers-All Avenue"; +const char kHomeCity[] = "Question-City"; +const char kHomeZip[] = "ziiiiiip"; + +} // namespace + +class PaymentRequestShippingAddressEditorTest + : public PaymentRequestBrowserTestBase, + public TestChromePaymentRequestDelegate::AddressInputProvider { + protected: + PaymentRequestShippingAddressEditorTest() + : PaymentRequestBrowserTestBase( + "/payment_request_dynamic_shipping_test.html") {} + + void EnableAddressInputOverride() { SetAddressInputOverride(this); } + + // TestChromePaymentRequestDelegate::AddressInputProvider. + std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource() + override { + return base::MakeUnique<TestSource>(address_input_override_data_); + } + + std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() + override { + return base::MakeUnique<::i18n::addressinput::NullStorage>(); + } + + void SetRequiredFields() { + SetEditorTextfieldValue(base::ASCIIToUTF16(kNameFull), autofill::NAME_FULL); + SetEditorTextfieldValue(base::ASCIIToUTF16(kHomeAddress), + autofill::ADDRESS_HOME_STREET_ADDRESS); + SetEditorTextfieldValue(base::ASCIIToUTF16(kHomeCity), + autofill::ADDRESS_HOME_CITY); + SetEditorTextfieldValue(base::ASCIIToUTF16(kHomeZip), + autofill::ADDRESS_HOME_ZIP); + } + + std::string GetSelectedCountryCode() { + views::Combobox* country_combobox = + static_cast<views::Combobox*>(dialog_view()->GetViewByID( + static_cast<int>(autofill::ADDRESS_HOME_COUNTRY))); + DCHECK(country_combobox); + int selected_country_row = country_combobox->GetSelectedRow(); + autofill::CountryComboboxModel* model = + static_cast<autofill::CountryComboboxModel*>(country_combobox->model()); + + return model->countries()[selected_country_row]->country_code(); + } + + void SetDefaultCountryData() { + AddCountryData(GetDataManager()->GetDefaultCountryCodeForNewAddress()); + } + + void AddCountryData(const std::string country_code) { + std::string country_key("data/"); + country_key += country_code; + std::string json("{\""); + json += country_key + "\":{"; + json += "\"id\":\""; + json += country_key + "\","; + json += "\"key\":\""; + json += country_code + "\","; + json += "\"sub_keys\":\"QC~ON\"},"; + + json += "\""; + json += country_key + "/ON\":{"; + json += "\"id\":\""; + json += country_key + "/ON\","; + json += "\"key\":\"ON\","; + json += "\"name\":\"Ontario\"},"; + + json += "\""; + json += country_key + "/QC\":{"; + json += "\"id\":\""; + json += country_key + "/QC\","; + json += "\"key\":\"QC\","; + json += "\"name\":\"Quebec\"}}"; + address_input_override_data_[country_key] = json; + } + + void AddCountryDataWithNoRegion(const std::string country_code) { + std::string country_key("data/"); + country_key += country_code; + std::string json("{\""); + json += country_key + "\":{"; + json += "\"id\":\""; + json += country_key + "\","; + json += "\"key\":\""; + json += country_code + "\"}}"; + address_input_override_data_[country_key] = json; + } + + PersonalDataLoadedObserverMock personal_data_observer_; + std::map<std::string, std::string> address_input_override_data_; + + private: + class TestSource : public ::i18n::addressinput::Source { + public: + explicit TestSource(const std::map<std::string, std::string>& data) + : data_(data) {} + ~TestSource() override {} + + void Get(const std::string& key, + const ::i18n::addressinput::Source::Callback& data_ready) + const override { + if (data_.find(key) == data_.end()) + data_ready(false, key, nullptr); + else + data_ready(true, key, new std::string(data_.at(key))); + } + + private: + const std::map<std::string, std::string> data_; + }; + DISALLOW_COPY_AND_ASSIGN(PaymentRequestShippingAddressEditorTest); +}; + +IN_PROC_BROWSER_TEST_F(PaymentRequestShippingAddressEditorTest, + EnteringValidDataWithDefaultCountry) { + InvokePaymentRequestUI(); + + SetDefaultCountryData(); + + EnableAddressInputOverride(); + + OpenShippingAddressSectionScreen(); + + OpenShippingAddressEditorScreen(); + + std::string country_code(GetSelectedCountryCode()); + + SetRequiredFields(); + + ResetEventObserver(DialogEvent::BACK_NAVIGATION); + + // Verifying the data is in the DB. + autofill::PersonalDataManager* personal_data_manager = GetDataManager(); + personal_data_manager->AddObserver(&personal_data_observer_); + + // Wait until the web database has been updated and the notification sent. + base::RunLoop data_loop; + EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) + .WillOnce(QuitMessageLoop(&data_loop)); + ClickOnDialogViewAndWait(DialogViewID::EDITOR_SAVE_BUTTON); + data_loop.Run(); + + ASSERT_EQ(1UL, personal_data_manager->GetProfiles().size()); + autofill::AutofillProfile* profile = personal_data_manager->GetProfiles()[0]; + DCHECK(profile); + EXPECT_EQ(base::ASCIIToUTF16(country_code), + profile->GetRawInfo(autofill::ADDRESS_HOME_COUNTRY)); + EXPECT_EQ(base::ASCIIToUTF16(kNameFull), + profile->GetRawInfo(autofill::NAME_FULL)); + EXPECT_EQ(base::ASCIIToUTF16(kHomeAddress), + profile->GetRawInfo(autofill::ADDRESS_HOME_STREET_ADDRESS)); + EXPECT_EQ(base::ASCIIToUTF16(kHomeCity), + profile->GetRawInfo(autofill::ADDRESS_HOME_CITY)); + EXPECT_EQ(base::ASCIIToUTF16(kHomeZip), + profile->GetRawInfo(autofill::ADDRESS_HOME_ZIP)); +} + +IN_PROC_BROWSER_TEST_F(PaymentRequestShippingAddressEditorTest, + SwitchingCountryUpdatesView) { + InvokePaymentRequestUI(); + + SetDefaultCountryData(); + + EnableAddressInputOverride(); + + OpenShippingAddressSectionScreen(); + + OpenShippingAddressEditorScreen(); + + views::Combobox* country_combobox = + static_cast<views::Combobox*>(dialog_view()->GetViewByID( + static_cast<int>(autofill::ADDRESS_HOME_COUNTRY))); + ASSERT_NE(nullptr, country_combobox); + ASSERT_EQ(0, country_combobox->GetSelectedRow()); + autofill::CountryComboboxModel* model = + static_cast<autofill::CountryComboboxModel*>(country_combobox->model()); + size_t num_countries = model->countries().size(); + ASSERT_GT(num_countries, 10UL); + bool without_region_data = true; + for (size_t country_index = 10; country_index < num_countries; + country_index += num_countries / 10) { + // The editor updates asynchronously when the country changes. + ResetEventObserver(DialogEvent::EDITOR_VIEW_UPDATED); + country_combobox->SetSelectedRow(country_index); + country_combobox->OnBlur(); + // Some entries don't have country data, e.g., separators. + if (model->countries()[country_index]) { + std::string code(model->countries()[country_index]->country_code()); + if (without_region_data) + AddCountryDataWithNoRegion(code); + else + AddCountryData(code); + without_region_data = !without_region_data; + } + // The view update will invalidate the country_combobox / model pointers. + country_combobox = nullptr; + model = nullptr; + WaitForObservedEvent(); + + // Make sure the country combo box was properly reset to the chosen country. + country_combobox = static_cast<views::Combobox*>(dialog_view()->GetViewByID( + static_cast<int>(autofill::ADDRESS_HOME_COUNTRY))); + DCHECK(country_combobox); + EXPECT_EQ(country_index, + static_cast<size_t>(country_combobox->GetSelectedRow())); + + country_combobox = static_cast<views::Combobox*>(dialog_view()->GetViewByID( + static_cast<int>(autofill::ADDRESS_HOME_COUNTRY))); + DCHECK(country_combobox); + model = + static_cast<autofill::CountryComboboxModel*>(country_combobox->model()); + ASSERT_EQ(num_countries, model->countries().size()); + } +} + +IN_PROC_BROWSER_TEST_F(PaymentRequestShippingAddressEditorTest, + FailToLoadRegionData) { + InvokePaymentRequestUI(); + + SetDefaultCountryData(); + + EnableAddressInputOverride(); + + OpenShippingAddressSectionScreen(); + + OpenShippingAddressEditorScreen(); + + // The editor updates asynchronously when the regions fail to load. + ResetEventObserver(DialogEvent::EDITOR_VIEW_UPDATED); + views::Combobox* country_combobox = + static_cast<views::Combobox*>(dialog_view()->GetViewByID( + static_cast<int>(autofill::ADDRESS_HOME_STATE))); + ASSERT_NE(nullptr, country_combobox); + autofill::RegionComboboxModel* model = + static_cast<autofill::RegionComboboxModel*>(country_combobox->model()); + model->SetFailureModeForTests(true); + + // The view update will invalidate the country_combobox / model pointers. + country_combobox = nullptr; + model = nullptr; + WaitForObservedEvent(); + + // Now any textual value can be set as the state. + SetEditorTextfieldValue(base::ASCIIToUTF16("any state"), + autofill::ADDRESS_HOME_STATE); + SetRequiredFields(); + ResetEventObserver(DialogEvent::BACK_NAVIGATION); + + // Verifying the data is in the DB. + autofill::PersonalDataManager* personal_data_manager = GetDataManager(); + personal_data_manager->AddObserver(&personal_data_observer_); + + // Wait until the web database has been updated and the notification sent. + base::RunLoop data_loop; + EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged()) + .WillOnce(QuitMessageLoop(&data_loop)); + ClickOnDialogViewAndWait(DialogViewID::EDITOR_SAVE_BUTTON); + data_loop.Run(); + + ASSERT_EQ(1UL, personal_data_manager->GetProfiles().size()); + autofill::AutofillProfile* profile = personal_data_manager->GetProfiles()[0]; + DCHECK(profile); + EXPECT_EQ(base::ASCIIToUTF16("any state"), + profile->GetRawInfo(autofill::ADDRESS_HOME_STATE)); +} + +} // namespace payments
diff --git a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc index 3bd1668..914a0df 100644 --- a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc +++ b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.cc
@@ -18,6 +18,7 @@ views::WidgetObserver* widget_observer, bool is_incognito) : ChromePaymentRequestDelegate(web_contents), + address_input_provider_(nullptr), observer_(observer), widget_observer_(widget_observer), is_incognito_for_testing_(is_incognito) {} @@ -38,4 +39,18 @@ return is_incognito_for_testing_; } +std::unique_ptr<const ::i18n::addressinput::Source> +TestChromePaymentRequestDelegate::GetAddressInputSource() { + if (address_input_provider_) + return address_input_provider_->GetAddressInputSource(); + return ChromePaymentRequestDelegate::GetAddressInputSource(); +} + +std::unique_ptr<::i18n::addressinput::Storage> +TestChromePaymentRequestDelegate::GetAddressInputStorage() { + if (address_input_provider_) + return address_input_provider_->GetAddressInputStorage(); + return ChromePaymentRequestDelegate::GetAddressInputStorage(); +} + } // namespace payments
diff --git a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h index 09e6393..633d3fb 100644 --- a/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h +++ b/chrome/browser/ui/views/payments/test_chrome_payment_request_delegate.h
@@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE_H_ #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_TEST_CHROME_PAYMENT_REQUEST_DELEGATE_H_ +#include <memory> + #include "base/macros.h" #include "chrome/browser/payments/chrome_payment_request_delegate.h" #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" @@ -30,14 +32,35 @@ views::WidgetObserver* widget_observer, bool is_incognito); + // This class allows tests to provide their own AddressInput data. + class AddressInputProvider { + public: + virtual std::unique_ptr<const ::i18n::addressinput::Source> + GetAddressInputSource() = 0; + virtual std::unique_ptr<::i18n::addressinput::Storage> + GetAddressInputStorage() = 0; + }; + + void SetAddressInputOverride(AddressInputProvider* address_input_provider) { + address_input_provider_ = address_input_provider; + } + + // ChromePaymentRequestDelegate. void ShowDialog(PaymentRequest* request) override; bool IsIncognito() const override; + std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource() + override; + std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() + override; PaymentRequestDialogView* dialog_view() { return static_cast<PaymentRequestDialogView*>(dialog_); } private: + // Not owned so must outlive the PaymentRequest object; + AddressInputProvider* address_input_provider_; + PaymentRequestDialogView::ObserverForTest* observer_; views::WidgetObserver* widget_observer_; bool is_incognito_for_testing_;
diff --git a/chrome/browser/ui/views/payments/validating_combobox.cc b/chrome/browser/ui/views/payments/validating_combobox.cc index 3c4324fba..1871a1d 100644 --- a/chrome/browser/ui/views/payments/validating_combobox.cc +++ b/chrome/browser/ui/views/payments/validating_combobox.cc
@@ -45,6 +45,7 @@ void ValidatingCombobox::OnComboboxModelChanged( ui::ComboboxModel* unused_model) { ModelChanged(); + delegate_->ComboboxModelChanged(this); } void ValidatingCombobox::Validate() {
diff --git a/chrome/browser/ui/views/payments/validating_textfield_unittest.cc b/chrome/browser/ui/views/payments/validating_textfield_unittest.cc index faa4768..6260c40 100644 --- a/chrome/browser/ui/views/payments/validating_textfield_unittest.cc +++ b/chrome/browser/ui/views/payments/validating_textfield_unittest.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/payments/validating_textfield.h" #include <memory> +#include <utility> #include "base/macros.h" #include "base/strings/string16.h" @@ -32,6 +33,7 @@ return textfield->text().size() <= 5u; } bool ValidateCombobox(views::Combobox* combobox) override { return true; } + void ComboboxModelChanged(views::Combobox* combobox) override {} private: DISALLOW_COPY_AND_ASSIGN(TestValidationDelegate);
diff --git a/chrome/browser/ui/views/payments/validation_delegate.h b/chrome/browser/ui/views/payments/validation_delegate.h index 060c082..4065398 100644 --- a/chrome/browser/ui/views/payments/validation_delegate.h +++ b/chrome/browser/ui/views/payments/validation_delegate.h
@@ -20,6 +20,7 @@ virtual bool ValidateTextfield(views::Textfield* textfield) = 0; virtual bool ValidateCombobox(views::Combobox* combobox) = 0; + virtual void ComboboxModelChanged(views::Combobox* combobox) = 0; }; } // namespace payments
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc index 4969455..0933b3b 100644 --- a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc +++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
@@ -16,7 +16,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/page_info/permission_selector_row.h" #include "chrome/browser/ui/views/page_info/permission_selector_row_observer.h" #include "chrome/grit/generated_resources.h" @@ -197,12 +197,10 @@ set_close_on_deactivate(false); - LayoutDelegate* layout_delegate = LayoutDelegate::Get(); - SetLayoutManager( - new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric:: - RELATED_CONTROL_VERTICAL_SPACING))); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); + SetLayoutManager(new views::BoxLayout( + views::BoxLayout::kVertical, 0, 0, + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL))); display_origin_ = url_formatter::FormatUrlForSecurityDisplay( requests[0]->GetOrigin(), @@ -225,12 +223,11 @@ row_layout->StartRow(0, 0); views::View* label_container = new views::View(); - int indent = layout_delegate->GetMetric( - LayoutDelegate::Metric::SUBSECTION_HORIZONTAL_INDENT); + int indent = + provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT); label_container->SetLayoutManager(new views::BoxLayout( views::BoxLayout::kHorizontal, indent, 0, - layout_delegate->GetMetric( - LayoutDelegate::Metric::RELATED_LABEL_HORIZONTAL_SPACING))); + provider->GetDistanceMetric(DISTANCE_RELATED_LABEL_HORIZONTAL))); views::ImageView* icon = new views::ImageView(); const gfx::VectorIcon& vector_id = requests[index]->GetIconId(); icon->SetImage(
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc index d101e07e..926d73a7 100644 --- a/chrome/browser/ui/views/sad_tab_view.cc +++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -9,7 +9,6 @@ #include "base/metrics/histogram_macros.h" #include "build/build_config.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" #include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h"
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc index 0645a65d..18ea2fa 100644 --- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc +++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
@@ -32,6 +32,7 @@ #include "ui/views/controls/styled_label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_client_view.h" @@ -194,8 +195,7 @@ // Layout the components. const gfx::Insets panel_insets = - views::ViewsDelegate::GetInstance()->GetInsetsMetric( - views::InsetsMetric::PANEL); + views::LayoutProvider::Get()->GetInsetsMetric(views::INSETS_PANEL); // The prompt bar needs to go to the edge of the dialog, so ignore insets for // the outer layout. views::GridLayout* dialog_layout = new views::GridLayout(this);
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index 6d9eafc..0e722e8 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -17,7 +17,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/task_manager/task_manager_columns.h" #include "chrome/browser/ui/user_manager.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/grit/chromium_strings.h" @@ -333,8 +333,8 @@ SetLayoutManager(new views::FillLayout()); SetBorder(views::CreateEmptyBorder( - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN), views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew)); table_model_->RetrieveSavedColumnsSettingsAndUpdateTable();
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc index 4dc0d689..8842a43 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/locale_settings.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/color_palette.h" @@ -72,10 +72,10 @@ if (icon && label) { views::View* parent = new views::View(); - parent->SetLayoutManager(new views::BoxLayout( - views::BoxLayout::kHorizontal, 0, 0, - LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING))); + parent->SetLayoutManager( + new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, + ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL))); parent->AddChildView(icon.release()); parent->AddChildView(label.release()); return parent; @@ -106,11 +106,10 @@ } void ToolbarActionsBarBubbleViews::Init() { - LayoutDelegate* delegate = LayoutDelegate::Get(); + ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); SetLayoutManager(new views::BoxLayout( views::BoxLayout::kVertical, 0, 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_VERTICAL_SPACING))); + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL))); // Add the content string. views::Label* content_label = @@ -128,8 +127,7 @@ item_list_ = new views::Label(item_list); item_list_->SetBorder(views::CreateEmptyBorder( 0, - delegate->GetMetric( - LayoutDelegate::Metric::RELATED_CONTROL_HORIZONTAL_SPACING), + provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL), 0, 0)); item_list_->SetMultiLine(true); item_list_->SizeToFit(width);
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc index fe7c4ba9..5c4178f19 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views_unittest.cc
@@ -11,6 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/toolbar/test_toolbar_actions_bar_bubble_delegate.h" #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "components/grit/components_scaled_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -44,6 +45,12 @@ ToolbarActionsBarBubbleViewsTest() {} ~ToolbarActionsBarBubbleViewsTest() override {} + void SetUp() override { + views::ViewsTestBase::SetUp(); + test_views_delegate()->set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); + } + void TearDown() override { anchor_widget_.reset(); views::ViewsTestBase::TearDown();
diff --git a/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc b/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc index cf1b4583..97d6dea 100644 --- a/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc +++ b/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/ui/views/webshare/webshare_target_picker_view.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/browser/ui/views/harmony/layout_delegate.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/grit/generated_resources.h" #include "components/constrained_window/constrained_window_views.h" #include "ui/base/l10n/l10n_util.h" @@ -80,8 +80,8 @@ : targets_(targets), table_model_(base::MakeUnique<TargetPickerTableModel>(&targets_)), close_callback_(close_callback) { - const int panel_margin = LayoutDelegate::Get()->GetMetric( - LayoutDelegate::Metric::PANEL_CONTENT_MARGIN); + const int panel_margin = ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_PANEL_CONTENT_MARGIN); views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, panel_margin, panel_margin, views::kRelatedControlVerticalSpacing);
diff --git a/chrome/browser/ui/views/webshare/webshare_target_picker_view_unittest.cc b/chrome/browser/ui/views/webshare/webshare_target_picker_view_unittest.cc index 130f70f..dc57d740 100644 --- a/chrome/browser/ui/views/webshare/webshare_target_picker_view_unittest.cc +++ b/chrome/browser/ui/views/webshare/webshare_target_picker_view_unittest.cc
@@ -14,6 +14,7 @@ #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "components/constrained_window/constrained_window_views.h" #include "testing/gtest/include/gtest/gtest.h" @@ -31,6 +32,9 @@ void SetUp() override { ViewsTestBase::SetUp(); + test_views_delegate()->set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); + SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); // Create the parent widget.
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui_browsertest.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui_browsertest.cc index 99eedb3c..9e1161f0 100644 --- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui_browsertest.cc +++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui_browsertest.cc
@@ -33,92 +33,141 @@ DISALLOW_COPY_AND_ASSIGN(TestWebUIMessageHandler); }; +content::WebContents* StartKeyboardOverlayUI(Browser* browser) { + ui_test_utils::NavigateToURL(browser, + GURL(chrome::kChromeUIKeyboardOverlayURL)); + content::WebContents* web_contents = + browser->tab_strip_model()->GetActiveWebContents(); + web_contents->GetWebUI()->AddMessageHandler( + base::MakeUnique<TestWebUIMessageHandler>()); + return web_contents; +} + +bool IsDisplayUIScalingEnabled(content::WebContents* web_contents) { + bool is_display_ui_scaling_enabled; + EXPECT_TRUE(content::ExecuteScriptAndExtractBool( + web_contents, + "domAutomationController.send(isDisplayUIScalingEnabled());", + &is_display_ui_scaling_enabled)); + return is_display_ui_scaling_enabled; +} + +// Skip some accelerators in the tests: +// 1. If the accelerator has no modifier, i.e. ui::EF_NONE, or for "Caps +// Lock", such as ui::VKEY_MENU and ui::VKEY_LWIN, the logic to show it on +// the keyboard overlay is not by the mapping of +// keyboardOverlayData['shortcut'], so it can not be tested by this test. +// 2. If it has debug modifiers: ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | +// ui::EF_SHIFT_DOWN +bool ShouldSkip(const ash::AcceleratorData& accelerator) { + return accelerator.keycode == ui::VKEY_MENU || + accelerator.keycode == ui::VKEY_LWIN || + accelerator.modifiers == ui::EF_NONE || + accelerator.modifiers == + (ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN); +} + +std::string KeyboardCodeToLabel(const ash::AcceleratorData& accelerator, + content::WebContents* web_contents) { + std::string label; + EXPECT_TRUE(content::ExecuteScriptAndExtractString( + web_contents, + "domAutomationController.send(" + " (function(number) {" + " if (!!KEYCODE_TO_LABEL[number]) {" + " return KEYCODE_TO_LABEL[number];" + " } else {" + " return 'NONE';" + " }" + " })(" + + std::to_string(static_cast<unsigned int>(accelerator.keycode)) + + " )" + ");", + &label)); + if (label == "NONE") { + label = base::ToLowerASCII(static_cast<char>( + LocatedToNonLocatedKeyboardCode(accelerator.keycode))); + } + return label; +} + +std::string GenerateShortcutKey(const ash::AcceleratorData& accelerator, + content::WebContents* web_contents) { + std::string shortcut = KeyboardCodeToLabel(accelerator, web_contents); + // The order of the "if" conditions should not be changed because the + // modifiers are expected to be alphabetical sorted in the generated + // shortcut. + if (accelerator.modifiers & ui::EF_ALT_DOWN) + shortcut.append("<>ALT"); + if (accelerator.modifiers & ui::EF_CONTROL_DOWN) + shortcut.append("<>CTRL"); + if (accelerator.modifiers & ui::EF_COMMAND_DOWN) + shortcut.append("<>SEARCH"); + if (accelerator.modifiers & ui::EF_SHIFT_DOWN) + shortcut.append("<>SHIFT"); + return shortcut; +} + +bool ContainsShortcut(const std::string& shortcut, + content::WebContents* web_contents) { + bool contains; + EXPECT_TRUE(content::ExecuteScriptAndExtractBool( + web_contents, + "domAutomationController.send(" + " !!keyboardOverlayData['shortcut']['" + shortcut + "']" + ");", + &contains)); + return contains; +} + } // namespace using KeyboardOverlayUIBrowserTest = InProcessBrowserTest; IN_PROC_BROWSER_TEST_F(KeyboardOverlayUIBrowserTest, - ShouldHaveKeyboardOverlay) { - ui_test_utils::NavigateToURL(browser(), - GURL(chrome::kChromeUIKeyboardOverlayURL)); - content::WebContents* web_contents = - browser()->tab_strip_model()->GetActiveWebContents(); - web_contents->GetWebUI()->AddMessageHandler( - base::MakeUnique<TestWebUIMessageHandler>()); - - bool is_display_ui_scaling_enabled; - ASSERT_TRUE(content::ExecuteScriptAndExtractBool( - web_contents, - "domAutomationController.send(isDisplayUIScalingEnabled());", - &is_display_ui_scaling_enabled)); - + AcceleratorsShouldHaveKeyboardOverlay) { + content::WebContents* const web_contents = StartKeyboardOverlayUI(browser()); + const bool is_display_ui_scaling_enabled = + IsDisplayUIScalingEnabled(web_contents); for (size_t i = 0; i < ash::kAcceleratorDataLength; ++i) { const ash::AcceleratorData& entry = ash::kAcceleratorData[i]; - // Skip some accelerators in this test: - // 1. If the accelerator has no modifier, i.e. ui::EF_NONE, or for "Caps - // Lock", such as ui::VKEY_MENU and ui::VKEY_LWIN, the logic to show it on - // the keyboard overlay is not by the mapping of - // keyboardOverlayData['shortcut'], so it can not be tested by this test. - // 2. If it has debug modifiers: ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | - // ui::EF_SHIFT_DOWN - if (entry.keycode == ui::VKEY_MENU || - entry.keycode == ui::VKEY_LWIN || - entry.modifiers == ui::EF_NONE || - entry.modifiers == - (ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)) { + if (ShouldSkip(entry)) continue; - } - std::string shortcut; - ASSERT_TRUE(content::ExecuteScriptAndExtractString( - web_contents, - "domAutomationController.send(" - " (function(number) {" - " if (!!KEYCODE_TO_LABEL[number]) {" - " return KEYCODE_TO_LABEL[number];" - " } else {" - " return 'NONE';" - " }" - " })(" + std::to_string(static_cast<unsigned int>(entry.keycode)) + ")" - ");", - &shortcut)); - if (shortcut == "NONE") { - shortcut = base::ToLowerASCII( - static_cast<char>(LocatedToNonLocatedKeyboardCode(entry.keycode))); - } - - // The order of the "if" conditions should not be changed because the - // modifiers are expected to be alphabetical sorted in the generated - // shortcut. - if (entry.modifiers & ui::EF_ALT_DOWN) - shortcut.append("<>ALT"); - if (entry.modifiers & ui::EF_CONTROL_DOWN) - shortcut.append("<>CTRL"); - if (entry.modifiers & ui::EF_COMMAND_DOWN) - shortcut.append("<>SEARCH"); - if (entry.modifiers & ui::EF_SHIFT_DOWN) - shortcut.append("<>SHIFT"); - + const std::string shortcut = GenerateShortcutKey(entry, web_contents); if (!is_display_ui_scaling_enabled) { if (shortcut == "-<>CTRL<>SHIFT" || shortcut == "+<>CTRL<>SHIFT" || - shortcut == "0<>CTRL<>SHIFT") + shortcut == "0<>CTRL<>SHIFT") { continue; + } } - bool contains; - ASSERT_TRUE(content::ExecuteScriptAndExtractBool( - web_contents, - "domAutomationController.send(" - " !!keyboardOverlayData['shortcut']['" + shortcut + "']" - ");", - &contains)); - ASSERT_TRUE(contains) << "Please add the new accelerators to keyboard " - "overlay. Add one entry '" + - shortcut + - "' in the 'shortcut' section" - " at the bottom of the file of " - "'/chrome/browser/resources/chromeos/" - "keyboard_overlay_data.js'. Please keep it in " - "alphabetical order."; + EXPECT_TRUE(ContainsShortcut(shortcut, web_contents)) + << "Please add the new accelerators to keyboard " + "overlay. Add one entry '" + + shortcut + + "' in the 'shortcut' section" + " at the bottom of the file of " + "'/chrome/browser/resources/chromeos/" + "keyboard_overlay_data.js'. Please keep it in " + "alphabetical order."; + } +} + +IN_PROC_BROWSER_TEST_F(KeyboardOverlayUIBrowserTest, + DeprecatedAcceleratorsShouldNotHaveKeyboardOverlay) { + content::WebContents* const web_contents = StartKeyboardOverlayUI(browser()); + for (size_t i = 0; i < ash::kDeprecatedAcceleratorsLength; ++i) { + const ash::AcceleratorData& entry = ash::kDeprecatedAccelerators[i]; + if (ShouldSkip(entry)) + continue; + + const std::string shortcut = GenerateShortcutKey(entry, web_contents); + EXPECT_FALSE(ContainsShortcut(shortcut, web_contents)) + << "Please remove the deprecated accelerator '" + shortcut + + "' from the 'shortcut' section" + " at the bottom of the file of " + "'/chrome/browser/resources/chromeos/" + "keyboard_overlay_data.js'."; } }
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc index 6b118ce..729ff1a2 100644 --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -49,7 +49,6 @@ EncryptionMigrationScreenHandler::EncryptionMigrationScreenHandler() : BaseScreenHandler(kScreenId), weak_ptr_factory_(this) { set_call_js_prefix(kJsScreenPath); - DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); } EncryptionMigrationScreenHandler::~EncryptionMigrationScreenHandler() { @@ -102,6 +101,8 @@ if (!page_is_ready() || !delegate_) return; + DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); + if (show_on_init_) { Show(); show_on_init_ = false;
diff --git a/chrome/renderer/autofill/fake_content_password_manager_driver.cc b/chrome/renderer/autofill/fake_content_password_manager_driver.cc index 30e61704..299f006 100644 --- a/chrome/renderer/autofill/fake_content_password_manager_driver.cc +++ b/chrome/renderer/autofill/fake_content_password_manager_driver.cc
@@ -15,7 +15,10 @@ // mojom::PasswordManagerDriver: void FakeContentPasswordManagerDriver::PasswordFormsParsed( - const std::vector<autofill::PasswordForm>& forms) {} + const std::vector<autofill::PasswordForm>& forms) { + called_password_forms_parsed_ = true; + password_forms_parsed_ = forms; +} void FakeContentPasswordManagerDriver::PasswordFormsRendered( const std::vector<autofill::PasswordForm>& visible_forms,
diff --git a/chrome/renderer/autofill/fake_content_password_manager_driver.h b/chrome/renderer/autofill/fake_content_password_manager_driver.h index 5aac096..0b8c6fb 100644 --- a/chrome/renderer/autofill/fake_content_password_manager_driver.h +++ b/chrome/renderer/autofill/fake_content_password_manager_driver.h
@@ -64,6 +64,15 @@ return password_form_inpage_navigation_; } + bool called_password_forms_parsed() const { + return called_password_forms_parsed_; + } + + const base::Optional<std::vector<autofill::PasswordForm>>& + password_forms_parsed() const { + return password_forms_parsed_; + } + bool called_password_forms_rendered() const { return called_password_forms_rendered_; } @@ -73,7 +82,9 @@ return password_forms_rendered_; } - void reset_password_forms_rendered() { + void reset_password_forms_calls() { + called_password_forms_parsed_ = false; + password_forms_parsed_ = base::nullopt; called_password_forms_rendered_ = false; password_forms_rendered_ = base::nullopt; } @@ -162,6 +173,10 @@ bool called_inpage_navigation_ = false; // Records data received via InPageNavigation() call. base::Optional<autofill::PasswordForm> password_form_inpage_navigation_; + // Records whether PasswordFormsParsed() gets called. + bool called_password_forms_parsed_ = false; + // Records if the list received via PasswordFormsParsed() call was empty. + base::Optional<std::vector<autofill::PasswordForm>> password_forms_parsed_; // Records whether PasswordFormsRendered() gets called. bool called_password_forms_rendered_ = false; // Records data received via PasswordFormsRendered() call.
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index 66529cad..4b618b0 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -95,6 +95,12 @@ "<head> <style> form {display: inline;} </style> </head>" "<body> <form> </form> </body>"; +const char kFormWithoutPasswordsHTML[] = + "<FORM>" + " <INPUT type='text' id='random_field'/>" + " <INPUT type='text' id='username'/>" + "</FORM>"; + const char kNonVisibleFormHTML[] = "<head> <style> form {visibility: hidden;} </style> </head>" "<body>" @@ -857,53 +863,132 @@ EXPECT_FALSE(form_util::IsWebElementVisible(web_control_elements[0])); } -TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest) { - fake_driver_.reset_password_forms_rendered(); +TEST_F(PasswordAutofillAgentTest, + SendPasswordFormsTest_VisibleFormWithNoUsername) { + fake_driver_.reset_password_forms_calls(); LoadHTML(kVisibleFormWithNoUsernameHTML); base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + ASSERT_TRUE(fake_driver_.password_forms_parsed()); + EXPECT_FALSE(fake_driver_.password_forms_parsed()->empty()); EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); - ASSERT_TRUE(static_cast<bool>(fake_driver_.password_forms_rendered())); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); EXPECT_FALSE(fake_driver_.password_forms_rendered()->empty()); +} - fake_driver_.reset_password_forms_rendered(); +TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_EmptyForm) { + fake_driver_.reset_password_forms_calls(); LoadHTML(kEmptyFormHTML); base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(fake_driver_.called_password_forms_parsed()); EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); - ASSERT_TRUE(static_cast<bool>(fake_driver_.password_forms_rendered())); - EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); - - fake_driver_.reset_password_forms_rendered(); - LoadHTML(kNonDisplayedFormHTML); - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); - ASSERT_TRUE(static_cast<bool>(fake_driver_.password_forms_rendered())); - EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); - - fake_driver_.reset_password_forms_rendered(); - LoadHTML(kNonVisibleFormHTML); - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); - ASSERT_TRUE(static_cast<bool>(fake_driver_.password_forms_rendered())); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); } +TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_FormWithoutPasswords) { + fake_driver_.reset_password_forms_calls(); + LoadHTML(kFormWithoutPasswordsHTML); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(fake_driver_.called_password_forms_parsed()); + EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); + EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); +} + +TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_NonDisplayedForm) { + fake_driver_.reset_password_forms_calls(); + LoadHTML(kNonDisplayedFormHTML); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + ASSERT_TRUE(fake_driver_.password_forms_parsed()); + EXPECT_FALSE(fake_driver_.password_forms_parsed()->empty()); + EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); + EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); +} + +TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_NonVisibleForm) { + fake_driver_.reset_password_forms_calls(); + LoadHTML(kNonVisibleFormHTML); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + ASSERT_TRUE(fake_driver_.password_forms_parsed()); + EXPECT_FALSE(fake_driver_.password_forms_parsed()->empty()); + EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); + EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); +} + +TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_PasswordChangeForm) { + fake_driver_.reset_password_forms_calls(); + LoadHTML(kPasswordChangeFormHTML); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + ASSERT_TRUE(fake_driver_.password_forms_parsed()); + EXPECT_FALSE(fake_driver_.password_forms_parsed()->empty()); + EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); + EXPECT_FALSE(fake_driver_.password_forms_rendered()->empty()); +} + +TEST_F(PasswordAutofillAgentTest, + SendPasswordFormsTest_CannotCreatePasswordForm) { + // This test checks that a request to the store is sent even if we fail to + // create a |PasswordForm|. + fake_driver_.reset_password_forms_calls(); + const char kInvalidFormHTML[] = + "<FORM name='ChangeWithUsernameForm' action='http://www.bidule.com'>" + " <INPUT type='password' id='pwd1' value='1'/>" + " <INPUT type='password' id='pwd1' value='2'/>" + " <INPUT type='password' id='pwd2' value='3'/>" + " <INPUT type='submit' value='Login'/>" + "</FORM>"; + LoadHTML(kInvalidFormHTML); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + ASSERT_TRUE(fake_driver_.password_forms_parsed()); + EXPECT_FALSE(fake_driver_.password_forms_parsed()->empty()); + EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); + ASSERT_TRUE(fake_driver_.password_forms_rendered()); + EXPECT_TRUE(fake_driver_.password_forms_rendered()->empty()); +} + +TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_ReloadTab) { + // PasswordAutofillAgent::sent_request_to_store_ disables duplicate requests + // to the store. This test checks that new request will be sent if the frame + // has been reloaded. + fake_driver_.reset_password_forms_calls(); + LoadHTML(kNonVisibleFormHTML); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + + fake_driver_.reset_password_forms_calls(); + std::string url_string = "data:text/html;charset=utf-8,"; + url_string.append(kNonVisibleFormHTML); + Reload(GURL(url_string)); + EXPECT_TRUE(fake_driver_.called_password_forms_parsed()); + ASSERT_TRUE(fake_driver_.password_forms_parsed()); + EXPECT_FALSE(fake_driver_.password_forms_parsed()->empty()); +} + TEST_F(PasswordAutofillAgentTest, SendPasswordFormsTest_Redirection) { - fake_driver_.reset_password_forms_rendered(); + fake_driver_.reset_password_forms_calls(); LoadHTML(kEmptyWebpage); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(fake_driver_.called_password_forms_rendered()); - fake_driver_.reset_password_forms_rendered(); + fake_driver_.reset_password_forms_calls(); LoadHTML(kRedirectionWebpage); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(fake_driver_.called_password_forms_rendered()); - fake_driver_.reset_password_forms_rendered(); + fake_driver_.reset_password_forms_calls(); LoadHTML(kSimpleWebpage); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(fake_driver_.called_password_forms_rendered()); - fake_driver_.reset_password_forms_rendered(); + fake_driver_.reset_password_forms_calls(); LoadHTML(kWebpageWithDynamicContent); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(fake_driver_.called_password_forms_rendered());
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 0448b032..afcda37a 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2157,6 +2157,7 @@ "../browser/ui/views/payments/payment_request_can_make_payment_browsertest.cc", "../browser/ui/views/payments/payment_request_payment_response_browsertest.cc", "../browser/ui/views/payments/payment_sheet_view_controller_browsertest.cc", + "../browser/ui/views/payments/shipping_address_editor_view_controller_browsertest.cc", "../browser/ui/views/payments/shipping_option_view_controller_browsertest.cc", "../browser/ui/views/select_file_dialog_extension_browsertest.cc", "../browser/ui/views/sync/profile_signin_confirmation_dialog_views_browsertest.cc", @@ -4856,7 +4857,7 @@ "../browser/ui/views/apps/app_info_dialog/app_info_permissions_panel_unittest.cc", "../browser/ui/views/confirm_bubble_views_unittest.cc", "../browser/ui/views/global_error_bubble_view_unittest.cc", - "../browser/ui/views/harmony/layout_delegate_unittest.cc", + "../browser/ui/views/harmony/layout_provider_unittest.cc", "../browser/ui/views/page_info/page_info_bubble_view_unittest.cc", "../browser/ui/views/payments/credit_card_editor_view_controller_unittest.cc", "../browser/ui/views/payments/payment_request_item_list_unittest.cc",
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc index 955e36b..ecbed8ea 100644 --- a/chrome/test/base/browser_with_test_window_test.cc +++ b/chrome/test/base/browser_with_test_window_test.cc
@@ -23,17 +23,18 @@ #include "content/public/test/browser_side_navigation_test_utils.h" #include "content/public/test/test_renderer_host.h" #include "ui/base/page_transition_types.h" - -#if defined(OS_CHROMEOS) -#include "ash/test/ash_test_helper.h" -#include "chrome/test/base/ash_test_environment_chrome.h" -#elif defined(TOOLKIT_VIEWS) -#include "ui/views/test/scoped_views_test_helper.h" -#endif +#include "ui/views/test/test_views_delegate.h" #if defined(TOOLKIT_VIEWS) #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" +#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "components/constrained_window/constrained_window_views.h" + +#if defined(OS_CHROMEOS) +#include "chrome/test/base/ash_test_environment_chrome.h" +#else +#include "ui/views/test/test_views_delegate.h" +#endif #endif using content::NavigationController; @@ -66,6 +67,9 @@ #endif #if defined(TOOLKIT_VIEWS) SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); + + test_views_delegate()->set_layout_provider( + ChromeLayoutProvider::CreateLayoutProvider()); #endif if (content::IsBrowserSideNavigationEnabled())
diff --git a/chrome/test/base/browser_with_test_window_test.h b/chrome/test/base/browser_with_test_window_test.h index 18c5e06..2917789 100644 --- a/chrome/test/base/browser_with_test_window_test.h +++ b/chrome/test/base/browser_with_test_window_test.h
@@ -16,10 +16,16 @@ #include "content/public/test/test_renderer_host.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(TOOLKIT_VIEWS) #if defined(OS_CHROMEOS) +#include "ash/test/ash_test_helper.h" +#include "ash/test/ash_test_views_delegate.h" #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/device_settings_service.h" +#else +#include "ui/views/test/scoped_views_test_helper.h" +#endif #endif #if defined(OS_WIN) @@ -28,17 +34,17 @@ class GURL; +#if defined(TOOLKIT_VIEWS) +namespace views { +class TestViewsDelegate; +} #if defined(OS_CHROMEOS) namespace ash { namespace test { class AshTestEnvironment; -class AshTestHelper; } } -#elif defined(TOOLKIT_VIEWS) -namespace views { -class ScopedViewsTestHelper; -} +#endif #endif namespace content { @@ -144,6 +150,16 @@ bool hosted_app, BrowserWindow* browser_window); +#if defined(TOOLKIT_VIEWS) + views::TestViewsDelegate* test_views_delegate() { +#if defined(OS_CHROMEOS) + return ash_test_helper_->test_views_delegate(); +#else + return views_test_helper_->test_views_delegate(); +#endif + } +#endif + private: // We need to create a MessageLoop, otherwise a bunch of things fails. content::TestBrowserThreadBundle thread_bundle_;
diff --git a/chrome/test/data/banners/manifest_bad_badge.json b/chrome/test/data/banners/manifest_bad_badge.json new file mode 100644 index 0000000..fc551c7 --- /dev/null +++ b/chrome/test/data/banners/manifest_bad_badge.json
@@ -0,0 +1,39 @@ +{ + "name": "Manifest test app", + "icons": [ + { + "src": "launcher-icon-1x.png", + "sizes": "48x48", + "type": "image/png" + }, + { + "src": "launcher-icon-1-5x.png", + "sizes": "72x72", + "type": "image/png" + }, + { + "src": "bad_icon.png", + "sizes": "96x96", + "type": "image/png", + "purpose": "any badge" + }, + { + "src": "launcher-icon-3x.png", + "sizes": "144x144", + "type": "image/png" + }, + { + "src": "launcher-icon-4x.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "image-512px.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": "manifest_test_page.html", + "display": "standalone", + "orientation": "landscape" +} \ No newline at end of file
diff --git a/chromecast/media/cma/backend/alsa/filter_group.cc b/chromecast/media/cma/backend/alsa/filter_group.cc index 3b204e66..bfb611f 100644 --- a/chromecast/media/cma/backend/alsa/filter_group.cc +++ b/chromecast/media/cma/backend/alsa/filter_group.cc
@@ -11,17 +11,18 @@ namespace chromecast { namespace media { - FilterGroup::FilterGroup(const std::unordered_set<std::string>& input_types, AudioContentType content_type, - int channels, + int num_channels, const base::ListValue* filter_list) : input_types_(input_types), content_type_(content_type), - channels_(channels), + num_channels_(num_channels), output_samples_per_second_(0), + channels_(num_channels_), post_processing_pipeline_( - base::MakeUnique<PostProcessingPipeline>(filter_list, channels_)) {} + base::MakeUnique<PostProcessingPipeline>(filter_list, + num_channels_)) {} FilterGroup::~FilterGroup() = default; @@ -53,36 +54,39 @@ mixed_->ZeroFramesPartial(0, chunk_size); for (StreamMixerAlsa::InputQueue* input : active_inputs_) { input->GetResampledData(temp_.get(), chunk_size); - for (int c = 0; c < channels_; ++c) { - input->VolumeScaleAccumulate(c, temp_->channel(c), chunk_size, - mixed_->channel(c)); + for (int c = 0; c < num_channels_; ++c) { + DCHECK(channels_[c]); + input->VolumeScaleAccumulate(c != 0, temp_->channel(c), chunk_size, + channels_[c]); } } + post_processing_pipeline_->ProcessFrames(channels_, chunk_size, volume_, + active_inputs_.empty()); mixed_->ToInterleaved(chunk_size, BytesPerOutputFormatSample(), interleaved_.data()); - post_processing_pipeline_->ProcessFrames(interleaved_.data(), chunk_size, - volume_, active_inputs_.empty()); - return true; } void FilterGroup::ClearInterleaved(int chunk_size) { ResizeBuffersIfNecessary(chunk_size); memset(interleaved_.data(), 0, - static_cast<size_t>(chunk_size) * channels_ * + static_cast<size_t>(chunk_size) * num_channels_ * BytesPerOutputFormatSample()); } void FilterGroup::ResizeBuffersIfNecessary(int chunk_size) { if (!mixed_ || mixed_->frames() < chunk_size) { - mixed_ = ::media::AudioBus::Create(channels_, chunk_size); + mixed_ = ::media::AudioBus::Create(num_channels_, chunk_size); + for (int c = 0; c < num_channels_; ++c) { + channels_[c] = mixed_->channel(c); + } } if (!temp_ || temp_->frames() < chunk_size) { - temp_ = ::media::AudioBus::Create(channels_, chunk_size); + temp_ = ::media::AudioBus::Create(num_channels_, chunk_size); } - size_t interleaved_size = static_cast<size_t>(chunk_size) * channels_ * + size_t interleaved_size = static_cast<size_t>(chunk_size) * num_channels_ * BytesPerOutputFormatSample(); if (interleaved_.size() < interleaved_size) { @@ -100,7 +104,7 @@ void FilterGroup::DisablePostProcessingForTest() { post_processing_pipeline_ = - base::MakeUnique<PostProcessingPipeline>(nullptr, channels_); + base::MakeUnique<PostProcessingPipeline>(nullptr, num_channels_); } } // namespace media
diff --git a/chromecast/media/cma/backend/alsa/filter_group.h b/chromecast/media/cma/backend/alsa/filter_group.h index 1798814..a68b6af 100644 --- a/chromecast/media/cma/backend/alsa/filter_group.h +++ b/chromecast/media/cma/backend/alsa/filter_group.h
@@ -80,7 +80,7 @@ const std::unordered_set<std::string> input_types_; const AudioContentType content_type_; - const int channels_; + const int num_channels_; std::vector<StreamMixerAlsa::InputQueue*> active_inputs_; int output_samples_per_second_; @@ -93,6 +93,7 @@ std::unique_ptr<::media::AudioBus> temp_; std::unique_ptr<::media::AudioBus> mixed_; std::vector<uint8_t> interleaved_; + std::vector<float*> channels_; std::unique_ptr<PostProcessingPipeline> post_processing_pipeline_;
diff --git a/chromecast/media/cma/backend/alsa/post_processing_pipeline.cc b/chromecast/media/cma/backend/alsa/post_processing_pipeline.cc index 2694817..d8c7c5e 100644 --- a/chromecast/media/cma/backend/alsa/post_processing_pipeline.cc +++ b/chromecast/media/cma/backend/alsa/post_processing_pipeline.cc
@@ -64,7 +64,7 @@ PostProcessingPipeline::~PostProcessingPipeline() = default; -int PostProcessingPipeline::ProcessFrames(uint8_t* data, +int PostProcessingPipeline::ProcessFrames(const std::vector<float*>& data, int num_frames, float current_volume, bool is_silence) {
diff --git a/chromecast/media/cma/backend/alsa/post_processing_pipeline.h b/chromecast/media/cma/backend/alsa/post_processing_pipeline.h index 051ba65..b3864c68 100644 --- a/chromecast/media/cma/backend/alsa/post_processing_pipeline.h +++ b/chromecast/media/cma/backend/alsa/post_processing_pipeline.h
@@ -30,8 +30,7 @@ int channels); ~PostProcessingPipeline(); - // TODO(bshaya): Switch to float* - int ProcessFrames(uint8_t* data, + int ProcessFrames(const std::vector<float*>& data, int num_frames, float current_volume, bool is_silence);
diff --git a/chromecast/media/cma/backend/alsa/post_processors/governor_shlib.cc b/chromecast/media/cma/backend/alsa/post_processors/governor_shlib.cc index 91cd98fa..e4af055a 100644 --- a/chromecast/media/cma/backend/alsa/post_processors/governor_shlib.cc +++ b/chromecast/media/cma/backend/alsa/post_processors/governor_shlib.cc
@@ -37,7 +37,9 @@ ~Governor() override; bool SetSampleRate(int sample_rate) override; - int ProcessFrames(uint8_t* data, int frames, float volume) override; + int ProcessFrames(const std::vector<float*>& data, + int frames, + float volume) override; int GetRingingTimeInFrames() override; private: @@ -72,15 +74,22 @@ return true; } -int Governor::ProcessFrames(uint8_t* data, int frames, float volume) { +int Governor::ProcessFrames(const std::vector<float*>& data, + int frames, + float volume) { + DCHECK_EQ(data.size(), static_cast<size_t>(channels_)); + if (volume != volume_) { volume_ = volume; governor_.SetVolume(GetGovernorMultiplier()); } - if (!governor_.ProcessInterleaved(reinterpret_cast<int32_t*>(data), frames)) { - LOG(ERROR) << "Error in SlewVolume::ProcessInterleaved"; + for (int c = 0; c < channels_; ++c) { + DCHECK(data[c]); + governor_.ProcessFMAC(c != 0 /* repeat_transition */, data[c], frames, + data[c]); } + return 0; // No delay in this pipeline. }
diff --git a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc index 883edd2..17a791f 100644 --- a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc +++ b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
@@ -729,7 +729,8 @@ backend_->Start(kStartPts); int64_t current_pts = backend()->GetCurrentPts(); - EXPECT_TRUE(kStartPts || current_pts == std::numeric_limits<int64_t>::min()); + EXPECT_TRUE(current_pts == kStartPts || + current_pts == std::numeric_limits<int64_t>::min()); last_pts_ = current_pts; base::ThreadTaskRunnerHandle::Get()->PostTask( @@ -778,7 +779,7 @@ void AudioVideoPipelineDeviceTest::MonitorLoop() { // Backend is stopped, no need to monitor the loop any more. - if (stopped_) + if (stopped_ || !backend_) return; // Run checks while playing (once).
diff --git a/chromecast/public/media/audio_post_processor_shlib.h b/chromecast/public/media/audio_post_processor_shlib.h index 0a0ef12..e8e912a 100644 --- a/chromecast/public/media/audio_post_processor_shlib.h +++ b/chromecast/public/media/audio_post_processor_shlib.h
@@ -23,6 +23,8 @@ // Chromium dependencies. // Called from StreamMixerAlsa when shared objects are listed in // /etc/cast_audio.json +// AudioPostProcessors are created on startup and only destroyed/reset +// if the output sample rate changes. extern "C" CHROMECAST_EXPORT chromecast::media::AudioPostProcessor* AudioPostProcessorShlib_Create(const std::string& config, int channels); @@ -38,14 +40,21 @@ virtual bool SetSampleRate(int sample_rate) = 0; // Processes audio frames from |data|, overwriting contents. - // |data| will always be 32-bit interleaved float. - // Always provides |frames| frames of data back (may output 0’s) - // |volume| is the current attenuation level of the stream. + // |data| will always be 32-bit planar float. + // |frames| is the number of audio frames in data and is + // always non-zero and less than or equal to 20ms of audio. + // AudioPostProcessor must always provide |frames| frames of data back + // (may output 0’s) + // |volume| is the attenuation level (multiplier) of the stream. + // |volume| is between 0 and 1 inclusive. // AudioPostProcessor should assume that it has already been applied. + // TODO(bshaya): Change |volume| to Cast System Volume. // Returns the current rendering delay of the filter in frames, // or negative if an error occurred during processing. // If an error occurred during processing, |data| should be unchanged. - virtual int ProcessFrames(uint8_t* data, int frames, float volume) = 0; + virtual int ProcessFrames(const std::vector<float*>& data, + int frames, + float volume) = 0; // Returns the number of frames of silence it will take for the // processor to come to rest.
diff --git a/chromeos/dbus/fake_power_manager_client.cc b/chromeos/dbus/fake_power_manager_client.cc index d2decd9..9034cca 100644 --- a/chromeos/dbus/fake_power_manager_client.cc +++ b/chromeos/dbus/fake_power_manager_client.cc
@@ -185,6 +185,13 @@ observer.PowerButtonEventReceived(down, timestamp); } +void FakePowerManagerClient::SetLidState(LidState state, + const base::TimeTicks& timestamp) { + lid_state_ = state; + for (auto& observer : observers_) + observer.LidEventReceived(state, timestamp); +} + void FakePowerManagerClient::UpdatePowerProperties( const power_manager::PowerSupplyProperties& power_props) { props_ = power_props;
diff --git a/chromeos/dbus/fake_power_manager_client.h b/chromeos/dbus/fake_power_manager_client.h index d408729..c59a7e9 100644 --- a/chromeos/dbus/fake_power_manager_client.h +++ b/chromeos/dbus/fake_power_manager_client.h
@@ -42,8 +42,6 @@ int num_set_backlights_forced_off_calls() const { return num_set_backlights_forced_off_calls_; } - - void set_lid_state(LidState state) { lid_state_ = state; } void set_tablet_mode(TabletMode mode) { tablet_mode_ = mode; } // PowerManagerClient overrides @@ -93,6 +91,9 @@ // Notifies observers that the power button has been pressed or released. void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); + // Sets |lid_state_| and notifies |observers_| about the change. + void SetLidState(LidState state, const base::TimeTicks& timestamp); + // Updates |props_| and notifies observers of its changes. void UpdatePowerProperties( const power_manager::PowerSupplyProperties& power_props);
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index 51a1676..212eef1 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -599,6 +599,23 @@ } } +// Returns true iff there is a password field in |frame|. +bool HasPasswordField(const blink::WebLocalFrame& frame) { + CR_DEFINE_STATIC_LOCAL(blink::WebString, kPassword, ("password")); + + const blink::WebElementCollection elements = frame.GetDocument().All(); + for (blink::WebElement element = elements.FirstItem(); !element.IsNull(); + element = elements.NextItem()) { + if (element.IsFormControlElement()) { + const blink::WebFormControlElement& control = + element.To<blink::WebFormControlElement>(); + if (control.FormControlType() == kPassword) + return true; + } + } + return false; +} + } // namespace //////////////////////////////////////////////////////////////////////////////// @@ -609,6 +626,7 @@ logging_state_active_(false), was_username_autofilled_(false), was_password_autofilled_(false), + sent_request_to_store_(false), binding_(this) { // PasswordAutofillAgent is guaranteed to outlive |render_frame|. render_frame->GetInterfaceRegistry()->AddInterface( @@ -1118,20 +1136,33 @@ } } - if (password_forms.empty() && !only_visible) { - // We need to send the PasswordFormsRendered message regardless of whether - // there are any forms visible, as this is also the code path that triggers - // showing the infobar. - return; - } - if (only_visible) { + // Send the PasswordFormsRendered message regardless of whether + // |password_forms| is empty. The empty |password_forms| are a possible + // signal to the browser that a pending login attempt succeeded. blink::WebFrame* main_frame = render_frame()->GetWebFrame()->Top(); bool did_stop_loading = !main_frame || !main_frame->IsLoading(); GetPasswordManagerDriver()->PasswordFormsRendered(password_forms, did_stop_loading); } else { - GetPasswordManagerDriver()->PasswordFormsParsed(password_forms); + // If there is a password field, but the list of password forms is empty for + // some reason, add a dummy form to the list. It will cause a request to the + // store. Therefore, saved passwords will be available for filling on click. + if (!sent_request_to_store_ && password_forms.empty() && + HasPasswordField(*frame)) { + // Set everything that |FormDigest| needs. + password_forms.push_back(PasswordForm()); + password_forms.back().scheme = PasswordForm::SCHEME_HTML; + password_forms.back().origin = + form_util::GetCanonicalOriginForDocument(frame->GetDocument()); + GURL::Replacements rep; + rep.SetPathStr(""); + password_forms.back().signon_realm = + password_forms.back().origin.ReplaceComponents(rep).spec(); + sent_request_to_store_ = true; + } + if (!password_forms.empty()) + GetPasswordManagerDriver()->PasswordFormsParsed(password_forms); } } @@ -1565,6 +1596,7 @@ web_input_to_password_info_.clear(); provisionally_saved_form_.Reset(); field_value_and_properties_map_.clear(); + sent_request_to_store_ = false; } void PasswordAutofillAgent::ClearPreview(
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index 6447d3a..486e8eb 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -283,6 +283,9 @@ // True indicates that the password field was autofilled, false otherwise. bool was_password_autofilled_; + // True indicates that a request for credentials has been sent to the store. + bool sent_request_to_store_; + // Records the username typed before suggestions preview. base::string16 username_query_prefix_;
diff --git a/components/autofill/core/browser/region_combobox_model.cc b/components/autofill/core/browser/region_combobox_model.cc index ffdb13e..509bd596 100644 --- a/components/autofill/core/browser/region_combobox_model.cc +++ b/components/autofill/core/browser/region_combobox_model.cc
@@ -22,12 +22,13 @@ std::unique_ptr<::i18n::addressinput::Storage> storage, const std::string& app_locale, const std::string& country_code) - : app_locale_(app_locale), + : failed_to_load_data_(false), + pending_region_data_load_(false), + app_locale_(app_locale), region_data_supplier_(source.release(), storage.release()) { region_data_supplier_callback_.reset(::i18n::addressinput::BuildCallback( this, &RegionComboboxModel::RegionDataLoaded)); - region_data_supplier_.LoadRules(country_code, - *region_data_supplier_callback_.get()); + LoadRegionData(country_code); } RegionComboboxModel::~RegionComboboxModel() {} @@ -35,9 +36,7 @@ int RegionComboboxModel::GetItemCount() const { // The combobox view needs to always have at least one item. If the regions // have not been completely loaded yet, we display a single "loading" item. - // But if we failed to load, we return 0 so that the view can be identified - // as empty and potentially replaced by another view during ReLayout. - if (regions_.size() == 0 && !failed_to_load_data_) + if (regions_.size() == 0) return 1; return regions_.size(); } @@ -72,18 +71,37 @@ observers_.RemoveObserver(observer); } +void RegionComboboxModel::SetFailureModeForTests(bool failed_to_load_data) { + failed_to_load_data_ = failed_to_load_data; + for (auto& observer : observers_) { + observer.OnComboboxModelChanged(this); + } +} + +void RegionComboboxModel::LoadRegionData(const std::string& country_code) { + pending_region_data_load_ = true; + region_data_supplier_.LoadRules(country_code, + *region_data_supplier_callback_.get()); +} + void RegionComboboxModel::RegionDataLoaded(bool success, const std::string& country_code, int rule_count) { + pending_region_data_load_ = false; if (success) { - failed_to_load_data_ = false; std::string best_region_tree_language_tag; ::i18n::addressinput::RegionDataBuilder builder(®ion_data_supplier_); const std::vector<const ::i18n::addressinput::RegionData*>& regions = builder.Build(country_code, app_locale_, &best_region_tree_language_tag) .sub_regions(); - for (auto* const region : regions) { - regions_.push_back(std::make_pair(region->key(), region->name())); + // Some countries expose a state field but have not region names available. + if (regions.size() > 0) { + failed_to_load_data_ = false; + for (auto* const region : regions) { + regions_.push_back(std::make_pair(region->key(), region->name())); + } + } else { + failed_to_load_data_ = true; } } else { // TODO(mad): Maybe use a static list as is done for countries in
diff --git a/components/autofill/core/browser/region_combobox_model.h b/components/autofill/core/browser/region_combobox_model.h index 7d92571..aa16bc88 100644 --- a/components/autofill/core/browser/region_combobox_model.h +++ b/components/autofill/core/browser/region_combobox_model.h
@@ -36,6 +36,9 @@ const std::string& country_code); ~RegionComboboxModel() override; + bool pending_region_data_load() const { return pending_region_data_load_; } + bool failed_to_load_data() const { return failed_to_load_data_; } + // ui::ComboboxModel implementation: int GetItemCount() const override; base::string16 GetItemAt(int index) override; @@ -43,12 +46,22 @@ void AddObserver(ui::ComboboxModelObserver* observer) override; void RemoveObserver(ui::ComboboxModelObserver* observer) override; + // To allow testing failure states. + void SetFailureModeForTests(bool failed_to_load_data); + + private: + // Start the potentially asynchronous process of loading region data. + void LoadRegionData(const std::string& country_code); + // Callback for ::i18n::addressinput::PreloadSupplier::LoadRules void RegionDataLoaded(bool success, const std::string&, int rule_count); - private: // Whether the region data load failed or not. - bool failed_to_load_data_{false}; + bool failed_to_load_data_; + + // Set to true during region data load, and false otherwise. Whether the load + // succeeded or not doesn't affect this value. + bool pending_region_data_load_; // The application locale. const std::string app_locale_;
diff --git a/components/autofill/core/browser/region_combobox_model_unittest.cc b/components/autofill/core/browser/region_combobox_model_unittest.cc index f749e65..52878f0e 100644 --- a/components/autofill/core/browser/region_combobox_model_unittest.cc +++ b/components/autofill/core/browser/region_combobox_model_unittest.cc
@@ -34,8 +34,8 @@ void SetupCombobox(bool source_failure) { model_.reset(new RegionComboboxModel( - base::WrapUnique(new TestSource(source_failure)), - base::WrapUnique(new ::i18n::addressinput::NullStorage), + base::MakeUnique<TestSource>(source_failure), + base::MakeUnique<::i18n::addressinput::NullStorage>(), manager_.app_locale(), kTestCountryCode)); } @@ -94,12 +94,14 @@ EXPECT_EQ(2, model()->GetItemCount()); EXPECT_EQ(base::ASCIIToUTF16(kQuebec), model()->GetItemAt(0)); EXPECT_EQ(base::ASCIIToUTF16(kOntario), model()->GetItemAt(1)); + EXPECT_FALSE(model()->failed_to_load_data()); } // Make sure the combo box properly support source failures. TEST_F(RegionComboboxModelTest, FailingSource) { SetupCombobox(true); - EXPECT_EQ(0, model()->GetItemCount()); + EXPECT_EQ(1, model()->GetItemCount()); + EXPECT_TRUE(model()->failed_to_load_data()); } } // namespace autofill
diff --git a/components/constrained_window/constrained_window_views_unittest.cc b/components/constrained_window/constrained_window_views_unittest.cc index 26a4b6a..b0c98d3 100644 --- a/components/constrained_window/constrained_window_views_unittest.cc +++ b/components/constrained_window/constrained_window_views_unittest.cc
@@ -220,7 +220,7 @@ // Ensure CreateBrowserModalDialogViews() works correctly with a null parent. TEST_F(ConstrainedWindowViewsTest, NullModalParent) { // Use desktop widgets (except on ChromeOS) for extra coverage. - views_delegate()->set_use_desktop_native_widgets(true); + test_views_delegate()->set_use_desktop_native_widgets(true); SetConstrainedWindowViewsClient( base::MakeUnique<TestConstrainedWindowViewsClient>());
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc index c336696c..f232e945 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -23,6 +23,7 @@ #include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h" #include "components/data_reduction_proxy/core/common/lofi_decider.h" #include "net/base/load_flags.h" +#include "net/base/mime_util.h" #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/nqe/network_quality_estimator.h" @@ -46,27 +47,31 @@ // |freshness_lifetime| contains information on how long the resource will be // fresh for and how long is the usability. void RecordContentLengthHistograms(bool lofi_low_header_added, + bool is_https, + bool is_video, int64_t received_content_length, int64_t original_content_length, const base::TimeDelta& freshness_lifetime) { // Add the current resource to these histograms only when a valid // X-Original-Content-Length header is present. if (original_content_length >= 0) { - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthWithValidOCL", - received_content_length); - UMA_HISTOGRAM_COUNTS("Net.HttpOriginalContentLengthWithValidOCL", - original_content_length); - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthDifferenceWithValidOCL", - original_content_length - received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthWithValidOCL", + received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpOriginalContentLengthWithValidOCL", + original_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthDifferenceWithValidOCL", + original_content_length - received_content_length); // Populate Lo-Fi content length histograms. if (lofi_low_header_added) { - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthWithValidOCL.LoFiOn", - received_content_length); - UMA_HISTOGRAM_COUNTS("Net.HttpOriginalContentLengthWithValidOCL.LoFiOn", - original_content_length); - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthDifferenceWithValidOCL.LoFiOn", - original_content_length - received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthWithValidOCL.LoFiOn", + received_content_length); + UMA_HISTOGRAM_COUNTS_1M( + "Net.HttpOriginalContentLengthWithValidOCL.LoFiOn", + original_content_length); + UMA_HISTOGRAM_COUNTS_1M( + "Net.HttpContentLengthDifferenceWithValidOCL.LoFiOn", + original_content_length - received_content_length); } } else { @@ -74,11 +79,22 @@ // length if the X-Original-Content-Header is not present. original_content_length = received_content_length; } - UMA_HISTOGRAM_COUNTS("Net.HttpContentLength", received_content_length); - UMA_HISTOGRAM_COUNTS("Net.HttpOriginalContentLength", - original_content_length); - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthDifference", - original_content_length - received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLength", received_content_length); + if (is_https) { + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLength.Https", + received_content_length); + } else { + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLength.Http", + received_content_length); + } + if (is_video) { + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLength.Video", + received_content_length); + } + UMA_HISTOGRAM_COUNTS_1M("Net.HttpOriginalContentLength", + original_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthDifference", + original_content_length - received_content_length); UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpContentFreshnessLifetime", freshness_lifetime.InSeconds(), base::TimeDelta::FromHours(1).InSeconds(), @@ -86,17 +102,17 @@ 100); if (freshness_lifetime.InSeconds() <= 0) return; - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthCacheable", - received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthCacheable", + received_content_length); if (freshness_lifetime.InHours() < 4) return; - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthCacheable4Hours", - received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthCacheable4Hours", + received_content_length); if (freshness_lifetime.InHours() < 24) return; - UMA_HISTOGRAM_COUNTS("Net.HttpContentLengthCacheable24Hours", - received_content_length); + UMA_HISTOGRAM_COUNTS_1M("Net.HttpContentLengthCacheable24Hours", + received_content_length); } // Given a |request| that went through the Data Reduction Proxy, this function @@ -448,14 +464,21 @@ ->GetFreshnessLifetimes(request.response_info().response_time) .freshness; + bool is_https = request.url().SchemeIs("https"); + bool is_video = false; + std::string mime_type; + if (request.response_headers()->GetMimeType(&mime_type)) { + is_video = net::MatchesMimeType("video/*", mime_type); + } + RecordContentLengthHistograms( // |data_reduction_proxy_io_data_| can be NULL for Webview. data_reduction_proxy_io_data_ && data_reduction_proxy_io_data_->IsEnabled() && data_reduction_proxy_io_data_->lofi_decider() && data_reduction_proxy_io_data_->lofi_decider()->IsUsingLoFi(request), - request.received_response_content_length(), original_content_length, - freshness_lifetime); + is_https, is_video, request.received_response_content_length(), + original_content_length, freshness_lifetime); if (data_reduction_proxy_io_data_ && data_reduction_proxy_bypass_stats_) { // Record BypassedBytes histograms for the request.
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc index 8e3a0d46..756102e 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -72,6 +72,38 @@ const char kOtherProxy[] = "testproxy:17"; const char kTestURL[] = "http://www.google.com/"; +const char kSecureTestURL[] = "https://www.google.com/"; + +const std::string kReceivedValidOCLHistogramName = + "Net.HttpContentLengthWithValidOCL"; +const std::string kOriginalValidOCLHistogramName = + "Net.HttpOriginalContentLengthWithValidOCL"; +const std::string kDifferenceValidOCLHistogramName = + "Net.HttpContentLengthDifferenceWithValidOCL"; + +// Lo-Fi histograms. +const std::string kReceivedValidOCLLoFiOnHistogramName = + "Net.HttpContentLengthWithValidOCL.LoFiOn"; +const std::string kOriginalValidOCLLoFiOnHistogramName = + "Net.HttpOriginalContentLengthWithValidOCL.LoFiOn"; +const std::string kDifferenceValidOCLLoFiOnHistogramName = + "Net.HttpContentLengthDifferenceWithValidOCL.LoFiOn"; + +const std::string kReceivedHistogramName = "Net.HttpContentLength"; +const std::string kReceivedInsecureHistogramName = "Net.HttpContentLength.Http"; +const std::string kReceivedSecureHistogramName = "Net.HttpContentLength.Https"; +const std::string kReceivedVideoHistogramName = "Net.HttpContentLength.Video"; +const std::string kOriginalHistogramName = "Net.HttpOriginalContentLength"; +const std::string kDifferenceHistogramName = "Net.HttpContentLengthDifference"; +const std::string kFreshnessLifetimeHistogramName = + "Net.HttpContentFreshnessLifetime"; +const std::string kCacheableHistogramName = "Net.HttpContentLengthCacheable"; +const std::string kCacheable4HoursHistogramName = + "Net.HttpContentLengthCacheable4Hours"; +const std::string kCacheable24HoursHistogramName = + "Net.HttpContentLengthCacheable24Hours"; +const int64_t kResponseContentLength = 100; +const int64_t kOriginalContentLength = 200; #if defined(OS_ANDROID) const Client kClient = Client::CHROME_ANDROID; @@ -180,6 +212,8 @@ bool on_lofi_response_; }; +enum ProxyTestConfig { USE_SECURE_PROXY, USE_INSECURE_PROXY, BYPASS_PROXY }; + class DataReductionProxyNetworkDelegateTest : public testing::Test { public: DataReductionProxyNetworkDelegateTest() @@ -191,24 +225,35 @@ net::GetTestCertsDirectory(), "unittest.selfsigned.der"); } - void Init(bool use_secure_proxy, bool enable_brotli_globally) { - net::ProxyServer proxy_server = - use_secure_proxy - ? net::ProxyServer::FromURI("https://origin.net:443", - net::ProxyServer::SCHEME_HTTPS) - : net::ProxyServer::FromURI("http://origin.net:80", - net::ProxyServer::SCHEME_HTTP); - + void Init(ProxyTestConfig proxy_config, bool enable_brotli_globally) { + net::ProxyServer proxy_server; + switch (proxy_config) { + case BYPASS_PROXY: + proxy_server = net::ProxyServer::Direct(); + break; + case USE_SECURE_PROXY: + proxy_server = net::ProxyServer::FromURI( + "https://origin.net:443", net::ProxyServer::SCHEME_HTTPS); + break; + case USE_INSECURE_PROXY: + proxy_server = net::ProxyServer::FromURI("http://origin.net:80", + net::ProxyServer::SCHEME_HTTP); + break; + } proxy_service_ = net::ProxyService::CreateFixedFromPacResult(proxy_server.ToPacString()); context_.set_proxy_service(proxy_service_.get()); - test_context_ = (DataReductionProxyTestContext::Builder() - .WithClient(kClient) - .WithMockClientSocketFactory(&mock_socket_factory_) - .WithURLRequestContext(&context_) - .WithProxiesForHttp({DataReductionProxyServer( - proxy_server, ProxyServer::UNSPECIFIED_TYPE)}) - .Build()); + DataReductionProxyTestContext::Builder builder; + builder = builder.WithClient(kClient) + .WithMockClientSocketFactory(&mock_socket_factory_) + .WithURLRequestContext(&context_); + + if (proxy_config != BYPASS_PROXY) { + builder = builder.WithProxiesForHttp({DataReductionProxyServer( + proxy_server, ProxyServer::UNSPECIFIED_TYPE)}); + } + + test_context_ = builder.Build(); context_.set_client_socket_factory(&mock_socket_factory_); test_context_->AttachToURLRequestContext(&context_storage_); @@ -552,6 +597,10 @@ return &test_network_quality_estimator_; } + net::SSLSocketDataProvider* ssl_socket_data_provider() { + return &ssl_socket_data_provider_; + } + private: base::MessageLoopForIO message_loop_; net::MockClientSocketFactory mock_socket_factory_; @@ -573,7 +622,7 @@ }; TEST_F(DataReductionProxyNetworkDelegateTest, AuthenticationTest) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); std::unique_ptr<net::URLRequest> fake_request( FetchURLRequest(GURL(kTestURL), nullptr, std::string(), 0, 0)); @@ -603,7 +652,7 @@ } TEST_F(DataReductionProxyNetworkDelegateTest, LoFiTransitions) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); // Enable Lo-Fi. const struct { bool lofi_switch_enabled; @@ -754,7 +803,7 @@ } TEST_F(DataReductionProxyNetworkDelegateTest, RequestDataConfigurations) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); const struct { bool lofi_on; bool used_data_reduction_proxy; @@ -830,7 +879,7 @@ TEST_F(DataReductionProxyNetworkDelegateTest, RequestDataHoldbackConfigurations) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); const struct { bool data_reduction_proxy_enabled; bool used_direct; @@ -877,7 +926,7 @@ } TEST_F(DataReductionProxyNetworkDelegateTest, RedirectRequestDataCleared) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); net::ProxyInfo data_reduction_proxy_info; std::string data_reduction_proxy; base::TrimString(params()->DefaultOrigin(), "/", &data_reduction_proxy); @@ -944,35 +993,7 @@ } TEST_F(DataReductionProxyNetworkDelegateTest, NetHistograms) { - Init(false, false); - const std::string kReceivedValidOCLHistogramName = - "Net.HttpContentLengthWithValidOCL"; - const std::string kOriginalValidOCLHistogramName = - "Net.HttpOriginalContentLengthWithValidOCL"; - const std::string kDifferenceValidOCLHistogramName = - "Net.HttpContentLengthDifferenceWithValidOCL"; - - // Lo-Fi histograms. - const std::string kReceivedValidOCLLoFiOnHistogramName = - "Net.HttpContentLengthWithValidOCL.LoFiOn"; - const std::string kOriginalValidOCLLoFiOnHistogramName = - "Net.HttpOriginalContentLengthWithValidOCL.LoFiOn"; - const std::string kDifferenceValidOCLLoFiOnHistogramName = - "Net.HttpContentLengthDifferenceWithValidOCL.LoFiOn"; - - const std::string kReceivedHistogramName = "Net.HttpContentLength"; - const std::string kOriginalHistogramName = "Net.HttpOriginalContentLength"; - const std::string kDifferenceHistogramName = - "Net.HttpContentLengthDifference"; - const std::string kFreshnessLifetimeHistogramName = - "Net.HttpContentFreshnessLifetime"; - const std::string kCacheableHistogramName = "Net.HttpContentLengthCacheable"; - const std::string kCacheable4HoursHistogramName = - "Net.HttpContentLengthCacheable4Hours"; - const std::string kCacheable24HoursHistogramName = - "Net.HttpContentLengthCacheable24Hours"; - const int64_t kResponseContentLength = 100; - const int64_t kOriginalContentLength = 200; + Init(USE_INSECURE_PROXY, false); base::HistogramTester histogram_tester; @@ -1002,6 +1023,12 @@ kOriginalContentLength - kResponseContentLength, 1); histogram_tester.ExpectUniqueSample(kReceivedHistogramName, kResponseContentLength, 1); + histogram_tester.ExpectUniqueSample(kReceivedInsecureHistogramName, + kResponseContentLength, 1); + histogram_tester.ExpectTotalCount(kReceivedSecureHistogramName, 0); + histogram_tester.ExpectTotalCount(kReceivedVideoHistogramName, 0); + histogram_tester.ExpectUniqueSample(kReceivedInsecureHistogramName, + kResponseContentLength, 1); histogram_tester.ExpectUniqueSample(kOriginalHistogramName, kOriginalContentLength, 1); histogram_tester.ExpectUniqueSample( @@ -1092,8 +1119,57 @@ } } +TEST_F(DataReductionProxyNetworkDelegateTest, NetVideoHistograms) { + Init(USE_INSECURE_PROXY, false); + + base::HistogramTester histogram_tester; + + // Check video + std::string video_response_headers = + "HTTP/1.1 200 OK\r\n" + "Date: Wed, 28 Nov 2007 09:40:09 GMT\r\n" + "Expires: Mon, 24 Nov 2014 12:45:26 GMT\r\n" + "Content-Type: video/mp4\r\n" + "Via: 1.1 Chrome-Compression-Proxy\r\n" + "x-original-content-length: " + + base::Int64ToString(kOriginalContentLength) + "\r\n\r\n"; + + FetchURLRequest(GURL(kTestURL), nullptr, video_response_headers, + kResponseContentLength, 0); + + histogram_tester.ExpectUniqueSample(kReceivedInsecureHistogramName, + kResponseContentLength, 1); + histogram_tester.ExpectTotalCount(kReceivedSecureHistogramName, 0); + histogram_tester.ExpectUniqueSample(kReceivedVideoHistogramName, + kResponseContentLength, 1); +} + +TEST_F(DataReductionProxyNetworkDelegateTest, NetSSLHistograms) { + Init(BYPASS_PROXY, false); + + base::HistogramTester histogram_tester; + + // Check https + std::string secure_response_headers = + "HTTP/1.1 200 OK\r\n" + "Date: Wed, 28 Nov 2007 09:40:09 GMT\r\n" + "Expires: Mon, 24 Nov 2014 12:45:26 GMT\r\n" + "Via: 1.1 Chrome-Compression-Proxy\r\n" + "x-original-content-length: " + + base::Int64ToString(kOriginalContentLength) + "\r\n\r\n"; + + mock_socket_factory()->AddSSLSocketDataProvider(ssl_socket_data_provider()); + FetchURLRequest(GURL(kSecureTestURL), nullptr, secure_response_headers, + kResponseContentLength, 0); + + histogram_tester.ExpectTotalCount(kReceivedInsecureHistogramName, 0); + histogram_tester.ExpectUniqueSample(kReceivedSecureHistogramName, + kResponseContentLength, 1); + histogram_tester.ExpectTotalCount(kReceivedVideoHistogramName, 0); +} + TEST_F(DataReductionProxyNetworkDelegateTest, OnCompletedInternalLoFi) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); // Enable Lo-Fi. const struct { bool lofi_response; @@ -1121,7 +1197,7 @@ TEST_F(DataReductionProxyNetworkDelegateTest, TestLoFiTransformationTypeHistogram) { - Init(false, false); + Init(USE_INSECURE_PROXY, false); const char kLoFiTransformationTypeHistogram[] = "DataReductionProxy.LoFi.TransformationType"; base::HistogramTester histogram_tester; @@ -1152,7 +1228,7 @@ // disabled globally. TEST_F(DataReductionProxyNetworkDelegateTest, BrotliAdvertisement_BrotliDisabled) { - Init(true /* use_secure_proxy */, false /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, false /* enable_brotli_globally */); ReadBrotliFile(); @@ -1174,7 +1250,7 @@ // is fetched from an insecure proxy. TEST_F(DataReductionProxyNetworkDelegateTest, BrotliAdvertisementInsecureProxy) { - Init(false /* use_secure_proxy */, true /* enable_brotli_globally */); + Init(USE_INSECURE_PROXY, true /* enable_brotli_globally */); std::string response_headers = "HTTP/1.1 200 OK\r\n" "Content-Length: 140\r\n" @@ -1200,7 +1276,7 @@ // disabled via data reduction proxy field trial. TEST_F(DataReductionProxyNetworkDelegateTest, BrotliAdvertisementDisabledViaFieldTrial) { - Init(true /* use_secure_proxy */, true /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, true /* enable_brotli_globally */); base::FieldTrialList field_trial_list(nullptr); ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( @@ -1222,7 +1298,7 @@ // Test that Brotli is correctly added to the accept-encoding header when it is // enabled globally. TEST_F(DataReductionProxyNetworkDelegateTest, BrotliAdvertisement) { - Init(true /* use_secure_proxy */, true /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, true /* enable_brotli_globally */); std::string response_headers = "HTTP/1.1 200 OK\r\n" @@ -1239,7 +1315,7 @@ TEST_F(DataReductionProxyNetworkDelegateTest, IncrementingMainFramePageId) { // This is unaffacted by brotil and insecure proxy. - Init(true /* use_secure_proxy */, false /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, false /* enable_brotli_globally */); io_data()->request_options()->SetSecureSession("new-session"); @@ -1252,7 +1328,7 @@ TEST_F(DataReductionProxyNetworkDelegateTest, ResetSessionResetsId) { // This is unaffacted by brotil and insecure proxy. - Init(true /* use_secure_proxy */, false /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, false /* enable_brotli_globally */); io_data()->request_options()->SetSecureSession("new-session"); @@ -1265,14 +1341,14 @@ TEST_F(DataReductionProxyNetworkDelegateTest, SubResourceNoPageId) { // This is unaffacted by brotil and insecure proxy. - Init(true /* use_secure_proxy */, false /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, false /* enable_brotli_globally */); io_data()->request_options()->SetSecureSession("new-session"); FetchURLRequestAndVerifyPageIdDirective(std::string(), false); } TEST_F(DataReductionProxyNetworkDelegateTest, RedirectSharePid) { // This is unaffacted by brotil and insecure proxy. - Init(true /* use_secure_proxy */, false /* enable_brotli_globally */); + Init(USE_SECURE_PROXY, false /* enable_brotli_globally */); io_data()->request_options()->SetSecureSession("new-session"); @@ -1285,7 +1361,7 @@ // state changing in between redirects within an URLRequest's lifetime. // This is unaffacted by brotil and insecure proxy. - Init(false /* use_secure_proxy */, false /* enable_brotli_globally */); + Init(USE_INSECURE_PROXY, false /* enable_brotli_globally */); net::ProxyInfo data_reduction_proxy_info; std::string data_reduction_proxy; base::TrimString(params()->DefaultOrigin(), "/", &data_reduction_proxy);
diff --git a/components/favicon/core/favicon_driver_impl.cc b/components/favicon/core/favicon_driver_impl.cc index 61e5b08..f77d11b 100644 --- a/components/favicon/core/favicon_driver_impl.cc +++ b/components/favicon/core/favicon_driver_impl.cc
@@ -5,6 +5,7 @@ #include "components/favicon/core/favicon_driver_impl.h" #include "base/logging.h" +#include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "build/build_config.h" @@ -52,13 +53,17 @@ : favicon_service_(favicon_service), history_service_(history_service), bookmark_model_(bookmark_model) { - favicon_handler_.reset(new FaviconHandler( - favicon_service_, this, kEnableTouchIcon - ? FaviconDriverObserver::NON_TOUCH_LARGEST - : FaviconDriverObserver::NON_TOUCH_16_DIP)); + if (!favicon_service_) + return; + if (kEnableTouchIcon) { - touch_icon_handler_.reset(new FaviconHandler( + handlers_.push_back(base::MakeUnique<FaviconHandler>( + favicon_service_, this, FaviconDriverObserver::NON_TOUCH_LARGEST)); + handlers_.push_back(base::MakeUnique<FaviconHandler>( favicon_service_, this, FaviconDriverObserver::TOUCH_LARGEST)); + } else { + handlers_.push_back(base::MakeUnique<FaviconHandler>( + favicon_service_, this, FaviconDriverObserver::NON_TOUCH_16_DIP)); } } @@ -66,9 +71,8 @@ } void FaviconDriverImpl::FetchFavicon(const GURL& url) { - favicon_handler_->FetchFavicon(url); - if (touch_icon_handler_.get()) - touch_icon_handler_->FetchFavicon(url); + for (const std::unique_ptr<FaviconHandler>& handler : handlers_) + handler->FetchFavicon(url); } bool FaviconDriverImpl::IsBookmarked(const GURL& url) { @@ -76,10 +80,10 @@ } bool FaviconDriverImpl::HasPendingTasksForTest() { - if (favicon_handler_->HasPendingTasksForTest()) - return true; - if (touch_icon_handler_ && touch_icon_handler_->HasPendingTasksForTest()) - return true; + for (const std::unique_ptr<FaviconHandler>& handler : handlers_) { + if (handler->HasPendingTasksForTest()) + return true; + } return false; } @@ -97,9 +101,8 @@ const std::vector<FaviconURL>& candidates) { DCHECK(!candidates.empty()); RecordCandidateMetrics(candidates); - favicon_handler_->OnUpdateFaviconURL(page_url, candidates); - if (touch_icon_handler_.get()) - touch_icon_handler_->OnUpdateFaviconURL(page_url, candidates); + for (const std::unique_ptr<FaviconHandler>& handler : handlers_) + handler->OnUpdateFaviconURL(page_url, candidates); } } // namespace favicon
diff --git a/components/favicon/core/favicon_driver_impl.h b/components/favicon/core/favicon_driver_impl.h index 19086367..2faa6f3 100644 --- a/components/favicon/core/favicon_driver_impl.h +++ b/components/favicon/core/favicon_driver_impl.h
@@ -75,9 +75,7 @@ bookmarks::BookmarkModel* bookmark_model_; // FaviconHandlers used to download the different kind of favicons. - // |touch_icon_handler_| may be null depending on the platform and variations. - std::unique_ptr<FaviconHandler> favicon_handler_; - std::unique_ptr<FaviconHandler> touch_icon_handler_; + std::vector<std::unique_ptr<FaviconHandler>> handlers_; DISALLOW_COPY_AND_ASSIGN(FaviconDriverImpl); };
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc index 64c8961..9ecda9b5 100644 --- a/components/favicon/core/favicon_handler.cc +++ b/components/favicon/core/favicon_handler.cc
@@ -205,14 +205,11 @@ // Request the favicon from the history service. In parallel to this the // renderer is going to notify us (well WebContents) when the favicon url is // available. - if (service_) { - service_->GetFaviconForPageURL( - url_, icon_types_, preferred_icon_size(), - base::Bind( - &FaviconHandler::OnFaviconDataForInitialURLFromFaviconService, - base::Unretained(this)), - &cancelable_task_tracker_); - } + service_->GetFaviconForPageURL( + url_, icon_types_, preferred_icon_size(), + base::Bind(&FaviconHandler::OnFaviconDataForInitialURLFromFaviconService, + base::Unretained(this)), + &cancelable_task_tracker_); } bool FaviconHandler::UpdateFaviconCandidate( @@ -243,7 +240,7 @@ void FaviconHandler::SetFavicon(const GURL& icon_url, const gfx::Image& image, favicon_base::IconType icon_type) { - if (service_ && ShouldSaveFavicon()) + if (ShouldSaveFavicon()) service_->SetFavicons(url_, icon_url, icon_type, image); NotifyFaviconUpdated(icon_url, icon_type, image); @@ -359,8 +356,7 @@ if (bitmaps.empty() && http_status_code == 404) { DVLOG(1) << "Failed to Download Favicon:" << image_url; - if (service_) - service_->UnableToDownloadFavicon(image_url); + service_->UnableToDownloadFavicon(image_url); } bool request_next_icon = true; @@ -465,7 +461,7 @@ if (redownload_icons_) { // We have the mapping, but the favicon is out of date. Download it now. ScheduleDownload(icon_url, icon_type); - } else if (service_) { + } else { // We don't know the favicon, but we may have previously downloaded the // favicon for another page that shares the same favicon. Ask for the // favicon given the favicon URL. @@ -525,7 +521,7 @@ DCHECK(image_url.is_valid()); // Note that CancelableCallback starts cancelled. DCHECK(download_request_.IsCancelled()) << "More than one ongoing download"; - if (service_ && service_->WasUnableToDownloadFavicon(image_url)) { + if (service_->WasUnableToDownloadFavicon(image_url)) { DVLOG(1) << "Skip Failed FavIcon: " << image_url; OnDidDownloadFavicon(icon_type, 0, 0, image_url, std::vector<SkBitmap>(), std::vector<gfx::Size>());
diff --git a/components/favicon/core/favicon_handler.h b/components/favicon/core/favicon_handler.h index 9e6e22b9..9105723c 100644 --- a/components/favicon/core/favicon_handler.h +++ b/components/favicon/core/favicon_handler.h
@@ -115,7 +115,7 @@ const gfx::Image& image) = 0; }; - // |delegate| must not be nullptr and must outlive this class. + // |service| and |delegate| must not be nullptr and must outlive this class. FaviconHandler(FaviconService* service, Delegate* delegate, FaviconDriverObserver::NotificationIconType handler_type);
diff --git a/components/open_from_clipboard/clipboard_recent_content.cc b/components/open_from_clipboard/clipboard_recent_content.cc index c0900e7..31963fe 100644 --- a/components/open_from_clipboard/clipboard_recent_content.cc +++ b/components/open_from_clipboard/clipboard_recent_content.cc
@@ -49,3 +49,8 @@ // Not a scheme we're allowed to return. return false; } + +// static +base::TimeDelta ClipboardRecentContent::MaximumAgeOfClipboard() { + return base::TimeDelta::FromHours(3); +}
diff --git a/components/open_from_clipboard/clipboard_recent_content.h b/components/open_from_clipboard/clipboard_recent_content.h index 93e9a50..78a1b49c 100644 --- a/components/open_from_clipboard/clipboard_recent_content.h +++ b/components/open_from_clipboard/clipboard_recent_content.h
@@ -43,7 +43,7 @@ protected: // GetRecentURLFromClipboard() should never return a URL from a clipboard // older than this. - const base::TimeDelta kMaximumAgeOfClipboard = base::TimeDelta::FromHours(3); + static base::TimeDelta MaximumAgeOfClipboard(); // Returns true if the URL is appropriate to be suggested. static bool IsAppropriateSuggestion(const GURL& url);
diff --git a/components/open_from_clipboard/clipboard_recent_content_generic.cc b/components/open_from_clipboard/clipboard_recent_content_generic.cc index 4218ce1..87c6542 100644 --- a/components/open_from_clipboard/clipboard_recent_content_generic.cc +++ b/components/open_from_clipboard/clipboard_recent_content_generic.cc
@@ -16,7 +16,7 @@ (last_modified_time == last_modified_time_to_suppress_)) return false; - if (GetClipboardContentAge() > kMaximumAgeOfClipboard) + if (GetClipboardContentAge() > MaximumAgeOfClipboard()) return false; // Get and clean up the clipboard before processing.
diff --git a/components/open_from_clipboard/clipboard_recent_content_impl_ios.h b/components/open_from_clipboard/clipboard_recent_content_impl_ios.h index e3b3891..9507df0 100644 --- a/components/open_from_clipboard/clipboard_recent_content_impl_ios.h +++ b/components/open_from_clipboard/clipboard_recent_content_impl_ios.h
@@ -23,10 +23,10 @@ // should contain all schemes considered valid. |groupUserDefaults| is the // NSUserDefaults used to store information on pasteboard entry expiration. This // information will be shared with other applications in the application group. -- (instancetype)initWithAuthorizedSchemes:(NSSet<NSString*>*)authorizedSchemes - userDefaults:(NSUserDefaults*)groupUserDefaults - delegate:(id<ClipboardRecentContentDelegate>) - delegate +- (instancetype)initWithMaxAge:(NSTimeInterval)maxAge + authorizedSchemes:(NSSet<NSString*>*)authorizedSchemes + userDefaults:(NSUserDefaults*)groupUserDefaults + delegate:(id<ClipboardRecentContentDelegate>)delegate NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE;
diff --git a/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm b/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm index 669965ce..5e506ee8 100644 --- a/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm +++ b/components/open_from_clipboard/clipboard_recent_content_impl_ios.mm
@@ -26,8 +26,6 @@ // Key used to store the hash of the content of the pasteboard. Whenever the // hash changed, the pasteboard content is considered to have changed. NSString* const kPasteboardEntryMD5Key = @"PasteboardEntryMD5"; -// Maximum age of clipboard in seconds. -NSTimeInterval const kMaximumAgeOfClipboard = 3 * 60 * 60; // Compute a hash consisting of the first 4 bytes of the MD5 hash of |string|. // This value is used to detect pasteboard content change. Keeping only 4 bytes @@ -57,6 +55,8 @@ @property(nonatomic, readonly) NSSet* authorizedSchemes; // Delegate for metrics. @property(nonatomic, strong) id<ClipboardRecentContentDelegate> delegate; +// Maximum age of clipboard in seconds. +@property(nonatomic, readonly) NSTimeInterval maximumAgeOfClipboard; // If the content of the pasteboard has changed, updates the change count, // change date, and md5 of the latest pasteboard entry if necessary. @@ -85,13 +85,15 @@ @synthesize sharedUserDefaults = _sharedUserDefaults; @synthesize authorizedSchemes = _authorizedSchemes; @synthesize delegate = _delegate; +@synthesize maximumAgeOfClipboard = _maximumAgeOfClipboard; -- (instancetype)initWithAuthorizedSchemes:(NSSet<NSString*>*)authorizedSchemes - userDefaults:(NSUserDefaults*)groupUserDefaults - delegate:(id<ClipboardRecentContentDelegate>) - delegate { +- (instancetype)initWithMaxAge:(NSTimeInterval)maxAge + authorizedSchemes:(NSSet<NSString*>*)authorizedSchemes + userDefaults:(NSUserDefaults*)groupUserDefaults + delegate:(id<ClipboardRecentContentDelegate>)delegate { self = [super init]; if (self) { + _maximumAgeOfClipboard = maxAge; _delegate = delegate; _authorizedSchemes = authorizedSchemes; _sharedUserDefaults = groupUserDefaults; @@ -150,7 +152,7 @@ - (NSURL*)recentURLFromClipboard { [self updateIfNeeded]; - if ([self clipboardContentAge] > kMaximumAgeOfClipboard) { + if ([self clipboardContentAge] > self.maximumAgeOfClipboard) { return nil; } return [self URLFromPasteboard];
diff --git a/components/open_from_clipboard/clipboard_recent_content_ios.mm b/components/open_from_clipboard/clipboard_recent_content_ios.mm index 930a274..14a8646 100644 --- a/components/open_from_clipboard/clipboard_recent_content_ios.mm +++ b/components/open_from_clipboard/clipboard_recent_content_ios.mm
@@ -59,10 +59,11 @@ const std::string& application_scheme, NSUserDefaults* group_user_defaults) : ClipboardRecentContentIOS([[ClipboardRecentContentImplIOS alloc] - initWithAuthorizedSchemes:getAuthorizedSchemeList(application_scheme) - userDefaults:group_user_defaults - delegate:[[ClipboardRecentContentDelegateImpl alloc] - init]]) {} + initWithMaxAge:MaximumAgeOfClipboard().InSecondsF() + authorizedSchemes:getAuthorizedSchemeList(application_scheme) + userDefaults:group_user_defaults + delegate:[[ClipboardRecentContentDelegateImpl alloc] + init]]) {} ClipboardRecentContentIOS::ClipboardRecentContentIOS( ClipboardRecentContentImplIOS* implementation) {
diff --git a/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm b/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm index 341f0ba..6a68d6e 100644 --- a/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm +++ b/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm
@@ -46,17 +46,18 @@ const char kAppSpecificURL[] = "test://qux/"; const char kAppSpecificScheme[] = "test"; const char kRecognizedScheme[] = "good"; -NSTimeInterval kSevenHours = 60 * 60 * 7; +NSTimeInterval kLongerThanMaxAge = 60 * 60 * 7; +NSTimeInterval kMaxAge = 60 * 60 * 1; } // namespace @interface ClipboardRecentContentImplIOSWithFakeUptime : ClipboardRecentContentImplIOS @property(nonatomic) NSTimeInterval fakeUptime; -- (instancetype)initWithDelegate:(id<ClipboardRecentContentDelegate>)delegate - authorizedSchemes:(NSArray*)authorizedSchemes - userDefaults:(NSUserDefaults*)groupUserDefaults - uptime:(NSTimeInterval)uptime; +- (instancetype)initWithMaxAge:(NSTimeInterval)maxAge + authorizedSchemes:(NSArray*)authorizedSchemes + userDefaults:(NSUserDefaults*)groupUserDefaults + uptime:(NSTimeInterval)uptime; @end @@ -64,13 +65,14 @@ @synthesize fakeUptime = _fakeUptime; -- (instancetype)initWithDelegate:(id<ClipboardRecentContentDelegate>)delegate - authorizedSchemes:(NSSet*)authorizedSchemes - userDefaults:(NSUserDefaults*)groupUserDefaults - uptime:(NSTimeInterval)uptime { - self = [super initWithAuthorizedSchemes:authorizedSchemes - userDefaults:groupUserDefaults - delegate:delegate]; +- (instancetype)initWithMaxAge:(NSTimeInterval)maxAge + authorizedSchemes:(NSSet*)authorizedSchemes + userDefaults:(NSUserDefaults*)groupUserDefaults + uptime:(NSTimeInterval)uptime { + self = [super initWithMaxAge:maxAge + authorizedSchemes:authorizedSchemes + userDefaults:groupUserDefaults + delegate:nil]; if (self) { _fakeUptime = uptime; } @@ -108,7 +110,7 @@ base::TimeDelta time_delta) { clipboard_content_implementation_ = [[ClipboardRecentContentImplIOSWithFakeUptime alloc] - initWithDelegate:nil + initWithMaxAge:kMaxAge authorizedSchemes:@[ base::SysUTF8ToNSString(kRecognizedScheme), base::SysUTF8ToNSString(application_scheme) @@ -167,7 +169,7 @@ // Test that old pasteboard data is not provided. SetStoredPasteboardChangeDate( - [NSDate dateWithTimeIntervalSinceNow:-kSevenHours]); + [NSDate dateWithTimeIntervalSinceNow:-kLongerThanMaxAge]); EXPECT_FALSE(clipboard_content_->GetRecentURLFromClipboard(&gurl)); // Tests that if chrome is relaunched, old pasteboard data is still
diff --git a/components/password_manager/core/browser/login_database_unittest.cc b/components/password_manager/core/browser/login_database_unittest.cc index 61bc4fa..e04d1c2 100644 --- a/components/password_manager/core/browser/login_database_unittest.cc +++ b/components/password_manager/core/browser/login_database_unittest.cc
@@ -431,6 +431,37 @@ EXPECT_THAT(result, UnorderedElementsAre(Pointee(form), Pointee(form2))); } +TEST_F(LoginDatabaseTest, TestFederatedMatchingLocalhost) { + PasswordForm form; + form.origin = GURL("http://localhost/"); + form.signon_realm = "federation://localhost/accounts.google.com"; + form.federation_origin = url::Origin(GURL("https://accounts.google.com/")); + form.username_value = ASCIIToUTF16("test@gmail.com"); + form.type = PasswordForm::TYPE_API; + form.scheme = PasswordForm::SCHEME_HTML; + + PasswordForm form_with_port(form); + form_with_port.origin = GURL("http://localhost:8080/"); + form_with_port.signon_realm = "federation://localhost/accounts.google.com"; + + EXPECT_EQ(AddChangeForForm(form), db().AddLogin(form)); + EXPECT_EQ(AddChangeForForm(form_with_port), db().AddLogin(form_with_port)); + + // Match twice. + PasswordStore::FormDigest form_request(PasswordForm::SCHEME_HTML, + "http://localhost/", + GURL("http://localhost/")); + std::vector<std::unique_ptr<PasswordForm>> result; + EXPECT_TRUE(db().GetLogins(form_request, &result)); + EXPECT_THAT(result, UnorderedElementsAre(Pointee(form))); + + // Match against the mobile site. + form_request.origin = GURL("http://localhost:8080/"); + form_request.signon_realm = "http://localhost:8080/"; + EXPECT_TRUE(db().GetLogins(form_request, &result)); + EXPECT_THAT(result, UnorderedElementsAre(Pointee(form_with_port))); +} + TEST_F(LoginDatabaseTest, TestPublicSuffixDisabledForNonHTMLForms) { TestNonHTMLFormPSLMatching(PasswordForm::SCHEME_BASIC); TestNonHTMLFormPSLMatching(PasswordForm::SCHEME_DIGEST);
diff --git a/components/password_manager/core/browser/psl_matching_helper.cc b/components/password_manager/core/browser/psl_matching_helper.cc index 5ae887d..b4c4bef1 100644 --- a/components/password_manager/core/browser/psl_matching_helper.cc +++ b/components/password_manager/core/browser/psl_matching_helper.cc
@@ -36,6 +36,24 @@ return out; } +bool IsFederatedRealm(const std::string& form_signon_realm, + const GURL& origin) { + // The format should be "federation://origin.host/federation.host; + std::string federated_realm = "federation://" + origin.host() + "/"; + return form_signon_realm.size() > federated_realm.size() && + base::StartsWith(form_signon_realm, federated_realm, + base::CompareCase::INSENSITIVE_ASCII); +} + +bool IsFederatedPSLMatch(const std::string& form_signon_realm, + const GURL& form_origin, + const GURL& origin) { + if (!IsPublicSuffixDomainMatch(form_origin.spec(), origin.spec())) + return false; + + return IsFederatedRealm(form_signon_realm, form_origin); +} + MatchResult GetMatchResult(const PasswordForm& form, const PasswordStore::FormDigest& form_digest) { if (form.signon_realm == form_digest.signon_realm) @@ -55,11 +73,12 @@ return MatchResult::PSL_MATCH; if (allow_federated_match && - IsFederatedMatch(form.signon_realm, form_digest.origin)) + IsFederatedRealm(form.signon_realm, form_digest.origin) && + form.origin.GetOrigin() == form_digest.origin.GetOrigin()) return MatchResult::FEDERATED_MATCH; if (allow_psl_match && allow_federated_match && - IsFederatedPSLMatch(form.signon_realm, form_digest.origin)) + IsFederatedPSLMatch(form.signon_realm, form.origin, form_digest.origin)) return MatchResult::FEDERATED_PSL_MATCH; return MatchResult::NO_MATCH; @@ -97,39 +116,4 @@ signon_realm, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); } - -bool IsFederatedMatch(const std::string& signon_realm, const GURL& origin) { - // Federated matches only apply to HTTPS. - if (!origin.SchemeIs(url::kHttpsScheme)) - return false; - - // The format should be "federation://origin.host/federation.host; - std::string federated_realm = "federation://" + origin.host() + "/"; - return signon_realm.size() > federated_realm.size() && - base::StartsWith(signon_realm, federated_realm, - base::CompareCase::INSENSITIVE_ASCII); -} - -bool IsFederatedPSLMatch(const std::string& signon_realm, const GURL& origin) { - // The format should be "federation://origin.host/federation.host; - // Check for presence of "federation://" prefix. - static constexpr char federation_prefix[] = "federation://"; - if (!base::StartsWith(signon_realm, federation_prefix, - base::CompareCase::INSENSITIVE_ASCII)) - return false; - - // Replace federation scheme with HTTPS. This results in correct parsing of - // host and path, and forces origin to have a HTTPS scheme in order to return - // true. - GURL::Replacements replacements; - replacements.SetSchemeStr(url::kHttpsScheme); - GURL https_signon_realm = GURL(signon_realm).ReplaceComponents(replacements); - - // Check for non-empty federation.host. - if (!https_signon_realm.has_path() || https_signon_realm.path_piece() == "/") - return false; - - return IsPublicSuffixDomainMatch(https_signon_realm.GetOrigin().spec(), - origin.GetOrigin().spec()); -} } // namespace password_manager
diff --git a/components/password_manager/core/browser/psl_matching_helper.h b/components/password_manager/core/browser/psl_matching_helper.h index d5839c5..7bfea29d 100644 --- a/components/password_manager/core/browser/psl_matching_helper.h +++ b/components/password_manager/core/browser/psl_matching_helper.h
@@ -33,9 +33,21 @@ FEDERATED_PSL_MATCH, }; -// For testing. +#if defined(UNIT_TEST) std::ostream& operator<<(std::ostream& out, MatchResult result); +// Returns true iff |form_signon_realm| designates a federated credential for +// |origin|. It doesn't check the port because |form_signon_realm| doesn't have +// it. +bool IsFederatedRealm(const std::string& form_signon_realm, const GURL& origin); + +// Returns true iff |form_signon_realm| and |form_origin| designate a federated +// PSL matching credential for the |origin|. +bool IsFederatedPSLMatch(const std::string& form_signon_realm, + const GURL& form_origin, + const GURL& origin); +#endif + // Returns what type of match applies to |form| and |form_digest|. MatchResult GetMatchResult(const autofill::PasswordForm& form, const PasswordStore::FormDigest& form_digest); @@ -62,13 +74,6 @@ // registry-controlled domain part. std::string GetRegistryControlledDomain(const GURL& signon_realm); -// Returns true iff |signon_realm| designates a federated credential for the -// |origin|. -bool IsFederatedMatch(const std::string& signon_realm, const GURL& origin); - -// Returns true iff |signon_realm| designates a federated PSL matching -// credential for the |origin|. -bool IsFederatedPSLMatch(const std::string& signon_realm, const GURL& origin); } // namespace password_manager #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PSL_MATCHING_HELPER_H_
diff --git a/components/password_manager/core/browser/psl_matching_helper_unittest.cc b/components/password_manager/core/browser/psl_matching_helper_unittest.cc index 8c176b3..66c798df 100644 --- a/components/password_manager/core/browser/psl_matching_helper_unittest.cc +++ b/components/password_manager/core/browser/psl_matching_helper_unittest.cc
@@ -14,150 +14,245 @@ namespace { -TEST(PSLMatchingUtilsTest, GetMatchResult) { +TEST(PSLMatchingUtilsTest, GetMatchResultNormalCredentials) { struct TestData { - const char* form_signon_realm; - const char* form_federation_origin; - autofill::PasswordForm::Scheme digest_scheme; - const char* digest_signon_realm; + const char* form_origin; const char* digest_origin; MatchResult match_result; }; const TestData cases[] = { // Test Exact Matches. - {"http://facebook.com/", "", autofill::PasswordForm::SCHEME_HTML, - "http://facebook.com/", "http://facebook.com", MatchResult::EXACT_MATCH}, + {"http://facebook.com/p", "http://facebook.com/p1", + MatchResult::EXACT_MATCH}, - {"http://m.facebook.com/", "", autofill::PasswordForm::SCHEME_HTML, - "http://m.facebook.com/", "http://m.facebook.com", + {"http://m.facebook.com/p", "http://m.facebook.com/p1", MatchResult::EXACT_MATCH}, // Scheme mismatch. - {"http://www.example.com/", "", autofill::PasswordForm::SCHEME_HTML, - "https://www.example.com/", "https://www.example.com", + {"http://www.example.com", "https://www.example.com", MatchResult::NO_MATCH}, // Host mismatch. - {"http://www.example.com/", "", autofill::PasswordForm::SCHEME_HTML, - "http://wwwexample.com/", "http://wwwexample.com", + {"http://www.example.com", "http://wwwexample.com", MatchResult::NO_MATCH}, - {"http://www.example1.com/", "", autofill::PasswordForm::SCHEME_HTML, - "http://www.example2.com/", "http://www.example2.com", + {"http://www.example1.com", "http://www.example2.com", MatchResult::NO_MATCH}, // Port mismatch. - {"http://www.example.com:123/", "", autofill::PasswordForm::SCHEME_HTML, - "http://www.example.com/", "http://www.example.com", + {"http://www.example.com:123/", "http://www.example.com", MatchResult::NO_MATCH}, // TLD mismatch. - {"http://www.example.org/", "", autofill::PasswordForm::SCHEME_HTML, - "http://www.example.com/", "http://www.example.com", + {"http://www.example.org/", "http://www.example.com/", MatchResult::NO_MATCH}, // URLs without registry controlled domains should not match. - {"http://localhost/", "", autofill::PasswordForm::SCHEME_HTML, - "http://127.0.0.1/", "http://127.0.0.1", MatchResult::NO_MATCH}, + {"http://localhost/", "http://127.0.0.1/", MatchResult::NO_MATCH}, // Invalid URLs don't match. - {"http://www.example.com/", "", autofill::PasswordForm::SCHEME_HTML, - "http://", "", MatchResult::NO_MATCH}, + {"http://www.example.com/", "http://", MatchResult::NO_MATCH}, - {"", "", autofill::PasswordForm::SCHEME_HTML, "http://www.example.com/", - "http://www.example.com", MatchResult::NO_MATCH}, + {"", "http://www.example.com/", MatchResult::NO_MATCH}, - {"http://www.example.com", "", autofill::PasswordForm::SCHEME_HTML, - "bad url", "", MatchResult::NO_MATCH}, + {"http://www.example.com", "bad url", MatchResult::NO_MATCH}}; + for (const TestData& data : cases) { + autofill::PasswordForm form; + form.origin = GURL(data.form_origin); + form.signon_realm = form.origin.GetOrigin().spec(); + PasswordStore::FormDigest digest( + autofill::PasswordForm::SCHEME_HTML, + GURL(data.digest_origin).GetOrigin().spec(), GURL(data.digest_origin)); + + EXPECT_EQ(data.match_result, GetMatchResult(form, digest)) + << "form_origin = " << data.form_origin << ", digest = " << digest; + } +} + +TEST(PSLMatchingUtilsTest, GetMatchResultPSL) { + struct TestData { + const char* form_origin; + const char* digest_origin; + MatchResult match_result; + }; + + const TestData cases[] = { // Test PSL Matches. - {"http://facebook.com/", "", autofill::PasswordForm::SCHEME_HTML, - "http://m.facebook.com/", "http://m.facebook.com", + {"http://facebook.com/p1", "http://m.facebook.com/p2", MatchResult::PSL_MATCH}, - {"https://facebook.com/", "", autofill::PasswordForm::SCHEME_HTML, - "https://m.facebook.com/", "https://m.facebook.com", - MatchResult::PSL_MATCH}, - - {"https://www.facebook.com/", "", autofill::PasswordForm::SCHEME_HTML, - "https://m.facebook.com/", "https://m.facebook.com", + {"https://www.facebook.com/", "https://m.facebook.com", MatchResult::PSL_MATCH}, // Don't apply PSL matching to Google domains. - {"https://google.com/", "", autofill::PasswordForm::SCHEME_HTML, - "https://maps.google.com/", "https://maps.google.com", + {"https://google.com/", "https://maps.google.com/", MatchResult::NO_MATCH}, - {"https://google.com/", "", autofill::PasswordForm::SCHEME_HTML, - "https://maps.google.com/", "https://maps.google.com", + // Scheme mismatch. + {"http://facebook.com/", "https://m.facebook.com/", MatchResult::NO_MATCH}, - // Test Federated Matches. - {"federation://example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://example.com/", - "https://example.com", MatchResult::FEDERATED_MATCH}, - - // Empty federation providers don't match. - {"federation://example.com/", "", autofill::PasswordForm::SCHEME_HTML, - "https://example.com/", "https://example.com", MatchResult::NO_MATCH}, - - // Invalid origins don't match. - {"federation://example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://example.com", - "example.com", MatchResult::NO_MATCH}, - - {"federation://example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://example.com", "example", + {"https://facebook.com/", "http://m.facebook.com/", MatchResult::NO_MATCH}, - // Test Federated PSL Matches. - {"federation://sub.example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://sub.example.com/", - "https://sub.example.com", MatchResult::FEDERATED_MATCH}, + // Port mismatch. + {"http://facebook.com/", "https://m.facebook.com:8080/", + MatchResult::NO_MATCH}, - {"federation://sub1.example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://sub2.example.com/", - "https://sub2.example.com", MatchResult::FEDERATED_PSL_MATCH}, + {"http://facebook.com:8080/", "https://m.facebook.com/", + MatchResult::NO_MATCH}, - {"federation://example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://sub.example.com/", - "https://sub.example.com", MatchResult::FEDERATED_PSL_MATCH}, - - // Federated PSL matches do not apply to HTTP. - {"federation://sub1.example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "http://sub2.example.com/", - "http://sub2.example.com", MatchResult::NO_MATCH}, - - {"federation://example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "http://sub.example.com/", - "http://sub.example.com", MatchResult::NO_MATCH}, - - // Federated PSL matches do not apply to Google on HTTP or HTTPS. - {"federation://accounts.google.com/facebook.com", "https://facebook.com", - autofill::PasswordForm::SCHEME_HTML, "https://maps.google.com/", - "https://maps.google.com", MatchResult::NO_MATCH}, - - {"federation://accounts.google.com/facebook.com", "https://facebook.com", - autofill::PasswordForm::SCHEME_HTML, "http://maps.google.com/", - "http://maps.google.com", MatchResult::NO_MATCH}, - - // TLD Mismatch. - {"federation://sub.example.com/google.com", "https://google.com", - autofill::PasswordForm::SCHEME_HTML, "https://sub.example.org/", - "https://sub.example.org", MatchResult::NO_MATCH}, + // Port match. + {"http://facebook.com:8080/p1", "http://m.facebook.com:8080/p2", + MatchResult::PSL_MATCH}, }; for (const TestData& data : cases) { autofill::PasswordForm form; - form.signon_realm = data.form_signon_realm; - form.federation_origin = url::Origin(GURL(data.form_federation_origin)); + form.origin = GURL(data.form_origin); + form.signon_realm = form.origin.GetOrigin().spec(); PasswordStore::FormDigest digest( - data.digest_scheme, data.digest_signon_realm, GURL(data.digest_origin)); + autofill::PasswordForm::SCHEME_HTML, + GURL(data.digest_origin).GetOrigin().spec(), GURL(data.digest_origin)); EXPECT_EQ(data.match_result, GetMatchResult(form, digest)) - << "signon_realm = " << data.form_signon_realm - << ", federation_origin = " << data.form_federation_origin + << "form_origin = " << data.form_origin << ", digest = " << digest; + } +} + +TEST(PSLMatchingUtilsTest, GetMatchResultFederated) { + struct TestData { + const char* form_origin; + const char* form_federation_origin; + const char* digest_origin; + MatchResult match_result; + }; + + const TestData cases[] = { + // Test Federated Matches. + {"https://example.com/p", "https://google.com", "https://example.com/p2", + MatchResult::FEDERATED_MATCH}, + + // Empty federation providers don't match. + {"https://example.com/", "", "https://example.com", + MatchResult::NO_MATCH}, + + // Invalid origins don't match. + {"https://example.com/", "https://google.com", "example.com", + MatchResult::NO_MATCH}, + + {"https://example.com/", "https://google.com", "example", + MatchResult::NO_MATCH}, + + // TLD Mismatch. + {"https://example.com/", "https://google.com", "https://example.org", + MatchResult::NO_MATCH}, + + // Scheme mismatch. + {"http://example.com/", "https://google.com", "https://example.com/", + MatchResult::NO_MATCH}, + + {"https://example.com/", "https://google.com", "http://example.com/", + MatchResult::NO_MATCH}, + + // Port mismatch. + {"https://localhost/", "https://google.com", "http://localhost:8080", + MatchResult::NO_MATCH}, + + {"https://localhost:8080", "https://google.com", "http://localhost", + MatchResult::NO_MATCH}, + + // Port match. + {"https://localhost:8080/p", "https://google.com", + "https://localhost:8080/p2", MatchResult::FEDERATED_MATCH}, + }; + + for (const TestData& data : cases) { + autofill::PasswordForm form; + form.origin = GURL(data.form_origin); + form.federation_origin = url::Origin(GURL(data.form_federation_origin)); + form.signon_realm = "federation://" + form.origin.host() + "/" + + form.federation_origin.host(); + + PasswordStore::FormDigest digest( + autofill::PasswordForm::SCHEME_HTML, + GURL(data.digest_origin).GetOrigin().spec(), GURL(data.digest_origin)); + + EXPECT_EQ(data.match_result, GetMatchResult(form, digest)) + << "form_origin = " << data.form_origin + << ", form_federation_origin = " << data.form_federation_origin + << ", digest = " << digest; + } +} + +TEST(PSLMatchingUtilsTest, GetMatchResultFederatedPSL) { + struct TestData { + const char* form_origin; + const char* form_federation_origin; + const char* digest_origin; + MatchResult match_result; + }; + + const TestData cases[] = { + // Test Federated PSL Matches. + {"https://sub.example.com/p2", "https://google.com", + "https://sub.example.com/p1", MatchResult::FEDERATED_MATCH}, + + {"https://sub1.example.com/p1", "https://google.com", + "https://sub2.example.com/p2", MatchResult::FEDERATED_PSL_MATCH}, + + {"https://example.com/", "https://google.com", "https://sub.example.com", + MatchResult::FEDERATED_PSL_MATCH}, + + // Federated PSL matches do not apply to HTTP. + {"https://sub1.example.com/", "https://google.com", + "http://sub2.example.com", MatchResult::NO_MATCH}, + + {"https://example.com/", "https://google.com", "http://sub.example.com", + MatchResult::NO_MATCH}, + + {"http://example.com/", "https://google.com", "https://example.com/", + MatchResult::NO_MATCH}, + + // Federated PSL matches do not apply to Google on HTTP or HTTPS. + {"https://accounts.google.com/", "https://facebook.com", + "https://maps.google.com", MatchResult::NO_MATCH}, + + {"https://accounts.google.com/facebook.com", "https://facebook.com", + "http://maps.google.com", MatchResult::NO_MATCH}, + + // TLD Mismatch. + {"https://sub.example.com/google.com", "https://google.com", + "https://sub.example.org", MatchResult::NO_MATCH}, + + // Port mismatch. + {"https://example.com/", "https://google.com", "https://example.com:8080", + MatchResult::NO_MATCH}, + + {"https://example.com:8080", "https://google.com", "https://example.com", + MatchResult::NO_MATCH}, + + // Port match. + {"https://sub.example.com:8080/p", "https://google.com", + "https://sub2.example.com:8080/p2", MatchResult::FEDERATED_PSL_MATCH}, + }; + + for (const TestData& data : cases) { + autofill::PasswordForm form; + form.origin = GURL(data.form_origin); + form.federation_origin = url::Origin(GURL(data.form_federation_origin)); + form.signon_realm = "federation://" + form.origin.host() + "/" + + form.federation_origin.host(); + + PasswordStore::FormDigest digest( + autofill::PasswordForm::SCHEME_HTML, + GURL(data.digest_origin).GetOrigin().spec(), GURL(data.digest_origin)); + + EXPECT_EQ(data.match_result, GetMatchResult(form, digest)) + << "form_origin = " << data.form_origin + << ", form_federation_origin = " << data.form_federation_origin << ", digest = " << digest; } } @@ -206,9 +301,9 @@ } } -TEST(PSLMatchingUtilsTest, IsFederatedMatch) { +TEST(PSLMatchingUtilsTest, IsFederatedRealm) { struct TestPair { - const char* signon_realm; + const char* form_signon_realm; const char* origin; bool should_match; }; @@ -219,55 +314,76 @@ {"", "https://facebook.com/", false}, {"https://facebook.com/", "", false}, {"federation://example.com/google.com", "https://example.com/", true}, - {"federation://example.com/google.com", "http://example.com/", false}, + {"federation://example.com/google.com", "http://example.com/", true}, {"federation://example.com/google.com", "example.com", false}, {"federation://example.com/", "http://example.com/", false}, {"federation://example.com/google.com", "example", false}, + + {"federation://localhost/google.com", "http://localhost/", true}, + {"federation://localhost/google.com", "http://localhost:8000/", true}, }; for (const TestPair& pair : pairs) { - std::string signon_realm = pair.signon_realm; - GURL origin(pair.origin); - EXPECT_EQ(pair.should_match, IsFederatedMatch(signon_realm, origin)) - << "signon_realm = " << pair.signon_realm + EXPECT_EQ(pair.should_match, + IsFederatedRealm(pair.form_signon_realm, GURL(pair.origin))) + << "form_signon_realm = " << pair.form_signon_realm << ", origin = " << pair.origin; } } TEST(PSLMatchingUtilsTest, IsFederatedPSLMatch) { struct TestPair { - const char* signon_realm; + const char* form_signon_realm; + const char* form_origin; const char* origin; bool should_match; }; const TestPair pairs[] = { - {"https://facebook.com", "https://facebook.com", false}, - {"", "", false}, - {"", "https://facebook.com/", false}, - {"https://facebook.com/", "", false}, + {"https://facebook.com", "https://facebook.com", "https://facebook.com", + false}, + {"", "", "", false}, + {"", "", "https://facebook.com/", false}, + {"https://facebook.com/", "https://facebook.com/", "", false}, - {"federation://example.com/google.com", "https://example.com/", true}, - {"federation://example.com/google.com", "http://example.com/", false}, - {"federation://example.com/google.com", "example.com", false}, - {"federation://example.com/", "http://example.com/", false}, - {"federation://example.com/google.com", "example", false}, + {"federation://example.com/google.com", "https://example.com/p1", + "https://example.com/p2", true}, + {"federation://example.com/google.com", "https://example.com/", + "http://example.com/", false}, + {"federation://example.com/google.com", "https://example.com/", + "example.com", false}, + {"federation://example.com/", "https://example.com/", + "https://example.com/", false}, + {"federation://example.com/google.com", "https://example.com/", "example", + false}, - {"federation://sub.example.com/google.com", "https://sub.example.com/", - true}, - {"federation://sub1.example.com/google.com", "https://sub2.example.com/", - true}, - {"federation://example.com/google.com", "https://sub.example.com/", true}, - {"federation://example.com/google.com", "http://sub.example.com/", false}, - {"federation://sub.example.com/", "https://sub.example.com/", false}, + {"federation://sub.example.com/google.com", "https://sub.example.com/p1", + "https://sub.example.com/p2", true}, + {"federation://sub.example.com/google.com", "https://sub.example.com/p1", + "https://sub2.example.com/p2", true}, + {"federation://example.com/google.com", "https://example.com/p1", + "https://sub.example.com/", true}, + {"federation://example.com/google.com", "https://example.com/", + "http://sub.example.com/", false}, + {"federation://sub.example.com/", "https://sub.example.com/", + "https://sub.example.com/", false}, + + {"federation://localhost/google.com", "http://localhost/", + "http://localhost/", true}, + {"federation://localhost/google.com", "http://localhost:8000/", + "http://localhost:8000/", true}, + {"federation://localhost/google.com", "http://localhost:8000/", + "http://localhost/", false}, + {"federation://localhost/google.com", "http://localhost/", + "http://localhost:8000/", false}, }; for (const TestPair& pair : pairs) { - std::string signon_realm = pair.signon_realm; - GURL origin(pair.origin); - EXPECT_EQ(pair.should_match, IsFederatedPSLMatch(signon_realm, origin)) - << "signon_realm = " << pair.signon_realm - << ", origin = " << pair.origin; + EXPECT_EQ(pair.should_match, + IsFederatedPSLMatch(pair.form_signon_realm, + GURL(pair.form_origin), GURL(pair.origin))) + << "form_signon_realm = " << pair.form_signon_realm + << "form_origin = " << pair.form_origin << ", origin = " << pair.origin; } }
diff --git a/components/password_manager/core/browser/test_password_store.cc b/components/password_manager/core/browser/test_password_store.cc index efd3aec..6ab4b77 100644 --- a/components/password_manager/core/browser/test_password_store.cc +++ b/components/password_manager/core/browser/test_password_store.cc
@@ -86,17 +86,26 @@ TestPasswordStore::FillMatchingLogins(const FormDigest& form) { std::vector<std::unique_ptr<autofill::PasswordForm>> matched_forms; for (const auto& elements : stored_passwords_) { + // The code below doesn't support PSL federated credential. It's doable but + // no test need it so far. const bool realm_matches = elements.first == form.signon_realm; const bool realm_psl_matches = IsPublicSuffixDomainMatch(elements.first, form.signon_realm); if (realm_matches || realm_psl_matches || (form.scheme == autofill::PasswordForm::SCHEME_HTML && - password_manager::IsFederatedMatch(elements.first, form.origin))) { + password_manager::IsFederatedRealm(elements.first, form.origin))) { const bool is_psl = !realm_matches && realm_psl_matches; for (const auto& stored_form : elements.second) { - matched_forms.push_back( - base::MakeUnique<autofill::PasswordForm>(stored_form)); - matched_forms.back()->is_public_suffix_match = is_psl; + // Repeat the condition above with an additional check for origin. + if (realm_matches || realm_psl_matches || + (form.scheme == autofill::PasswordForm::SCHEME_HTML && + stored_form.origin.GetOrigin() == form.origin.GetOrigin() && + password_manager::IsFederatedRealm(stored_form.signon_realm, + form.origin))) { + matched_forms.push_back( + base::MakeUnique<autofill::PasswordForm>(stored_form)); + matched_forms.back()->is_public_suffix_match = is_psl; + } } } }
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc index 959ee94..9f009bf 100644 --- a/components/payments/content/payment_request_state.cc +++ b/components/payments/content/payment_request_state.cc
@@ -4,7 +4,9 @@ #include "components/payments/content/payment_request_state.h" +#include <algorithm> #include <set> +#include <utility> #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_data_util.h" @@ -131,6 +133,16 @@ return personal_data_manager_; } +std::unique_ptr<const ::i18n::addressinput::Source> +PaymentRequestState::GetAddressInputSource() { + return payment_request_delegate_->GetAddressInputSource(); +} + +std::unique_ptr<::i18n::addressinput::Storage> +PaymentRequestState::GetAddressInputStorage() { + return payment_request_delegate_->GetAddressInputStorage(); +} + void PaymentRequestState::PopulateProfileCache() { std::vector<autofill::AutofillProfile*> profiles = personal_data_manager_->GetProfilesToSuggest();
diff --git a/components/payments/content/payment_request_state.h b/components/payments/content/payment_request_state.h index 1f4584e..cb0b2a97 100644 --- a/components/payments/content/payment_request_state.h +++ b/components/payments/content/payment_request_state.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ +#include <memory> #include <string> #include <vector> @@ -13,6 +14,13 @@ #include "components/payments/content/payment_request.mojom.h" #include "components/payments/content/payment_response_helper.h" +namespace i18n { +namespace addressinput { +class Storage; +class Source; +} // namespace addressinput +} // namespace i18n + namespace autofill { class AutofillProfile; class CreditCard; @@ -127,6 +135,8 @@ const std::string& GetApplicationLocale(); autofill::PersonalDataManager* GetPersonalDataManager(); + std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource(); + std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage(); Delegate* delegate() { return delegate_; }
diff --git a/components/payments/content/payment_response_helper_unittest.cc b/components/payments/content/payment_response_helper_unittest.cc index 3b56de99..7f63b66 100644 --- a/components/payments/content/payment_response_helper_unittest.cc +++ b/components/payments/content/payment_response_helper_unittest.cc
@@ -4,7 +4,10 @@ #include "components/payments/content/payment_response_helper.h" +#include <memory> +#include <string> #include <utility> +#include <vector> #include "base/memory/weak_ptr.h" #include "base/strings/utf_string_conversions.h" @@ -47,6 +50,16 @@ base::ASCIIToUTF16("123")); } + std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource() + override { + return nullptr; + } + + std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage() + override { + return nullptr; + } + private: autofill::PersonalDataManager* personal_data_manager_; std::string locale_;
diff --git a/components/payments/core/payment_request_delegate.h b/components/payments/core/payment_request_delegate.h index 1465d9b..aab278a 100644 --- a/components/payments/core/payment_request_delegate.h +++ b/components/payments/core/payment_request_delegate.h
@@ -2,18 +2,28 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ -#define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ +#ifndef COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DELEGATE_H_ +#define COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DELEGATE_H_ +#include <memory> #include <string> #include "base/memory/weak_ptr.h" #include "components/autofill/core/browser/payments/full_card_request.h" +#include "third_party/libaddressinput/src/cpp/include/libaddressinput/source.h" +#include "third_party/libaddressinput/src/cpp/include/libaddressinput/storage.h" + +namespace i18n { +namespace addressinput { +class Storage; +class Source; +} // namespace addressinput +} // namespace i18n namespace autofill { class CreditCard; class PersonalDataManager; -} +} // namespace autofill namespace payments { @@ -48,8 +58,14 @@ const autofill::CreditCard& credit_card, base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> result_delegate) = 0; + + // Returns the source and storage for country/region data loads. + virtual std::unique_ptr<const ::i18n::addressinput::Source> + GetAddressInputSource() = 0; + virtual std::unique_ptr<::i18n::addressinput::Storage> + GetAddressInputStorage() = 0; }; } // namespace payments -#endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_DELEGATE_H_ +#endif // COMPONENTS_PAYMENTS_CORE_PAYMENT_REQUEST_DELEGATE_H_
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index fc4f164..e5a601c 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -2359,9 +2359,9 @@ 'id': 168, 'caption': '''Configure allowed app/extension types''', 'tags': [], - 'desc': '''Controls which app/extension types are allowed to be installed. + 'desc': '''Controls which app/extension types are allowed to be installed and limits runtime access. - This setting white-lists the allowed types of extension/apps that can be installed in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. The value is a list of strings, each of which should be one of the following: "extension", "theme", "user_script", "hosted_app", "legacy_packaged_app", "platform_app". See the <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> extensions documentation for more information on these types. + This setting white-lists the allowed types of extension/apps that can be installed in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and which hosts they can interact with. The value is a list of strings, each of which should be one of the following: "extension", "theme", "user_script", "hosted_app", "legacy_packaged_app", "platform_app". See the <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> extensions documentation for more information on these types. Note that this policy also affects extensions and apps to be force-installed via ExtensionInstallForcelist. @@ -2399,6 +2399,16 @@ 'type': 'string', 'pattern': '^[0-9]+([.][0-9]+)*$', }, + 'runtime_blocked_hosts': { + 'type': 'array', + 'items': { + 'type': 'string' + }, + 'id': 'ListOfUrlPatterns' + }, + 'runtime_allowed_hosts': { + '$ref': 'ListOfUrlPatterns' + } }, }, '^update_url:': { @@ -2434,6 +2444,12 @@ 'allowed_types': { '$ref': 'ExtensionAllowedTypes', }, + 'runtime_blocked_hosts': { + '$ref': 'ListOfUrlPatterns' + }, + 'runtime_allowed_hosts': { + '$ref': 'ListOfUrlPatterns' + } }, }, },
diff --git a/components/subresource_filter/core/common/flat/rules.fbs b/components/subresource_filter/core/common/flat/rules.fbs index 96c251a..fdeaea9 100644 --- a/components/subresource_filter/core/common/flat/rules.fbs +++ b/components/subresource_filter/core/common/flat/rules.fbs
@@ -48,9 +48,8 @@ anchor_right : AnchorType = NONE; // The list of domains to be included/excluded from the filter's affected set. - // If a particular string in the list starts with '~' then the respective - // domain is excluded, otherwise included. - domains : [string]; + domains_included : [string]; + domains_excluded : [string]; // A URL pattern in the format defined by |url_pattern_type|. url_pattern : string;
diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/components/subresource_filter/core/common/indexed_ruleset.cc index 341968a..66d08f4 100644 --- a/components/subresource_filter/core/common/indexed_ruleset.cc +++ b/components/subresource_filter/core/common/indexed_ruleset.cc
@@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/numerics/safe_conversions.h" +#include "base/strings/string_util.h" #include "components/subresource_filter/core/common/first_party_origin.h" #include "components/subresource_filter/core/common/ngram_extractor.h" #include "components/subresource_filter/core/common/url_pattern.h" @@ -20,6 +21,26 @@ namespace { using FlatStringOffset = flatbuffers::Offset<flatbuffers::String>; +using FlatDomains = flatbuffers::Vector<FlatStringOffset>; +using FlatDomainsOffset = flatbuffers::Offset<FlatDomains>; + +base::StringPiece ToStringPiece(const flatbuffers::String* string) { + DCHECK(string); + return base::StringPiece(string->c_str(), string->size()); +} + +// Performs three-way comparison between two domains. In the total order defined +// by this predicate, the lengths of domains will be monotonically decreasing. +int CompareDomains(base::StringPiece lhs_domain, base::StringPiece rhs_domain) { + if (lhs_domain.size() != rhs_domain.size()) + return lhs_domain.size() > rhs_domain.size() ? -1 : 1; + return lhs_domain.compare(rhs_domain); +} + +bool HasNoUpperAscii(base::StringPiece string) { + return std::none_of(string.begin(), string.end(), + [](char c) { return base::IsAsciiUpper(c); }); +} // Checks whether a URL |rule| can be converted to its FlatBuffers equivalent, // and performs the actual conversion. @@ -48,29 +69,58 @@ flatbuffers::FlatBufferBuilder* builder) const { DCHECK(is_convertible()); - flatbuffers::Offset<flatbuffers::Vector<FlatStringOffset>> domains_offset; + FlatDomainsOffset domains_included_offset; + FlatDomainsOffset domains_excluded_offset; if (rule_.domains_size()) { - std::vector<FlatStringOffset> domains; - domains.reserve(rule_.domains_size()); + // TODO(pkalinnikov): Consider sharing the vectors between rules. + std::vector<FlatStringOffset> domains_included; + std::vector<FlatStringOffset> domains_excluded; + // Reserve only for |domains_included| because it is expected to be the + // one used more frequently. + domains_included.reserve(rule_.domains_size()); - std::string domain; for (const auto& domain_list_item : rule_.domains()) { - domain.clear(); - domain.reserve(domain_list_item.domain().size() + 1); + // Note: The |domain| can have non-ASCII UTF-8 characters, but + // ToLowerASCII leaves these intact. + // TODO(pkalinnikov): Convert non-ASCII characters to lower case too. + // TODO(pkalinnikov): Possibly convert Punycode to IDN here or directly + // assume this is done in the proto::UrlRule. + const std::string& domain = domain_list_item.domain(); + auto offset = builder->CreateSharedString( + HasNoUpperAscii(domain) ? domain : base::ToLowerASCII(domain)); + if (domain_list_item.exclude()) - domain += '~'; - domain += domain_list_item.domain(); - domains.push_back(builder->CreateSharedString(domain)); + domains_excluded.push_back(offset); + else + domains_included.push_back(offset); } - domains_offset = builder->CreateVector(domains); + + // The comparator ensuring the domains order necessary for fast matching. + auto precedes = [&builder](FlatStringOffset lhs, FlatStringOffset rhs) { + return CompareDomains(ToStringPiece(flatbuffers::GetTemporaryPointer( + *builder, lhs)), + ToStringPiece(flatbuffers::GetTemporaryPointer( + *builder, rhs))) < 0; + }; + + // The domains are stored in sorted order to support fast matching. + if (!domains_included.empty()) { + // TODO(pkalinnikov): Don't sort if it is already sorted offline. + std::sort(domains_included.begin(), domains_included.end(), precedes); + domains_included_offset = builder->CreateVector(domains_included); + } + if (!domains_excluded.empty()) { + std::sort(domains_excluded.begin(), domains_excluded.end(), precedes); + domains_excluded_offset = builder->CreateVector(domains_excluded); + } } auto url_pattern_offset = builder->CreateString(rule_.url_pattern()); - return flat::CreateUrlRule(*builder, options_, element_types_, - activation_types_, url_pattern_type_, - anchor_left_, anchor_right_, domains_offset, - url_pattern_offset); + return flat::CreateUrlRule( + *builder, options_, element_types_, activation_types_, + url_pattern_type_, anchor_left_, anchor_right_, domains_included_offset, + domains_excluded_offset, url_pattern_offset); } private: @@ -199,7 +249,7 @@ // RulesetIndexer -------------------------------------------------------------- // static -const int RulesetIndexer::kIndexedFormatVersion = 16; +const int RulesetIndexer::kIndexedFormatVersion = 17; RulesetIndexer::MutableUrlPatternIndex::MutableUrlPatternIndex() = default; RulesetIndexer::MutableUrlPatternIndex::~MutableUrlPatternIndex() = default; @@ -309,62 +359,94 @@ using FlatNGramIndex = flatbuffers::Vector<flatbuffers::Offset<flat::NGramToRules>>; -// Returns whether the |origin| matches the list of |domains|. A match means -// that the longest domain in |domains| that |origin| is a sub-domain of is not -// an exception OR all the |domains| are exceptions and neither matches the -// |origin|. Thus, domain filters with more domain components trump filters with -// fewer domain components, i.e. the more specific a filter is, the higher the -// priority. +// Returns the size of the longest (sub-)domain of |origin| matching one of the +// |domains| in the list. +// +// The |domains| should be sorted in descending order of their length, and +// ascending alphabetical order within the groups of same-length domains. +size_t GetLongestMatchingSubdomain(const url::Origin& origin, + const FlatDomains& domains) { + // If the |domains| list is short, then the simple strategy is usually faster. + if (domains.size() <= 5) { + for (auto* domain : domains) { + const base::StringPiece domain_piece = ToStringPiece(domain); + if (origin.DomainIs(domain_piece)) + return domain_piece.size(); + } + return 0; + } + // Otherwise look for each subdomain of the |origin| using binary search. + + DCHECK(!origin.unique()); + base::StringPiece canonicalized_host(origin.host()); + if (canonicalized_host.empty()) + return 0; + + // If the host name ends with a dot, then ignore it. + if (canonicalized_host.back() == '.') + canonicalized_host.remove_suffix(1); + + // The |left| bound of the search is shared between iterations, because + // subdomains are considered in decreasing order of their lengths, therefore + // each consecutive lower_bound will be at least as far as the previous. + flatbuffers::uoffset_t left = 0; + for (size_t position = 0;; ++position) { + const base::StringPiece subdomain = canonicalized_host.substr(position); + + flatbuffers::uoffset_t right = domains.size(); + while (left + 1 < right) { + auto middle = left + (right - left) / 2; + DCHECK_LT(middle, domains.size()); + if (CompareDomains(ToStringPiece(domains[middle]), subdomain) <= 0) + left = middle; + else + right = middle; + } + + DCHECK_LT(left, domains.size()); + if (ToStringPiece(domains[left]) == subdomain) + return subdomain.size(); + + position = canonicalized_host.find('.', position); + if (position == base::StringPiece::npos) + break; + } + + return 0; +} + +// Returns whether the |origin| matches the domain list of the |rule|. A match +// means that the longest domain in |domains| that |origin| is a sub-domain of +// is not an exception OR all the |domains| are exceptions and neither matches +// the |origin|. Thus, domain filters with more domain components trump filters +// with fewer domain components, i.e. the more specific a filter is, the higher +// the priority. // // A rule whose domain list is empty or contains only negative domains is still // considered a "generic" rule. Therefore, if |disable_generic_rules| is set, -// this function will always return false for such |domains| lists. -// -// TODO(pkalinnikov): Make it fast. -bool DoesOriginMatchDomainList( - const url::Origin& origin, - const flatbuffers::Vector<FlatStringOffset>* domains, - bool disable_generic_rules) { - if (!domains || !domains->size()) - return !disable_generic_rules; +// this function will always return false for such rules. +bool DoesOriginMatchDomainList(const url::Origin& origin, + const flat::UrlRule& rule, + bool disable_generic_rules) { + const bool is_generic = !rule.domains_included(); + DCHECK(is_generic || rule.domains_included()->size()); + if (disable_generic_rules && is_generic) + return false; + // Unique |origin| matches lists of exception domains only. - if (origin.unique()) { - for (const flatbuffers::String* domain_filter : *domains) { - DCHECK_GT(domain_filter->size(), 0u); - if (domain_filter->Get(0) != '~') - return false; - } - return !disable_generic_rules; + if (origin.unique()) + return is_generic; + + size_t longest_matching_included_domain_length = 1; + if (!is_generic) { + longest_matching_included_domain_length = + GetLongestMatchingSubdomain(origin, *rule.domains_included()); } - - size_t max_domain_length = 0; - bool is_positive = true; - bool negatives_only = true; - - for (flatbuffers::uoffset_t i = 0, size = domains->size(); i != size; ++i) { - const flatbuffers::String* domain_filter = domains->Get(i); - if (domain_filter->Length() <= max_domain_length) - continue; - - base::StringPiece filter_piece(domain_filter->c_str(), - domain_filter->Length()); - const bool is_negative = (domain_filter->Get(0) == '~'); - if (is_negative) { - filter_piece.remove_prefix(1); - if (filter_piece.length() == max_domain_length) - continue; - } else { - negatives_only = false; - } - - if (!origin.DomainIs(filter_piece)) - continue; - max_domain_length = filter_piece.length(); - is_positive = !is_negative; + if (longest_matching_included_domain_length && rule.domains_excluded()) { + return GetLongestMatchingSubdomain(origin, *rule.domains_excluded()) < + longest_matching_included_domain_length; } - - return max_domain_length ? is_positive - : negatives_only && !disable_generic_rules; + return !!longest_matching_included_domain_length; } // Returns whether the request matches flags of the specified URL |rule|. Takes @@ -419,7 +501,7 @@ if (!UrlPattern(*rule).MatchesUrl(url)) continue; - if (DoesOriginMatchDomainList(document_origin, rule->domains(), + if (DoesOriginMatchDomainList(document_origin, *rule, disable_generic_rules)) { return true; }
diff --git a/components/subresource_filter/core/common/indexed_ruleset_unittest.cc b/components/subresource_filter/core/common/indexed_ruleset_unittest.cc index c89dc21..998fd74 100644 --- a/components/subresource_filter/core/common/indexed_ruleset_unittest.cc +++ b/components/subresource_filter/core/common/indexed_ruleset_unittest.cc
@@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/macros.h" +#include "base/strings/string_util.h" #include "components/subresource_filter/core/common/first_party_origin.h" #include "components/subresource_filter/core/common/proto/rules.pb.h" #include "components/subresource_filter/core/common/url_pattern.h" @@ -372,104 +373,159 @@ } TEST_F(SubresourceFilterIndexedRulesetTest, OneRuleWithDomainList) { - const struct { - const char* url_pattern; - std::vector<std::string> domains; + constexpr const char* kUrl = "http://example.com"; - const char* url; + const struct { + std::vector<std::string> domains; const char* document_origin; + bool expect_allowed; } kTestCases[] = { - {"example.com", - {"domain1.com", "domain2.com"}, - "http://example.com", - "http://domain1.com", - false}, + {std::vector<std::string>(), nullptr, false}, + {std::vector<std::string>(), "http://domain.com", false}, - {"example.com", - {"domain1.com", "domain2.com"}, - "http://example.com", - "http://not_domain1.com", + {{"domain.com"}, nullptr, true}, + {{"domain.com"}, "http://domain.com", false}, + {{"ddomain.com"}, "http://domain.com", true}, + {{"domain.com"}, "http://ddomain.com", true}, + {{"domain.com"}, "http://sub.domain.com", false}, + {{"sub.domain.com"}, "http://domain.com", true}, + {{"sub.domain.com"}, "http://sub.domain.com", false}, + {{"sub.domain.com"}, "http://a.b.c.sub.domain.com", false}, + {{"sub.domain.com"}, "http://sub.domain.com.com", true}, + + // TODO(pkalinnikov): Probably need to canonicalize domain patterns to + // avoid subtleties like below. + {{"domain.com"}, "http://domain.com.", false}, + {{"domain.com"}, "http://.domain.com", false}, + {{"domain.com"}, "http://.domain.com.", false}, + {{".domain.com"}, "http://.domain.com", false}, + {{"domain.com."}, "http://domain.com", true}, + {{"domain.com."}, "http://domain.com.", false}, + + {{"domain..com"}, "http://domain.com", true}, + {{"domain.com"}, "http://domain..com", true}, + {{"domain..com"}, "http://domain..com", false}, + + {{"~domain.com"}, nullptr, false}, + {{"~domain.com"}, "http://domain.com", true}, + {{"~ddomain.com"}, "http://domain.com", false}, + {{"~domain.com"}, "http://ddomain.com", false}, + {{"~domain.com"}, "http://sub.domain.com", true}, + {{"~sub.domain.com"}, "http://domain.com", false}, + {{"~sub.domain.com"}, "http://sub.domain.com", true}, + {{"~sub.domain.com"}, "http://a.b.c.sub.domain.com", true}, + {{"~sub.domain.com"}, "http://sub.domain.com.com", false}, + + {{"domain1.com", "domain2.com"}, nullptr, true}, + {{"domain1.com", "domain2.com"}, "http://domain1.com", false}, + {{"domain1.com", "domain2.com"}, "http://domain2.com", false}, + {{"domain1.com", "domain2.com"}, "http://domain3.com", true}, + {{"domain1.com", "domain2.com"}, "http://not_domain1.com", true}, + {{"domain1.com", "domain2.com"}, "http://sub.domain1.com", false}, + {{"domain1.com", "domain2.com"}, "http://a.b.c.sub.domain2.com", false}, + + {{"~domain1.com", "~domain2.com"}, "http://domain1.com", true}, + {{"~domain1.com", "~domain2.com"}, "http://domain2.com", true}, + {{"~domain1.com", "~domain2.com"}, "http://domain3.com", false}, + + {{"domain.com", "~sub.domain.com"}, "http://domain.com", false}, + {{"domain.com", "~sub.domain.com"}, "http://sub.domain.com", true}, + {{"domain.com", "~sub.domain.com"}, "http://a.b.sub.domain.com", true}, + {{"domain.com", "~sub.domain.com"}, "http://ssub.domain.com", false}, + + {{"domain.com", "~a.domain.com", "~b.domain.com"}, + "http://domain.com", + false}, + {{"domain.com", "~a.domain.com", "~b.domain.com"}, + "http://a.domain.com", + true}, + {{"domain.com", "~a.domain.com", "~b.domain.com"}, + "http://b.domain.com", true}, - {"example.com", - {"domain1.com", "domain2.com"}, - "http://example.com", - "http://domain2.com", + {{"domain.com", "~a.domain.com", "b.a.domain.com"}, + "http://domain.com", false}, - - {"example.com", - {"domain1.com", "domain2.com"}, - "http://example.com", - "http://subdomain.domain2.com", + {{"domain.com", "~a.domain.com", "b.a.domain.com"}, + "http://a.domain.com", + true}, + {{"domain.com", "~a.domain.com", "b.a.domain.com"}, + "http://b.a.domain.com", false}, - - {"example.com", - {"domain1.com", "domain2.com"}, - "http://example.com", - "http://domain3.com", - true}, - - {"example.com", - {"~domain1.com", "~domain2.com"}, - "http://example.com", - "http://domain2.com", - true}, - - {"example.com", - {"~domain1.com", "~domain2.com"}, - "http://example.com", - "http://domain3.com", + {{"domain.com", "~a.domain.com", "b.a.domain.com"}, + "http://c.b.a.domain.com", false}, - {"example.com", - {"domain1.com", "~subdomain1.domain1.com"}, - "http://example.com", - "http://subdomain2.domain1.com", - false}, - - {"example.com", - {"domain1.com", "~subdomain1.domain1.com"}, - "http://example.com", - "http://subdomain1.domain1.com", - true}, - - {"example.com", - {"domain1.com", "domain2.com"}, - "http://example.com", - nullptr, - true}, - // The following test addresses a former bug in domain list matcher. When // "domain.com" was matched, the positive filters lookup stopped, and the // next domain was considered as a negative. The initial character was // skipped (supposing it's a '~') and the remainder was considered a // domain. So "ddomain.com" would be matched and thus the whole rule would // be classified as non-matching, which is not correct. - {"ex.com", - {"domain.com", "ddomain.com", "~sub.domain.com"}, - "http://ex.com", + {{"domain.com", "ddomain.com", "~sub.domain.com"}, "http://domain.com", false}, }; for (const auto& test_case : kTestCases) { SCOPED_TRACE(testing::Message() - << "Rule: " << test_case.url_pattern - << "; URL: " << test_case.url + << "Domains: " << base::JoinString(test_case.domains, "|") << "; document: " << test_case.document_origin); - UrlRuleBuilder builder(UrlPattern(test_case.url_pattern, kSubstring)); + UrlRuleBuilder builder(UrlPattern(kUrl, kSubstring)); builder.AddDomains(test_case.domains); AddUrlRule(builder.rule()); Finish(); EXPECT_EQ(test_case.expect_allowed, - ShouldAllow(test_case.url, test_case.document_origin)); + ShouldAllow(kUrl, test_case.document_origin)); Reset(); } } +TEST_F(SubresourceFilterIndexedRulesetTest, OneRuleWithLongDomainList) { + constexpr const char* kUrl = "http://example.com"; + constexpr size_t kDomains = 200; + + std::vector<std::string> domains; + for (size_t i = 0; i < kDomains; ++i) { + const std::string domain = "domain" + std::to_string(i) + ".com"; + domains.push_back(domain); + domains.push_back("~sub." + domain); + domains.push_back("a.sub." + domain); + domains.push_back("b.sub." + domain); + domains.push_back("c.sub." + domain); + domains.push_back("~aa.sub." + domain); + domains.push_back("~ab.sub." + domain); + domains.push_back("~ba.sub." + domain); + domains.push_back("~bb.sub." + domain); + domains.push_back("~sub.sub.c.sub." + domain); + } + + UrlRuleBuilder builder(UrlPattern(kUrl, kSubstring)); + builder.AddDomains(domains); + AddUrlRule(builder.rule()); + Finish(); + + for (size_t i = 0; i < kDomains; ++i) { + SCOPED_TRACE(testing::Message() << "Iteration: " << i); + const std::string domain = "domain" + std::to_string(i) + ".com"; + + EXPECT_FALSE(ShouldAllow(kUrl, ("http://" + domain).c_str())); + EXPECT_TRUE(ShouldAllow(kUrl, ("http://sub." + domain).c_str())); + EXPECT_FALSE(ShouldAllow(kUrl, ("http://a.sub." + domain).c_str())); + EXPECT_FALSE(ShouldAllow(kUrl, ("http://b.sub." + domain).c_str())); + EXPECT_FALSE(ShouldAllow(kUrl, ("http://c.sub." + domain).c_str())); + EXPECT_TRUE(ShouldAllow(kUrl, ("http://aa.sub." + domain).c_str())); + EXPECT_TRUE(ShouldAllow(kUrl, ("http://ab.sub." + domain).c_str())); + EXPECT_TRUE(ShouldAllow(kUrl, ("http://ba.sub." + domain).c_str())); + EXPECT_TRUE(ShouldAllow(kUrl, ("http://bb.sub." + domain).c_str())); + EXPECT_FALSE(ShouldAllow(kUrl, ("http://sub.c.sub." + domain).c_str())); + EXPECT_TRUE(ShouldAllow(kUrl, ("http://sub.sub.c.sub." + domain).c_str())); + } +} + TEST_F(SubresourceFilterIndexedRulesetTest, OneRuleWithElementTypes) { constexpr auto kAll = kAllElementTypes; const struct {
diff --git a/content/browser/android/launcher_thread.cc b/content/browser/android/launcher_thread.cc index 2c59a2da..06a7f23 100644 --- a/content/browser/android/launcher_thread.cc +++ b/content/browser/android/launcher_thread.cc
@@ -19,7 +19,9 @@ LauncherThread::LauncherThread() : java_handler_thread_(Java_LauncherThread_getHandlerThread( - base::android::AttachCurrentThread())) {} + base::android::AttachCurrentThread())) { + java_handler_thread_.Start(); +} LauncherThread::~LauncherThread() {}
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 90c2bf9f..8ca5ddd3 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -1069,6 +1069,7 @@ // concerns are not a problem in practice. redirect_thread = false; message_loop = android::LauncherThread::GetMessageLoop(); + DCHECK(message_loop); #endif if (redirect_thread) { non_ui_non_io_task_runner_traits @@ -1127,7 +1128,8 @@ (*thread_to_start) .reset(message_loop ? new BrowserProcessSubThread(id, message_loop) : new BrowserProcessSubThread(id)); - if (!(*thread_to_start)->StartWithOptions(options)) + // Start the thread if an existing |message_loop| wasn't provided. + if (!message_loop && !(*thread_to_start)->StartWithOptions(options)) LOG(FATAL) << "Failed to start the browser thread: id == " << id; } else { scoped_refptr<base::SingleThreadTaskRunner> redirection_task_runner =
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index e2bf149..90ed1ce 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -102,6 +102,7 @@ #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/http/http_response_info.h" +#include "net/log/net_log_with_source.h" #include "net/ssl/client_cert_store.h" #include "net/ssl/ssl_cert_request_info.h" #include "net/url_request/url_request.h" @@ -1227,6 +1228,15 @@ : request_data.url, request_data.priority, nullptr); + // Log that this request is a service worker navigation preload request here, + // since navigation preload machinery has no access to netlog. + // TODO(falken): Figure out how mojom::URLLoaderClient can + // access the request's netlog. + if (requester_info->IsNavigationPreload()) { + new_request->net_log().AddEvent( + net::NetLogEventType::SERVICE_WORKER_NAVIGATION_PRELOAD_REQUEST); + } + // PlzNavigate: Always set the method to GET when gaining access to the // stream that contains the response body of a navigation. Otherwise the data // that was already fetched by the browser will not be transmitted to the
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm index fe8ab8c0..fba983b 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -86,6 +86,7 @@ void OnCompositingDidCommit(ui::Compositor* compositor) override; void OnCompositingStarted(ui::Compositor* compositor, base::TimeTicks start_time) override {} + void OnCompositingEnded(ui::Compositor* compositor) override {} void OnCompositingLockStateChanged(ui::Compositor* compositor) override {} void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc index 975a7501..3d2a3d3 100644 --- a/content/browser/renderer_host/delegated_frame_host.cc +++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -721,6 +721,8 @@ last_draw_ended_ = start_time; } +void DelegatedFrameHost::OnCompositingEnded(ui::Compositor* compositor) {} + void DelegatedFrameHost::OnCompositingLockStateChanged( ui::Compositor* compositor) { if (resize_lock_ && resize_lock_->timed_out()) {
diff --git a/content/browser/renderer_host/delegated_frame_host.h b/content/browser/renderer_host/delegated_frame_host.h index 6857a9a0..3ac90e8 100644 --- a/content/browser/renderer_host/delegated_frame_host.h +++ b/content/browser/renderer_host/delegated_frame_host.h
@@ -94,6 +94,7 @@ void OnCompositingDidCommit(ui::Compositor* compositor) override; void OnCompositingStarted(ui::Compositor* compositor, base::TimeTicks start_time) override; + void OnCompositingEnded(ui::Compositor* compositor) override; void OnCompositingLockStateChanged(ui::Compositor* compositor) override; void OnCompositingShuttingDown(ui::Compositor* compositor) override;
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index cb7a479d..e524b921 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -1090,9 +1090,13 @@ // Test that scrolling a nested out-of-process iframe bubbles unused scroll // delta to a parent frame. -// Flaky: https://crbug.com/627238 +#if defined(OS_ANDROID) +#define MAYBE_ScrollBubblingFromOOPIFTest DISABLED_ScrollBubblingFromOOPIFTest +#else +#define MAYBE_ScrollBubblingFromOOPIFTest ScrollBubblingFromOOPIFTest +#endif IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, - DISABLED_ScrollBubblingFromOOPIFTest) { + MAYBE_ScrollBubblingFromOOPIFTest) { GURL main_url(embedded_test_server()->GetURL( "a.com", "/cross_site_iframe_factory.html?a(b)")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -1160,6 +1164,10 @@ scroll_event.SetPositionInWidget(1, 1); scroll_event.delta_x = 0.0f; scroll_event.delta_y = -5.0f; + // Set has_precise_scroll_deltas to keep these events off the animated scroll + // pathways, which currently break this test. + // https://bugs.chromium.org/p/chromium/issues/detail?id=710513 + scroll_event.has_precise_scrolling_deltas = true; rwhv_parent->ProcessMouseWheelEvent(scroll_event, ui::LatencyInfo()); // Ensure that the view position is propagated to the child properly.
diff --git a/content/content_resources.grd b/content/content_resources.grd index e879081..7eb6571 100644 --- a/content/content_resources.grd +++ b/content/content_resources.grd
@@ -50,6 +50,7 @@ <include name="IDR_UTILITY_SANDBOX_PROFILE" file="utility/utility.sb" type="BINDATA" /> </if> <if expr="not is_ios"> + <include name="IDR_MOJO_ASSOCIATED_BINDINGS_JS" file="../mojo/public/js/associated_bindings.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_BINDINGS_JS" file="../mojo/public/js/bindings.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_BUFFER_JS" file="../mojo/public/js/buffer.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_CODEC_JS" file="../mojo/public/js/codec.js" flattenhtml="true" type="BINDATA" />
diff --git a/content/renderer/mojo_context_state.cc b/content/renderer/mojo_context_state.cc index 99cf77e..8296cd4 100644 --- a/content/renderer/mojo_context_state.cc +++ b/content/renderer/mojo_context_state.cc
@@ -62,6 +62,7 @@ const char* path; const int id; } kBuiltinModuleResources[] = { + {mojo::kAssociatedBindingsModuleName, IDR_MOJO_ASSOCIATED_BINDINGS_JS}, {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS},
diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc index 0dd04426..5677fbc83 100644 --- a/extensions/common/url_pattern.cc +++ b/extensions/common/url_pattern.cc
@@ -129,6 +129,14 @@ return false; } +// static +int URLPattern::GetValidSchemeMaskForExtensions() { + int result = 0; + for (size_t i = 0; i < arraysize(kValidSchemeMasks); ++i) + result |= kValidSchemeMasks[i]; + return result; +} + URLPattern::URLPattern() : valid_schemes_(SCHEME_NONE), match_all_urls_(false),
diff --git a/extensions/common/url_pattern.h b/extensions/common/url_pattern.h index 574a00c..23f06878 100644 --- a/extensions/common/url_pattern.h +++ b/extensions/common/url_pattern.h
@@ -87,6 +87,9 @@ // Returns true if the given |scheme| is considered valid for extensions. static bool IsValidSchemeForExtensions(base::StringPiece scheme); + // Returns the mask for all schemes considered valid for extensions. + static int GetValidSchemeMaskForExtensions(); + explicit URLPattern(int valid_schemes); // Convenience to construct a URLPattern from a string. If the string is not
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc index 28e2b0b4..421e3711 100644 --- a/extensions/renderer/dispatcher.cc +++ b/extensions/renderer/dispatcher.cc
@@ -740,6 +740,7 @@ {"webViewEvents", IDR_WEB_VIEW_EVENTS_JS}, {"webViewInternal", IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS}, + {mojo::kAssociatedBindingsModuleName, IDR_MOJO_ASSOCIATED_BINDINGS_JS}, {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS},
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 67dcbb4..55afe1f 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -316,11 +316,15 @@ ] } + public_deps = [ + "//base", + "//net", + ] + deps = [ ":gen_devtools_client_api", ":tab_socket", ":version_header", - "//base", "//components/crash/content/browser", "//components/security_state/content", "//components/security_state/core", @@ -329,7 +333,6 @@ "//content/public/child:child", "//content/public/common", "//content/public/common:service_names", - "//net", "//services/service_manager/public/cpp", "//third_party/mesa:osmesa", "//ui/base",
diff --git a/ios/chrome/browser/payments/payment_items_display_view_controller.mm b/ios/chrome/browser/payments/payment_items_display_view_controller.mm index 7c10166..dc99162 100644 --- a/ios/chrome/browser/payments/payment_items_display_view_controller.mm +++ b/ios/chrome/browser/payments/payment_items_display_view_controller.mm
@@ -49,7 +49,7 @@ @interface PaymentItemsDisplayViewController ()< PaymentItemsDisplayViewControllerActions> { - MDCFlatButton* _payButton; + MDCButton* _payButton; // The PaymentRequest object having a copy of web::PaymentRequest as provided // by the page invoking the Payment Request API. This is a weak pointer and @@ -78,14 +78,11 @@ [self navigationItem].leftBarButtonItem = returnButton; // Set up trailing (pay) button. - _payButton = [[MDCFlatButton alloc] init]; + _payButton = [[MDCButton alloc] init]; [_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON) forState:UIControlStateNormal]; - [_payButton setBackgroundColor:[[MDCPalette cr_bluePalette] tint500] - forState:UIControlStateNormal]; + [_payButton setCustomTitleColor:[UIColor whiteColor]]; [_payButton setInkColor:[UIColor colorWithWhite:1 alpha:0.2]]; - [_payButton setBackgroundColor:[UIColor grayColor] - forState:UIControlStateDisabled]; [_payButton addTarget:nil action:@selector(onConfirm) forControlEvents:UIControlEventTouchUpInside];
diff --git a/ios/chrome/browser/ui/BUILD.gn b/ios/chrome/browser/ui/BUILD.gn index 1ecee8b..34024c6 100644 --- a/ios/chrome/browser/ui/BUILD.gn +++ b/ios/chrome/browser/ui/BUILD.gn
@@ -431,6 +431,7 @@ "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/ui", "//ios/public/provider/chrome/browser/voice", + "//ios/shared/chrome/browser/ui/tools_menu", "//ios/third_party/material_components_ios", "//ios/web", "//ios/web:user_agent",
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm index d8c0b03..cf8e9d41 100644 --- a/ios/chrome/browser/ui/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -143,7 +143,6 @@ #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" #include "ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.h" #include "ios/chrome/browser/ui/toolbar/toolbar_model_ios.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_item.h" #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" #include "ios/chrome/browser/ui/ui_util.h" @@ -170,6 +169,7 @@ #include "ios/public/provider/chrome/browser/voice/voice_search_controller.h" #include "ios/public/provider/chrome/browser/voice/voice_search_controller_delegate.h" #include "ios/public/provider/chrome/browser/voice/voice_search_provider.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #include "ios/web/public/active_state_manager.h" #include "ios/web/public/navigation_item.h" #import "ios/web/public/navigation_manager.h"
diff --git a/ios/chrome/browser/ui/settings/BUILD.gn b/ios/chrome/browser/ui/settings/BUILD.gn index edbc096..a6d3426 100644 --- a/ios/chrome/browser/ui/settings/BUILD.gn +++ b/ios/chrome/browser/ui/settings/BUILD.gn
@@ -49,6 +49,27 @@ "block_popups_collection_view_controller.mm", "clear_browsing_data_collection_view_controller.h", "clear_browsing_data_collection_view_controller.mm", + "content_settings_collection_view_controller.h", + "content_settings_collection_view_controller.mm", + "contextual_search_collection_view_controller.h", + "contextual_search_collection_view_controller.mm", + "dataplan_usage_collection_view_controller.h", + "dataplan_usage_collection_view_controller.mm", + "do_not_track_collection_view_controller.h", + "do_not_track_collection_view_controller.mm", + "handoff_collection_view_controller.h", + "handoff_collection_view_controller.mm", + "import_data_collection_view_controller.h", + "import_data_collection_view_controller.mm", + "material_cell_catalog_view_controller.h", + "material_cell_catalog_view_controller.mm", + "native_apps_collection_view_controller.h", + "native_apps_collection_view_controller.mm", + "native_apps_collection_view_controller_private.h", + "password_details_collection_view_controller.h", + "password_details_collection_view_controller.mm", + "physical_web_collection_view_controller.h", + "physical_web_collection_view_controller.mm", ] deps = [ ":resources", @@ -149,27 +170,6 @@ source_set("settings") { sources = [ - "content_settings_collection_view_controller.h", - "content_settings_collection_view_controller.mm", - "contextual_search_collection_view_controller.h", - "contextual_search_collection_view_controller.mm", - "dataplan_usage_collection_view_controller.h", - "dataplan_usage_collection_view_controller.mm", - "do_not_track_collection_view_controller.h", - "do_not_track_collection_view_controller.mm", - "handoff_collection_view_controller.h", - "handoff_collection_view_controller.mm", - "import_data_collection_view_controller.h", - "import_data_collection_view_controller.mm", - "material_cell_catalog_view_controller.h", - "material_cell_catalog_view_controller.mm", - "native_apps_collection_view_controller.h", - "native_apps_collection_view_controller.mm", - "native_apps_collection_view_controller_private.h", - "password_details_collection_view_controller.h", - "password_details_collection_view_controller.mm", - "physical_web_collection_view_controller.h", - "physical_web_collection_view_controller.mm", "privacy_collection_view_controller.h", "privacy_collection_view_controller.mm", "reauthentication_module.h",
diff --git a/ios/chrome/browser/ui/settings/content_settings_collection_view_controller.mm b/ios/chrome/browser/ui/settings/content_settings_collection_view_controller.mm index 717f290..b495e9c 100644 --- a/ios/chrome/browser/ui/settings/content_settings_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/content_settings_collection_view_controller.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/ui/settings/content_settings_collection_view_controller.h" #include "base/logging.h" -#import "base/mac/scoped_nsobject.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_types.h" @@ -28,6 +27,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_mac.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -49,11 +52,11 @@ PrefChangeRegistrar _prefChangeRegistrar; // The observable boolean that binds to the "Disable Popups" setting state. - base::scoped_nsobject<ContentSettingBackedBoolean> _disablePopupsSetting; + ContentSettingBackedBoolean* _disablePopupsSetting; // Updatable Items - base::scoped_nsobject<CollectionViewDetailItem> _blockPopupsDetailItem; - base::scoped_nsobject<CollectionViewDetailItem> _translateDetailItem; + CollectionViewDetailItem* _blockPopupsDetailItem; + CollectionViewDetailItem* _translateDetailItem; } // Returns the value for the default setting with ID |settingID|. @@ -85,10 +88,10 @@ HostContentSettingsMap* settingsMap = ios::HostContentSettingsMapFactory::GetForBrowserState(browserState); - _disablePopupsSetting.reset([[ContentSettingBackedBoolean alloc] + _disablePopupsSetting = [[ContentSettingBackedBoolean alloc] initWithHostContentSettingsMap:settingsMap settingID:CONTENT_SETTINGS_TYPE_POPUPS - inverted:YES]); + inverted:YES]; [_disablePopupsSetting setObserver:self]; [self loadModel]; @@ -98,7 +101,6 @@ - (void)dealloc { [_disablePopupsSetting setObserver:nil]; - [super dealloc]; } - (instancetype)init { @@ -118,33 +120,30 @@ } - (CollectionViewItem*)blockPopupsItem { - _blockPopupsDetailItem.reset([[CollectionViewDetailItem alloc] - initWithType:ItemTypeSettingsBlockPopups]); + _blockPopupsDetailItem = [[CollectionViewDetailItem alloc] + initWithType:ItemTypeSettingsBlockPopups]; NSString* subtitle = [_disablePopupsSetting value] ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) : l10n_util::GetNSString(IDS_IOS_SETTING_OFF); - _blockPopupsDetailItem.get().text = - l10n_util::GetNSString(IDS_IOS_BLOCK_POPUPS); - _blockPopupsDetailItem.get().detailText = subtitle; - _blockPopupsDetailItem.get().accessoryType = + _blockPopupsDetailItem.text = l10n_util::GetNSString(IDS_IOS_BLOCK_POPUPS); + _blockPopupsDetailItem.detailText = subtitle; + _blockPopupsDetailItem.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator; - _blockPopupsDetailItem.get().accessibilityTraits |= - UIAccessibilityTraitButton; + _blockPopupsDetailItem.accessibilityTraits |= UIAccessibilityTraitButton; return _blockPopupsDetailItem; } - (CollectionViewItem*)translateItem { - _translateDetailItem.reset([[CollectionViewDetailItem alloc] - initWithType:ItemTypeSettingsTranslate]); + _translateDetailItem = + [[CollectionViewDetailItem alloc] initWithType:ItemTypeSettingsTranslate]; BOOL enabled = browserState_->GetPrefs()->GetBoolean(prefs::kEnableTranslate); NSString* subtitle = enabled ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) : l10n_util::GetNSString(IDS_IOS_SETTING_OFF); - _translateDetailItem.get().text = - l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING); - _translateDetailItem.get().detailText = subtitle; - _translateDetailItem.get().accessoryType = + _translateDetailItem.text = l10n_util::GetNSString(IDS_IOS_TRANSLATE_SETTING); + _translateDetailItem.detailText = subtitle; + _translateDetailItem.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator; - _translateDetailItem.get().accessibilityTraits |= UIAccessibilityTraitButton; + _translateDetailItem.accessibilityTraits |= UIAccessibilityTraitButton; return _translateDetailItem; } @@ -163,16 +162,15 @@ [self.collectionViewModel itemTypeForIndexPath:indexPath]; switch (itemType) { case ItemTypeSettingsBlockPopups: { - base::scoped_nsobject<UIViewController> controller( + UIViewController* controller = [[BlockPopupsCollectionViewController alloc] - initWithBrowserState:browserState_]); + initWithBrowserState:browserState_]; [self.navigationController pushViewController:controller animated:YES]; break; } case ItemTypeSettingsTranslate: { - base::scoped_nsobject<UIViewController> controller( - [[TranslateCollectionViewController alloc] - initWithPrefs:browserState_->GetPrefs()]); + UIViewController* controller = [[TranslateCollectionViewController alloc] + initWithPrefs:browserState_->GetPrefs()]; [self.navigationController pushViewController:controller animated:YES]; break; } @@ -186,7 +184,7 @@ BOOL enabled = browserState_->GetPrefs()->GetBoolean(preferenceName); NSString* subtitle = enabled ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) : l10n_util::GetNSString(IDS_IOS_SETTING_OFF); - _translateDetailItem.get().detailText = subtitle; + _translateDetailItem.detailText = subtitle; [self reconfigureCellsForItems:@[ _translateDetailItem ] inSectionWithIdentifier:SectionIdentifierSettings]; } @@ -195,13 +193,13 @@ #pragma mark - BooleanObserver - (void)booleanDidChange:(id<ObservableBoolean>)observableBoolean { - DCHECK_EQ(observableBoolean, _disablePopupsSetting.get()); + DCHECK_EQ(observableBoolean, _disablePopupsSetting); NSString* subtitle = [_disablePopupsSetting value] ? l10n_util::GetNSString(IDS_IOS_SETTING_ON) : l10n_util::GetNSString(IDS_IOS_SETTING_OFF); // Update the item. - _blockPopupsDetailItem.get().detailText = subtitle; + _blockPopupsDetailItem.detailText = subtitle; // Update the cell. [self reconfigureCellsForItems:@[ _blockPopupsDetailItem ]
diff --git a/ios/chrome/browser/ui/settings/contextual_search_collection_view_controller.mm b/ios/chrome/browser/ui/settings/contextual_search_collection_view_controller.mm index 7c891b1..f77ec2f5 100644 --- a/ios/chrome/browser/ui/settings/contextual_search_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/contextual_search_collection_view_controller.mm
@@ -5,7 +5,6 @@ #import "ios/chrome/browser/ui/settings/contextual_search_collection_view_controller.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "components/google/core/browser/google_util.h" #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/application_context.h" @@ -20,6 +19,10 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -36,8 +39,7 @@ @interface ContextualSearchCollectionViewController () { // Permissions interface for Touch-to-Search. - base::scoped_nsobject<TouchToSearchPermissionsMediator> - _touchToSearchPermissions; + TouchToSearchPermissionsMediator* _touchToSearchPermissions; } // Returns the switch item to use for the touch to search setting. @@ -60,7 +62,7 @@ self = [super initWithStyle:CollectionViewControllerStyleAppBar]; if (self) { self.title = l10n_util::GetNSString(IDS_IOS_CONTEXTUAL_SEARCH_TITLE); - _touchToSearchPermissions.reset([touchToSearchPermissions retain]); + _touchToSearchPermissions = touchToSearchPermissions; self.collectionViewAccessibilityIdentifier = @"Contextual Search"; [self loadModel]; } @@ -68,9 +70,8 @@ } - (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState { - return [self - initWithPermissions:[[[TouchToSearchPermissionsMediator alloc] - initWithBrowserState:browserState] autorelease]]; + return [self initWithPermissions:[[TouchToSearchPermissionsMediator alloc] + initWithBrowserState:browserState]]; } #pragma mark - SettingsRootCollectionViewController @@ -89,8 +90,8 @@ } - (CollectionViewSwitchItem*)touchToSearchSwitchItem { - CollectionViewSwitchItem* item = [[[CollectionViewSwitchItem alloc] - initWithType:ItemTypeTouchToSearchSwitch] autorelease]; + CollectionViewSwitchItem* item = [[CollectionViewSwitchItem alloc] + initWithType:ItemTypeTouchToSearchSwitch]; item.text = l10n_util::GetNSString(IDS_IOS_CONTEXTUAL_SEARCH_TITLE); item.on = ([_touchToSearchPermissions preferenceState] != TouchToSearch::DISABLED); @@ -107,8 +108,8 @@ GURL(l10n_util::GetStringUTF8(IDS_IOS_CONTEXTUAL_SEARCH_LEARN_MORE_URL)), GetApplicationContext()->GetApplicationLocale()); - CollectionViewFooterItem* item = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeFooter] autorelease]; + CollectionViewFooterItem* item = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter]; item.text = footerText; item.linkURL = learnMoreURL; item.linkDelegate = self;
diff --git a/ios/chrome/browser/ui/settings/dataplan_usage_collection_view_controller.mm b/ios/chrome/browser/ui/settings/dataplan_usage_collection_view_controller.mm index b79607a..f46e458 100644 --- a/ios/chrome/browser/ui/settings/dataplan_usage_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/dataplan_usage_collection_view_controller.mm
@@ -6,7 +6,6 @@ #include "base/logging.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "components/prefs/pref_member.h" #include "components/prefs/pref_service.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h" @@ -16,6 +15,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util_mac.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -71,20 +74,20 @@ [model addSectionWithIdentifier:SectionIdentifierOptions]; - base::scoped_nsobject<CollectionViewTextItem> always( - [[CollectionViewTextItem alloc] initWithType:ItemTypeOptionsAlways]); + CollectionViewTextItem* always = + [[CollectionViewTextItem alloc] initWithType:ItemTypeOptionsAlways]; [always setText:l10n_util::GetNSString(IDS_IOS_OPTIONS_DATA_USAGE_ALWAYS)]; [always setAccessibilityTraits:UIAccessibilityTraitButton]; [model addItem:always toSectionWithIdentifier:SectionIdentifierOptions]; - base::scoped_nsobject<CollectionViewTextItem> wifi( - [[CollectionViewTextItem alloc] initWithType:ItemTypeOptionsOnlyOnWiFi]); + CollectionViewTextItem* wifi = + [[CollectionViewTextItem alloc] initWithType:ItemTypeOptionsOnlyOnWiFi]; [wifi setText:l10n_util::GetNSString(IDS_IOS_OPTIONS_DATA_USAGE_ONLY_WIFI)]; [wifi setAccessibilityTraits:UIAccessibilityTraitButton]; [model addItem:wifi toSectionWithIdentifier:SectionIdentifierOptions]; - base::scoped_nsobject<CollectionViewTextItem> never( - [[CollectionViewTextItem alloc] initWithType:ItemTypeOptionsNever]); + CollectionViewTextItem* never = + [[CollectionViewTextItem alloc] initWithType:ItemTypeOptionsNever]; [never setText:l10n_util::GetNSString(IDS_IOS_OPTIONS_DATA_USAGE_NEVER)]; [never setAccessibilityTraits:UIAccessibilityTraitButton]; [model addItem:never toSectionWithIdentifier:SectionIdentifierOptions];
diff --git a/ios/chrome/browser/ui/settings/do_not_track_collection_view_controller.mm b/ios/chrome/browser/ui/settings/do_not_track_collection_view_controller.mm index fd6b7c8f..65a91a7 100644 --- a/ios/chrome/browser/ui/settings/do_not_track_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/do_not_track_collection_view_controller.mm
@@ -18,6 +18,10 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -73,8 +77,8 @@ } - (CollectionViewItem*)switchItem { - CollectionViewSwitchItem* item = [[[CollectionViewSwitchItem alloc] - initWithType:ItemTypeSwitch] autorelease]; + CollectionViewSwitchItem* item = + [[CollectionViewSwitchItem alloc] initWithType:ItemTypeSwitch]; item.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_DO_NOT_TRACK_MOBILE); item.on = _doNotTrackEnabled.GetValue(); return item; @@ -87,8 +91,8 @@ GURL(kDoNotTrackLearnMoreURL), GetApplicationContext()->GetApplicationLocale()); - CollectionViewFooterItem* item = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeFooter] autorelease]; + CollectionViewFooterItem* item = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter]; item.text = footerText; item.linkURL = learnMoreURL; item.linkDelegate = self;
diff --git a/ios/chrome/browser/ui/settings/handoff_collection_view_controller.mm b/ios/chrome/browser/ui/settings/handoff_collection_view_controller.mm index 8fcca093..57d5425 100644 --- a/ios/chrome/browser/ui/settings/handoff_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/handoff_collection_view_controller.mm
@@ -15,6 +15,10 @@ #include "ios/chrome/grit/ios_strings.h" #include "ui/base/l10n/l10n_util.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -61,8 +65,8 @@ CollectionViewModel* model = self.collectionViewModel; [model addSectionWithIdentifier:SectionIdentifierSwitch]; - CollectionViewSwitchItem* switchItem = [[[CollectionViewSwitchItem alloc] - initWithType:ItemTypeSwitch] autorelease]; + CollectionViewSwitchItem* switchItem = + [[CollectionViewSwitchItem alloc] initWithType:ItemTypeSwitch]; switchItem.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_ENABLE_HANDOFF_TO_OTHER_DEVICES); switchItem.on = _handoffEnabled.GetValue(); @@ -72,8 +76,8 @@ // drawing bug in MDC. // TODO(crbug.com/650424) Use setFooter:forSectionWithIdentifier:. [model addSectionWithIdentifier:SectionIdentifierFooter]; - CollectionViewFooterItem* footer = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeFooter] autorelease]; + CollectionViewFooterItem* footer = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter]; footer.text = l10n_util::GetNSString( IDS_IOS_OPTIONS_ENABLE_HANDOFF_TO_OTHER_DEVICES_DETAILS); [model addItem:footer toSectionWithIdentifier:SectionIdentifierFooter];
diff --git a/ios/chrome/browser/ui/settings/import_data_collection_view_controller.mm b/ios/chrome/browser/ui/settings/import_data_collection_view_controller.mm index cdef4a7..2b08e82 100644 --- a/ios/chrome/browser/ui/settings/import_data_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/import_data_collection_view_controller.mm
@@ -4,10 +4,8 @@ #import "ios/chrome/browser/ui/settings/import_data_collection_view_controller.h" -#import "base/ios/weak_nsobject.h" #include "base/logging.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item.h" @@ -21,6 +19,10 @@ #import "ios/third_party/material_components_ios/src/components/Collections/src/MaterialCollections.h" #include "ui/base/l10n/l10n_util_mac.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + // The accessibility identifier of the Import Data cell. NSString* const kImportDataImportCellId = @"kImportDataImportCellId"; // The accessibility identifier of the Keep Data Separate cell. @@ -43,13 +45,13 @@ } // namespace @implementation ImportDataCollectionViewController { - base::WeakNSProtocol<id<ImportDataControllerDelegate>> _delegate; - base::scoped_nsobject<NSString> _fromEmail; - base::scoped_nsobject<NSString> _toEmail; + __weak id<ImportDataControllerDelegate> _delegate; + NSString* _fromEmail; + NSString* _toEmail; BOOL _isSignedIn; ShouldClearData _shouldClearData; - base::scoped_nsobject<CollectionViewDetailItem> _importDataItem; - base::scoped_nsobject<CollectionViewDetailItem> _keepDataSeparateItem; + CollectionViewDetailItem* _importDataItem; + CollectionViewDetailItem* _keepDataSeparateItem; } #pragma mark Initialization @@ -62,9 +64,9 @@ DCHECK(toEmail); self = [super initWithStyle:CollectionViewControllerStyleAppBar]; if (self) { - _delegate.reset(delegate); - _fromEmail.reset([fromEmail copy]); - _toEmail.reset([toEmail copy]); + _delegate = delegate; + _fromEmail = [fromEmail copy]; + _toEmail = [toEmail copy]; _isSignedIn = isSignedIn; _shouldClearData = isSignedIn ? SHOULD_CLEAR_DATA_CLEAR_DATA : SHOULD_CLEAR_DATA_MERGE_DATA; @@ -73,12 +75,12 @@ ? l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SWITCH) : l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_TITLE_SIGNIN); [self setShouldHideDoneButton:YES]; - self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:l10n_util::GetNSString( IDS_IOS_OPTIONS_IMPORT_DATA_CONTINUE_BUTTON) style:UIBarButtonItemStyleDone target:self - action:@selector(didTapContinue)] autorelease]; + action:@selector(didTapContinue)]; [self loadModel]; } return self; @@ -95,8 +97,8 @@ toSectionWithIdentifier:SectionIdentifierDisclaimer]; [model addSectionWithIdentifier:SectionIdentifierOptions]; - _importDataItem.reset([[self importDataItem] retain]); - _keepDataSeparateItem.reset([[self keepDataSeparateItem] retain]); + _importDataItem = [self importDataItem]; + _keepDataSeparateItem = [self keepDataSeparateItem]; if (_isSignedIn) { [model addItem:_keepDataSeparateItem toSectionWithIdentifier:SectionIdentifierOptions]; @@ -114,15 +116,15 @@ - (CollectionViewItem*)descriptionItem { CardMultilineItem* item = - [[[CardMultilineItem alloc] initWithType:ItemTypeFooter] autorelease]; + [[CardMultilineItem alloc] initWithType:ItemTypeFooter]; item.text = l10n_util::GetNSStringF(IDS_IOS_OPTIONS_IMPORT_DATA_HEADER, base::SysNSStringToUTF16(_fromEmail)); return item; } - (CollectionViewDetailItem*)importDataItem { - CollectionViewDetailItem* item = [[[CollectionViewDetailItem alloc] - initWithType:ItemTypeOptionImportData] autorelease]; + CollectionViewDetailItem* item = + [[CollectionViewDetailItem alloc] initWithType:ItemTypeOptionImportData]; item.cellClass = [ImportDataMultilineDetailCell class]; item.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_IMPORT_TITLE); item.detailText = @@ -135,8 +137,8 @@ } - (CollectionViewDetailItem*)keepDataSeparateItem { - CollectionViewDetailItem* item = [[[CollectionViewDetailItem alloc] - initWithType:ItemTypeOptionKeepDataSeparate] autorelease]; + CollectionViewDetailItem* item = [[CollectionViewDetailItem alloc] + initWithType:ItemTypeOptionKeepDataSeparate]; item.cellClass = [ImportDataMultilineDetailCell class]; item.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_IMPORT_DATA_KEEP_TITLE); if (_isSignedIn) { @@ -189,10 +191,10 @@ // Updates the UI based on the value of |_shouldClearData|. - (void)updateUI { BOOL importDataSelected = _shouldClearData == SHOULD_CLEAR_DATA_MERGE_DATA; - _importDataItem.get().accessoryType = - importDataSelected ? MDCCollectionViewCellAccessoryCheckmark - : MDCCollectionViewCellAccessoryNone; - _keepDataSeparateItem.get().accessoryType = + _importDataItem.accessoryType = importDataSelected + ? MDCCollectionViewCellAccessoryCheckmark + : MDCCollectionViewCellAccessoryNone; + _keepDataSeparateItem.accessoryType = importDataSelected ? MDCCollectionViewCellAccessoryNone : MDCCollectionViewCellAccessoryCheckmark; [self reconfigureCellsForItems:@[ _importDataItem, _keepDataSeparateItem ]
diff --git a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm index 93334ac..df84898 100644 --- a/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm +++ b/ios/chrome/browser/ui/settings/material_cell_catalog_view_controller.mm
@@ -7,7 +7,6 @@ #import <UIKit/UIKit.h> #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/credit_card.h" #include "components/grit/components_scaled_resources.h" @@ -44,6 +43,10 @@ #import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -113,34 +116,34 @@ // Text cells. [model addSectionWithIdentifier:SectionIdentifierTextCell]; - CollectionViewTextItem* textHeader = [ - [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease]; + CollectionViewTextItem* textHeader = + [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader]; textHeader.text = @"CollectionViewTextCell"; textHeader.textFont = [MDCTypography body2Font]; textHeader.textColor = [[MDCPalette greyPalette] tint500]; [model setHeader:textHeader forSectionWithIdentifier:SectionIdentifierTextCell]; - CollectionViewTextItem* textCell = [[[CollectionViewTextItem alloc] - initWithType:ItemTypeTextCheckmark] autorelease]; + CollectionViewTextItem* textCell = + [[CollectionViewTextItem alloc] initWithType:ItemTypeTextCheckmark]; textCell.text = @"Text cell 1"; textCell.accessoryType = MDCCollectionViewCellAccessoryCheckmark; [model addItem:textCell toSectionWithIdentifier:SectionIdentifierTextCell]; - CollectionViewTextItem* textCell2 = [[[CollectionViewTextItem alloc] - initWithType:ItemTypeTextDetail] autorelease]; + CollectionViewTextItem* textCell2 = + [[CollectionViewTextItem alloc] initWithType:ItemTypeTextDetail]; textCell2.text = @"Text cell with text that is so long it must truncate at some point"; textCell2.accessoryType = MDCCollectionViewCellAccessoryDetailButton; [model addItem:textCell2 toSectionWithIdentifier:SectionIdentifierTextCell]; CollectionViewTextItem* textCell3 = - [[[CollectionViewTextItem alloc] initWithType:ItemTypeText] autorelease]; + [[CollectionViewTextItem alloc] initWithType:ItemTypeText]; textCell3.text = @"Truncated text cell with three lines:"; textCell3.detailText = @"One title line and two detail lines, so it should " @"wrap nicely at some point."; textCell3.numberOfDetailTextLines = 0; [model addItem:textCell3 toSectionWithIdentifier:SectionIdentifierTextCell]; CollectionViewTextItem* smallTextCell = - [[[CollectionViewTextItem alloc] initWithType:ItemTypeText] autorelease]; + [[CollectionViewTextItem alloc] initWithType:ItemTypeText]; smallTextCell.text = @"Text cell with small font but height of 48."; smallTextCell.textFont = [smallTextCell.textFont fontWithSize:8]; [model addItem:smallTextCell @@ -148,7 +151,7 @@ // Text and Error cell. TextAndErrorItem* textAndErrorItem = - [[[TextAndErrorItem alloc] initWithType:ItemTypeTextError] autorelease]; + [[TextAndErrorItem alloc] initWithType:ItemTypeTextError]; textAndErrorItem.text = @"Text and Error cell"; textAndErrorItem.shouldDisplayError = YES; textAndErrorItem.accessoryType = @@ -158,43 +161,41 @@ // Detail cells. [model addSectionWithIdentifier:SectionIdentifierDetailCell]; - CollectionViewDetailItem* detailBasic = [[[CollectionViewDetailItem alloc] - initWithType:ItemTypeDetailBasic] autorelease]; + CollectionViewDetailItem* detailBasic = + [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailBasic]; detailBasic.text = @"Preload Webpages"; detailBasic.detailText = @"Only on Wi-Fi"; detailBasic.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator; [model addItem:detailBasic toSectionWithIdentifier:SectionIdentifierDetailCell]; CollectionViewDetailItem* detailMediumLeft = - [[[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailLeftMedium] - autorelease]; + [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailLeftMedium]; detailMediumLeft.text = @"A long string but it should fit"; detailMediumLeft.detailText = @"Detail"; [model addItem:detailMediumLeft toSectionWithIdentifier:SectionIdentifierDetailCell]; CollectionViewDetailItem* detailMediumRight = - [[[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailRightMedium] - autorelease]; + [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailRightMedium]; detailMediumRight.text = @"Main"; detailMediumRight.detailText = @"A long string but it should fit"; [model addItem:detailMediumRight toSectionWithIdentifier:SectionIdentifierDetailCell]; - CollectionViewDetailItem* detailLongLeft = [[[CollectionViewDetailItem alloc] - initWithType:ItemTypeDetailLeftLong] autorelease]; + CollectionViewDetailItem* detailLongLeft = + [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailLeftLong]; detailLongLeft.text = @"This is a very long main text that is intended to overflow"; detailLongLeft.detailText = @"Detail Text"; [model addItem:detailLongLeft toSectionWithIdentifier:SectionIdentifierDetailCell]; - CollectionViewDetailItem* detailLongRight = [[[CollectionViewDetailItem alloc] - initWithType:ItemTypeDetailRightLong] autorelease]; + CollectionViewDetailItem* detailLongRight = + [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailRightLong]; detailLongRight.text = @"Main Text"; detailLongRight.detailText = @"This is a very long detail text that is intended to overflow"; [model addItem:detailLongRight toSectionWithIdentifier:SectionIdentifierDetailCell]; - CollectionViewDetailItem* detailLongBoth = [[[CollectionViewDetailItem alloc] - initWithType:ItemTypeDetailBothLong] autorelease]; + CollectionViewDetailItem* detailLongBoth = + [[CollectionViewDetailItem alloc] initWithType:ItemTypeDetailBothLong]; detailLongBoth.text = @"This is a very long main text that is intended to overflow"; detailLongBoth.detailText = @@ -213,18 +214,15 @@ // Native app cells. [model addSectionWithIdentifier:SectionIdentifierNativeAppCell]; - NativeAppItem* fooApp = - [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease]; + NativeAppItem* fooApp = [[NativeAppItem alloc] initWithType:ItemTypeApp]; fooApp.name = @"App Foo"; fooApp.state = NativeAppItemSwitchOff; [model addItem:fooApp toSectionWithIdentifier:SectionIdentifierNativeAppCell]; - NativeAppItem* barApp = - [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease]; + NativeAppItem* barApp = [[NativeAppItem alloc] initWithType:ItemTypeApp]; barApp.name = @"App Bar"; barApp.state = NativeAppItemSwitchOn; [model addItem:barApp toSectionWithIdentifier:SectionIdentifierNativeAppCell]; - NativeAppItem* bazApp = - [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease]; + NativeAppItem* bazApp = [[NativeAppItem alloc] initWithType:ItemTypeApp]; bazApp.name = @"App Baz Qux Bla Bug Lorem ipsum dolor sit amet"; bazApp.state = NativeAppItemInstall; [model addItem:bazApp toSectionWithIdentifier:SectionIdentifierNativeAppCell]; @@ -261,32 +259,32 @@ [model addItem:[self paymentsItemWithWrappingTextandOptionalImage] toSectionWithIdentifier:SectionIdentifierPayments]; PriceItem* priceItem1 = - [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease]; + [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine]; priceItem1.item = @"Total"; priceItem1.notification = @"Updated"; priceItem1.price = @"USD $100.00"; [model addItem:priceItem1 toSectionWithIdentifier:SectionIdentifierPayments]; PriceItem* priceItem2 = - [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease]; + [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine]; priceItem2.item = @"Price label is long and should get clipped"; priceItem2.notification = @"Updated"; priceItem2.price = @"USD $1,000,000.00"; [model addItem:priceItem2 toSectionWithIdentifier:SectionIdentifierPayments]; PriceItem* priceItem3 = - [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease]; + [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine]; priceItem3.item = @"Price label is long and should get clipped"; priceItem3.notification = @"Should get clipped too"; priceItem3.price = @"USD $1,000,000.00"; [model addItem:priceItem3 toSectionWithIdentifier:SectionIdentifierPayments]; PriceItem* priceItem4 = - [[[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine] autorelease]; + [[PriceItem alloc] initWithType:ItemTypePaymentsSingleLine]; priceItem4.item = @"Price label is long and should get clipped"; priceItem4.notification = @"Should get clipped too"; priceItem4.price = @"USD $1,000,000,000.00"; [model addItem:priceItem4 toSectionWithIdentifier:SectionIdentifierPayments]; - AutofillProfileItem* profileItem1 = [[[AutofillProfileItem alloc] - initWithType:ItemTypePaymentsDynamicHeight] autorelease]; + AutofillProfileItem* profileItem1 = + [[AutofillProfileItem alloc] initWithType:ItemTypePaymentsDynamicHeight]; profileItem1.name = @"Profile Name gets wrapped if it's too long"; profileItem1.address = @"Profile Address also gets wrapped if it's too long"; profileItem1.phoneNumber = @"123-456-7890"; @@ -294,15 +292,15 @@ profileItem1.notification = @"Some fields are missing"; [model addItem:profileItem1 toSectionWithIdentifier:SectionIdentifierPayments]; - AutofillProfileItem* profileItem2 = [[[AutofillProfileItem alloc] - initWithType:ItemTypePaymentsDynamicHeight] autorelease]; + AutofillProfileItem* profileItem2 = + [[AutofillProfileItem alloc] initWithType:ItemTypePaymentsDynamicHeight]; profileItem1.name = @"All fields are optional"; profileItem2.phoneNumber = @"123-456-7890"; profileItem2.notification = @"Some fields are missing"; [model addItem:profileItem2 toSectionWithIdentifier:SectionIdentifierPayments]; - AutofillProfileItem* profileItem3 = [[[AutofillProfileItem alloc] - initWithType:ItemTypePaymentsDynamicHeight] autorelease]; + AutofillProfileItem* profileItem3 = + [[AutofillProfileItem alloc] initWithType:ItemTypePaymentsDynamicHeight]; profileItem3.address = @"All fields are optional"; profileItem3.email = @"foo@bar.com"; [model addItem:profileItem3 @@ -444,8 +442,7 @@ - (CollectionViewItem*)accountItemDetailWithError { CollectionViewAccountItem* accountItemDetail = - [[[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountDetail] - autorelease]; + [[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountDetail]; accountItemDetail.image = [UIImage imageNamed:@"default_avatar"]; accountItemDetail.text = @"Account User Name"; accountItemDetail.detailText = @@ -458,8 +455,7 @@ - (CollectionViewItem*)accountItemCheckMark { CollectionViewAccountItem* accountItemCheckMark = - [[[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountCheckMark] - autorelease]; + [[CollectionViewAccountItem alloc] initWithType:ItemTypeAccountCheckMark]; accountItemCheckMark.image = [UIImage imageNamed:@"default_avatar"]; accountItemCheckMark.text = @"Lorem ipsum dolor sit amet, consectetur " @"adipiscing elit, sed do eiusmod tempor " @@ -472,8 +468,8 @@ } - (CollectionViewItem*)accountSignInItem { - AccountSignInItem* accountSignInItem = [[[AccountSignInItem alloc] - initWithType:ItemTypeAccountSignIn] autorelease]; + AccountSignInItem* accountSignInItem = + [[AccountSignInItem alloc] initWithType:ItemTypeAccountSignIn]; accountSignInItem.image = CircularImageFromImage(ios::GetChromeBrowserProvider() ->GetSigninResourcesProvider() @@ -483,28 +479,28 @@ } - (CollectionViewItem*)coldStateSigninPromoItem { - SigninPromoItem* signinPromoItem = [[[SigninPromoItem alloc] - initWithType:ItemTypeWarmStateSigninPromo] autorelease]; + SigninPromoItem* signinPromoItem = + [[SigninPromoItem alloc] initWithType:ItemTypeWarmStateSigninPromo]; signinPromoItem.configurator = - [[[SigninPromoViewConfigurator alloc] initWithUserEmail:nil - userFullName:nil - userImage:nil] autorelease]; + [[SigninPromoViewConfigurator alloc] initWithUserEmail:nil + userFullName:nil + userImage:nil]; return signinPromoItem; } - (CollectionViewItem*)warmStateSigninPromoItem { - SigninPromoItem* signinPromoItem = [[[SigninPromoItem alloc] - initWithType:ItemTypeColdStateSigninPromo] autorelease]; - signinPromoItem.configurator = [[[SigninPromoViewConfigurator alloc] + SigninPromoItem* signinPromoItem = + [[SigninPromoItem alloc] initWithType:ItemTypeColdStateSigninPromo]; + signinPromoItem.configurator = [[SigninPromoViewConfigurator alloc] initWithUserEmail:@"jonhdoe@example.com" userFullName:@"John Doe" - userImage:nil] autorelease]; + userImage:nil]; return signinPromoItem; } - (CollectionViewItem*)accountControlItem { - AccountControlItem* item = [[[AccountControlItem alloc] - initWithType:ItemTypeAccountControlDynamicHeight] autorelease]; + AccountControlItem* item = [[AccountControlItem alloc] + initWithType:ItemTypeAccountControlDynamicHeight]; item.image = [UIImage imageNamed:@"settings_sync"]; item.text = @"Account Sync Settings"; item.detailText = @"Detail text"; @@ -513,8 +509,8 @@ } - (CollectionViewItem*)accountControlItemWithExtraLongText { - AccountControlItem* item = [[[AccountControlItem alloc] - initWithType:ItemTypeAccountControlDynamicHeight] autorelease]; + AccountControlItem* item = [[AccountControlItem alloc] + initWithType:ItemTypeAccountControlDynamicHeight]; item.image = [ChromeIcon infoIcon]; item.text = @"Account Control Settings"; item.detailText = @@ -526,16 +522,16 @@ #pragma mark Private - (CollectionViewItem*)basicSwitchItem { - CollectionViewSwitchItem* item = [[[CollectionViewSwitchItem alloc] - initWithType:ItemTypeSwitchBasic] autorelease]; + CollectionViewSwitchItem* item = + [[CollectionViewSwitchItem alloc] initWithType:ItemTypeSwitchBasic]; item.text = @"Enable awesomeness."; item.on = YES; return item; } - (CollectionViewItem*)longTextSwitchItem { - CollectionViewSwitchItem* item = [[[CollectionViewSwitchItem alloc] - initWithType:ItemTypeSwitchDynamicHeight] autorelease]; + CollectionViewSwitchItem* item = [[CollectionViewSwitchItem alloc] + initWithType:ItemTypeSwitchDynamicHeight]; item.text = @"Enable awesomeness. This is a very long text that is intended " @"to overflow."; item.on = YES; @@ -544,7 +540,7 @@ - (CollectionViewItem*)syncSwitchItem { SyncSwitchItem* item = - [[[SyncSwitchItem alloc] initWithType:ItemTypeSwitchSync] autorelease]; + [[SyncSwitchItem alloc] initWithType:ItemTypeSwitchSync]; item.text = @"Cell used in Sync Settings"; item.detailText = @"This is a very long text that is intended to overflow to two lines."; @@ -553,8 +549,8 @@ } - (CollectionViewItem*)paymentsItemWithWrappingTextandOptionalImage { - PaymentsTextItem* item = [[[PaymentsTextItem alloc] - initWithType:ItemTypePaymentsDynamicHeight] autorelease]; + PaymentsTextItem* item = + [[PaymentsTextItem alloc] initWithType:ItemTypePaymentsDynamicHeight]; item.text = @"If you want to display a long text that wraps to the next line " @"and may need to feature an image this is the cell to use."; item.image = [UIImage imageNamed:@"app_icon_placeholder"]; @@ -562,8 +558,8 @@ } - (CollectionViewItem*)autofillItemWithMainAndTrailingText { - AutofillDataItem* item = [[[AutofillDataItem alloc] - initWithType:ItemTypeAutofillDynamicHeight] autorelease]; + AutofillDataItem* item = + [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; item.text = @"Main Text"; item.trailingDetailText = @"Trailing Detail Text"; item.accessoryType = MDCCollectionViewCellAccessoryNone; @@ -571,8 +567,8 @@ } - (CollectionViewItem*)autofillItemWithLeadingTextOnly { - AutofillDataItem* item = [[[AutofillDataItem alloc] - initWithType:ItemTypeAutofillDynamicHeight] autorelease]; + AutofillDataItem* item = + [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; item.text = @"Main Text"; item.leadingDetailText = @"Leading Detail Text"; item.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator; @@ -580,8 +576,8 @@ } - (CollectionViewItem*)autofillItemWithAllText { - AutofillDataItem* item = [[[AutofillDataItem alloc] - initWithType:ItemTypeAutofillDynamicHeight] autorelease]; + AutofillDataItem* item = + [[AutofillDataItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; item.text = @"Main Text"; item.leadingDetailText = @"Leading Detail Text"; item.trailingDetailText = @"Trailing Detail Text"; @@ -590,8 +586,8 @@ } - (CollectionViewItem*)autofillEditItem { - AutofillEditItem* item = [[[AutofillEditItem alloc] - initWithType:ItemTypeAutofillDynamicHeight] autorelease]; + AutofillEditItem* item = + [[AutofillEditItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; item.textFieldName = @"Required Card Number"; item.textFieldValue = @"4111111111111111"; item.textFieldEnabled = YES; @@ -600,8 +596,8 @@ } - (CollectionViewItem*)autofillEditItemWithIcon { - AutofillEditItem* item = [[[AutofillEditItem alloc] - initWithType:ItemTypeAutofillDynamicHeight] autorelease]; + AutofillEditItem* item = + [[AutofillEditItem alloc] initWithType:ItemTypeAutofillDynamicHeight]; item.textFieldName = @"Card Number"; item.textFieldValue = @"4111111111111111"; item.textFieldEnabled = YES; @@ -615,8 +611,7 @@ } - (CollectionViewItem*)cvcItem { - CVCItem* item = - [[[CVCItem alloc] initWithType:ItemTypeAutofillCVC] autorelease]; + CVCItem* item = [[CVCItem alloc] initWithType:ItemTypeAutofillCVC]; item.instructionsText = @"This is a long text explaining to enter card details and what " @"will happen afterwards."; @@ -625,8 +620,7 @@ } - (CollectionViewItem*)cvcItemWithDate { - CVCItem* item = - [[[CVCItem alloc] initWithType:ItemTypeAutofillCVC] autorelease]; + CVCItem* item = [[CVCItem alloc] initWithType:ItemTypeAutofillCVC]; item.instructionsText = @"This is a long text explaining to enter card details and what " @"will happen afterwards."; @@ -636,8 +630,7 @@ } - (CollectionViewItem*)cvcItemWithError { - CVCItem* item = - [[[CVCItem alloc] initWithType:ItemTypeAutofillCVC] autorelease]; + CVCItem* item = [[CVCItem alloc] initWithType:ItemTypeAutofillCVC]; item.instructionsText = @"This is a long text explaining to enter card details and what " @"will happen afterwards. Is this long enough to span 3 lines?"; @@ -649,23 +642,20 @@ } - (CollectionViewItem*)statusItemVerifying { - StatusItem* item = - [[[StatusItem alloc] initWithType:ItemTypeAutofillStatus] autorelease]; + StatusItem* item = [[StatusItem alloc] initWithType:ItemTypeAutofillStatus]; item.text = @"Verifying…"; return item; } - (CollectionViewItem*)statusItemVerified { - StatusItem* item = - [[[StatusItem alloc] initWithType:ItemTypeAutofillStatus] autorelease]; + StatusItem* item = [[StatusItem alloc] initWithType:ItemTypeAutofillStatus]; item.state = StatusItemState::VERIFIED; item.text = @"Verified!"; return item; } - (CollectionViewItem*)statusItemError { - StatusItem* item = - [[[StatusItem alloc] initWithType:ItemTypeAutofillStatus] autorelease]; + StatusItem* item = [[StatusItem alloc] initWithType:ItemTypeAutofillStatus]; item.state = StatusItemState::ERROR; item.text = @"There was a really long error. We can't tell you more, but we " @"will still display this long string."; @@ -673,22 +663,22 @@ } - (CollectionViewItem*)storageSwitchItem { - StorageSwitchItem* item = [[[StorageSwitchItem alloc] - initWithType:ItemTypeAutofillStorageSwitch] autorelease]; + StorageSwitchItem* item = + [[StorageSwitchItem alloc] initWithType:ItemTypeAutofillStorageSwitch]; item.on = YES; return item; } - (CollectionViewFooterItem*)shortFooterItem { - CollectionViewFooterItem* footerItem = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeFooter] autorelease]; + CollectionViewFooterItem* footerItem = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter]; footerItem.text = @"Hello"; return footerItem; } - (CollectionViewFooterItem*)longFooterItem { - CollectionViewFooterItem* footerItem = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeFooter] autorelease]; + CollectionViewFooterItem* footerItem = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeFooter]; footerItem.text = @"Hello Hello Hello Hello Hello Hello Hello Hello Hello " @"Hello Hello Hello Hello Hello Hello Hello Hello Hello " @"Hello Hello Hello Hello Hello Hello Hello Hello Hello ";
diff --git a/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm b/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm index 2ec5fb3..68602f5 100644 --- a/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/native_apps_collection_view_controller.mm
@@ -7,10 +7,8 @@ #import <StoreKit/StoreKit.h> -#import "base/ios/weak_nsobject.h" #include "base/logging.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" @@ -35,6 +33,10 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + const NSInteger kTagShift = 1000; namespace { @@ -54,7 +56,7 @@ @interface NativeAppsCollectionViewController ()< SKStoreProductViewControllerDelegate> { std::unique_ptr<image_fetcher::IOSImageDataFetcherWrapper> _imageFetcher; - base::scoped_nsobject<NSArray> _nativeAppsInSettings; + NSArray* _nativeAppsInSettings; BOOL _userDidSomething; } @@ -62,7 +64,7 @@ @property(nonatomic, copy) NSArray* appsInSettings; // Delegate for App-Store-related operations. -@property(nonatomic, assign) id<StoreKitLauncher> storeKitLauncher; +@property(nonatomic, weak) id<StoreKitLauncher> storeKitLauncher; // Sets up the list of visible apps based on |nativeAppWhitelistManager|, which // serves as datasource for this controller. Apps from @@ -117,7 +119,6 @@ [[InstallationNotifier sharedInstance] unregisterForNotifications:self]; if (!_userDidSomething) [self recordUserAction:settings::kNativeAppsActionDidNothing]; - [super dealloc]; } #pragma mark - View lifecycle @@ -213,17 +214,17 @@ NativeAppItem* appItem = base::mac::ObjCCastStrict<NativeAppItem>(item); if (!appItem.icon) { // Fetch the real icon. - base::WeakNSObject<NativeAppsCollectionViewController> weakSelf(self); + __weak NativeAppsCollectionViewController* weakSelf = self; id<NativeAppMetadata> metadata = [self nativeAppAtIndex:indexPath.item]; [metadata fetchSmallIconWithImageFetcher:_imageFetcher.get() completionBlock:^(UIImage* image) { - base::scoped_nsobject< - NativeAppsCollectionViewController> - strongSelf([weakSelf retain]); + + NativeAppsCollectionViewController* strongSelf = + weakSelf; if (!image || !strongSelf) return; appItem.icon = image; - [strongSelf.get().collectionView + [strongSelf.collectionView reloadItemsAtIndexPaths:@[ indexPath ]]; }]; } @@ -232,8 +233,8 @@ - (CollectionViewItem*)learnMoreItem { NSString* learnMoreText = l10n_util::GetNSString(IDS_IOS_GOOGLE_APPS_SM_SECTION_HEADER); - CollectionViewFooterItem* learnMoreItem = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeLearnMore] autorelease]; + CollectionViewFooterItem* learnMoreItem = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeLearnMore]; learnMoreItem.text = learnMoreText; return learnMoreItem; } @@ -255,8 +256,8 @@ return; NSDictionary* product = @{SKStoreProductParameterITunesItemIdentifier : appId}; - base::scoped_nsobject<SKStoreProductViewController> storeViewController( - [[SKStoreProductViewController alloc] init]); + SKStoreProductViewController* storeViewController = + [[SKStoreProductViewController alloc] init]; [storeViewController setDelegate:self]; [storeViewController loadProductWithParameters:product completionBlock:nil]; [self presentViewController:storeViewController animated:YES completion:nil]; @@ -372,19 +373,18 @@ } else { state = NativeAppItemInstall; } - NativeAppItem* appItem = - [[[NativeAppItem alloc] initWithType:ItemTypeApp] autorelease]; + NativeAppItem* appItem = [[NativeAppItem alloc] initWithType:ItemTypeApp]; appItem.name = [metadata appName]; appItem.state = state; return appItem; } - (NSArray*)appsInSettings { - return _nativeAppsInSettings.get(); + return _nativeAppsInSettings; } - (void)setAppsInSettings:(NSArray*)apps { - _nativeAppsInSettings.reset([apps copy]); + _nativeAppsInSettings = [apps copy]; } - (NSInteger)tagForIndexPath:(NSIndexPath*)indexPath {
diff --git a/ios/chrome/browser/ui/settings/password_details_collection_view_controller.mm b/ios/chrome/browser/ui/settings/password_details_collection_view_controller.mm index 9cd65b87..50b7fd7 100644 --- a/ios/chrome/browser/ui/settings/password_details_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/password_details_collection_view_controller.mm
@@ -4,9 +4,7 @@ #import "ios/chrome/browser/ui/settings/password_details_collection_view_controller.h" -#import "base/ios/weak_nsobject.h" #include "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/affiliation_utils.h" @@ -27,6 +25,10 @@ #import "ios/third_party/material_components_ios/src/components/Snackbar/src/MaterialSnackbar.h" #include "ui/base/l10n/l10n_util_mac.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -47,23 +49,21 @@ @interface PasswordDetailsCollectionViewController () { // The username to which the saved password belongs. - base::scoped_nsobject<NSString> _username; + NSString* _username; // The saved password. - base::scoped_nsobject<NSString> _password; + NSString* _password; // Whether the password is shown in plain text form or in obscured form. BOOL _plainTextPasswordShown; // The password form. autofill::PasswordForm _passwordForm; // Instance of the parent view controller needed in order to update the // password list when a password is deleted. - base::WeakNSProtocol<id<PasswordDetailsCollectionViewControllerDelegate>> - _weakDelegate; + __weak id<PasswordDetailsCollectionViewControllerDelegate> _weakDelegate; // Module containing the reauthentication mechanism for viewing and copying // passwords. - base::WeakNSProtocol<id<ReauthenticationProtocol>> - _weakReauthenticationModule; + __weak id<ReauthenticationProtocol> _weakReauthenticationModule; // The password item. - base::scoped_nsobject<PasswordDetailsItem> _passwordItem; + PasswordDetailsItem* _passwordItem; } @end @@ -82,11 +82,11 @@ DCHECK(reauthenticationModule); self = [super initWithStyle:CollectionViewControllerStyleAppBar]; if (self) { - _weakDelegate.reset(delegate); - _weakReauthenticationModule.reset(reauthenticationModule); + _weakDelegate = delegate; + _weakReauthenticationModule = reauthenticationModule; _passwordForm = passwordForm; - _username.reset([username copy]); - _password.reset([password copy]); + _username = [username copy]; + _password = [password copy]; self.title = [PasswordDetailsCollectionViewController simplifyOrigin:origin]; NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; @@ -119,32 +119,31 @@ CollectionViewModel* model = self.collectionViewModel; [model addSectionWithIdentifier:SectionIdentifierUsername]; - CollectionViewTextItem* usernameHeader = [ - [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease]; + CollectionViewTextItem* usernameHeader = + [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader]; usernameHeader.text = l10n_util::GetNSString(IDS_IOS_SHOW_PASSWORD_VIEW_USERNAME); usernameHeader.textColor = [[MDCPalette greyPalette] tint500]; [model setHeader:usernameHeader forSectionWithIdentifier:SectionIdentifierUsername]; PasswordDetailsItem* usernameItem = - [[[PasswordDetailsItem alloc] initWithType:ItemTypeUsername] autorelease]; + [[PasswordDetailsItem alloc] initWithType:ItemTypeUsername]; usernameItem.text = _username; usernameItem.showingText = YES; [model addItem:usernameItem toSectionWithIdentifier:SectionIdentifierUsername]; [model addSectionWithIdentifier:SectionIdentifierPassword]; - CollectionViewTextItem* passwordHeader = [ - [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader] autorelease]; + CollectionViewTextItem* passwordHeader = + [[CollectionViewTextItem alloc] initWithType:ItemTypeHeader]; passwordHeader.text = l10n_util::GetNSString(IDS_IOS_SHOW_PASSWORD_VIEW_PASSWORD); passwordHeader.textColor = [[MDCPalette greyPalette] tint500]; [model setHeader:passwordHeader forSectionWithIdentifier:SectionIdentifierPassword]; - _passwordItem.reset( - [[PasswordDetailsItem alloc] initWithType:ItemTypePassword]); - _passwordItem.get().text = _password; - _passwordItem.get().showingText = NO; + _passwordItem = [[PasswordDetailsItem alloc] initWithType:ItemTypePassword]; + _passwordItem.text = _password; + _passwordItem.showingText = NO; [model addItem:_passwordItem toSectionWithIdentifier:SectionIdentifierPassword]; @@ -160,30 +159,29 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; } #pragma mark - Items - (CollectionViewItem*)passwordCopyButtonItem { CollectionViewTextItem* item = - [[[CollectionViewTextItem alloc] initWithType:ItemTypeCopy] autorelease]; + [[CollectionViewTextItem alloc] initWithType:ItemTypeCopy]; item.text = l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_COPY_BUTTON); item.accessibilityTraits |= UIAccessibilityTraitButton; return item; } - (CollectionViewItem*)showHidePasswordButtonItem { - CollectionViewTextItem* item = [[[CollectionViewTextItem alloc] - initWithType:ItemTypeShowHide] autorelease]; + CollectionViewTextItem* item = + [[CollectionViewTextItem alloc] initWithType:ItemTypeShowHide]; item.text = [self showHideButtonText]; item.accessibilityTraits |= UIAccessibilityTraitButton; return item; } - (CollectionViewItem*)deletePasswordButtonItem { - CollectionViewTextItem* item = [ - [[CollectionViewTextItem alloc] initWithType:ItemTypeDelete] autorelease]; + CollectionViewTextItem* item = + [[CollectionViewTextItem alloc] initWithType:ItemTypeDelete]; item.text = l10n_util::GetNSString(IDS_IOS_SETTINGS_PASSWORD_DELETE_BUTTON); item.textColor = [[MDCPalette cr_redPalette] tint500]; item.accessibilityTraits |= UIAccessibilityTraitButton; @@ -220,18 +218,17 @@ } if ([_weakReauthenticationModule canAttemptReauth]) { - base::WeakNSObject<PasswordDetailsCollectionViewController> weakSelf(self); + __weak PasswordDetailsCollectionViewController* weakSelf = self; void (^showPasswordHandler)(BOOL) = ^(BOOL success) { - base::scoped_nsobject<PasswordDetailsCollectionViewController> strongSelf( - [weakSelf retain]); + PasswordDetailsCollectionViewController* strongSelf = weakSelf; if (!strongSelf || !success) return; - PasswordDetailsItem* passwordItem = strongSelf.get()->_passwordItem.get(); + PasswordDetailsItem* passwordItem = strongSelf->_passwordItem; passwordItem.showingText = YES; [strongSelf reconfigureCellsForItems:@[ passwordItem ] inSectionWithIdentifier:SectionIdentifierPassword]; [[strongSelf collectionView].collectionViewLayout invalidateLayout]; - strongSelf.get()->_plainTextPasswordShown = YES; + strongSelf->_plainTextPasswordShown = YES; [strongSelf toggleShowHideButton]; }; @@ -246,7 +243,7 @@ if (!_plainTextPasswordShown) { return; } - _passwordItem.get().showingText = NO; + _passwordItem.showingText = NO; [self reconfigureCellsForItems:@[ _passwordItem ] inSectionWithIdentifier:SectionIdentifierPassword]; [self.collectionView.collectionViewLayout invalidateLayout]; @@ -266,15 +263,14 @@ l10n_util::GetNSString( IDS_IOS_SETTINGS_PASSWORD_WAS_COPIED_MESSAGE)]; } else if ([_weakReauthenticationModule canAttemptReauth]) { - base::WeakNSObject<PasswordDetailsCollectionViewController> weakSelf(self); + __weak PasswordDetailsCollectionViewController* weakSelf = self; void (^copyPasswordHandler)(BOOL) = ^(BOOL success) { - base::scoped_nsobject<PasswordDetailsCollectionViewController> strongSelf( - [weakSelf retain]); + PasswordDetailsCollectionViewController* strongSelf = weakSelf; if (!strongSelf) return; if (success) { UIPasteboard* generalPasteboard = [UIPasteboard generalPasteboard]; - generalPasteboard.string = strongSelf.get()->_password; + generalPasteboard.string = strongSelf->_password; TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess); [strongSelf showCopyPasswordResultToast: l10n_util::GetNSString(
diff --git a/ios/chrome/browser/ui/settings/physical_web_collection_view_controller.mm b/ios/chrome/browser/ui/settings/physical_web_collection_view_controller.mm index 9067652..9ef7cff9 100644 --- a/ios/chrome/browser/ui/settings/physical_web_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/physical_web_collection_view_controller.mm
@@ -6,9 +6,7 @@ #import <CoreLocation/CoreLocation.h> -#import "base/ios/weak_nsobject.h" #import "base/mac/foundation_util.h" -#import "base/mac/scoped_nsobject.h" #include "base/metrics/user_metrics.h" #include "components/google/core/browser/google_util.h" #include "components/physical_web/data_source/physical_web_data_source.h" @@ -32,6 +30,10 @@ #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + namespace { typedef NS_ENUM(NSInteger, SectionIdentifier) { @@ -163,8 +165,8 @@ NSString* switchLabelText = l10n_util::GetNSString(IDS_IOS_OPTIONS_ENABLE_PHYSICAL_WEB); - CollectionViewSwitchItem* switchItem = [[[CollectionViewSwitchItem alloc] - initWithType:ItemTypePhysicalWebSwitch] autorelease]; + CollectionViewSwitchItem* switchItem = + [[CollectionViewSwitchItem alloc] initWithType:ItemTypePhysicalWebSwitch]; switchItem.text = switchLabelText; switchItem.on = [PhysicalWebCollectionViewController shouldEnableForPreferenceState:_physicalWebEnabled.GetValue()]; @@ -176,8 +178,8 @@ NSString* learnMoreText = l10n_util::GetNSString(IDS_IOS_OPTIONS_ENABLE_PHYSICAL_WEB_DETAILS); - CollectionViewFooterItem* learnMore = [[[CollectionViewFooterItem alloc] - initWithType:ItemTypeLearnMore] autorelease]; + CollectionViewFooterItem* learnMore = + [[CollectionViewFooterItem alloc] initWithType:ItemTypeLearnMore]; learnMore.text = learnMoreText; learnMore.linkURL = GURL(kPhysicalWebLearnMoreURL); learnMore.linkDelegate = self;
diff --git a/ios/chrome/browser/ui/settings/settings_navigation_controller.mm b/ios/chrome/browser/ui/settings/settings_navigation_controller.mm index e0e9b29..9f7b5db3 100644 --- a/ios/chrome/browser/ui/settings/settings_navigation_controller.mm +++ b/ios/chrome/browser/ui/settings/settings_navigation_controller.mm
@@ -171,7 +171,7 @@ base::scoped_nsobject<UIViewController> controller( ios::GetChromeBrowserProvider() ->GetUserFeedbackProvider() - ->CreateViewController([dataSource retain])); + ->CreateViewController(dataSource)); DCHECK(controller); SettingsNavigationController* nc = [[SettingsNavigationController alloc] initWithRootViewController:controller
diff --git a/ios/chrome/browser/ui/stack_view/BUILD.gn b/ios/chrome/browser/ui/stack_view/BUILD.gn index ffbd7b1f..dcf3ca52 100644 --- a/ios/chrome/browser/ui/stack_view/BUILD.gn +++ b/ios/chrome/browser/ui/stack_view/BUILD.gn
@@ -92,6 +92,7 @@ "//ios/chrome/browser/ui/toolbar", "//ios/chrome/browser/ui/tools_menu", "//ios/chrome/common", + "//ios/shared/chrome/browser/ui/tools_menu", "//ios/third_party/material_components_ios", "//ios/web", "//net",
diff --git a/ios/chrome/browser/ui/stack_view/stack_view_controller.mm b/ios/chrome/browser/ui/stack_view/stack_view_controller.mm index 2dabb01..cdb4ba2b 100644 --- a/ios/chrome/browser/ui/stack_view/stack_view_controller.mm +++ b/ios/chrome/browser/ui/stack_view/stack_view_controller.mm
@@ -48,12 +48,12 @@ #import "ios/chrome/browser/ui/stack_view/title_label.h" #import "ios/chrome/browser/ui/toolbar/new_tab_button.h" #import "ios/chrome/browser/ui/toolbar/toolbar_owner.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_item.h" #import "ios/chrome/browser/ui/ui_util.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/common/material_timing.h" #include "ios/chrome/grit/ios_strings.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #include "ios/web/public/referrer.h" #import "net/base/mac/url_conversions.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/ios/chrome/browser/ui/toolbar/BUILD.gn b/ios/chrome/browser/ui/toolbar/BUILD.gn index 68d815db..65fe924 100644 --- a/ios/chrome/browser/ui/toolbar/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/BUILD.gn
@@ -100,6 +100,7 @@ "//ios/public/provider/chrome/browser/images", "//ios/public/provider/chrome/browser/voice", "//ios/shared/chrome/browser/ui/omnibox", + "//ios/shared/chrome/browser/ui/tools_menu", "//ios/third_party/material_components_ios", "//ios/third_party/material_roboto_font_loader_ios", "//ios/web", @@ -171,6 +172,7 @@ "//ios/chrome/browser/web_state_list", "//ios/chrome/browser/web_state_list:test_support", "//ios/chrome/test:test_support", + "//ios/shared/chrome/browser/ui/toolbar:test_support", "//ios/testing:ocmock_support", "//ios/web:test_support", "//testing/gtest",
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/toolbar_controller.mm index 3eb51c6..0e8d5ac 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_controller.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_controller.mm
@@ -27,12 +27,12 @@ #include "ios/chrome/browser/ui/toolbar/toolbar_resource_macros.h" #import "ios/chrome/browser/ui/toolbar/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/tools_menu_button_observer_bridge.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" #import "ios/chrome/common/material_timing.h" #include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_theme_resources.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/third_party/material_roboto_font_loader_ios/src/src/MaterialRobotoFontLoader.h" using base::UserMetricsAction;
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm b/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm index 1188727d..80eddcb 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm
@@ -20,6 +20,7 @@ #include "ios/chrome/browser/web_state_list/fake_web_state_list_delegate.h" #include "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/xcallback_parameters.h" +#import "ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.h" #import "ios/testing/ocmock_complex_type_helper.h" #import "ios/web/public/test/fakes/test_navigation_manager.h" #import "ios/web/public/test/fakes/test_web_state.h" @@ -35,43 +36,6 @@ static const char kWebUrl[] = "http://www.chromium.org"; static const char kNativeUrl[] = "chrome://version"; -namespace { - -class ToolbarTestWebState : public web::TestWebState { - public: - ToolbarTestWebState() : loading_progress_(0) {} - - double GetLoadingProgress() const override { return loading_progress_; } - void set_loading_progress(double loading_progress) { - loading_progress_ = loading_progress; - } - - private: - double loading_progress_; - - DISALLOW_COPY_AND_ASSIGN(ToolbarTestWebState); -}; - -class ToolbarTestNavigationManager : public web::TestNavigationManager { - public: - ToolbarTestNavigationManager() - : can_go_back_(false), can_go_forward_(false) {} - - bool CanGoBack() const override { return can_go_back_; } - bool CanGoForward() const override { return can_go_forward_; } - - void set_can_go_back(bool can_go_back) { can_go_back_ = can_go_back; } - void set_can_go_forward(bool can_go_forward) { - can_go_forward_ = can_go_forward; - } - - private: - bool can_go_back_; - bool can_go_forward_; -}; - -} // namespace - class ToolbarModelImplIOSTest : public PlatformTest { protected: void SetUp() override {
diff --git a/ios/chrome/browser/ui/tools_menu/BUILD.gn b/ios/chrome/browser/ui/tools_menu/BUILD.gn index 6ffcd2d..4b842be 100644 --- a/ios/chrome/browser/ui/tools_menu/BUILD.gn +++ b/ios/chrome/browser/ui/tools_menu/BUILD.gn
@@ -6,8 +6,6 @@ sources = [ "reading_list_menu_view_item.h", "reading_list_menu_view_item.mm", - "tools_menu_configuration.h", - "tools_menu_configuration.mm", "tools_menu_constants.h", "tools_menu_constants.mm", "tools_menu_model.h", @@ -36,6 +34,7 @@ "//ios/chrome/common", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/user_feedback", + "//ios/shared/chrome/browser/ui/tools_menu", "//ios/third_party/material_components_ios", "//ios/third_party/material_roboto_font_loader_ios", "//ios/web:user_agent", @@ -58,6 +57,7 @@ ":tools_menu", "//base", "//ios/chrome/browser/ui/commands:commands", + "//ios/shared/chrome/browser/ui/tools_menu", "//ios/web:user_agent", "//testing/gtest", ]
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_model.h b/ios/chrome/browser/ui/tools_menu/tools_menu_model.h index 9b40414..4e88cd8 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_model.h +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_model.h
@@ -7,7 +7,7 @@ #import <Foundation/Foundation.h> -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" // Total number of possible menu items. const int kToolsMenuNumberOfItems = 16;
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm index 2d578f37..e6bd9549 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.mm
@@ -20,7 +20,6 @@ #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notification_delegate.h" #import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h" #import "ios/chrome/browser/ui/tools_menu/reading_list_menu_view_item.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_model.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_item.h" @@ -32,6 +31,7 @@ #include "ios/chrome/grit/ios_strings.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/third_party/material_components_ios/src/components/Ink/src/MaterialInk.h" #include "ios/web/public/user_agent.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm index 2a7d7a5..768387b 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_menu_view_controller_unittest.mm
@@ -6,8 +6,8 @@ #import "base/mac/scoped_nsobject.h" #include "ios/chrome/browser/ui/commands/ios_command_ids.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_item.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #include "ios/web/public/user_agent.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h"
diff --git a/ios/chrome/browser/ui/tools_menu/tools_popup_controller.mm b/ios/chrome/browser/ui/tools_menu/tools_popup_controller.mm index af3f141..13da1c8 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_popup_controller.mm +++ b/ios/chrome/browser/ui/tools_menu/tools_popup_controller.mm
@@ -12,9 +12,9 @@ #include "base/metrics/user_metrics_action.h" #include "ios/chrome/browser/ui/commands/ios_command_ids.h" #include "ios/chrome/browser/ui/rtl_geometry.h" -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" #import "ios/chrome/browser/ui/uikit_ui_util.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" using base::UserMetricsAction;
diff --git a/ios/chrome/widget_extension/widget_view_controller.mm b/ios/chrome/widget_extension/widget_view_controller.mm index b68b97a..141cc23 100644 --- a/ios/chrome/widget_extension/widget_view_controller.mm +++ b/ios/chrome/widget_extension/widget_view_controller.mm
@@ -55,9 +55,10 @@ self = [super init]; if (self) { _clipboardRecentContent = [[ClipboardRecentContentImplIOS alloc] - initWithAuthorizedSchemes:[NSSet setWithObjects:@"http", @"https", nil] - userDefaults:app_group::GetGroupUserDefaults() - delegate:nil]; + initWithMaxAge:1 * 60 * 60 + authorizedSchemes:[NSSet setWithObjects:@"http", @"https", nil] + userDefaults:app_group::GetGroupUserDefaults() + delegate:nil]; } return self; }
diff --git a/ios/clean/OWNERS b/ios/clean/OWNERS index d5d7f59..6d63668 100644 --- a/ios/clean/OWNERS +++ b/ios/clean/OWNERS
@@ -1,2 +1,3 @@ +edchin@chromium.org lpromero@chromium.org marq@chromium.org
diff --git a/ios/clean/chrome/browser/ui/ntp/ntp_coordinator.mm b/ios/clean/chrome/browser/ui/ntp/ntp_coordinator.mm index 3ead5f6b..bcfe9259 100644 --- a/ios/clean/chrome/browser/ui/ntp/ntp_coordinator.mm +++ b/ios/clean/chrome/browser/ui/ntp/ntp_coordinator.mm
@@ -47,11 +47,6 @@ - (void)stop { [super stop]; - // PLACEHOLDER: Stop child coordinators here for now. We might deal with this - // differently later on. - for (BrowserCoordinator* child in self.children) { - [child stop]; - } [self.browser->dispatcher() stopDispatchingToTarget:self]; }
diff --git a/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm b/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm index 65bc96c..f3fa649 100644 --- a/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm +++ b/ios/clean/chrome/browser/ui/tab/tab_coordinator.mm
@@ -99,11 +99,6 @@ - (void)stop { [super stop]; - // PLACEHOLDER: Stop child coordinators here for now. We might deal with this - // differently later on. - for (BrowserCoordinator* child in self.children) { - [child stop]; - } _webStateObserver.reset(); [self.browser->dispatcher() stopDispatchingToTarget:self]; }
diff --git a/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h b/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h index f97a6b72..976379b 100644 --- a/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h +++ b/ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h
@@ -42,7 +42,7 @@ virtual bool IsUserFeedbackEnabled(); // Returns view controller to present to the user to collect their feedback. virtual UIViewController* CreateViewController( - id<UserFeedbackDataSource> dataSource); + id<UserFeedbackDataSource> dataSource) NS_RETURNS_RETAINED; // Uploads collected feedback reports. virtual void Synchronize();
diff --git a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h index 20987e0..1386b19 100644 --- a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h +++ b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.h
@@ -34,6 +34,7 @@ // Stops the user interaction managed by the receiver. This method needs to be // called at the beginning of the overriding implementation. +// Calling stop on a coordinator transitively calls stop on its children. - (void)stop NS_REQUIRES_SUPER; @end
diff --git a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm index 4e758fd..338fa15a 100644 --- a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm +++ b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator.mm
@@ -46,6 +46,11 @@ - (void)stop { [self.parentCoordinator childCoordinatorWillStop:self]; self.started = NO; + for (BrowserCoordinator* child in self.children) { + if (child.started) { + [child stop]; + } + } } @end
diff --git a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator_unittest.mm b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator_unittest.mm index df005e6e..354f2875 100644 --- a/ios/shared/chrome/browser/ui/coordinators/browser_coordinator_unittest.mm +++ b/ios/shared/chrome/browser/ui/coordinators/browser_coordinator_unittest.mm
@@ -190,4 +190,41 @@ EXPECT_TRUE(parent.childWillStopCalled); } +TEST(BrowserCoordinatorTest, StopStopsStartedChildren) { + TestCoordinator* parent = [[TestCoordinator alloc] init]; + TestCoordinator* child = [[TestCoordinator alloc] init]; + [parent addChildCoordinator:child]; + [parent start]; + [child start]; + __block BOOL called = NO; + child.stopHandler = ^{ + called = YES; + }; + EXPECT_FALSE(called); + + // Call stop on the parent. + [parent stop]; + + // It should have called stop on the child. + EXPECT_TRUE(called); +} + +TEST(BrowserCoordinatorTest, StopDoesntStopNonStartedChildren) { + TestCoordinator* parent = [[TestCoordinator alloc] init]; + TestCoordinator* child = [[TestCoordinator alloc] init]; + [parent addChildCoordinator:child]; + [parent start]; + __block BOOL called = NO; + child.stopHandler = ^{ + called = YES; + }; + EXPECT_FALSE(called); + + // Call stop on the parent. + [parent stop]; + + // It should not have called stop on the child. + EXPECT_FALSE(called); +} + } // namespace
diff --git a/ios/shared/chrome/browser/ui/toolbar/BUILD.gn b/ios/shared/chrome/browser/ui/toolbar/BUILD.gn new file mode 100644 index 0000000..d787bd37d --- /dev/null +++ b/ios/shared/chrome/browser/ui/toolbar/BUILD.gn
@@ -0,0 +1,15 @@ +# Copyright 2017 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. + +source_set("test_support") { + testonly = true + sources = [ + "toolbar_test_util.h", + "toolbar_test_util.mm", + ] + deps = [ + "//ios/web:test_support", + ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.h b/ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.h new file mode 100644 index 0000000..41774a0 --- /dev/null +++ b/ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.h
@@ -0,0 +1,39 @@ +// Copyright 2017 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 IOS_SHARED_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_TEST_UTIL_H_ +#define IOS_SHARED_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_TEST_UTIL_H_ + +#import "ios/web/public/test/fakes/test_navigation_manager.h" +#import "ios/web/public/test/fakes/test_web_state.h" + +class ToolbarTestWebState : public web::TestWebState { + public: + ToolbarTestWebState(); + + double GetLoadingProgress() const override; + void set_loading_progress(double loading_progress); + + private: + double loading_progress_; + + DISALLOW_COPY_AND_ASSIGN(ToolbarTestWebState); +}; + +class ToolbarTestNavigationManager : public web::TestNavigationManager { + public: + ToolbarTestNavigationManager(); + + bool CanGoBack() const override; + bool CanGoForward() const override; + + void set_can_go_back(bool can_go_back); + void set_can_go_forward(bool can_go_forward); + + private: + bool can_go_back_; + bool can_go_forward_; +}; + +#endif // IOS_SHARED_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_TEST_UTIL_H_
diff --git a/ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.mm b/ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.mm new file mode 100644 index 0000000..5de45cda --- /dev/null +++ b/ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.mm
@@ -0,0 +1,38 @@ +// Copyright 2017 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. + +#import "ios/shared/chrome/browser/ui/toolbar/toolbar_test_util.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +ToolbarTestWebState::ToolbarTestWebState() : loading_progress_(0){}; + +double ToolbarTestWebState::GetLoadingProgress() const { + return loading_progress_; +} + +void ToolbarTestWebState::set_loading_progress(double loading_progress) { + loading_progress_ = loading_progress; +} + +ToolbarTestNavigationManager::ToolbarTestNavigationManager() + : can_go_back_(false), can_go_forward_(false) {} + +bool ToolbarTestNavigationManager::CanGoBack() const { + return can_go_back_; +} + +bool ToolbarTestNavigationManager::CanGoForward() const { + return can_go_forward_; +} + +void ToolbarTestNavigationManager::set_can_go_back(bool can_go_back) { + can_go_back_ = can_go_back; +} + +void ToolbarTestNavigationManager::set_can_go_forward(bool can_go_forward) { + can_go_forward_ = can_go_forward; +}
diff --git a/ios/shared/chrome/browser/ui/tools_menu/BUILD.gn b/ios/shared/chrome/browser/ui/tools_menu/BUILD.gn new file mode 100644 index 0000000..eb5a01d --- /dev/null +++ b/ios/shared/chrome/browser/ui/tools_menu/BUILD.gn
@@ -0,0 +1,17 @@ +# Copyright 2017 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. + +source_set("tools_menu") { + sources = [ + "tools_menu_configuration.h", + "tools_menu_configuration.mm", + ] + + configs += [ "//build/config/compiler:enable_arc" ] + + deps = [ + "//base", + "//ios/web:user_agent", + ] +}
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h b/ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h similarity index 90% rename from ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h rename to ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h index aaf14a12..b941753 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h +++ b/ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.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 IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ -#define IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ +#ifndef IOS_SHARED_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ +#define IOS_SHARED_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @@ -54,4 +54,4 @@ @end -#endif // IOS_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_ +#endif // IOS_SHARED_CHROME_BROWSER_UI_TOOLS_MENU_TOOLS_MENU_CONFIGURATION_H_
diff --git a/ios/chrome/browser/ui/tools_menu/tools_menu_configuration.mm b/ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.mm similarity index 92% rename from ios/chrome/browser/ui/tools_menu/tools_menu_configuration.mm rename to ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.mm index 916eece..f4a4bd5 100644 --- a/ios/chrome/browser/ui/tools_menu/tools_menu_configuration.mm +++ b/ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.mm
@@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "ios/chrome/browser/ui/tools_menu/tools_menu_configuration.h" +#import "ios/shared/chrome/browser/ui/tools_menu/tools_menu_configuration.h" #import "base/ios/weak_nsobject.h" #import "base/logging.h" -#import "ios/chrome/browser/ui/reading_list/reading_list_menu_notifier.h" #include "ios/web/public/user_agent.h" @implementation ToolsMenuConfiguration {
diff --git a/ios/showcase/BUILD.gn b/ios/showcase/BUILD.gn index 307589671..c8832832 100644 --- a/ios/showcase/BUILD.gn +++ b/ios/showcase/BUILD.gn
@@ -27,6 +27,7 @@ deps = [ "//ios/clean/chrome/browser/ui/tools:tools_ui", "//ios/showcase/content_suggestions", + "//ios/showcase/ntp", "//ios/showcase/payments", "//ios/showcase/root", "//ios/showcase/settings",
diff --git a/ios/showcase/core/showcase_model.mm b/ios/showcase/core/showcase_model.mm index 83a4d18b..200d2ee 100644 --- a/ios/showcase/core/showcase_model.mm +++ b/ios/showcase/core/showcase_model.mm
@@ -27,6 +27,11 @@ showcase::kUseCaseKey : @"Tools menu", }, @{ + showcase::kClassForDisplayKey : @"NTPViewController", + showcase::kClassForInstantiationKey : @"SCNTPCoordinator", + showcase::kUseCaseKey : @"NTP", + }, + @{ showcase::kClassForDisplayKey : @"PaymentRequestEditViewController", showcase::kClassForInstantiationKey : @"SCPaymentsEditorCoordinator", showcase::kUseCaseKey : @"Generic payment request editor",
diff --git a/ios/showcase/ntp/BUILD.gn b/ios/showcase/ntp/BUILD.gn new file mode 100644 index 0000000..74ce733 --- /dev/null +++ b/ios/showcase/ntp/BUILD.gn
@@ -0,0 +1,18 @@ +# Copyright 2017 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. + +source_set("ntp") { + sources = [ + "sc_ntp_coordinator.h", + "sc_ntp_coordinator.mm", + ] + deps = [ + "//ios/chrome/browser/ui/ntp:ntp_internal", + "//ios/clean/chrome/browser/ui/commands", + "//ios/clean/chrome/browser/ui/ntp:ntp_ui", + "//ios/showcase/common", + ] + libs = [ "UIKit.framework" ] + configs += [ "//build/config/compiler:enable_arc" ] +}
diff --git a/ios/showcase/ntp/sc_ntp_coordinator.h b/ios/showcase/ntp/sc_ntp_coordinator.h new file mode 100644 index 0000000..14e76bfe --- /dev/null +++ b/ios/showcase/ntp/sc_ntp_coordinator.h
@@ -0,0 +1,15 @@ +// Copyright 2017 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 IOS_SHOWCASE_NTP_SC_NTP_COORDINATOR_H_ +#define IOS_SHOWCASE_NTP_SC_NTP_COORDINATOR_H_ + +#import <UIKit/UIKit.h> + +#import "ios/showcase/common/navigation_coordinator.h" + +@interface SCNTPCoordinator : NSObject<NavigationCoordinator> +@end + +#endif // IOS_SHOWCASE_NTP_SC_NTP_COORDINATOR_H_
diff --git a/ios/showcase/ntp/sc_ntp_coordinator.mm b/ios/showcase/ntp/sc_ntp_coordinator.mm new file mode 100644 index 0000000..98301fc6 --- /dev/null +++ b/ios/showcase/ntp/sc_ntp_coordinator.mm
@@ -0,0 +1,46 @@ +// Copyright 2017 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. + +#import "ios/showcase/ntp/sc_ntp_coordinator.h" + +#import "ios/chrome/browser/ui/ntp/new_tab_page_bar_item.h" +#import "ios/clean/chrome/browser/ui/commands/ntp_commands.h" +#import "ios/clean/chrome/browser/ui/ntp/ntp_view_controller.h" +#import "ios/showcase/common/protocol_alerter.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface SCNTPCoordinator () +@property(nonatomic, strong) ProtocolAlerter* alerter; +@end + +@implementation SCNTPCoordinator + +@synthesize baseViewController; +@synthesize alerter = _alerter; + +- (void)start { + NTPViewController* ntp = [[NTPViewController alloc] init]; + + self.alerter = + [[ProtocolAlerter alloc] initWithProtocols:@[ @protocol(NTPCommands) ]]; + self.alerter.baseViewController = self.baseViewController; + ntp.dispatcher = static_cast<id<NTPCommands>>(self.alerter); + + NewTabPageBarItem* item1 = [NewTabPageBarItem + newTabPageBarItemWithTitle:@"Item 1" + identifier:0 + image:[UIImage imageNamed:@"ntp_mv_search"]]; + NewTabPageBarItem* item2 = [NewTabPageBarItem + newTabPageBarItemWithTitle:@"Item 2" + identifier:0 + image:[UIImage imageNamed:@"ntp_bookmarks"]]; + [ntp setBarItems:@[ item1, item2 ]]; + + [self.baseViewController pushViewController:ntp animated:YES]; +} + +@end
diff --git a/ios/showcase/tab_grid/sc_tab_grid_coordinator.mm b/ios/showcase/tab_grid/sc_tab_grid_coordinator.mm index a512528..69d36cf8 100644 --- a/ios/showcase/tab_grid/sc_tab_grid_coordinator.mm +++ b/ios/showcase/tab_grid/sc_tab_grid_coordinator.mm
@@ -5,6 +5,7 @@ #import "ios/showcase/tab_grid/sc_tab_grid_coordinator.h" #import "base/format_macros.h" +#import "ios/clean/chrome/browser/ui/commands/settings_commands.h" #import "ios/clean/chrome/browser/ui/commands/tab_grid_commands.h" #import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_data_source.h" #import "ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.h"
diff --git a/ios/web/ios_web_resources.grd b/ios/web/ios_web_resources.grd index 935c870..b650fdcd 100644 --- a/ios/web/ios_web_resources.grd +++ b/ios/web/ios_web_resources.grd
@@ -17,6 +17,7 @@ <include name="IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS" file="webui/resources/sync_message_channel.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_IOS_SHELL_INTERFACE_PROVIDER_JS" file="webui/resources/interface_provider.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_BINDINGS_JS" file="../../mojo/public/js/bindings.js" flattenhtml="true" type="BINDATA" /> + <include name="IDR_MOJO_ASSOCIATED_BINDINGS_JS" file="../../mojo/public/js/associated_bindings.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_BUFFER_JS" file="../../mojo/public/js/buffer.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_CODEC_JS" file="../../mojo/public/js/codec.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MOJO_CONNECTOR_JS" file="../../mojo/public/js/connector.js" flattenhtml="true" type="BINDATA" />
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm index e3ec4c0..26cd09e7 100644 --- a/ios/web/webui/crw_web_ui_manager.mm +++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -212,6 +212,7 @@ // Look for built-in scripts first. std::map<std::string, int> resource_map{ + {mojo::kAssociatedBindingsModuleName, IDR_MOJO_ASSOCIATED_BINDINGS_JS}, {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS},
diff --git a/media/base/android/BUILD.gn b/media/base/android/BUILD.gn index 12bcbe1..2018c40 100644 --- a/media/base/android/BUILD.gn +++ b/media/base/android/BUILD.gn
@@ -123,10 +123,15 @@ ] } + android_resources("media_java_resources") { + custom_package = "org.chromium.media" + resource_dirs = [ "java/res" ] + } + android_library("media_java") { deps = [ + ":media_java_resources", "//base:base_java", - "//content/public/android:content_java_resources", "//third_party/android_tools:android_support_annotations_java", ] srcjar_deps = [
diff --git a/content/public/android/java/res/raw/empty.wav b/media/base/android/java/res/raw/empty.wav similarity index 100% rename from content/public/android/java/res/raw/empty.wav rename to media/base/android/java/res/raw/empty.wav Binary files differ
diff --git a/media/base/android/java/src/org/chromium/media/MediaServerCrashListener.java b/media/base/android/java/src/org/chromium/media/MediaServerCrashListener.java index 9245980a..42c77c808 100644 --- a/media/base/android/java/src/org/chromium/media/MediaServerCrashListener.java +++ b/media/base/android/java/src/org/chromium/media/MediaServerCrashListener.java
@@ -12,7 +12,6 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.MainDex; -import org.chromium.content.R; /** * Class for listening to Android MediaServer crashes to throttle media decoding
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc index b57cc19..845f18d 100644 --- a/media/renderers/video_renderer_impl_unittest.cc +++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -560,7 +560,7 @@ InitializeRenderer(&new_stream, false, true); } -// crbug.com/697171. +// crbug.com/711318. #if defined(MEMORY_SANITIZER) #define MAYBE_DestroyWhileInitializing DISABLED_DestroyWhileInitializing #else
diff --git a/mojo/common/string16.mojom b/mojo/common/string16.mojom index 173c8670..08c39e7 100644 --- a/mojo/common/string16.mojom +++ b/mojo/common/string16.mojom
@@ -6,7 +6,7 @@ // Corresponds to |base::string16| in base/strings/string16.h // Corresponds to |WTF::String| in -// third_party/WebKit/Source/wtf/text/WTFString.h. +// third_party/WebKit/Source/platform/wtf/text/WTFString.h. struct String16 { array<uint16> data; };
diff --git a/mojo/edk/js/tests/BUILD.gn b/mojo/edk/js/tests/BUILD.gn index f56c4b95..c58b252 100644 --- a/mojo/edk/js/tests/BUILD.gn +++ b/mojo/edk/js/tests/BUILD.gn
@@ -57,6 +57,7 @@ "//mojo/edk/test:run_all_unittests", "//mojo/edk/test:test_support", "//mojo/public/cpp/system", + "//mojo/public/interfaces/bindings/tests:test_associated_interfaces", "//mojo/public/interfaces/bindings/tests:test_interfaces", "//mojo/public/js:tests", ]
diff --git a/mojo/public/cpp/bindings/DEPS b/mojo/public/cpp/bindings/DEPS index 36eba44..f45f4e1 100644 --- a/mojo/public/cpp/bindings/DEPS +++ b/mojo/public/cpp/bindings/DEPS
@@ -1,3 +1,3 @@ include_rules = [ - "+third_party/WebKit/Source/wtf", + "+third_party/WebKit/Source/platform/wtf", ]
diff --git a/mojo/public/cpp/bindings/array_traits_wtf_vector.h b/mojo/public/cpp/bindings/array_traits_wtf_vector.h index 2aea2c4..d95cd2e 100644 --- a/mojo/public/cpp/bindings/array_traits_wtf_vector.h +++ b/mojo/public/cpp/bindings/array_traits_wtf_vector.h
@@ -6,7 +6,7 @@ #define MOJO_PUBLIC_CPP_BINDINGS_ARRAY_TRAITS_WTF_VECTOR_H_ #include "mojo/public/cpp/bindings/array_traits.h" -#include "third_party/WebKit/Source/wtf/Vector.h" +#include "third_party/WebKit/Source/platform/wtf/Vector.h" namespace mojo {
diff --git a/mojo/public/cpp/bindings/lib/string_traits_wtf.cc b/mojo/public/cpp/bindings/lib/string_traits_wtf.cc index 3bda50f..c128ecf 100644 --- a/mojo/public/cpp/bindings/lib/string_traits_wtf.cc +++ b/mojo/public/cpp/bindings/lib/string_traits_wtf.cc
@@ -8,7 +8,7 @@ #include "base/logging.h" #include "mojo/public/cpp/bindings/lib/array_internal.h" -#include "third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h" +#include "third_party/WebKit/Source/platform/wtf/text/StringUTF8Adaptor.h" namespace mojo { namespace {
diff --git a/mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h b/mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h index cb24bc4..07f969dd 100644 --- a/mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h +++ b/mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h
@@ -9,10 +9,10 @@ #include "mojo/public/cpp/bindings/clone_traits.h" #include "mojo/public/cpp/bindings/lib/equals_traits.h" -#include "third_party/WebKit/Source/wtf/HashMap.h" -#include "third_party/WebKit/Source/wtf/Optional.h" -#include "third_party/WebKit/Source/wtf/Vector.h" -#include "third_party/WebKit/Source/wtf/text/WTFString.h" +#include "third_party/WebKit/Source/platform/wtf/HashMap.h" +#include "third_party/WebKit/Source/platform/wtf/Optional.h" +#include "third_party/WebKit/Source/platform/wtf/Vector.h" +#include "third_party/WebKit/Source/platform/wtf/text/WTFString.h" namespace mojo {
diff --git a/mojo/public/cpp/bindings/lib/wtf_hash_util.h b/mojo/public/cpp/bindings/lib/wtf_hash_util.h index d4cd505..509b7cf 100644 --- a/mojo/public/cpp/bindings/lib/wtf_hash_util.h +++ b/mojo/public/cpp/bindings/lib/wtf_hash_util.h
@@ -9,9 +9,9 @@ #include "mojo/public/cpp/bindings/lib/hash_util.h" #include "mojo/public/cpp/bindings/struct_ptr.h" -#include "third_party/WebKit/Source/wtf/HashFunctions.h" -#include "third_party/WebKit/Source/wtf/text/StringHash.h" -#include "third_party/WebKit/Source/wtf/text/WTFString.h" +#include "third_party/WebKit/Source/platform/wtf/HashFunctions.h" +#include "third_party/WebKit/Source/platform/wtf/text/StringHash.h" +#include "third_party/WebKit/Source/platform/wtf/text/WTFString.h" namespace mojo { namespace internal {
diff --git a/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h b/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h index ef01466..1f0ccf0 100644 --- a/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h +++ b/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "mojo/public/cpp/bindings/map_traits.h" -#include "third_party/WebKit/Source/wtf/HashMap.h" +#include "third_party/WebKit/Source/platform/wtf/HashMap.h" namespace mojo {
diff --git a/mojo/public/cpp/bindings/string_traits_wtf.h b/mojo/public/cpp/bindings/string_traits_wtf.h index 8a9dc88..4f0de489 100644 --- a/mojo/public/cpp/bindings/string_traits_wtf.h +++ b/mojo/public/cpp/bindings/string_traits_wtf.h
@@ -7,7 +7,7 @@ #include "mojo/public/cpp/bindings/lib/bindings_internal.h" #include "mojo/public/cpp/bindings/string_traits.h" -#include "third_party/WebKit/Source/wtf/text/WTFString.h" +#include "third_party/WebKit/Source/platform/wtf/text/WTFString.h" namespace mojo {
diff --git a/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc b/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc index 04f14b5..9ee97c3 100644 --- a/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc +++ b/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc
@@ -7,7 +7,7 @@ #include "mojo/public/interfaces/bindings/tests/test_structs.mojom-blink.h" #include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/Source/wtf/HashFunctions.h" +#include "third_party/WebKit/Source/platform/wtf/HashFunctions.h" namespace mojo { namespace test {
diff --git a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc index 4c48195..b0ce918 100644 --- a/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc +++ b/mojo/public/cpp/bindings/tests/wtf_types_unittest.cc
@@ -14,7 +14,7 @@ #include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom-blink.h" #include "mojo/public/interfaces/bindings/tests/test_wtf_types.mojom.h" #include "testing/gtest/include/gtest/gtest.h" -#include "third_party/WebKit/Source/wtf/text/StringHash.h" +#include "third_party/WebKit/Source/platform/wtf/text/StringHash.h" namespace mojo { namespace test {
diff --git a/mojo/public/js/BUILD.gn b/mojo/public/js/BUILD.gn index 5ed57a13..3861163 100644 --- a/mojo/public/js/BUILD.gn +++ b/mojo/public/js/BUILD.gn
@@ -15,6 +15,7 @@ data = [ "$interfaces_bindings_gen_dir/interface_control_messages.mojom.js", "$interfaces_bindings_gen_dir/pipe_control_messages.mojom.js", + "associated_bindings.js", "bindings.js", "buffer.js", "codec.js",
diff --git a/mojo/public/js/associated_bindings.js b/mojo/public/js/associated_bindings.js new file mode 100644 index 0000000..fdfe3c2 --- /dev/null +++ b/mojo/public/js/associated_bindings.js
@@ -0,0 +1,17 @@ +// Copyright 2017 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. + +define("mojo/public/js/associated_bindings", [ + "mojo/public/js/core", + "mojo/public/js/interface_types", + "mojo/public/js/lib/interface_endpoint_client", + "mojo/public/js/lib/interface_endpoint_handle", +], function(core, types, interfaceEndpointClient, interfaceEndpointHandle) { + + var exports = {}; + exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo; + exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest; + + return exports; +});
diff --git a/mojo/public/js/codec.js b/mojo/public/js/codec.js index ce58a8cf..b78aac2 100644 --- a/mojo/public/js/codec.js +++ b/mojo/public/js/codec.js
@@ -5,13 +5,15 @@ define("mojo/public/js/codec", [ "mojo/public/js/buffer", "mojo/public/js/interface_types", + "mojo/public/js/lib/interface_endpoint_handle", "mojo/public/js/unicode", -], function(buffer, types, unicode) { +], function(buffer, types, interfaceEndpointHandle, unicode) { var kErrorUnsigned = "Passing negative value to unsigned"; var kErrorArray = "Passing non Array for array type"; var kErrorString = "Passing non String for string type"; var kErrorMap = "Passing non Map for map type"; + var InterfaceEndpointHandle = interfaceEndpointHandle.InterfaceEndpointHandle; // Memory ------------------------------------------------------------------- @@ -29,8 +31,9 @@ var kArrayHeaderSize = 8; var kStructHeaderSize = 8; - var kMessageHeaderSize = 24; - var kMessageWithRequestIDHeaderSize = 32; + var kMessageV0HeaderSize = 24; + var kMessageV1HeaderSize = 32; + var kMessageV2HeaderSize = 48; var kMapStructPayloadSize = 16; var kStructHeaderNumBytesOffset = 0; @@ -428,6 +431,7 @@ var kMessageNameOffset = kMessageInterfaceIdOffset + 4; var kMessageFlagsOffset = kMessageNameOffset + 4; var kMessageRequestIDOffset = kMessageFlagsOffset + 8; + var kMessagePayloadInterfaceIdsPointerOffset = kMessageV2HeaderSize - 8; var kMessageExpectsResponse = 1 << 0; var kMessageIsResponse = 1 << 1; @@ -457,6 +461,17 @@ return this.buffer.getUint32(kMessageInterfaceIdOffset); }; + Message.prototype.getPayloadInterfaceIds = function() { + if (this.getHeaderVersion() < 2) { + return null; + } + + var decoder = new Decoder(this.buffer, this.handles, + kMessagePayloadInterfaceIdsPointerOffset); + var payloadInterfaceIds = decoder.decodeArrayPointer(Uint32); + return payloadInterfaceIds; + }; + Message.prototype.isResponse = function() { return (this.getFlags() & kMessageIsResponse) != 0; }; @@ -480,11 +495,11 @@ function MessageBuilder(messageName, payloadSize) { // Currently, we don't compute the payload size correctly ahead of time. // Instead, we resize the buffer at the end. - var numberOfBytes = kMessageHeaderSize + payloadSize; + var numberOfBytes = kMessageV0HeaderSize + payloadSize; this.buffer = new buffer.Buffer(numberOfBytes); this.handles = []; - var encoder = this.createEncoder(kMessageHeaderSize); - encoder.writeUint32(kMessageHeaderSize); + var encoder = this.createEncoder(kMessageV0HeaderSize); + encoder.writeUint32(kMessageV0HeaderSize); encoder.writeUint32(0); // version. encoder.writeUint32(0); // interface ID. encoder.writeUint32(messageName); @@ -518,11 +533,11 @@ requestID) { // Currently, we don't compute the payload size correctly ahead of time. // Instead, we resize the buffer at the end. - var numberOfBytes = kMessageWithRequestIDHeaderSize + payloadSize; + var numberOfBytes = kMessageV1HeaderSize + payloadSize; this.buffer = new buffer.Buffer(numberOfBytes); this.handles = []; - var encoder = this.createEncoder(kMessageWithRequestIDHeaderSize); - encoder.writeUint32(kMessageWithRequestIDHeaderSize); + var encoder = this.createEncoder(kMessageV1HeaderSize); + encoder.writeUint32(kMessageV1HeaderSize); encoder.writeUint32(1); // version. encoder.writeUint32(0); // interface ID. encoder.writeUint32(messageName); @@ -838,6 +853,17 @@ NullableInterface.prototype = Object.create(Interface.prototype); + function AssociatedInterfacePtrInfo() { + } + + AssociatedInterfacePtrInfo.prototype.encodedSize = 8; + + function NullableAssociatedInterfacePtrInfo() { + } + + NullableAssociatedInterfacePtrInfo.encodedSize = + AssociatedInterfacePtrInfo.encodedSize; + function InterfaceRequest() { } @@ -860,6 +886,17 @@ NullableInterfaceRequest.encode = InterfaceRequest.encode; + function AssociatedInterfaceRequest() { + } + + AssociatedInterfaceRequest.encodedSize = 4; + + function NullableAssociatedInterfaceRequest() { + } + + NullableAssociatedInterfaceRequest.encodedSize = + AssociatedInterfaceRequest.encodedSize; + function MapOf(keyClass, valueClass) { this.keyClass = keyClass; this.valueClass = valueClass; @@ -892,8 +929,11 @@ exports.kMapStructPayloadSize = kMapStructPayloadSize; exports.kStructHeaderSize = kStructHeaderSize; exports.kEncodedInvalidHandleValue = kEncodedInvalidHandleValue; - exports.kMessageHeaderSize = kMessageHeaderSize; - exports.kMessageWithRequestIDHeaderSize = kMessageWithRequestIDHeaderSize; + exports.kMessageV0HeaderSize = kMessageV0HeaderSize; + exports.kMessageV1HeaderSize = kMessageV1HeaderSize; + exports.kMessageV2HeaderSize = kMessageV2HeaderSize; + exports.kMessagePayloadInterfaceIdsPointerOffset = + kMessagePayloadInterfaceIdsPointerOffset; exports.kMessageExpectsResponse = kMessageExpectsResponse; exports.kMessageIsResponse = kMessageIsResponse; exports.Int8 = Int8; @@ -920,6 +960,12 @@ exports.NullableInterface = NullableInterface; exports.InterfaceRequest = InterfaceRequest; exports.NullableInterfaceRequest = NullableInterfaceRequest; + exports.AssociatedInterfacePtrInfo = AssociatedInterfacePtrInfo; + exports.NullableAssociatedInterfacePtrInfo = + NullableAssociatedInterfacePtrInfo; + exports.AssociatedInterfaceRequest = AssociatedInterfaceRequest; + exports.NullableAssociatedInterfaceRequest = + NullableAssociatedInterfaceRequest; exports.MapOf = MapOf; exports.NullableMapOf = NullableMapOf; return exports;
diff --git a/mojo/public/js/constants.cc b/mojo/public/js/constants.cc index a0ce7d4..17cd0a9 100644 --- a/mojo/public/js/constants.cc +++ b/mojo/public/js/constants.cc
@@ -6,6 +6,8 @@ namespace mojo { +const char kAssociatedBindingsModuleName[] = + "mojo/public/js/associated_bindings"; const char kBindingsModuleName[] = "mojo/public/js/bindings"; const char kBufferModuleName[] = "mojo/public/js/buffer"; const char kCodecModuleName[] = "mojo/public/js/codec";
diff --git a/mojo/public/js/constants.h b/mojo/public/js/constants.h index f561d73..c82fe1d 100644 --- a/mojo/public/js/constants.h +++ b/mojo/public/js/constants.h
@@ -8,6 +8,7 @@ namespace mojo { // JavaScript module names: +extern const char kAssociatedBindingsModuleName[]; extern const char kBindingsModuleName[]; extern const char kBufferModuleName[]; extern const char kCodecModuleName[];
diff --git a/mojo/public/js/interface_types.js b/mojo/public/js/interface_types.js index e8ed37a..e3c0655 100644 --- a/mojo/public/js/interface_types.js +++ b/mojo/public/js/interface_types.js
@@ -31,6 +31,15 @@ this.version = 0; }; + function AssociatedInterfacePtrInfo(interfaceEndpointHandle, version) { + this.interfaceEndpointHandle = interfaceEndpointHandle; + this.version = version; + } + + AssociatedInterfacePtrInfo.prototype.isValid = function() { + return this.interfaceEndpointHandle.isValid(); + }; + // --------------------------------------------------------------------------- function InterfaceRequest(handle) { @@ -49,6 +58,14 @@ this.handle = null; }; + function AssociatedInterfaceRequest(interfaceEndpointHandle) { + this.interfaceEndpointHandle = interfaceEndpointHandle; + } + + AssociatedInterfaceRequest.prototype.isValid = function() { + return this.interfaceEndpointHandle.isValid(); + }; + function isMasterInterfaceId(interfaceId) { return interfaceId === kMasterInterfaceId; } @@ -60,6 +77,8 @@ var exports = {}; exports.InterfacePtrInfo = InterfacePtrInfo; exports.InterfaceRequest = InterfaceRequest; + exports.AssociatedInterfacePtrInfo = AssociatedInterfacePtrInfo; + exports.AssociatedInterfaceRequest = AssociatedInterfaceRequest; exports.isMasterInterfaceId = isMasterInterfaceId; exports.isValidInterfaceId = isValidInterfaceId; exports.kInvalidInterfaceId = kInvalidInterfaceId;
diff --git a/mojo/public/js/tests/validation_unittest.js b/mojo/public/js/tests/validation_unittest.js index 2a073154..abefe8e 100644 --- a/mojo/public/js/tests/validation_unittest.js +++ b/mojo/public/js/tests/validation_unittest.js
@@ -6,6 +6,7 @@ "console", "file", "gin/test/expect", + "mojo/public/interfaces/bindings/tests/validation_test_associated_interfaces.mojom", "mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom", "mojo/public/js/bindings", "mojo/public/js/buffer", @@ -16,6 +17,7 @@ ], function(console, file, expect, + testAssociatedInterface, testInterface, bindings, buffer, @@ -270,6 +272,12 @@ testInterface.BoundsCheckTestInterface.validateResponse]); } + function testAssociatedConformanceMessageValidation() { + testMessageValidation("associated_conformance_", [ + testAssociatedInterface.AssociatedConformanceTestInterface + .validateRequest]); + } + function testIntegratedMessageValidation(testFilesPattern, endpoint) { var testFiles = getMessageTestFiles(testFilesPattern); expect(testFiles.length).toBeGreaterThan(0); @@ -321,6 +329,7 @@ } expect(checkTestMessageParser()).toBeNull(); + testAssociatedConformanceMessageValidation(); testConformanceMessageValidation(); testBoundsCheckMessageValidation(); testResponseConformanceMessageValidation();
diff --git a/mojo/public/js/validator.js b/mojo/public/js/validator.js index 283546d4f..037f3f46 100644 --- a/mojo/public/js/validator.js +++ b/mojo/public/js/validator.js
@@ -4,7 +4,8 @@ define("mojo/public/js/validator", [ "mojo/public/js/codec", -], function(codec) { + "mojo/public/js/interface_types", +], function(codec, types) { var validationError = { NONE: 'VALIDATION_ERROR_NONE', @@ -16,6 +17,9 @@ UNEXPECTED_INVALID_HANDLE: 'VALIDATION_ERROR_UNEXPECTED_INVALID_HANDLE', ILLEGAL_POINTER: 'VALIDATION_ERROR_ILLEGAL_POINTER', UNEXPECTED_NULL_POINTER: 'VALIDATION_ERROR_UNEXPECTED_NULL_POINTER', + ILLEGAL_INTERFACE_ID: 'VALIDATION_ERROR_ILLEGAL_INTERFACE_ID', + UNEXPECTED_INVALID_INTERFACE_ID: + 'VALIDATION_ERROR_UNEXPECTED_INVALID_INTERFACE_ID', MESSAGE_HEADER_INVALID_FLAGS: 'VALIDATION_ERROR_MESSAGE_HEADER_INVALID_FLAGS', MESSAGE_HEADER_MISSING_REQUEST_ID: @@ -93,6 +97,16 @@ cls === codec.NullableInterfaceRequest; } + function isAssociatedInterfaceClass(cls) { + return cls === codec.AssociatedInterfacePtrInfo || + cls === codec.NullableAssociatedInterfacePtrInfo; + } + + function isAssociatedInterfaceRequestClass(cls) { + return cls === codec.AssociatedInterfaceRequest || + cls === codec.NullableAssociatedInterfaceRequest; + } + function isNullable(type) { return type === codec.NullableString || type === codec.NullableHandle || type === codec.NullableInterface || @@ -105,16 +119,21 @@ this.message = message; this.offset = 0; this.handleIndex = 0; + this.associatedEndpointHandleIndex = 0; + this.payloadInterfaceIds = null; + this.offsetLimit = this.message.buffer.byteLength; } - Object.defineProperty(Validator.prototype, "offsetLimit", { - get: function() { return this.message.buffer.byteLength; } - }); - Object.defineProperty(Validator.prototype, "handleIndexLimit", { get: function() { return this.message.handles.length; } }); + Object.defineProperty(Validator.prototype, "associatedHandleIndexLimit", { + get: function() { + return this.payloadInterfaceIds ? this.payloadInterfaceIds.length : 0; + } + }); + // True if we can safely allocate a block of bytes from start to // to start + numBytes. Validator.prototype.isValidRange = function(start, numBytes) { @@ -152,6 +171,21 @@ return true; }; + Validator.prototype.claimAssociatedEndpointHandle = function(index) { + if (index === codec.kEncodedInvalidHandleValue) { + return true; + } + + if (index < this.associatedEndpointHandleIndex || + index >= this.associatedHandleIndexLimit) { + return false; + } + + // This is safe because handle indices are uint32. + this.associatedEndpointHandleIndex = index + 1; + return true; + }; + Validator.prototype.validateEnum = function(offset, enumClass) { // Note: Assumes that enums are always 32 bits! But this matches // mojom::generate::pack::PackedField::GetSizeForKind, so it should be okay. @@ -172,6 +206,22 @@ return validationError.NONE; }; + Validator.prototype.validateAssociatedEndpointHandle = function(offset, + nullable) { + var index = this.message.buffer.getUint32(offset); + + if (index === codec.kEncodedInvalidHandleValue) { + return nullable ? validationError.NONE : + validationError.UNEXPECTED_INVALID_INTERFACE_ID; + } + + if (!this.claimAssociatedEndpointHandle(index)) { + return validationError.ILLEGAL_INTERFACE_ID; + } + + return validationError.NONE; + }; + Validator.prototype.validateInterface = function(offset, nullable) { return this.validateHandle(offset, nullable); }; @@ -180,6 +230,16 @@ return this.validateHandle(offset, nullable); }; + Validator.prototype.validateAssociatedInterface = function(offset, + nullable) { + return this.validateAssociatedEndpointHandle(offset, nullable); + }; + + Validator.prototype.validateAssociatedInterfaceRequest = function( + offset, nullable) { + return this.validateAssociatedEndpointHandle(offset, nullable); + }; + Validator.prototype.validateStructHeader = function(offset, minNumBytes) { if (!codec.isAligned(offset)) return validationError.MISALIGNED_OBJECT; @@ -223,33 +283,64 @@ return fieldVersion <= structVersion; }; - // TODO(wangjimmy): Add support for v2 messages. Validator.prototype.validateMessageHeader = function() { - - var err = this.validateStructHeader(0, codec.kMessageHeaderSize); - if (err != validationError.NONE) + var err = this.validateStructHeader(0, codec.kMessageV0HeaderSize); + if (err != validationError.NONE) { return err; + } var numBytes = this.message.getHeaderNumBytes(); var version = this.message.getHeaderVersion(); var validVersionAndNumBytes = - (version == 0 && numBytes == codec.kMessageHeaderSize) || - (version == 1 && - numBytes == codec.kMessageWithRequestIDHeaderSize) || - (version > 1 && - numBytes >= codec.kMessageWithRequestIDHeaderSize); - if (!validVersionAndNumBytes) + (version == 0 && numBytes == codec.kMessageV0HeaderSize) || + (version == 1 && numBytes == codec.kMessageV1HeaderSize) || + (version == 2 && numBytes == codec.kMessageV2HeaderSize) || + (version > 2 && numBytes >= codec.kMessageV2HeaderSize); + + if (!validVersionAndNumBytes) { return validationError.UNEXPECTED_STRUCT_HEADER; + } var expectsResponse = this.message.expectsResponse(); var isResponse = this.message.isResponse(); - if (version == 0 && (expectsResponse || isResponse)) + if (version == 0 && (expectsResponse || isResponse)) { return validationError.MESSAGE_HEADER_MISSING_REQUEST_ID; + } - if (isResponse && expectsResponse) + if (isResponse && expectsResponse) { return validationError.MESSAGE_HEADER_INVALID_FLAGS; + } + + if (version < 2) { + return validationError.NONE; + } + + var err = this.validateArrayPointer( + codec.kMessagePayloadInterfaceIdsPointerOffset, + codec.Uint32.encodedSize, codec.Uint32, true, [0], 0); + + if (err != validationError.NONE) { + return err; + } + + this.payloadInterfaceIds = this.message.getPayloadInterfaceIds(); + if (this.payloadInterfaceIds) { + for (var interfaceId of this.payloadInterfaceIds) { + if (!types.isValidInterfaceId(interfaceId) || + types.isMasterInterfaceId(interfaceId)) { + return validationError.ILLEGAL_INTERFACE_ID; + } + } + } + + // Set offset to the start of the payload and offsetLimit to the start of + // the payload interface Ids so that payload can be validated using the + // same messageValidator. + this.offset = this.message.getHeaderNumBytes(); + this.offsetLimit = this.decodePointer( + codec.kMessagePayloadInterfaceIdsPointerOffset); return validationError.NONE; }; @@ -451,6 +542,12 @@ if (isInterfaceRequestClass(elementType)) return this.validateInterfaceRequestElements( elementsOffset, numElements, nullable); + if (isAssociatedInterfaceClass(elementType)) + return this.validateAssociatedInterfaceElements( + elementsOffset, numElements, nullable); + if (isAssociatedInterfaceRequestClass(elementType)) + return this.validateAssociatedInterfaceRequestElements( + elementsOffset, numElements, nullable); if (isStringClass(elementType)) return this.validateArrayElements( elementsOffset, numElements, codec.Uint8, nullable, [0], 0); @@ -508,6 +605,33 @@ return validationError.NONE; }; + Validator.prototype.validateAssociatedInterfaceElements = + function(offset, numElements, nullable) { + var elementSize = codec.AssociatedInterfacePtrInfo.prototype.encodedSize; + for (var i = 0; i < numElements; i++) { + var elementOffset = offset + i * elementSize; + var err = this.validateAssociatedInterface(elementOffset, nullable); + if (err != validationError.NONE) { + return err; + } + } + return validationError.NONE; + }; + + Validator.prototype.validateAssociatedInterfaceRequestElements = + function(offset, numElements, nullable) { + var elementSize = codec.AssociatedInterfaceRequest.encodedSize; + for (var i = 0; i < numElements; i++) { + var elementOffset = offset + i * elementSize; + var err = this.validateAssociatedInterfaceRequest(elementOffset, + nullable); + if (err != validationError.NONE) { + return err; + } + } + return validationError.NONE; + }; + // The elementClass parameter is the element type of the element arrays. Validator.prototype.validateArrayElements = function(offset, numElements, elementClass, nullable,
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl index 0ef6b25..9cb28d4e 100644 --- a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl +++ b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
@@ -73,9 +73,9 @@ {# hash_util.h includes template specializations that should be present for every use of {Inlined}StructPtr. #} #include "mojo/public/cpp/bindings/lib/wtf_hash_util.h" -#include "third_party/WebKit/Source/wtf/HashFunctions.h" -#include "third_party/WebKit/Source/wtf/Optional.h" -#include "third_party/WebKit/Source/wtf/text/WTFString.h" +#include "third_party/WebKit/Source/platform/wtf/HashFunctions.h" +#include "third_party/WebKit/Source/platform/wtf/Optional.h" +#include "third_party/WebKit/Source/platform/wtf/text/WTFString.h" {%- endif %} {%- for header in extra_public_headers %}
diff --git a/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl b/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl index 3637b196..1fe27f72 100644 --- a/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl +++ b/mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl
@@ -42,6 +42,7 @@ "mojo/public/interfaces/bindings/interface_control_messages.mojom" and module.path != "mojo/public/interfaces/bindings/pipe_control_messages.mojom" %} + "mojo/public/js/associated_bindings", "mojo/public/js/bindings", {%- endif %} "mojo/public/js/codec", @@ -55,7 +56,7 @@ "mojo/public/interfaces/bindings/interface_control_messages.mojom" and module.path != "mojo/public/interfaces/bindings/pipe_control_messages.mojom" -%} -bindings, {% endif -%} +associatedBindings, bindings, {% endif -%} codec, core, validator {%- for import in imports -%} , {{import.unique_name}}
diff --git a/mojo/public/tools/bindings/generators/js_templates/validation_macros.tmpl b/mojo/public/tools/bindings/generators/js_templates/validation_macros.tmpl index d4e15a7..c9821d0 100644 --- a/mojo/public/tools/bindings/generators/js_templates/validation_macros.tmpl +++ b/mojo/public/tools/bindings/generators/js_templates/validation_macros.tmpl
@@ -28,6 +28,14 @@ // validate {{name}} err = messageValidator.validateInterfaceRequest({{offset}}, {{field|validate_nullable_params}}) {{_check_err()}} +{%- elif field|is_associated_interface_field %} +// validate {{name}} +err = messageValidator.validateAssociatedInterface({{offset}}, {{field|validate_nullable_params}}); +{{_check_err()}} +{%- elif field|is_associated_interface_request_field %} +// validate {{name}} +err = messageValidator.validateAssociatedInterfaceRequest({{offset}}, {{field|validate_nullable_params}}) +{{_check_err()}} {%- elif field|is_handle_field %} // validate {{name}} err = messageValidator.validateHandle({{offset}}, {{field|validate_nullable_params}})
diff --git a/mojo/public/tools/bindings/generators/mojom_js_generator.py b/mojo/public/tools/bindings/generators/mojom_js_generator.py index ab9635e..a42bd59 100644 --- a/mojo/public/tools/bindings/generators/mojom_js_generator.py +++ b/mojo/public/tools/bindings/generators/mojom_js_generator.py
@@ -67,8 +67,10 @@ return "new %sPtr()" % JavaScriptType(field.kind) if mojom.IsInterfaceRequestKind(field.kind): return "new bindings.InterfaceRequest()" - if mojom.IsAssociatedKind(field.kind): - return "null" + if mojom.IsAssociatedInterfaceKind(field.kind): + return "new associatedBindings.AssociatedInterfacePtrInfo()" + if mojom.IsAssociatedInterfaceRequestKind(field.kind): + return "new associatedBindings.AssociatedInterfaceRequest()" if mojom.IsEnumKind(field.kind): return "0" raise Exception("No valid default: %s" % field) @@ -134,9 +136,13 @@ "NullableInterfaceRequest" if mojom.IsNullableKind(kind) else "InterfaceRequest") if mojom.IsAssociatedInterfaceKind(kind): - return "codec.AssociatedInterfaceNotSupported" + return "codec.%s" % ( + "NullableAssociatedInterfacePtrInfo" if mojom.IsNullableKind(kind) + else "AssociatedInterfacePtrInfo") if mojom.IsAssociatedInterfaceRequestKind(kind): - return "codec.AssociatedInterfaceRequestNotSupported" + return "codec.%s" % ( + "NullableAssociatedInterfaceRequest" if mojom.IsNullableKind(kind) + else "AssociatedInterfaceRequest") if mojom.IsEnumKind(kind): return "new codec.Enum(%s)" % JavaScriptType(kind) if mojom.IsMapKind(kind): @@ -310,6 +316,12 @@ def IsInterfaceRequestField(field): return mojom.IsInterfaceRequestKind(field.kind) +def IsAssociatedInterfaceField(field): + return mojom.IsAssociatedInterfaceKind(field.kind) + +def IsAssociatedInterfaceRequestField(field): + return mojom.IsAssociatedInterfaceRequestKind(field.kind) + def IsUnionField(field): return mojom.IsUnionKind(field.kind) @@ -340,6 +352,8 @@ "has_callbacks": mojom.HasCallbacks, "is_any_handle_or_interface_field": IsAnyHandleOrInterfaceField, "is_array_pointer_field": IsArrayPointerField, + "is_associated_interface_field": IsAssociatedInterfaceField, + "is_associated_interface_request_field": IsAssociatedInterfaceRequestField, "is_bool_field": IsBoolField, "is_enum_field": IsEnumField, "is_handle_field": IsHandleField,
diff --git a/net/log/net_log_event_type_list.h b/net/log/net_log_event_type_list.h index 53c84f4..b3325d74 100644 --- a/net/log/net_log_event_type_list.h +++ b/net/log/net_log_event_type_list.h
@@ -2232,6 +2232,9 @@ // } EVENT_TYPE(SERVICE_WORKER_SCRIPT_LOAD_UNHANDLED_REQUEST_ERROR) +// This event is emitted when a navigation preload request is created. +EVENT_TYPE(SERVICE_WORKER_NAVIGATION_PRELOAD_REQUEST) + // ------------------------------------------------------------------------ // Global events // ------------------------------------------------------------------------
diff --git a/styleguide/c++/c++.md b/styleguide/c++/c++.md index e7af38be..c7bb491 100644 --- a/styleguide/c++/c++.md +++ b/styleguide/c++/c++.md
@@ -30,12 +30,6 @@ * "Chromium" is the name of the project, not the product, and should never appear in code, variable names, API names etc. Use "Chrome" instead. - * Though the Google C++ Style Guide now says to use `kConstantNaming` for - enums, Chromium was written using `MACRO_STYLE` naming. In enums that are - actually enumerations (i.e. have multiple values), continue to use this - style for consistency. Use `kConstantNaming` when using the "enum hack" to - define a single constant, as you would for a const int or the like. - * Functions used only for testing should be restricted to test-only scenarios either by `#ifdefing` them appropriately (e.g. `#if defined(UNIT_TEST)`) or by naming them with a `ForTesting` suffix. The latter will be checked at
diff --git a/testing/android/OWNERS b/testing/android/OWNERS index f1cabca..f244d03 100644 --- a/testing/android/OWNERS +++ b/testing/android/OWNERS
@@ -1,6 +1,7 @@ dtrainor@chromium.org jbudorick@chromium.org miguelg@chromium.org +mikecase@chromium.org nyquist@chromium.org skyostil@chromium.org tedchoc@chromium.org
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java b/testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java index 09cec07..49aaa62 100644 --- a/testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java +++ b/testing/android/junit/java/src/org/chromium/testing/local/GNManifestFactory.java
@@ -8,33 +8,62 @@ import org.robolectric.internal.ManifestFactory; import org.robolectric.internal.ManifestIdentifier; import org.robolectric.manifest.AndroidManifest; +import org.robolectric.res.Fs; +import org.robolectric.res.FsFile; +import org.robolectric.res.ResourcePath; -// TODO(mikecase): Add support for specifying the AndroidManifest for -// Robolectric tests. +import java.util.ArrayList; +import java.util.List; /** * Class that manages passing Android manifest information to Robolectric. */ public class GNManifestFactory implements ManifestFactory { - private static final String DEFAULT_PACKAGE_NAME = "org.robolectric.default"; + private static final String CHROMIUM_MANIFEST_PATH = "chromium.robolectric.manifest"; + private static final String CHROMIUM_RES_DIRECTORIES = "chromium.robolectric.resource.dirs"; @Override public ManifestIdentifier identify(Config config) { - if (!config.manifest().equals(Config.NONE)) { - throw new RuntimeException("Specifying custom manifest not currently supported. " - + "Please use annotation @Config(manifest = Config.NONE) on Robolectric tests " - + "for the time being."); + if (config.resourceDir() != null + && !config.resourceDir().equals(Config.DEFAULT_RES_FOLDER)) { + throw new RuntimeException("Resource dirs should be generated automatically by GN. " + + "Make sure you specify the correct app package_name in the GN build file. " + + "Make sure you run the tests using the generated run_<test name> scripts."); } + + if (config.manifest() != null && !config.manifest().equals(Config.NONE)) { + throw new RuntimeException("Specify manifest path in GN build file."); + } + return new ManifestIdentifier(null, null, null, config.packageName(), null); } @Override public AndroidManifest create(ManifestIdentifier manifestIdentifier) { - String packageName = manifestIdentifier.getPackageName(); - if (packageName == null || packageName.equals("")) { - packageName = DEFAULT_PACKAGE_NAME; + String manifestPath = System.getProperty(CHROMIUM_MANIFEST_PATH); + String resourceDirs = System.getProperty(CHROMIUM_RES_DIRECTORIES); + + final List<FsFile> resourceDirsList = new ArrayList<FsFile>(); + if (resourceDirs != null) { + for (String resourceDir : resourceDirs.split(":")) { + resourceDirsList.add(Fs.fileFromPath(resourceDir)); + } } - return new AndroidManifest(null, null, null, packageName); + FsFile manifestFile = null; + if (manifestPath != null) { + manifestFile = Fs.fileFromPath(manifestPath); + } + + return new AndroidManifest(manifestFile, null, null, manifestIdentifier.getPackageName()) { + @Override + public List<ResourcePath> getIncludedResourcePaths() { + List<ResourcePath> paths = super.getIncludedResourcePaths(); + for (FsFile resourceDir : resourceDirsList) { + paths.add(new ResourcePath(getRClass(), resourceDir, getAssetsDirectory())); + } + return paths; + } + }; } }
diff --git a/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java b/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java index ae72114..7b2e28e9 100644 --- a/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java +++ b/testing/android/junit/java/src/org/chromium/testing/local/LocalRobolectricTestRunner.java
@@ -14,6 +14,7 @@ */ public class LocalRobolectricTestRunner extends RobolectricTestRunner { private static final int DEFAULT_SDK = 25; + private static final String DEFAULT_PACKAGE_NAME = "org.robolectric.default"; public LocalRobolectricTestRunner(Class<?> testClass) throws InitializationError { super(testClass); @@ -21,7 +22,10 @@ @Override protected Config buildGlobalConfig() { - return new Config.Builder().setSdk(DEFAULT_SDK).build(); + String packageName = + System.getProperty("chromium.robolectric.package.name", DEFAULT_PACKAGE_NAME); + + return new Config.Builder().setSdk(DEFAULT_SDK).setPackageName(packageName).build(); } @Override
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 1972fb6..b000d037 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -2645,6 +2645,9 @@ crbug.com/685951 css2.1/t040304-c64-uri-00-a-g.html [ Failure Pass ] +# Rebaseline after https://skia-review.googlesource.com/c/11400/ rolls into Chromium. +crbug.com/706792 [ Win ] fast/text/ellipsis-platform-font-change.html [ NeedsManualRebaseline ] + # Importing 'fetch' tests from WPT. crbug.com/705490 external/wpt/fetch/api/basic/error-after-response.html [ Timeout Pass ]
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvasWebGL-texImage2D.html b/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvasWebGL-texImage2D.html new file mode 100644 index 0000000..89bcd16 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/cross-origin-OffscreenCanvasWebGL-texImage2D.html
@@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + +function startTest(imageSourceElement, imageSourceType) { + var offscreenCanvas = new OffscreenCanvas(10, 10); + var gl = offscreenCanvas.getContext("webgl"); + var texture = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, texture); + + assert_throws("SecurityError", function() { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imageSourceElement); + }, "cross-origin " + imageSourceType + " should be tainted"); +} + +var t = async_test("cross-origin image/canvas passed to Offscreen webgl texImage2D should be thrown"); +var image = document.createElement('img'); +image.addEventListener("load", function() { + t.step(function() { + startTest(image, "image"); + }); + + var canvas = document.createElement("canvas"); + canvas.width = 10; + canvas.height = 10; + var context = canvas.getContext("2d"); + // taint the canvas + context.drawImage(image, 0, 0, 10, 10); + t.step(function() { + startTest(canvas, "canvas"); + t.done(); + }); + +}); +image.src = 'http://localhost:8080/security/resources/abe.png'; + +var t2 = async_test("cross-origin video passed to Offscreen webgl texImage2D should be thrown"); +var video = document.createElement('video'); +video.src = 'http://localhost:8080/media/resources/load-video.php?name=test.ogv&type=video/ogv'; +document.body.appendChild(video); +video.addEventListener("playing", function() { + t2.step(function() { + startTest(video, "video"); + t2.done(); + }); +}); +video.play(); + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/mojo/struct.html b/third_party/WebKit/LayoutTests/mojo/struct.html index 62804123..0e9c53ba 100644 --- a/third_party/WebKit/LayoutTests/mojo/struct.html +++ b/third_party/WebKit/LayoutTests/mojo/struct.html
@@ -105,7 +105,7 @@ var message = builder.finish(); var messageValidator = new validator.Validator(message); - var err = structClass.validate(messageValidator, codec.kMessageHeaderSize); + var err = structClass.validate(messageValidator, codec.kMessageV0HeaderSize); assert_equals(err, validator.validationError.NONE); var reader = new codec.MessageReader(message);
diff --git a/third_party/WebKit/LayoutTests/mojo/union.html b/third_party/WebKit/LayoutTests/mojo/union.html index d519c5e..96f2b7e 100644 --- a/third_party/WebKit/LayoutTests/mojo/union.html +++ b/third_party/WebKit/LayoutTests/mojo/union.html
@@ -53,7 +53,7 @@ var message = builder.finish(); var messageValidator = new validator.Validator(message); - var err = structClass.validate(messageValidator, codec.kMessageHeaderSize); + var err = structClass.validate(messageValidator, codec.kMessageV0HeaderSize); assert_equals(err, validator.validationError.NONE); var reader = new codec.MessageReader(message); @@ -152,7 +152,7 @@ var message = builder.finish(); var messageValidator = new validator.Validator(message); - return structClass.validate(messageValidator, codec.kMessageHeaderSize); + return structClass.validate(messageValidator, codec.kMessageV0HeaderSize); } test(() => {
diff --git a/third_party/WebKit/LayoutTests/vibration/vibration-expected.txt b/third_party/WebKit/LayoutTests/vibration/vibration-expected.txt index 264e4f2..e258033 100644 --- a/third_party/WebKit/LayoutTests/vibration/vibration-expected.txt +++ b/third_party/WebKit/LayoutTests/vibration/vibration-expected.txt
@@ -1,4 +1,4 @@ -CONSOLE ERROR: line 300: Uncaught TypeError: Cannot read property 'then' of undefined +CONSOLE ERROR: line 301: Uncaught TypeError: Cannot read property 'then' of undefined This is a testharness.js-based test. Harness Error. harness_status.status = 1 , harness_status.message = Uncaught TypeError: Cannot read property 'then' of undefined PASS VibrationManager Mojo bindings and mock interfaces are available to tests.
diff --git a/third_party/WebKit/LayoutTests/vibration/vibration-iframe-expected.txt b/third_party/WebKit/LayoutTests/vibration/vibration-iframe-expected.txt index 0a0865e..154b228 100644 --- a/third_party/WebKit/LayoutTests/vibration/vibration-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/vibration/vibration-iframe-expected.txt
@@ -1,5 +1,5 @@ -CONSOLE ERROR: line 300: Uncaught TypeError: Cannot read property 'then' of undefined -CONSOLE ERROR: line 300: Uncaught TypeError: Cannot read property 'then' of undefined +CONSOLE ERROR: line 301: Uncaught TypeError: Cannot read property 'then' of undefined +CONSOLE ERROR: line 301: Uncaught TypeError: Cannot read property 'then' of undefined This is a testharness.js-based test. Harness Error. harness_status.status = 1 , harness_status.message = Uncaught TypeError: Cannot read property 'then' of undefined PASS Iframe reload cancels vibration started by it before.
diff --git a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt index 82728fbe..6a45098 100644 --- a/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/sharedarraybuffer/webaudio/dom-exceptions-expected.txt
@@ -1,8 +1,8 @@ -CONSOLE WARNING: line 341: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 347: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. -CONSOLE WARNING: line 502: The provided value '9x' is not a valid enum value of type OverSampleType. -CONSOLE WARNING: line 717: The provided value 'junk' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 746: The provided value 'junk' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 327: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 333: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. +CONSOLE WARNING: line 488: The provided value '9x' is not a valid enum value of type OverSampleType. +CONSOLE WARNING: line 703: The provided value 'junk' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 732: The provided value 'junk' is not a valid enum value of type ChannelCountMode. This is a testharness.js-based test. PASS # AUDIT TASK RUNNER STARTED. PASS > [initialize] Initialize contexts for testing @@ -44,15 +44,13 @@ PASS context.createChannelMerger(99) threw IndexSizeError: "Failed to execute 'createChannelMerger' on 'BaseAudioContext': The number of inputs provided (99) is outside the range [1, 32].". PASS < [createChannelMerger] All assertions passed. (total 1 assertions) PASS > [createPeriodicWave] -PASS context.createPeriodicWave(null, null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': parameter 1 is not of type 'Float32Array'.". -PASS context.createPeriodicWave(new Float32Array(10), null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': parameter 2 is not of type 'Float32Array'.". +PASS context.createPeriodicWave(null, null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The 1st argument is neither an array, nor does it have indexed properties.". +PASS context.createPeriodicWave(new Float32Array(10), null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The 2nd argument is neither an array, nor does it have indexed properties.". PASS context.createPeriodicWave(new Float32Array(4100), new Float32Array(4100)) did not throw an exception. PASS context.createPeriodicWave(new Float32Array(8192), new Float32Array(8192)) did not throw an exception. PASS context.createPeriodicWave(new Float32Array(10000), new Float32Array(10000)) did not throw an exception. PASS context.createPeriodicWave(new Float32Array(10), new Float32Array(7)) threw IndexSizeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': length of real array (10) and length of imaginary array (7) must match.". -PASS context.createPeriodicWave(shared_view, nonshared_view) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The provided ArrayBufferView value must not be shared.". -PASS context.createPeriodicWave(nonshared_view, shared_view) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The provided ArrayBufferView value must not be shared.". -PASS < [createPeriodicWave] All assertions passed. (total 8 assertions) +PASS < [createPeriodicWave] All assertions passed. (total 6 assertions) PASS > [createAnalyser] PASS AnalyserNode.fftSize = 42 threw IndexSizeError: "Failed to set the 'fftSize' property on 'AnalyserNode': The value provided (42) is not a power of two.". PASS AnalyserNode.fftSize is not equal to 42.
diff --git a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-exceptions.html b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-exceptions.html new file mode 100644 index 0000000..74415d4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-exceptions.html
@@ -0,0 +1,46 @@ +<!doctype html> +<html> + <head> + <title>Test PeriodicWave exceptions</title> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> + <script src="../resources/audit-util.js"></script> + <script src="../resources/audit.js"></script> + </head> + + <body> + <script> + let audit = Audit.createTaskRunner(); + + audit.define( + { + label: 'non-finite values', + description: 'Constructor should throw for non-finite coefficients' + }, + (task, should) => { + // Arbitrary context for testing. + let context = new OfflineAudioContext(1, 1, 44100); + + should( + () => context.createPeriodicWave([1, Infinity], [1, 1]), + 'createPeriodicWave([1, Infinity], [1,1])') + .throw('TypeError'); + should( + () => context.createPeriodicWave([1, NaN], [1, 1]), + 'createPeriodicWave([1, NaN], [1,1])') + .throw('TypeError'); + should( + () => context.createPeriodicWave([1, 1], [1, Infinity]), + 'createPeriodicWave([1, 1], [1, Infinity])') + .throw('TypeError'); + should( + () => context.createPeriodicWave([1, 1], [1, NaN]), + 'createPeriodicWave([1, 1], [1, NaN])') + .throw('TypeError'); + task.done(); + }); + + audit.run(); + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html index e097a1ff..c200df08 100644 --- a/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html +++ b/third_party/WebKit/LayoutTests/webaudio/PeriodicWave/periodicwave-lengths.html
@@ -47,15 +47,12 @@ verifier: resultShouldBeNonZero }, - // Test that we use all 8192 Fourier coefficients at 192 kHz sample rate. Ideally, we'd - // like to compare 8191 coefficients vs 8192 coefficients. However, due to single-precision - // arithmetic, the wave forms are identical in this case. Thus, use a somewhat smaller - // value where the wave forms are actually different. + // Test that we use all 8192 Fourier coefficients at 192 kHz sample rate. { name: "192khz-test-3", sampleRate: 192000, bigWave: 8192, - smallWave: (8 - 1 / 256) * 1024, + smallWave: 8191, verifier: resultShouldBeNonZero }, @@ -185,9 +182,12 @@ var bigWaveRealCoef = new Float32Array(bigPeriodicWaveLength); var bigWaveImagCoef = new Float32Array(bigPeriodicWaveLength); - // Set up the Fourier coefficients for a square wave. - for (var k = 0; k < bigPeriodicWaveLength; k += 2) { - bigWaveImagCoef[k] = 4 / Math.PI / k; + // Set up the Fourier coefficients for a sawtooth wave. We use + // sawtooth because all coefficients are non-zero + bigWaveImagCoef[0] = 0; + for (var k = 1; k < bigPeriodicWaveLength; k++) { + var piFactor = 2 / (Math.PI * k); + bigWaveImagCoef[k] = piFactor * ((k % 2 === 0) ? -1 : 1); if (k < smallPeriodicWaveLength) smallWaveImagCoef[k] = bigWaveImagCoef[k]; }
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/oscillator.html b/third_party/WebKit/LayoutTests/webaudio/constructor/oscillator.html index a7b8332..7d91505 100644 --- a/third_party/WebKit/LayoutTests/webaudio/constructor/oscillator.html +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/oscillator.html
@@ -117,11 +117,12 @@ real: [1, 1] }) }; - success = Should("new OscillatorNode(c, " + JSON.stringify(options) + ")", + success = Should("node2 = new OscillatorNode(c, " + JSON.stringify(options) + ")", function () { node = new OscillatorNode(context, options); }) - .throw("InvalidStateError") && success; + .notThrow() && success; + Should("node2.type", node.type).beEqualTo("custom"); options = { type: "custom"
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt index 34e9429b..7b3b66e 100644 --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
@@ -1,8 +1,8 @@ -CONSOLE WARNING: line 341: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 347: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. -CONSOLE WARNING: line 502: The provided value '9x' is not a valid enum value of type OverSampleType. -CONSOLE WARNING: line 717: The provided value 'junk' is not a valid enum value of type ChannelCountMode. -CONSOLE WARNING: line 746: The provided value 'junk' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 327: The provided value 'fancy' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 333: The provided value 'undefined' is not a valid enum value of type ChannelInterpretation. +CONSOLE WARNING: line 488: The provided value '9x' is not a valid enum value of type OverSampleType. +CONSOLE WARNING: line 703: The provided value 'junk' is not a valid enum value of type ChannelCountMode. +CONSOLE WARNING: line 732: The provided value 'junk' is not a valid enum value of type ChannelCountMode. This is a testharness.js-based test. PASS # AUDIT TASK RUNNER STARTED. PASS > [initialize] Initialize contexts for testing @@ -44,8 +44,8 @@ PASS context.createChannelMerger(99) threw IndexSizeError: "Failed to execute 'createChannelMerger' on 'BaseAudioContext': The number of inputs provided (99) is outside the range [1, 32].". PASS < [createChannelMerger] All assertions passed. (total 1 assertions) PASS > [createPeriodicWave] -PASS context.createPeriodicWave(null, null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': parameter 1 is not of type 'Float32Array'.". -PASS context.createPeriodicWave(new Float32Array(10), null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': parameter 2 is not of type 'Float32Array'.". +PASS context.createPeriodicWave(null, null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The 1st argument is neither an array, nor does it have indexed properties.". +PASS context.createPeriodicWave(new Float32Array(10), null) threw TypeError: "Failed to execute 'createPeriodicWave' on 'BaseAudioContext': The 2nd argument is neither an array, nor does it have indexed properties.". PASS context.createPeriodicWave(new Float32Array(4100), new Float32Array(4100)) did not throw an exception. PASS context.createPeriodicWave(new Float32Array(8192), new Float32Array(8192)) did not throw an exception. PASS context.createPeriodicWave(new Float32Array(10000), new Float32Array(10000)) did not throw an exception.
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html index 72a36d1f..4bcefa9 100644 --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html
@@ -197,20 +197,6 @@ 'context.createPeriodicWave(new Float32Array(10), new Float32Array(7))') .throw('IndexSizeError'); - if (window.SharedArrayBuffer) { - let shared_view = new Float32Array(new SharedArrayBuffer(4100 * 4)); - let nonshared_view = new Float32Array(4100); - should( - () => context.createPeriodicWave(shared_view, nonshared_view), - 'context.createPeriodicWave(shared_view, nonshared_view)') - .throw('TypeError'); - - should( - () => context.createPeriodicWave(nonshared_view, shared_view), - 'context.createPeriodicWave(nonshared_view, shared_view)') - .throw('TypeError'); - } - task.done(); });
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderLoaderClient.h b/third_party/WebKit/Source/core/fileapi/FileReaderLoaderClient.h index 835bae64..b587621 100644 --- a/third_party/WebKit/Source/core/fileapi/FileReaderLoaderClient.h +++ b/third_party/WebKit/Source/core/fileapi/FileReaderLoaderClient.h
@@ -33,6 +33,7 @@ #include "core/CoreExport.h" #include "core/fileapi/FileError.h" +#include "platform/wtf/Assertions.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp index a8fde46..b1e2366 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.cpp +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -210,10 +210,7 @@ needs_scrollbars_update_(false), suppress_adjust_view_size_(false), allows_layout_invalidation_after_layout_clean_(true), - main_thread_scrolling_reasons_(0), - main_thread_scrolling_reasons_counter_( - MainThreadScrollingReason::kMainThreadScrollingReasonCount, - 0) { + main_thread_scrolling_reasons_(0) { Init(); } @@ -5176,6 +5173,8 @@ if (frame.IsMainFrame()) main_thread_scrolling_reasons_ = reasons; + DCHECK(!MainThreadScrollingReason::HasNonCompositedScrollReasons( + main_thread_scrolling_reasons_)); } MainThreadScrollingReasons FrameView::MainThreadScrollingReasonsPerFrame() @@ -5234,6 +5233,7 @@ ToLocalFrame(frame)->View()->MainThreadScrollingReasonsPerFrame(); } + DCHECK(!MainThreadScrollingReason::HasNonCompositedScrollReasons(reasons)); return reasons; } @@ -5267,29 +5267,6 @@ return result; } -void FrameView::AdjustStyleRelatedMainThreadScrollingReasons( - const uint32_t reason, - bool increase) { - int index = MainThreadScrollingReason::getReasonIndex(reason); - DCHECK_GE(index, 0); - main_thread_scrolling_reasons_counter_[index] += increase ? 1 : -1; - DCHECK_GE(main_thread_scrolling_reasons_counter_[index], 0); -} - -MainThreadScrollingReasons -FrameView::GetStyleRelatedMainThreadScrollingReasons() const { - MainThreadScrollingReasons reasons = - static_cast<MainThreadScrollingReasons>(0); - for (uint32_t reason = 0; - reason < MainThreadScrollingReason::kMainThreadScrollingReasonCount; - ++reason) { - if (main_thread_scrolling_reasons_counter_[reason] > 0) { - reasons |= 1 << reason; - } - } - return reasons; -} - void FrameView::SetViewportIntersectionFromParent( const IntRect& viewport_intersection) { if (remote_viewport_intersection_ != viewport_intersection) {
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h index 0fa8fa7..53df8155 100644 --- a/third_party/WebKit/Source/core/frame/FrameView.h +++ b/third_party/WebKit/Source/core/frame/FrameView.h
@@ -803,9 +803,6 @@ // Main thread scrolling reasons for this object only. For all reasons, // see: mainThreadScrollingReasons(). MainThreadScrollingReasons MainThreadScrollingReasonsPerFrame() const; - void AdjustStyleRelatedMainThreadScrollingReasons(const uint32_t reason, - bool increase); - MainThreadScrollingReasons GetStyleRelatedMainThreadScrollingReasons() const; bool HasVisibleSlowRepaintViewportConstrainedObjects() const; @@ -1221,11 +1218,6 @@ bool is_storing_composited_layer_debug_info_; MainThreadScrollingReasons main_thread_scrolling_reasons_; - // For recording main thread scrolling reasons - // due to layout object properties. e.g. opacity, transform. - // The size of the vector depends on the number of - // main thread scrolling reasons. - Vector<int> main_thread_scrolling_reasons_counter_; // TODO(kenrb): Remove these when https://crbug.com/680606 is resolved. std::unique_ptr<CompositorAnimationTimeline> animation_timeline_;
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index 515ef265..e0208cc4 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -1531,6 +1531,49 @@ kCanRequestURLNonHTTPContainingNewline = 1915, kGetGamepads = 1916, kV8SVGPathElement_GetPathSegAtLength_Method = 1917, + kMediaStreamConstraintsAudio = 1918, + kMediaStreamConstraintsAudioUnconstrained = 1919, + kMediaStreamConstraintsVideo = 1920, + kMediaStreamConstraintsVideoUnconstrained = 1921, + kMediaStreamConstraintsWidth = 1922, + kMediaStreamConstraintsHeight = 1923, + kMediaStreamConstraintsAspectRatio = 1924, + kMediaStreamConstraintsFrameRate = 1925, + kMediaStreamConstraintsFacingMode = 1926, + kMediaStreamConstraintsVolume = 1927, + kMediaStreamConstraintsSampleRate = 1928, + kMediaStreamConstraintsSampleSize = 1929, + kMediaStreamConstraintsEchoCancellation = 1930, + kMediaStreamConstraintsLatency = 1931, + kMediaStreamConstraintsChannelCount = 1932, + kMediaStreamConstraintsDeviceIdAudio = 1933, + kMediaStreamConstraintsDeviceIdVideo = 1934, + kMediaStreamConstraintsDisableLocalEcho = 1935, + kMediaStreamConstraintsGroupIdAudio = 1936, + kMediaStreamConstraintsGroupIdVideo = 1937, + kMediaStreamConstraintsVideoKind = 1938, + kMediaStreamConstraintsDepthNear = 1939, + kMediaStreamConstraintsDepthFar = 1940, + kMediaStreamConstraintsFocalLengthX = 1941, + kMediaStreamConstraintsFocalLengthY = 1942, + kMediaStreamConstraintsMediaStreamSourceAudio = 1943, + kMediaStreamConstraintsMediaStreamSourceVideo = 1944, + kMediaStreamConstraintsRenderToAssociatedSink = 1945, + kMediaStreamConstraintsHotwordEnabled = 1946, + kMediaStreamConstraintsGoogEchoCancellation = 1947, + kMediaStreamConstraintsGoogExperimentalEchoCancellation = 1948, + kMediaStreamConstraintsGoogAutoGainControl = 1949, + kMediaStreamConstraintsGoogExperimentalAutoGainControl = 1950, + kMediaStreamConstraintsGoogNoiseSuppression = 1951, + kMediaStreamConstraintsGoogHighpassFilter = 1952, + kMediaStreamConstraintsGoogTypingNoiseDetection = 1953, + kMediaStreamConstraintsGoogExperimentalNoiseSuppression = 1954, + kMediaStreamConstraintsGoogBeamforming = 1955, + kMediaStreamConstraintsGoogArrayGeometry = 1956, + kMediaStreamConstraintsGoogAudioMirroring = 1957, + kMediaStreamConstraintsGoogDAEchoCancellation = 1958, + kMediaStreamConstraintsGoogNoiseReduction = 1959, + kMediaStreamConstraintsGoogPowerLineFrequency = 1960, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp index 1152fb1..41f39ae 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp +++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
@@ -231,12 +231,8 @@ return true; } - DCHECK_EQ(!canvas(), - !!destination_security_origin); // Must have one or the other - bool taint_origin = image_source->WouldTaintOrigin( - destination_security_origin ? destination_security_origin - : canvas()->GetSecurityOrigin()); - + bool taint_origin = + image_source->WouldTaintOrigin(destination_security_origin); if (has_url) { if (taint_origin) dirty_urls_.insert(source_url.GetString());
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h index c182daf..e646999 100644 --- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h +++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
@@ -208,7 +208,7 @@ OffscreenCanvas* offscreenCanvas() const { return offscreen_canvas_; } virtual ImageBitmap* TransferToImageBitmap(ScriptState*) { return nullptr; } - bool WouldTaintOrigin(CanvasImageSource*, SecurityOrigin* = nullptr); + bool WouldTaintOrigin(CanvasImageSource*, SecurityOrigin*); void DidMoveToNewDocument(Document*); void DetachCanvas() { canvas_ = nullptr; }
diff --git a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp index d71e2f1..fd1d837 100644 --- a/third_party/WebKit/Source/core/input/EventHandlerTest.cpp +++ b/third_party/WebKit/Source/core/input/EventHandlerTest.cpp
@@ -5,6 +5,7 @@ #include "core/input/EventHandler.h" #include <memory> +#include "core/dom/ClientRect.h" #include "core/dom/Document.h" #include "core/dom/Range.h" #include "core/editing/Editor.h" @@ -12,12 +13,34 @@ #include "core/frame/FrameView.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" +#include "core/layout/LayoutBox.h" #include "core/loader/EmptyClients.h" #include "core/page/AutoscrollController.h" #include "core/page/Page.h" +#include "core/paint/PaintLayerScrollableArea.h" #include "core/testing/DummyPageHolder.h" +#include "platform/scroll/MainThreadScrollingReason.h" +#include "platform/testing/HistogramTester.h" #include "testing/gtest/include/gtest/gtest.h" +#define EXPECT_WHEEL_BUCKET(reason, count) \ + histogram_tester.ExpectBucketCount( \ + "Renderer4.MainThreadWheelScrollReason", \ + GetBucketIndex(MainThreadScrollingReason::reason), count); + +#define EXPECT_TOUCH_BUCKET(reason, count) \ + histogram_tester.ExpectBucketCount( \ + "Renderer4.MainThreadGestureScrollReason", \ + GetBucketIndex(MainThreadScrollingReason::reason), count); + +#define EXPECT_WHEEL_TOTAL(count) \ + histogram_tester.ExpectTotalCount("Renderer4.MainThreadWheelScrollReason", \ + count); + +#define EXPECT_TOUCH_TOTAL(count) \ + histogram_tester.ExpectTotalCount("Renderer4.MainThreadGestureScrollReason", \ + count); + namespace blink { class EventHandlerTest : public ::testing::Test { @@ -36,6 +59,48 @@ std::unique_ptr<DummyPageHolder> dummy_page_holder_; }; +class NonCompositedMainThreadScrollingReasonRecordTest + : public EventHandlerTest { + protected: + class ScrollBeginEventBuilder : public WebGestureEvent { + public: + ScrollBeginEventBuilder(IntPoint position, + FloatPoint delta, + WebGestureDevice device) + : WebGestureEvent() { + type_ = WebInputEvent::kGestureScrollBegin; + x = global_x = position.X(); + y = global_y = position.Y(); + data.scroll_begin.delta_y_hint = delta.Y(); + source_device = device; + frame_scale_ = 1; + } + }; + + class ScrollUpdateEventBuilder : public WebGestureEvent { + public: + ScrollUpdateEventBuilder() : WebGestureEvent() { + type_ = WebInputEvent::kGestureScrollUpdate; + data.scroll_update.delta_x = 0.0f; + data.scroll_update.delta_y = 1.0f; + data.scroll_update.velocity_x = 0; + data.scroll_update.velocity_y = 1; + frame_scale_ = 1; + } + }; + + class ScrollEndEventBuilder : public WebGestureEvent { + public: + ScrollEndEventBuilder() : WebGestureEvent() { + type_ = WebInputEvent::kGestureScrollEnd; + frame_scale_ = 1; + } + }; + + int GetBucketIndex(uint32_t reason); + void Scroll(Element*, const WebGestureDevice); +}; + class TapEventBuilder : public WebGestureEvent { public: TapEventBuilder(IntPoint position, int tap_count) @@ -90,6 +155,34 @@ GetDocument().View()->UpdateAllLifecyclePhases(); } +int NonCompositedMainThreadScrollingReasonRecordTest::GetBucketIndex( + uint32_t reason) { + int index = 1; + while (!(reason & 1)) { + reason >>= 1; + ++index; + } + DCHECK_EQ(reason, 1u); + return index; +} + +void NonCompositedMainThreadScrollingReasonRecordTest::Scroll( + Element* element, + const WebGestureDevice device) { + DCHECK(element); + DCHECK(element->getBoundingClientRect()); + ClientRect* rect = element->getBoundingClientRect(); + ScrollBeginEventBuilder scroll_begin( + IntPoint(rect->left() + rect->width() / 2, + rect->top() + rect->height() / 2), + FloatPoint(0.f, 1.f), device); + ScrollUpdateEventBuilder scroll_update; + ScrollEndEventBuilder scroll_end; + GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_begin); + GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_update); + GetDocument().GetFrame()->GetEventHandler().HandleGestureEvent(scroll_end); +} + TEST_F(EventHandlerTest, dragSelectionAfterScroll) { SetHtmlInnerHTML( "<style> body { margin: 0px; } .upper { width: 300px; height: 400px; }" @@ -548,4 +641,145 @@ EXPECT_EQ(WTF::String(), LastToolTip()); } +TEST_F(NonCompositedMainThreadScrollingReasonRecordTest, + TouchAndWheelGeneralTest) { + SetHtmlInnerHTML( + "<style>" + " .box { overflow:scroll; width: 100px; height: 100px; }" + " .translucent { opacity: 0.5; }" + " .spacer { height: 1000px; }" + "</style>" + "<div id='box' class='translucent box'>" + " <div class='spacer'></div>" + "</div>"); + + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* box = GetDocument().getElementById("box"); + HistogramTester histogram_tester; + + // Test touch scroll. + Scroll(box, kWebGestureDeviceTouchscreen); + EXPECT_TOUCH_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_TOUCH_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + + Scroll(box, kWebGestureDeviceTouchscreen); + EXPECT_TOUCH_BUCKET(kHasOpacityAndLCDText, 2); + EXPECT_TOUCH_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 2); + EXPECT_TOUCH_TOTAL(4); + + // Test wheel scroll. + Scroll(box, kWebGestureDeviceTouchpad); + EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + EXPECT_WHEEL_TOTAL(2); +} + +TEST_F(NonCompositedMainThreadScrollingReasonRecordTest, + CompositedScrollableAreaTest) { + SetHtmlInnerHTML( + "<style>" + " .box { overflow:scroll; width: 100px; height: 100px; }" + " .translucent { opacity: 0.5; }" + " .composited { will-change: transform; }" + " .spacer { height: 1000px; }" + "</style>" + "<div id='box' class='translucent box'>" + " <div class='spacer'></div>" + "</div>"); + + GetPage().GetSettings().SetAcceleratedCompositingEnabled(true); + GetDocument().View()->SetParentVisible(true); + GetDocument().View()->SetSelfVisible(true); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* box = GetDocument().getElementById("box"); + HistogramTester histogram_tester; + + Scroll(box, kWebGestureDeviceTouchpad); + EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + EXPECT_WHEEL_TOTAL(2); + + box->setAttribute("class", "composited translucent box"); + GetDocument().View()->UpdateAllLifecyclePhases(); + Scroll(box, kWebGestureDeviceTouchpad); + EXPECT_FALSE(ToLayoutBox(box->GetLayoutObject()) + ->GetScrollableArea() + ->GetNonCompositedMainThreadScrollingReasons()); + EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + EXPECT_WHEEL_TOTAL(2); +} + +TEST_F(NonCompositedMainThreadScrollingReasonRecordTest, + NotScrollableAreaTest) { + SetHtmlInnerHTML( + "<style>.box { overflow:scroll; width: 100px; height: 100px; }" + " .translucent { opacity: 0.5; }" + " .hidden { overflow: hidden; }" + " .spacer { height: 1000px; }" + "</style>" + "<div id='box' class='translucent box'>" + " <div class='spacer'></div>" + "</div>"); + + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* box = GetDocument().getElementById("box"); + HistogramTester histogram_tester; + + Scroll(box, kWebGestureDeviceTouchpad); + EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + EXPECT_WHEEL_TOTAL(2); + + box->setAttribute("class", "hidden translucent box"); + GetDocument().View()->UpdateAllLifecyclePhases(); + Scroll(box, kWebGestureDeviceTouchpad); + EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + EXPECT_WHEEL_TOTAL(2); +} + +TEST_F(NonCompositedMainThreadScrollingReasonRecordTest, NestedScrollersTest) { + SetHtmlInnerHTML( + "<style>" + " .container { overflow:scroll; width: 200px; height: 200px; }" + " .box { overflow:scroll; width: 100px; height: 100px; }" + " .translucent { opacity: 0.5; }" + " .transform { transform: scale(0.8); }" + " .with-border-radius { border: 5px solid; border-radius: 5px; }" + " .spacer { height: 1000px; }" + " .composited { will-change: transform; }" + "</style>" + "<div id='container' class='container with-border-radius'>" + " <div class='translucent box'>" + " <div id='inner' class='composited transform box'>" + " <div class='spacer'></div>" + " </div>" + " <div class='spacer'></div>" + " </div>" + " <div class='spacer'></div>" + "</div>"); + + GetPage().GetSettings().SetAcceleratedCompositingEnabled(true); + GetDocument().View()->SetParentVisible(true); + GetDocument().View()->SetSelfVisible(true); + GetDocument().View()->UpdateAllLifecyclePhases(); + + Element* box = GetDocument().getElementById("inner"); + HistogramTester histogram_tester; + + Scroll(box, kWebGestureDeviceTouchpad); + // Scrolling the inner box will gather reasons from the scrolling chain. The + // inner box itself has no reason because it's composited. Other scrollable + // areas from the chain have corresponding reasons. + EXPECT_WHEEL_BUCKET(kHasOpacityAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kBackgroundNotOpaqueInRectAndLCDText, 1); + EXPECT_WHEEL_BUCKET(kHasBorderRadius, 1); + EXPECT_WHEEL_BUCKET(kHasTransformAndLCDText, 0); + EXPECT_WHEEL_TOTAL(3); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp index 2f69e7bb..38bc0e55 100644 --- a/third_party/WebKit/Source/core/input/ScrollManager.cpp +++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp
@@ -22,6 +22,7 @@ #include "core/page/scrolling/RootScrollerController.h" #include "core/page/scrolling/ScrollState.h" #include "core/paint/PaintLayer.h" +#include "platform/Histogram.h" #include "platform/RuntimeEnabledFeatures.h" #include "wtf/PtrUtil.h" @@ -196,6 +197,67 @@ scroll_state.distributeToScrollChainDescendant(); } +uint32_t ScrollManager::ComputeNonCompositedMainThreadScrollingReasons() { + // When scrolling on the main thread, the scrollableArea may or may not be + // composited. Either way, we have recorded either the reasons stored in + // its layer or the reason NonFastScrollableRegion from the compositor + // side. Here we record scrolls that occurred on main thread due to a + // non-composited scroller. + if (!scroll_gesture_handling_node_->GetLayoutObject() || !frame_->View()) + return 0; + + uint32_t non_composited_main_thread_scrolling_reasons = 0; + + for (auto* cur_box = + scroll_gesture_handling_node_->GetLayoutObject()->EnclosingBox(); + cur_box; cur_box = cur_box->ContainingBlock()) { + PaintLayerScrollableArea* scrollable_area = cur_box->GetScrollableArea(); + + if (!scrollable_area || !scrollable_area->ScrollsOverflow()) + continue; + + DCHECK(!scrollable_area->UsesCompositedScrolling() || + !scrollable_area->GetNonCompositedMainThreadScrollingReasons()); + non_composited_main_thread_scrolling_reasons |= + scrollable_area->GetNonCompositedMainThreadScrollingReasons(); + } + + return non_composited_main_thread_scrolling_reasons; +} + +void ScrollManager::RecordNonCompositedMainThreadScrollingReasons( + const WebGestureDevice device) { + if (device != kWebGestureDeviceTouchpad && + device != kWebGestureDeviceTouchscreen) { + return; + } + + uint32_t reasons = ComputeNonCompositedMainThreadScrollingReasons(); + if (!reasons) + return; + DCHECK(MainThreadScrollingReason::HasNonCompositedScrollReasons(reasons)); + + uint32_t main_thread_scrolling_reason_enum_max = + MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; + for (uint32_t i = MainThreadScrollingReason::kNonCompositedReasonsFirst; + i <= MainThreadScrollingReason::kNonCompositedReasonsLast; ++i) { + unsigned val = 1 << i; + if (reasons & val) { + if (device == kWebGestureDeviceTouchscreen) { + DEFINE_STATIC_LOCAL(EnumerationHistogram, touch_histogram, + ("Renderer4.MainThreadGestureScrollReason", + main_thread_scrolling_reason_enum_max)); + touch_histogram.Count(i + 1); + } else { + DEFINE_STATIC_LOCAL(EnumerationHistogram, wheel_histogram, + ("Renderer4.MainThreadWheelScrollReason", + main_thread_scrolling_reason_enum_max)); + wheel_histogram.Count(i + 1); + } + } + } +} + WebInputEventResult ScrollManager::HandleGestureScrollBegin( const WebGestureEvent& gesture_event) { Document* document = frame_->GetDocument(); @@ -221,6 +283,8 @@ PassScrollGestureEvent(gesture_event, scroll_gesture_handling_node_->GetLayoutObject()); + RecordNonCompositedMainThreadScrollingReasons(gesture_event.source_device); + current_scroll_chain_.clear(); std::unique_ptr<ScrollStateData> scroll_state_data = WTF::MakeUnique<ScrollStateData>();
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.h b/third_party/WebKit/Source/core/input/ScrollManager.h index 28d492e..bdd7a1e8 100644 --- a/third_party/WebKit/Source/core/input/ScrollManager.h +++ b/third_party/WebKit/Source/core/input/ScrollManager.h
@@ -111,6 +111,9 @@ void RecomputeScrollChain(const Node& start_node, std::deque<int>& scroll_chain); + uint32_t ComputeNonCompositedMainThreadScrollingReasons(); + void RecordNonCompositedMainThreadScrollingReasons(const WebGestureDevice); + // NOTE: If adding a new field to this class please ensure that it is // cleared in |ScrollManager::clear()|.
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index 638fee9..3eda3a9d 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -114,7 +114,7 @@ scroll_corner_(nullptr), resizer_(nullptr), scroll_anchor_(this), - reasons_(0) + non_composited_main_thread_scrolling_reasons_(0) #if DCHECK_IS_ON() , has_been_disposed_(false) @@ -152,7 +152,7 @@ } } - RemoveStyleRelatedMainThreadScrollingReasons(); + non_composited_main_thread_scrolling_reasons_ = 0; if (ScrollingCoordinator* scrolling_coordinator = GetScrollingCoordinator()) scrolling_coordinator->WillDestroyScrollableArea(this); @@ -1796,6 +1796,7 @@ bool PaintLayerScrollableArea::ComputeNeedsCompositedScrolling( const LCDTextMode mode, const PaintLayer* layer) { + non_composited_main_thread_scrolling_reasons_ = 0; if (!layer->ScrollsOverflow()) return false; @@ -1810,14 +1811,14 @@ return false; bool needs_composited_scrolling = true; - uint32_t main_thread_scrolling_reasons = 0; // TODO(flackr): Allow integer transforms as long as all of the ancestor // transforms are also integer. bool background_supports_lcd_text = RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && layer->GetLayoutObject().Style()->IsStackingContext() && - layer->GetBackgroundPaintLocation(&main_thread_scrolling_reasons) & + layer->GetBackgroundPaintLocation( + &non_composited_main_thread_scrolling_reasons_) & kBackgroundPaintInScrollingContents && layer->BackgroundIsKnownToBeOpaqueInRect( ToLayoutBox(layer->GetLayoutObject()).PaddingBoxRect()) && @@ -1827,16 +1828,16 @@ !layer->Compositor()->PreferCompositingToLCDTextEnabled() && !background_supports_lcd_text) { if (layer->CompositesWithOpacity()) { - main_thread_scrolling_reasons |= + non_composited_main_thread_scrolling_reasons_ |= MainThreadScrollingReason::kHasOpacityAndLCDText; } if (layer->CompositesWithTransform()) { - main_thread_scrolling_reasons |= + non_composited_main_thread_scrolling_reasons_ |= MainThreadScrollingReason::kHasTransformAndLCDText; } if (!layer->BackgroundIsKnownToBeOpaqueInRect( ToLayoutBox(layer->GetLayoutObject()).PaddingBoxRect())) { - main_thread_scrolling_reasons |= + non_composited_main_thread_scrolling_reasons_ |= MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText; } @@ -1848,68 +1849,24 @@ // behind dashed borders). Resolve this case, or not, and update this check // with the results. if (layer->GetLayoutObject().Style()->HasBorderRadius()) { - main_thread_scrolling_reasons |= + non_composited_main_thread_scrolling_reasons_ |= MainThreadScrollingReason::kHasBorderRadius; needs_composited_scrolling = false; } if (layer->GetLayoutObject().HasClip() || layer->HasDescendantWithClipPath() || layer->HasAncestorWithClipPath()) { - main_thread_scrolling_reasons |= + non_composited_main_thread_scrolling_reasons_ |= MainThreadScrollingReason::kHasClipRelatedProperty; needs_composited_scrolling = false; } - if (main_thread_scrolling_reasons) { - AddStyleRelatedMainThreadScrollingReasons(main_thread_scrolling_reasons); - } - + DCHECK(!(non_composited_main_thread_scrolling_reasons_ & + ~MainThreadScrollingReason::kNonCompositedReasons)); return needs_composited_scrolling; } -void PaintLayerScrollableArea::AddStyleRelatedMainThreadScrollingReasons( - const uint32_t reasons) { - LocalFrame* frame = Box().GetFrame(); - if (!frame) - return; - FrameView* frame_view = frame->View(); - if (!frame_view) - return; - - for (uint32_t reason = 1; - reason < 1 << MainThreadScrollingReason::kMainThreadScrollingReasonCount; - reason <<= 1) { - if (reasons & reason) { - frame_view->AdjustStyleRelatedMainThreadScrollingReasons(reason, true); - reasons_ |= reason; - } - } -} - -void PaintLayerScrollableArea::RemoveStyleRelatedMainThreadScrollingReasons() { - LocalFrame* frame = Box().GetFrame(); - if (!frame) - return; - FrameView* frame_view = frame->View(); - if (!frame_view) - return; - - // Decrease the number of layers that have any main thread - // scrolling reasons stored in FrameView - for (uint32_t i = 0; - i < MainThreadScrollingReason::kMainThreadScrollingReasonCount; ++i) { - uint32_t reason = 1 << i; - if (HasMainThreadScrollingReason(reason)) { - reasons_ &= ~reason; - frame_view->AdjustStyleRelatedMainThreadScrollingReasons(reason, false); - } - } -} - void PaintLayerScrollableArea::UpdateNeedsCompositedScrolling( LCDTextMode mode) { - // Clear all style related main thread scrolling reasons, if any, - // before calling computeNeedsCompositedScrolling - RemoveStyleRelatedMainThreadScrollingReasons(); const bool needs_composited_scrolling = ComputeNeedsCompositedScrolling(mode, Layer());
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h index 0a348662..8a3e916 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
@@ -479,14 +479,12 @@ StickyConstraintsMap& GetStickyConstraintsMap() { return EnsureRareData().sticky_constraints_map_; } + void InvalidateAllStickyConstraints(); void InvalidateStickyConstraintsFor(PaintLayer*, bool needs_compositing_update = true); - - void RemoveStyleRelatedMainThreadScrollingReasons(); - void AddStyleRelatedMainThreadScrollingReasons(const uint32_t); - bool HasMainThreadScrollingReason(uint32_t reason) const { - return reasons_ & reason; + uint32_t GetNonCompositedMainThreadScrollingReasons() { + return non_composited_main_thread_scrolling_reasons_; } uint64_t Id() const; @@ -597,7 +595,7 @@ std::unique_ptr<PaintLayerScrollableAreaRareData> rare_data_; // MainThreadScrollingReason due to the properties of the LayoutObject - uint32_t reasons_; + uint32_t non_composited_main_thread_scrolling_reasons_; #if DCHECK_IS_ON() bool has_been_disposed_;
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css b/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css index f45303bd..f7a09738 100644 --- a/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css +++ b/third_party/WebKit/Source/devtools/front_end/ui/toolbar.css
@@ -79,6 +79,8 @@ .toolbar-has-dropdown { justify-content: space-between; + padding: 0 3px 0 5px; + margin: 0 -3px 0 -5px; } .toolbar-has-dropdown .toolbar-text {
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h index 2a9ff71..ee5bcb65 100644 --- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h +++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.h
@@ -159,8 +159,10 @@ // BaseRenderingContext2D implementation bool OriginClean() const final; void SetOriginTainted() final; - bool WouldTaintOrigin(CanvasImageSource* source, ExecutionContext*) final { - return CanvasRenderingContext::WouldTaintOrigin(source); + bool WouldTaintOrigin(CanvasImageSource* source, + ExecutionContext* execution_context) final { + return CanvasRenderingContext::WouldTaintOrigin( + source, execution_context->GetSecurityOrigin()); } int Width() const final;
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp index 15d5515..292553e 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBCursor.cpp
@@ -104,16 +104,9 @@ ExceptionState& exception_state) { IDB_TRACE("IDBCursor::update"); - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } if (transaction_->IsReadOnly()) { @@ -152,16 +145,9 @@ "than 0."); return; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return; } if (IsDeleted()) { @@ -185,16 +171,9 @@ ExceptionState& exception_state) { IDB_TRACE("IDBCursor::continue"); - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return; } if (!got_value_) { @@ -228,16 +207,9 @@ ExceptionState& exception_state) { IDB_TRACE("IDBCursor::continuePrimaryKey"); - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return; } @@ -336,16 +308,9 @@ IDBRequest* IDBCursor::deleteFunction(ScriptState* script_state, ExceptionState& exception_state) { IDB_TRACE("IDBCursor::delete"); - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } if (transaction_->IsReadOnly()) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp index c997e91..17d620a 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
@@ -77,16 +77,9 @@ IDBDatabase::kIndexDeletedErrorMessage); return; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return; } @@ -128,16 +121,9 @@ IDBDatabase::kIndexDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } WebIDBCursorDirection direction = @@ -177,16 +163,9 @@ IDBDatabase::kIndexDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } @@ -218,16 +197,9 @@ IDBDatabase::kIndexDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } WebIDBCursorDirection direction = @@ -305,16 +277,9 @@ IDBDatabase::kIndexDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } @@ -353,16 +318,9 @@ IDBDatabase::kIndexDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp index 9cbf73a..2022121 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -89,16 +89,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return; } @@ -140,16 +133,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } IDBKeyRange* key_range = IDBKeyRange::FromScriptValue( @@ -184,16 +170,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } IDBKeyRange* key_range = IDBKeyRange::FromScriptValue( @@ -239,16 +218,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } IDBKeyRange* range = IDBKeyRange::FromScriptValue( @@ -289,16 +261,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } IDBKeyRange* range = IDBKeyRange::FromScriptValue( @@ -398,16 +363,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } if (transaction_->IsReadOnly()) { @@ -564,16 +522,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } if (transaction_->IsReadOnly()) { @@ -612,16 +563,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } if (transaction_->IsReadOnly()) { @@ -756,16 +700,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } if (ContainsIndex(name)) { @@ -869,16 +806,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return; } int64_t index_id = FindIndexId(name); @@ -914,16 +844,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } @@ -967,16 +890,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; } @@ -1013,16 +929,9 @@ kInvalidStateError, IDBDatabase::kObjectStoreDeletedErrorMessage); return nullptr; } - if (transaction_->IsFinished() || transaction_->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return nullptr; - } if (!transaction_->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction_->InactiveErrorMessage()); return nullptr; }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp index 0ed096e2..42874b9a 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObserver.cpp
@@ -29,16 +29,9 @@ IDBTransaction* transaction, const IDBObserverInit& options, ExceptionState& exception_state) { - if (transaction->IsFinished() || transaction->IsFinishing()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionFinishedErrorMessage); - return; - } if (!transaction->IsActive()) { - exception_state.ThrowDOMException( - kTransactionInactiveError, - IDBDatabase::kTransactionInactiveErrorMessage); + exception_state.ThrowDOMException(kTransactionInactiveError, + transaction->InactiveErrorMessage()); return; } if (transaction->IsVersionChange()) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp index 3b29056..42a7867 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.cpp
@@ -485,6 +485,22 @@ return ContextLifecycleObserver::GetExecutionContext(); } +const char* IDBTransaction::InactiveErrorMessage() const { + switch (state_) { + case kActive: + // Callers should check !IsActive() before calling. + NOTREACHED(); + return nullptr; + case kInactive: + return IDBDatabase::kTransactionInactiveErrorMessage; + case kFinishing: + case kFinished: + return IDBDatabase::kTransactionFinishedErrorMessage; + } + NOTREACHED(); + return nullptr; +} + DispatchEventResult IDBTransaction::DispatchEventInternal(Event* event) { IDB_TRACE("IDBTransaction::dispatchEvent"); if (!GetExecutionContext()) {
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h index f24644a..7bc8996 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h +++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.h
@@ -141,6 +141,10 @@ return old_database_metadata_.max_object_store_id; } + // Returns a detailed message to use when throwing TransactionInactiveError, + // depending on whether the transaction is just inactive or has finished. + const char* InactiveErrorMessage() const; + protected: // EventTarget DispatchEventResult DispatchEventInternal(Event*) override;
diff --git a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp index 51287a57..503dd846 100644 --- a/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp +++ b/third_party/WebKit/Source/modules/mediastream/UserMediaRequest.cpp
@@ -31,6 +31,8 @@ #include "modules/mediastream/UserMediaRequest.h" +#include <type_traits> + #include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" @@ -49,10 +51,259 @@ namespace blink { -static WebMediaConstraints ParseOptions( - ExecutionContext* context, - const BooleanOrMediaTrackConstraints& options, - MediaErrorState& error_state) { +namespace { + +template <typename NumericConstraint> +bool SetUsesNumericConstraint( + const WebMediaTrackConstraintSet& set, + NumericConstraint WebMediaTrackConstraintSet::*field) { + return (set.*field).HasExact() || (set.*field).HasIdeal() || + (set.*field).HasMin() || (set.*field).HasMax(); +} + +template <typename DiscreteConstraint> +bool SetUsesDiscreteConstraint( + const WebMediaTrackConstraintSet& set, + DiscreteConstraint WebMediaTrackConstraintSet::*field) { + return (set.*field).HasExact() || (set.*field).HasIdeal(); +} + +template <typename NumericConstraint> +bool RequestUsesNumericConstraint( + const WebMediaConstraints& constraints, + NumericConstraint WebMediaTrackConstraintSet::*field) { + if (SetUsesNumericConstraint(constraints.Basic(), field)) + return true; + for (const auto& advanced_set : constraints.Advanced()) { + if (SetUsesNumericConstraint(advanced_set, field)) + return true; + } + return false; +} + +template <typename DiscreteConstraint> +bool RequestUsesDiscreteConstraint( + const WebMediaConstraints& constraints, + DiscreteConstraint WebMediaTrackConstraintSet::*field) { + static_assert( + std::is_same<decltype(field), + StringConstraint WebMediaTrackConstraintSet::*>::value || + std::is_same<decltype(field), + BooleanConstraint WebMediaTrackConstraintSet::*>::value, + "Must use StringConstraint or BooleanConstraint"); + if (SetUsesDiscreteConstraint(constraints.Basic(), field)) + return true; + for (const auto& advanced_set : constraints.Advanced()) { + if (SetUsesDiscreteConstraint(advanced_set, field)) + return true; + } + return false; +} + +class FeatureCounter { + WTF_MAKE_NONCOPYABLE(FeatureCounter); + + public: + FeatureCounter(ExecutionContext* context) + : context_(context), is_unconstrained_(true) {} + void Count(UseCounter::Feature feature) { + UseCounter::Count(context_, feature); + is_unconstrained_ = false; + } + bool IsUnconstrained() { return is_unconstrained_; } + + private: + Persistent<ExecutionContext> context_; + bool is_unconstrained_; +}; + +void CountAudioConstraintUses(ExecutionContext* context, + const WebMediaConstraints& constraints) { + FeatureCounter counter(context); + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::sample_rate)) { + counter.Count(UseCounter::kMediaStreamConstraintsSampleRate); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::sample_size)) { + counter.Count(UseCounter::kMediaStreamConstraintsSampleSize); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::echo_cancellation)) { + counter.Count(UseCounter::kMediaStreamConstraintsEchoCancellation); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::latency)) { + counter.Count(UseCounter::kMediaStreamConstraintsLatency); + } + if (RequestUsesNumericConstraint( + constraints, &WebMediaTrackConstraintSet::channel_count)) { + counter.Count(UseCounter::kMediaStreamConstraintsChannelCount); + } + if (RequestUsesDiscreteConstraint(constraints, + &WebMediaTrackConstraintSet::device_id)) { + counter.Count(UseCounter::kMediaStreamConstraintsDeviceIdAudio); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::disable_local_echo)) { + counter.Count(UseCounter::kMediaStreamConstraintsDisableLocalEcho); + } + if (RequestUsesDiscreteConstraint(constraints, + &WebMediaTrackConstraintSet::group_id)) { + counter.Count(UseCounter::kMediaStreamConstraintsGroupIdAudio); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::media_stream_source)) { + counter.Count(UseCounter::kMediaStreamConstraintsMediaStreamSourceAudio); + } + if (RequestUsesDiscreteConstraint( + constraints, + &WebMediaTrackConstraintSet::render_to_associated_sink)) { + counter.Count(UseCounter::kMediaStreamConstraintsRenderToAssociatedSink); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::hotword_enabled)) { + counter.Count(UseCounter::kMediaStreamConstraintsHotwordEnabled); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_echo_cancellation)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogEchoCancellation); + } + if (RequestUsesDiscreteConstraint( + constraints, + &WebMediaTrackConstraintSet::goog_experimental_echo_cancellation)) { + counter.Count( + UseCounter::kMediaStreamConstraintsGoogExperimentalEchoCancellation); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_auto_gain_control)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogAutoGainControl); + } + if (RequestUsesDiscreteConstraint( + constraints, + &WebMediaTrackConstraintSet::goog_experimental_auto_gain_control)) { + counter.Count( + UseCounter::kMediaStreamConstraintsGoogExperimentalAutoGainControl); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_noise_suppression)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogNoiseSuppression); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_highpass_filter)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogHighpassFilter); + } + if (RequestUsesDiscreteConstraint( + constraints, + &WebMediaTrackConstraintSet::goog_typing_noise_detection)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogTypingNoiseDetection); + } + if (RequestUsesDiscreteConstraint( + constraints, + &WebMediaTrackConstraintSet::goog_experimental_noise_suppression)) { + counter.Count( + UseCounter::kMediaStreamConstraintsGoogExperimentalNoiseSuppression); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_beamforming)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogBeamforming); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_array_geometry)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogArrayGeometry); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_audio_mirroring)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogAudioMirroring); + } + if (RequestUsesDiscreteConstraint( + constraints, + &WebMediaTrackConstraintSet::goog_da_echo_cancellation)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogDAEchoCancellation); + } + + UseCounter::Count(context, UseCounter::kMediaStreamConstraintsAudio); + if (counter.IsUnconstrained()) { + UseCounter::Count(context, + UseCounter::kMediaStreamConstraintsAudioUnconstrained); + } +} + +void CountVideoConstraintUses(ExecutionContext* context, + const WebMediaConstraints& constraints) { + FeatureCounter counter(context); + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::width)) { + counter.Count(UseCounter::kMediaStreamConstraintsWidth); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::height)) { + counter.Count(UseCounter::kMediaStreamConstraintsHeight); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::aspect_ratio)) { + counter.Count(UseCounter::kMediaStreamConstraintsAspectRatio); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::frame_rate)) { + counter.Count(UseCounter::kMediaStreamConstraintsFrameRate); + } + if (RequestUsesDiscreteConstraint(constraints, + &WebMediaTrackConstraintSet::facing_mode)) { + counter.Count(UseCounter::kMediaStreamConstraintsFacingMode); + } + if (RequestUsesDiscreteConstraint(constraints, + &WebMediaTrackConstraintSet::device_id)) { + counter.Count(UseCounter::kMediaStreamConstraintsDeviceIdVideo); + } + if (RequestUsesDiscreteConstraint(constraints, + &WebMediaTrackConstraintSet::group_id)) { + counter.Count(UseCounter::kMediaStreamConstraintsGroupIdVideo); + } + if (RequestUsesDiscreteConstraint(constraints, + &WebMediaTrackConstraintSet::video_kind)) { + counter.Count(UseCounter::kMediaStreamConstraintsVideoKind); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::depth_near)) { + counter.Count(UseCounter::kMediaStreamConstraintsDepthNear); + } + if (RequestUsesNumericConstraint(constraints, + &WebMediaTrackConstraintSet::depth_far)) { + counter.Count(UseCounter::kMediaStreamConstraintsDepthFar); + } + if (RequestUsesNumericConstraint( + constraints, &WebMediaTrackConstraintSet::focal_length_x)) { + counter.Count(UseCounter::kMediaStreamConstraintsFocalLengthX); + } + if (RequestUsesNumericConstraint( + constraints, &WebMediaTrackConstraintSet::focal_length_y)) { + counter.Count(UseCounter::kMediaStreamConstraintsFocalLengthY); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::media_stream_source)) { + counter.Count(UseCounter::kMediaStreamConstraintsMediaStreamSourceVideo); + } + if (RequestUsesDiscreteConstraint( + constraints, &WebMediaTrackConstraintSet::goog_noise_reduction)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogNoiseReduction); + } + if (RequestUsesNumericConstraint( + constraints, + &WebMediaTrackConstraintSet::goog_power_line_frequency)) { + counter.Count(UseCounter::kMediaStreamConstraintsGoogPowerLineFrequency); + } + + UseCounter::Count(context, UseCounter::kMediaStreamConstraintsVideo); + if (counter.IsUnconstrained()) { + UseCounter::Count(context, + UseCounter::kMediaStreamConstraintsVideoUnconstrained); + } +} + +WebMediaConstraints ParseOptions(ExecutionContext* context, + const BooleanOrMediaTrackConstraints& options, + MediaErrorState& error_state) { WebMediaConstraints constraints; Dictionary constraints_dictionary; @@ -71,6 +322,8 @@ return constraints; } +} // namespace + UserMediaRequest* UserMediaRequest::Create( ExecutionContext* context, UserMediaController* controller, @@ -94,6 +347,11 @@ return nullptr; } + if (!audio.IsNull()) + CountAudioConstraintUses(context, audio); + if (!video.IsNull()) + CountVideoConstraintUses(context, video); + return new UserMediaRequest(context, controller, audio, video, success_callback, error_callback); }
diff --git a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp index 55a3109..330e14b 100644 --- a/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AnalyserNode.cpp
@@ -202,12 +202,9 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasFftSize()) - node->setFftSize(options.fftSize(), exception_state); - - if (options.hasSmoothingTimeConstant()) - node->setSmoothingTimeConstant(options.smoothingTimeConstant(), - exception_state); + node->setFftSize(options.fftSize(), exception_state); + node->setSmoothingTimeConstant(options.smoothingTimeConstant(), + exception_state); // minDecibels and maxDecibels have default values. Set both of the values // at once.
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp index f7316e1..569440f 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceNode.cpp
@@ -678,16 +678,11 @@ if (options.hasBuffer()) node->setBuffer(options.buffer(), exception_state); - if (options.hasDetune()) - node->detune()->setValue(options.detune()); - if (options.hasLoop()) - node->setLoop(options.loop()); - if (options.hasLoopEnd()) - node->setLoopEnd(options.loopEnd()); - if (options.hasLoopStart()) - node->setLoopStart(options.loopStart()); - if (options.hasPlaybackRate()) - node->playbackRate()->setValue(options.playbackRate()); + node->detune()->setValue(options.detune()); + node->setLoop(options.loop()); + node->setLoopEnd(options.loopEnd()); + node->setLoopStart(options.loopStart()); + node->playbackRate()->setValue(options.playbackRate()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceOptions.idl b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceOptions.idl index e7b2a8c..5dd5e85 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/AudioBufferSourceOptions.idl
@@ -5,9 +5,9 @@ // See https://webaudio.github.io/web-audio-api/#audiobuffersourceoptions dictionary AudioBufferSourceOptions { AudioBuffer? buffer; - float detune; - boolean loop; - double loopEnd; - double loopStart; - float playbackRate; + float detune = 0; + boolean loop = false; + double loopEnd = 0; + double loopStart = 0; + float playbackRate = 1; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp index 4ff9d1bf..d58dd559 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -523,8 +523,8 @@ } PeriodicWave* BaseAudioContext::createPeriodicWave( - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + const Vector<float>& real, + const Vector<float>& imag, ExceptionState& exception_state) { DCHECK(IsMainThread()); @@ -532,15 +532,13 @@ } PeriodicWave* BaseAudioContext::createPeriodicWave( - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + const Vector<float>& real, + const Vector<float>& imag, const PeriodicWaveConstraints& options, ExceptionState& exception_state) { DCHECK(IsMainThread()); - bool disable = options.hasDisableNormalization() - ? options.disableNormalization() - : false; + bool disable = options.disableNormalization(); return PeriodicWave::Create(*this, real, imag, disable, exception_state); }
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h index a4a6f4f8..eaa1be1 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.h
@@ -221,11 +221,11 @@ ChannelMergerNode* createChannelMerger(size_t number_of_inputs, ExceptionState&); OscillatorNode* createOscillator(ExceptionState&); - PeriodicWave* createPeriodicWave(NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + PeriodicWave* createPeriodicWave(const Vector<float>& real, + const Vector<float>& imag, ExceptionState&); - PeriodicWave* createPeriodicWave(NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + PeriodicWave* createPeriodicWave(const Vector<float>& real, + const Vector<float>& imag, const PeriodicWaveConstraints&, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl index 274ea99..d8d4d6d 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl
@@ -50,7 +50,7 @@ [RaisesException, MeasureAs=AudioContextCreateScriptProcessor] ScriptProcessorNode createScriptProcessor(optional unsigned long bufferSize, optional unsigned long numberOfInputChannels, optional unsigned long numberOfOutputChannels); [RaisesException, MeasureAs=AudioContextCreateStereoPanner] StereoPannerNode createStereoPanner(); [RaisesException, MeasureAs=AudioContextCreateOscillator] OscillatorNode createOscillator(); - [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave createPeriodicWave(Float32Array real, Float32Array imag, optional PeriodicWaveConstraints options); + [RaisesException, MeasureAs=AudioContextCreatePeriodicWave] PeriodicWave createPeriodicWave(sequence<float> real, sequence<float> imag, optional PeriodicWaveConstraints options); // Channel splitting and merging [RaisesException, MeasureAs=AudioContextCreateChannelSplitter] ChannelSplitterNode createChannelSplitter(optional unsigned long numberOfOutputs);
diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp index df2d501..56e381a 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterNode.cpp
@@ -78,16 +78,11 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasType()) - node->setType(options.type()); - if (options.hasQ()) - node->q()->setValue(options.Q()); - if (options.hasDetune()) - node->detune()->setValue(options.detune()); - if (options.hasFrequency()) - node->frequency()->setValue(options.frequency()); - if (options.hasGain()) - node->gain()->setValue(options.gain()); + node->setType(options.type()); + node->q()->setValue(options.Q()); + node->detune()->setValue(options.detune()); + node->frequency()->setValue(options.frequency()); + node->gain()->setValue(options.gain()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/BiquadFilterOptions.idl b/third_party/WebKit/Source/modules/webaudio/BiquadFilterOptions.idl index 310c1ee..3d8c7b8 100644 --- a/third_party/WebKit/Source/modules/webaudio/BiquadFilterOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/BiquadFilterOptions.idl
@@ -4,9 +4,9 @@ // See https://webaudio.github.io/web-audio-api/#biquadfilteroptions dictionary BiquadFilterOptions : AudioNodeOptions { - BiquadFilterType type; - float Q; - float detune; - float frequency; - float gain; + BiquadFilterType type = "lowpass"; + float Q = 1; + float detune = 0; + float frequency = 350; + float gain = 0; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp index eac2b785..a1dd067 100644 --- a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
@@ -95,8 +95,7 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasDelayTime()) - node->delayTime()->setValue(options.delayTime()); + node->delayTime()->setValue(options.delayTime()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/DelayOptions.idl b/third_party/WebKit/Source/modules/webaudio/DelayOptions.idl index bd17286a..9ace73f 100644 --- a/third_party/WebKit/Source/modules/webaudio/DelayOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/DelayOptions.idl
@@ -5,5 +5,5 @@ // See https://webaudio.github.io/web-audio-api/#delayoptions dictionary DelayOptions : AudioNodeOptions { double maxDelayTime = 1; - double delayTime; + double delayTime = 0; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp index c90a80a24..031b484 100644 --- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp
@@ -191,16 +191,11 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasAttack()) - node->attack()->setValue(options.attack()); - if (options.hasKnee()) - node->knee()->setValue(options.knee()); - if (options.hasRatio()) - node->ratio()->setValue(options.ratio()); - if (options.hasRelease()) - node->release()->setValue(options.release()); - if (options.hasThreshold()) - node->threshold()->setValue(options.threshold()); + node->attack()->setValue(options.attack()); + node->knee()->setValue(options.knee()); + node->ratio()->setValue(options.ratio()); + node->release()->setValue(options.release()); + node->threshold()->setValue(options.threshold()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorOptions.idl b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorOptions.idl index b193101..d182297 100644 --- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorOptions.idl
@@ -4,9 +4,9 @@ // See https://webaudio.github.io/web-audio-api/#dynamicscompressoroptions dictionary DynamicsCompressorOptions : AudioNodeOptions { - float attack; - float knee; - float ratio; - float release; - float threshold; + float attack = 0.003; + float knee = 30; + float ratio = 12; + float release = 0.25; + float threshold = -24; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp index 88f7856..fd0e6adc 100644 --- a/third_party/WebKit/Source/modules/webaudio/GainNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/GainNode.cpp
@@ -169,8 +169,7 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasGain()) - node->gain()->setValue(options.gain()); + node->gain()->setValue(options.gain()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/GainOptions.idl b/third_party/WebKit/Source/modules/webaudio/GainOptions.idl index 047d6cd..65fb4fe 100644 --- a/third_party/WebKit/Source/modules/webaudio/GainOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/GainOptions.idl
@@ -4,5 +4,5 @@ // See https://webaudio.github.io/web-audio-api/#gainoptions dictionary GainOptions : AudioNodeOptions { - float gain; + float gain = 1; };
diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp index 59c1c6d3..14c4c9c 100644 --- a/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OscillatorNode.cpp
@@ -402,35 +402,16 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasType()) { - if (options.type() == "custom" && !options.hasPeriodicWave()) { - exception_state.ThrowDOMException(kInvalidStateError, - "'type' cannot be set to 'custom' " - "without also specifying " - "'periodicWave'"); - return nullptr; - } - if (options.type() != "custom" && options.hasPeriodicWave()) { - exception_state.ThrowDOMException( - kInvalidStateError, "'type' MUST be 'custom' instead of '" + - options.type() + - "' if 'periodicWave' is also given"); - return nullptr; - } - - // At this both type and periodicWave are consistently defined. In that - // case, don't set the type if periodicWave is specified because that - // will cause an (incorrect) error to be signaled. - if (options.type() != "custom") - node->setType(options.type(), exception_state); - } - if (options.hasDetune()) - node->detune()->setValue(options.detune()); - if (options.hasFrequency()) - node->frequency()->setValue(options.frequency()); - - if (options.hasPeriodicWave()) + if (options.hasPeriodicWave()) { + // Set up the custom wave; this also sets the type to "custom", + // overriding any |type| option the user may have set. Per spec. node->setPeriodicWave(options.periodicWave()); + } else { + node->setType(options.type(), exception_state); + } + + node->detune()->setValue(options.detune()); + node->frequency()->setValue(options.frequency()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/OscillatorOptions.idl b/third_party/WebKit/Source/modules/webaudio/OscillatorOptions.idl index 98a15ce3..689ec4ab 100644 --- a/third_party/WebKit/Source/modules/webaudio/OscillatorOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/OscillatorOptions.idl
@@ -4,8 +4,8 @@ // See https://webaudio.github.io/web-audio-api/#oscillatoroptions dictionary OscillatorOptions : AudioNodeOptions { - OscillatorType type; - float detune; - float frequency; + OscillatorType type = "sine"; + float detune = 0; + float frequency = 440; PeriodicWave? periodicWave; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp index 6b6abe8..58be8223 100644 --- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
@@ -679,37 +679,23 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasPanningModel()) - node->setPanningModel(options.panningModel()); - if (options.hasDistanceModel()) - node->setDistanceModel(options.distanceModel()); + node->setPanningModel(options.panningModel()); + node->setDistanceModel(options.distanceModel()); - if (options.hasPositionX()) - node->positionX()->setValue(options.positionX()); - if (options.hasPositionY()) - node->positionY()->setValue(options.positionY()); - if (options.hasPositionZ()) - node->positionZ()->setValue(options.positionZ()); + node->positionX()->setValue(options.positionX()); + node->positionY()->setValue(options.positionY()); + node->positionZ()->setValue(options.positionZ()); - if (options.hasOrientationX()) - node->orientationX()->setValue(options.orientationX()); - if (options.hasOrientationY()) - node->orientationY()->setValue(options.orientationY()); - if (options.hasOrientationZ()) - node->orientationZ()->setValue(options.orientationZ()); + node->orientationX()->setValue(options.orientationX()); + node->orientationY()->setValue(options.orientationY()); + node->orientationZ()->setValue(options.orientationZ()); - if (options.hasRefDistance()) - node->setRefDistance(options.refDistance(), exception_state); - if (options.hasMaxDistance()) - node->setMaxDistance(options.maxDistance(), exception_state); - if (options.hasRolloffFactor()) - node->setRolloffFactor(options.rolloffFactor()); - if (options.hasConeInnerAngle()) - node->setConeInnerAngle(options.coneInnerAngle()); - if (options.hasConeOuterAngle()) - node->setConeOuterAngle(options.coneOuterAngle()); - if (options.hasConeOuterGain()) - node->setConeOuterGain(options.coneOuterGain()); + node->setRefDistance(options.refDistance(), exception_state); + node->setMaxDistance(options.maxDistance(), exception_state); + node->setRolloffFactor(options.rolloffFactor()); + node->setConeInnerAngle(options.coneInnerAngle()); + node->setConeOuterAngle(options.coneOuterAngle()); + node->setConeOuterGain(options.coneOuterGain()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerOptions.idl b/third_party/WebKit/Source/modules/webaudio/PannerOptions.idl index f7f5b1a..4cf7042 100644 --- a/third_party/WebKit/Source/modules/webaudio/PannerOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/PannerOptions.idl
@@ -4,20 +4,20 @@ // See https://webaudio.github.io/web-audio-api/#panneroptions dictionary PannerOptions : AudioNodeOptions { - PanningModelType panningModel; - DistanceModelType distanceModel; + PanningModelType panningModel = "equalpower"; + DistanceModelType distanceModel = "inverse"; - float positionX; - float positionY; - float positionZ; - float orientationX; - float orientationY; - float orientationZ; + float positionX = 0; + float positionY = 0; + float positionZ = 0; + float orientationX = 1; + float orientationY = 0; + float orientationZ = 0; - double refDistance; - double maxDistance; - double rolloffFactor; - double coneInnerAngle; - double coneOuterAngle; - double coneOuterGain; + double refDistance = 1; + double maxDistance= 10000; + double rolloffFactor = 1; + double coneInnerAngle = 360; + double coneOuterAngle = 360; + double coneOuterGain = 0; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp index fe93007..9658b8b 100644 --- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp +++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.cpp
@@ -54,10 +54,8 @@ using namespace VectorMath; PeriodicWave* PeriodicWave::Create(BaseAudioContext& context, - size_t real_length, - const float* real, - size_t imag_length, - const float* imag, + const Vector<float>& real, + const Vector<float>& imag, bool disable_normalization, ExceptionState& exception_state) { DCHECK(IsMainThread()); @@ -67,39 +65,25 @@ return nullptr; } - if (real_length != imag_length) { + if (real.size() != imag.size()) { exception_state.ThrowDOMException( kIndexSizeError, "length of real array (" + - String::Number(real_length) + + String::Number(real.size()) + ") and length of imaginary array (" + - String::Number(imag_length) + ") must match."); + String::Number(imag.size()) + ") must match."); return nullptr; } PeriodicWave* periodic_wave = new PeriodicWave(context.sampleRate()); - periodic_wave->CreateBandLimitedTables(real, imag, real_length, + periodic_wave->CreateBandLimitedTables(real.Data(), imag.Data(), real.size(), disable_normalization); return periodic_wave; } -PeriodicWave* PeriodicWave::Create(BaseAudioContext& context, - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, - bool disable_normalization, - ExceptionState& exception_state) { - DCHECK(IsMainThread()); - - return Create(context, real.View()->length(), real.View()->Data(), - imag.View()->length(), imag.View()->Data(), - disable_normalization, exception_state); -} - PeriodicWave* PeriodicWave::Create(BaseAudioContext* context, const PeriodicWaveOptions& options, ExceptionState& exception_state) { - bool normalize = options.hasDisableNormalization() - ? options.disableNormalization() - : false; + bool normalize = options.disableNormalization(); Vector<float> real_coef; Vector<float> imag_coef; @@ -122,8 +106,7 @@ imag_coef[1] = 1; } - return Create(*context, real_coef.size(), real_coef.Data(), imag_coef.size(), - imag_coef.Data(), normalize, exception_state); + return Create(*context, real_coef, imag_coef, normalize, exception_state); } PeriodicWave* PeriodicWave::CreateSine(float sample_rate) {
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h index 1e44125..44404f5 100644 --- a/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h +++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWave.h
@@ -56,16 +56,8 @@ // Creates an arbitrary periodic wave given the frequency components (Fourier // coefficients). static PeriodicWave* Create(BaseAudioContext&, - size_t real_length, - const float* real, - size_t imag_length, - const float* imag, - bool normalize, - ExceptionState&); - - static PeriodicWave* Create(BaseAudioContext&, - NotShared<DOMFloat32Array> real, - NotShared<DOMFloat32Array> imag, + const Vector<float>& real, + const Vector<float>& imag, bool normalize, ExceptionState&);
diff --git a/third_party/WebKit/Source/modules/webaudio/PeriodicWaveConstraints.idl b/third_party/WebKit/Source/modules/webaudio/PeriodicWaveConstraints.idl index 950ce166..6c8e6890 100644 --- a/third_party/WebKit/Source/modules/webaudio/PeriodicWaveConstraints.idl +++ b/third_party/WebKit/Source/modules/webaudio/PeriodicWaveConstraints.idl
@@ -4,5 +4,5 @@ // See https://webaudio.github.io/web-audio-api/#periodicwaveconstraints dictionary PeriodicWaveConstraints { - boolean disableNormalization; + boolean disableNormalization = false; };
diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp index b342558b..968c42ef 100644 --- a/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerNode.cpp
@@ -168,8 +168,7 @@ node->HandleChannelOptions(options, exception_state); - if (options.hasPan()) - node->pan()->setValue(options.pan()); + node->pan()->setValue(options.pan()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/StereoPannerOptions.idl b/third_party/WebKit/Source/modules/webaudio/StereoPannerOptions.idl index b8c11eb..87713a0 100644 --- a/third_party/WebKit/Source/modules/webaudio/StereoPannerOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/StereoPannerOptions.idl
@@ -4,5 +4,5 @@ // See https://webaudio.github.io/web-audio-api/#stereopanneroptions dictionary StereoPannerOptions : AudioNodeOptions { - float pan; + float pan = 0; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp index 994ef204..0776060 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperNode.cpp
@@ -66,8 +66,8 @@ if (options.hasCurve()) node->setCurve(options.curve(), exception_state); - if (options.hasOversample()) - node->setOversample(options.oversample()); + + node->setOversample(options.oversample()); return node; }
diff --git a/third_party/WebKit/Source/modules/webaudio/WaveShaperOptions.idl b/third_party/WebKit/Source/modules/webaudio/WaveShaperOptions.idl index c671a57c..c004b3f 100644 --- a/third_party/WebKit/Source/modules/webaudio/WaveShaperOptions.idl +++ b/third_party/WebKit/Source/modules/webaudio/WaveShaperOptions.idl
@@ -5,5 +5,5 @@ // https://webaudio.github.io/web-audio-api/#waveshaperoptions dictionary WaveShaperOptions : AudioNodeOptions { sequence<float> curve; - OverSampleType oversample; + OverSampleType oversample = "none"; }; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp index d3d020d4..3d554f9a 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -1195,7 +1195,8 @@ GetTextureSourceSubRectangle(width, height), 0); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, +void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLsizei width, @@ -1212,13 +1213,15 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLImageElement(kTexImage2D, target, level, internalformat, + TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), + kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, image, GetTextureSourceSubRectangle(width, height), 1, unpack_image_height_, exception_state); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, +void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLsizei width, @@ -1235,12 +1238,15 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } + TexImageHelperHTMLCanvasElement( - kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, canvas, + execution_context->GetSecurityOrigin(), kTexImage2D, target, level, + internalformat, format, type, 0, 0, 0, canvas, GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, +void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLsizei width, @@ -1257,8 +1263,10 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } + TexImageHelperHTMLVideoElement( - kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, video, + execution_context->GetSecurityOrigin(), kTexImage2D, target, level, + internalformat, format, type, 0, 0, 0, video, GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); } @@ -1302,7 +1310,8 @@ type, image_data); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, +void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLenum format, @@ -1316,11 +1325,14 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, - type, image, exception_state); + + WebGLRenderingContextBase::texImage2D(execution_context, target, level, + internalformat, format, type, image, + exception_state); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, +void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLenum format, @@ -1334,11 +1346,14 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, - type, canvas, exception_state); + + WebGLRenderingContextBase::texImage2D(execution_context, target, level, + internalformat, format, type, canvas, + exception_state); } -void WebGL2RenderingContextBase::texImage2D(GLenum target, +void WebGL2RenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLenum format, @@ -1352,8 +1367,10 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - WebGLRenderingContextBase::texImage2D(target, level, internalformat, format, - type, video, exception_state); + + WebGLRenderingContextBase::texImage2D(execution_context, target, level, + internalformat, format, type, video, + exception_state); } void WebGL2RenderingContextBase::texImage2D(GLenum target, @@ -1441,6 +1458,7 @@ } void WebGL2RenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1458,13 +1476,15 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLImageElement(kTexSubImage2D, target, level, 0, format, type, - xoffset, yoffset, 0, image, - GetTextureSourceSubRectangle(width, height), 1, - 0, exception_state); + + TexImageHelperHTMLImageElement( + execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, + format, type, xoffset, yoffset, 0, image, + GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); } void WebGL2RenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1482,13 +1502,15 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLCanvasElement(kTexSubImage2D, target, level, 0, format, - type, xoffset, yoffset, 0, canvas, - GetTextureSourceSubRectangle(width, height), - 1, 0, exception_state); + + TexImageHelperHTMLCanvasElement( + execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, + format, type, xoffset, yoffset, 0, canvas, + GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); } void WebGL2RenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1506,10 +1528,11 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLVideoElement(kTexSubImage2D, target, level, 0, format, type, - xoffset, yoffset, 0, video, - GetTextureSourceSubRectangle(width, height), 1, - 0, exception_state); + + TexImageHelperHTMLVideoElement( + execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, + format, type, xoffset, yoffset, 0, video, + GetTextureSourceSubRectangle(width, height), 1, 0, exception_state); } void WebGL2RenderingContextBase::texSubImage2D( @@ -1556,6 +1579,7 @@ } void WebGL2RenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1571,11 +1595,14 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - WebGLRenderingContextBase::texSubImage2D( - target, level, xoffset, yoffset, format, type, image, exception_state); + + WebGLRenderingContextBase::texSubImage2D(execution_context, target, level, + xoffset, yoffset, format, type, + image, exception_state); } void WebGL2RenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1591,11 +1618,14 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - WebGLRenderingContextBase::texSubImage2D( - target, level, xoffset, yoffset, format, type, canvas, exception_state); + + WebGLRenderingContextBase::texSubImage2D(execution_context, target, level, + xoffset, yoffset, format, type, + canvas, exception_state); } void WebGL2RenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1604,8 +1634,9 @@ GLenum type, HTMLVideoElement* video, ExceptionState& exception_state) { - WebGLRenderingContextBase::texSubImage2D( - target, level, xoffset, yoffset, format, type, video, exception_state); + WebGLRenderingContextBase::texSubImage2D(execution_context, target, level, + xoffset, yoffset, format, type, + video, exception_state); } void WebGL2RenderingContextBase::texSubImage2D( @@ -1748,7 +1779,8 @@ unpack_image_height_); } -void WebGL2RenderingContextBase::texImage3D(GLenum target, +void WebGL2RenderingContextBase::texImage3D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLsizei width, @@ -1766,13 +1798,16 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLImageElement(kTexImage3D, target, level, internalformat, + + TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), + kTexImage3D, target, level, internalformat, format, type, 0, 0, 0, image, GetTextureSourceSubRectangle(width, height), depth, unpack_image_height_, exception_state); } -void WebGL2RenderingContextBase::texImage3D(GLenum target, +void WebGL2RenderingContextBase::texImage3D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLsizei width, @@ -1790,13 +1825,16 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLCanvasElement(kTexImage3D, target, level, internalformat, + + TexImageHelperHTMLCanvasElement(execution_context->GetSecurityOrigin(), + kTexImage3D, target, level, internalformat, format, type, 0, 0, 0, canvas, GetTextureSourceSubRectangle(width, height), depth, unpack_image_height_, exception_state); } -void WebGL2RenderingContextBase::texImage3D(GLenum target, +void WebGL2RenderingContextBase::texImage3D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLsizei width, @@ -1814,7 +1852,9 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLVideoElement(kTexImage3D, target, level, internalformat, + + TexImageHelperHTMLVideoElement(execution_context->GetSecurityOrigin(), + kTexImage3D, target, level, internalformat, format, type, 0, 0, 0, video, GetTextureSourceSubRectangle(width, height), depth, unpack_image_height_, exception_state); @@ -1927,6 +1967,7 @@ } void WebGL2RenderingContextBase::texSubImage3D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1946,13 +1987,16 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLImageElement(kTexSubImage3D, target, level, 0, format, type, + + TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), + kTexSubImage3D, target, level, 0, format, type, xoffset, yoffset, zoffset, image, GetTextureSourceSubRectangle(width, height), depth, unpack_image_height_, exception_state); } void WebGL2RenderingContextBase::texSubImage3D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1972,13 +2016,16 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLCanvasElement(kTexSubImage3D, target, level, 0, format, + + TexImageHelperHTMLCanvasElement(execution_context->GetSecurityOrigin(), + kTexSubImage3D, target, level, 0, format, type, xoffset, yoffset, zoffset, canvas, GetTextureSourceSubRectangle(width, height), depth, unpack_image_height_, exception_state); } void WebGL2RenderingContextBase::texSubImage3D( + ExecutionContext* execution_context, GLenum target, GLint level, GLint xoffset, @@ -1998,7 +2045,9 @@ "a buffer is bound to PIXEL_UNPACK_BUFFER"); return; } - TexImageHelperHTMLVideoElement(kTexSubImage3D, target, level, 0, format, type, + + TexImageHelperHTMLVideoElement(execution_context->GetSecurityOrigin(), + kTexSubImage3D, target, level, 0, format, type, xoffset, yoffset, zoffset, video, GetTextureSourceSubRectangle(width, height), depth, unpack_image_height_, exception_state);
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h index 085bc48..f7a951c 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
@@ -115,7 +115,8 @@ GLenum, GLenum, ImageData*); - void texImage2D(GLenum, + void texImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLsizei, @@ -125,7 +126,8 @@ GLenum, HTMLImageElement*, ExceptionState&); - void texImage2D(GLenum, + void texImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLsizei, @@ -135,7 +137,8 @@ GLenum, HTMLCanvasElement*, ExceptionState&); - void texImage2D(GLenum, + void texImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLsizei, @@ -184,7 +187,8 @@ GLenum, GLenum, ImageData*); - void texSubImage2D(GLenum, + void texSubImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -194,7 +198,8 @@ GLenum, HTMLImageElement*, ExceptionState&); - void texSubImage2D(GLenum, + void texSubImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -204,7 +209,8 @@ GLenum, HTMLCanvasElement*, ExceptionState&); - void texSubImage2D(GLenum, + void texSubImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -239,21 +245,24 @@ // base class. This is because the above tex{Sub}Image2D() hides the name // from base class. void texImage2D(GLenum, GLint, GLint, GLenum, GLenum, ImageData*); - void texImage2D(GLenum, + void texImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLenum, GLenum, HTMLImageElement*, ExceptionState&); - void texImage2D(GLenum, + void texImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLenum, GLenum, HTMLCanvasElement*, ExceptionState&); - void texImage2D(GLenum, + void texImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLenum, @@ -268,7 +277,8 @@ ImageBitmap*, ExceptionState&); void texSubImage2D(GLenum, GLint, GLint, GLint, GLenum, GLenum, ImageData*); - void texSubImage2D(GLenum, + void texSubImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -276,7 +286,8 @@ GLenum, HTMLImageElement*, ExceptionState&); - void texSubImage2D(GLenum, + void texSubImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -284,7 +295,8 @@ GLenum, HTMLCanvasElement*, ExceptionState&); - void texSubImage2D(GLenum, + void texSubImage2D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -334,7 +346,8 @@ GLenum, GLenum, ImageData*); - void texImage3D(GLenum, + void texImage3D(ExecutionContext*, + GLenum, GLint, GLint, GLsizei, @@ -345,7 +358,8 @@ GLenum, HTMLImageElement*, ExceptionState&); - void texImage3D(GLenum, + void texImage3D(ExecutionContext*, + GLenum, GLint, GLint, GLsizei, @@ -356,7 +370,8 @@ GLenum, HTMLCanvasElement*, ExceptionState&); - void texImage3D(GLenum, + void texImage3D(ExecutionContext*, + GLenum, GLint, GLint, GLsizei, @@ -422,7 +437,8 @@ GLenum, GLenum, ImageData*); - void texSubImage3D(GLenum, + void texSubImage3D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -434,7 +450,8 @@ GLenum, HTMLImageElement*, ExceptionState&); - void texSubImage3D(GLenum, + void texSubImage3D(ExecutionContext*, + GLenum, GLint, GLint, GLint, @@ -446,7 +463,8 @@ GLenum, HTMLCanvasElement*, ExceptionState&); - void texSubImage3D(GLenum, + void texSubImage3D(ExecutionContext*, + GLenum, GLint, GLint, GLint,
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl index 75fe60be..8e793999 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl +++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
@@ -296,33 +296,33 @@ /* Texture objects */ void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLintptr offset); void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ImageData data); - [RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLImageElement image); - [RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLCanvasElement canvas); - [RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLVideoElement video); + [CallWith=ExecutionContext, RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLImageElement image); + [CallWith=ExecutionContext, RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLCanvasElement canvas); + [CallWith=ExecutionContext,RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, HTMLVideoElement video); [RaisesException] void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ImageBitmap bitmap); void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView srcData, GLuint srcOffset); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLintptr offset); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ImageData data); - [RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLImageElement image); - [RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLCanvasElement canvas); - [RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLVideoElement video); + [CallWith=ExecutionContext, RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLImageElement image); + [CallWith=ExecutionContext, RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLCanvasElement canvas); + [CallWith=ExecutionContext, RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, HTMLVideoElement video); [RaisesException] void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ImageBitmap bitmap); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, ArrayBufferView srcData, GLuint srcOffset); void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLintptr offset); void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ImageData data); - [RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLImageElement image); - [RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLCanvasElement canvas); - [RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLVideoElement video); + [CallWith=ExecutionContext, RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLImageElement image); + [CallWith=ExecutionContext, RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLCanvasElement canvas); + [CallWith=ExecutionContext, RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, HTMLVideoElement video); [RaisesException] void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ImageBitmap bitmap); void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels); void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ArrayBufferView pixels, GLuint srcOffset); void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLintptr offset); void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ImageData data); - [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLImageElement image); - [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLCanvasElement canvas); - [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLVideoElement video); + [CallWith=ExecutionContext, RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLImageElement image); + [CallWith=ExecutionContext, RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLCanvasElement canvas); + [CallWith=ExecutionContext, RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLVideoElement video); [RaisesException] void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ImageBitmap bitmap); void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ArrayBufferView pixels, optional GLuint srcOffset = 0);
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index f0449e4..4a8e117a 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -4853,6 +4853,7 @@ } void WebGLRenderingContextBase::TexImageHelperHTMLImageElement( + SecurityOrigin* security_origin, TexImageFunctionID function_id, GLenum target, GLint level, @@ -4870,7 +4871,9 @@ const char* func_name = GetTexImageFunctionName(function_id); if (isContextLost()) return; - if (!ValidateHTMLImageElement(func_name, image, exception_state)) + + if (!ValidateHTMLImageElement(security_origin, func_name, image, + exception_state)) return; if (!ValidateTexImageBinding(func_name, function_id, target)) return; @@ -4903,14 +4906,16 @@ unpack_image_height); } -void WebGLRenderingContextBase::texImage2D(GLenum target, +void WebGLRenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLImageElement* image, ExceptionState& exception_state) { - TexImageHelperHTMLImageElement(kTexImage2D, target, level, internalformat, + TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), + kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, image, SentinelEmptyRect(), 1, 0, exception_state); } @@ -5085,6 +5090,7 @@ } void WebGLRenderingContextBase::TexImageHelperHTMLCanvasElement( + SecurityOrigin* security_origin, TexImageFunctionID function_id, GLenum target, GLint level, @@ -5102,7 +5108,9 @@ const char* func_name = GetTexImageFunctionName(function_id); if (isContextLost()) return; - if (!ValidateHTMLCanvasElement(func_name, canvas, exception_state)) + + if (!ValidateHTMLCanvasElement(security_origin, func_name, canvas, + exception_state)) return; WebGLTexture* texture = ValidateTexImageBinding(func_name, function_id, target); @@ -5182,7 +5190,8 @@ } } -void WebGLRenderingContextBase::texImage2D(GLenum target, +void WebGLRenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLenum format, @@ -5190,7 +5199,8 @@ HTMLCanvasElement* canvas, ExceptionState& exception_state) { TexImageHelperHTMLCanvasElement( - kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, canvas, + execution_context->GetSecurityOrigin(), kTexImage2D, target, level, + internalformat, format, type, 0, 0, 0, canvas, GetTextureSourceSize(canvas), 1, 0, exception_state); } @@ -5208,6 +5218,7 @@ } void WebGLRenderingContextBase::TexImageHelperHTMLVideoElement( + SecurityOrigin* security_origin, TexImageFunctionID function_id, GLenum target, GLint level, @@ -5225,7 +5236,9 @@ const char* func_name = GetTexImageFunctionName(function_id); if (isContextLost()) return; - if (!ValidateHTMLVideoElement(func_name, video, exception_state)) + + if (!ValidateHTMLVideoElement(security_origin, func_name, video, + exception_state)) return; WebGLTexture* texture = ValidateTexImageBinding(func_name, function_id, target); @@ -5350,14 +5363,16 @@ IntPoint(xoffset, yoffset), source_sub_rect); } -void WebGLRenderingContextBase::texImage2D(GLenum target, +void WebGLRenderingContextBase::texImage2D(ExecutionContext* execution_context, + GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLVideoElement* video, ExceptionState& exception_state) { - TexImageHelperHTMLVideoElement(kTexImage2D, target, level, internalformat, + TexImageHelperHTMLVideoElement(execution_context->GetSecurityOrigin(), + kTexImage2D, target, level, internalformat, format, type, 0, 0, 0, video, SentinelEmptyRect(), 1, 0, exception_state); } @@ -5603,41 +5618,50 @@ 0); } -void WebGLRenderingContextBase::texSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLenum format, - GLenum type, - HTMLImageElement* image, - ExceptionState& exception_state) { - TexImageHelperHTMLImageElement(kTexSubImage2D, target, level, 0, format, type, +void WebGLRenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLenum format, + GLenum type, + HTMLImageElement* image, + ExceptionState& exception_state) { + TexImageHelperHTMLImageElement(execution_context->GetSecurityOrigin(), + kTexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, image, SentinelEmptyRect(), 1, 0, exception_state); } -void WebGLRenderingContextBase::texSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLenum format, - GLenum type, - HTMLCanvasElement* canvas, - ExceptionState& exception_state) { +void WebGLRenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLenum format, + GLenum type, + HTMLCanvasElement* canvas, + ExceptionState& exception_state) { TexImageHelperHTMLCanvasElement( - kTexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, - canvas, GetTextureSourceSize(canvas), 1, 0, exception_state); + execution_context->GetSecurityOrigin(), kTexSubImage2D, target, level, 0, + format, type, xoffset, yoffset, 0, canvas, GetTextureSourceSize(canvas), + 1, 0, exception_state); } -void WebGLRenderingContextBase::texSubImage2D(GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLenum format, - GLenum type, - HTMLVideoElement* video, - ExceptionState& exception_state) { - TexImageHelperHTMLVideoElement(kTexSubImage2D, target, level, 0, format, type, +void WebGLRenderingContextBase::texSubImage2D( + ExecutionContext* execution_context, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLenum format, + GLenum type, + HTMLVideoElement* video, + ExceptionState& exception_state) { + TexImageHelperHTMLVideoElement(execution_context->GetSecurityOrigin(), + kTexSubImage2D, target, level, 0, format, type, xoffset, yoffset, 0, video, SentinelEmptyRect(), 1, 0, exception_state); } @@ -7314,6 +7338,7 @@ } bool WebGLRenderingContextBase::ValidateHTMLImageElement( + SecurityOrigin* security_origin, const char* function_name, HTMLImageElement* image, ExceptionState& exception_state) { @@ -7327,7 +7352,7 @@ return false; } - if (WouldTaintOrigin(image)) { + if (WouldTaintOrigin(image, security_origin)) { exception_state.ThrowSecurityError("The cross-origin image at " + url.ElidedString() + " may not be loaded."); @@ -7337,6 +7362,7 @@ } bool WebGLRenderingContextBase::ValidateHTMLCanvasElement( + SecurityOrigin* security_origin, const char* function_name, HTMLCanvasElement* canvas, ExceptionState& exception_state) { @@ -7344,7 +7370,8 @@ SynthesizeGLError(GL_INVALID_VALUE, function_name, "no canvas"); return false; } - if (WouldTaintOrigin(canvas)) { + + if (WouldTaintOrigin(canvas, security_origin)) { exception_state.ThrowSecurityError("Tainted canvases may not be loaded."); return false; } @@ -7352,6 +7379,7 @@ } bool WebGLRenderingContextBase::ValidateHTMLVideoElement( + SecurityOrigin* security_origin, const char* function_name, HTMLVideoElement* video, ExceptionState& exception_state) { @@ -7360,7 +7388,7 @@ return false; } - if (WouldTaintOrigin(video)) { + if (WouldTaintOrigin(video, security_origin)) { exception_state.ThrowSecurityError( "The video element contains cross-origin data, and may not be loaded."); return false;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h index c6574a3..3a7af8e 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -355,21 +355,24 @@ GLenum format, GLenum type, ImageData*); - void texImage2D(GLenum target, + void texImage2D(ExecutionContext*, + GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLImageElement*, ExceptionState&); - void texImage2D(GLenum target, + void texImage2D(ExecutionContext*, + GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLCanvasElement*, ExceptionState&); - void texImage2D(GLenum target, + void texImage2D(ExecutionContext*, + GLenum target, GLint level, GLint internalformat, GLenum format, @@ -403,7 +406,8 @@ GLenum format, GLenum type, ImageData*); - void texSubImage2D(GLenum target, + void texSubImage2D(ExecutionContext*, + GLenum target, GLint level, GLint xoffset, GLint yoffset, @@ -411,7 +415,8 @@ GLenum type, HTMLImageElement*, ExceptionState&); - void texSubImage2D(GLenum target, + void texSubImage2D(ExecutionContext*, + GLenum target, GLint level, GLint xoffset, GLint yoffset, @@ -419,7 +424,8 @@ GLenum type, HTMLCanvasElement*, ExceptionState&); - void texSubImage2D(GLenum target, + void texSubImage2D(ExecutionContext*, + GLenum target, GLint level, GLint xoffset, GLint yoffset, @@ -1150,7 +1156,7 @@ WebGLTexture* ValidateTextureBinding(const char* function_name, GLenum target); - // Wrapper function for validateTexture2D(3D)Binding, used in texImageHelper + // Wrapper function for validateTexture2D(3D)Binding, used in TexImageHelper // functions. virtual WebGLTexture* ValidateTexImageBinding(const char*, TexImageFunctionID, @@ -1415,19 +1421,23 @@ // Helper function for tex{Sub}Image2D to make sure image is ready and // wouldn't taint Origin. - bool ValidateHTMLImageElement(const char* function_name, + + bool ValidateHTMLImageElement(SecurityOrigin*, + const char* function_name, HTMLImageElement*, ExceptionState&); // Helper function for tex{Sub}Image2D to make sure canvas is ready and // wouldn't taint Origin. - bool ValidateHTMLCanvasElement(const char* function_name, + bool ValidateHTMLCanvasElement(SecurityOrigin*, + const char* function_name, HTMLCanvasElement*, ExceptionState&); // Helper function for tex{Sub}Image2D to make sure video is ready wouldn't // taint Origin. - bool ValidateHTMLVideoElement(const char* function_name, + bool ValidateHTMLVideoElement(SecurityOrigin*, + const char* function_name, HTMLVideoElement*, ExceptionState&); @@ -1563,7 +1573,9 @@ ImageData*, const IntRect&, GLint); - void TexImageHelperHTMLImageElement(TexImageFunctionID, + + void TexImageHelperHTMLImageElement(SecurityOrigin*, + TexImageFunctionID, GLenum, GLint, GLint, @@ -1577,7 +1589,9 @@ GLsizei, GLint, ExceptionState&); - void TexImageHelperHTMLCanvasElement(TexImageFunctionID, + + void TexImageHelperHTMLCanvasElement(SecurityOrigin*, + TexImageFunctionID, GLenum, GLint, GLint, @@ -1591,7 +1605,9 @@ GLsizei, GLint, ExceptionState&); - void TexImageHelperHTMLVideoElement(TexImageFunctionID, + + void TexImageHelperHTMLVideoElement(SecurityOrigin*, + TexImageFunctionID, GLenum, GLint, GLint,
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl index 892a94e..7047ff4 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl
@@ -621,13 +621,13 @@ void texImage2D( GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, ImageData pixels); - [RaisesException] void texImage2D( + [CallWith=ExecutionContext, RaisesException] void texImage2D( GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLImageElement image); - [RaisesException] void texImage2D( + [CallWith=ExecutionContext, RaisesException] void texImage2D( GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLCanvasElement canvas); - [RaisesException] void texImage2D( + [CallWith=ExecutionContext, RaisesException] void texImage2D( GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type, HTMLVideoElement video); [RaisesException] void texImage2D( @@ -641,13 +641,13 @@ void texSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, ImageData pixels); - [RaisesException] void texSubImage2D( + [CallWith=ExecutionContext, RaisesException] void texSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLImageElement image); - [RaisesException] void texSubImage2D( + [CallWith=ExecutionContext, RaisesException] void texSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLCanvasElement canvas); - [RaisesException] void texSubImage2D( + [CallWith=ExecutionContext, RaisesException] void texSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLenum format, GLenum type, HTMLVideoElement video); [RaisesException] void texSubImage2D(
diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp index afd588d..a1781f5 100644 --- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp +++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp
@@ -70,33 +70,89 @@ return data_->GetAsSkData().release(); } -bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, +static void doColorSpaceXform(const SkImageInfo& dst_info, + void* pixels, + size_t row_bytes, + SkColorSpace* src_color_space) { + TRACE_EVENT0("blink", "DecodingImageGenerator::getPixels - apply xform"); + std::unique_ptr<SkColorSpaceXform> xform = + SkColorSpaceXform::New(src_color_space, dst_info.colorSpace()); + + uint32_t* row = reinterpret_cast<uint32_t*>(pixels); + for (int y = 0; y < dst_info.height(); y++) { + SkColorSpaceXform::ColorFormat format = + SkColorSpaceXform::kRGBA_8888_ColorFormat; + if (kN32_SkColorType == kBGRA_8888_SkColorType) { + format = SkColorSpaceXform::kBGRA_8888_ColorFormat; + } + SkAlphaType alpha_type = + dst_info.isOpaque() ? kOpaque_SkAlphaType : kUnpremul_SkAlphaType; + bool xformed = + xform->apply(format, row, format, row, dst_info.width(), alpha_type); + DCHECK(xformed); + + // To be compatible with dst space blending, premultiply in the dst space. + if (kPremul_SkAlphaType == dst_info.alphaType()) { + for (int x = 0; x < dst_info.width(); x++) { + row[x] = + SkPreMultiplyARGB(SkGetPackedA32(row[x]), SkGetPackedR32(row[x]), + SkGetPackedG32(row[x]), SkGetPackedB32(row[x])); + } + } + + row = reinterpret_cast<uint32_t*>( + (reinterpret_cast<uint8_t*>(row) + row_bytes)); + } +} + +bool DecodingImageGenerator::onGetPixels(const SkImageInfo& dst_info, void* pixels, size_t row_bytes, - SkPMColor table[], - int* table_count) { + SkPMColor*, + int*) { TRACE_EVENT1("blink", "DecodingImageGenerator::getPixels", "frame index", static_cast<int>(frame_index_)); // Implementation doesn't support scaling yet, so make sure we're not given a // different size. - if (info.width() != getInfo().width() || info.height() != getInfo().height()) + if (dst_info.dimensions() != getInfo().dimensions()) { return false; + } - if (info.colorType() != getInfo().colorType()) { - // blink::ImageFrame may have changed the owning SkBitmap to - // kOpaque_SkAlphaType after fully decoding the image frame, so if we see a - // request for opaque, that is ok even if our initial alpha type was not - // opaque. + if (dst_info.colorType() != kN32_SkColorType) { return false; } + // Skip the check for alphaType. blink::ImageFrame may have changed the + // owning SkBitmap to kOpaque_SkAlphaType after fully decoding the image + // frame, so if we see a request for opaque, that is ok even if our initial + // alpha type was not opaque. + + // Pass decodeColorSpace to the decoder. That is what we can expect the + // output to be. + SkColorSpace* decode_color_space = getInfo().colorSpace(); + SkImageInfo decode_info = + dst_info.makeColorSpace(sk_ref_sp(decode_color_space)); + + const bool needs_color_xform = + decode_color_space && dst_info.colorSpace() && + !SkColorSpace::Equals(decode_color_space, dst_info.colorSpace()); + ImageDecoder::AlphaOption alpha_option = ImageDecoder::kAlphaPremultiplied; + if (needs_color_xform && !decode_info.isOpaque()) { + alpha_option = ImageDecoder::kAlphaNotPremultiplied; + decode_info = decode_info.makeAlphaType(kUnpremul_SkAlphaType); + } + PlatformInstrumentation::WillDecodeLazyPixelRef(uniqueID()); bool decoded = frame_generator_->DecodeAndScale( - data_.Get(), all_data_received_, frame_index_, getInfo(), pixels, - row_bytes); + data_.Get(), all_data_received_, frame_index_, decode_info, pixels, + row_bytes, alpha_option); PlatformInstrumentation::DidDecodeLazyPixelRef(); + if (decoded && needs_color_xform) { + doColorSpaceXform(dst_info, pixels, row_bytes, decode_color_space); + } + return decoded; }
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp b/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp index 259f2b6..bd1a528 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp +++ b/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp
@@ -59,12 +59,13 @@ bool ImageDecodingStore::LockDecoder(const ImageFrameGenerator* generator, const SkISize& scaled_size, + ImageDecoder::AlphaOption alpha_option, ImageDecoder** decoder) { DCHECK(decoder); MutexLocker lock(mutex_); DecoderCacheMap::iterator iter = decoder_cache_map_.Find( - DecoderCacheEntry::MakeCacheKey(generator, scaled_size)); + DecoderCacheEntry::MakeCacheKey(generator, scaled_size, alpha_option)); if (iter == decoder_cache_map_.end()) return false;
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.h b/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.h index dce492d..87e105c 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.h +++ b/third_party/WebKit/Source/platform/graphics/ImageDecodingStore.h
@@ -30,6 +30,7 @@ #include "SkSize.h" #include "SkTypes.h" #include "platform/PlatformExport.h" +#include "platform/graphics/ImageFrameGenerator.h" #include "platform/graphics/skia/SkSizeHash.h" #include "platform/image-decoders/ImageDecoder.h" #include "platform/wtf/DoublyLinkedList.h" @@ -40,7 +41,171 @@ namespace blink { -class ImageFrameGenerator; +// Decoder cache entry is identified by: +// 1. Pointer to ImageFrameGenerator. +// 2. Size of the image. +// 3. ImageDecoder::AlphaOption +struct DecoderCacheKey { + const blink::ImageFrameGenerator* gen_; + SkISize size_; + blink::ImageDecoder::AlphaOption alpha_option_; + + DecoderCacheKey() + : gen_(nullptr), + size_(SkISize::Make(0, 0)), + alpha_option_(static_cast<blink::ImageDecoder::AlphaOption>(0)) {} +}; + +static inline bool operator==(const DecoderCacheKey& a, + const DecoderCacheKey& b) { + return a.gen_ == b.gen_ && a.size_ == b.size_ && + a.alpha_option_ == b.alpha_option_; +} + +static inline bool operator!=(const DecoderCacheKey& a, + const DecoderCacheKey& b) { + return !(a == b); +} + +// Base class for all cache entries. +class CacheEntry : public DoublyLinkedListNode<CacheEntry> { + USING_FAST_MALLOC(CacheEntry); + WTF_MAKE_NONCOPYABLE(CacheEntry); + friend class WTF::DoublyLinkedListNode<CacheEntry>; + + public: + enum CacheType { + kTypeDecoder, + }; + + CacheEntry(const ImageFrameGenerator* generator, int use_count) + : generator_(generator), use_count_(use_count), prev_(0), next_(0) {} + + virtual ~CacheEntry() { DCHECK(!use_count_); } + + const ImageFrameGenerator* Generator() const { return generator_; } + int UseCount() const { return use_count_; } + void IncrementUseCount() { ++use_count_; } + void DecrementUseCount() { + --use_count_; + DCHECK_GE(use_count_, 0); + } + + // FIXME: getSafeSize() returns the size in bytes truncated to a 32-bit + // integer. Find a way to get the size in 64-bits. + virtual size_t MemoryUsageInBytes() const = 0; + virtual CacheType GetType() const = 0; + + protected: + const ImageFrameGenerator* generator_; + int use_count_; + + private: + CacheEntry* prev_; + CacheEntry* next_; +}; + +class DecoderCacheEntry final : public CacheEntry { + public: + static std::unique_ptr<DecoderCacheEntry> Create( + const ImageFrameGenerator* generator, + std::unique_ptr<ImageDecoder> decoder) { + return WTF::WrapUnique( + new DecoderCacheEntry(generator, 0, std::move(decoder))); + } + + size_t MemoryUsageInBytes() const override { + return size_.width() * size_.height() * 4; + } + CacheType GetType() const override { return kTypeDecoder; } + + static DecoderCacheKey MakeCacheKey(const ImageFrameGenerator* generator, + const SkISize& size, + ImageDecoder::AlphaOption alpha_option) { + DecoderCacheKey key; + key.gen_ = generator; + key.size_ = size; + key.alpha_option_ = alpha_option; + return key; + } + static DecoderCacheKey MakeCacheKey(const ImageFrameGenerator* generator, + const ImageDecoder* decoder) { + return MakeCacheKey(generator, + SkISize::Make(decoder->DecodedSize().Width(), + decoder->DecodedSize().Height()), + decoder->GetAlphaOption()); + } + DecoderCacheKey CacheKey() const { + return MakeCacheKey(generator_, size_, alpha_option_); + } + ImageDecoder* CachedDecoder() const { return cached_decoder_.get(); } + + private: + DecoderCacheEntry(const ImageFrameGenerator* generator, + int count, + std::unique_ptr<ImageDecoder> decoder) + : CacheEntry(generator, count), + cached_decoder_(std::move(decoder)), + size_(SkISize::Make(cached_decoder_->DecodedSize().Width(), + cached_decoder_->DecodedSize().Height())), + alpha_option_(cached_decoder_->GetAlphaOption()) {} + + std::unique_ptr<ImageDecoder> cached_decoder_; + SkISize size_; + ImageDecoder::AlphaOption alpha_option_; +}; + +} // namespace blink + +namespace WTF { + +template <> +struct DefaultHash<blink::DecoderCacheKey> { + STATIC_ONLY(DefaultHash); + struct Hash { + STATIC_ONLY(Hash); + static unsigned GetHash(const blink::DecoderCacheKey& p) { + return HashInts( + HashInts(DefaultHash<blink::ImageFrameGenerator*>::Hash::GetHash( + const_cast<blink::ImageFrameGenerator*>(p.gen_)), + DefaultHash<SkISize>::Hash::GetHash(p.size_)), + DefaultHash<uint8_t>::Hash::GetHash( + static_cast<uint8_t>(p.alpha_option_))); + } + static bool Equal(const blink::DecoderCacheKey& a, + const blink::DecoderCacheKey& b) { + return a.gen_ == b.gen_ && a.size_ == b.size_ && + a.alpha_option_ == b.alpha_option_; + } + static const bool safe_to_compare_to_empty_or_deleted = true; + }; +}; + +template <> +struct HashTraits<blink::DecoderCacheKey> + : GenericHashTraits<blink::DecoderCacheKey> { + STATIC_ONLY(HashTraits); + static const bool kEmptyValueIsZero = true; + static blink::DecoderCacheKey EmptyValue() { + return blink::DecoderCacheEntry::MakeCacheKey( + nullptr, SkISize::Make(0, 0), + static_cast<blink::ImageDecoder::AlphaOption>(0)); + } + static void ConstructDeletedValue(blink::DecoderCacheKey& slot, bool) { + slot = blink::DecoderCacheEntry::MakeCacheKey( + nullptr, SkISize::Make(-1, -1), + static_cast<blink::ImageDecoder::AlphaOption>(-1)); + } + static bool IsDeletedValue(const blink::DecoderCacheKey& value) { + return !value.gen_ && value.size_ == SkISize::Make(-1, -1) && + value.alpha_option_ == + static_cast<blink::ImageDecoder::AlphaOption>(-1); + } +}; + +} // namespace WTF + +namespace blink { // FUNCTION // @@ -53,9 +218,9 @@ // // ImageFrameGenerator // This is a direct user of this cache. Responsible for generating bitmap -// images using an ImageDecoder. It contains encoded image data and is used to -// represent one image file. It is used to index image and decoder objects in -// the cache. +// images using an ImageDecoder. It contains encoded image data and is used +// to represent one image file. It is used to index image and decoder +// objects in the cache. // // THREAD SAFETY // @@ -74,10 +239,11 @@ static ImageDecodingStore& Instance(); // Accesses a cached decoder object. A decoder is indexed by origin - // (ImageFrameGenerator) and scaled size. Returns true if the cached object is - // found. + // (ImageFrameGenerator) and scaled size. Returns true if the cached object + // is found. bool LockDecoder(const ImageFrameGenerator*, const SkISize& scaled_size, + ImageDecoder::AlphaOption, ImageDecoder**); void UnlockDecoder(const ImageFrameGenerator*, const ImageDecoder*); void InsertDecoder(const ImageFrameGenerator*, std::unique_ptr<ImageDecoder>); @@ -93,89 +259,6 @@ int DecoderCacheEntries(); private: - // Decoder cache entry is identified by: - // 1. Pointer to ImageFrameGenerator. - // 2. Size of the image. - typedef std::pair<const ImageFrameGenerator*, SkISize> DecoderCacheKey; - - // Base class for all cache entries. - class CacheEntry : public DoublyLinkedListNode<CacheEntry> { - USING_FAST_MALLOC(CacheEntry); - WTF_MAKE_NONCOPYABLE(CacheEntry); - friend class WTF::DoublyLinkedListNode<CacheEntry>; - - public: - enum CacheType { - kTypeDecoder, - }; - - CacheEntry(const ImageFrameGenerator* generator, int use_count) - : generator_(generator), use_count_(use_count), prev_(0), next_(0) {} - - virtual ~CacheEntry() { DCHECK(!use_count_); } - - const ImageFrameGenerator* Generator() const { return generator_; } - int UseCount() const { return use_count_; } - void IncrementUseCount() { ++use_count_; } - void DecrementUseCount() { - --use_count_; - DCHECK_GE(use_count_, 0); - } - - // FIXME: getSafeSize() returns the size in bytes truncated to a 32-bit - // integer. Find a way to get the size in 64-bits. - virtual size_t MemoryUsageInBytes() const = 0; - virtual CacheType GetType() const = 0; - - protected: - const ImageFrameGenerator* generator_; - int use_count_; - - private: - CacheEntry* prev_; - CacheEntry* next_; - }; - - class DecoderCacheEntry final : public CacheEntry { - public: - static std::unique_ptr<DecoderCacheEntry> Create( - const ImageFrameGenerator* generator, - std::unique_ptr<ImageDecoder> decoder) { - return WTF::WrapUnique( - new DecoderCacheEntry(generator, 0, std::move(decoder))); - } - - DecoderCacheEntry(const ImageFrameGenerator* generator, - int count, - std::unique_ptr<ImageDecoder> decoder) - : CacheEntry(generator, count), - cached_decoder_(std::move(decoder)), - size_(SkISize::Make(cached_decoder_->DecodedSize().Width(), - cached_decoder_->DecodedSize().Height())) {} - - size_t MemoryUsageInBytes() const override { - return size_.width() * size_.height() * 4; - } - CacheType GetType() const override { return kTypeDecoder; } - - static DecoderCacheKey MakeCacheKey(const ImageFrameGenerator* generator, - const SkISize& size) { - return std::make_pair(generator, size); - } - static DecoderCacheKey MakeCacheKey(const ImageFrameGenerator* generator, - const ImageDecoder* decoder) { - return std::make_pair(generator, - SkISize::Make(decoder->DecodedSize().Width(), - decoder->DecodedSize().Height())); - } - DecoderCacheKey CacheKey() const { return MakeCacheKey(generator_, size_); } - ImageDecoder* CachedDecoder() const { return cached_decoder_.get(); } - - private: - std::unique_ptr<ImageDecoder> cached_decoder_; - SkISize size_; - }; - ImageDecodingStore(); void Prune();
diff --git a/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp index deb3d056..a56f0cf 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp
@@ -83,8 +83,9 @@ EXPECT_EQ(4u, ImageDecodingStore::Instance().MemoryUsageInBytes()); ImageDecoder* test_decoder; - EXPECT_TRUE(ImageDecodingStore::Instance().LockDecoder(generator_.Get(), size, - &test_decoder)); + EXPECT_TRUE(ImageDecodingStore::Instance().LockDecoder( + generator_.Get(), size, ImageDecoder::kAlphaPremultiplied, + &test_decoder)); EXPECT_TRUE(test_decoder); EXPECT_EQ(ref_decoder, test_decoder); ImageDecodingStore::Instance().UnlockDecoder(generator_.Get(), test_decoder); @@ -137,7 +138,8 @@ ImageDecoder* test_decoder; EXPECT_TRUE(ImageDecodingStore::Instance().LockDecoder( - generator_.Get(), SkISize::Make(2, 2), &test_decoder)); + generator_.Get(), SkISize::Make(2, 2), ImageDecoder::kAlphaPremultiplied, + &test_decoder)); EvictOneCache(); EvictOneCache(); @@ -162,15 +164,17 @@ EXPECT_EQ(4u, ImageDecodingStore::Instance().MemoryUsageInBytes()); ImageDecoder* test_decoder; - EXPECT_TRUE(ImageDecodingStore::Instance().LockDecoder(generator_.Get(), size, - &test_decoder)); + EXPECT_TRUE(ImageDecodingStore::Instance().LockDecoder( + generator_.Get(), size, ImageDecoder::kAlphaPremultiplied, + &test_decoder)); EXPECT_TRUE(test_decoder); EXPECT_EQ(ref_decoder, test_decoder); ImageDecodingStore::Instance().RemoveDecoder(generator_.Get(), test_decoder); EXPECT_FALSE(ImageDecodingStore::Instance().CacheEntries()); - EXPECT_FALSE(ImageDecodingStore::Instance().LockDecoder(generator_.Get(), - size, &test_decoder)); + EXPECT_FALSE(ImageDecodingStore::Instance().LockDecoder( + generator_.Get(), size, ImageDecoder::kAlphaPremultiplied, + &test_decoder)); } } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp index 1cbc8650..933023ee 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp +++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp
@@ -130,12 +130,14 @@ ImageDecodingStore::Instance().RemoveCacheIndexedByGenerator(this); } -bool ImageFrameGenerator::DecodeAndScale(SegmentReader* data, - bool all_data_received, - size_t index, - const SkImageInfo& info, - void* pixels, - size_t row_bytes) { +bool ImageFrameGenerator::DecodeAndScale( + SegmentReader* data, + bool all_data_received, + size_t index, + const SkImageInfo& info, + void* pixels, + size_t row_bytes, + ImageDecoder::AlphaOption alpha_option) { if (decode_failed_) return false; @@ -151,8 +153,9 @@ // returning (i.e. a pointer to |pixels|) and therefore 2) should not live // longer than the call to the current method. ExternalMemoryAllocator external_allocator(info, pixels, row_bytes); - SkBitmap bitmap = TryToResumeDecode(data, all_data_received, index, - scaled_size, &external_allocator); + SkBitmap bitmap = + TryToResumeDecode(data, all_data_received, index, scaled_size, + &external_allocator, alpha_option); DCHECK(external_allocator.unique()); // Verify we have the only ref-count. if (bitmap.isNull()) @@ -214,7 +217,8 @@ bool all_data_received, size_t index, const SkISize& scaled_size, - SkBitmap::Allocator* allocator) { + SkBitmap::Allocator* allocator, + ImageDecoder::AlphaOption alpha_option) { TRACE_EVENT1("blink", "ImageFrameGenerator::tryToResumeDecode", "frame index", static_cast<int>(index)); @@ -222,13 +226,13 @@ // Lock the mutex, so only one thread can use the decoder at once. MutexLocker lock(decode_mutex_); - const bool resume_decoding = - ImageDecodingStore::Instance().LockDecoder(this, full_size_, &decoder); + const bool resume_decoding = ImageDecodingStore::Instance().LockDecoder( + this, full_size_, alpha_option, &decoder); DCHECK(!resume_decoding || decoder); SkBitmap full_size_image; bool complete = Decode(data, all_data_received, index, &decoder, - &full_size_image, allocator); + &full_size_image, allocator, alpha_option); if (!decoder) return SkBitmap(); @@ -293,7 +297,8 @@ size_t index, ImageDecoder** decoder, SkBitmap* bitmap, - SkBitmap::Allocator* allocator) { + SkBitmap::Allocator* allocator, + ImageDecoder::AlphaOption alpha_option) { #if DCHECK_IS_ON() DCHECK(decode_mutex_.Locked()); #endif @@ -310,8 +315,7 @@ *decoder = image_decoder_factory_->Create().release(); if (!*decoder) { - *decoder = ImageDecoder::Create(data, all_data_received, - ImageDecoder::kAlphaPremultiplied, + *decoder = ImageDecoder::Create(data, all_data_received, alpha_option, decoder_color_behavior_) .release(); // The newly created decoder just grabbed the data. No need to reset it.
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h index 1b41360..2f32dfca 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h +++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
@@ -82,7 +82,8 @@ size_t index, const SkImageInfo&, void* pixels, - size_t row_bytes); + size_t row_bytes, + ImageDecoder::AlphaOption); // Decodes YUV components directly into the provided memory planes. Must not // be called unless getYUVComponentSizes has been called and returned true. @@ -126,14 +127,16 @@ bool all_data_received, size_t index, const SkISize& scaled_size, - SkBitmap::Allocator*); + SkBitmap::Allocator*, + ImageDecoder::AlphaOption); // This method should only be called while m_decodeMutex is locked. bool Decode(SegmentReader*, bool all_data_received, size_t index, ImageDecoder**, SkBitmap*, - SkBitmap::Allocator*); + SkBitmap::Allocator*, + ImageDecoder::AlphaOption); const SkISize full_size_;
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp index 55ef447..5cfad80 100644 --- a/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp
@@ -133,12 +133,14 @@ char buffer[100 * 100 * 4]; generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(1, decode_request_count_); AddNewData(); generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(2, decode_request_count_); EXPECT_EQ(0, decoders_destroyed_); } @@ -148,7 +150,8 @@ char buffer[100 * 100 * 4]; generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(1, decode_request_count_); EXPECT_EQ(0, decoders_destroyed_); @@ -156,13 +159,15 @@ AddNewData(); generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(2, decode_request_count_); EXPECT_EQ(1, decoders_destroyed_); // Decoder created again. generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(3, decode_request_count_); } @@ -170,7 +175,7 @@ SegmentReader* segment_reader) { char buffer[100 * 100 * 4]; generator->DecodeAndScale(segment_reader, false, 0, ImageInfo(), buffer, - 100 * 4); + 100 * 4, ImageDecoder::kAlphaPremultiplied); } TEST_F(ImageFrameGeneratorTest, incompleteDecodeBecomesCompleteMultiThreaded) { @@ -178,7 +183,8 @@ char buffer[100 * 100 * 4]; generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(1, decode_request_count_); EXPECT_EQ(0, decoders_destroyed_); @@ -196,7 +202,8 @@ // Decoder created again. generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(3, decode_request_count_); AddNewData(); @@ -210,13 +217,15 @@ char buffer[100 * 100 * 4]; generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_TRUE(generator_->HasAlpha(0)); EXPECT_EQ(1, decode_request_count_); ImageDecoder* temp_decoder = 0; EXPECT_TRUE(ImageDecodingStore::Instance().LockDecoder( - generator_.Get(), FullSize(), &temp_decoder)); + generator_.Get(), FullSize(), ImageDecoder::kAlphaPremultiplied, + &temp_decoder)); ASSERT_TRUE(temp_decoder); temp_decoder->FrameBufferAtIndex(0)->SetHasAlpha(false); ImageDecodingStore::Instance().UnlockDecoder(generator_.Get(), temp_decoder); @@ -224,7 +233,8 @@ SetFrameStatus(ImageFrame::kFrameComplete); generator_->DecodeAndScale(segment_reader_.Get(), false, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(3, decode_request_count_); EXPECT_FALSE(generator_->HasAlpha(0)); } @@ -235,7 +245,8 @@ char buffer[100 * 100 * 4]; generator_->DecodeAndScale(segment_reader_.Get(), true, 0, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(1, decode_request_count_); EXPECT_EQ(0, decoders_destroyed_); EXPECT_EQ(0U, requested_clear_except_frame_); @@ -243,7 +254,8 @@ SetFrameStatus(ImageFrame::kFrameComplete); generator_->DecodeAndScale(segment_reader_.Get(), true, 1, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(2, decode_request_count_); EXPECT_EQ(0, decoders_destroyed_); EXPECT_EQ(1U, requested_clear_except_frame_); @@ -254,7 +266,8 @@ // all the frame data, but not destroying the decoder. See comments in // ImageFrameGenerator::tryToResumeDecode(). generator_->DecodeAndScale(segment_reader_.Get(), true, 2, ImageInfo(), - buffer, 100 * 4); + buffer, 100 * 4, + ImageDecoder::kAlphaPremultiplied); EXPECT_EQ(3, decode_request_count_); EXPECT_EQ(0, decoders_destroyed_); EXPECT_EQ(kNotFound, requested_clear_except_frame_);
diff --git a/third_party/WebKit/Source/platform/heap/Member.h b/third_party/WebKit/Source/platform/heap/Member.h index a5b8de7..3a607ab 100644 --- a/third_party/WebKit/Source/platform/heap/Member.h +++ b/third_party/WebKit/Source/platform/heap/Member.h
@@ -5,6 +5,7 @@ #ifndef Member_h #define Member_h +#include "platform/heap/HeapPage.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/HashFunctions.h" #include "platform/wtf/HashTraits.h"
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp index 86cb401b..69399dc 100644 --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
@@ -521,19 +521,30 @@ source_to_target_color_transform_needs_update_ = false; source_to_target_color_transform_ = nullptr; - if (!color_behavior_.IsTransformToTargetColorSpace()) + if (color_behavior_.IsIgnore()) { return nullptr; - - sk_sp<SkColorSpace> src_color_space = embedded_color_space_; - if (!src_color_space) { - if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) - src_color_space = SkColorSpace::MakeSRGB(); - else - return nullptr; } - sk_sp<SkColorSpace> dst_color_space = - color_behavior_.TargetColorSpace().ToSkColorSpace(); + sk_sp<SkColorSpace> src_color_space = nullptr; + sk_sp<SkColorSpace> dst_color_space = nullptr; + if (color_behavior_.IsTransformToTargetColorSpace()) { + if (!embedded_color_space_) { + return nullptr; + } + + src_color_space = embedded_color_space_; + dst_color_space = color_behavior_.TargetColorSpace().ToSkColorSpace(); + } else { + DCHECK(color_behavior_.IsTag()); + src_color_space = embedded_color_space_; + if (!src_color_space) { + src_color_space = SkColorSpace::MakeSRGB(); + } + + // This will most likely be equal to the |src_color_space|. + // In that case, we skip the xform when we check for equality below. + dst_color_space = ColorSpaceForSkImages(); + } if (SkColorSpace::Equals(src_color_space.get(), dst_color_space.get())) { return nullptr; @@ -548,8 +559,26 @@ if (!color_behavior_.IsTag()) return nullptr; - if (embedded_color_space_) - return embedded_color_space_; + if (embedded_color_space_) { + SkColorSpaceTransferFn fn; + if (embedded_color_space_->isNumericalTransferFn(&fn)) { + // The embedded color space is supported by Skia. + return embedded_color_space_; + } + + // In the rare case that the embedded color space is unsupported, xform at + // decode time. + SkMatrix44 to_xyz_d50(SkMatrix44::kUninitialized_Constructor); + if (embedded_color_space_->toXYZD50(&to_xyz_d50)) { + // Preserve the gamut, but convert to a standard transfer function. + return SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, + to_xyz_d50); + } + + // For color spaces without an identifiable gamut, just fall through to + // sRGB. + } + return SkColorSpace::MakeSRGB(); }
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h index 8ad82490..bf81950 100644 --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -226,6 +226,10 @@ // Transformation from embedded color space to target color space. SkColorSpaceXform* ColorTransform(); + AlphaOption GetAlphaOption() const { + return premultiply_alpha_ ? kAlphaPremultiplied : kAlphaNotPremultiplied; + } + // Sets the "decode failure" flag. For caller convenience (since so // many callers want to return false after calling this), returns false // to enable easy tailcalling. Subclasses may override this to also
diff --git a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp index ae7f73e..c2a1113 100644 --- a/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp +++ b/third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp
@@ -1047,7 +1047,7 @@ } } -class StyleRelatedMainThreadScrollingReasonTest +class NonCompositedMainThreadScrollingReasonTest : public ScrollingCoordinatorTest { static const uint32_t kLCDTextRelatedReasons = MainThreadScrollingReason::kHasOpacityAndLCDText | @@ -1055,132 +1055,188 @@ MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText; protected: - StyleRelatedMainThreadScrollingReasonTest() { + NonCompositedMainThreadScrollingReasonTest() { RegisterMockedHttpURLLoad("two_scrollable_area.html"); NavigateTo(base_url_ + "two_scrollable_area.html"); } - void TestStyle(const std::string& target, const uint32_t reason) { + void TestNonCompositedReasons(const std::string& target, + const uint32_t reason) { GetWebViewImpl()->GetSettings()->SetPreferCompositingToLCDTextEnabled( false); Document* document = GetFrame()->GetDocument(); Element* container = document->GetElementById("scroller1"); container->setAttribute("class", target.c_str(), ASSERT_NO_EXCEPTION); - container = document->GetElementById("scroller2"); - container->setAttribute("class", target.c_str(), ASSERT_NO_EXCEPTION); ForceFullCompositingUpdate(); + PaintLayerScrollableArea* scrollable_area = + ToLayoutBoxModelObject(container->GetLayoutObject()) + ->GetScrollableArea(); + ASSERT_TRUE(scrollable_area); + EXPECT_TRUE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + reason); + + Element* container2 = document->GetElementById("scroller2"); + PaintLayerScrollableArea* scrollable_area2 = + ToLayoutBoxModelObject(container2->GetLayoutObject()) + ->GetScrollableArea(); + ASSERT_TRUE(scrollable_area2); + // Different scrollable area should remain unaffected. + EXPECT_FALSE( + scrollable_area2->GetNonCompositedMainThreadScrollingReasons() & + reason); + FrameView* frame_view = GetFrame()->View(); ASSERT_TRUE(frame_view); - ASSERT_TRUE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & reason); - // Remove the target attribute from one of the scrollers. - // Still need to scroll on main thread. - container = document->GetElementById("scroller1"); - DCHECK(container); - + // Remove attribute from the scroller 1 would lead to scroll on impl. container->removeAttribute("class"); ForceFullCompositingUpdate(); - ASSERT_TRUE(frame_view->GetMainThreadScrollingReasons() & reason); - - // Remove attribute from the other scroller would lead to - // scroll on impl. - container = document->GetElementById("scroller2"); - DCHECK(container); - - container->removeAttribute("class"); - ForceFullCompositingUpdate(); - - ASSERT_FALSE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & reason); // Add target attribute would again lead to scroll on main thread container->setAttribute("class", target.c_str(), ASSERT_NO_EXCEPTION); ForceFullCompositingUpdate(); - ASSERT_TRUE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_TRUE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & reason); if ((reason & kLCDTextRelatedReasons) && !(reason & ~kLCDTextRelatedReasons)) { GetWebViewImpl()->GetSettings()->SetPreferCompositingToLCDTextEnabled( true); ForceFullCompositingUpdate(); - ASSERT_FALSE(frame_view->GetMainThreadScrollingReasons()); + EXPECT_FALSE( + scrollable_area->GetNonCompositedMainThreadScrollingReasons()); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons()); } } }; INSTANTIATE_TEST_CASE_P(All, - StyleRelatedMainThreadScrollingReasonTest, + NonCompositedMainThreadScrollingReasonTest, ::testing::Bool()); -// TODO(yigu): This test and all other style realted main thread scrolling -// reason tests below have been disabled due to https://crbug.com/701355. -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_TransparentTest) { - TestStyle("transparent", MainThreadScrollingReason::kHasOpacityAndLCDText); +TEST_P(NonCompositedMainThreadScrollingReasonTest, TransparentTest) { + TestNonCompositedReasons("transparent", + MainThreadScrollingReason::kHasOpacityAndLCDText); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_TransformTest) { - TestStyle("transform", MainThreadScrollingReason::kHasTransformAndLCDText); +TEST_P(NonCompositedMainThreadScrollingReasonTest, TransformTest) { + TestNonCompositedReasons("transform", + MainThreadScrollingReason::kHasTransformAndLCDText); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, - DISABLED_BackgroundNotOpaqueTest) { - TestStyle("background-not-opaque", - MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); +TEST_P(NonCompositedMainThreadScrollingReasonTest, BackgroundNotOpaqueTest) { + TestNonCompositedReasons( + "background-not-opaque", + MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_BorderRadiusTest) { - TestStyle("border-radius", MainThreadScrollingReason::kHasBorderRadius); +TEST_P(NonCompositedMainThreadScrollingReasonTest, BorderRadiusTest) { + TestNonCompositedReasons("border-radius", + MainThreadScrollingReason::kHasBorderRadius); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_ClipTest) { - TestStyle("clip", MainThreadScrollingReason::kHasClipRelatedProperty); +TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipTest) { + TestNonCompositedReasons("clip", + MainThreadScrollingReason::kHasClipRelatedProperty); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_ClipPathTest) { - uint32_t reason = MainThreadScrollingReason::kHasClipRelatedProperty; +TEST_P(NonCompositedMainThreadScrollingReasonTest, ClipPathTest) { + uint32_t clip_reason = MainThreadScrollingReason::kHasClipRelatedProperty; GetWebViewImpl()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); Document* document = GetFrame()->GetDocument(); // Test ancestor with ClipPath Element* element = document->body(); - DCHECK(element); + ASSERT_TRUE(element); element->setAttribute(HTMLNames::styleAttr, "clip-path:circle(115px at 20px 20px);"); + Element* container = document->getElementById("scroller1"); + ASSERT_TRUE(container); ForceFullCompositingUpdate(); + PaintLayerScrollableArea* scrollable_area = + ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); + ASSERT_TRUE(scrollable_area); + EXPECT_TRUE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + clip_reason); + FrameView* frame_view = GetFrame()->View(); ASSERT_TRUE(frame_view); - ASSERT_TRUE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); // Remove clip path from ancestor. element->removeAttribute(HTMLNames::styleAttr); ForceFullCompositingUpdate(); - ASSERT_FALSE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + clip_reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); // Test descendant with ClipPath element = document->GetElementById("content1"); - DCHECK(element); + ASSERT_TRUE(element); element->setAttribute(HTMLNames::styleAttr, "clip-path:circle(115px at 20px 20px);"); ForceFullCompositingUpdate(); - ASSERT_TRUE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_TRUE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + clip_reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); // Remove clip path from descendant. element->removeAttribute(HTMLNames::styleAttr); ForceFullCompositingUpdate(); - ASSERT_FALSE(frame_view->GetMainThreadScrollingReasons() & reason); + EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons() & + clip_reason); + EXPECT_FALSE(frame_view->GetMainThreadScrollingReasons() & clip_reason); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_LCDTextEnabledTest) { - TestStyle("transparent border-radius", - MainThreadScrollingReason::kHasOpacityAndLCDText | - MainThreadScrollingReason::kHasBorderRadius); +TEST_P(NonCompositedMainThreadScrollingReasonTest, LCDTextEnabledTest) { + TestNonCompositedReasons("transparent border-radius", + MainThreadScrollingReason::kHasOpacityAndLCDText | + MainThreadScrollingReason::kHasBorderRadius); } -TEST_P(StyleRelatedMainThreadScrollingReasonTest, DISABLED_BoxShadowTest) { - TestStyle("box-shadow", - MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); +TEST_P(NonCompositedMainThreadScrollingReasonTest, BoxShadowTest) { + TestNonCompositedReasons( + "box-shadow", MainThreadScrollingReason::kHasBoxShadowFromNonRootLayer); +} + +TEST_P(NonCompositedMainThreadScrollingReasonTest, + CompositedWithLCDTextRelatedReasonsTest) { + // With "will-change:transform" we composite elements with + // LCDTextRelatedReasons only. For elements with other + // NonCompositedReasons, we don't create scrollingLayer for their + // CompositedLayerMapping therefore they don't get composited. + GetWebViewImpl()->GetSettings()->SetPreferCompositingToLCDTextEnabled(false); + Document* document = GetFrame()->GetDocument(); + Element* container = document->getElementById("scroller1"); + ASSERT_TRUE(container); + container->setAttribute("class", "composited transparent", + ASSERT_NO_EXCEPTION); + ForceFullCompositingUpdate(); + + PaintLayerScrollableArea* scrollable_area = + ToLayoutBoxModelObject(container->GetLayoutObject())->GetScrollableArea(); + ASSERT_TRUE(scrollable_area); + EXPECT_FALSE(scrollable_area->GetNonCompositedMainThreadScrollingReasons()); + + Element* container2 = document->getElementById("scroller2"); + ASSERT_TRUE(container2); + container2->setAttribute("class", "composited border-radius", + ASSERT_NO_EXCEPTION); + ForceFullCompositingUpdate(); + PaintLayerScrollableArea* scrollable_area2 = + ToLayoutBoxModelObject(container2->GetLayoutObject()) + ->GetScrollableArea(); + ASSERT_TRUE(scrollable_area2); + EXPECT_TRUE(scrollable_area2->GetNonCompositedMainThreadScrollingReasons() & + MainThreadScrollingReason::kHasBorderRadius); } } // namespace blink
diff --git a/third_party/WebKit/Source/web/tests/data/two_scrollable_area.html b/third_party/WebKit/Source/web/tests/data/two_scrollable_area.html index 9de7288..81e1e37 100644 --- a/third_party/WebKit/Source/web/tests/data/two_scrollable_area.html +++ b/third_party/WebKit/Source/web/tests/data/two_scrollable_area.html
@@ -32,6 +32,10 @@ will-change:transform; /*This reason is not recorded for root layer*/ } +.composited { + will-change:transform; +} + .content { height: 500px; }
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py index 83f5b8f..5c03c13 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py
@@ -75,14 +75,26 @@ return None def latest_try_jobs(self, builder_names=None): - """Returns a list of Builds for the latest jobs for the given builders.""" + """Returns a list of Builds for the latest jobs for the given builders. + + This includes builds that are not yet finished and builds with infra + failures, so if a build is in this list, that doesn't guarantee that + there are results. + + Args: + builder_names: Optional list of builders used to filter results. + + Returns: + A list of Build objects for try jobs, with one Build listed + per builder. For scheduled builds, there is no build number. + """ try_results = self.fetch_try_results() if builder_names: try_results = [r for r in try_results if r['builder_name'] in builder_names] return filter_latest_builds(self._try_result_to_build(r) for r in try_results) def fetch_try_results(self): - """Requests results f try jobs for the current CL.""" + """Requests results of try jobs for the current CL.""" with self._host.filesystem.mkdtemp() as temp_directory: results_path = self._host.filesystem.join(temp_directory, 'try-results.json') self.run(['try-results', '--json', results_path])
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py index 7dbe596..fcb2f8f 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py
@@ -156,13 +156,13 @@ 'builder_name': 'builder-b', 'status': 'COMPLETED', 'result': 'SUCCESS', - 'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100', + 'url': 'http://build.chromium.org/p/master/builders/builder-b/builds/100', }, { 'builder_name': 'builder-b', 'status': 'COMPLETED', 'result': 'SUCCESS', - 'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/90', + 'url': 'http://build.chromium.org/p/master/builders/builder-b/builds/90', }, { 'builder_name': 'builder-a', @@ -174,13 +174,25 @@ 'builder_name': 'builder-c', 'status': 'COMPLETED', 'result': 'SUCCESS', - 'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/123', + 'url': 'http://build.chromium.org/p/master/builders/builder-c/builds/123', }, ] self.assertEqual( git_cl.latest_try_jobs(['builder-a', 'builder-b']), [Build('builder-a'), Build('builder-b', 100)]) + def test_latest_try_builds_started_builds(self): + git_cl = GitCL(MockHost()) + git_cl.fetch_try_results = lambda: [ + { + 'builder_name': 'builder-a', + 'status': 'STARTED', + 'result': None, + 'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100', + }, + ] + self.assertEqual(git_cl.latest_try_jobs(['builder-a']), [Build('builder-a', 100)]) + def test_latest_try_builds_failures(self): git_cl = GitCL(MockHost()) git_cl.fetch_try_results = lambda: [ @@ -188,9 +200,17 @@ 'builder_name': 'builder-a', 'status': 'COMPLETED', 'result': 'FAILURE', - 'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100', + 'failure_reason': 'BUILD_FAILURE', + 'url': 'http://build.chromium.org/p/master/builders/builder-a/builds/100', + }, + { + 'builder_name': 'builder-b', + 'status': 'COMPLETED', + 'result': 'FAILURE', + 'failure_reason': 'INFRA_FAILURE', + 'url': 'http://build.chromium.org/p/master/builders/builder-b/builds/200', }, ] self.assertEqual( git_cl.latest_try_jobs(['builder-a', 'builder-b']), - [Build('builder-a', 100)]) + [Build('builder-a', 100), Build('builder-b', 200)])
diff --git a/third_party/robolectric/README.chromium b/third_party/robolectric/README.chromium index 235b7740..612411a 100644 --- a/third_party/robolectric/README.chromium +++ b/third_party/robolectric/README.chromium
@@ -13,8 +13,4 @@ - Hardcoded version number in robolectric-version.properties. - Hardcoded ShadowProvider service config files. These files are normally generated at compile time but it is difficult to use the generated file - with GN. -- Added template_processor/ directory with Java classes to process Robolectric's - .vm template files. The template processor creates versions of these classes - for different Android API levels. The templated code is used to build the - respective shadows-core-3.0-<API Level>.jar \ No newline at end of file + with GN. \ No newline at end of file
diff --git a/tools/binary_size/README.md b/tools/binary_size/README.md index b5e3bd3..4787956a 100644 --- a/tools/binary_size/README.md +++ b/tools/binary_size/README.md
@@ -33,7 +33,7 @@ Creates an interactive size breakdown (by source path) as a stand-alone html report. -## Example Usage: +### Example Usage: tools/binary_size/supersize html_report chrome.size --report-dir size-report -v xdg-open size-report/index.html @@ -42,19 +42,27 @@ Starts a Python interpreter where you can run custom queries. -## Example Usage: +### Example Usage: - # Runs a single diff and exits (does not enter interactive mode). - tools/binary_size/supersize console without_patch.size with_patch.size --query='Diff(size_info2, size_info1)' + # Prints size infomation and exits (does not enter interactive mode). + tools/binary_size/supersize console chrome.size --query='Print(size_info)' # Enters a Python REPL (it will print more guidance). tools/binary_size/supersize console chrome.size -## diagnose_apk_bloat.py +## "diff" + +A convenience command equivalent to: `console before.size after.size --query='Print(Diff(size_info1, size_info2))'` + +### Example Usage: + + tools/binary_size/supersize diff before.size after.size --all + +# diagnose_apk_bloat.py Determine the cause of binary size bloat for a patch. -### Example Usage: +## Example Usage: # Sync, build, and diff for HEAD and HEAD^. tools/binary_size/diagnose_apk_bloat.py
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py index 7443c37..97f12f40 100644 --- a/tools/binary_size/libsupersize/archive.py +++ b/tools/binary_size/libsupersize/archive.py
@@ -459,8 +459,9 @@ any_input = apk_path or elf_path or map_path if not any_input: parser.error('Most pass at least one of --apk-file, --elf-file, --map-file') - lazy_paths = paths.LazyPaths(args=args, input_file=any_input) - + lazy_paths = paths.LazyPaths(tool_prefix=args.tool_prefix, + output_directory=args.output_directory, + any_path_within_output_directory=any_input) if apk_path: with zipfile.ZipFile(apk_path) as z: lib_infos = [f for f in z.infolist()
diff --git a/tools/binary_size/libsupersize/console.py b/tools/binary_size/libsupersize/console.py index 3dbb6a8..e350f817 100644 --- a/tools/binary_size/libsupersize/console.py +++ b/tools/binary_size/libsupersize/console.py
@@ -206,9 +206,7 @@ atexit.register(lambda: readline.write_history_file(history_file)) def Eval(self, query): - eval_result = eval(query, self._variables) - if eval_result: - self._PrintFunc(eval_result) + exec query in self._variables def GoInteractive(self): _Session._InitReadline() @@ -221,10 +219,9 @@ help='Input .size files to load. For a single file, it will be mapped to ' 'the variable "size_info". For multiple inputs, the names will be ' 'size_info1, size_info2, etc.') - parser.add_argument( - '--query', help='Print the result of the given snippet. Example: ' - 'size_info.symbols.WhereInSection("d")' - '.WhereBiggerThan(100)') + parser.add_argument('--query', + help='Execute the given snippet. ' + 'Example: Print(size_info)') parser.add_argument('--tool-prefix', default='', help='Path prefix for objdump. Required only for ' 'Disassemble().') @@ -239,7 +236,9 @@ parser.error('All inputs must end with ".size"') size_infos = [archive.LoadAndPostProcessSizeInfo(p) for p in args.inputs] - lazy_paths = paths.LazyPaths(args=args, input_file=args.inputs[0]) + lazy_paths = paths.LazyPaths(tool_prefix=args.tool_prefix, + output_directory=args.output_directory, + any_path_within_output_directory=args.inputs[0]) session = _Session(size_infos, lazy_paths) if args.query:
diff --git a/tools/binary_size/libsupersize/describe.py b/tools/binary_size/libsupersize/describe.py index b4cf6a71..bf689d57 100644 --- a/tools/binary_size/libsupersize/describe.py +++ b/tools/binary_size/libsupersize/describe.py
@@ -175,19 +175,19 @@ group_desc) def _DescribeSizeInfoDiff(self, diff): - common_metadata = {k: v for k, v in diff.old_metadata.iteritems() - if diff.new_metadata[k] == v} - old_metadata = {k: v for k, v in diff.old_metadata.iteritems() - if k not in common_metadata} - new_metadata = {k: v for k, v in diff.new_metadata.iteritems() - if k not in common_metadata} + common_metadata = {k: v for k, v in diff.before_metadata.iteritems() + if diff.after_metadata[k] == v} + before_metadata = {k: v for k, v in diff.before_metadata.iteritems() + if k not in common_metadata} + after_metadata = {k: v for k, v in diff.after_metadata.iteritems() + if k not in common_metadata} metadata_desc = itertools.chain( ('Common Metadata:',), (' %s' % line for line in DescribeMetadata(common_metadata)), ('Old Metadata:',), - (' %s' % line for line in DescribeMetadata(old_metadata)), + (' %s' % line for line in DescribeMetadata(before_metadata)), ('New Metadata:',), - (' %s' % line for line in DescribeMetadata(new_metadata))) + (' %s' % line for line in DescribeMetadata(after_metadata))) section_desc = self._DescribeSectionSizes(diff.section_sizes) group_desc = self.GenerateLines(diff.symbols) return itertools.chain(metadata_desc, section_desc, ('',), group_desc)
diff --git a/tools/binary_size/libsupersize/integration_test.py b/tools/binary_size/libsupersize/integration_test.py index 30fa4fd..e9ad925 100755 --- a/tools/binary_size/libsupersize/integration_test.py +++ b/tools/binary_size/libsupersize/integration_test.py
@@ -5,6 +5,7 @@ import copy import difflib +import glob import itertools import logging import os @@ -94,11 +95,25 @@ archive.LoadAndPostProcessSizeInfo(temp_file.name) @_CompareWithGolden - def test_ConsoleNullDiff(self): + def test_Console(self): + with tempfile.NamedTemporaryFile(suffix='.size') as size_file, \ + tempfile.NamedTemporaryFile(suffix='.txt') as output_file: + file_format.SaveSizeInfo(self._CloneSizeInfo(), size_file.name) + query = [ + 'ShowExamples()', + 'ExpandRegex("_foo_")', + 'Print(size_info, to_file=%r)' % output_file.name, + ] + ret = _RunApp('console', size_file.name, '--query', '; '.join(query)) + with open(output_file.name) as f: + ret.extend(l.rstrip() for l in f) + return ret + + @_CompareWithGolden + def test_Diff_NullDiff(self): with tempfile.NamedTemporaryFile(suffix='.size') as temp_file: file_format.SaveSizeInfo(self._CloneSizeInfo(), temp_file.name) - return _RunApp('console', '--query', 'Diff(size_info1, size_info2)', - temp_file.name, temp_file.name) + return _RunApp('diff', temp_file.name, temp_file.name) @_CompareWithGolden def test_ActualDiff(self): @@ -146,6 +161,8 @@ argv.pop(0) global update_goldens update_goldens = True + for f in glob.glob(os.path.join(_TEST_DATA_DIR, '*.golden')): + os.unlink(f) unittest.main(argv=argv, verbosity=2)
diff --git a/tools/binary_size/libsupersize/main.py b/tools/binary_size/libsupersize/main.py index 4eeb894..33b82f0 100755 --- a/tools/binary_size/libsupersize/main.py +++ b/tools/binary_size/libsupersize/main.py
@@ -36,6 +36,23 @@ help='Verbose level (multiple times for more)') +class _DiffAction(object): + @staticmethod + def AddArguments(parser): + parser.add_argument('before', help='Before-patch .size file.') + parser.add_argument('after', help='After-patch .size file.') + parser.add_argument('--all', action='store_true', help='Verbose diff') + + @staticmethod + def Run(args, parser): + args.output_directory = None + args.tool_prefix = None + args.inputs = [args.before, args.after] + args.query = ('Print(Diff(size_info1, size_info2), verbose=%s)' % + bool(args.all)) + console.Run(args, parser) + + def main(): parser = argparse.ArgumentParser(description=__doc__) sub_parsers = parser.add_subparsers() @@ -46,6 +63,9 @@ actions['console'] = ( console, 'Starts an interactive Python console for analyzing .size files.') + actions['diff'] = ( + _DiffAction(), + 'Shorthand for console --query "Print(Diff(size_info1, size_info2))"') for name, tup in actions.iteritems(): sub_parser = sub_parsers.add_parser(name, help=tup[1])
diff --git a/tools/binary_size/libsupersize/models.py b/tools/binary_size/libsupersize/models.py index dac0072..7e2ceb1 100644 --- a/tools/binary_size/libsupersize/models.py +++ b/tools/binary_size/libsupersize/models.py
@@ -82,21 +82,21 @@ Fields: section_sizes: A dict of section_name -> size delta. symbols: A SymbolDiff with all symbols in it. - old_metadata: metadata of the "old" SizeInfo. - new_metadata: metadata of the "new" SizeInfo. + before_metadata: metadata of the "before" SizeInfo. + after_metadata: metadata of the "after" SizeInfo. """ __slots__ = ( 'section_sizes', 'symbols', - 'old_metadata', - 'new_metadata', + 'before_metadata', + 'after_metadata', ) - def __init__(self, section_sizes, symbols, old_metadata, new_metadata): + def __init__(self, section_sizes, symbols, before_metadata, after_metadata): self.section_sizes = section_sizes self.symbols = symbols - self.old_metadata = old_metadata - self.new_metadata = new_metadata + self.before_metadata = before_metadata + self.after_metadata = after_metadata class BaseSymbol(object): @@ -253,14 +253,15 @@ def __sub__(self, other): other_ids = set(id(s) for s in other) - new_symbols = [s for s in self if id(s) not in other_ids] - return self._CreateTransformed(new_symbols, section_name=self.section_name) + after_symbols = [s for s in self if id(s) not in other_ids] + return self._CreateTransformed(after_symbols, + section_name=self.section_name) def __add__(self, other): self_ids = set(id(s) for s in self) - new_symbols = self._symbols + [s for s in other if id(s) not in self_ids] - return self._CreateTransformed(new_symbols, section_name=self.section_name, - is_sorted=False) + after_symbols = self._symbols + [s for s in other if id(s) not in self_ids] + return self._CreateTransformed( + after_symbols, section_name=self.section_name, is_sorted=False) @property def address(self): @@ -313,9 +314,9 @@ cmp_func = lambda a, b: cmp((a.IsBss(), abs(b.size), a.name), (b.IsBss(), abs(a.size), b.name)) - new_symbols = sorted(self._symbols, cmp_func, key, reverse) + after_symbols = sorted(self._symbols, cmp_func, key, reverse) return self._CreateTransformed( - new_symbols, filtered_symbols=self._filtered_symbols, + after_symbols, filtered_symbols=self._filtered_symbols, section_name=self.section_name, is_sorted=True) def SortedByName(self, reverse=False): @@ -416,7 +417,7 @@ Use a negative value to omit symbols entirely rather than include them outside of a group. """ - new_syms = [] + after_syms = [] filtered_symbols = [] symbols_by_token = collections.defaultdict(list) # Index symbols by |func|. @@ -430,15 +431,15 @@ min_count = abs(min_count) for token, symbols in symbols_by_token.iteritems(): if len(symbols) >= min_count: - new_syms.append(self._CreateTransformed( + after_syms.append(self._CreateTransformed( symbols, name=token, section_name=self.section_name, is_sorted=False)) elif include_singles: - new_syms.extend(symbols) + after_syms.extend(symbols) else: filtered_symbols.extend(symbols) return self._CreateTransformed( - new_syms, filtered_symbols=filtered_symbols, + after_syms, filtered_symbols=filtered_symbols, section_name=self.section_name, is_sorted=False) def GroupBySectionName(self): @@ -589,7 +590,7 @@ return self.Filter(lambda s: not self.IsSimilar(s) or s.size) -def Diff(new, old): +def Diff(before, after): """Diffs two SizeInfo or SymbolGroup objects. When diffing SizeInfos, a SizeInfoDiff is returned. @@ -599,15 +600,16 @@ Returns a SizeInfo when args are of type SizeInfo. Returns a SymbolDiff when args are of type SymbolGroup. """ - if isinstance(new, SizeInfo): - assert isinstance(old, SizeInfo) - section_sizes = { - k:new.section_sizes[k] - v for k, v in old.section_sizes.iteritems()} - symbol_diff = Diff(new.symbols, old.symbols) - return SizeInfoDiff(section_sizes, symbol_diff, old.metadata, new.metadata) + if isinstance(after, SizeInfo): + assert isinstance(before, SizeInfo) + section_sizes = {k: after.section_sizes[k] - v + for k, v in before.section_sizes.iteritems()} + symbol_diff = _DiffSymbols(before.symbols, after.symbols) + return SizeInfoDiff(section_sizes, symbol_diff, before.metadata, + after.metadata) - assert isinstance(new, SymbolGroup) and isinstance(old, SymbolGroup) - return _DiffSymbols(new, old) + assert isinstance(after, SymbolGroup) and isinstance(before, SymbolGroup) + return _DiffSymbols(before, after) def _NegateAll(symbols): @@ -625,9 +627,9 @@ return ret -def _DiffSymbols(new_group, old_group): +def _DiffSymbols(before, after): symbols_by_key = collections.defaultdict(list) - for s in old_group: + for s in before: symbols_by_key[s._Key()].append(s) added = [] @@ -635,32 +637,33 @@ # For similar symbols, padding is zeroed out. In order to not lose the # information entirely, store it in aggregate. padding_by_section_name = collections.defaultdict(int) - for new_sym in new_group: - matching_syms = symbols_by_key.get(new_sym._Key()) + for after_sym in after: + matching_syms = symbols_by_key.get(after_sym._Key()) if matching_syms: - old_sym = matching_syms.pop(0) - if old_sym.IsGroup() and new_sym.IsGroup(): - merged_sym = _DiffSymbols(new_sym, old_sym) + before_sym = matching_syms.pop(0) + if before_sym.IsGroup() and after_sym.IsGroup(): + merged_sym = _DiffSymbols(before_sym, after_sym) else: - size_diff = new_sym.size_without_padding - old_sym.size_without_padding - merged_sym = Symbol(new_sym.section_name, size_diff, - address=new_sym.address, name=new_sym.name, - source_path=new_sym.source_path, - object_path=new_sym.object_path, - full_name=new_sym.full_name, - is_anonymous=new_sym.is_anonymous) + size_diff = (after_sym.size_without_padding - + before_sym.size_without_padding) + merged_sym = Symbol(after_sym.section_name, size_diff, + address=after_sym.address, name=after_sym.name, + source_path=after_sym.source_path, + object_path=after_sym.object_path, + full_name=after_sym.full_name, + is_anonymous=after_sym.is_anonymous) # Diffs are more stable when comparing size without padding, except when # the symbol is a padding-only symbol. - if new_sym.size_without_padding == 0 and size_diff == 0: - merged_sym.padding = new_sym.padding - old_sym.padding + if after_sym.size_without_padding == 0 and size_diff == 0: + merged_sym.padding = after_sym.padding - before_sym.padding else: - padding_by_section_name[new_sym.section_name] += ( - new_sym.padding - old_sym.padding) + padding_by_section_name[after_sym.section_name] += ( + after_sym.padding - before_sym.padding) similar.append(merged_sym) else: - added.append(new_sym) + added.append(after_sym) removed = [] for remaining_syms in symbols_by_key.itervalues(): @@ -671,9 +674,9 @@ if padding != 0: similar.append(Symbol(section_name, padding, name="** aggregate padding of diff'ed symbols")) - return SymbolDiff(added, removed, similar, name=new_group.name, - full_name=new_group.full_name, - section_name=new_group.section_name) + return SymbolDiff(added, removed, similar, name=after.name, + full_name=after.full_name, + section_name=after.section_name) def _ExtractPrefixBeforeSeparator(string, separator, count=1):
diff --git a/tools/binary_size/libsupersize/paths.py b/tools/binary_size/libsupersize/paths.py index bf877cb6..dcb7c72 100644 --- a/tools/binary_size/libsupersize/paths.py +++ b/tools/binary_size/libsupersize/paths.py
@@ -13,13 +13,11 @@ class LazyPaths(object): - def __init__(self, args=None, tool_prefix=None, output_directory=None, - input_file=None): - tool_prefix = tool_prefix or (args and args.tool_prefix) - output_directory = output_directory or (args and args.output_directory) + def __init__(self, tool_prefix=None, output_directory=None, + any_path_within_output_directory=None): self._tool_prefix = tool_prefix self._output_directory = output_directory - self._input_file = input_file + self._any_path_within_output_directory = any_path_within_output_directory self._output_directory_status = _STATUS_DETECTED if output_directory else 0 self._tool_prefix_status = _STATUS_DETECTED if tool_prefix else 0 @@ -64,13 +62,15 @@ return tool_prefix def _DetectOutputDirectory(self): - # See if input file is in out/Release. - abs_path = os.path.abspath(self._input_file) - release_idx = abs_path.find('Release') - if release_idx != -1: - output_directory = abs_path[:release_idx] + 'Release' - output_directory = os.path.relpath(abs_path[:release_idx] + '/Release') - return output_directory + # Try and find build.ninja. + abs_path = os.path.abspath(self._any_path_within_output_directory) + while True: + if os.path.exists(os.path.join(abs_path, 'build.ninja')): + return os.path.relpath(abs_path) + parent_dir = os.path.dirname(abs_path) + if parent_dir == abs_path: + break + abs_path = abs_path = parent_dir # See if CWD=output directory. if os.path.exists('build.ninja'):
diff --git a/tools/binary_size/libsupersize/testdata/ActualDiff.golden b/tools/binary_size/libsupersize/testdata/ActualDiff.golden index 2299ddb1..13dc194 100644 --- a/tools/binary_size/libsupersize/testdata/ActualDiff.golden +++ b/tools/binary_size/libsupersize/testdata/ActualDiff.golden
@@ -2,9 +2,9 @@ baz=yes foo=1 Old Metadata: - bar=[1, 3] -New Metadata: bar=[1, 2, 3] +New Metadata: + bar=[1, 3] Section Sizes (Total=0 bytes): .bss: 0 bytes (not included in totals) @@ -49,135 +49,135 @@ .strtab: 0 bytes .symtab: 0 bytes -3 symbols added (+), 1 changed (~), 2 removed (-), 32 unchanged (=) -0 object files added, 1 removed -Removed files: +2 symbols added (+), 1 changed (~), 3 removed (-), 32 unchanged (=) +1 object files added, 0 removed +Added files: third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o -Showing 38 symbols with total size: -10 bytes -.text=-10 bytes .rodata=0 bytes other=0 bytes total=-10 bytes +Showing 38 symbols with total size: 10 bytes +.text=10 bytes .rodata=0 bytes other=0 bytes total=10 bytes Number of object files: 10 First columns are: running total, type, size -~ -10 t@0x28d900 size=-10 padding=0 size_without_padding=-10 +~ 10 t@0x28d900 size=10 padding=0 size_without_padding=10 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=startup._GLOBAL__sub_I_page_allocator.cc -= -10 r@0x284e364 size=0 padding=0 size_without_padding=0 += 10 r@0x284e364 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o -= -10 r@Group size=0 padding=0 size_without_padding=0 count=2 += 10 r@Group size=0 padding=0 size_without_padding=0 count=2 source_path= object_path= is_anonymous=0 name=** merge strings -= -10 t@Group size=0 padding=0 size_without_padding=0 count=2 += 10 t@Group size=0 padding=0 size_without_padding=0 count=2 source_path=None object_path=None is_anonymous=0 name=** symbol gaps -= -10 d@0x2cd84e0 size=0 padding=0 size_without_padding=0 += 10 d@0x2cd84e0 size=0 padding=0 size_without_padding=0 source_path= object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o is_anonymous=0 name=.Lswitch.table.45 -= -10 d@0x2c176f0 size=0 padding=0 size_without_padding=0 += 10 d@0x2c176f0 size=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=ChromeMainDelegate [vtable] -= -10 d@0x2cd8500 size=0 padding=0 size_without_padding=0 += 10 d@0x2cd8500 size=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o is_anonymous=0 name=ChromeMainDelegateAndroid [vtable] -= -10 r@0x284e370 size=0 padding=0 size_without_padding=0 += 10 r@0x284e370 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=Name -= -10 d@0x2de70a0 size=0 padding=0 size_without_padding=0 += 10 d@0x2de70a0 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=1 name=base::android::g_renderer_histogram_code -= -10 r@0x28f3480 size=0 padding=0 size_without_padding=0 += 10 r@0x28f3480 size=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o is_anonymous=1 name=blink::CSSValueKeywordsHash::findValueImpl::value_word_list full_name=blink::CSSValueKeywordsHash::findValueImpl(char const*, unsigned int)::value_word_list -= -10 t@0x2a0020 size=0 padding=0 size_without_padding=0 += 10 t@0x2a0020 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=0 name=blink::ContiguousContainerBase::ContiguousContainerBase full_name=blink::ContiguousContainerBase::ContiguousContainerBase(blink::ContiguousContainerBase&&) -= -10 t@0x2a0000 size=0 padding=0 size_without_padding=0 += 10 t@0x2a0000 size=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o is_anonymous=0 name=blink::ContiguousContainerBase::shrinkToFit full_name=blink::ContiguousContainerBase::shrinkToFit() -= -10 t@0x2a0010 size=0 padding=0 size_without_padding=0 += 10 t@0x2a0010 size=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o is_anonymous=0 name=blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2] full_name=blink::ContiguousContainerBase::shrinkToFit() [clone .part.1234] [clone .isra.2] -= -10 t@0x2a1000 size=0 padding=0 size_without_padding=0 += 10 t@0x2a1000 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=1 name=blink::PaintChunker::releasePaintChunks [clone .part.1] full_name=blink::PaintChunker::releasePaintChunks() [clone .part.1] -= -10 d@0x2c17740 size=0 padding=0 size_without_padding=0 += 10 d@0x2c17740 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=0 name=chrome::mojom::FieldTrialRecorderProxy [vtable] -= -10 d@0x2c17728 size=0 padding=0 size_without_padding=0 += 10 d@0x2c17728 size=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=chrome::mojom::FieldTrialRecorderRequestValidator [vtable] -= -10 r@0x284e398 size=0 padding=0 size_without_padding=0 += 10 r@0x284e398 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=0 name=chrome::mojom::FilePatcher::Name_ -= -10 t@0x28d964 size=0 padding=0 size_without_padding=0 += 10 t@0x28d964 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=extFromUUseMapping full_name=extFromUUseMapping(signed char, unsigned int, int) -= -10 t@0x28d98a size=0 padding=0 size_without_padding=0 += 10 t@0x28d98a size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=extFromUUseMapping full_name=extFromUUseMapping(aj, int) -= -10 d@0x2de7000 size=0 padding=0 size_without_padding=0 += 10 d@0x2de7000 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=google::protobuf::internal::pLinuxKernelCmpxchg -= -10 d@0x2de7004 size=0 padding=0 size_without_padding=0 += 10 d@0x2de7004 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=0 name=google::protobuf::internal::pLinuxKernelMemoryBarrier -= -10 r@0x28f3450 size=0 padding=0 size_without_padding=0 += 10 r@0x28f3450 size=0 padding=0 size_without_padding=0 source_path=third_party/paint.cc object_path=third_party/WebKit.a/PaintChunker.o is_anonymous=1 name=kAnimationFrameTimeHistogramClassPath -= -10 d@0x2cd8550 size=0 padding=0 size_without_padding=0 += 10 d@0x2cd8550 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=kMethodsAnimationFrameTimeHistogram -= -10 d@0x2cd84f0 size=0 padding=0 size_without_padding=0 += 10 d@0x2cd84f0 size=0 padding=0 size_without_padding=0 source_path= object_path=third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o is_anonymous=1 name=kSystemClassPrefixes -= -10 d@0x2cd8538 size=0 padding=0 size_without_padding=0 += 10 d@0x2cd8538 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=mojo::MessageReceiver [vtable] -= -10 d@0x2de7008 size=0 padding=0 size_without_padding=0 += 10 d@0x2de7008 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=0 name=rel._ZN4base7androidL22kBaseRegisteredMethodsE -= -10 d@0x2de70a4 size=0 padding=0 size_without_padding=0 += 10 d@0x2de70a4 size=0 padding=0 size_without_padding=0 source_path=third_party/container.c object_path=third_party/WebKit.a/ContiguousContainer.o is_anonymous=0 name=rel.local._ZN4base7android12_GLOBAL__N_124g_library_version_numberE -= -10 t@0x28f1c8 size=0 padding=0 size_without_padding=0 += 10 t@0x28f1c8 size=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=startup._GLOBAL__sub_I_SkDeviceProfile.cpp -= -10 t@0x28f1e0 size=0 padding=0 size_without_padding=0 += 10 t@0x28f1e0 size=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=startup._GLOBAL__sub_I_SkDiscardableMemoryPool.cpp -= -10 t@0x28d910 size=0 padding=0 size_without_padding=0 += 10 t@0x28d910 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=startup._GLOBAL__sub_I_bbr_sender.cc -= -10 t@0x28d948 size=0 padding=0 size_without_padding=0 += 10 t@0x28d948 size=0 padding=0 size_without_padding=0 source_path=base/page_allocator.cc object_path=base/base/page_allocator.o is_anonymous=0 name=startup._GLOBAL__sub_I_pacing_sender.cc -= -10 t@0x28f000 size=0 padding=0 size_without_padding=0 += 10 t@0x28f000 size=0 padding=0 size_without_padding=0 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=ucnv_extMatchFromU full_name=ucnv_extMatchFromU(int const*, int, unsigned short const*, int, unsigned short const*, int, unsigned int*, signed char, signed char) -- -10 b@0x0 size=-262144 padding=0 size_without_padding=-262144 ++ 10 b@0x0 size=262144 padding=0 size_without_padding=262144 source_path=third_party/fft_float.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o is_anonymous=0 name=ff_cos_131072 -- -10 b@0x0 size=-131072 padding=0 size_without_padding=-131072 ++ 10 b@0x0 size=131072 padding=0 size_without_padding=131072 source_path=third_party/fft_fixed.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_fixed.o is_anonymous=0 name=ff_cos_131072_fixed -+ -10 b@0x2dffe80 size=200 padding=196 size_without_padding=4 +- 10 b@0x2dffe80 size=-200 padding=-196 size_without_padding=-4 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=SaveHistogram::atomic_histogram_pointer full_name=SaveHistogram(_JNIEnv*, base::android::JavaParamRef<_jobject*> const&, base::android::JavaParamRef<_jstring*> const&, base::android::JavaParamRef<_jlongArray*> const&, int)::atomic_histogram_pointer -+ -10 b@0x2dffda0 size=28 padding=0 size_without_padding=28 +- 10 b@0x2dffda0 size=-28 padding=0 size_without_padding=-28 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=0 name=g_chrome_content_browser_client -+ -10 b@0x2dffe84 size=4 padding=0 size_without_padding=4 +- 10 b@0x2dffe84 size=-4 padding=0 size_without_padding=-4 source_path=third_party/icu/ucnv_ext.c object_path=third_party/icu/icuuc/ucnv_ext.o is_anonymous=1 name=g_AnimationFrameTimeHistogram_clazz -= -10 b@0x0 size=0 padding=0 size_without_padding=0 += 10 b@0x0 size=0 padding=0 size_without_padding=0 source_path=third_party/fft_float.cc object_path=third_party/ffmpeg/libffmpeg_internal.a/fft_float.o is_anonymous=0 name=ff_cos_65536
diff --git a/tools/binary_size/libsupersize/testdata/Console.golden b/tools/binary_size/libsupersize/testdata/Console.golden new file mode 100644 index 0000000..1fd39ebd --- /dev/null +++ b/tools/binary_size/libsupersize/testdata/Console.golden
@@ -0,0 +1,116 @@ +# Show pydoc for main types: +import models +help(models) + +# Show all attributes of all symbols & per-section totals: +Print(size_info, verbose=True) + +# Show two levels of .text, grouped by first two subdirectories +text_syms = size_info.symbols.WhereInSection("t") +by_path = text_syms.GroupBySourcePath(depth=2) +Print(by_path.WhereBiggerThan(1024)) + +# Show all non-vtable generated symbols +generated_syms = size_info.symbols.WhereIsGenerated() +Print(generated_syms.WhereNameMatches(r"vtable").Inverted()) + +# Show all symbols that have "print" in their name or path, except +# those within components/. +# Note: Could have also used Inverted(), as above. +# Note: Use "help(ExpandRegex)" for more about what {{_print_}} does. +print_syms = size_info.symbols.WhereMatches(r"{{_print_}}") +Print(print_syms - print_syms.WherePathMatches(r"^components/")) + +# Diff two .size files and save result to a file: +Print(Diff(size_info1, size_info2), to_file="output.txt") + +Metadata: + +Section Sizes (Total=43,785,380 bytes): + .bss: 1,300,456 bytes (not included in totals) + .data: 101,768 bytes (0.2%) + .data.rel.ro: 1,065,224 bytes (2.4%) + .data.rel.ro.local: 790,024 bytes (1.8%) + .rodata: 5,927,652 bytes (13.5%) + .text: 35,900,712 bytes (82.0%) + +Showing 38 symbols with total size: 2652506 bytes +.text=10.3kb .rodata=2.52mb other=388 bytes total=2.53mb +Number of object files: 10 + +First columns are: running total, type, size + 2641394 r@Group 2641394 {no path} + ** merge strings (count=2) + 2651152 t@Group 9758 {no path} + ** symbol gaps (count=2) + 2651600 t@0x28f000 448 third_party/icu/ucnv_ext.c + ucnv_extMatchFromU + 2651752 d@0x2de7008 152 third_party/container.c + rel._ZN4base7androidL22kBaseRegisteredMethodsE + 2651846 t@0x2a1000 94 third_party/container.c + blink::PaintChunker::releasePaintChunks [clone .part.1] + 2651902 d@0x2c176f0 56 third_party/icu/ucnv_ext.c + ChromeMainDelegate [vtable] + 2651958 d@0x2cd8500 56 third_party/paint.cc + ChromeMainDelegateAndroid [vtable] + 2652014 t@0x28d910 56 base/page_allocator.cc + startup._GLOBAL__sub_I_bbr_sender.cc + 2652069 r@0x28f3450 55 third_party/paint.cc + kAnimationFrameTimeHistogramClassPath + 2652113 r@0x284e370 44 base/page_allocator.cc + Name + 2652151 t@0x28d964 38 base/page_allocator.cc + extFromUUseMapping + 2652183 r@0x284e398 32 third_party/container.c + chrome::mojom::FilePatcher::Name_ + 2652215 t@0x28d98a 32 base/page_allocator.cc + extFromUUseMapping + 2652243 t@0x2a0020 28 third_party/container.c + blink::ContiguousContainerBase::ContiguousContainerBase + 2652271 t@0x28f1c8 28 third_party/icu/ucnv_ext.c + startup._GLOBAL__sub_I_SkDeviceProfile.cpp + 2652299 t@0x28d948 28 base/page_allocator.cc + startup._GLOBAL__sub_I_pacing_sender.cc + 2652323 d@0x2c17740 24 third_party/container.c + chrome::mojom::FieldTrialRecorderProxy [vtable] + 2652347 d@0x2c17728 24 third_party/icu/ucnv_ext.c + chrome::mojom::FieldTrialRecorderRequestValidator [vtable] + 2652371 d@0x2cd8538 24 base/page_allocator.cc + mojo::MessageReceiver [vtable] + 2652395 t@0x28f1e0 24 third_party/icu/ucnv_ext.c + startup._GLOBAL__sub_I_SkDiscardableMemoryPool.cpp + 2652411 d@0x2cd84e0 16 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libcontroller_api_impl.a_controller_api_impl.o + .Lswitch.table.45 + 2652427 t@0x2a0000 16 third_party/paint.cc + blink::ContiguousContainerBase::shrinkToFit + 2652443 t@0x28d900 16 base/page_allocator.cc + startup._GLOBAL__sub_I_page_allocator.cc + 2652455 t@0x2a0010 12 third_party/paint.cc + blink::ContiguousContainerBase::shrinkToFit [clone .part.1234] [clone .isra.2] + 2652467 d@0x2cd8550 12 base/page_allocator.cc + kMethodsAnimationFrameTimeHistogram + 2652478 r@0x284e364 11 base/page_allocator.cc + 2652486 d@0x2cd84f0 8 third_party/gvr-android-sdk/libgvr_shim_static_arm.a/libport_android_jni.a_jni_utils.o + kSystemClassPrefixes + 2652490 d@0x2de70a0 4 third_party/container.c + base::android::g_renderer_histogram_code + 2652494 r@0x28f3480 4 third_party/paint.cc + blink::CSSValueKeywordsHash::findValueImpl::value_word_list + 2652498 d@0x2de7000 4 base/page_allocator.cc + google::protobuf::internal::pLinuxKernelCmpxchg + 2652502 d@0x2de7004 4 third_party/container.c + google::protobuf::internal::pLinuxKernelMemoryBarrier + 2652506 d@0x2de70a4 4 third_party/container.c + rel.local._ZN4base7android12_GLOBAL__N_124g_library_version_numberE + 2652506 b@0x0 262144 third_party/fft_float.cc + ff_cos_131072 + 2652506 b@0x0 131072 third_party/fft_fixed.cc + ff_cos_131072_fixed + 2652506 b@0x0 131072 third_party/fft_float.cc + ff_cos_65536 + 2652506 b@0x2dffe80 200 third_party/icu/ucnv_ext.c + SaveHistogram::atomic_histogram_pointer + 2652506 b@0x2dffda0 28 third_party/icu/ucnv_ext.c + g_chrome_content_browser_client + 2652506 b@0x2dffe84 4 third_party/icu/ucnv_ext.c + g_AnimationFrameTimeHistogram_clazz
diff --git a/tools/binary_size/libsupersize/testdata/ConsoleNullDiff.golden b/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden similarity index 100% rename from tools/binary_size/libsupersize/testdata/ConsoleNullDiff.golden rename to tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden
diff --git a/tools/blink_rename_merge_helper/COMPONENTS b/tools/blink_rename_merge_helper/COMPONENTS index b573832..b376ee0 100644 --- a/tools/blink_rename_merge_helper/COMPONENTS +++ b/tools/blink_rename_merge_helper/COMPONENTS
@@ -1,8 +1,8 @@ { - "pylib": "2af6a38142b87bc78f57f65030de579820406c4b", - "data": "2a75d6c41ca69e5278a46eb271296b9354d2728d", + "pylib": "374e8c010eb86beb9c97d4179c5b1f1cc8c1d999", + "data": "3a2675b967f26b2d2aabe3d903824ebfeed1af64", "bin-darwin": "f45f58ccbf42a26b0704f63d8740cf008b84afcc", - "include-darwin": "1a5693595308ffc3c2cd826ac21e538aeafe5345", + "include-darwin": "7f1790ea6a3257dda2035fe885a33fbfe4078fed", "lib-darwin": "29baf57b55dd0ab060baf0cd6461a7e0fa0105f4", "bin-linux*": "c7c76f202a6d0feb77dd946b2e605a1ba56d3046", "lib-linux*": "508b0ba0de0b4191a54360330f74cea8afd5ee93",
diff --git a/tools/blink_rename_merge_helper/data/idl_blocklist.txt b/tools/blink_rename_merge_helper/data/idl_blocklist.txt new file mode 100644 index 0000000..613ddfd --- /dev/null +++ b/tools/blink_rename_merge_helper/data/idl_blocklist.txt
@@ -0,0 +1,6419 @@ +AbstractWorker:::onerror:::1 +AbstractWorker:::setOnerror:::2 +Accelerometer:::x:::1 +Accelerometer:::y:::1 +Accelerometer:::z:::1 +AccessibleNode:::autocomplete:::0 +AccessibleNode:::checked:::0 +AccessibleNode:::current:::0 +AccessibleNode:::invalid:::0 +AccessibleNode:::keyShortcuts:::0 +AccessibleNode:::label:::0 +AccessibleNode:::live:::0 +AccessibleNode:::orientation:::0 +AccessibleNode:::placeholder:::0 +AccessibleNode:::relevant:::0 +AccessibleNode:::role:::0 +AccessibleNode:::roleDescription:::0 +AccessibleNode:::setAutocomplete:::1 +AccessibleNode:::setChecked:::1 +AccessibleNode:::setCurrent:::1 +AccessibleNode:::setInvalid:::1 +AccessibleNode:::setKeyShortcuts:::1 +AccessibleNode:::setLabel:::1 +AccessibleNode:::setLive:::1 +AccessibleNode:::setOrientation:::1 +AccessibleNode:::setPlaceholder:::1 +AccessibleNode:::setRelevant:::1 +AccessibleNode:::setRole:::1 +AccessibleNode:::setRoleDescription:::1 +AccessibleNode:::setSort:::1 +AccessibleNode:::setValueText:::1 +AccessibleNode:::sort:::0 +AccessibleNode:::valueText:::0 +AmbientLightSensor:::illuminance:::1 +AnalyserNode:::fftSize:::0 +AnalyserNode:::frequencyBinCount:::0 +AnalyserNode:::getByteFrequencyData:::1 +AnalyserNode:::getByteTimeDomainData:::1 +AnalyserNode:::getFloatFrequencyData:::1 +AnalyserNode:::getFloatTimeDomainData:::1 +AnalyserNode:::maxDecibels:::0 +AnalyserNode:::minDecibels:::0 +AnalyserNode:::setFftSize:::2 +AnalyserNode:::setMaxDecibels:::2 +AnalyserNode:::setMinDecibels:::2 +AnalyserNode:::setSmoothingTimeConstant:::2 +AnalyserNode:::smoothingTimeConstant:::0 +ANGLEInstancedArrays:::drawArraysInstancedANGLE:::4 +ANGLEInstancedArrays:::drawElementsInstancedANGLE:::5 +ANGLEInstancedArrays:::vertexAttribDivisorANGLE:::2 +Animation:::cancel:::0 +Animation:::currentTime:::1 +Animation:::effect:::0 +AnimationEffectReadOnly:::getComputedTiming:::0 +AnimationEffectReadOnly:::getComputedTiming:::1 +AnimationEffectReadOnly:::timing:::0 +AnimationEffectTiming:::delay:::0 +AnimationEffectTiming:::direction:::0 +AnimationEffectTiming:::duration:::1 +AnimationEffectTiming:::easing:::0 +AnimationEffectTiming:::endDelay:::0 +AnimationEffectTiming:::fill:::0 +AnimationEffectTiming:::iterations:::0 +AnimationEffectTiming:::iterationStart:::0 +AnimationEffectTimingReadOnly:::delay:::0 +AnimationEffectTimingReadOnly:::direction:::0 +AnimationEffectTimingReadOnly:::duration:::1 +AnimationEffectTimingReadOnly:::easing:::0 +AnimationEffectTimingReadOnly:::endDelay:::0 +AnimationEffectTimingReadOnly:::fill:::0 +AnimationEffectTimingReadOnly:::iterations:::0 +AnimationEffectTimingReadOnly:::iterationStart:::0 +AnimationEffectTiming:::setDelay:::1 +AnimationEffectTiming:::setDirection:::1 +AnimationEffectTiming:::setDuration:::2 +AnimationEffectTiming:::setEasing:::2 +AnimationEffectTiming:::setEndDelay:::1 +AnimationEffectTiming:::setFill:::1 +AnimationEffectTiming:::setIterations:::2 +AnimationEffectTiming:::setIterationStart:::2 +AnimationEvent:::animationName:::0 +AnimationEvent:::elapsedTime:::0 +Animation:::finish:::1 +Animation:::finished:::1 +Animation:::id:::0 +Animation:::oncancel:::0 +Animation:::onfinish:::0 +Animation:::pause:::1 +Animation:::play:::1 +AnimationPlaybackEvent:::currentTime:::1 +AnimationPlaybackEvent:::timelineTime:::1 +Animation:::playbackRate:::0 +Animation:::playState:::0 +Animation:::ready:::1 +Animation:::reverse:::1 +Animation:::setCurrentTime:::1 +Animation:::setEffect:::1 +Animation:::setId:::1 +Animation:::setOncancel:::1 +Animation:::setOnfinish:::1 +Animation:::setPlaybackRate:::1 +Animation:::setStartTime:::1 +Animation:::startTime:::1 +Animation:::timeline:::0 +AnimationTimeline:::currentTime:::1 +AnimationTimeline:::getAnimations:::0 +AnimationTimeline:::setCurrentTime:::1 +AppBannerPromptResult:::outcome:::0 +AppBannerPromptResult:::platform:::0 +ApplicationCache:::abort:::0 +ApplicationCacheErrorEvent:::message:::0 +ApplicationCacheErrorEvent:::reason:::0 +ApplicationCacheErrorEvent:::status:::0 +ApplicationCacheErrorEvent:::url:::0 +ApplicationCache:::oncached:::0 +ApplicationCache:::onchecking:::0 +ApplicationCache:::ondownloading:::0 +ApplicationCache:::onerror:::0 +ApplicationCache:::onnoupdate:::0 +ApplicationCache:::onobsolete:::0 +ApplicationCache:::onprogress:::0 +ApplicationCache:::onupdateready:::0 +ApplicationCache:::setOncached:::1 +ApplicationCache:::setOnchecking:::1 +ApplicationCache:::setOndownloading:::1 +ApplicationCache:::setOnerror:::1 +ApplicationCache:::setOnnoupdate:::1 +ApplicationCache:::setOnobsolete:::1 +ApplicationCache:::setOnprogress:::1 +ApplicationCache:::setOnupdateready:::1 +ApplicationCache:::status:::0 +ApplicationCache:::swapCache:::1 +ApplicationCache:::update:::1 +Attr:::localName:::0 +Attr:::name:::0 +Attr:::namespaceURI:::0 +Attr:::ownerElement:::0 +Attr:::prefix:::0 +Attr:::setValue:::1 +Attr:::specified:::0 +Attr:::value:::0 +AudioBufferCallback:::handleEvent:::1 +AudioBuffer:::copyFromChannel:::3 +AudioBuffer:::copyFromChannel:::4 +AudioBuffer:::copyToChannel:::3 +AudioBuffer:::copyToChannel:::4 +AudioBuffer:::duration:::0 +AudioBuffer:::getChannelData:::2 +AudioBuffer:::length:::0 +AudioBuffer:::numberOfChannels:::0 +AudioBuffer:::sampleRate:::0 +AudioBufferSourceNode:::buffer:::0 +AudioBufferSourceNode:::detune:::0 +AudioBufferSourceNode:::loop:::0 +AudioBufferSourceNode:::loopEnd:::0 +AudioBufferSourceNode:::loopStart:::0 +AudioBufferSourceNode:::playbackRate:::0 +AudioBufferSourceNode:::setBuffer:::2 +AudioBufferSourceNode:::setLoop:::1 +AudioBufferSourceNode:::setLoopEnd:::1 +AudioBufferSourceNode:::setLoopStart:::1 +AudioBufferSourceNode:::start:::1 +AudioBufferSourceNode:::start:::2 +AudioBufferSourceNode:::start:::3 +AudioBufferSourceNode:::start:::4 +AudioContext:::baseLatency:::0 +AudioContext:::closeContext:::1 +AudioContext:::getOutputTimestamp:::1 +AudioContext:::suspendContext:::1 +AudioDestinationNode:::maxChannelCount:::0 +AudioListener:::forwardX:::0 +AudioListener:::forwardY:::0 +AudioListener:::forwardZ:::0 +AudioListener:::positionX:::0 +AudioListener:::positionY:::0 +AudioListener:::positionZ:::0 +AudioListener:::setOrientation:::6 +AudioListener:::setPosition:::3 +AudioListener:::upX:::0 +AudioListener:::upY:::0 +AudioListener:::upZ:::0 +AudioNode:::channelCount:::0 +AudioNode:::channelCountMode:::0 +AudioNode:::channelInterpretation:::0 +AudioNode:::connect:::2 +AudioNode:::connect:::3 +AudioNode:::connect:::4 +AudioNode:::context:::0 +AudioNode:::disconnect:::0 +AudioNode:::disconnect:::2 +AudioNode:::disconnect:::3 +AudioNode:::disconnect:::4 +AudioNode:::numberOfInputs:::0 +AudioNode:::numberOfOutputs:::0 +AudioNode:::setChannelCount:::2 +AudioNode:::setChannelCountMode:::2 +AudioNode:::setChannelInterpretation:::2 +AudioParam:::cancelAndHoldAtTime:::2 +AudioParam:::cancelScheduledValues:::2 +AudioParam:::defaultValue:::0 +AudioParam:::exponentialRampToValueAtTime:::3 +AudioParam:::linearRampToValueAtTime:::3 +AudioParam:::maxValue:::0 +AudioParam:::minValue:::0 +AudioParam:::setTargetAtTime:::4 +AudioParam:::setValue:::1 +AudioParam:::setValueAtTime:::3 +AudioParam:::setValueCurveAtTime:::4 +AudioParam:::value:::0 +AudioProcessingEvent:::inputBuffer:::0 +AudioProcessingEvent:::outputBuffer:::0 +AudioProcessingEvent:::playbackTime:::0 +AudioScheduledSourceNode:::onended:::0 +AudioScheduledSourceNode:::setOnended:::1 +AudioScheduledSourceNode:::start:::1 +AudioScheduledSourceNode:::start:::2 +AudioScheduledSourceNode:::stop:::1 +AudioScheduledSourceNode:::stop:::2 +AudioTrack:::enabled:::0 +AudioTrack:::id:::0 +AudioTrack:::kind:::0 +AudioTrack:::label:::0 +AudioTrack:::language:::0 +AudioTrackList::::::1 +AudioTrackList:::getTrackById:::1 +AudioTrackList:::length:::0 +AudioTrackList:::onaddtrack:::0 +AudioTrackList:::onchange:::0 +AudioTrackList:::onremovetrack:::0 +AudioTrackList:::setOnaddtrack:::1 +AudioTrackList:::setOnchange:::1 +AudioTrackList:::setOnremovetrack:::1 +AudioTrack:::setEnabled:::1 +AudioWorkletGlobalScope:::registerProcessor:::3 +AuthenticationAssertion:::authenticatorData:::0 +AuthenticationAssertion:::clientData:::0 +AuthenticationAssertion:::credential:::0 +AuthenticationAssertion:::signature:::0 +BackgroundFetchClickEvent:::state:::0 +BackgroundFetchedEvent:::fetches:::0 +BackgroundFetchedEvent:::updateUI:::2 +BackgroundFetchEvent:::tag:::0 +BackgroundFetchFailEvent:::fetches:::0 +BackgroundFetchFetch:::request:::0 +BackgroundFetchManager:::fetch:::4 +BackgroundFetchManager:::fetch:::5 +BackgroundFetchManager:::get:::2 +BackgroundFetchManager:::getTags:::1 +BackgroundFetchRegistration:::abort:::1 +BackgroundFetchRegistration:::icons:::0 +BackgroundFetchRegistration:::tag:::0 +BackgroundFetchRegistration:::title:::0 +BackgroundFetchRegistration:::totalDownloadSize:::0 +BackgroundFetchSettledFetch:::response:::0 +BarcodeDetector:::detect:::2 +BarProp:::visible:::0 +BaseAudioContext:::createAnalyser:::1 +BaseAudioContext:::createBiquadFilter:::1 +BaseAudioContext:::createBuffer:::4 +BaseAudioContext:::createBufferSource:::1 +BaseAudioContext:::createChannelMerger:::1 +BaseAudioContext:::createChannelMerger:::2 +BaseAudioContext:::createChannelSplitter:::1 +BaseAudioContext:::createChannelSplitter:::2 +BaseAudioContext:::createConstantSource:::1 +BaseAudioContext:::createConvolver:::1 +BaseAudioContext:::createDelay:::1 +BaseAudioContext:::createDelay:::2 +BaseAudioContext:::createDynamicsCompressor:::1 +BaseAudioContext:::createGain:::1 +BaseAudioContext:::createIIRFilter:::3 +BaseAudioContext:::createMediaElementSource:::2 +BaseAudioContext:::createMediaStreamDestination:::1 +BaseAudioContext:::createMediaStreamSource:::2 +BaseAudioContext:::createOscillator:::1 +BaseAudioContext:::createPanner:::1 +BaseAudioContext:::createPeriodicWave:::3 +BaseAudioContext:::createPeriodicWave:::4 +BaseAudioContext:::createScriptProcessor:::1 +BaseAudioContext:::createScriptProcessor:::2 +BaseAudioContext:::createScriptProcessor:::3 +BaseAudioContext:::createScriptProcessor:::4 +BaseAudioContext:::createStereoPanner:::1 +BaseAudioContext:::createWaveShaper:::1 +BaseAudioContext:::currentTime:::0 +BaseAudioContext:::decodeAudioData:::3 +BaseAudioContext:::decodeAudioData:::4 +BaseAudioContext:::decodeAudioData:::5 +BaseAudioContext:::destination:::0 +BaseAudioContext:::getOutputTimestamp:::1 +BaseAudioContext:::listener:::0 +BaseAudioContext:::onstatechange:::0 +BaseAudioContext:::resumeContext:::1 +BaseAudioContext:::sampleRate:::0 +BaseAudioContext:::setOnstatechange:::1 +BaseAudioContext:::state:::0 +BaseAudioContext:::suspendContext:::1 +BaseRenderingContext2D:::beginPath:::0 +BaseRenderingContext2D:::clearRect:::4 +BaseRenderingContext2D:::clip:::1 +BaseRenderingContext2D:::clip:::2 +BaseRenderingContext2D:::createImageData:::2 +BaseRenderingContext2D:::createImageData:::3 +BaseRenderingContext2D:::createLinearGradient:::4 +BaseRenderingContext2D:::createPattern:::4 +BaseRenderingContext2D:::createRadialGradient:::7 +BaseRenderingContext2D:::currentTransform:::0 +BaseRenderingContext2D:::drawImage:::11 +BaseRenderingContext2D:::drawImage:::5 +BaseRenderingContext2D:::drawImage:::7 +BaseRenderingContext2D:::fill:::1 +BaseRenderingContext2D:::fill:::2 +BaseRenderingContext2D:::fillRect:::4 +BaseRenderingContext2D:::fillStyle:::1 +BaseRenderingContext2D:::filter:::0 +BaseRenderingContext2D:::getImageData:::5 +BaseRenderingContext2D:::getLineDash:::0 +BaseRenderingContext2D:::globalAlpha:::0 +BaseRenderingContext2D:::globalCompositeOperation:::0 +BaseRenderingContext2D:::imageSmoothingEnabled:::0 +BaseRenderingContext2D:::imageSmoothingQuality:::0 +BaseRenderingContext2D:::isContextLost:::0 +BaseRenderingContext2D:::isPointInPath:::3 +BaseRenderingContext2D:::isPointInPath:::4 +BaseRenderingContext2D:::isPointInStroke:::2 +BaseRenderingContext2D:::isPointInStroke:::3 +BaseRenderingContext2D:::lineCap:::0 +BaseRenderingContext2D:::lineDashOffset:::0 +BaseRenderingContext2D:::lineJoin:::0 +BaseRenderingContext2D:::lineWidth:::0 +BaseRenderingContext2D:::miterLimit:::0 +BaseRenderingContext2D:::putImageData:::4 +BaseRenderingContext2D:::putImageData:::8 +BaseRenderingContext2D:::resetTransform:::0 +BaseRenderingContext2D:::restore:::0 +BaseRenderingContext2D:::rotate:::1 +BaseRenderingContext2D:::save:::0 +BaseRenderingContext2D:::scale:::2 +BaseRenderingContext2D:::setCurrentTransform:::1 +BaseRenderingContext2D:::setFillStyle:::1 +BaseRenderingContext2D:::setFilter:::1 +BaseRenderingContext2D:::setGlobalAlpha:::1 +BaseRenderingContext2D:::setGlobalCompositeOperation:::1 +BaseRenderingContext2D:::setImageSmoothingEnabled:::1 +BaseRenderingContext2D:::setImageSmoothingQuality:::1 +BaseRenderingContext2D:::setLineCap:::1 +BaseRenderingContext2D:::setLineDash:::1 +BaseRenderingContext2D:::setLineDashOffset:::1 +BaseRenderingContext2D:::setLineJoin:::1 +BaseRenderingContext2D:::setLineWidth:::1 +BaseRenderingContext2D:::setMiterLimit:::1 +BaseRenderingContext2D:::setShadowBlur:::1 +BaseRenderingContext2D:::setShadowColor:::1 +BaseRenderingContext2D:::setShadowOffsetX:::1 +BaseRenderingContext2D:::setShadowOffsetY:::1 +BaseRenderingContext2D:::setStrokeStyle:::1 +BaseRenderingContext2D:::setTransform:::6 +BaseRenderingContext2D:::shadowBlur:::0 +BaseRenderingContext2D:::shadowColor:::0 +BaseRenderingContext2D:::shadowOffsetX:::0 +BaseRenderingContext2D:::shadowOffsetY:::0 +BaseRenderingContext2D:::stroke:::0 +BaseRenderingContext2D:::stroke:::1 +BaseRenderingContext2D:::strokeRect:::4 +BaseRenderingContext2D:::strokeStyle:::1 +BaseRenderingContext2D:::transform:::6 +BaseRenderingContext2D:::translate:::2 +BatteryManager:::charging:::0 +BatteryManager:::chargingTime:::0 +BatteryManager:::dischargingTime:::0 +BatteryManager:::level:::0 +BatteryManager:::onchargingchange:::0 +BatteryManager:::onchargingtimechange:::0 +BatteryManager:::ondischargingtimechange:::0 +BatteryManager:::onlevelchange:::0 +BatteryManager:::setOnchargingchange:::1 +BatteryManager:::setOnchargingtimechange:::1 +BatteryManager:::setOndischargingtimechange:::1 +BatteryManager:::setOnlevelchange:::1 +BeforeInstallPromptEvent:::platforms:::0 +BeforeInstallPromptEvent:::prompt:::1 +BeforeInstallPromptEvent:::userChoice:::1 +BeforeUnloadEvent:::returnValue:::0 +BeforeUnloadEvent:::setReturnValue:::1 +BiquadFilterNode:::detune:::0 +BiquadFilterNode:::frequency:::0 +BiquadFilterNode:::gain:::0 +BiquadFilterNode:::getFrequencyResponse:::3 +BiquadFilterNode:::q:::0 +BiquadFilterNode:::setType:::1 +BiquadFilterNode:::type:::0 +BlobCallback:::handleEvent:::1 +Blob:::close:::2 +BlobEvent:::data:::0 +BlobEvent:::timecode:::0 +Blob:::isClosed:::0 +Blob:::size:::0 +Blob:::slice:::1 +Blob:::slice:::2 +Blob:::slice:::3 +Blob:::slice:::4 +Blob:::type:::0 +BluetoothCharacteristicProperties:::authenticatedSignedWrites:::0 +BluetoothCharacteristicProperties:::broadcast:::0 +BluetoothCharacteristicProperties:::indicate:::0 +BluetoothCharacteristicProperties:::notify:::0 +BluetoothCharacteristicProperties:::read:::0 +BluetoothCharacteristicProperties:::reliableWrite:::0 +BluetoothCharacteristicProperties:::writableAuxiliaries:::0 +BluetoothCharacteristicProperties:::write:::0 +BluetoothCharacteristicProperties:::writeWithoutResponse:::0 +BluetoothDevice:::gatt:::0 +BluetoothDevice:::id:::0 +BluetoothDevice:::name:::0 +BluetoothDevice:::ongattserverdisconnected:::0 +BluetoothDevice:::setOngattserverdisconnected:::1 +BluetoothRemoteGATTCharacteristic:::getDescriptor:::3 +BluetoothRemoteGATTCharacteristic:::getDescriptors:::2 +BluetoothRemoteGATTCharacteristic:::getDescriptors:::3 +BluetoothRemoteGATTCharacteristic:::oncharacteristicvaluechanged:::0 +BluetoothRemoteGATTCharacteristic:::properties:::0 +BluetoothRemoteGATTCharacteristic:::readValue:::1 +BluetoothRemoteGATTCharacteristic:::service:::0 +BluetoothRemoteGATTCharacteristic:::setOncharacteristicvaluechanged:::1 +BluetoothRemoteGATTCharacteristic:::startNotifications:::1 +BluetoothRemoteGATTCharacteristic:::stopNotifications:::1 +BluetoothRemoteGATTCharacteristic:::uuid:::0 +BluetoothRemoteGATTCharacteristic:::value:::0 +BluetoothRemoteGATTCharacteristic:::writeValue:::2 +BluetoothRemoteGATTDescriptor:::characteristic:::0 +BluetoothRemoteGATTDescriptor:::readValue:::1 +BluetoothRemoteGATTDescriptor:::uuid:::0 +BluetoothRemoteGATTDescriptor:::value:::0 +BluetoothRemoteGATTDescriptor:::writeValue:::2 +BluetoothRemoteGATTServer:::connect:::1 +BluetoothRemoteGATTServer:::connected:::0 +BluetoothRemoteGATTServer:::device:::0 +BluetoothRemoteGATTServer:::disconnect:::1 +BluetoothRemoteGATTServer:::getPrimaryService:::3 +BluetoothRemoteGATTServer:::getPrimaryServices:::2 +BluetoothRemoteGATTServer:::getPrimaryServices:::3 +BluetoothRemoteGATTService:::device:::0 +BluetoothRemoteGATTService:::getCharacteristic:::3 +BluetoothRemoteGATTService:::getCharacteristics:::2 +BluetoothRemoteGATTService:::getCharacteristics:::3 +BluetoothRemoteGATTService:::isPrimary:::0 +BluetoothRemoteGATTService:::uuid:::0 +Bluetooth:::requestDevice:::2 +Bluetooth:::requestDevice:::3 +BluetoothUUID:::canonicalUUID:::1 +BluetoothUUID:::getCharacteristic:::2 +BluetoothUUID:::getDescriptor:::2 +BluetoothUUID:::getService:::2 +Body:::arrayBuffer:::1 +Body:::blob:::1 +Body:::body:::1 +Body:::bodyUsed:::0 +Body:::bodyWithUseCounter:::1 +Body:::json:::1 +Body:::text:::1 +BroadcastChannel:::close:::0 +BroadcastChannel:::name:::0 +BroadcastChannel:::onmessage:::0 +BroadcastChannel:::postMessage:::2 +BroadcastChannel:::setOnmessage:::1 +BudgetService:::getBudget:::1 +BudgetService:::getCost:::2 +BudgetService:::reserve:::2 +BudgetState:::budgetAt:::0 +BudgetState:::time:::0 +Cache:::add:::3 +Cache:::addAll:::3 +Cache:::deleteFunction:::3 +Cache:::deleteFunction:::4 +Cache:::keys:::2 +Cache:::keys:::3 +Cache:::keys:::4 +Cache:::match:::3 +Cache:::match:::4 +Cache:::matchAll:::2 +Cache:::matchAll:::3 +Cache:::matchAll:::4 +Cache:::put:::4 +CacheStorage:::deleteFunction:::3 +CacheStorage:::has:::3 +CacheStorage:::keys:::2 +CacheStorage:::match:::3 +CacheStorage:::match:::4 +CacheStorage:::open:::3 +CallbackFunctionTest:::testCallback:::4 +CallbackFunctionTest:::testInterfaceCallback:::3 +CallbackFunctionTest:::testNullableCallback:::4 +CallbackFunctionTest:::testReceiverObjectCallback:::2 +CallbackFunctionTest:::testSequenceCallback:::3 +CanvasCaptureMediaStreamTrack:::canvas:::0 +CanvasCaptureMediaStreamTrack:::requestFrame:::0 +CanvasGradient:::addColorStop:::3 +CanvasPathMethods:::arc:::6 +CanvasPathMethods:::arc:::7 +CanvasPathMethods:::arcTo:::6 +CanvasPathMethods:::bezierCurveTo:::6 +CanvasPathMethods:::closePath:::0 +CanvasPathMethods:::ellipse:::8 +CanvasPathMethods:::ellipse:::9 +CanvasPathMethods:::lineTo:::2 +CanvasPathMethods:::moveTo:::2 +CanvasPathMethods:::quadraticCurveTo:::4 +CanvasPathMethods:::rect:::4 +CanvasPattern:::setTransform:::1 +CanvasRenderingContext2D:::addHitRegion:::1 +CanvasRenderingContext2D:::addHitRegion:::2 +CanvasRenderingContext2D:::beginPath:::0 +CanvasRenderingContext2D:::canvas:::0 +CanvasRenderingContext2D:::clearHitRegions:::0 +CanvasRenderingContext2D:::clearRect:::4 +CanvasRenderingContext2D:::clip:::0 +CanvasRenderingContext2D:::clip:::1 +CanvasRenderingContext2D:::clip:::2 +CanvasRenderingContext2D:::createImageData:::2 +CanvasRenderingContext2D:::createImageData:::3 +CanvasRenderingContext2D:::createLinearGradient:::4 +CanvasRenderingContext2D:::createPattern:::4 +CanvasRenderingContext2D:::createRadialGradient:::7 +CanvasRenderingContext2D:::currentTransform:::0 +CanvasRenderingContext2D:::direction:::0 +CanvasRenderingContext2D:::drawFocusIfNeeded:::1 +CanvasRenderingContext2D:::drawFocusIfNeeded:::2 +CanvasRenderingContext2D:::drawImage:::11 +CanvasRenderingContext2D:::drawImage:::5 +CanvasRenderingContext2D:::drawImage:::7 +CanvasRenderingContext2D:::fill:::0 +CanvasRenderingContext2D:::fill:::1 +CanvasRenderingContext2D:::fill:::2 +CanvasRenderingContext2D:::fillRect:::4 +CanvasRenderingContext2D:::fillStyle:::1 +CanvasRenderingContext2D:::fillText:::3 +CanvasRenderingContext2D:::fillText:::4 +CanvasRenderingContext2D:::filter:::0 +CanvasRenderingContext2D:::font:::0 +CanvasRenderingContext2D:::getContextAttributes:::0 +CanvasRenderingContext2D:::getImageData:::5 +CanvasRenderingContext2D:::getLineDash:::0 +CanvasRenderingContext2D:::globalAlpha:::0 +CanvasRenderingContext2D:::globalCompositeOperation:::0 +CanvasRenderingContext2D:::imageSmoothingEnabled:::0 +CanvasRenderingContext2D:::imageSmoothingQuality:::0 +CanvasRenderingContext2D:::isContextLost:::0 +CanvasRenderingContext2D:::isPointInPath:::2 +CanvasRenderingContext2D:::isPointInPath:::3 +CanvasRenderingContext2D:::isPointInPath:::4 +CanvasRenderingContext2D:::isPointInStroke:::2 +CanvasRenderingContext2D:::isPointInStroke:::3 +CanvasRenderingContext2D:::lineCap:::0 +CanvasRenderingContext2D:::lineDashOffset:::0 +CanvasRenderingContext2D:::lineJoin:::0 +CanvasRenderingContext2D:::lineWidth:::0 +CanvasRenderingContext2D:::measureText:::1 +CanvasRenderingContext2D:::miterLimit:::0 +CanvasRenderingContext2D:::putImageData:::4 +CanvasRenderingContext2D:::putImageData:::8 +CanvasRenderingContext2D:::removeHitRegion:::1 +CanvasRenderingContext2D:::resetTransform:::0 +CanvasRenderingContext2D:::restore:::0 +CanvasRenderingContext2D:::rotate:::1 +CanvasRenderingContext2D:::save:::0 +CanvasRenderingContext2D:::scale:::2 +CanvasRenderingContext2D:::scrollPathIntoView:::0 +CanvasRenderingContext2D:::scrollPathIntoView:::1 +CanvasRenderingContext2D:::setCurrentTransform:::1 +CanvasRenderingContext2D:::setDirection:::1 +CanvasRenderingContext2D:::setFillStyle:::1 +CanvasRenderingContext2D:::setFilter:::1 +CanvasRenderingContext2D:::setFont:::1 +CanvasRenderingContext2D:::setGlobalAlpha:::1 +CanvasRenderingContext2D:::setGlobalCompositeOperation:::1 +CanvasRenderingContext2D:::setImageSmoothingEnabled:::1 +CanvasRenderingContext2D:::setImageSmoothingQuality:::1 +CanvasRenderingContext2D:::setLineCap:::1 +CanvasRenderingContext2D:::setLineDash:::1 +CanvasRenderingContext2D:::setLineDashOffset:::1 +CanvasRenderingContext2D:::setLineJoin:::1 +CanvasRenderingContext2D:::setLineWidth:::1 +CanvasRenderingContext2D:::setMiterLimit:::1 +CanvasRenderingContext2D:::setShadowBlur:::1 +CanvasRenderingContext2D:::setShadowColor:::1 +CanvasRenderingContext2D:::setShadowOffsetX:::1 +CanvasRenderingContext2D:::setShadowOffsetY:::1 +CanvasRenderingContext2D:::setStrokeStyle:::1 +CanvasRenderingContext2D:::setTextAlign:::1 +CanvasRenderingContext2D:::setTextBaseline:::1 +CanvasRenderingContext2D:::setTransform:::6 +CanvasRenderingContext2D:::shadowBlur:::0 +CanvasRenderingContext2D:::shadowColor:::0 +CanvasRenderingContext2D:::shadowOffsetX:::0 +CanvasRenderingContext2D:::shadowOffsetY:::0 +CanvasRenderingContext2D:::stroke:::0 +CanvasRenderingContext2D:::stroke:::1 +CanvasRenderingContext2D:::strokeRect:::4 +CanvasRenderingContext2D:::strokeStyle:::1 +CanvasRenderingContext2D:::strokeText:::3 +CanvasRenderingContext2D:::strokeText:::4 +CanvasRenderingContext2D:::textAlign:::0 +CanvasRenderingContext2D:::textBaseline:::0 +CanvasRenderingContext2D:::transform:::6 +CanvasRenderingContext2D:::translate:::2 +CanvasRenderingContext:::canvas:::0 +CanvasRenderingContext:::clearRect:::4 +CanvasRenderingContext:::isContextLost:::0 +CanvasRenderingContext:::offscreenCanvas:::0 +CanvasRenderingContext:::setFont:::1 +# C++ class - via blink::Navigator. +CharacterData:::appendData:::1 +CharacterData:::data:::0 +CharacterData:::deleteData:::3 +CharacterData:::insertData:::3 +CharacterData:::length:::0 +CharacterData:::replaceData:::4 +CharacterData:::setData:::1 +CharacterData:::substringData:::3 +ChildNode:::after:::3 +ChildNode:::before:::3 +ChildNode:::remove:::2 +ChildNode:::replaceWith:::3 +ClientRect:::bottom:::0 +ClientRect:::height:::0 +ClientRect:::left:::0 +ClientRectList::::::1 +ClientRectList:::item:::1 +ClientRectList:::length:::0 +ClientRect:::right:::0 +ClientRect:::top:::0 +ClientRect:::width:::0 +ClipboardEvent:::clipboardData:::0 +CloseEvent:::code:::0 +CloseEvent:::reason:::0 +CloseEvent:::wasClean:::0 +CompositionEvent:::data:::0 +CompositionEvent:::initCompositionEvent:::0 +CompositionEvent:::initCompositionEvent:::1 +CompositionEvent:::initCompositionEvent:::2 +CompositionEvent:::initCompositionEvent:::3 +CompositionEvent:::initCompositionEvent:::4 +CompositionEvent:::initCompositionEvent:::5 +CompositorProxy:::disconnect:::0 +CompositorProxy:::initialized:::0 +CompositorProxy:::opacity:::1 +CompositorProxy:::scrollLeft:::1 +CompositorProxy:::scrollTop:::1 +CompositorProxy:::setOpacity:::2 +CompositorProxy:::setScrollLeft:::2 +CompositorProxy:::setScrollTop:::2 +CompositorProxy:::setTransform:::2 +CompositorProxy:::supports:::1 +CompositorProxy:::transform:::1 +CompositorWorkerGlobalScope:::cancelAnimationFrame:::1 +CompositorWorkerGlobalScope:::onmessage:::0 +CompositorWorkerGlobalScope:::postMessage:::3 +CompositorWorkerGlobalScope:::postMessage:::4 +CompositorWorkerGlobalScope:::requestAnimationFrame:::1 +CompositorWorkerGlobalScope:::setOnmessage:::1 +CompositorWorker:::onmessage:::0 +CompositorWorker:::postMessage:::3 +CompositorWorker:::postMessage:::4 +CompositorWorker:::setOnmessage:::1 +CompositorWorker:::terminate:::0 +ConstantSourceNode:::offset:::0 +ContainerNode:::getElementById:::1 +ContainerNode:::getElementsByClassName:::1 +ContainerNode:::getElementsByName:::1 +ContainerNode:::getElementsByTagName:::1 +ContainerNode:::getElementsByTagNameNS:::2 +ConvolverNode:::buffer:::0 +ConvolverNode:::normalize:::0 +ConvolverNode:::setBuffer:::2 +ConvolverNode:::setNormalize:::1 +Coordinates:::accuracy:::0 +Coordinates:::altitude:::1 +Coordinates:::altitudeAccuracy:::1 +Coordinates:::heading:::1 +Coordinates:::latitude:::0 +Coordinates:::longitude:::0 +Coordinates:::speed:::1 +Credential:::id:::0 +CredentialsContainer:::get:::1 +CredentialsContainer:::get:::2 +CredentialsContainer:::requireUserMediation:::1 +CredentialsContainer:::store:::2 +Credential:::type:::0 +Crypto:::getRandomValues:::2 +CryptoKey:::algorithm:::1 +CryptoKey:::extractable:::0 +CryptoKey:::type:::0 +CryptoKey:::usages:::0 +Crypto:::subtle:::0 +CSSAngleValue:::degrees:::0 +CSSAngleValue:::gradians:::0 +CSSAngleValue:::radians:::0 +CSSAngleValue:::turns:::0 +CSSCalcLength:::ch:::1 +CSSCalcLength:::cm:::1 +CSSCalcLength:::em:::1 +CSSCalcLength:::ex:::1 +CSSCalcLength:::in:::1 +CSSCalcLength:::mm:::1 +CSSCalcLength:::pc:::1 +CSSCalcLength:::percent:::1 +CSSCalcLength:::pt:::1 +CSSCalcLength:::px:::1 +CSSCalcLength:::rem:::1 +CSSCalcLength:::vh:::1 +CSSCalcLength:::vmax:::1 +CSSCalcLength:::vmin:::1 +CSSCalcLength:::vw:::1 +CSSConditionRule:::conditionText:::0 +CSSFontFaceRule:::style:::0 +CSSGroupingRule:::cssRules:::0 +CSSGroupingRule:::deleteRule:::2 +CSSGroupingRule:::insertRule:::3 +CSSImportRule:::href:::0 +CSSImportRule:::media:::0 +CSSImportRule:::styleSheet:::0 +CSSKeyframeRule:::keyText:::0 +CSSKeyframeRule:::setKeyText:::2 +CSSKeyframeRule:::style:::0 +CSSKeyframesRule::::::1 +CSSKeyframesRule:::appendRule:::1 +CSSKeyframesRule:::cssRules:::0 +CSSKeyframesRule:::deleteRule:::1 +CSSKeyframesRule:::findRule:::1 +CSSKeyframesRule:::length:::0 +CSSKeyframesRule:::name:::0 +CSSKeyframesRule:::setName:::1 +CSSKeywordValue:::keywordValue:::0 +CSSLengthValue:::add:::1 +CSSLengthValue:::divide:::2 +CSSLengthValue:::from:::2 +CSSLengthValue:::from:::3 +CSSLengthValue:::multiply:::1 +CSSLengthValue:::subtract:::1 +CSSMatrix:::a:::0 +CSSMatrix:::b:::0 +CSSMatrix:::c:::0 +CSSMatrixComponent:::a:::0 +CSSMatrixComponent:::b:::0 +CSSMatrixComponent:::c:::0 +CSSMatrixComponent:::d:::0 +CSSMatrixComponent:::e:::0 +CSSMatrixComponent:::f:::0 +CSSMatrixComponent:::m11:::0 +CSSMatrixComponent:::m12:::0 +CSSMatrixComponent:::m13:::0 +CSSMatrixComponent:::m14:::0 +CSSMatrixComponent:::m21:::0 +CSSMatrixComponent:::m22:::0 +CSSMatrixComponent:::m23:::0 +CSSMatrixComponent:::m24:::0 +CSSMatrixComponent:::m31:::0 +CSSMatrixComponent:::m32:::0 +CSSMatrixComponent:::m33:::0 +CSSMatrixComponent:::m34:::0 +CSSMatrixComponent:::m41:::0 +CSSMatrixComponent:::m42:::0 +CSSMatrixComponent:::m43:::0 +CSSMatrixComponent:::m44:::0 +CSSMatrix:::d:::0 +CSSMatrix:::e:::0 +CSSMatrix:::f:::0 +CSSMatrix:::inverse:::1 +CSSMatrix:::m11:::0 +CSSMatrix:::m12:::0 +CSSMatrix:::m13:::0 +CSSMatrix:::m14:::0 +CSSMatrix:::m21:::0 +CSSMatrix:::m22:::0 +CSSMatrix:::m23:::0 +CSSMatrix:::m24:::0 +CSSMatrix:::m31:::0 +CSSMatrix:::m32:::0 +CSSMatrix:::m33:::0 +CSSMatrix:::m34:::0 +CSSMatrix:::m41:::0 +CSSMatrix:::m42:::0 +CSSMatrix:::m43:::0 +CSSMatrix:::m44:::0 +CSSMatrix:::multiply:::0 +CSSMatrix:::multiply:::1 +CSSMatrix:::rotate:::0 +CSSMatrix:::rotate:::1 +CSSMatrix:::rotate:::2 +CSSMatrix:::rotate:::3 +CSSMatrix:::rotateAxisAngle:::0 +CSSMatrix:::rotateAxisAngle:::1 +CSSMatrix:::rotateAxisAngle:::2 +CSSMatrix:::rotateAxisAngle:::3 +CSSMatrix:::rotateAxisAngle:::4 +CSSMatrix:::scale:::0 +CSSMatrix:::scale:::1 +CSSMatrix:::scale:::2 +CSSMatrix:::scale:::3 +CSSMatrix:::setA:::1 +CSSMatrix:::setB:::1 +CSSMatrix:::setC:::1 +CSSMatrix:::setD:::1 +CSSMatrix:::setE:::1 +CSSMatrix:::setF:::1 +CSSMatrix:::setM11:::1 +CSSMatrix:::setM12:::1 +CSSMatrix:::setM13:::1 +CSSMatrix:::setM14:::1 +CSSMatrix:::setM21:::1 +CSSMatrix:::setM22:::1 +CSSMatrix:::setM23:::1 +CSSMatrix:::setM24:::1 +CSSMatrix:::setM31:::1 +CSSMatrix:::setM32:::1 +CSSMatrix:::setM33:::1 +CSSMatrix:::setM34:::1 +CSSMatrix:::setM41:::1 +CSSMatrix:::setM42:::1 +CSSMatrix:::setM43:::1 +CSSMatrix:::setM44:::1 +CSSMatrix:::setMatrixValue:::1 +CSSMatrix:::setMatrixValue:::2 +CSSMatrix:::skewX:::0 +CSSMatrix:::skewX:::1 +CSSMatrix:::skewY:::0 +CSSMatrix:::skewY:::1 +CSSMatrix:::toString:::0 +CSSMatrix:::translate:::0 +CSSMatrix:::translate:::1 +CSSMatrix:::translate:::2 +CSSMatrix:::translate:::3 +CSSMediaRule:::media:::0 +CSSNamespaceRule:::namespaceURI:::0 +CSSNamespaceRule:::prefix:::0 +CSSNumberValue:::value:::0 +CSSNumericValue:::add:::2 +CSSNumericValue:::div:::2 +CSSNumericValue:::mul:::2 +CSSNumericValue:::parse:::2 +CSSNumericValue:::sub:::2 +CSSNumericValue:::to:::2 +CSSPageRule:::selectorText:::0 +CSSPageRule:::setSelectorText:::1 +CSSPageRule:::style:::0 +CSSPerspective:::length:::0 +CSSPositionValue:::x:::0 +CSSPositionValue:::y:::0 +CSSResourceValue:::state:::0 +CSSRotation:::angle:::0 +CSSRotation:::x:::0 +CSSRotation:::y:::0 +CSSRotation:::z:::0 +CSSRule:::cssRules:::0 +CSSRule:::cssText:::0 +CSSRuleList:::item:::1 +CSSRuleList:::length:::0 +CSSRule:::parentRule:::0 +CSSRule:::parentStyleSheet:::0 +CSSRule:::setCSSText:::1 +CSSRule:::type:::0 +CSSScale:::x:::0 +CSSScale:::y:::0 +CSSScale:::z:::0 +CSSSimpleLength:::unit:::0 +CSSSimpleLength:::value:::0 +CSSSkew:::ax:::0 +CSSSkew:::ay:::0 +CSSStyleDeclaration::::::2 +CSSStyleDeclaration:::cssFloat:::0 +CSSStyleDeclaration:::cssText:::0 +CSSStyleDeclaration:::getPropertyPriority:::1 +CSSStyleDeclaration:::getPropertyValue:::1 +CSSStyleDeclaration:::item:::1 +CSSStyleDeclaration:::length:::0 +CSSStyleDeclaration:::parentRule:::0 +CSSStyleDeclaration:::removeProperty:::2 +CSSStyleDeclaration:::setCSSFloat:::2 +CSSStyleDeclaration:::setCSSText:::2 +CSSStyleDeclaration:::setProperty:::3 +CSSStyleDeclaration:::setProperty:::4 +CSSStyleImageValue:::intrinsicHeight:::1 +CSSStyleImageValue:::intrinsicRatio:::1 +CSSStyleImageValue:::intrinsicWidth:::1 +CSSStyleRule:::selectorText:::0 +CSSStyleRule:::setSelectorText:::1 +CSSStyleRule:::style:::0 +CSSStyleSheet:::addRule:::1 +CSSStyleSheet:::addRule:::2 +CSSStyleSheet:::addRule:::3 +CSSStyleSheet:::addRule:::4 +CSSStyleSheet:::cssRules:::0 +CSSStyleSheet:::deleteRule:::2 +CSSStyleSheet:::insertRule:::2 +CSSStyleSheet:::insertRule:::3 +CSSStyleSheet:::item:::1 +CSSStyleSheet:::ownerRule:::0 +CSSStyleSheet:::removeRule:::1 +CSSStyleSheet:::removeRule:::2 +CSSStyleSheet:::rules:::0 +CSSStyleValue:::cssText:::0 +CSSStyleValue:::parse:::4 +CSSStyleVariableReferenceValue:::fallback:::0 +CSSStyleVariableReferenceValue:::variable:::0 +CSSTransformComponent:::asMatrix:::0 +CSSTransformComponent:::cssText:::0 +CSSTransformComponent:::is2D:::0 +CSSTransformValue:::componentAtIndex:::1 +CSSTransformValue:::is2D:::0 +CSSTransformValue:::length:::0 +CSSTranslation:::x:::0 +CSSTranslation:::y:::0 +CSSTranslation:::z:::0 +CSSUnitValue:::cssType:::0 +CSSUnitValue:::setUnit:::2 +CSSUnitValue:::setValue:::1 +CSSUnitValue:::unit:::0 +CSSUnitValue:::value:::0 +CSSUnparsedValue:::fragmentAtIndex:::2 +CSSUnparsedValue:::length:::0 +CSSURLImageValue:::url:::0 +CSSViewportRule:::style:::0 +CustomElementRegistry:::define:::4 +CustomElementRegistry:::define:::5 +CustomElementRegistry:::get:::1 +CustomElementRegistry:::whenDefined:::3 +CustomEvent:::detail:::0 +CustomEvent:::initCustomEvent:::1 +CustomEvent:::initCustomEvent:::2 +CustomEvent:::initCustomEvent:::3 +CustomEvent:::initCustomEvent:::4 +DatabaseCallback:::handleEvent:::1 +Database:::changeVersion:::2 +Database:::changeVersion:::3 +Database:::changeVersion:::4 +Database:::changeVersion:::5 +Database:::readTransaction:::1 +Database:::readTransaction:::2 +Database:::readTransaction:::3 +Database:::transaction:::1 +Database:::transaction:::2 +Database:::transaction:::3 +Database:::version:::0 +DataTransfer:::clearData:::0 +DataTransfer:::clearData:::1 +DataTransfer:::dropEffect:::0 +DataTransfer:::effectAllowed:::0 +DataTransfer:::files:::0 +DataTransfer:::getData:::1 +DataTransferItemFileSystem:::webkitGetAsEntry:::2 +DataTransferItem:::getAsFile:::0 +DataTransferItem:::getAsString:::2 +DataTransferItem:::kind:::0 +DataTransferItemList:::add:::1 +DataTransferItemList:::add:::3 +DataTransferItemList:::clear:::0 +DataTransferItemList:::deleteItem:::2 +DataTransferItemList:::item:::1 +DataTransferItemList:::length:::0 +DataTransfer:::items:::0 +DataTransferItem:::type:::0 +DataTransfer:::setData:::2 +DataTransfer:::setDragImage:::3 +DataTransfer:::setDropEffect:::1 +DataTransfer:::setEffectAllowed:::1 +DataTransfer:::types:::0 +DedicatedWorkerGlobalScope:::close:::0 +DedicatedWorkerGlobalScope:::onmessage:::0 +DedicatedWorkerGlobalScope:::postMessage:::3 +DedicatedWorkerGlobalScope:::postMessage:::4 +DedicatedWorkerGlobalScope:::setOnmessage:::1 +DelayNode:::delayTime:::0 +DeprecatedStorageInfo:::queryUsageAndQuota:::2 +DeprecatedStorageInfo:::queryUsageAndQuota:::3 +DeprecatedStorageInfo:::queryUsageAndQuota:::4 +DeprecatedStorageInfo:::requestQuota:::3 +DeprecatedStorageInfo:::requestQuota:::4 +DeprecatedStorageInfo:::requestQuota:::5 +DeprecatedStorageQuota:::queryUsageAndQuota:::2 +DeprecatedStorageQuota:::queryUsageAndQuota:::3 +DeprecatedStorageQuota:::requestQuota:::2 +DeprecatedStorageQuota:::requestQuota:::3 +DeprecatedStorageQuota:::requestQuota:::4 +DetectedBarcode:::boundingBox:::0 +DetectedBarcode:::cornerPoints:::0 +DetectedBarcode:::rawValue:::0 +DetectedFace:::boundingBox:::0 +DetectedText:::boundingBox:::0 +DetectedText:::rawValue:::0 +DeviceAcceleration:::x:::1 +DeviceAcceleration:::y:::1 +DeviceAcceleration:::z:::1 +DeviceLightEvent:::value:::0 +DeviceMotionEvent:::acceleration:::0 +DeviceMotionEvent:::accelerationIncludingGravity:::0 +DeviceMotionEvent:::interval:::0 +DeviceMotionEvent:::rotationRate:::0 +DeviceOrientationEvent:::absolute:::0 +DeviceOrientationEvent:::alpha:::1 +DeviceOrientationEvent:::beta:::1 +DeviceOrientationEvent:::gamma:::1 +DeviceRotationRate:::alpha:::1 +DeviceRotationRate:::beta:::1 +DeviceRotationRate:::gamma:::1 +DevToolsHost:::copyText:::1 +DevToolsHostFileSystem:::isolatedFileSystem:::3 +DevToolsHostFileSystem:::upgradeDraggedFileSystemPermissions:::2 +DevToolsHost:::getSelectionBackgroundColor:::0 +DevToolsHost:::getSelectionForegroundColor:::0 +DevToolsHost:::isHostedMode:::0 +DevToolsHost:::isUnderTest:::0 +DevToolsHost:::platform:::0 +DevToolsHost:::sendMessageToEmbedder:::1 +DevToolsHost:::setInjectedScriptForOrigin:::2 +DevToolsHost:::showContextMenuAtPoint:::3 +DevToolsHost:::showContextMenuAtPoint:::4 +DevToolsHost:::zoomFactor:::0 +DictionaryTest:::get:::0 +DictionaryTest:::getDerived:::0 +DictionaryTest:::getDerivedDerived:::0 +DictionaryTest:::getDictionaryMemberProperties:::1 +DictionaryTest:::set:::0 +DictionaryTest:::set:::1 +DictionaryTest:::setDerived:::1 +DictionaryTest:::setDerivedDerived:::1 +DictionaryTest:::stringFromIterable:::3 +DirectoryEntry:::createReader:::0 +DirectoryEntry:::getDirectory:::1 +DirectoryEntry:::getDirectory:::2 +DirectoryEntry:::getDirectory:::3 +DirectoryEntry:::getDirectory:::4 +DirectoryEntry:::getFile:::1 +DirectoryEntry:::getFile:::2 +DirectoryEntry:::getFile:::3 +DirectoryEntry:::getFile:::4 +DirectoryEntry:::removeRecursively:::1 +DirectoryEntry:::removeRecursively:::2 +DirectoryEntrySync:::createReader:::0 +DirectoryEntrySync:::getDirectory:::3 +DirectoryEntrySync:::getFile:::3 +DirectoryEntrySync:::removeRecursively:::1 +DirectoryReader:::readEntries:::1 +DirectoryReader:::readEntries:::2 +DirectoryReaderSync:::readEntries:::1 +Document:::addressSpaceForBindings:::0 +Document:::adoptNode:::2 +Document:::all:::0 +Document:::anchors:::0 +DocumentAnimation:::timeline:::1 +Document:::applets:::0 +Document:::body:::0 +Document:::caretRangeFromPoint:::0 +Document:::caretRangeFromPoint:::1 +Document:::caretRangeFromPoint:::2 +Document:::characterSet:::0 +Document:::close:::1 +Document:::compatMode:::0 +Document:::contentType:::0 +Document:::cookie:::1 +Document:::createAttribute:::2 +Document:::createAttributeNS:::3 +Document:::createCDATASection:::2 +Document:::createComment:::1 +Document:::createDocumentFragment:::0 +Document:::createElement:::2 +Document:::createElement:::3 +Document:::createElementNS:::3 +Document:::createElementNS:::4 +Document:::createEvent:::3 +Document:::createNodeIterator:::1 +Document:::createNodeIterator:::2 +Document:::createNodeIterator:::3 +Document:::createProcessingInstruction:::3 +Document:::createRange:::0 +Document:::createTextNode:::1 +Document:::createTouch:::10 +Document:::createTouch:::11 +Document:::createTouch:::7 +Document:::createTouch:::8 +Document:::createTouch:::9 +Document:::createTouchList:::1 +Document:::createTreeWalker:::1 +Document:::createTreeWalker:::2 +Document:::createTreeWalker:::3 +Document:::currentScriptForBinding:::0 +Document:::currentScriptForBinding:::1 +Document:::designMode:::0 +Document:::dir:::0 +Document:::doctype:::0 +Document:::documentElement:::0 +Document:::domain:::0 +Document:::domWindow:::0 +Document:::embeds:::0 +Document:::execCommand:::2 +Document:::execCommand:::3 +Document:::execCommand:::4 +Document:::exitPointerLock:::0 +DocumentFontFaceSet:::fonts:::1 +Document:::forms:::0 +DocumentFullscreen:::currentFullScreenElement:::1 +DocumentFullscreen:::exitFullscreen:::1 +DocumentFullscreen:::fullscreenElement:::1 +DocumentFullscreen:::fullscreenEnabled:::1 +DocumentFullscreen:::onfullscreenchange:::1 +DocumentFullscreen:::onfullscreenerror:::1 +DocumentFullscreen:::onwebkitfullscreenchange:::1 +DocumentFullscreen:::onwebkitfullscreenerror:::1 +DocumentFullscreen:::setOnfullscreenchange:::2 +DocumentFullscreen:::setOnfullscreenerror:::2 +DocumentFullscreen:::setOnwebkitfullscreenchange:::2 +DocumentFullscreen:::setOnwebkitfullscreenerror:::2 +Document:::getElementsByClassName:::1 +Document:::getElementsByName:::1 +Document:::getElementsByTagName:::1 +Document:::getElementsByTagNameNS:::2 +Document:::hasFocus:::0 +Document:::head:::0 +Document:::hidden:::0 +Document:::images:::0 +Document:::implementation:::0 +Document:::importNode:::2 +Document:::importNode:::3 +Document:::lastModified:::0 +Document:::links:::0 +Document:::location:::0 +Document:::onbeforecopy:::0 +Document:::onbeforecut:::0 +Document:::onbeforepaste:::0 +Document:::oncopy:::0 +Document:::oncut:::0 +Document:::onpaste:::0 +Document:::onpointerlockchange:::0 +Document:::onpointerlockerror:::0 +Document:::onreadystatechange:::0 +Document:::onsearch:::0 +Document:::onsecuritypolicyviolation:::0 +Document:::onselectionchange:::0 +Document:::onselectstart:::0 +Document:::onwheel:::0 +Document:::open:::1 +Document:::origin:::0 +DocumentOrShadowRoot:::activeElement:::1 +DocumentOrShadowRoot:::elementFromPoint:::3 +DocumentOrShadowRoot:::elementsFromPoint:::3 +DocumentOrShadowRoot:::fullscreenElement:::1 +DocumentOrShadowRoot:::getSelection:::1 +DocumentOrShadowRoot:::pointerLockElement:::1 +DocumentOrShadowRoot:::styleSheets:::1 +Document:::preferredStylesheetSet:::0 +Document:::queryCommandEnabled:::2 +Document:::queryCommandIndeterm:::2 +Document:::queryCommandState:::2 +Document:::queryCommandSupported:::2 +Document:::queryCommandValue:::2 +Document:::readyState:::0 +Document:::referrer:::0 +Document:::registerElement:::3 +Document:::registerElement:::4 +Document:::rootScroller:::0 +Document:::scripts:::0 +Document:::scrollingElement:::0 +Document:::selectedStylesheetSet:::0 +Document:::setBody:::2 +Document:::setCookie:::2 +Document:::setDesignMode:::1 +Document:::setDir:::1 +Document:::setDomain:::2 +Document:::setOnbeforecopy:::1 +Document:::setOnbeforecut:::1 +Document:::setOnbeforepaste:::1 +Document:::setOncopy:::1 +Document:::setOncut:::1 +Document:::setOnpaste:::1 +Document:::setOnpointerlockchange:::1 +Document:::setOnpointerlockerror:::1 +Document:::setOnreadystatechange:::1 +Document:::setOnsearch:::1 +Document:::setOnsecuritypolicyviolation:::1 +Document:::setOnselectionchange:::1 +Document:::setOnselectstart:::1 +Document:::setOnwheel:::1 +Document:::setRootScroller:::2 +Document:::setSelectedStylesheetSet:::1 +Document:::setTitle:::1 +Document:::setXMLStandalone:::2 +Document:::setXMLVersion:::2 +Document:::suborigin:::0 +Document:::title:::0 +DocumentType:::name:::0 +DocumentType:::publicId:::0 +DocumentType:::systemId:::0 +Document:::urlForBinding:::0 +Document:::visibilityState:::0 +Document:::write:::3 +Document:::writeln:::3 +Document:::xmlEncoding:::0 +Document:::xmlStandalone:::0 +Document:::xmlVersion:::0 +DocumentXPathEvaluator:::createExpression:::3 +DocumentXPathEvaluator:::createExpression:::4 +DocumentXPathEvaluator:::createNSResolver:::2 +DocumentXPathEvaluator:::evaluate:::4 +DocumentXPathEvaluator:::evaluate:::5 +DocumentXPathEvaluator:::evaluate:::6 +DocumentXPathEvaluator:::evaluate:::7 +DOMArrayBuffer:::byteLength:::0 +DOMArrayBufferView:::buffer:::0 +DOMArrayBufferView:::byteLength:::0 +DOMArrayBufferView:::byteOffset:::0 +DOMError:::message:::0 +DOMError:::name:::0 +DOMException:::code:::0 +DOMException:::message:::0 +DOMException:::name:::0 +DOMException:::toString:::0 +DOMFileSystemBase:::name:::0 +DOMFileSystem:::name:::0 +DOMFileSystem:::root:::0 +DOMFileSystemSync:::name:::0 +DOMFileSystemSync:::root:::0 +DOMImplementation:::createDocument:::3 +DOMImplementation:::createDocument:::4 +DOMImplementation:::createDocumentType:::4 +DOMImplementation:::createHTMLDocument:::0 +DOMImplementation:::createHTMLDocument:::1 +DOMImplementation:::hasFeature:::0 +DOMMatrix:::a:::0 +DOMMatrix:::b:::0 +DOMMatrix:::c:::0 +DOMMatrix:::d:::0 +DOMMatrix:::e:::0 +DOMMatrix:::f:::0 +DOMMatrix:::fromFloat32Array:::2 +DOMMatrix:::fromFloat64Array:::2 +DOMMatrix:::fromMatrix:::1 +DOMMatrix:::fromMatrix:::2 +DOMMatrix:::invertSelf:::0 +DOMMatrix:::m11:::0 +DOMMatrix:::m12:::0 +DOMMatrix:::m13:::0 +DOMMatrix:::m14:::0 +DOMMatrix:::m21:::0 +DOMMatrix:::m22:::0 +DOMMatrix:::m23:::0 +DOMMatrix:::m24:::0 +DOMMatrix:::m31:::0 +DOMMatrix:::m32:::0 +DOMMatrix:::m33:::0 +DOMMatrix:::m34:::0 +DOMMatrix:::m41:::0 +DOMMatrix:::m42:::0 +DOMMatrix:::m43:::0 +DOMMatrix:::m44:::0 +DOMMatrix:::multiplySelf:::1 +DOMMatrix:::multiplySelf:::2 +DOMMatrix:::preMultiplySelf:::1 +DOMMatrix:::preMultiplySelf:::2 +DOMMatrixReadOnly:::a:::0 +DOMMatrixReadOnly:::b:::0 +DOMMatrixReadOnly:::c:::0 +DOMMatrixReadOnly:::d:::0 +DOMMatrixReadOnly:::e:::0 +DOMMatrixReadOnly:::f:::0 +DOMMatrixReadOnly:::flipX:::0 +DOMMatrixReadOnly:::flipY:::0 +DOMMatrixReadOnly:::fromFloat32Array:::2 +DOMMatrixReadOnly:::fromFloat64Array:::2 +DOMMatrixReadOnly:::fromMatrix:::1 +DOMMatrixReadOnly:::fromMatrix:::2 +DOMMatrixReadOnly:::inverse:::0 +DOMMatrixReadOnly:::is2D:::0 +DOMMatrixReadOnly:::isIdentity:::0 +DOMMatrixReadOnly:::m11:::0 +DOMMatrixReadOnly:::m12:::0 +DOMMatrixReadOnly:::m13:::0 +DOMMatrixReadOnly:::m14:::0 +DOMMatrixReadOnly:::m21:::0 +DOMMatrixReadOnly:::m22:::0 +DOMMatrixReadOnly:::m23:::0 +DOMMatrixReadOnly:::m24:::0 +DOMMatrixReadOnly:::m31:::0 +DOMMatrixReadOnly:::m32:::0 +DOMMatrixReadOnly:::m33:::0 +DOMMatrixReadOnly:::m34:::0 +DOMMatrixReadOnly:::m41:::0 +DOMMatrixReadOnly:::m42:::0 +DOMMatrixReadOnly:::m43:::0 +DOMMatrixReadOnly:::m44:::0 +DOMMatrixReadOnly:::multiply:::1 +DOMMatrixReadOnly:::multiply:::2 +DOMMatrixReadOnly:::rotate:::0 +DOMMatrixReadOnly:::rotate:::1 +DOMMatrixReadOnly:::rotate:::2 +DOMMatrixReadOnly:::rotate:::3 +DOMMatrixReadOnly:::rotateAxisAngle:::0 +DOMMatrixReadOnly:::rotateAxisAngle:::1 +DOMMatrixReadOnly:::rotateAxisAngle:::2 +DOMMatrixReadOnly:::rotateAxisAngle:::3 +DOMMatrixReadOnly:::rotateAxisAngle:::4 +DOMMatrixReadOnly:::rotateFromVector:::0 +DOMMatrixReadOnly:::rotateFromVector:::1 +DOMMatrixReadOnly:::rotateFromVector:::2 +DOMMatrixReadOnly:::scale:::0 +DOMMatrixReadOnly:::scale:::1 +DOMMatrixReadOnly:::scale:::2 +DOMMatrixReadOnly:::scale:::3 +DOMMatrixReadOnly:::scale3d:::0 +DOMMatrixReadOnly:::scale3d:::1 +DOMMatrixReadOnly:::scale3d:::2 +DOMMatrixReadOnly:::scale3d:::3 +DOMMatrixReadOnly:::scale3d:::4 +DOMMatrixReadOnly:::scale:::4 +DOMMatrixReadOnly:::scale:::5 +DOMMatrixReadOnly:::scale:::6 +DOMMatrixReadOnly:::skewX:::0 +DOMMatrixReadOnly:::skewX:::1 +DOMMatrixReadOnly:::skewY:::0 +DOMMatrixReadOnly:::skewY:::1 +DOMMatrixReadOnly:::toFloat32Array:::0 +DOMMatrixReadOnly:::toFloat64Array:::0 +DOMMatrixReadOnly:::toJSONForBinding:::0 +DOMMatrixReadOnly:::toString:::0 +DOMMatrixReadOnly:::transformPoint:::0 +DOMMatrixReadOnly:::transformPoint:::1 +DOMMatrixReadOnly:::translate:::0 +DOMMatrixReadOnly:::translate:::1 +DOMMatrixReadOnly:::translate:::2 +DOMMatrixReadOnly:::translate:::3 +DOMMatrix:::rotateAxisAngleSelf:::0 +DOMMatrix:::rotateAxisAngleSelf:::1 +DOMMatrix:::rotateAxisAngleSelf:::2 +DOMMatrix:::rotateAxisAngleSelf:::3 +DOMMatrix:::rotateAxisAngleSelf:::4 +DOMMatrix:::rotateFromVectorSelf:::0 +DOMMatrix:::rotateFromVectorSelf:::1 +DOMMatrix:::rotateFromVectorSelf:::2 +DOMMatrix:::rotateSelf:::0 +DOMMatrix:::rotateSelf:::1 +DOMMatrix:::rotateSelf:::2 +DOMMatrix:::rotateSelf:::3 +DOMMatrix:::scale3dSelf:::0 +DOMMatrix:::scale3dSelf:::1 +DOMMatrix:::scale3dSelf:::2 +DOMMatrix:::scale3dSelf:::3 +DOMMatrix:::scale3dSelf:::4 +DOMMatrix:::scaleSelf:::0 +DOMMatrix:::scaleSelf:::1 +DOMMatrix:::scaleSelf:::2 +DOMMatrix:::scaleSelf:::3 +DOMMatrix:::scaleSelf:::4 +DOMMatrix:::scaleSelf:::5 +DOMMatrix:::scaleSelf:::6 +DOMMatrix:::setA:::1 +DOMMatrix:::setB:::1 +DOMMatrix:::setC:::1 +DOMMatrix:::setD:::1 +DOMMatrix:::setE:::1 +DOMMatrix:::setF:::1 +DOMMatrix:::setM11:::1 +DOMMatrix:::setM12:::1 +DOMMatrix:::setM13:::1 +DOMMatrix:::setM14:::1 +DOMMatrix:::setM21:::1 +DOMMatrix:::setM22:::1 +DOMMatrix:::setM23:::1 +DOMMatrix:::setM24:::1 +DOMMatrix:::setM31:::1 +DOMMatrix:::setM32:::1 +DOMMatrix:::setM33:::1 +DOMMatrix:::setM34:::1 +DOMMatrix:::setM41:::1 +DOMMatrix:::setM42:::1 +DOMMatrix:::setM43:::1 +DOMMatrix:::setM44:::1 +DOMMatrix:::setMatrixValue:::2 +DOMMatrix:::skewXSelf:::0 +DOMMatrix:::skewXSelf:::1 +DOMMatrix:::skewYSelf:::0 +DOMMatrix:::skewYSelf:::1 +DOMMatrix:::translateSelf:::0 +DOMMatrix:::translateSelf:::1 +DOMMatrix:::translateSelf:::2 +DOMMatrix:::translateSelf:::3 +DOMMimeTypeArray:::item:::1 +DOMMimeTypeArray:::length:::0 +DOMMimeTypeArray:::namedItem:::1 +DOMMimeType:::description:::0 +DOMMimeType:::enabledPlugin:::0 +DOMMimeType:::suffixes:::0 +DOMMimeType:::type:::0 +DOMParser:::parseFromString:::2 +DOMPluginArray:::item:::1 +DOMPluginArray:::length:::0 +DOMPluginArray:::namedItem:::1 +DOMPluginArray:::refresh:::0 +DOMPluginArray:::refresh:::1 +DOMPlugin:::description:::0 +DOMPlugin:::filename:::0 +DOMPlugin:::item:::1 +DOMPlugin:::length:::0 +DOMPlugin:::name:::0 +DOMPlugin:::namedItem:::1 +DOMPoint:::fromPoint:::0 +DOMPoint:::fromPoint:::1 +DOMPointReadOnly:::fromPoint:::0 +DOMPointReadOnly:::fromPoint:::1 +DOMPointReadOnly:::matrixTransform:::1 +DOMPointReadOnly:::matrixTransform:::2 +DOMPointReadOnly:::toJSONForBinding:::0 +DOMPointReadOnly:::w:::0 +DOMPointReadOnly:::x:::0 +DOMPointReadOnly:::y:::0 +DOMPointReadOnly:::z:::0 +DOMPoint:::setW:::1 +DOMPoint:::setX:::1 +DOMPoint:::setY:::1 +DOMPoint:::setZ:::1 +DOMPoint:::w:::0 +DOMPoint:::x:::0 +DOMPoint:::y:::0 +DOMPoint:::z:::0 +DOMQuad:::fromQuad:::0 +DOMQuad:::fromQuad:::1 +DOMQuad:::fromRect:::0 +DOMQuad:::fromRect:::1 +DOMQuad:::getBounds:::0 +DOMQuad:::p1:::0 +DOMQuad:::p2:::0 +DOMQuad:::p3:::0 +DOMQuad:::p4:::0 +DOMQuad:::toJSONForBinding:::0 +DOMRect:::fromRect:::0 +DOMRect:::fromRect:::1 +DOMRect:::height:::0 +DOMRectReadOnly:::bottom:::0 +DOMRectReadOnly:::fromRect:::0 +DOMRectReadOnly:::fromRect:::1 +DOMRectReadOnly:::height:::0 +DOMRectReadOnly:::left:::0 +DOMRectReadOnly:::right:::0 +DOMRectReadOnly:::toJSONForBinding:::0 +DOMRectReadOnly:::top:::0 +DOMRectReadOnly:::width:::0 +DOMRectReadOnly:::x:::0 +DOMRectReadOnly:::y:::0 +DOMRect:::setHeight:::1 +DOMRect:::setWidth:::1 +DOMRect:::setX:::1 +DOMRect:::setY:::1 +DOMRect:::width:::0 +DOMRect:::x:::0 +DOMRect:::y:::0 +DOMSelection:::addRange:::1 +DOMSelection:::anchorNode:::0 +DOMSelection:::anchorOffset:::0 +DOMSelection:::baseNode:::0 +DOMSelection:::baseOffset:::0 +DOMSelection:::collapse:::2 +DOMSelection:::collapse:::3 +DOMSelection:::collapseToEnd:::1 +DOMSelection:::collapseToStart:::1 +DOMSelection:::containsNode:::1 +DOMSelection:::containsNode:::2 +DOMSelection:::deleteFromDocument:::0 +DOMSelection:::empty:::0 +DOMSelection:::extend:::2 +DOMSelection:::extend:::3 +DOMSelection:::extentNode:::0 +DOMSelection:::extentOffset:::0 +DOMSelection:::focusNode:::0 +DOMSelection:::focusOffset:::0 +DOMSelection:::getRangeAt:::2 +DOMSelection:::isCollapsed:::0 +DOMSelection:::modify:::0 +DOMSelection:::modify:::1 +DOMSelection:::modify:::2 +DOMSelection:::modify:::3 +DOMSelection:::rangeCount:::0 +DOMSelection:::removeAllRanges:::0 +DOMSelection:::removeRange:::1 +DOMSelection:::selectAllChildren:::2 +DOMSelection:::setBaseAndExtent:::5 +DOMSelection:::toString:::0 +DOMSelection:::type:::0 +DOMSharedArrayBuffer:::byteLength:::0 +DOMStringList:::contains:::1 +DOMStringList:::item:::1 +DOMStringList:::length:::0 +DOMStringMap::::::1 +DOMStringMap::::::3 +DOMStringMap:::item:::1 +DOMTokenList:::add:::2 +DOMTokenList:::contains:::2 +DOMTokenList:::item:::1 +DOMTokenList:::length:::0 +DOMTokenList:::remove:::2 +DOMTokenList:::setValue:::1 +DOMTokenList:::supports:::2 +DOMTokenList:::toggle:::2 +DOMTokenList:::toggle:::3 +DOMTokenList:::toString:::0 +DOMTokenList:::value:::0 +DOMURL:::hash:::0 +DOMURL:::host:::0 +DOMURL:::hostname:::0 +DOMURL:::href:::0 +DOMURL:::origin:::0 +DOMURL:::password:::0 +DOMURL:::pathname:::0 +DOMURL:::port:::0 +DOMURL:::protocol:::0 +DOMURL:::search:::0 +DOMURL:::searchParams:::0 +DOMURL:::setHash:::1 +DOMURL:::setHost:::1 +DOMURL:::setHostname:::1 +DOMURL:::setHref:::1 +DOMURL:::setPassword:::1 +DOMURL:::setPathname:::1 +DOMURL:::setPort:::1 +DOMURL:::setProtocol:::1 +DOMURL:::setSearch:::1 +DOMURL:::setUsername:::1 +DOMURL:::username:::0 +DOMURLUtilsReadOnly:::hash:::0 +DOMURLUtilsReadOnly:::host:::0 +DOMURLUtilsReadOnly:::hostname:::0 +DOMURLUtilsReadOnly:::href:::0 +DOMURLUtilsReadOnly:::origin:::0 +DOMURLUtilsReadOnly:::password:::0 +DOMURLUtilsReadOnly:::pathname:::0 +DOMURLUtilsReadOnly:::port:::0 +DOMURLUtilsReadOnly:::protocol:::0 +DOMURLUtilsReadOnly:::search:::0 +DOMURLUtilsReadOnly:::username:::0 +DOMURLUtils:::setHash:::1 +DOMURLUtils:::setHost:::1 +DOMURLUtils:::setHostname:::1 +DOMURLUtils:::setHref:::1 +DOMURLUtils:::setPassword:::1 +DOMURLUtils:::setPathname:::1 +DOMURLUtils:::setPort:::1 +DOMURLUtils:::setProtocol:::1 +DOMURLUtils:::setSearch:::1 +DOMURLUtils:::setUsername:::1 +DOMVisualViewport:::clientHeight:::0 +DOMVisualViewport:::clientWidth:::0 +DOMVisualViewport:::pageX:::0 +DOMVisualViewport:::pageY:::0 +DOMVisualViewport:::scale:::0 +DOMVisualViewport:::scrollLeft:::0 +DOMVisualViewport:::scrollTop:::0 +DOMWebSocket:::binaryType:::0 +DOMWebSocket:::bufferedAmount:::0 +DOMWebSocket:::close:::1 +DOMWebSocket:::close:::2 +DOMWebSocket:::close:::3 +DOMWebSocket:::extensions:::0 +DOMWebSocket:::onclose:::0 +DOMWebSocket:::onerror:::0 +DOMWebSocket:::onmessage:::0 +DOMWebSocket:::onopen:::0 +DOMWebSocket:::protocol:::0 +DOMWebSocket:::readyState:::0 +DOMWebSocket:::send:::2 +DOMWebSocket:::setBinaryType:::1 +DOMWebSocket:::setOnclose:::1 +DOMWebSocket:::setOnerror:::1 +DOMWebSocket:::setOnmessage:::1 +DOMWebSocket:::setOnopen:::1 +DOMWebSocket:::url:::0 +DOMWindow::::::1 +DOMWindow:::alert:::1 +DOMWindow:::alert:::2 +DOMWindow:::applicationCache:::0 +DOMWindowBase64:::atob:::2 +DOMWindowBase64:::btoa:::2 +DOMWindow:::blur:::0 +DOMWindow:::cancelAnimationFrame:::1 +DOMWindow:::cancelIdleCallback:::1 +DOMWindow:::captureEvents:::0 +DOMWindow:::clientInformation:::0 +DOMWindow:::close:::1 +DOMWindow:::closed:::0 +DOMWindow:::confirm:::1 +DOMWindow:::confirm:::2 +DOMWindowCrypto:::crypto:::1 +DOMWindowCSS:::escape:::1 +DOMWindowCSS:::supports:::1 +DOMWindowCSS:::supports:::2 +DOMWindow:::customElements:::1 +DOMWindow:::defaultStatus:::0 +DOMWindowDeviceLight:::ondevicelight:::1 +DOMWindowDeviceLight:::setOndevicelight:::2 +DOMWindowDeviceMotion:::ondevicemotion:::1 +DOMWindowDeviceMotion:::setOndevicemotion:::2 +DOMWindowDeviceOrientation:::ondeviceorientation:::1 +DOMWindowDeviceOrientation:::ondeviceorientationabsolute:::1 +DOMWindowDeviceOrientation:::setOndeviceorientation:::2 +DOMWindowDeviceOrientation:::setOndeviceorientationabsolute:::2 +DOMWindow:::devicePixelRatio:::0 +DOMWindow:::document:::0 +DOMWindow:::event:::0 +DOMWindowEventHandlers:::onbeforeunload:::1 +DOMWindowEventHandlers:::onhashchange:::1 +DOMWindowEventHandlers:::onlanguagechange:::1 +DOMWindowEventHandlers:::onmessage:::1 +DOMWindowEventHandlers:::onoffline:::1 +DOMWindowEventHandlers:::ononline:::1 +DOMWindowEventHandlers:::onpagehide:::1 +DOMWindowEventHandlers:::onpageshow:::1 +DOMWindowEventHandlers:::onpopstate:::1 +DOMWindowEventHandlers:::onrejectionhandled:::1 +DOMWindowEventHandlers:::onstorage:::1 +DOMWindowEventHandlers:::onunhandledrejection:::1 +DOMWindowEventHandlers:::onunload:::1 +DOMWindowEventHandlers:::setOnbeforeunload:::2 +DOMWindowEventHandlers:::setOnhashchange:::2 +DOMWindowEventHandlers:::setOnlanguagechange:::2 +DOMWindowEventHandlers:::setOnmessage:::2 +DOMWindowEventHandlers:::setOnoffline:::2 +DOMWindowEventHandlers:::setOnonline:::2 +DOMWindowEventHandlers:::setOnpagehide:::2 +DOMWindowEventHandlers:::setOnpageshow:::2 +DOMWindowEventHandlers:::setOnpopstate:::2 +DOMWindowEventHandlers:::setOnrejectionhandled:::2 +DOMWindowEventHandlers:::setOnstorage:::2 +DOMWindowEventHandlers:::setOnunhandledrejection:::2 +DOMWindowEventHandlers:::setOnunload:::2 +DOMWindow:::external:::0 +DOMWindowFileSystem:::webkitRequestFileSystem:::4 +DOMWindowFileSystem:::webkitRequestFileSystem:::5 +DOMWindowFileSystem:::webkitResolveLocalFileSystemURL:::3 +DOMWindowFileSystem:::webkitResolveLocalFileSystemURL:::4 +DOMWindow:::find:::0 +DOMWindow:::find:::1 +DOMWindow:::find:::2 +DOMWindow:::find:::3 +DOMWindow:::find:::4 +DOMWindow:::find:::5 +DOMWindow:::find:::6 +DOMWindow:::find:::7 +DOMWindow:::focus:::1 +DOMWindow:::frameElement:::0 +DOMWindow:::frames:::0 +DOMWindow:::getComputedStyle:::1 +DOMWindow:::getComputedStyle:::2 +DOMWindow:::getMatchedCSSRules:::0 +DOMWindow:::getMatchedCSSRules:::1 +DOMWindow:::getMatchedCSSRules:::2 +DOMWindow:::getSelection:::0 +DOMWindow:::history:::0 +DOMWindow:::innerHeight:::0 +DOMWindow:::innerWidth:::0 +DOMWindow:::isSecureContext:::0 +DOMWindow:::length:::0 +DOMWindow:::location:::0 +DOMWindow:::locationbar:::0 +DOMWindow:::matchMedia:::1 +DOMWindowMediaStream:::setWebkitMediaStream:::2 +DOMWindowMediaStream:::setWebkitRTCPeerConnection:::2 +DOMWindowMediaStream:::webkitMediaStream:::1 +DOMWindowMediaStream:::webkitRTCPeerConnection:::1 +DOMWindow:::menubar:::0 +DOMWindow:::moveBy:::2 +DOMWindow:::moveTo:::2 +DOMWindow:::name:::0 +DOMWindow:::navigator:::0 +DOMWindow:::offscreenBuffering:::0 +DOMWindow:::onanimationend:::0 +DOMWindow:::onanimationiteration:::0 +DOMWindow:::onanimationstart:::0 +DOMWindow:::onorientationchange:::0 +DOMWindow:::onsearch:::0 +DOMWindow:::ontransitionend:::0 +DOMWindow:::onwebkitanimationend:::0 +DOMWindow:::onwebkitanimationiteration:::0 +DOMWindow:::onwebkitanimationstart:::0 +DOMWindow:::onwebkittransitionend:::0 +DOMWindow:::onwheel:::0 +DOMWindow:::open:::2 +DOMWindow:::open:::3 +DOMWindow:::opener:::0 +DOMWindow:::orientation:::0 +DOMWindow:::origin:::0 +DOMWindow:::outerHeight:::0 +DOMWindow:::outerWidth:::0 +DOMWindow:::pageXOffset:::0 +DOMWindow:::pageYOffset:::0 +DOMWindow:::parent:::0 +DOMWindowPerformance:::performance:::1 +DOMWindow:::personalbar:::0 +DOMWindow:::postMessage:::3 +DOMWindow:::postMessage:::4 +DOMWindow:::print:::1 +DOMWindow:::prompt:::1 +DOMWindow:::prompt:::2 +DOMWindow:::prompt:::3 +DOMWindowQuota:::webkitStorageInfo:::1 +DOMWindow:::releaseEvents:::0 +DOMWindow:::requestAnimationFrame:::1 +DOMWindow:::requestIdleCallback:::1 +DOMWindow:::requestIdleCallback:::2 +DOMWindow:::resizeBy:::2 +DOMWindow:::resizeTo:::2 +DOMWindow:::screen:::0 +DOMWindow:::screenLeft:::0 +DOMWindow:::screenTop:::0 +DOMWindow:::screenX:::0 +DOMWindow:::screenY:::0 +DOMWindow:::scroll:::0 +DOMWindow:::scroll:::1 +DOMWindow:::scroll:::2 +DOMWindow:::scrollbars:::0 +DOMWindow:::scrollBy:::0 +DOMWindow:::scrollBy:::1 +DOMWindow:::scrollBy:::2 +DOMWindow:::scrollTo:::0 +DOMWindow:::scrollTo:::1 +DOMWindow:::scrollTo:::2 +DOMWindow:::scrollX:::0 +DOMWindow:::scrollY:::0 +DOMWindow:::self:::0 +DOMWindow:::setDefaultStatus:::1 +DOMWindow:::setEvent:::1 +DOMWindow:::setName:::1 +DOMWindow:::setOnanimationend:::1 +DOMWindow:::setOnanimationiteration:::1 +DOMWindow:::setOnanimationstart:::1 +DOMWindow:::setOnorientationchange:::1 +DOMWindow:::setOnsearch:::1 +DOMWindow:::setOntransitionend:::1 +DOMWindow:::setOnwebkitanimationend:::1 +DOMWindow:::setOnwebkitanimationiteration:::1 +DOMWindow:::setOnwebkitanimationstart:::1 +DOMWindow:::setOnwebkittransitionend:::1 +DOMWindow:::setOnwheel:::1 +DOMWindow:::setOpener:::1 +DOMWindow:::setStatus:::1 +DOMWindow:::setWebKitAnimationEvent:::1 +DOMWindow:::setWebKitMutationObserver:::1 +DOMWindow:::setWebKitTransitionEvent:::1 +DOMWindow:::setWebkitURL:::1 +DOMWindowSpeech:::setWebkitSpeechGrammar:::2 +DOMWindowSpeech:::setWebkitSpeechGrammarList:::2 +DOMWindowSpeech:::setWebkitSpeechRecognition:::2 +DOMWindowSpeech:::setWebkitSpeechRecognitionError:::2 +DOMWindowSpeech:::setWebkitSpeechRecognitionEvent:::2 +DOMWindowSpeechSynthesis:::speechSynthesis:::2 +DOMWindowSpeech:::webkitSpeechGrammar:::1 +DOMWindowSpeech:::webkitSpeechGrammarList:::1 +DOMWindowSpeech:::webkitSpeechRecognition:::1 +DOMWindowSpeech:::webkitSpeechRecognitionError:::1 +DOMWindowSpeech:::webkitSpeechRecognitionEvent:::1 +DOMWindow:::status:::0 +DOMWindow:::statusbar:::0 +DOMWindow:::stop:::0 +DOMWindowStorage:::localStorage:::2 +DOMWindowStorage:::sessionStorage:::2 +DOMWindow:::styleMedia:::0 +DOMWindowTimers:::clearInterval:::1 +DOMWindowTimers:::clearInterval:::2 +DOMWindowTimers:::clearTimeout:::1 +DOMWindowTimers:::clearTimeout:::2 +DOMWindowTimers:::setInterval:::4 +DOMWindowTimers:::setInterval:::5 +DOMWindowTimers:::setTimeout:::4 +DOMWindowTimers:::setTimeout:::5 +DOMWindow:::toolbar:::0 +DOMWindow:::top:::0 +DOMWindow:::visualViewport:::0 +DOMWindowWebDatabase:::openDatabase:::6 +DOMWindowWebDatabase:::openDatabase:::7 +DOMWindow:::webKitAnimationEvent:::0 +DOMWindow:::webKitMutationObserver:::0 +DOMWindow:::webkitRequestAnimationFrame:::1 +DOMWindow:::webKitTransitionEvent:::0 +DOMWindow:::webkitURL:::0 +DOMWindow:::window:::0 +DragEvent:::getDataTransfer:::0 +DynamicsCompressorNode:::attack:::0 +DynamicsCompressorNode:::knee:::0 +DynamicsCompressorNode:::ratio:::0 +DynamicsCompressorNode:::reduction:::0 +DynamicsCompressorNode:::release:::0 +DynamicsCompressorNode:::threshold:::0 +Element:::accessibleNode:::0 +ElementAnimation:::animate:::4 +ElementAnimation:::animate:::5 +ElementAnimation:::getAnimations:::1 +Element:::assignedSlotForBinding:::0 +Element:::attachShadow:::3 +Element:::attributesForBindings:::0 +Element:::blur:::0 +Element:::classList:::0 +Element:::clientHeight:::0 +Element:::clientLeft:::0 +Element:::clientTop:::0 +Element:::clientWidth:::0 +Element:::closest:::2 +Element:::computedName:::0 +Element:::computedRole:::0 +Element:::createShadowRoot:::2 +Element:::dataset:::0 +Element:::focus:::1 +ElementFullscreen:::onwebkitfullscreenchange:::1 +ElementFullscreen:::onwebkitfullscreenerror:::1 +ElementFullscreen:::requestFullscreen:::1 +ElementFullscreen:::setOnwebkitfullscreenchange:::2 +ElementFullscreen:::setOnwebkitfullscreenerror:::2 +ElementFullscreen:::webkitRequestFullscreen:::1 +Element:::getAttribute:::1 +Element:::getAttributeNode:::1 +Element:::getAttributeNodeNS:::2 +Element:::getAttributeNS:::2 +Element:::getBoundingClientRect:::0 +Element:::getClientRects:::0 +Element:::getDestinationInsertionPoints:::0 +Element:::getElementsByClassName:::1 +Element:::getElementsByTagName:::1 +Element:::getElementsByTagNameNS:::2 +Element:::hasAttribute:::1 +Element:::hasAttributeNS:::2 +Element:::hasAttributes:::0 +Element:::hasPointerCapture:::1 +Element:::innerHTML:::0 +Element:::innerText:::0 +Element:::insertAdjacentElement:::3 +Element:::insertAdjacentHTML:::3 +Element:::insertAdjacentText:::3 +Element:::localName:::0 +Element:::matches:::2 +Element:::namespaceURI:::0 +Element:::onbeforecopy:::0 +Element:::onbeforecut:::0 +Element:::onbeforepaste:::0 +Element:::oncopy:::0 +Element:::oncut:::0 +Element:::onpaste:::0 +Element:::onsearch:::0 +Element:::onselectstart:::0 +Element:::onwheel:::0 +Element:::openShadowRoot:::0 +Element:::outerHTML:::0 +Element:::outerText:::0 +Element:::prefix:::0 +Element:::releasePointerCapture:::2 +Element:::removeAttribute:::1 +Element:::removeAttributeNode:::2 +Element:::removeAttributeNS:::2 +Element:::requestPointerLock:::0 +Element:::scrollBy:::0 +Element:::scrollBy:::1 +Element:::scrollBy:::2 +Element:::scrollHeight:::0 +Element:::scrollIntoView:::0 +Element:::scrollIntoView:::1 +Element:::scrollIntoViewIfNeeded:::0 +Element:::scrollIntoViewIfNeeded:::1 +Element:::scrollLeft:::0 +Element:::scrollTo:::0 +Element:::scrollTo:::1 +Element:::scrollTo:::2 +Element:::scrollTop:::0 +Element:::scrollWidth:::0 +Element:::setApplyScroll:::2 +Element:::setAttribute:::3 +Element:::setAttributeNode:::2 +Element:::setAttributeNodeNS:::2 +Element:::setAttributeNS:::4 +Element:::setDistributeScroll:::2 +Element:::setInnerHTML:::2 +Element:::setOnbeforecopy:::1 +Element:::setOnbeforecut:::1 +Element:::setOnbeforepaste:::1 +Element:::setOncopy:::1 +Element:::setOncut:::1 +Element:::setOnpaste:::1 +Element:::setOnsearch:::1 +Element:::setOnselectstart:::1 +Element:::setOnwheel:::1 +Element:::setOuterHTML:::2 +Element:::setPointerCapture:::2 +Element:::setScrollLeft:::1 +Element:::setScrollTop:::1 +Element:::setTabIndex:::1 +Element:::style:::0 +Element:::styleMap:::0 +Element:::tagName:::0 +Element:::title:::0 +Element:::willValidate:::0 +EntriesCallback:::handleEvent:::1 +EntryBase:::filesystem:::0 +EntryBase:::fullPath:::0 +EntryBase:::isDirectory:::0 +EntryBase:::isFile:::0 +EntryBase:::name:::0 +EntryBase:::toURL:::0 +EntryCallback:::handleEvent:::1 +Entry:::copyTo:::2 +Entry:::copyTo:::3 +Entry:::copyTo:::4 +Entry:::copyTo:::5 +Entry:::filesystem:::1 +Entry:::fullPath:::0 +Entry:::getMetadata:::2 +Entry:::getMetadata:::3 +Entry:::getParent:::1 +Entry:::getParent:::2 +Entry:::getParent:::3 +Entry:::isDirectory:::0 +Entry:::isFile:::0 +Entry:::moveTo:::2 +Entry:::moveTo:::3 +Entry:::moveTo:::4 +Entry:::moveTo:::5 +Entry:::name:::0 +Entry:::remove:::2 +Entry:::remove:::3 +EntrySync:::copyTo:::3 +EntrySync:::filesystem:::0 +EntrySync:::fullPath:::0 +EntrySync:::getMetadata:::1 +EntrySync:::getParent:::0 +EntrySync:::isDirectory:::0 +EntrySync:::isFile:::0 +EntrySync:::moveTo:::3 +EntrySync:::name:::0 +EntrySync:::remove:::1 +EntrySync:::toURL:::0 +Entry:::toURL:::1 +ErrorCallback:::handleEvent:::1 +ErrorEvent:::colno:::0 +ErrorEvent:::error:::0 +ErrorEvent:::filename:::0 +ErrorEvent:::lineno:::0 +ErrorEvent:::message:::0 +Event:::bubbles:::0 +Event:::cancelable:::0 +Event:::cancelBubble:::1 +Event:::composed:::0 +Event:::composedPath:::1 +Event:::currentTarget:::0 +Event:::defaultPrevented:::0 +Event:::eventPhase:::0 +Event:::initEvent:::1 +Event:::initEvent:::2 +Event:::initEvent:::3 +Event:::isTrusted:::0 +Event:::legacyReturnValue:::1 +EventListener:::handleEvent:::1 +Event:::path:::1 +Event:::preventDefault:::0 +Event:::setCancelBubble:::2 +Event:::setLegacyReturnValue:::2 +EventSource:::close:::0 +EventSource:::onerror:::0 +EventSource:::onmessage:::0 +EventSource:::onopen:::0 +EventSource:::readyState:::0 +EventSource:::setOnerror:::1 +EventSource:::setOnmessage:::1 +EventSource:::setOnopen:::1 +EventSource:::url:::0 +EventSource:::withCredentials:::0 +Event:::srcElement:::0 +Event:::stopImmediatePropagation:::0 +Event:::stopPropagation:::0 +Event:::target:::0 +EventTarget:::addEventListener:::2 +EventTarget:::addEventListener:::3 +EventTarget:::dispatchEventForBindings:::2 +EventTarget:::removeEventListener:::2 +EventTarget:::removeEventListener:::3 +Event:::timeStamp:::1 +Event:::type:::0 +EXTDisjointTimerQuery:::beginQueryEXT:::2 +EXTDisjointTimerQuery:::createQueryEXT:::0 +EXTDisjointTimerQuery:::deleteQueryEXT:::1 +EXTDisjointTimerQuery:::endQueryEXT:::1 +EXTDisjointTimerQuery:::getQueryEXT:::3 +EXTDisjointTimerQuery:::getQueryObjectEXT:::3 +EXTDisjointTimerQuery:::isQueryEXT:::1 +EXTDisjointTimerQuery:::queryCounterEXT:::2 +EXTDisjointTimerQueryWebGL2:::queryCounterEXT:::2 +ExtendableEvent:::waitUntil:::3 +ExtendableMessageEvent:::data:::0 +ExtendableMessageEvent:::lastEventId:::0 +ExtendableMessageEvent:::origin:::0 +ExtendableMessageEvent:::ports:::1 +ExtendableMessageEvent:::source:::1 +External:::AddSearchProvider:::0 +External:::IsSearchProviderInstalled:::0 +FaceDetector:::detect:::2 +# False for operations below (i.e. why it doesn't see that the IDL interface +FederatedCredential:::protocol:::0 +FederatedCredential:::provider:::0 +FetchEvent:::clientId:::0 +FetchEvent:::isReload:::0 +FetchEvent:::preloadResponse:::1 +FetchEvent:::request:::0 +FetchEvent:::respondWith:::3 +FileEntry:::createWriter:::1 +FileEntry:::createWriter:::2 +FileEntry:::file:::1 +FileEntry:::file:::2 +FileEntrySync:::createWriter:::1 +FileEntrySync:::file:::1 +File:::lastModified:::0 +File:::lastModifiedDate:::0 +FileList:::item:::1 +FileList:::length:::0 +File:::name:::0 +FileReader:::abort:::0 +FileReader:::error:::0 +FileReader:::getReadyState:::0 +FileReader:::onabort:::0 +FileReader:::onerror:::0 +FileReader:::onload:::0 +FileReader:::onloadend:::0 +FileReader:::onloadstart:::0 +FileReader:::onprogress:::0 +FileReader:::readAsArrayBuffer:::2 +FileReader:::readAsBinaryString:::2 +FileReader:::readAsDataURL:::2 +FileReader:::readAsText:::2 +FileReader:::readAsText:::3 +FileReader:::result:::1 +FileReader:::setOnabort:::1 +FileReader:::setOnerror:::1 +FileReader:::setOnload:::1 +FileReader:::setOnloadend:::1 +FileReader:::setOnloadstart:::1 +FileReader:::setOnprogress:::1 +FileReaderSync:::readAsArrayBuffer:::3 +FileReaderSync:::readAsBinaryString:::3 +FileReaderSync:::readAsDataURL:::3 +FileReaderSync:::readAsText:::3 +FileReaderSync:::readAsText:::4 +FileSystemCallback:::handleEvent:::1 +File:::webkitRelativePath:::0 +FileWriter:::abort:::1 +FileWriterBaseCallback:::handleEvent:::1 +FileWriterBase:::length:::0 +FileWriterBase:::position:::0 +FileWriterCallback:::handleEvent:::1 +FileWriter:::error:::0 +FileWriter:::getReadyState:::0 +FileWriter:::length:::0 +FileWriter:::onabort:::0 +FileWriter:::onerror:::0 +FileWriter:::onprogress:::0 +FileWriter:::onwrite:::0 +FileWriter:::onwriteend:::0 +FileWriter:::onwritestart:::0 +FileWriter:::position:::0 +FileWriter:::seek:::2 +FileWriter:::setOnabort:::1 +FileWriter:::setOnerror:::1 +FileWriter:::setOnprogress:::1 +FileWriter:::setOnwrite:::1 +FileWriter:::setOnwriteend:::1 +FileWriter:::setOnwritestart:::1 +FileWriterSync:::length:::0 +FileWriterSync:::position:::0 +FileWriterSync:::seek:::2 +FileWriterSync:::truncate:::2 +FileWriterSync:::write:::2 +FileWriter:::truncate:::2 +FileWriter:::write:::2 +FocusEvent:::relatedTarget:::0 +FontFace:::display:::0 +FontFace:::family:::0 +FontFace:::featureSettings:::0 +FontFace:::load:::1 +FontFace:::loaded:::1 +FontFaceSet:::check:::2 +FontFaceSet:::check:::3 +FontFace:::setDisplay:::3 +FontFace:::setFamily:::3 +FontFace:::setFeatureSettings:::3 +FontFaceSet:::load:::2 +FontFaceSet:::load:::3 +FontFaceSetLoadEvent:::fontfaces:::0 +FontFaceSet:::onloading:::0 +FontFaceSet:::onloadingdone:::0 +FontFaceSet:::onloadingerror:::0 +FontFaceSet:::ready:::1 +FontFaceSet:::setOnloading:::1 +FontFaceSet:::setOnloadingdone:::1 +FontFaceSet:::setOnloadingerror:::1 +FontFaceSet:::size:::0 +FontFaceSet:::status:::0 +FontFace:::setStretch:::3 +FontFace:::setStyle:::3 +FontFace:::setUnicodeRange:::3 +FontFace:::setVariant:::3 +FontFace:::setWeight:::3 +FontFace:::status:::0 +FontFace:::stretch:::0 +FontFace:::style:::0 +FontFace:::unicodeRange:::0 +FontFace:::variant:::0 +FontFace:::weight:::0 +ForeignFetchEvent:::origin:::0 +ForeignFetchEvent:::request:::0 +ForeignFetchEvent:::respondWith:::3 +FormData:::append:::2 +FormData:::append:::3 +FormData:::append:::4 +FormData:::deleteEntry:::1 +FormData:::get:::1 +FormData:::get:::2 +FormData:::getAll:::1 +FormData:::has:::1 +FormData:::set:::2 +FormData:::set:::3 +FrameRequestCallback:::handleEvent:::1 +GainNode:::gain:::0 +Gamepad:::axes:::0 +GamepadButton:::pressed:::0 +Gamepad:::buttons:::0 +GamepadButton:::touched:::0 +GamepadButton:::value:::0 +Gamepad:::connected:::0 +Gamepad:::displayId:::0 +GamepadEvent:::getGamepad:::0 +Gamepad:::hand:::0 +Gamepad:::id:::0 +Gamepad:::index:::0 +GamepadList:::item:::0 +GamepadList:::item:::1 +GamepadList:::length:::0 +Gamepad:::mapping:::0 +Gamepad:::pose:::0 +GamepadPose:::angularAcceleration:::0 +GamepadPose:::angularVelocity:::0 +GamepadPose:::hasOrientation:::0 +GamepadPose:::hasPosition:::0 +GamepadPose:::linearAcceleration:::0 +GamepadPose:::linearVelocity:::0 +GamepadPose:::orientation:::0 +GamepadPose:::position:::0 +Gamepad:::timestamp:::0 +GarbageCollectedScriptWrappable:::toString:::0 +GCObservation:::wasCollected:::0 +Geolocation:::clearWatch:::1 +Geolocation:::getCurrentPosition:::1 +Geolocation:::getCurrentPosition:::2 +Geolocation:::getCurrentPosition:::3 +Geolocation:::watchPosition:::1 +Geolocation:::watchPosition:::2 +Geolocation:::watchPosition:::3 +Geoposition:::coords:::0 +Geoposition:::timestamp:::0 +GlobalCacheStorage:::caches:::2 +GlobalEventHandlers:::onabort:::1 +GlobalEventHandlers:::onauxclick:::1 +GlobalEventHandlers:::onblur:::1 +GlobalEventHandlers:::oncancel:::1 +GlobalEventHandlers:::oncanplay:::1 +GlobalEventHandlers:::oncanplaythrough:::1 +GlobalEventHandlers:::onchange:::1 +GlobalEventHandlers:::onclick:::1 +GlobalEventHandlers:::onclose:::1 +GlobalEventHandlers:::oncontextmenu:::1 +GlobalEventHandlers:::oncuechange:::1 +GlobalEventHandlers:::ondblclick:::1 +GlobalEventHandlers:::ondrag:::1 +GlobalEventHandlers:::ondragend:::1 +GlobalEventHandlers:::ondragenter:::1 +GlobalEventHandlers:::ondragleave:::1 +GlobalEventHandlers:::ondragover:::1 +GlobalEventHandlers:::ondragstart:::1 +GlobalEventHandlers:::ondrop:::1 +GlobalEventHandlers:::ondurationchange:::1 +GlobalEventHandlers:::onemptied:::1 +GlobalEventHandlers:::onended:::1 +GlobalEventHandlers:::onerror:::1 +GlobalEventHandlers:::onfocus:::1 +GlobalEventHandlers:::ongotpointercapture:::1 +GlobalEventHandlers:::oninput:::1 +GlobalEventHandlers:::oninvalid:::1 +GlobalEventHandlers:::onkeydown:::1 +GlobalEventHandlers:::onkeypress:::1 +GlobalEventHandlers:::onkeyup:::1 +GlobalEventHandlers:::onload:::1 +GlobalEventHandlers:::onloadeddata:::1 +GlobalEventHandlers:::onloadedmetadata:::1 +GlobalEventHandlers:::onloadstart:::1 +GlobalEventHandlers:::onlostpointercapture:::1 +GlobalEventHandlers:::onmousedown:::1 +GlobalEventHandlers:::onmouseenter:::1 +GlobalEventHandlers:::onmouseleave:::1 +GlobalEventHandlers:::onmousemove:::1 +GlobalEventHandlers:::onmouseout:::1 +GlobalEventHandlers:::onmouseover:::1 +GlobalEventHandlers:::onmouseup:::1 +GlobalEventHandlers:::onmousewheel:::1 +GlobalEventHandlers:::onpause:::1 +GlobalEventHandlers:::onplay:::1 +GlobalEventHandlers:::onplaying:::1 +GlobalEventHandlers:::onpointercancel:::1 +GlobalEventHandlers:::onpointerdown:::1 +GlobalEventHandlers:::onpointerenter:::1 +GlobalEventHandlers:::onpointerleave:::1 +GlobalEventHandlers:::onpointermove:::1 +GlobalEventHandlers:::onpointerout:::1 +GlobalEventHandlers:::onpointerover:::1 +GlobalEventHandlers:::onpointerup:::1 +GlobalEventHandlers:::onprogress:::1 +GlobalEventHandlers:::onratechange:::1 +GlobalEventHandlers:::onreset:::1 +GlobalEventHandlers:::onresize:::1 +GlobalEventHandlers:::onscroll:::1 +GlobalEventHandlers:::onseeked:::1 +GlobalEventHandlers:::onseeking:::1 +GlobalEventHandlers:::onselect:::1 +GlobalEventHandlers:::onshow:::1 +GlobalEventHandlers:::onstalled:::1 +GlobalEventHandlers:::onsubmit:::1 +GlobalEventHandlers:::onsuspend:::1 +GlobalEventHandlers:::ontimeupdate:::1 +GlobalEventHandlers:::ontoggle:::1 +GlobalEventHandlers:::ontouchcancel:::1 +GlobalEventHandlers:::ontouchend:::1 +GlobalEventHandlers:::ontouchmove:::1 +GlobalEventHandlers:::ontouchstart:::1 +GlobalEventHandlers:::onvolumechange:::1 +GlobalEventHandlers:::onwaiting:::1 +GlobalEventHandlers:::setOnabort:::2 +GlobalEventHandlers:::setOnauxclick:::2 +GlobalEventHandlers:::setOnblur:::2 +GlobalEventHandlers:::setOncancel:::2 +GlobalEventHandlers:::setOncanplay:::2 +GlobalEventHandlers:::setOncanplaythrough:::2 +GlobalEventHandlers:::setOnchange:::2 +GlobalEventHandlers:::setOnclick:::2 +GlobalEventHandlers:::setOnclose:::2 +GlobalEventHandlers:::setOncontextmenu:::2 +GlobalEventHandlers:::setOncuechange:::2 +GlobalEventHandlers:::setOndblclick:::2 +GlobalEventHandlers:::setOndrag:::2 +GlobalEventHandlers:::setOndragend:::2 +GlobalEventHandlers:::setOndragenter:::2 +GlobalEventHandlers:::setOndragleave:::2 +GlobalEventHandlers:::setOndragover:::2 +GlobalEventHandlers:::setOndragstart:::2 +GlobalEventHandlers:::setOndrop:::2 +GlobalEventHandlers:::setOndurationchange:::2 +GlobalEventHandlers:::setOnemptied:::2 +GlobalEventHandlers:::setOnended:::2 +GlobalEventHandlers:::setOnerror:::2 +GlobalEventHandlers:::setOnfocus:::2 +GlobalEventHandlers:::setOngotpointercapture:::2 +GlobalEventHandlers:::setOninput:::2 +GlobalEventHandlers:::setOninvalid:::2 +GlobalEventHandlers:::setOnkeydown:::2 +GlobalEventHandlers:::setOnkeypress:::2 +GlobalEventHandlers:::setOnkeyup:::2 +GlobalEventHandlers:::setOnload:::2 +GlobalEventHandlers:::setOnloadeddata:::2 +GlobalEventHandlers:::setOnloadedmetadata:::2 +GlobalEventHandlers:::setOnloadstart:::2 +GlobalEventHandlers:::setOnlostpointercapture:::2 +GlobalEventHandlers:::setOnmousedown:::2 +GlobalEventHandlers:::setOnmouseenter:::2 +GlobalEventHandlers:::setOnmouseleave:::2 +GlobalEventHandlers:::setOnmousemove:::2 +GlobalEventHandlers:::setOnmouseout:::2 +GlobalEventHandlers:::setOnmouseover:::2 +GlobalEventHandlers:::setOnmouseup:::2 +GlobalEventHandlers:::setOnmousewheel:::2 +GlobalEventHandlers:::setOnpause:::2 +GlobalEventHandlers:::setOnplay:::2 +GlobalEventHandlers:::setOnplaying:::2 +GlobalEventHandlers:::setOnpointercancel:::2 +GlobalEventHandlers:::setOnpointerdown:::2 +GlobalEventHandlers:::setOnpointerenter:::2 +GlobalEventHandlers:::setOnpointerleave:::2 +GlobalEventHandlers:::setOnpointermove:::2 +GlobalEventHandlers:::setOnpointerout:::2 +GlobalEventHandlers:::setOnpointerover:::2 +GlobalEventHandlers:::setOnpointerup:::2 +GlobalEventHandlers:::setOnprogress:::2 +GlobalEventHandlers:::setOnratechange:::2 +GlobalEventHandlers:::setOnreset:::2 +GlobalEventHandlers:::setOnresize:::2 +GlobalEventHandlers:::setOnscroll:::2 +GlobalEventHandlers:::setOnseeked:::2 +GlobalEventHandlers:::setOnseeking:::2 +GlobalEventHandlers:::setOnselect:::2 +GlobalEventHandlers:::setOnshow:::2 +GlobalEventHandlers:::setOnstalled:::2 +GlobalEventHandlers:::setOnsubmit:::2 +GlobalEventHandlers:::setOnsuspend:::2 +GlobalEventHandlers:::setOntimeupdate:::2 +GlobalEventHandlers:::setOntoggle:::2 +GlobalEventHandlers:::setOntouchcancel:::2 +GlobalEventHandlers:::setOntouchend:::2 +GlobalEventHandlers:::setOntouchmove:::2 +GlobalEventHandlers:::setOntouchstart:::2 +GlobalEventHandlers:::setOnvolumechange:::2 +GlobalEventHandlers:::setOnwaiting:::2 +GlobalFetch:::fetch:::4 +GlobalFetch:::fetch:::5 +GlobalIndexedDB:::indexedDB:::1 +Gyroscope:::x:::1 +Gyroscope:::y:::1 +Gyroscope:::z:::1 +HashChangeEvent:::newURL:::0 +HashChangeEvent:::oldURL:::0 +Headers:::append:::3 +Headers:::get:::2 +Headers:::getAll:::2 +Headers:::has:::2 +Headers:::remove:::2 +Headers:::set:::3 +History:::back:::1 +History:::forward:::1 +History:::go:::1 +History:::go:::2 +History:::length:::0 +History:::pushState:::3 +History:::pushState:::4 +History:::replaceState:::3 +History:::replaceState:::4 +History:::scrollRestoration:::0 +History:::setScrollRestoration:::1 +History:::state:::0 +History:::stateChanged:::0 +HTMLAllCollection:::item:::0 +HTMLAllCollection:::item:::1 +HTMLAllCollection:::length:::0 +HTMLAllCollection:::namedGetter:::2 +HTMLAnchorElement:::setTextContent:::1 +HTMLAnchorElement:::textContent:::0 +HTMLBaseElement:::href:::0 +HTMLBaseElement:::setHref:::1 +HTMLBodyElement:::onblur:::0 +HTMLBodyElement:::onerror:::0 +HTMLBodyElement:::onfocus:::0 +HTMLBodyElement:::onload:::0 +HTMLBodyElement:::onorientationchange:::0 +HTMLBodyElement:::onresize:::0 +HTMLBodyElement:::onscroll:::0 +HTMLBodyElement:::setOnblur:::1 +HTMLBodyElement:::setOnerror:::1 +HTMLBodyElement:::setOnfocus:::1 +HTMLBodyElement:::setOnload:::1 +HTMLBodyElement:::setOnorientationchange:::1 +HTMLBodyElement:::setOnresize:::1 +HTMLBodyElement:::setOnscroll:::1 +HTMLButtonElement:::checkValidity:::0 +HTMLButtonElement:::formAction:::0 +HTMLButtonElement:::formEnctype:::0 +HTMLButtonElement:::formMethod:::0 +HTMLButtonElement:::formOwner:::0 +HTMLButtonElement:::labels:::0 +HTMLButtonElement:::reportValidity:::0 +HTMLButtonElement:::setCustomValidity:::1 +HTMLButtonElement:::setFormAction:::1 +HTMLButtonElement:::setFormEnctype:::1 +HTMLButtonElement:::setFormMethod:::1 +HTMLButtonElement:::setType:::1 +HTMLButtonElement:::type:::0 +HTMLButtonElement:::validationMessage:::0 +HTMLButtonElement:::validity:::0 +HTMLButtonElement:::willValidate:::0 +HTMLCanvasElementCapture:::captureStream:::2 +HTMLCanvasElementCapture:::captureStream:::3 +HTMLCanvasElement:::height:::0 +HTMLCanvasElementModule:::getContext:::3 +HTMLCanvasElementModule:::getContext:::4 +HTMLCanvasElementModule:::transferControlToOffscreen:::2 +HTMLCanvasElement:::setHeight:::2 +HTMLCanvasElement:::setWidth:::2 +HTMLCanvasElement:::toBlob:::2 +HTMLCanvasElement:::toBlob:::3 +HTMLCanvasElement:::toBlob:::4 +HTMLCanvasElement:::toDataURL:::1 +HTMLCanvasElement:::toDataURL:::2 +HTMLCanvasElement:::toDataURL:::3 +HTMLCanvasElement:::width:::0 +HTMLCollection:::item:::1 +HTMLCollection:::length:::0 +HTMLCollection:::namedItem:::1 +HTMLContentElement:::getDistributedNodes:::0 +HTMLDataListElement:::options:::0 +HTMLDialogElement:::close:::1 +HTMLDialogElement:::close:::2 +HTMLDialogElement:::returnValue:::0 +HTMLDialogElement:::setReturnValue:::1 +HTMLDialogElement:::show:::0 +HTMLDialogElement:::showModal:::1 +HTMLDocument:::alinkColor:::0 +HTMLDocument:::all:::0 +HTMLDocument:::bgColor:::0 +HTMLDocument:::captureEvents:::0 +HTMLDocument:::clear:::0 +HTMLDocument:::fgColor:::0 +HTMLDocument:::linkColor:::0 +HTMLDocument:::releaseEvents:::0 +HTMLDocument:::setAlinkColor:::1 +HTMLDocument:::setBgColor:::1 +HTMLDocument:::setFgColor:::1 +HTMLDocument:::setLinkColor:::1 +HTMLDocument:::setVlinkColor:::1 +HTMLDocument:::vlinkColor:::0 +HTMLElement:::blur:::0 +HTMLElement:::click:::0 +HTMLElement:::contentEditable:::0 +HTMLElement:::contextMenu:::0 +HTMLElement:::dataset:::0 +HTMLElement:::dir:::0 +HTMLElement:::draggable:::0 +HTMLElement:::focus:::0 +HTMLElement:::formOwner:::0 +HTMLElement:::innerText:::0 +HTMLElement:::isContentEditableForBinding:::0 +HTMLElement:::offsetHeightForBinding:::0 +HTMLElement:::offsetLeftForBinding:::0 +HTMLElement:::offsetTopForBinding:::0 +HTMLElement:::offsetWidthForBinding:::0 +HTMLElement:::outerText:::0 +HTMLElement:::setContentEditable:::2 +HTMLElement:::setContextMenu:::1 +HTMLElement:::setDir:::1 +HTMLElement:::setDraggable:::1 +HTMLElement:::setInnerText:::2 +HTMLElement:::setOuterText:::2 +HTMLElement:::setSpellcheck:::1 +HTMLElement:::setTabIndex:::1 +HTMLElement:::setTranslate:::1 +HTMLElement:::spellcheck:::0 +HTMLElement:::style:::0 +HTMLElement:::tabIndex:::0 +HTMLElement:::translate:::0 +HTMLElement:::unclosedOffsetParent:::0 +HTMLEmbedElement::::::1 +HTMLEmbedElement::::::2 +HTMLEmbedElement:::getSVGDocument:::1 +HTMLFieldSetElement:::checkValidity:::0 +HTMLFieldSetElement:::elements:::0 +HTMLFieldSetElement:::formOwner:::0 +HTMLFieldSetElement:::reportValidity:::0 +HTMLFieldSetElement:::setCustomValidity:::1 +HTMLFieldSetElement:::type:::0 +HTMLFieldSetElement:::validationMessage:::0 +HTMLFieldSetElement:::validity:::0 +HTMLFieldSetElement:::willValidate:::0 +HTMLFormControlElement:::checkValidity:::2 +HTMLFormControlElement:::formAction:::0 +HTMLFormControlElement:::formEnctype:::0 +HTMLFormControlElement:::formMethod:::0 +HTMLFormControlElement:::formOwner:::0 +HTMLFormControlElement:::reportValidity:::0 +HTMLFormControlElement:::setCustomValidity:::1 +HTMLFormControlElement:::setFormAction:::1 +HTMLFormControlElement:::setFormEnctype:::1 +HTMLFormControlElement:::setFormMethod:::1 +HTMLFormControlElement:::type:::0 +HTMLFormControlsCollection:::item:::1 +HTMLFormControlsCollection:::length:::0 +HTMLFormControlsCollection:::namedGetter:::2 +HTMLFormElement::::::2 +HTMLFormElement:::checkValidity:::0 +HTMLFormElement:::elements:::0 +HTMLFormElement:::encoding:::0 +HTMLFormElement:::enctype:::0 +HTMLFormElement:::item:::1 +HTMLFormElement:::length:::0 +HTMLFormElement:::method:::0 +HTMLFormElement:::reportValidity:::0 +HTMLFormElement:::reset:::0 +HTMLFormElement:::setEncoding:::1 +HTMLFormElement:::setEnctype:::1 +HTMLFormElement:::setMethod:::1 +HTMLFormElement:::submitFromJavaScript:::0 +HTMLFrameElement:::contentDocument:::0 +HTMLFrameElement:::contentWindow:::0 +HTMLFrameOwnerElement:::contentDocument:::0 +HTMLFrameOwnerElement:::contentWindow:::0 +HTMLFrameOwnerElement:::getSVGDocument:::1 +HTMLFrameSetElement::::::1 +HTMLFrameSetElement:::onblur:::0 +HTMLFrameSetElement:::onerror:::0 +HTMLFrameSetElement:::onfocus:::0 +HTMLFrameSetElement:::onload:::0 +HTMLFrameSetElement:::onorientationchange:::0 +HTMLFrameSetElement:::onresize:::0 +HTMLFrameSetElement:::onscroll:::0 +HTMLFrameSetElement:::setOnblur:::1 +HTMLFrameSetElement:::setOnerror:::1 +HTMLFrameSetElement:::setOnfocus:::1 +HTMLFrameSetElement:::setOnload:::1 +HTMLFrameSetElement:::setOnorientationchange:::1 +HTMLFrameSetElement:::setOnresize:::1 +HTMLFrameSetElement:::setOnscroll:::1 +HTMLHyperlinkElementUtils:::hash:::0 +HTMLHyperlinkElementUtils:::host:::0 +HTMLHyperlinkElementUtils:::hostname:::0 +HTMLHyperlinkElementUtils:::href:::0 +HTMLHyperlinkElementUtils:::origin:::0 +HTMLHyperlinkElementUtils:::password:::0 +HTMLHyperlinkElementUtils:::pathname:::0 +HTMLHyperlinkElementUtils:::port:::0 +HTMLHyperlinkElementUtils:::protocol:::0 +HTMLHyperlinkElementUtils:::search:::0 +HTMLHyperlinkElementUtils:::setHash:::1 +HTMLHyperlinkElementUtils:::setHost:::1 +HTMLHyperlinkElementUtils:::setHostname:::1 +HTMLHyperlinkElementUtils:::setHref:::1 +HTMLHyperlinkElementUtils:::setPassword:::1 +HTMLHyperlinkElementUtils:::setPathname:::1 +HTMLHyperlinkElementUtils:::setPort:::1 +HTMLHyperlinkElementUtils:::setProtocol:::1 +HTMLHyperlinkElementUtils:::setSearch:::1 +HTMLHyperlinkElementUtils:::setUsername:::1 +HTMLHyperlinkElementUtils:::username:::0 +HTMLIFrameElement:::allow:::0 +HTMLIFrameElement:::contentDocument:::0 +HTMLIFrameElement:::contentWindow:::0 +HTMLIFrameElement:::getSVGDocument:::1 +HTMLIFrameElement:::sandbox:::0 +HTMLImageElement:::complete:::0 +HTMLImageElement:::currentSrc:::0 +HTMLImageElement:::height:::0 +HTMLImageElement:::naturalHeight:::0 +HTMLImageElement:::naturalWidth:::0 +HTMLImageElement:::setHeight:::1 +HTMLImageElement:::setWidth:::1 +HTMLImageElement:::width:::0 +HTMLImageElement:::x:::0 +HTMLImageElement:::y:::0 +HTMLInputElement:::autocapitalize:::0 +HTMLInputElement:::checked:::0 +HTMLInputElement:::checkValidity:::0 +HTMLInputElement:::files:::0 +HTMLInputElementFileSystem:::webkitEntries:::2 +HTMLInputElement:::formAction:::0 +HTMLInputElement:::formEnctype:::0 +HTMLInputElement:::formMethod:::0 +HTMLInputElement:::formOwner:::0 +HTMLInputElement:::height:::0 +HTMLInputElement:::indeterminate:::0 +HTMLInputElement:::labels:::0 +HTMLInputElement:::list:::0 +HTMLInputElement:::maxLength:::0 +HTMLInputElement:::minLength:::0 +HTMLInputElement:::reportValidity:::0 +HTMLInputElement:::select:::0 +HTMLInputElement:::selectionDirectionForBinding:::1 +HTMLInputElement:::selectionEndForBinding:::2 +HTMLInputElement:::selectionStartForBinding:::2 +HTMLInputElement:::setAutocapitalize:::1 +HTMLInputElement:::setChecked:::1 +HTMLInputElement:::setCustomValidity:::1 +HTMLInputElement:::setFiles:::1 +HTMLInputElement:::setFormAction:::1 +HTMLInputElement:::setFormEnctype:::1 +HTMLInputElement:::setFormMethod:::1 +HTMLInputElement:::setHeight:::1 +HTMLInputElement:::setIndeterminate:::1 +HTMLInputElement:::setMaxLength:::2 +HTMLInputElement:::setMinLength:::2 +HTMLInputElement:::setRangeText:::2 +HTMLInputElement:::setRangeText:::4 +HTMLInputElement:::setRangeText:::5 +HTMLInputElement:::setSelectionDirectionForBinding:::2 +HTMLInputElement:::setSelectionEndForBinding:::2 +HTMLInputElement:::setSelectionRangeForBinding:::3 +HTMLInputElement:::setSelectionRangeForBinding:::4 +HTMLInputElement:::setSelectionStartForBinding:::2 +HTMLInputElement:::setSize:::2 +HTMLInputElement:::setType:::1 +HTMLInputElement:::setValue:::2 +HTMLInputElement:::setValueAsDate:::2 +HTMLInputElement:::setValueAsNumber:::2 +HTMLInputElement:::setWidth:::1 +HTMLInputElement:::size:::0 +HTMLInputElement:::stepDown:::1 +HTMLInputElement:::stepDown:::2 +HTMLInputElement:::stepUp:::1 +HTMLInputElement:::stepUp:::2 +HTMLInputElement:::type:::0 +HTMLInputElement:::validationMessage:::0 +HTMLInputElement:::validity:::0 +HTMLInputElement:::value:::0 +HTMLInputElement:::valueAsDate:::1 +HTMLInputElement:::valueAsNumber:::0 +HTMLInputElement:::width:::0 +HTMLInputElement:::willValidate:::0 +HTMLLabelElement:::control:::0 +HTMLLabelElement:::form:::0 +HTMLLegendElement:::form:::0 +HTMLLinkElement:::import:::0 +HTMLLinkElement:::relList:::0 +HTMLLinkElement:::sheet:::0 +HTMLLinkElement:::sizes:::0 +HTMLMapElement:::areas:::0 +HTMLMarqueeElement:::loop:::0 +HTMLMarqueeElement:::scrollAmount:::0 +HTMLMarqueeElement:::scrollDelay:::0 +HTMLMarqueeElement:::setLoop:::2 +HTMLMarqueeElement:::setScrollAmount:::2 +HTMLMarqueeElement:::setScrollDelay:::2 +HTMLMarqueeElement:::start:::0 +HTMLMarqueeElement:::stop:::0 +HTMLMediaElement:::addTextTrack:::2 +HTMLMediaElement:::addTextTrack:::3 +HTMLMediaElement:::addTextTrack:::4 +HTMLMediaElementAudioOutputDevice:::setSinkId:::3 +HTMLMediaElementAudioOutputDevice:::sinkId:::1 +HTMLMediaElement:::audioTracks:::0 +HTMLMediaElement:::buffered:::0 +HTMLMediaElement:::canPlayType:::1 +HTMLMediaElementCapture:::captureStream:::2 +HTMLMediaElement:::controlsList:::0 +HTMLMediaElement:::currentSrc:::0 +HTMLMediaElement:::currentTime:::0 +HTMLMediaElement:::defaultPlaybackRate:::0 +HTMLMediaElement:::duration:::0 +HTMLMediaElementEncryptedMedia:::mediaKeys:::1 +HTMLMediaElementEncryptedMedia:::onencrypted:::1 +HTMLMediaElementEncryptedMedia:::onwaitingforkey:::1 +HTMLMediaElementEncryptedMedia:::setMediaKeys:::3 +HTMLMediaElementEncryptedMedia:::setOnencrypted:::2 +HTMLMediaElementEncryptedMedia:::setOnwaitingforkey:::2 +HTMLMediaElement:::ended:::0 +HTMLMediaElement:::error:::0 +HTMLMediaElement:::getNetworkState:::0 +HTMLMediaElement:::getReadyState:::0 +HTMLMediaElement:::load:::0 +HTMLMediaElement:::muted:::0 +HTMLMediaElement:::pause:::0 +HTMLMediaElement:::paused:::0 +HTMLMediaElement:::playbackRate:::0 +HTMLMediaElement:::played:::0 +HTMLMediaElement:::playForBindings:::1 +HTMLMediaElement:::preload:::0 +HTMLMediaElementRemotePlayback:::remote:::1 +HTMLMediaElement:::seekable:::0 +HTMLMediaElement:::seeking:::0 +HTMLMediaElement:::setCurrentTime:::1 +HTMLMediaElement:::setDefaultPlaybackRate:::1 +HTMLMediaElement:::setMuted:::1 +HTMLMediaElement:::setPlaybackRate:::1 +HTMLMediaElement:::setPreload:::1 +HTMLMediaElement:::setVolume:::2 +HTMLMediaElementSrcObject:::setSrcObject:::2 +HTMLMediaElementSrcObject:::srcObject:::1 +HTMLMediaElement:::textTracks:::0 +HTMLMediaElement:::videoTracks:::0 +HTMLMediaElement:::volume:::0 +HTMLMediaElement:::webkitAudioDecodedByteCount:::0 +HTMLMediaElement:::webkitVideoDecodedByteCount:::0 +HTMLMediaSource:::duration:::0 +HTMLMeterElement:::high:::0 +HTMLMeterElement:::labels:::0 +HTMLMeterElement:::low:::0 +HTMLMeterElement:::max:::0 +HTMLMeterElement:::min:::0 +HTMLMeterElement:::optimum:::0 +HTMLMeterElement:::setHigh:::1 +HTMLMeterElement:::setLow:::1 +HTMLMeterElement:::setMax:::1 +HTMLMeterElement:::setMin:::1 +HTMLMeterElement:::setOptimum:::1 +HTMLMeterElement:::setValue:::1 +HTMLMeterElement:::value:::0 +HTMLObjectElement::::::1 +HTMLObjectElement::::::2 +HTMLObjectElement:::checkValidity:::0 +HTMLObjectElement:::contentDocument:::0 +HTMLObjectElement:::contentWindow:::0 +HTMLObjectElement:::formOwner:::0 +HTMLObjectElement:::getSVGDocument:::1 +HTMLObjectElement:::reportValidity:::0 +HTMLObjectElement:::setCustomValidity:::1 +HTMLObjectElement:::validationMessage:::0 +HTMLObjectElement:::validity:::0 +HTMLObjectElement:::willValidate:::0 +HTMLOListElement:::setStart:::1 +HTMLOListElement:::start:::0 +HTMLOptionElement:::form:::0 +HTMLOptionElement:::index:::0 +HTMLOptionElement:::label:::0 +HTMLOptionElement:::selectedForBinding:::0 +HTMLOptionElement:::setLabel:::1 +HTMLOptionElement:::setSelectedForBinding:::1 +HTMLOptionElement:::setText:::2 +HTMLOptionElement:::setValue:::1 +HTMLOptionElement:::text:::0 +HTMLOptionElement:::value:::0 +HTMLOptionsCollection::::::3 +HTMLOptionsCollection:::add:::2 +HTMLOptionsCollection:::add:::3 +HTMLOptionsCollection:::item:::1 +HTMLOptionsCollection:::length:::0 +HTMLOptionsCollection:::namedGetter:::2 +HTMLOptionsCollection:::remove:::1 +HTMLOptionsCollection:::selectedIndex:::0 +HTMLOptionsCollection:::setLength:::2 +HTMLOptionsCollection:::setSelectedIndex:::1 +HTMLOutputElement:::checkValidity:::0 +HTMLOutputElement:::defaultValue:::0 +HTMLOutputElement:::formOwner:::0 +HTMLOutputElement:::htmlFor:::0 +HTMLOutputElement:::labels:::0 +HTMLOutputElement:::reportValidity:::0 +HTMLOutputElement:::setCustomValidity:::1 +HTMLOutputElement:::setDefaultValue:::1 +HTMLOutputElement:::setValue:::1 +HTMLOutputElement:::type:::0 +HTMLOutputElement:::validationMessage:::0 +HTMLOutputElement:::validity:::0 +HTMLOutputElement:::value:::0 +HTMLOutputElement:::willValidate:::0 +HTMLProgressElement:::labels:::0 +HTMLProgressElement:::max:::0 +HTMLProgressElement:::position:::0 +HTMLProgressElement:::setMax:::1 +HTMLProgressElement:::setValue:::1 +HTMLProgressElement:::value:::0 +HTMLScriptElement:::async:::0 +HTMLScriptElement:::nonce:::0 +HTMLScriptElement:::setAsync:::1 +HTMLScriptElement:::setNonce:::1 +HTMLScriptElement:::setText:::1 +HTMLScriptElement:::text:::0 +HTMLSelectElement::::::3 +HTMLSelectElement:::add:::2 +HTMLSelectElement:::add:::3 +HTMLSelectElement:::checkValidity:::0 +HTMLSelectElement:::formOwner:::0 +HTMLSelectElement:::item:::1 +HTMLSelectElement:::labels:::0 +HTMLSelectElement:::length:::0 +HTMLSelectElement:::namedItem:::1 +HTMLSelectElement:::options:::0 +HTMLSelectElement:::remove:::1 +HTMLSelectElement:::reportValidity:::0 +HTMLSelectElement:::selectedIndex:::0 +HTMLSelectElement:::selectedOptions:::0 +HTMLSelectElement:::setCustomValidity:::1 +HTMLSelectElement:::setLength:::2 +HTMLSelectElement:::setSelectedIndex:::1 +HTMLSelectElement:::setSize:::1 +HTMLSelectElement:::setValue:::1 +HTMLSelectElement:::size:::0 +HTMLSelectElement:::type:::0 +HTMLSelectElement:::validationMessage:::0 +HTMLSelectElement:::validity:::0 +HTMLSelectElement:::value:::0 +HTMLSelectElement:::willValidate:::0 +HTMLShadowElement:::getDistributedNodes:::0 +HTMLSlotElement:::assignedNodesForBinding:::0 +HTMLSlotElement:::assignedNodesForBinding:::1 +HTMLSourceElement:::setType:::1 +HTMLSourceElement:::type:::0 +HTMLStyleElement:::disabled:::0 +HTMLStyleElement:::setDisabled:::1 +HTMLStyleElement:::sheet:::0 +HTMLTableCellElement:::cellIndex:::0 +HTMLTableCellElement:::colSpan:::0 +HTMLTableCellElement:::rowSpan:::0 +HTMLTableCellElement:::setColSpan:::1 +HTMLTableCellElement:::setRowSpan:::1 +HTMLTableColElement:::setSpan:::1 +HTMLTableColElement:::span:::0 +HTMLTableElement:::caption:::0 +HTMLTableElement:::createCaption:::0 +HTMLTableElement:::createTBody:::0 +HTMLTableElement:::createTFoot:::0 +HTMLTableElement:::createTHead:::0 +HTMLTableElement:::deleteCaption:::0 +HTMLTableElement:::deleteRow:::2 +HTMLTableElement:::deleteTFoot:::0 +HTMLTableElement:::deleteTHead:::0 +HTMLTableElement:::insertRow:::1 +HTMLTableElement:::insertRow:::2 +HTMLTableElement:::rows:::0 +HTMLTableElement:::setCaption:::2 +HTMLTableElement:::setTFoot:::2 +HTMLTableElement:::setTHead:::2 +HTMLTableElement:::tBodies:::0 +HTMLTableElement:::tFoot:::0 +HTMLTableElement:::tHead:::0 +HTMLTableRowElement:::cells:::0 +HTMLTableRowElement:::deleteCell:::2 +HTMLTableRowElement:::insertCell:::1 +HTMLTableRowElement:::insertCell:::2 +HTMLTableRowElement:::rowIndex:::0 +HTMLTableRowElement:::sectionRowIndex:::0 +HTMLTableSectionElement:::deleteRow:::2 +HTMLTableSectionElement:::insertRow:::1 +HTMLTableSectionElement:::insertRow:::2 +HTMLTableSectionElement:::rows:::0 +HTMLTemplateElement:::content:::0 +HTMLTextAreaElement:::autocapitalize:::0 +HTMLTextAreaElement:::checkValidity:::0 +HTMLTextAreaElement:::cols:::0 +HTMLTextAreaElement:::defaultValue:::0 +HTMLTextAreaElement:::formOwner:::0 +HTMLTextAreaElement:::labels:::0 +HTMLTextAreaElement:::maxLength:::0 +HTMLTextAreaElement:::minLength:::0 +HTMLTextAreaElement:::reportValidity:::0 +HTMLTextAreaElement:::rows:::0 +HTMLTextAreaElement:::select:::0 +HTMLTextAreaElement:::selectionDirection:::0 +HTMLTextAreaElement:::selectionEnd:::0 +HTMLTextAreaElement:::selectionStart:::0 +HTMLTextAreaElement:::setAutocapitalize:::1 +HTMLTextAreaElement:::setCols:::1 +HTMLTextAreaElement:::setCustomValidity:::1 +HTMLTextAreaElement:::setDefaultValue:::1 +HTMLTextAreaElement:::setMaxLength:::2 +HTMLTextAreaElement:::setMinLength:::2 +HTMLTextAreaElement:::setRangeText:::2 +HTMLTextAreaElement:::setRangeText:::4 +HTMLTextAreaElement:::setRangeText:::5 +HTMLTextAreaElement:::setRows:::1 +HTMLTextAreaElement:::setSelectionDirection:::1 +HTMLTextAreaElement:::setSelectionEnd:::1 +HTMLTextAreaElement:::setSelectionRangeForBinding:::2 +HTMLTextAreaElement:::setSelectionRangeForBinding:::3 +HTMLTextAreaElement:::setSelectionStart:::1 +HTMLTextAreaElement:::setValue:::1 +HTMLTextAreaElement:::textLength:::0 +HTMLTextAreaElement:::type:::0 +HTMLTextAreaElement:::validationMessage:::0 +HTMLTextAreaElement:::validity:::0 +HTMLTextAreaElement:::value:::0 +HTMLTextAreaElement:::willValidate:::0 +HTMLTitleElement:::setText:::1 +HTMLTitleElement:::text:::0 +HTMLTrackElement:::getReadyState:::0 +HTMLTrackElement:::kind:::0 +HTMLTrackElement:::setKind:::1 +HTMLTrackElement:::track:::0 +HTMLVideoElementMediaSource:::getVideoPlaybackQuality:::1 +HTMLVideoElement:::videoHeight:::0 +HTMLVideoElement:::videoWidth:::0 +HTMLVideoElement:::webkitDecodedFrameCount:::0 +HTMLVideoElement:::webkitDisplayingFullscreen:::0 +HTMLVideoElement:::webkitDroppedFrameCount:::0 +HTMLVideoElement:::webkitEnterFullscreen:::0 +HTMLVideoElement:::webkitExitFullscreen:::0 +HTMLVideoElement:::webkitSupportsFullscreen:::0 +IDBCursor:::advance:::2 +IDBCursor:::continueFunction:::2 +IDBCursor:::continueFunction:::3 +IDBCursor:::continuePrimaryKey:::4 +IDBCursor:::deleteFunction:::2 +IDBCursor:::direction:::0 +IDBCursor:::isKeyDirty:::0 +IDBCursor:::isPrimaryKeyDirty:::0 +IDBCursor:::isValueDirty:::0 +IDBCursor:::key:::1 +IDBCursor:::primaryKey:::1 +IDBCursor:::source:::1 +IDBCursor:::update:::3 +IDBCursor:::value:::1 +IDBCursorWithValue:::isValueDirty:::0 +IDBCursorWithValue:::value:::1 +IDBDatabase:::close:::0 +IDBDatabase:::createObjectStore:::2 +IDBDatabase:::createObjectStore:::3 +IDBDatabase:::deleteObjectStore:::2 +IDBDatabase:::name:::0 +IDBDatabase:::objectStoreNames:::0 +IDBDatabase:::onabort:::0 +IDBDatabase:::onclose:::0 +IDBDatabase:::onerror:::0 +IDBDatabase:::onversionchange:::0 +IDBDatabase:::setOnabort:::1 +IDBDatabase:::setOnclose:::1 +IDBDatabase:::setOnerror:::1 +IDBDatabase:::setOnversionchange:::1 +IDBDatabase:::transaction:::3 +IDBDatabase:::transaction:::4 +IDBDatabase:::version:::0 +IDBFactory:::cmp:::4 +IDBFactory:::deleteDatabase:::3 +IDBFactory:::getDatabaseNames:::2 +IDBFactory:::open:::3 +IDBFactory:::open:::4 +IDBIndex:::count:::2 +IDBIndex:::count:::3 +IDBIndex:::get:::3 +IDBIndex:::getAll:::2 +IDBIndex:::getAll:::3 +IDBIndex:::getAll:::4 +IDBIndex:::getAllKeys:::2 +IDBIndex:::getAllKeys:::3 +IDBIndex:::getAllKeys:::4 +IDBIndex:::getKey:::3 +IDBIndex:::keyPath:::1 +IDBIndex:::multiEntry:::0 +IDBIndex:::name:::0 +IDBIndex:::objectStore:::0 +IDBIndex:::openCursor:::2 +IDBIndex:::openCursor:::3 +IDBIndex:::openCursor:::4 +IDBIndex:::openKeyCursor:::2 +IDBIndex:::openKeyCursor:::3 +IDBIndex:::openKeyCursor:::4 +IDBIndex:::setName:::2 +IDBIndex:::unique:::0 +IDBKeyRange:::bound:::4 +IDBKeyRange:::bound:::5 +IDBKeyRange:::bound:::6 +IDBKeyRange:::includes:::3 +IDBKeyRange:::lowerBound:::3 +IDBKeyRange:::lowerBound:::4 +IDBKeyRange:::lowerOpen:::0 +IDBKeyRange:::lowerValue:::1 +IDBKeyRange:::only:::3 +IDBKeyRange:::upperBound:::3 +IDBKeyRange:::upperBound:::4 +IDBKeyRange:::upperOpen:::0 +IDBKeyRange:::upperValue:::1 +IDBObjectStore:::add:::3 +IDBObjectStore:::add:::4 +IDBObjectStore:::autoIncrement:::0 +IDBObjectStore:::clear:::2 +IDBObjectStore:::count:::2 +IDBObjectStore:::count:::3 +IDBObjectStore:::createIndex:::4 +IDBObjectStore:::createIndex:::5 +IDBObjectStore:::deleteFunction:::3 +IDBObjectStore:::deleteIndex:::2 +IDBObjectStore:::get:::3 +IDBObjectStore:::getAll:::2 +IDBObjectStore:::getAll:::3 +IDBObjectStore:::getAll:::4 +IDBObjectStore:::getAllKeys:::2 +IDBObjectStore:::getAllKeys:::3 +IDBObjectStore:::getAllKeys:::4 +IDBObjectStore:::getKey:::3 +IDBObjectStore:::index:::2 +IDBObjectStore:::indexNames:::0 +IDBObjectStore:::keyPath:::1 +IDBObjectStore:::name:::0 +IDBObjectStore:::openCursor:::2 +IDBObjectStore:::openCursor:::3 +IDBObjectStore:::openCursor:::4 +IDBObjectStore:::openKeyCursor:::2 +IDBObjectStore:::openKeyCursor:::3 +IDBObjectStore:::openKeyCursor:::4 +IDBObjectStore:::put:::3 +IDBObjectStore:::put:::4 +IDBObjectStore:::setName:::2 +IDBObjectStore:::transaction:::0 +IDBObservation:::key:::1 +IDBObservation:::type:::0 +IDBObservation:::value:::1 +IDBObserverChanges:::database:::0 +IDBObserverChanges:::records:::1 +IDBObserverChanges:::transaction:::0 +IDBObserver:::observe:::4 +IDBObserver:::unobserve:::2 +IDBOpenDBRequest:::onblocked:::0 +IDBOpenDBRequest:::onupgradeneeded:::0 +IDBOpenDBRequest:::setOnblocked:::1 +IDBOpenDBRequest:::setOnupgradeneeded:::1 +IDBRequest:::error:::1 +IDBRequest:::isResultDirty:::0 +IDBRequest:::onerror:::0 +IDBRequest:::onsuccess:::0 +IDBRequest:::readyState:::0 +IDBRequest:::result:::2 +IDBRequest:::setOnerror:::1 +IDBRequest:::setOnsuccess:::1 +IDBRequest:::source:::1 +IDBRequest:::transaction:::0 +IDBTransaction:::abort:::1 +IDBTransaction:::db:::0 +IDBTransaction:::error:::0 +IDBTransaction:::mode:::0 +IDBTransaction:::objectStore:::2 +IDBTransaction:::objectStoreNames:::0 +IDBTransaction:::onabort:::0 +IDBTransaction:::oncomplete:::0 +IDBTransaction:::onerror:::0 +IDBTransaction:::setOnabort:::1 +IDBTransaction:::setOncomplete:::1 +IDBTransaction:::setOnerror:::1 +IDBVersionChangeEvent:::dataLoss:::0 +IDBVersionChangeEvent:::dataLossMessage:::0 +IDBVersionChangeEvent:::newVersion:::1 +IDBVersionChangeEvent:::oldVersion:::0 +IdleDeadline:::didTimeout:::0 +IdleDeadline:::timeRemaining:::0 +IdleRequestCallback:::handleEvent:::1 +IIRFilterNode:::getFrequencyResponse:::4 +ImageBitmap:::close:::0 +ImageBitmapFactories:::createImageBitmap:::4 +ImageBitmapFactories:::createImageBitmap:::5 +ImageBitmapFactories:::createImageBitmap:::8 +ImageBitmapFactories:::createImageBitmap:::9 +ImageBitmap:::height:::0 +ImageBitmapRenderingContext:::canvas:::0 +ImageBitmapRenderingContext:::transferFromImageBitmap:::2 +ImageBitmap:::width:::0 +ImageCapture:::getPhotoCapabilities:::1 +ImageCapture:::grabFrame:::1 +ImageCapture:::setOptions:::2 +ImageCapture:::takePhoto:::1 +ImageCapture:::videoStreamTrack:::0 +ImageData:::createImageData:::4 +ImageData:::createImageData:::5 +ImageData:::data:::0 +ImageData:::dataUnion:::0 +ImageData:::getColorSettings:::0 +ImageData:::height:::0 +ImageData:::width:::0 +Image:::height:::0 +Image:::width:::0 +# ImplementedAs extended attribute), the method below is exposed via a different +InProcessWorkerBase:::postMessage:::4 +InProcessWorkerBase:::terminate:::0 +InputDeviceCapabilities:::firesTouchEvents:::0 +InputEvent:::data:::0 +InputEvent:::dataTransfer:::0 +InputEvent:::getTargetRanges:::0 +InputEvent:::inputType:::0 +InputEvent:::isComposing:::0 +InsertionPoint:::getDistributedNodes:::0 +InspectorOverlayHost:::resume:::0 +InspectorOverlayHost:::stepOver:::0 +InstallEvent:::registerForeignFetch:::3 +Internals::::::1 +Internals:::absoluteCaretBounds:::1 +InternalsAccessibility:::numberOfLiveAXObjects:::1 +Internals:::activeMarkerCountForNode:::1 +Internals:::addCompositionMarker:::5 +Internals:::addOneToPromise:::2 +Internals:::addTextMatchMarker:::3 +Internals:::advanceImageAnimation:::2 +Internals:::advanceTimeForImage:::3 +Internals:::allIconURLs:::1 +Internals:::bestZoomableAreaForTouchPoint:::6 +Internals:::boundingBox:::1 +Internals:::callbackFunctionTest:::0 +Internals:::canHyphenate:::1 +Internals:::canvasFontCacheMaxFonts:::0 +Internals:::clearHitTestCache:::2 +Internals:::clearNetworkConnectionInfoOverride:::0 +Internals:::compareTreeScopePosition:::3 +Internals:::computedStyleIncludingVisitedInfo:::1 +Internals:::countElementShadow:::2 +Internals:::counterValue:::1 +Internals:::countHitRegions:::1 +Internals:::crash:::0 +Internals:::createRejectedPromise:::2 +Internals:::createResolvedPromise:::2 +Internals:::createUserAgentShadowRoot:::1 +Internals:::cursorUpdatePending:::0 +Internals:::deserializeBuffer:::1 +Internals:::deserializeBufferContainingWasm:::2 +Internals:::dictionaryTest:::0 +Internals:::disableCompositedAnimation:::1 +Internals:::disableCSSAdditiveAnimations:::0 +Internals:::draggableRegions:::2 +Internals:::dumpRefCountedInstanceCounts:::0 +Internals:::effectivePreload:::1 +Internals:::elementFromPoint:::6 +Internals:::elementLayerTreeAsText:::2 +Internals:::elementLayerTreeAsText:::3 +Internals:::elementLayoutTreeAsText:::2 +Internals:::elementShouldAutoComplete:::2 +Internals:::endColorChooser:::1 +InternalSettings:::setAccessibilityFontScaleFactor:::2 +InternalSettings:::setAvailableHoverTypes:::2 +InternalSettings:::setAvailablePointerTypes:::2 +InternalSettings:::setCompositorWorkerEnabled:::2 +InternalSettings:::setCSSStickyPositionEnabled:::1 +InternalSettings:::setCursiveFontFamily:::3 +InternalSettings:::setDefaultVideoPosterURL:::2 +InternalSettings:::setDisplayModeOverride:::2 +InternalSettings:::setEditingBehavior:::2 +InternalSettings:::setExperimentalContentSecurityPolicyFeaturesEnabled:::1 +InternalSettings:::setFantasyFontFamily:::3 +InternalSettings:::setFixedFontFamily:::3 +InternalSettings:::setHideScrollbars:::2 +InternalSettings:::setImageAnimationPolicy:::2 +InternalSettings:::setImagesEnabled:::2 +InternalSettings:::setLangAttributeAwareFormControlUIEnabled:::1 +InternalSettings:::setMediaTypeOverride:::2 +InternalSettings:::setMockGestureTapHighlightsEnabled:::2 +InternalSettings:::setMockScrollbarsEnabled:::2 +InternalSettings:::setOverlayScrollbarsEnabled:::1 +InternalSettings:::setPictographFontFamily:::3 +InternalSettings:::setPresentationReceiver:::2 +InternalSettings:::setPrimaryHoverType:::2 +InternalSettings:::setPrimaryPointerType:::2 +InternalSettings:::setSansSerifFontFamily:::3 +InternalSettings:::setScrollTopLeftInteropEnabled:::1 +InternalSettings:::setSerifFontFamily:::3 +InternalSettings:::setStandardFontFamily:::3 +InternalSettings:::setTextAutosizingEnabled:::2 +InternalSettings:::setTextAutosizingWindowSizeOverride:::3 +InternalSettings:::setTextTrackKindUserPreference:::2 +InternalSettings:::setViewportEnabled:::2 +InternalSettings:::setViewportMetaEnabled:::2 +InternalSettings:::setViewportStyle:::2 +Internals:::evictAllResources:::0 +Internals:::executeCommand:::4 +InternalsFetch:::getInternalResponseURLList:::2 +Internals:::firstChildInFlatTree:::2 +Internals:::focusRingRects:::1 +Internals:::forceBlinkGCWithoutV8GC:::0 +Internals:::forceCompositingUpdate:::2 +Internals:::forceFullRepaint:::2 +Internals:::forceReload:::1 +Internals:::formControlStateOfHistoryItem:::1 +Internals:::getCurrentCursorInfo:::0 +Internals:::getImageSourceURL:::1 +Internals:::getProgrammaticScrollAnimationState:::1 +Internals:::getReferencedFilePaths:::0 +Internals:::getResourceHeader:::3 +Internals:::getResourcePriority:::2 +Internals:::getScrollAnimationState:::1 +Internals:::hasAutofocusRequest:::0 +Internals:::hasAutofocusRequest:::1 +Internals:::hasContentElement:::2 +Internals:::hasGrammarMarker:::4 +Internals:::hasShadowInsertionPoint:::2 +Internals:::hasSpellingMarker:::4 +Internals:::hitTestCacheHits:::2 +Internals:::hitTestCount:::2 +Internals:::htmlNamespace:::0 +Internals:::htmlTags:::0 +Internals:::idleTimeSpellCheckerState:::2 +Internals:::ignoreLayoutWithPendingStylesheets:::1 +Internals:::isAnimatedCSSPropertyUseCounted:::2 +Internals:::isCompositedAnimation:::1 +Internals:::isCSSPropertyUseCounted:::2 +Internals:::isInCanvasFontCache:::2 +Internals:::isLoading:::1 +Internals:::isLoadingFromMemoryCache:::1 +Internals:::isOverwriteModeEnabled:::1 +Internals:::isPageBoxVisible:::2 +Internals:::isPreloaded:::1 +Internals:::isPreloadedBy:::2 +Internals:::isSelectPopupVisible:::1 +Internals:::isSharingStyle:::2 +Internals:::isUseCounted:::2 +Internals:::isValidContentSelect:::2 +Internals:::lastChildInFlatTree:::2 +Internals:::lastSpellCheckProcessedSequence:::2 +Internals:::lastSpellCheckRequestSequence:::2 +Internals:::layerTreeAsText:::2 +Internals:::layerTreeAsText:::3 +Internals:::length:::0 +Internals:::lengthFromRange:::2 +Internals:::locationFromRange:::2 +Internals:::loseSharedGraphicsContext3D:::0 +Internals:::magnifyScaleAroundAnchor:::3 +Internals:::mainThreadScrollingReasons:::2 +Internals:::markerCountForNode:::3 +Internals:::markerDescriptionForNode:::4 +Internals:::markerRangeForNode:::4 +Internals:::markerTextForListItem:::1 +Internals:::mediaKeysCount:::0 +Internals:::mediaKeySessionCount:::0 +Internals:::mediaPlayerPlayingRemotelyChanged:::2 +Internals:::mediaPlayerRemoteRouteAvailabilityChanged:::2 +InternalsMediaStream:::addFakeDevice:::5 +Internals:::monotonicTimeToZeroBasedDocumentTime:::2 +InternalsNavigatorContentUtils:::setNavigatorContentUtilsClientMock:::2 +Internals:::needsLayoutCount:::1 +Internals:::nextInFlatTree:::2 +Internals:::nextSiblingInFlatTree:::2 +Internals:::nodesFromRect:::10 +Internals:::nonDraggableRegions:::2 +Internals:::nonFastScrollableRects:::2 +Internals:::numberOfLiveDocuments:::0 +Internals:::numberOfLiveNodes:::0 +Internals:::numberOfPages:::1 +Internals:::numberOfPages:::2 +Internals:::numberOfPages:::3 +Internals:::numberOfScrollableAreas:::1 +Internals:::observeGC:::1 +Internals:::observeUseCounter:::3 +Internals:::oldestShadowRoot:::1 +Internals:::originTrialsTest:::0 +Internals:::outlineRects:::1 +Internals:::pageNumber:::2 +Internals:::pageNumber:::3 +Internals:::pageNumber:::4 +Internals:::pagePopupWindow:::0 +Internals:::pageProperty:::3 +Internals:::pageScaleFactor:::1 +Internals:::pageSizeAndMarginsInPixels:::8 +Internals:::parentTreeScope:::1 +Internals:::pauseAnimations:::2 +Internals:::previousInFlatTree:::2 +Internals:::promiseCheck:::7 +Internals:::promiseCheckOverload:::2 +Internals:::promiseCheckOverload:::4 +Internals:::promiseCheckRange:::2 +Internals:::promiseCheckWithoutExceptionState:::4 +Internals:::rangeAsText:::1 +Internals:::rangeFromLocationAndLength:::3 +Internals:::recordTest:::0 +Internals:::registerURLSchemeAsBypassingContentSecurityPolicy:::1 +Internals:::registerURLSchemeAsBypassingContentSecurityPolicy:::2 +Internals:::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy:::1 +Internals:::replaceMisspelled:::3 +Internals:::resetTypeAheadSession:::1 +InternalsRTCCertificate:::rtcCertificateEquals:::3 +Internals:::runIdleTimeSpellChecker:::2 +Internals:::runtimeFlags:::0 +Internals:::scrollEventHandlerCount:::1 +Internals:::scrollingStateTreeAsText:::1 +Internals:::scrollsWithRespectTo:::3 +Internals:::selectColorInColorChooser:::2 +Internals:::selectedHTMLForClipboard:::0 +Internals:::selectedTextForClipboard:::0 +Internals:::selectionBounds:::1 +Internals:::selectMenuListText:::1 +Internals:::selectPopupItemStyleFontHeight:::2 +Internals:::selectPopupItemStyleIsRtl:::2 +Internals:::serializeObject:::1 +Internals:::serializeWithInlineWasm:::1 +InternalsServiceWorker:::terminateServiceWorker:::2 +Internals:::setAutofilled:::3 +Internals:::setCapsLockState:::1 +Internals:::setEditingValue:::3 +Internals:::setFocused:::1 +Internals:::setFormControlStateOfHistoryItem:::2 +Internals:::setFrameViewPosition:::4 +Internals:::setInitialFocus:::1 +Internals:::setIsCursorVisible:::3 +Internals:::setIsLowEndDevice:::1 +Internals:::setMarkedTextMatchesAreHighlighted:::2 +Internals:::setMarker:::4 +Internals:::setMarkersActive:::4 +Internals:::setMediaElementNetworkState:::2 +Internals:::setMockHyphenation:::1 +Internals:::setNetworkConnectionInfoOverride:::4 +Internals:::setPageScaleFactor:::2 +Internals:::setPageScaleFactorLimits:::3 +Internals:::setPersistent:::2 +Internals:::setScrollbarVisibilityInScrollableArea:::2 +Internals:::setScrollChain:::3 +Internals:::setShouldRevealPassword:::3 +Internals:::setSpellCheckingEnabled:::2 +Internals:::setSuggestedValue:::3 +Internals:::settings:::0 +Internals:::setUserPreferredLanguages:::1 +Internals:::setValueForUser:::2 +Internals:::setVisualViewportOffset:::2 +Internals:::setZoomFactor:::1 +Internals:::shadowPseudoId:::1 +Internals:::shadowRoot:::1 +Internals:::shadowRootType:::2 +Internals:::shortcutIconURLs:::1 +InternalsSpeechSynthesis:::enableMockSpeechSynthesizer:::3 +Internals:::startStoringCompositedLayerDebugInfo:::2 +Internals:::startTrackingRepaints:::2 +Internals:::stopStoringCompositedLayerDebugInfo:::2 +Internals:::stopTrackingRepaints:::2 +Internals:::suggestedValue:::2 +Internals:::suspendableObjectCount:::1 +Internals:::svgNamespace:::0 +Internals:::svgTags:::0 +Internals:::textAffinity:::0 +Internals:::textSurroundingNode:::4 +Internals:::toggleOverwriteModeEnabled:::1 +Internals:::touchEndOrCancelEventHandlerCount:::1 +Internals:::touchEventTargetLayerRects:::2 +Internals:::touchNodeAdjustedToBestClickableNode:::6 +Internals:::touchNodeAdjustedToBestContextMenuNode:::6 +Internals:::touchPositionAdjustedToBestClickableNode:::6 +Internals:::touchPositionAdjustedToBestContextMenuNode:::6 +Internals:::touchStartOrMoveEventHandlerCount:::1 +Internals:::treeScopeRootNode:::1 +Internals:::typeConversions:::0 +Internals:::unionTypesTest:::0 +Internals:::unscopableAttribute:::0 +Internals:::unscopableMethod:::0 +Internals:::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks:::1 +Internals:::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks:::2 +Internals:::updateStyleAndReturnAffectedElementCount:::1 +Internals:::userPreferredLanguages:::0 +InternalsVibration:::isVibrating:::2 +InternalsVibration:::pendingVibrationPattern:::2 +Internals:::viewportAsText:::5 +Internals:::visiblePlaceholder:::1 +Internals:::visibleSelectionAnchorNode:::0 +Internals:::visibleSelectionAnchorOffset:::0 +Internals:::visibleSelectionFocusNode:::0 +Internals:::visibleSelectionFocusOffset:::0 +Internals:::visualRect:::1 +Internals:::visualViewportHeight:::0 +Internals:::visualViewportScrollX:::0 +Internals:::visualViewportScrollY:::0 +Internals:::visualViewportWidth:::0 +InternalsWebAudio:::audioHandlerCount:::1 +Internals:::wheelEventHandlerCount:::1 +Internals:::workerThreadCount:::0 +Internals:::youngerShadowRoot:::2 +Internals:::youngestShadowRoot:::1 +IntersectionObserver:::disconnect:::1 +IntersectionObserverEntry:::boundingClientRect:::0 +IntersectionObserverEntry:::intersectionRatio:::0 +IntersectionObserverEntry:::intersectionRect:::0 +IntersectionObserverEntry:::isIntersecting:::0 +IntersectionObserverEntry:::rootBounds:::0 +IntersectionObserverEntry:::target:::0 +IntersectionObserverEntry:::time:::0 +IntersectionObserver:::observe:::2 +IntersectionObserver:::root:::0 +IntersectionObserver:::rootMargin:::0 +IntersectionObserver:::takeRecords:::1 +IntersectionObserver:::thresholds:::0 +IntersectionObserver:::unobserve:::2 +Iterator:::next:::2 +Iterator:::next:::3 +KeyboardEvent:::altKey:::0 +KeyboardEvent:::charCode:::0 +KeyboardEvent:::code:::0 +KeyboardEvent:::ctrlKey:::0 +KeyboardEvent:::getModifierState:::1 +KeyboardEvent:::initKeyboardEvent:::1 +KeyboardEvent:::initKeyboardEvent:::10 +KeyboardEvent:::initKeyboardEvent:::11 +KeyboardEvent:::initKeyboardEvent:::2 +KeyboardEvent:::initKeyboardEvent:::3 +KeyboardEvent:::initKeyboardEvent:::4 +KeyboardEvent:::initKeyboardEvent:::5 +KeyboardEvent:::initKeyboardEvent:::6 +KeyboardEvent:::initKeyboardEvent:::7 +KeyboardEvent:::initKeyboardEvent:::8 +KeyboardEvent:::initKeyboardEvent:::9 +KeyboardEvent:::isComposing:::0 +KeyboardEvent:::key:::0 +KeyboardEvent:::keyCode:::0 +KeyboardEvent:::location:::0 +KeyboardEvent:::metaKey:::0 +KeyboardEvent:::repeat:::0 +KeyboardEvent:::shiftKey:::0 +KeyboardEvent:::which:::0 +LabelableElement:::labels:::0 +LayerRect:::associatedNodeOffsetX:::0 +LayerRect:::associatedNodeOffsetY:::0 +LayerRect:::layerAssociatedNode:::0 +LayerRect:::layerRelativeRect:::0 +LayerRect:::layerType:::0 +LayerRectList:::item:::1 +LayerRectList:::length:::0 +ListedElement:::setCustomValidity:::1 +ListedElement:::validationMessage:::0 +ListedElement:::validity:::0 +LiveNodeListBase:::ownerNode:::0 +LiveNodeList:::item:::1 +LocalDOMWindow::::::1 +LocalDOMWindow:::alert:::1 +LocalDOMWindow:::alert:::2 +LocalDOMWindow:::animationWorklet:::1 +LocalDOMWindow:::applicationCache:::0 +LocalDOMWindow:::audioWorklet:::1 +LocalDOMWindow:::blur:::0 +LocalDOMWindow:::caches:::2 +LocalDOMWindow:::cancelAnimationFrame:::1 +LocalDOMWindow:::cancelIdleCallback:::1 +LocalDOMWindow:::captureEvents:::0 +LocalDOMWindow:::clientInformation:::0 +LocalDOMWindow:::close:::1 +LocalDOMWindow:::closed:::0 +LocalDOMWindow:::confirm:::1 +LocalDOMWindow:::confirm:::2 +LocalDOMWindow:::crypto:::1 +LocalDOMWindow:::customElements:::1 +LocalDOMWindow:::defaultStatus:::0 +LocalDOMWindow:::devicePixelRatio:::0 +LocalDOMWindow:::document:::0 +LocalDOMWindow:::event:::0 +LocalDOMWindow:::external:::0 +LocalDOMWindow:::fetch:::4 +LocalDOMWindow:::fetch:::5 +LocalDOMWindow:::find:::0 +LocalDOMWindow:::find:::1 +LocalDOMWindow:::find:::2 +LocalDOMWindow:::find:::3 +LocalDOMWindow:::find:::4 +LocalDOMWindow:::find:::5 +LocalDOMWindow:::find:::6 +LocalDOMWindow:::find:::7 +LocalDOMWindow:::focus:::1 +LocalDOMWindow:::frameElement:::0 +LocalDOMWindow:::frames:::0 +LocalDOMWindow:::getComputedStyle:::1 +LocalDOMWindow:::getComputedStyle:::2 +LocalDOMWindow:::getComputedStyleMap:::2 +LocalDOMWindow:::getComputedStyleMap:::3 +LocalDOMWindow:::getMatchedCSSRules:::0 +LocalDOMWindow:::getMatchedCSSRules:::1 +LocalDOMWindow:::getMatchedCSSRules:::2 +LocalDOMWindow:::getSelection:::0 +LocalDOMWindow:::history:::0 +LocalDOMWindow:::indexedDB:::1 +LocalDOMWindow:::innerHeight:::0 +LocalDOMWindow:::innerWidth:::0 +LocalDOMWindow:::isSecureContext:::0 +LocalDOMWindow:::length:::0 +LocalDOMWindow:::localStorage:::2 +LocalDOMWindow:::location:::0 +LocalDOMWindow:::locationbar:::0 +LocalDOMWindow:::matchMedia:::1 +LocalDOMWindow:::menubar:::0 +LocalDOMWindow:::moveBy:::2 +LocalDOMWindow:::moveTo:::2 +LocalDOMWindow:::name:::0 +LocalDOMWindow:::navigator:::0 +LocalDOMWindow:::offscreenBuffering:::0 +LocalDOMWindow:::onanimationend:::0 +LocalDOMWindow:::onanimationiteration:::0 +LocalDOMWindow:::onanimationstart:::0 +LocalDOMWindow:::ondevicelight:::1 +LocalDOMWindow:::ondevicemotion:::1 +LocalDOMWindow:::ondeviceorientation:::1 +LocalDOMWindow:::ondeviceorientationabsolute:::1 +LocalDOMWindow:::onorientationchange:::0 +LocalDOMWindow:::onsearch:::0 +LocalDOMWindow:::ontransitionend:::0 +LocalDOMWindow:::onwebkitanimationend:::0 +LocalDOMWindow:::onwebkitanimationiteration:::0 +LocalDOMWindow:::onwebkitanimationstart:::0 +LocalDOMWindow:::onwebkittransitionend:::0 +LocalDOMWindow:::onwheel:::0 +LocalDOMWindow:::open:::2 +LocalDOMWindow:::open:::3 +LocalDOMWindow:::openDatabase:::6 +LocalDOMWindow:::openDatabase:::7 +LocalDOMWindow:::opener:::0 +LocalDOMWindow:::orientation:::0 +LocalDOMWindow:::origin:::0 +LocalDOMWindow:::outerHeight:::0 +LocalDOMWindow:::outerWidth:::0 +LocalDOMWindow:::pageXOffset:::0 +LocalDOMWindow:::pageYOffset:::0 +LocalDOMWindow:::paintWorklet:::1 +LocalDOMWindow:::parent:::0 +LocalDOMWindow:::performance:::1 +LocalDOMWindow:::personalbar:::0 +LocalDOMWindow:::postMessage:::3 +LocalDOMWindow:::postMessage:::4 +LocalDOMWindow:::print:::1 +LocalDOMWindow:::prompt:::1 +LocalDOMWindow:::prompt:::2 +LocalDOMWindow:::prompt:::3 +LocalDOMWindow:::releaseEvents:::0 +LocalDOMWindow:::requestAnimationFrame:::1 +LocalDOMWindow:::requestIdleCallback:::1 +LocalDOMWindow:::requestIdleCallback:::2 +LocalDOMWindow:::resizeBy:::2 +LocalDOMWindow:::resizeTo:::2 +LocalDOMWindow:::screen:::0 +LocalDOMWindow:::screenLeft:::0 +LocalDOMWindow:::screenTop:::0 +LocalDOMWindow:::screenX:::0 +LocalDOMWindow:::screenY:::0 +LocalDOMWindow:::scroll:::0 +LocalDOMWindow:::scroll:::1 +LocalDOMWindow:::scroll:::2 +LocalDOMWindow:::scrollbars:::0 +LocalDOMWindow:::scrollBy:::0 +LocalDOMWindow:::scrollBy:::1 +LocalDOMWindow:::scrollBy:::2 +LocalDOMWindow:::scrollTo:::0 +LocalDOMWindow:::scrollTo:::1 +LocalDOMWindow:::scrollTo:::2 +LocalDOMWindow:::scrollX:::0 +LocalDOMWindow:::scrollY:::0 +LocalDOMWindow:::self:::0 +LocalDOMWindow:::sessionStorage:::2 +LocalDOMWindow:::setDefaultStatus:::1 +LocalDOMWindow:::setEvent:::1 +LocalDOMWindow:::setName:::1 +LocalDOMWindow:::setOnanimationend:::1 +LocalDOMWindow:::setOnanimationiteration:::1 +LocalDOMWindow:::setOnanimationstart:::1 +LocalDOMWindow:::setOndevicelight:::2 +LocalDOMWindow:::setOndevicemotion:::2 +LocalDOMWindow:::setOndeviceorientation:::2 +LocalDOMWindow:::setOndeviceorientationabsolute:::2 +LocalDOMWindow:::setOnorientationchange:::1 +LocalDOMWindow:::setOnsearch:::1 +LocalDOMWindow:::setOntransitionend:::1 +LocalDOMWindow:::setOnwebkitanimationend:::1 +LocalDOMWindow:::setOnwebkitanimationiteration:::1 +LocalDOMWindow:::setOnwebkitanimationstart:::1 +LocalDOMWindow:::setOnwebkittransitionend:::1 +LocalDOMWindow:::setOnwheel:::1 +LocalDOMWindow:::setOpener:::1 +LocalDOMWindow:::setStatus:::1 +LocalDOMWindow:::setWebKitAnimationEvent:::1 +LocalDOMWindow:::setWebkitMediaStream:::2 +LocalDOMWindow:::setWebKitMutationObserver:::1 +LocalDOMWindow:::setWebkitRTCPeerConnection:::2 +LocalDOMWindow:::setWebkitSpeechGrammar:::2 +LocalDOMWindow:::setWebkitSpeechGrammarList:::2 +LocalDOMWindow:::setWebkitSpeechRecognition:::2 +LocalDOMWindow:::setWebkitSpeechRecognitionError:::2 +LocalDOMWindow:::setWebkitSpeechRecognitionEvent:::2 +LocalDOMWindow:::setWebKitTransitionEvent:::1 +LocalDOMWindow:::setWebkitURL:::1 +LocalDOMWindow:::speechSynthesis:::2 +LocalDOMWindow:::status:::0 +LocalDOMWindow:::statusbar:::0 +LocalDOMWindow:::stop:::0 +LocalDOMWindow:::styleMedia:::0 +LocalDOMWindow:::toolbar:::0 +LocalDOMWindow:::top:::0 +LocalDOMWindow:::visualViewport:::0 +LocalDOMWindow:::webKitAnimationEvent:::0 +LocalDOMWindow:::webkitMediaStream:::1 +LocalDOMWindow:::webKitMutationObserver:::0 +LocalDOMWindow:::webkitRequestAnimationFrame:::1 +LocalDOMWindow:::webkitRequestFileSystem:::4 +LocalDOMWindow:::webkitRequestFileSystem:::5 +LocalDOMWindow:::webkitResolveLocalFileSystemURL:::3 +LocalDOMWindow:::webkitResolveLocalFileSystemURL:::4 +LocalDOMWindow:::webkitRTCPeerConnection:::1 +LocalDOMWindow:::webkitSpeechGrammar:::1 +LocalDOMWindow:::webkitSpeechGrammarList:::1 +LocalDOMWindow:::webkitSpeechRecognition:::1 +LocalDOMWindow:::webkitSpeechRecognitionError:::1 +LocalDOMWindow:::webkitSpeechRecognitionEvent:::1 +LocalDOMWindow:::webkitStorageInfo:::1 +LocalDOMWindow:::webKitTransitionEvent:::0 +LocalDOMWindow:::webkitURL:::0 +LocalDOMWindow:::window:::0 +Location:::ancestorOrigins:::0 +Location:::assign:::4 +Location:::hash:::0 +Location:::host:::0 +Location:::hostname:::0 +Location:::href:::0 +Location:::origin:::0 +Location:::pathname:::0 +Location:::port:::0 +Location:::protocol:::0 +Location:::reload:::1 +Location:::replace:::4 +Location:::search:::0 +Location:::setHash:::4 +Location:::setHost:::4 +Location:::setHostname:::4 +Location:::setHref:::4 +Location:::setPathname:::4 +Location:::setPort:::4 +Location:::setProtocol:::4 +Location:::setSearch:::4 +Location:::valueOf:::1 +Magnetometer:::x:::1 +Magnetometer:::y:::1 +Magnetometer:::z:::1 +MediaCapabilities:::query:::2 +MediaDecodingAbility:::powerEfficient:::0 +MediaDecodingAbility:::smooth:::0 +MediaDecodingAbility:::supported:::0 +MediaDeviceInfo:::deviceId:::0 +MediaDeviceInfo:::groupId:::0 +MediaDeviceInfo:::kind:::0 +MediaDeviceInfo:::label:::0 +MediaDeviceInfo:::toJSONForBinding:::0 +MediaDevices:::enumerateDevices:::1 +MediaDevices:::getSupportedConstraints:::0 +MediaDevices:::getUserMedia:::2 +MediaDevices:::getUserMedia:::3 +MediaDevices:::ondevicechange:::0 +MediaDevices:::setOndevicechange:::1 +MediaElementAudioSourceNode:::mediaElement:::0 +MediaEncryptedEvent:::initData:::0 +MediaEncryptedEvent:::initDataType:::0 +MediaError:::code:::0 +MediaKeyMessageEvent:::message:::0 +MediaKeyMessageEvent:::messageType:::0 +MediaKeys:::createSession:::2 +MediaKeys:::createSession:::3 +MediaKeySession:::close:::1 +MediaKeySession:::closed:::1 +MediaKeySession:::expiration:::0 +MediaKeySession:::generateRequest:::3 +MediaKeySession:::keyStatuses:::0 +MediaKeySession:::load:::2 +MediaKeySession:::onkeystatuseschange:::0 +MediaKeySession:::onmessage:::0 +MediaKeySession:::remove:::1 +MediaKeySession:::sessionId:::0 +MediaKeySession:::setOnkeystatuseschange:::1 +MediaKeySession:::setOnmessage:::1 +MediaKeySession:::update:::2 +MediaKeys:::setServerCertificate:::2 +MediaKeyStatusMap:::get:::2 +MediaKeyStatusMap:::has:::1 +MediaKeyStatusMap:::size:::0 +MediaKeySystemAccess:::createMediaKeys:::1 +MediaKeySystemAccess:::getConfiguration:::0 +MediaKeySystemAccess:::keySystem:::0 +MediaList:::appendMedium:::2 +MediaList:::deleteMedium:::2 +MediaList:::item:::1 +MediaList:::length:::0 +MediaList:::mediaText:::0 +MediaList:::setMediaText:::1 +MediaMetadata:::album:::0 +MediaMetadata:::artist:::0 +MediaMetadata:::artwork:::1 +MediaMetadata:::setAlbum:::1 +MediaMetadata:::setArtist:::1 +MediaMetadata:::setArtwork:::3 +MediaMetadata:::setTitle:::1 +MediaMetadata:::title:::0 +MediaQueryList:::addDeprecatedListener:::1 +MediaQueryListEvent:::matches:::0 +MediaQueryListEvent:::media:::0 +MediaQueryList:::matches:::0 +MediaQueryList:::media:::0 +MediaQueryList:::onchange:::0 +MediaQueryList:::removeDeprecatedListener:::1 +MediaQueryList:::setOnchange:::1 +MediaRecorder:::audioBitsPerSecond:::0 +MediaRecorder:::isTypeSupported:::1 +MediaRecorder:::mimeType:::0 +MediaRecorder:::ondataavailable:::0 +MediaRecorder:::onerror:::0 +MediaRecorder:::onpause:::0 +MediaRecorder:::onresume:::0 +MediaRecorder:::onstart:::0 +MediaRecorder:::onstop:::0 +MediaRecorder:::pause:::1 +MediaRecorder:::requestData:::1 +MediaRecorder:::resume:::1 +MediaRecorder:::setOndataavailable:::1 +MediaRecorder:::setOnerror:::1 +MediaRecorder:::setOnpause:::1 +MediaRecorder:::setOnresume:::1 +MediaRecorder:::setOnstart:::1 +MediaRecorder:::setOnstop:::1 +MediaRecorder:::start:::1 +MediaRecorder:::start:::2 +MediaRecorder:::state:::0 +MediaRecorder:::stop:::1 +MediaRecorder:::stream:::0 +MediaRecorder:::videoBitsPerSecond:::0 +MediaSession:::metadata:::0 +MediaSession:::playbackState:::0 +MediaSession:::setActionHandler:::2 +MediaSession:::setMetadata:::1 +MediaSession:::setPlaybackState:::1 +MediaSettingsRange:::max:::0 +MediaSettingsRange:::min:::0 +MediaSettingsRange:::step:::0 +MediaSource:::activeSourceBuffers:::0 +MediaSource:::addSourceBuffer:::2 +MediaSource:::clearLiveSeekableRange:::1 +MediaSource:::duration:::0 +MediaSource:::endOfStream:::1 +MediaSource:::endOfStream:::2 +MediaSource:::isTypeSupported:::1 +MediaSource:::onsourceclose:::0 +MediaSource:::onsourceended:::0 +MediaSource:::onsourceopen:::0 +MediaSource:::readyState:::0 +MediaSource:::removeSourceBuffer:::2 +MediaSource:::setDuration:::2 +MediaSource:::setLiveSeekableRange:::3 +MediaSource:::setOnsourceclose:::1 +MediaSource:::setOnsourceended:::1 +MediaSource:::setOnsourceopen:::1 +MediaSource:::sourceBuffers:::0 +MediaStream:::active:::0 +MediaStream:::addTrack:::2 +MediaStreamAudioDestinationNode:::stream:::0 +MediaStreamAudioSourceNode:::getMediaStream:::0 +MediaStream:::clone:::1 +MediaStreamEvent:::stream:::0 +MediaStream:::getAudioTracks:::0 +MediaStream:::getTrackById:::1 +MediaStream:::getTracks:::0 +MediaStream:::getVideoTracks:::0 +MediaStream:::id:::0 +MediaStream:::onactive:::0 +MediaStream:::onaddtrack:::0 +MediaStream:::oninactive:::0 +MediaStream:::onremovetrack:::0 +MediaStream:::removeTrack:::2 +MediaStream:::setOnactive:::1 +MediaStream:::setOnaddtrack:::1 +MediaStream:::setOninactive:::1 +MediaStream:::setOnremovetrack:::1 +MediaStreamTrack:::applyConstraints:::1 +MediaStreamTrack:::applyConstraints:::2 +MediaStreamTrack:::clone:::1 +MediaStreamTrackContentHint:::contentHint:::1 +MediaStreamTrackContentHint:::setContentHint:::2 +MediaStreamTrack:::enabled:::0 +MediaStreamTrackEvent:::track:::0 +MediaStreamTrack:::getCapabilities:::0 +MediaStreamTrack:::getConstraints:::0 +MediaStreamTrack:::getSettings:::0 +MediaStreamTrack:::id:::0 +MediaStreamTrack:::kind:::0 +MediaStreamTrack:::label:::0 +MediaStreamTrack:::muted:::0 +MediaStreamTrack:::onended:::0 +MediaStreamTrack:::onmute:::0 +MediaStreamTrack:::onunmute:::0 +MediaStreamTrack:::readyState:::0 +MediaStreamTrack:::setEnabled:::1 +MediaStreamTrack:::setOnended:::1 +MediaStreamTrack:::setOnmute:::1 +MediaStreamTrack:::setOnunmute:::1 +MediaStreamTrack:::stopTrack:::1 +MemoryInfo:::jsHeapSizeLimit:::0 +MemoryInfo:::totalJSHeapSize:::0 +MemoryInfo:::usedJSHeapSize:::0 +MessageCallback:::handleMessage:::1 +MessageChannel:::port1:::0 +MessageChannel:::port2:::0 +MessageEvent:::data:::0 +MessageEvent:::initMessageEvent:::0 +MessageEvent:::initMessageEvent:::1 +MessageEvent:::initMessageEvent:::2 +MessageEvent:::initMessageEvent:::3 +MessageEvent:::initMessageEvent:::4 +MessageEvent:::initMessageEvent:::5 +MessageEvent:::initMessageEvent:::6 +MessageEvent:::initMessageEvent:::7 +MessageEvent:::initMessageEvent:::8 +MessageEvent:::lastEventId:::0 +MessageEvent:::origin:::0 +MessageEvent:::ports:::1 +MessageEvent:::source:::0 +MessageEvent:::suborigin:::0 +MessagePort:::close:::0 +MessagePort:::onmessage:::0 +MessagePort:::postMessage:::3 +MessagePort:::postMessage:::4 +MessagePort:::setOnmessage:::1 +MessagePort:::start:::0 +MetadataCallback:::handleEvent:::1 +Metadata:::modificationTime:::0 +Metadata:::size:::0 +# Methods declared in a base class: +MIDIAccess:::inputs:::0 +MIDIAccess:::onstatechange:::0 +MIDIAccess:::outputs:::0 +MIDIAccess:::setOnstatechange:::1 +MIDIAccess:::sysexEnabled:::0 +MIDIConnectionEvent:::port:::0 +MIDIInputMap:::size:::0 +MIDIInput:::onmidimessage:::0 +MIDIInput:::setOnmidimessage:::1 +MIDIMessageEvent:::data:::0 +MIDIOutputMap:::size:::0 +MIDIOutput:::send:::2 +MIDIOutput:::send:::3 +MIDIPort:::close:::1 +MIDIPort:::connection:::0 +MIDIPort:::id:::0 +MIDIPort:::manufacturer:::0 +MIDIPortMap:::size:::0 +MIDIPort:::midiAccess:::0 +MIDIPort:::name:::0 +MIDIPort:::onstatechange:::0 +MIDIPort:::open:::1 +MIDIPort:::setOnstatechange:::1 +MIDIPort:::state:::0 +MIDIPort:::type:::0 +MIDIPort:::version:::0 +Mojo:::createDataPipe:::1 +Mojo:::createMessagePipe:::0 +Mojo:::createSharedBuffer:::1 +MojoHandle:::close:::0 +MojoHandle:::discardData:::1 +MojoHandle:::discardData:::2 +MojoHandle:::duplicateBufferHandle:::0 +MojoHandle:::duplicateBufferHandle:::1 +MojoHandle:::mapBuffer:::2 +MojoHandle:::queryData:::0 +MojoHandle:::readData:::1 +MojoHandle:::readData:::2 +MojoHandle:::readMessage:::0 +MojoHandle:::readMessage:::1 +MojoHandle:::watch:::3 +MojoHandle:::writeData:::1 +MojoHandle:::writeData:::2 +MojoHandle:::writeMessage:::2 +MojoWatcher:::cancel:::0 +MouseEvent:::altKey:::0 +MouseEvent:::button:::0 +MouseEvent:::buttons:::0 +MouseEvent:::clientX:::0 +MouseEvent:::clientY:::0 +MouseEvent:::ctrlKey:::0 +MouseEvent:::fromElement:::0 +MouseEvent:::getDataTransfer:::0 +MouseEvent:::getModifierState:::1 +MouseEvent:::initMouseEvent:::1 +MouseEvent:::initMouseEvent:::10 +MouseEvent:::initMouseEvent:::11 +MouseEvent:::initMouseEvent:::12 +MouseEvent:::initMouseEvent:::13 +MouseEvent:::initMouseEvent:::14 +MouseEvent:::initMouseEvent:::15 +MouseEvent:::initMouseEvent:::16 +MouseEvent:::initMouseEvent:::2 +MouseEvent:::initMouseEvent:::3 +MouseEvent:::initMouseEvent:::4 +MouseEvent:::initMouseEvent:::5 +MouseEvent:::initMouseEvent:::6 +MouseEvent:::initMouseEvent:::7 +MouseEvent:::initMouseEvent:::8 +MouseEvent:::initMouseEvent:::9 +MouseEvent:::layerX:::0 +MouseEvent:::layerY:::0 +MouseEvent:::metaKey:::0 +MouseEvent:::movementX:::0 +MouseEvent:::movementY:::0 +MouseEvent:::offsetX:::0 +MouseEvent:::offsetY:::0 +MouseEvent:::pageX:::0 +MouseEvent:::pageY:::0 +MouseEvent:::region:::0 +MouseEvent:::relatedTarget:::0 +MouseEvent:::screenX:::0 +MouseEvent:::screenY:::0 +MouseEvent:::shiftKey:::0 +MouseEvent:::toElement:::0 +MouseEvent:::which:::0 +MouseEvent:::x:::0 +MouseEvent:::y:::0 +MutationEvent:::attrChange:::0 +MutationEvent:::attrName:::0 +MutationEvent:::initMutationEvent:::0 +MutationEvent:::initMutationEvent:::1 +MutationEvent:::initMutationEvent:::2 +MutationEvent:::initMutationEvent:::3 +MutationEvent:::initMutationEvent:::4 +MutationEvent:::initMutationEvent:::5 +MutationEvent:::initMutationEvent:::6 +MutationEvent:::initMutationEvent:::7 +MutationEvent:::initMutationEvent:::8 +MutationEvent:::newValue:::0 +MutationEvent:::prevValue:::0 +MutationEvent:::relatedNode:::0 +MutationObserver:::disconnect:::0 +MutationObserver:::observe:::2 +MutationObserver:::observe:::3 +MutationObserver:::takeRecords:::0 +MutationRecord:::addedNodes:::0 +MutationRecord:::attributeName:::0 +MutationRecord:::attributeNamespace:::0 +MutationRecord:::nextSibling:::0 +MutationRecord:::oldValue:::0 +MutationRecord:::previousSibling:::0 +MutationRecord:::removedNodes:::0 +MutationRecord:::target:::0 +MutationRecord:::type:::0 +NamedNodeMap:::getNamedItem:::1 +NamedNodeMap:::getNamedItemNS:::2 +NamedNodeMap:::item:::1 +NamedNodeMap:::length:::0 +NamedNodeMap:::removeNamedItem:::2 +NamedNodeMap:::removeNamedItemNS:::3 +NamedNodeMap:::setNamedItem:::2 +NamedNodeMap:::setNamedItemNS:::2 +NavigationPreloadManager:::disable:::1 +NavigationPreloadManager:::enable:::1 +NavigationPreloadManager:::getState:::1 +NavigationPreloadManager:::setHeaderValue:::2 +NavigatorAuth:::authentication:::1 +NavigatorBattery:::getBattery:::2 +NavigatorBeacon:::sendBeacon:::4 +NavigatorBeacon:::sendBeacon:::5 +NavigatorBluetooth:::bluetooth:::1 +NavigatorBudget:::budget:::1 +NavigatorContentUtils:::isProtocolHandlerRegistered:::4 +NavigatorContentUtils:::registerProtocolHandler:::5 +NavigatorContentUtils:::unregisterProtocolHandler:::4 +Navigator:::cookieEnabled:::0 +NavigatorCookies:::cookieEnabled:::0 +NavigatorCPU:::hardwareConcurrency:::0 +NavigatorCredentials:::credentials:::1 +NavigatorDoNotTrack:::doNotTrack:::1 +NavigatorEvents:::maxTouchPoints:::1 +NavigatorGamepad:::getGamepads:::1 +NavigatorGeolocation:::geolocation:::1 +NavigatorID:::appCodeName:::0 +NavigatorID:::appName:::0 +NavigatorID:::appVersion:::0 +NavigatorID:::platform:::0 +NavigatorID:::product:::0 +NavigatorID:::userAgent:::0 +NavigatorInstalledApp:::getInstalledRelatedApps:::2 +NavigatorLanguage:::hasLanguagesChanged:::0 +NavigatorLanguage:::language:::0 +NavigatorLanguage:::languages:::0 +NavigatorMediaCapabilities:::mediaCapabilities:::1 +NavigatorMediaSession:::mediaSession:::2 +NavigatorMediaStream:::getUserMedia:::5 +NavigatorNetworkInformation:::connection:::1 +NavigatorNFC:::nfc:::1 +NavigatorOnLine:::onLine:::0 +NavigatorPermissions:::permissions:::1 +NavigatorPlugins:::javaEnabled:::1 +NavigatorPlugins:::mimeTypes:::1 +NavigatorPlugins:::plugins:::1 +NavigatorPresentation:::presentation:::1 +Navigator:::productSub:::0 +NavigatorRequestMediaKeySystemAccess:::requestMediaKeySystemAccess:::4 +NavigatorServiceWorker:::serviceWorker:::3 +NavigatorShare:::share:::3 +NavigatorStorageQuota:::storage:::1 +NavigatorStorageQuota:::webkitPersistentStorage:::1 +NavigatorStorageQuota:::webkitTemporaryStorage:::1 +NavigatorUSB:::usb:::1 +NavigatorUserMediaErrorCallback:::handleEvent:::1 +NavigatorUserMediaError:::constraintName:::0 +NavigatorUserMediaError:::message:::0 +NavigatorUserMediaError:::name:::0 +NavigatorUserMedia:::mediaDevices:::1 +NavigatorUserMediaSuccessCallback:::handleEvent:::1 +Navigator:::vendor:::0 +Navigator:::vendorSub:::0 +NavigatorVibration:::vibrate:::2 +NavigatorVR:::getVRDisplays:::2 +NavigatorWebMIDI:::requestMIDIAccess:::2 +NavigatorWebMIDI:::requestMIDIAccess:::3 +NetworkInformation:::downlinkMax:::0 +NetworkInformation:::onchange:::0 +NetworkInformation:::ontypechange:::0 +NetworkInformation:::setOnchange:::1 +NetworkInformation:::setOntypechange:::1 +NetworkInformation:::type:::0 +NFC:::cancelPush:::1 +NFC:::cancelPush:::2 +NFC:::cancelWatch:::1 +NFC:::cancelWatch:::2 +NFC:::push:::2 +NFC:::push:::3 +NFC:::watch:::2 +NFC:::watch:::3 +Node:::appendChild:::2 +Node:::assignedSlotForBinding:::0 +Node:::baseURI:::0 +Node:::childNodes:::0 +Node:::cloneNode:::1 +Node:::cloneNode:::2 +Node:::compareDocumentPosition:::1 +Node:::contains:::1 +NodeFilter:::acceptNode:::1 +NodeFilter:::acceptNode:::2 +Node:::firstChild:::0 +Node:::getDestinationInsertionPoints:::0 +Node:::getNodeType:::0 +Node:::getRootNode:::0 +Node:::getRootNode:::1 +Node:::hasChildren:::0 +Node:::insertBefore:::3 +Node:::isConnected:::0 +Node:::isDefaultNamespace:::1 +Node:::isEqualNode:::1 +Node:::isSameNode:::1 +NodeIteratorBase:::filter:::0 +NodeIteratorBase:::root:::0 +NodeIteratorBase:::whatToShow:::0 +NodeIterator:::detach:::0 +NodeIterator:::filter:::0 +NodeIterator:::nextNode:::1 +NodeIterator:::pointerBeforeReferenceNode:::0 +NodeIterator:::previousNode:::1 +NodeIterator:::referenceNode:::0 +NodeIterator:::root:::0 +NodeIterator:::whatToShow:::0 +Node:::lastChild:::0 +NodeList:::item:::1 +NodeList:::length:::0 +Node:::lookupNamespaceURI:::1 +Node:::lookupPrefix:::1 +Node:::nextSibling:::0 +Node:::nodeName:::0 +Node:::nodeValue:::0 +Node:::normalize:::0 +Node:::ownerDocument:::0 +Node:::parentElement:::0 +Node:::parentNode:::0 +Node:::previousSibling:::0 +Node:::remove:::1 +Node:::removeChild:::2 +Node:::replaceChild:::3 +Node:::setNodeValue:::1 +Node:::setTextContent:::1 +Node:::tabIndex:::0 +Node:::textContent:::0 +NonDocumentTypeChildNode:::nextElementSibling:::1 +NonDocumentTypeChildNode:::previousElementSibling:::1 +NonElementParentNode:::getElementById:::2 +Notification:::actions:::1 +Notification:::badge:::0 +Notification:::body:::0 +Notification:::close:::0 +Notification:::data:::1 +Notification:::dir:::0 +NotificationEvent:::action:::0 +NotificationEvent:::getNotification:::0 +NotificationEvent:::reply:::0 +Notification:::icon:::0 +Notification:::image:::0 +Notification:::lang:::0 +Notification:::maxActions:::0 +Notification:::onclick:::0 +Notification:::onclose:::0 +Notification:::onerror:::0 +Notification:::onshow:::0 +Notification:::permission:::1 +NotificationPermissionCallback:::handleEvent:::1 +Notification:::renotify:::0 +Notification:::requestPermission:::1 +Notification:::requestPermission:::2 +Notification:::requireInteraction:::0 +Notification:::setOnclick:::1 +Notification:::setOnclose:::1 +Notification:::setOnerror:::1 +Notification:::setOnshow:::1 +Notification:::silent:::0 +Notification:::tag:::0 +Notification:::timestamp:::0 +Notification:::title:::0 +Notification:::vibrate:::0 +OESVertexArrayObject:::bindVertexArrayOES:::0 +OESVertexArrayObject:::bindVertexArrayOES:::1 +OESVertexArrayObject:::createVertexArrayOES:::0 +OESVertexArrayObject:::deleteVertexArrayOES:::0 +OESVertexArrayObject:::deleteVertexArrayOES:::1 +OESVertexArrayObject:::isVertexArrayOES:::0 +OESVertexArrayObject:::isVertexArrayOES:::1 +OfflineAudioCompletionEvent:::renderedBuffer:::0 +OfflineAudioContext:::length:::0 +OfflineAudioContext:::oncomplete:::0 +OfflineAudioContext:::setOncomplete:::1 +OfflineAudioContext:::startOfflineRendering:::1 +OfflineAudioContext:::suspendContext:::2 +OffscreenCanvas:::convertToBlob:::2 +OffscreenCanvas:::convertToBlob:::3 +OffscreenCanvas:::height:::0 +OffscreenCanvasModules:::getContext:::4 +OffscreenCanvasModules:::getContext:::5 +OffscreenCanvasRenderingContext2D:::beginPath:::0 +OffscreenCanvasRenderingContext2D:::clearRect:::4 +OffscreenCanvasRenderingContext2D:::clip:::0 +OffscreenCanvasRenderingContext2D:::clip:::1 +OffscreenCanvasRenderingContext2D:::commit:::2 +OffscreenCanvasRenderingContext2D:::createImageData:::2 +OffscreenCanvasRenderingContext2D:::createImageData:::3 +OffscreenCanvasRenderingContext2D:::createLinearGradient:::4 +OffscreenCanvasRenderingContext2D:::createPattern:::4 +OffscreenCanvasRenderingContext2D:::createRadialGradient:::7 +OffscreenCanvasRenderingContext2D:::drawImage:::11 +OffscreenCanvasRenderingContext2D:::drawImage:::5 +OffscreenCanvasRenderingContext2D:::drawImage:::7 +OffscreenCanvasRenderingContext2D:::fill:::0 +OffscreenCanvasRenderingContext2D:::fill:::1 +OffscreenCanvasRenderingContext2D:::fill:::2 +OffscreenCanvasRenderingContext2D:::fillRect:::4 +OffscreenCanvasRenderingContext2D:::fillStyle:::1 +OffscreenCanvasRenderingContext2D:::filter:::0 +OffscreenCanvasRenderingContext2D:::getImageData:::5 +OffscreenCanvasRenderingContext2D:::getLineDash:::0 +OffscreenCanvasRenderingContext2D:::globalAlpha:::0 +OffscreenCanvasRenderingContext2D:::globalCompositeOperation:::0 +OffscreenCanvasRenderingContext2D:::imageSmoothingEnabled:::0 +OffscreenCanvasRenderingContext2D:::imageSmoothingQuality:::0 +OffscreenCanvasRenderingContext2D:::isPointInPath:::2 +OffscreenCanvasRenderingContext2D:::isPointInPath:::3 +OffscreenCanvasRenderingContext2D:::isPointInPath:::4 +OffscreenCanvasRenderingContext2D:::isPointInStroke:::2 +OffscreenCanvasRenderingContext2D:::isPointInStroke:::3 +OffscreenCanvasRenderingContext2D:::lineCap:::0 +OffscreenCanvasRenderingContext2D:::lineDashOffset:::0 +OffscreenCanvasRenderingContext2D:::lineJoin:::0 +OffscreenCanvasRenderingContext2D:::lineWidth:::0 +OffscreenCanvasRenderingContext2D:::miterLimit:::0 +OffscreenCanvasRenderingContext2D:::offscreenCanvas:::0 +OffscreenCanvasRenderingContext2D:::putImageData:::4 +OffscreenCanvasRenderingContext2D:::putImageData:::8 +OffscreenCanvasRenderingContext2D:::resetTransform:::0 +OffscreenCanvasRenderingContext2D:::restore:::0 +OffscreenCanvasRenderingContext2D:::rotate:::1 +OffscreenCanvasRenderingContext2D:::save:::0 +OffscreenCanvasRenderingContext2D:::scale:::2 +OffscreenCanvasRenderingContext2D:::setFillStyle:::1 +OffscreenCanvasRenderingContext2D:::setFilter:::1 +OffscreenCanvasRenderingContext2D:::setGlobalAlpha:::1 +OffscreenCanvasRenderingContext2D:::setGlobalCompositeOperation:::1 +OffscreenCanvasRenderingContext2D:::setImageSmoothingEnabled:::1 +OffscreenCanvasRenderingContext2D:::setImageSmoothingQuality:::1 +OffscreenCanvasRenderingContext2D:::setLineCap:::1 +OffscreenCanvasRenderingContext2D:::setLineDash:::1 +OffscreenCanvasRenderingContext2D:::setLineDashOffset:::1 +OffscreenCanvasRenderingContext2D:::setLineJoin:::1 +OffscreenCanvasRenderingContext2D:::setLineWidth:::1 +OffscreenCanvasRenderingContext2D:::setMiterLimit:::1 +OffscreenCanvasRenderingContext2D:::setShadowBlur:::1 +OffscreenCanvasRenderingContext2D:::setShadowColor:::1 +OffscreenCanvasRenderingContext2D:::setShadowOffsetX:::1 +OffscreenCanvasRenderingContext2D:::setShadowOffsetY:::1 +OffscreenCanvasRenderingContext2D:::setStrokeStyle:::1 +OffscreenCanvasRenderingContext2D:::setTransform:::6 +OffscreenCanvasRenderingContext2D:::shadowBlur:::0 +OffscreenCanvasRenderingContext2D:::shadowColor:::0 +OffscreenCanvasRenderingContext2D:::shadowOffsetX:::0 +OffscreenCanvasRenderingContext2D:::shadowOffsetY:::0 +OffscreenCanvasRenderingContext2D:::stroke:::0 +OffscreenCanvasRenderingContext2D:::stroke:::1 +OffscreenCanvasRenderingContext2D:::strokeRect:::4 +OffscreenCanvasRenderingContext2D:::strokeStyle:::1 +OffscreenCanvasRenderingContext2D:::transform:::6 +OffscreenCanvasRenderingContext2D:::translate:::2 +OffscreenCanvas:::setHeight:::1 +OffscreenCanvas:::setWidth:::1 +OffscreenCanvas:::transferToImageBitmap:::2 +OffscreenCanvas:::width:::0 +OrientationSensor:::isReadingDirty:::0 +OrientationSensor:::populateMatrix:::2 +OrientationSensor:::quaternion:::1 +OriginTrialsTest:::normalAttribute:::0 +OriginTrialsTestPartial:::methodPartial:::1 +OriginTrialsTestPartial:::normalAttributePartial:::1 +OriginTrialsTestPartial:::staticAttributePartial:::0 +OriginTrialsTestPartial:::staticMethodPartial:::0 +OriginTrialsTest:::staticAttribute:::0 +OriginTrialsTest:::throwingAttribute:::2 +OriginTrialsTest:::unconditionalAttribute:::0 +OscillatorNode:::detune:::0 +OscillatorNode:::frequency:::0 +OscillatorNode:::setPeriodicWave:::1 +OscillatorNode:::setType:::2 +OscillatorNode:::type:::0 +PagePopupController:::closePopup:::0 +PagePopupController:::formatMonth:::2 +PagePopupController:::formatShortMonth:::2 +PagePopupController:::formatWeek:::3 +PagePopupController:::localizeNumberString:::1 +PagePopupController:::selectFontsFromOwnerDocument:::1 +PagePopupController:::setValue:::1 +PagePopupController:::setValueAndClosePopup:::2 +PagePopupController:::setWindowRect:::4 +PageTransitionEvent:::persisted:::0 +PaintRenderingContext2D:::beginPath:::0 +PaintRenderingContext2D:::clearRect:::4 +PaintRenderingContext2D:::clip:::0 +PaintRenderingContext2D:::clip:::1 +PaintRenderingContext2D:::clip:::2 +PaintRenderingContext2D:::createLinearGradient:::4 +PaintRenderingContext2D:::createPattern:::4 +PaintRenderingContext2D:::createRadialGradient:::7 +PaintRenderingContext2D:::currentTransform:::0 +PaintRenderingContext2D:::drawImage:::11 +PaintRenderingContext2D:::drawImage:::5 +PaintRenderingContext2D:::drawImage:::7 +PaintRenderingContext2D:::fill:::0 +PaintRenderingContext2D:::fill:::1 +PaintRenderingContext2D:::fill:::2 +PaintRenderingContext2D:::fillRect:::4 +PaintRenderingContext2D:::fillStyle:::1 +PaintRenderingContext2D:::getLineDash:::0 +PaintRenderingContext2D:::globalAlpha:::0 +PaintRenderingContext2D:::globalCompositeOperation:::0 +PaintRenderingContext2D:::imageSmoothingEnabled:::0 +PaintRenderingContext2D:::imageSmoothingQuality:::0 +PaintRenderingContext2D:::isPointInPath:::2 +PaintRenderingContext2D:::isPointInPath:::3 +PaintRenderingContext2D:::isPointInPath:::4 +PaintRenderingContext2D:::isPointInStroke:::2 +PaintRenderingContext2D:::isPointInStroke:::3 +PaintRenderingContext2D:::lineCap:::0 +PaintRenderingContext2D:::lineDashOffset:::0 +PaintRenderingContext2D:::lineJoin:::0 +PaintRenderingContext2D:::lineWidth:::0 +PaintRenderingContext2D:::miterLimit:::0 +PaintRenderingContext2D:::resetTransform:::0 +PaintRenderingContext2D:::restore:::0 +PaintRenderingContext2D:::rotate:::1 +PaintRenderingContext2D:::save:::0 +PaintRenderingContext2D:::scale:::2 +PaintRenderingContext2D:::setCurrentTransform:::1 +PaintRenderingContext2D:::setFillStyle:::1 +PaintRenderingContext2D:::setGlobalAlpha:::1 +PaintRenderingContext2D:::setGlobalCompositeOperation:::1 +PaintRenderingContext2D:::setImageSmoothingEnabled:::1 +PaintRenderingContext2D:::setImageSmoothingQuality:::1 +PaintRenderingContext2D:::setLineCap:::1 +PaintRenderingContext2D:::setLineDash:::1 +PaintRenderingContext2D:::setLineDashOffset:::1 +PaintRenderingContext2D:::setLineJoin:::1 +PaintRenderingContext2D:::setLineWidth:::1 +PaintRenderingContext2D:::setMiterLimit:::1 +PaintRenderingContext2D:::setShadowBlur:::1 +PaintRenderingContext2D:::setShadowColor:::1 +PaintRenderingContext2D:::setShadowOffsetX:::1 +PaintRenderingContext2D:::setShadowOffsetY:::1 +PaintRenderingContext2D:::setStrokeStyle:::1 +PaintRenderingContext2D:::setTransform:::6 +PaintRenderingContext2D:::shadowBlur:::0 +PaintRenderingContext2D:::shadowColor:::0 +PaintRenderingContext2D:::shadowOffsetX:::0 +PaintRenderingContext2D:::shadowOffsetY:::0 +PaintRenderingContext2D:::stroke:::0 +PaintRenderingContext2D:::stroke:::1 +PaintRenderingContext2D:::strokeRect:::4 +PaintRenderingContext2D:::strokeStyle:::1 +PaintRenderingContext2D:::transform:::6 +PaintRenderingContext2D:::translate:::2 +PaintSize:::height:::0 +PaintSize:::width:::0 +PaintWorkletGlobalScope:::registerPaint:::3 +PannerNode:::coneInnerAngle:::0 +PannerNode:::coneOuterAngle:::0 +PannerNode:::coneOuterGain:::0 +PannerNode:::distanceModel:::0 +PannerNode:::maxDistance:::0 +PannerNode:::orientationX:::0 +PannerNode:::orientationY:::0 +PannerNode:::orientationZ:::0 +PannerNode:::panningModel:::0 +PannerNode:::positionX:::0 +PannerNode:::positionY:::0 +PannerNode:::positionZ:::0 +PannerNode:::refDistance:::0 +PannerNode:::rolloffFactor:::0 +PannerNode:::setConeInnerAngle:::1 +PannerNode:::setConeOuterAngle:::1 +PannerNode:::setConeOuterGain:::1 +PannerNode:::setDistanceModel:::1 +PannerNode:::setMaxDistance:::2 +PannerNode:::setOrientation:::3 +PannerNode:::setPanningModel:::1 +PannerNode:::setPosition:::3 +PannerNode:::setRefDistance:::2 +PannerNode:::setRolloffFactor:::1 +ParentNode:::append:::3 +ParentNode:::childElementCount:::1 +ParentNode:::children:::1 +ParentNode:::firstElementChild:::1 +ParentNode:::lastElementChild:::1 +ParentNode:::prepend:::3 +ParentNode:::querySelector:::3 +ParentNode:::querySelectorAll:::3 +PasswordCredential:::additionalData:::0 +PasswordCredential:::idName:::0 +PasswordCredential:::passwordName:::0 +PasswordCredential:::setAdditionalData:::1 +PasswordCredential:::setIdName:::1 +PasswordCredential:::setPasswordName:::1 +Path2D:::addPath:::1 +Path2D:::addPath:::2 +PaymentAddress:::addressLine:::0 +PaymentAddress:::city:::0 +PaymentAddress:::country:::0 +PaymentAddress:::dependentLocality:::0 +PaymentAddress:::languageCode:::0 +PaymentAddress:::organization:::0 +PaymentAddress:::phone:::0 +PaymentAddress:::postalCode:::0 +PaymentAddress:::recipient:::0 +PaymentAddress:::region:::0 +PaymentAddress:::sortingCode:::0 +PaymentAddress:::toJSONForBinding:::0 +PaymentAppServiceWorkerGlobalScope:::onpaymentrequest:::1 +PaymentAppServiceWorkerGlobalScope:::setOnpaymentrequest:::2 +PaymentAppServiceWorkerRegistration:::paymentManager:::2 +PaymentInstruments:::deleteInstrument:::1 +PaymentInstruments:::get:::1 +PaymentInstruments:::has:::1 +PaymentInstruments:::keys:::0 +PaymentInstruments:::set:::2 +PaymentManager:::getManifest:::1 +PaymentManager:::instruments:::0 +PaymentManager:::setManifest:::2 +PaymentRequest:::abort:::1 +PaymentRequest:::canMakePayment:::1 +PaymentRequestEvent:::appRequest:::0 +PaymentRequestEvent:::respondWith:::3 +PaymentRequest:::getShippingAddress:::0 +PaymentRequest:::onshippingaddresschange:::0 +PaymentRequest:::onshippingoptionchange:::0 +PaymentRequest:::setOnshippingaddresschange:::1 +PaymentRequest:::setOnshippingoptionchange:::1 +PaymentRequest:::shippingOption:::0 +PaymentRequest:::shippingType:::0 +PaymentRequest:::show:::1 +PaymentRequestUpdateEvent:::updateWith:::3 +PaymentResponse:::complete:::1 +PaymentResponse:::complete:::2 +PaymentResponse:::details:::2 +PaymentResponse:::methodName:::0 +PaymentResponse:::payerEmail:::0 +PaymentResponse:::payerName:::0 +PaymentResponse:::payerPhone:::0 +PaymentResponse:::shippingAddress:::0 +PaymentResponse:::shippingOption:::0 +PaymentResponse:::toJSONForBinding:::0 +PerformanceBase:::clearFrameTimings:::0 +PerformanceBase:::clearMarks:::1 +PerformanceBase:::clearMeasures:::1 +PerformanceBase:::clearResourceTimings:::0 +PerformanceBase:::getEntries:::0 +PerformanceBase:::getEntriesByName:::2 +PerformanceBase:::getEntriesByType:::1 +PerformanceBase:::mark:::2 +PerformanceBase:::measure:::4 +PerformanceBase:::now:::0 +PerformanceBase:::setFrameTimingBufferSize:::1 +PerformanceBase:::setResourceTimingBufferSize:::1 +PerformanceBase:::timing:::0 +Performance:::clearFrameTimings:::0 +Performance:::clearMarks:::0 +Performance:::clearMarks:::1 +Performance:::clearMeasures:::0 +Performance:::clearMeasures:::1 +Performance:::clearResourceTimings:::0 +PerformanceEntry:::duration:::0 +PerformanceEntry:::entryType:::0 +PerformanceEntry:::name:::0 +PerformanceEntry:::startTime:::0 +PerformanceEntry:::toJSONForBinding:::0 +Performance:::getEntries:::0 +Performance:::getEntriesByName:::1 +Performance:::getEntriesByName:::2 +Performance:::getEntriesByType:::1 +PerformanceLongTaskTiming:::attribution:::0 +Performance:::mark:::2 +Performance:::measure:::2 +Performance:::measure:::3 +Performance:::measure:::4 +Performance:::memory:::0 +Performance:::navigation:::0 +PerformanceNavigation:::redirectCount:::0 +PerformanceNavigationTiming:::domComplete:::0 +PerformanceNavigationTiming:::domContentLoadedEventEnd:::0 +PerformanceNavigationTiming:::domContentLoadedEventStart:::0 +PerformanceNavigationTiming:::domInteractive:::0 +PerformanceNavigationTiming:::loadEventEnd:::0 +PerformanceNavigationTiming:::loadEventStart:::0 +PerformanceNavigationTiming:::redirectCount:::0 +PerformanceNavigationTiming:::toJSONForBinding:::0 +PerformanceNavigationTiming:::type:::0 +PerformanceNavigationTiming:::unloadEventEnd:::0 +PerformanceNavigationTiming:::unloadEventStart:::0 +PerformanceNavigation:::toJSONForBinding:::0 +PerformanceNavigation:::type:::0 +Performance:::now:::0 +PerformanceObserver:::disconnect:::0 +PerformanceObserverEntryList:::getEntries:::0 +PerformanceObserverEntryList:::getEntriesByName:::1 +PerformanceObserverEntryList:::getEntriesByName:::2 +PerformanceObserverEntryList:::getEntriesByType:::1 +PerformanceObserver:::observe:::2 +Performance:::onframetimingbufferfull:::0 +Performance:::onresourcetimingbufferfull:::0 +PerformanceResourceTiming:::connectEnd:::0 +PerformanceResourceTiming:::connectStart:::0 +PerformanceResourceTiming:::decodedBodySize:::0 +PerformanceResourceTiming:::domainLookupEnd:::0 +PerformanceResourceTiming:::domainLookupStart:::0 +PerformanceResourceTiming:::encodedBodySize:::0 +PerformanceResourceTiming:::fetchStart:::0 +PerformanceResourceTiming:::initiatorType:::0 +PerformanceResourceTiming:::redirectEnd:::0 +PerformanceResourceTiming:::redirectStart:::0 +PerformanceResourceTiming:::requestStart:::0 +PerformanceResourceTiming:::responseEnd:::0 +PerformanceResourceTiming:::responseStart:::0 +PerformanceResourceTiming:::secureConnectionStart:::0 +PerformanceResourceTiming:::transferSize:::0 +PerformanceResourceTiming:::workerStart:::0 +Performance:::setFrameTimingBufferSize:::1 +Performance:::setOnframetimingbufferfull:::1 +Performance:::setOnresourcetimingbufferfull:::1 +Performance:::setResourceTimingBufferSize:::1 +Performance:::timing:::0 +PerformanceTiming:::connectEnd:::0 +PerformanceTiming:::connectStart:::0 +PerformanceTiming:::domainLookupEnd:::0 +PerformanceTiming:::domainLookupStart:::0 +PerformanceTiming:::domComplete:::0 +PerformanceTiming:::domContentLoadedEventEnd:::0 +PerformanceTiming:::domContentLoadedEventStart:::0 +PerformanceTiming:::domInteractive:::0 +PerformanceTiming:::domLoading:::0 +PerformanceTiming:::fetchStart:::0 +PerformanceTiming:::loadEventEnd:::0 +PerformanceTiming:::loadEventStart:::0 +PerformanceTiming:::navigationStart:::0 +PerformanceTiming:::redirectEnd:::0 +PerformanceTiming:::redirectStart:::0 +PerformanceTiming:::requestStart:::0 +PerformanceTiming:::responseEnd:::0 +PerformanceTiming:::responseStart:::0 +PerformanceTiming:::secureConnectionStart:::0 +PerformanceTiming:::toJSONForBinding:::0 +PerformanceTiming:::unloadEventEnd:::0 +PerformanceTiming:::unloadEventStart:::0 +Performance:::toJSONForBinding:::0 +Permissions:::query:::2 +Permissions:::request:::2 +Permissions:::requestAll:::2 +Permissions:::revoke:::2 +PermissionStatus:::onchange:::0 +PermissionStatus:::setOnchange:::1 +PermissionStatus:::state:::0 +PhotoCapabilities:::fillLightMode:::0 +PhotoCapabilities:::imageHeight:::0 +PhotoCapabilities:::imageWidth:::0 +PhotoCapabilities:::redEyeReduction:::0 +PointerEvent:::getCoalescedEvents:::0 +PointerEvent:::height:::0 +PointerEvent:::isPrimary:::0 +PointerEvent:::pointerId:::0 +PointerEvent:::pointerType:::0 +PointerEvent:::pressure:::0 +PointerEvent:::tangentialPressure:::0 +PointerEvent:::tiltX:::0 +PointerEvent:::tiltY:::0 +PointerEvent:::twist:::0 +PointerEvent:::width:::0 +PopStateEvent:::state:::0 +PositionCallback:::handleEvent:::1 +PositionErrorCallback:::handleEvent:::1 +PositionError:::code:::0 +PositionError:::message:::0 +PresentationAvailability:::onchange:::0 +PresentationAvailability:::setOnchange:::1 +PresentationAvailability:::value:::0 +PresentationConnectionAvailableEvent:::connection:::0 +PresentationConnection:::binaryType:::0 +PresentationConnection:::close:::0 +PresentationConnectionCloseEvent:::message:::0 +PresentationConnectionCloseEvent:::reason:::0 +PresentationConnection:::id:::0 +PresentationConnectionList:::connections:::0 +PresentationConnectionList:::onconnectionavailable:::0 +PresentationConnectionList:::setOnconnectionavailable:::1 +PresentationConnection:::onclose:::0 +PresentationConnection:::onconnect:::0 +PresentationConnection:::onmessage:::0 +PresentationConnection:::onterminate:::0 +PresentationConnection:::send:::2 +PresentationConnection:::setBinaryType:::1 +PresentationConnection:::setOnclose:::1 +PresentationConnection:::setOnconnect:::1 +PresentationConnection:::setOnmessage:::1 +PresentationConnection:::setOnterminate:::1 +PresentationConnection:::state:::0 +PresentationConnection:::terminate:::0 +PresentationConnection:::url:::0 +Presentation:::defaultRequest:::0 +Presentation:::receiver:::0 +PresentationReceiver:::connectionList:::1 +PresentationRequest:::getAvailability:::1 +PresentationRequest:::onconnectionavailable:::0 +PresentationRequest:::reconnect:::2 +PresentationRequest:::setOnconnectionavailable:::1 +PresentationRequest:::start:::1 +Presentation:::setDefaultRequest:::1 +ProcessingInstruction:::sheet:::0 +ProcessingInstruction:::target:::0 +ProgressEvent:::lengthComputable:::0 +ProgressEvent:::loaded:::0 +ProgressEvent:::total:::0 +PromiseRejectionEvent:::promise:::0 +PromiseRejectionEvent:::reason:::1 +PropertyRegistration:::registerProperty:::3 +PushEvent:::data:::0 +PushManager:::getSubscription:::1 +PushManager:::permissionState:::2 +PushManager:::permissionState:::3 +PushManager:::subscribe:::2 +PushManager:::subscribe:::3 +PushMessageData:::arrayBuffer:::0 +PushMessageData:::blob:::0 +PushMessageData:::json:::2 +PushMessageData:::text:::0 +PushSubscription:::endpoint:::0 +PushSubscription:::getKey:::1 +PushSubscription:::options:::0 +PushSubscriptionOptions:::applicationServerKey:::0 +PushSubscriptionOptions:::userVisibleOnly:::0 +PushSubscription:::toJSONForBinding:::0 +PushSubscription:::unsubscribe:::1 +RadioNodeList:::item:::1 +RadioNodeList:::length:::0 +RadioNodeList:::setValue:::1 +RadioNodeList:::value:::0 +Range:::cloneContents:::1 +Range:::cloneRange:::0 +Range:::collapse:::0 +Range:::collapse:::1 +Range:::collapsed:::0 +Range:::commonAncestorContainer:::0 +Range:::compareBoundaryPoints:::3 +Range:::comparePoint:::3 +Range:::createContextualFragment:::2 +Range:::deleteContents:::1 +Range:::detach:::0 +Range:::endContainer:::0 +Range:::endOffset:::0 +Range:::expand:::1 +Range:::expand:::2 +Range:::extractContents:::1 +Range:::getBoundingClientRect:::0 +Range:::getClientRects:::0 +Range:::insertNode:::2 +Range:::intersectsNode:::2 +Range:::isPointInRange:::3 +Range:::selectNode:::2 +Range:::selectNodeContents:::2 +Range:::setEnd:::3 +Range:::setEndAfter:::2 +Range:::setEndBefore:::2 +Range:::setStart:::3 +Range:::setStartAfter:::2 +Range:::setStartBefore:::2 +Range:::startContainer:::0 +Range:::startOffset:::0 +Range:::surroundContents:::2 +Range:::toString:::0 +RecordTest:::getNullableStringLongRecord:::0 +RecordTest:::getStringElementRecord:::0 +RecordTest:::getStringLongRecord:::0 +RecordTest:::getUSVStringUSVStringBooleanRecordRecord:::0 +RecordTest:::returnStringByteStringSequenceRecord:::0 +RecordTest:::setByteStringByteStringRecord:::1 +RecordTest:::setFloatOrStringElementRecord:::1 +RecordTest:::setNullableStringLongRecord:::1 +RecordTest:::setStringElementRecord:::1 +RecordTest:::setStringLongRecord:::1 +RecordTest:::setUSVStringUSVStringBooleanRecordRecord:::1 +RecordTest:::unionReceivedARecord:::1 +RelatedApplication:::id:::0 +RelatedApplication:::platform:::0 +RelatedApplication:::url:::0 +RelatedEvent:::relatedTarget:::0 +RemotePlayback:::cancelWatchAvailability:::1 +RemotePlayback:::cancelWatchAvailability:::2 +RemotePlayback:::onconnect:::0 +RemotePlayback:::onconnecting:::0 +RemotePlayback:::ondisconnect:::0 +RemotePlayback:::prompt:::1 +RemotePlayback:::setOnconnect:::1 +RemotePlayback:::setOnconnecting:::1 +RemotePlayback:::setOndisconnect:::1 +RemotePlayback:::state:::0 +RemotePlayback:::watchAvailability:::2 +Request:::clone:::2 +Request:::credentials:::0 +Request:::getHeaders:::0 +Request:::getReferrerPolicy:::0 +Request:::integrity:::0 +Request:::method:::0 +Request:::mode:::0 +Request:::redirect:::0 +Request:::referrer:::0 +Request:::url:::0 +ResizeObserverCallback:::handleEvent:::2 +ResizeObserver:::disconnect:::0 +ResizeObserverEntry:::contentRect:::0 +ResizeObserverEntry:::target:::0 +ResizeObserver:::observe:::1 +ResizeObserver:::unobserve:::1 +ResourceProgressEvent:::url:::0 +Response:::body:::1 +Response:::clone:::2 +Response:::error:::1 +Response:::headers:::0 +Response:::ok:::0 +Response:::redirect:::3 +Response:::redirect:::4 +Response:::redirected:::0 +Response:::status:::0 +Response:::statusText:::0 +Response:::type:::0 +Response:::url:::0 +RTCCertificate:::expires:::0 +RTCDataChannel:::binaryType:::0 +RTCDataChannel:::bufferedAmount:::0 +RTCDataChannel:::bufferedAmountLowThreshold:::0 +RTCDataChannel:::close:::0 +RTCDataChannelEvent:::channel:::0 +RTCDataChannel:::id:::0 +RTCDataChannel:::label:::0 +RTCDataChannel:::maxRetransmits:::0 +RTCDataChannel:::maxRetransmitTime:::0 +RTCDataChannel:::negotiated:::0 +RTCDataChannel:::onbufferedamountlow:::0 +RTCDataChannel:::onclose:::0 +RTCDataChannel:::onerror:::0 +RTCDataChannel:::onmessage:::0 +RTCDataChannel:::onopen:::0 +RTCDataChannel:::ordered:::0 +RTCDataChannel:::protocol:::0 +RTCDataChannel:::readyState:::0 +RTCDataChannel:::reliable:::0 +RTCDataChannel:::send:::2 +RTCDataChannel:::setBinaryType:::2 +RTCDataChannel:::setBufferedAmountLowThreshold:::1 +RTCDataChannel:::setOnbufferedamountlow:::1 +RTCDataChannel:::setOnclose:::1 +RTCDataChannel:::setOnerror:::1 +RTCDataChannel:::setOnmessage:::1 +RTCDataChannel:::setOnopen:::1 +RTCDTMFSender:::canInsertDTMF:::0 +RTCDTMFSender:::duration:::0 +RTCDTMFSender:::insertDTMF:::2 +RTCDTMFSender:::insertDTMF:::3 +RTCDTMFSender:::insertDTMF:::4 +RTCDTMFSender:::interToneGap:::0 +RTCDTMFSender:::ontonechange:::0 +RTCDTMFSender:::setOntonechange:::1 +RTCDTMFSender:::toneBuffer:::0 +RTCDTMFSender:::track:::0 +RTCDTMFToneChangeEvent:::tone:::0 +RTCIceCandidate:::candidate:::0 +RTCIceCandidate:::sdpMid:::0 +RTCIceCandidate:::sdpMLineIndex:::0 +RTCIceCandidate:::setCandidate:::1 +RTCIceCandidate:::setSdpMid:::1 +RTCIceCandidate:::setSdpMLineIndex:::1 +RTCIceCandidate:::toJSONForBinding:::0 +RTCLegacyStatsReport:::id:::0 +RTCLegacyStatsReport:::names:::0 +RTCLegacyStatsReport:::stat:::1 +RTCLegacyStatsReport:::timestamp:::0 +RTCLegacyStatsReport:::type:::0 +RTCPeerConnection:::addIceCandidate:::2 +RTCPeerConnection:::addIceCandidate:::4 +RTCPeerConnection:::addStream:::3 +RTCPeerConnection:::addStream:::4 +RTCPeerConnection:::close:::1 +RTCPeerConnection:::createAnswer:::1 +RTCPeerConnection:::createAnswer:::2 +RTCPeerConnection:::createAnswer:::3 +RTCPeerConnection:::createAnswer:::4 +RTCPeerConnection:::createDataChannel:::3 +RTCPeerConnection:::createDataChannel:::4 +RTCPeerConnection:::createDTMFSender:::2 +RTCPeerConnection:::createOffer:::1 +RTCPeerConnection:::createOffer:::2 +RTCPeerConnection:::createOffer:::4 +RTCPeerConnection:::createOffer:::5 +RTCPeerConnectionErrorCallback:::handleEvent:::1 +RTCPeerConnection:::generateCertificate:::3 +RTCPeerConnection:::getLocalStreams:::0 +RTCPeerConnection:::getReceivers:::0 +RTCPeerConnection:::getRemoteStreams:::0 +RTCPeerConnection:::getStats:::1 +RTCPeerConnection:::getStats:::2 +RTCPeerConnection:::getStats:::3 +RTCPeerConnection:::getStreamById:::1 +RTCPeerConnection:::iceConnectionState:::0 +RTCPeerConnectionIceEvent:::candidate:::0 +RTCPeerConnection:::iceGatheringState:::0 +RTCPeerConnection:::localDescription:::0 +RTCPeerConnection:::onaddstream:::0 +RTCPeerConnection:::ondatachannel:::0 +RTCPeerConnection:::onicecandidate:::0 +RTCPeerConnection:::oniceconnectionstatechange:::0 +RTCPeerConnection:::onicegatheringstatechange:::0 +RTCPeerConnection:::onnegotiationneeded:::0 +RTCPeerConnection:::onremovestream:::0 +RTCPeerConnection:::onsignalingstatechange:::0 +RTCPeerConnection:::remoteDescription:::0 +RTCPeerConnection:::removeStream:::2 +RTCPeerConnection:::setConfiguration:::3 +RTCPeerConnection:::setLocalDescription:::2 +RTCPeerConnection:::setLocalDescription:::3 +RTCPeerConnection:::setLocalDescription:::4 +RTCPeerConnection:::setOnaddstream:::1 +RTCPeerConnection:::setOndatachannel:::1 +RTCPeerConnection:::setOnicecandidate:::1 +RTCPeerConnection:::setOniceconnectionstatechange:::1 +RTCPeerConnection:::setOnicegatheringstatechange:::1 +RTCPeerConnection:::setOnnegotiationneeded:::1 +RTCPeerConnection:::setOnremovestream:::1 +RTCPeerConnection:::setOnsignalingstatechange:::1 +RTCPeerConnection:::setRemoteDescription:::2 +RTCPeerConnection:::setRemoteDescription:::3 +RTCPeerConnection:::setRemoteDescription:::4 +RTCPeerConnection:::signalingState:::0 +RTCRtpReceiver:::track:::0 +RTCSessionDescriptionCallback:::handleEvent:::1 +RTCSessionDescription:::sdp:::0 +RTCSessionDescription:::setSdp:::1 +RTCSessionDescription:::setType:::1 +RTCSessionDescription:::toJSONForBinding:::0 +RTCSessionDescription:::type:::0 +RTCStatsCallback:::handleEvent:::1 +RTCStatsResponse:::namedItem:::0 +RTCStatsResponse:::namedItem:::1 +RTCStatsResponse:::result:::0 +ScopedCredential:::id:::0 +ScopedCredentialInfo:::attestation:::0 +ScopedCredentialInfo:::clientData:::0 +ScopedCredential:::type:::0 +Screen:::availHeight:::0 +Screen:::availLeft:::0 +Screen:::availTop:::0 +Screen:::availWidth:::0 +Screen:::colorDepth:::0 +Screen:::height:::0 +ScreenOrientation:::angle:::0 +ScreenOrientation:::lock:::2 +ScreenOrientation:::onchange:::0 +ScreenOrientation:::setOnchange:::1 +ScreenOrientation:::type:::0 +ScreenOrientation:::unlock:::0 +Screen:::pixelDepth:::0 +ScreenScreenOrientation:::orientation:::2 +ScreenWakeLock:::keepAwake:::1 +ScreenWakeLock:::setKeepAwake:::2 +Screen:::width:::0 +ScriptElementBase:::nonce:::0 +ScriptElementBase:::setNonce:::1 +ScriptLoaderClient:::nonce:::0 +ScriptLoaderClient:::setNonce:::1 +ScriptProcessorNode:::bufferSize:::0 +ScriptProcessorNode:::onaudioprocess:::0 +ScriptProcessorNode:::setOnaudioprocess:::1 +ScrollStateCallback:::handleEvent:::1 +ScrollState:::consumeDelta:::3 +ScrollState:::deltaGranularity:::0 +ScrollState:::deltaX:::0 +ScrollState:::deltaY:::0 +ScrollState:::distributeToScrollChainDescendant:::0 +ScrollState:::fromUserInput:::0 +ScrollState:::inInertialPhase:::0 +ScrollState:::isBeginning:::0 +ScrollState:::isDirectManipulation:::0 +ScrollState:::isEnding:::0 +ScrollState:::positionX:::0 +ScrollState:::positionY:::0 +ScrollState:::shouldPropagate:::0 +ScrollState:::velocityX:::0 +ScrollState:::velocityY:::0 +SecurityContext:::addressSpaceForBindings:::0 +SecurityPolicyViolationEvent:::blockedURI:::0 +SecurityPolicyViolationEvent:::columnNumber:::0 +SecurityPolicyViolationEvent:::disposition:::0 +SecurityPolicyViolationEvent:::documentURI:::0 +SecurityPolicyViolationEvent:::effectiveDirective:::0 +SecurityPolicyViolationEvent:::lineNumber:::0 +SecurityPolicyViolationEvent:::originalPolicy:::0 +SecurityPolicyViolationEvent:::referrer:::0 +SecurityPolicyViolationEvent:::sample:::0 +SecurityPolicyViolationEvent:::sourceFile:::0 +SecurityPolicyViolationEvent:::statusCode:::0 +SecurityPolicyViolationEvent:::violatedDirective:::0 +Sensor:::activated:::0 +SensorErrorEvent:::error:::0 +Sensor:::onactivate:::0 +Sensor:::onchange:::0 +Sensor:::onerror:::0 +Sensor:::setOnactivate:::1 +Sensor:::setOnchange:::1 +Sensor:::setOnerror:::1 +Sensor:::start:::0 +Sensor:::stop:::0 +Sensor:::timestamp:::1 +ServiceWorkerClient:::frameType:::0 +ServiceWorkerClient:::id:::0 +ServiceWorkerClient:::postMessage:::4 +ServiceWorkerClient:::postMessage:::5 +ServiceWorkerClients:::claim:::1 +ServiceWorkerClients:::get:::2 +ServiceWorkerClients:::matchAll:::1 +ServiceWorkerClients:::matchAll:::2 +ServiceWorkerClients:::openWindow:::2 +ServiceWorkerClient:::url:::0 +ServiceWorkerContainer:::controller:::0 +ServiceWorkerContainer:::getRegistration:::1 +ServiceWorkerContainer:::getRegistration:::2 +ServiceWorkerContainer:::getRegistrations:::1 +ServiceWorkerContainer:::oncontrollerchange:::0 +ServiceWorkerContainer:::onmessage:::0 +ServiceWorkerContainer:::ready:::1 +ServiceWorkerContainer:::registerServiceWorker:::2 +ServiceWorkerContainer:::registerServiceWorker:::3 +ServiceWorkerContainer:::setOncontrollerchange:::1 +ServiceWorkerContainer:::setOnmessage:::1 +ServiceWorkerGlobalScopeBackgroundFetch:::onbackgroundfetchabort:::1 +ServiceWorkerGlobalScopeBackgroundFetch:::onbackgroundfetchclick:::1 +ServiceWorkerGlobalScopeBackgroundFetch:::onbackgroundfetched:::1 +ServiceWorkerGlobalScopeBackgroundFetch:::onbackgroundfetchfail:::1 +ServiceWorkerGlobalScopeBackgroundFetch:::setOnbackgroundfetchabort:::2 +ServiceWorkerGlobalScopeBackgroundFetch:::setOnbackgroundfetchclick:::2 +ServiceWorkerGlobalScopeBackgroundFetch:::setOnbackgroundfetched:::2 +ServiceWorkerGlobalScopeBackgroundFetch:::setOnbackgroundfetchfail:::2 +ServiceWorkerGlobalScope:::clients:::0 +ServiceWorkerGlobalScope:::fetch:::3 +ServiceWorkerGlobalScope:::fetch:::4 +ServiceWorkerGlobalScopeNotifications:::onnotificationclick:::1 +ServiceWorkerGlobalScopeNotifications:::onnotificationclose:::1 +ServiceWorkerGlobalScopeNotifications:::setOnnotificationclick:::2 +ServiceWorkerGlobalScopeNotifications:::setOnnotificationclose:::2 +ServiceWorkerGlobalScope:::onactivate:::0 +ServiceWorkerGlobalScope:::onfetch:::0 +ServiceWorkerGlobalScope:::onforeignfetch:::0 +ServiceWorkerGlobalScope:::oninstall:::0 +ServiceWorkerGlobalScope:::onmessage:::0 +ServiceWorkerGlobalScopePush:::onpush:::1 +ServiceWorkerGlobalScopePush:::setOnpush:::2 +ServiceWorkerGlobalScope:::registration:::0 +ServiceWorkerGlobalScope:::setOnactivate:::1 +ServiceWorkerGlobalScope:::setOnfetch:::1 +ServiceWorkerGlobalScope:::setOnforeignfetch:::1 +ServiceWorkerGlobalScope:::setOninstall:::1 +ServiceWorkerGlobalScope:::setOnmessage:::1 +ServiceWorkerGlobalScope:::skipWaiting:::1 +ServiceWorkerGlobalScopeSync:::onsync:::1 +ServiceWorkerGlobalScopeSync:::setOnsync:::2 +ServiceWorkerMessageEvent:::data:::0 +ServiceWorkerMessageEvent:::lastEventId:::0 +ServiceWorkerMessageEvent:::origin:::0 +ServiceWorkerMessageEvent:::ports:::1 +ServiceWorkerMessageEvent:::source:::1 +ServiceWorker:::onstatechange:::0 +ServiceWorker:::postMessage:::3 +ServiceWorker:::postMessage:::4 +ServiceWorkerRegistration:::active:::0 +ServiceWorkerRegistrationBackgroundFetch:::backgroundFetch:::1 +ServiceWorkerRegistration:::installing:::0 +ServiceWorkerRegistration:::navigationPreload:::0 +ServiceWorkerRegistrationNotifications:::getNotifications:::2 +ServiceWorkerRegistrationNotifications:::getNotifications:::3 +ServiceWorkerRegistrationNotifications:::showNotification:::4 +ServiceWorkerRegistrationNotifications:::showNotification:::5 +ServiceWorkerRegistration:::onupdatefound:::0 +ServiceWorkerRegistrationPush:::pushManager:::1 +ServiceWorkerRegistration:::scope:::0 +ServiceWorkerRegistration:::setOnupdatefound:::1 +ServiceWorkerRegistrationSync:::sync:::1 +ServiceWorkerRegistration:::unregister:::1 +ServiceWorkerRegistration:::update:::1 +ServiceWorkerRegistration:::waiting:::0 +ServiceWorker:::scriptURL:::0 +ServiceWorker:::setOnstatechange:::1 +ServiceWorker:::state:::0 +ServiceWorkerWindowClient:::focus:::1 +ServiceWorkerWindowClient:::focused:::0 +ServiceWorkerWindowClient:::navigate:::2 +ServiceWorkerWindowClient:::visibilityState:::0 +ShadowRoot:::delegatesFocus:::0 +ShadowRoot:::host:::0 +ShadowRoot:::innerHTML:::0 +ShadowRoot:::mode:::0 +ShadowRoot:::olderShadowRootForBindings:::0 +ShadowRoot:::setInnerHTML:::2 +ShapeDetector:::detect:::2 +SharedWorkerGlobalScope:::close:::0 +SharedWorkerGlobalScope:::name:::0 +SharedWorkerGlobalScope:::onconnect:::0 +SharedWorkerGlobalScope:::setOnconnect:::1 +SharedWorkerPerformance:::workerStart:::2 +SharedWorker:::port:::0 +SiteBoundCredential:::iconURL:::0 +SiteBoundCredential:::name:::0 +SourceBuffer:::abort:::1 +SourceBuffer:::appendBuffer:::2 +SourceBuffer:::appendWindowEnd:::0 +SourceBuffer:::appendWindowStart:::0 +SourceBuffer:::audioTracks:::0 +SourceBuffer:::buffered:::1 +SourceBufferList:::item:::1 +SourceBufferList:::length:::0 +SourceBufferList:::onaddsourcebuffer:::0 +SourceBufferList:::onremovesourcebuffer:::0 +SourceBufferList:::setOnaddsourcebuffer:::1 +SourceBufferList:::setOnremovesourcebuffer:::1 +SourceBuffer:::mode:::0 +SourceBuffer:::onabort:::0 +SourceBuffer:::onerror:::0 +SourceBuffer:::onupdate:::0 +SourceBuffer:::onupdateend:::0 +SourceBuffer:::onupdatestart:::0 +SourceBuffer:::remove:::3 +SourceBuffer:::setAppendWindowEnd:::2 +SourceBuffer:::setAppendWindowStart:::2 +SourceBuffer:::setMode:::2 +SourceBuffer:::setOnabort:::1 +SourceBuffer:::setOnerror:::1 +SourceBuffer:::setOnupdate:::1 +SourceBuffer:::setOnupdateend:::1 +SourceBuffer:::setOnupdatestart:::1 +SourceBuffer:::setTimestampOffset:::2 +SourceBuffer:::setTrackDefaults:::2 +SourceBuffer:::timestampOffset:::0 +SourceBufferTrackBaseSupplement:::sourceBuffer:::1 +SourceBuffer:::trackDefaults:::0 +SourceBuffer:::updating:::0 +SourceBuffer:::videoTracks:::0 +SpeechGrammarList:::addFromString:::1 +SpeechGrammarList:::addFromString:::2 +SpeechGrammarList:::addFromUri:::2 +SpeechGrammarList:::addFromUri:::3 +SpeechGrammarList:::item:::1 +SpeechGrammarList:::length:::0 +SpeechGrammar:::setSrc:::2 +SpeechGrammar:::setWeight:::1 +SpeechGrammar:::src:::1 +SpeechGrammar:::weight:::0 +SpeechRecognition:::abort:::0 +SpeechRecognitionAlternative:::confidence:::0 +SpeechRecognitionAlternative:::transcript:::0 +SpeechRecognition:::audioTrack:::0 +SpeechRecognition:::continuous:::0 +SpeechRecognitionError:::error:::0 +SpeechRecognitionError:::message:::0 +SpeechRecognitionEvent:::emma:::0 +SpeechRecognitionEvent:::interpretation:::0 +SpeechRecognitionEvent:::resultIndex:::0 +SpeechRecognitionEvent:::results:::0 +SpeechRecognition:::grammars:::0 +SpeechRecognition:::interimResults:::0 +SpeechRecognition:::lang:::0 +SpeechRecognition:::maxAlternatives:::0 +SpeechRecognition:::onaudioend:::0 +SpeechRecognition:::onaudiostart:::0 +SpeechRecognition:::onend:::0 +SpeechRecognition:::onerror:::0 +SpeechRecognition:::onnomatch:::0 +SpeechRecognition:::onresult:::0 +SpeechRecognition:::onsoundend:::0 +SpeechRecognition:::onsoundstart:::0 +SpeechRecognition:::onspeechend:::0 +SpeechRecognition:::onspeechstart:::0 +SpeechRecognition:::onstart:::0 +SpeechRecognitionResult:::isFinal:::0 +SpeechRecognitionResult:::item:::1 +SpeechRecognitionResult:::length:::0 +SpeechRecognitionResultList:::item:::1 +SpeechRecognitionResultList:::length:::0 +SpeechRecognition:::setAudioTrack:::1 +SpeechRecognition:::setContinuous:::1 +SpeechRecognition:::setGrammars:::1 +SpeechRecognition:::setInterimResults:::1 +SpeechRecognition:::setLang:::1 +SpeechRecognition:::setMaxAlternatives:::1 +SpeechRecognition:::setOnaudioend:::1 +SpeechRecognition:::setOnaudiostart:::1 +SpeechRecognition:::setOnend:::1 +SpeechRecognition:::setOnerror:::1 +SpeechRecognition:::setOnnomatch:::1 +SpeechRecognition:::setOnresult:::1 +SpeechRecognition:::setOnsoundend:::1 +SpeechRecognition:::setOnsoundstart:::1 +SpeechRecognition:::setOnspeechend:::1 +SpeechRecognition:::setOnspeechstart:::1 +SpeechRecognition:::setOnstart:::1 +SpeechRecognition:::start:::1 +SpeechRecognition:::stopFunction:::0 +SpeechSynthesis:::cancel:::0 +SpeechSynthesisEvent:::charIndex:::0 +SpeechSynthesisEvent:::elapsedTime:::0 +SpeechSynthesisEvent:::name:::0 +SpeechSynthesisEvent:::utterance:::0 +SpeechSynthesis:::getVoices:::0 +SpeechSynthesis:::onvoiceschanged:::0 +SpeechSynthesis:::pause:::0 +SpeechSynthesis:::paused:::0 +SpeechSynthesis:::pending:::0 +SpeechSynthesis:::resume:::0 +SpeechSynthesis:::setOnvoiceschanged:::1 +SpeechSynthesis:::speak:::1 +SpeechSynthesis:::speaking:::0 +SpeechSynthesisUtterance:::lang:::0 +SpeechSynthesisUtterance:::onboundary:::0 +SpeechSynthesisUtterance:::onend:::0 +SpeechSynthesisUtterance:::onerror:::0 +SpeechSynthesisUtterance:::onmark:::0 +SpeechSynthesisUtterance:::onpause:::0 +SpeechSynthesisUtterance:::onresume:::0 +SpeechSynthesisUtterance:::onstart:::0 +SpeechSynthesisUtterance:::pitch:::0 +SpeechSynthesisUtterance:::rate:::0 +SpeechSynthesisUtterance:::setLang:::1 +SpeechSynthesisUtterance:::setOnboundary:::1 +SpeechSynthesisUtterance:::setOnend:::1 +SpeechSynthesisUtterance:::setOnerror:::1 +SpeechSynthesisUtterance:::setOnmark:::1 +SpeechSynthesisUtterance:::setOnpause:::1 +SpeechSynthesisUtterance:::setOnresume:::1 +SpeechSynthesisUtterance:::setOnstart:::1 +SpeechSynthesisUtterance:::setPitch:::1 +SpeechSynthesisUtterance:::setRate:::1 +SpeechSynthesisUtterance:::setText:::1 +SpeechSynthesisUtterance:::setVoice:::1 +SpeechSynthesisUtterance:::setVolume:::1 +SpeechSynthesisUtterance:::text:::0 +SpeechSynthesisUtterance:::voice:::0 +SpeechSynthesisUtterance:::volume:::0 +SpeechSynthesisVoice:::isDefault:::0 +SpeechSynthesisVoice:::lang:::0 +SpeechSynthesisVoice:::localService:::0 +SpeechSynthesisVoice:::name:::0 +SpeechSynthesisVoice:::voiceURI:::0 +SQLError:::code:::0 +SQLError:::message:::0 +SQLResultSet:::insertId:::1 +SQLResultSetRowList:::item:::3 +SQLResultSetRowList:::length:::0 +SQLResultSet:::rows:::0 +SQLResultSet:::rowsAffected:::0 +SQLStatementCallback:::handleEvent:::2 +SQLStatementErrorCallback:::handleEvent:::2 +SQLTransactionCallback:::handleEvent:::1 +SQLTransactionErrorCallback:::handleEvent:::1 +SQLTransaction:::executeSql:::3 +SQLTransaction:::executeSql:::4 +SQLTransaction:::executeSql:::5 +SQLTransaction:::executeSql:::6 +StaticRange:::collapsed:::0 +StaticRange:::endContainer:::0 +StaticRange:::endOffset:::0 +StaticRange:::setEnd:::2 +StaticRange:::setEndContainer:::1 +StaticRange:::setEndOffset:::1 +StaticRange:::setStart:::2 +StaticRange:::setStartContainer:::1 +StaticRange:::setStartOffset:::1 +StaticRange:::startContainer:::0 +StaticRange:::startOffset:::0 +StaticRange:::toRange:::1 +StereoPannerNode:::pan:::0 +Storage::::::2 +Storage::::::3 +Storage:::clear:::1 +StorageErrorCallback:::handleEvent:::1 +StorageEvent:::initStorageEvent:::0 +StorageEvent:::initStorageEvent:::1 +StorageEvent:::initStorageEvent:::2 +StorageEvent:::initStorageEvent:::3 +StorageEvent:::initStorageEvent:::4 +StorageEvent:::initStorageEvent:::5 +StorageEvent:::initStorageEvent:::6 +StorageEvent:::initStorageEvent:::7 +StorageEvent:::initStorageEvent:::8 +StorageEvent:::key:::0 +StorageEvent:::newValue:::0 +StorageEvent:::oldValue:::0 +StorageEvent:::storageArea:::0 +StorageEvent:::url:::0 +Storage:::getItem:::2 +Storage:::key:::2 +Storage:::length:::1 +StorageManager:::estimate:::1 +StorageManager:::persist:::1 +StorageManager:::persisted:::1 +StorageQuotaCallback:::handleEvent:::1 +Storage:::removeItem:::2 +Storage:::setItem:::3 +StorageUsageCallback:::handleEvent:::2 +StringCallback:::handleEvent:::1 +StyleElement:::media:::0 +StyleElement:::sheet:::0 +StyleElement:::type:::0 +StyleMedia:::matchMedium:::0 +StyleMedia:::matchMedium:::1 +StyleMedia:::type:::0 +StylePropertyMap:::append:::3 +StylePropertyMapReadonly:::get:::2 +StylePropertyMapReadonly:::getAll:::2 +StylePropertyMapReadonly:::getProperties:::0 +StylePropertyMapReadonly:::has:::2 +StylePropertyMap:::remove:::2 +StylePropertyMap:::set:::3 +StyleSheet:::disabled:::0 +StyleSheet:::href:::0 +StyleSheetList::::::1 +StyleSheetList:::item:::1 +StyleSheetList:::length:::0 +StyleSheet:::media:::0 +StyleSheet:::ownerNode:::0 +StyleSheet:::ownerRule:::0 +StyleSheet:::parentStyleSheet:::0 +StyleSheet:::setDisabled:::1 +StyleSheet:::title:::0 +StyleSheet:::type:::0 +SubtleCrypto:::decrypt:::4 +SubtleCrypto:::deriveBits:::4 +SubtleCrypto:::deriveKey:::6 +SubtleCrypto:::digest:::3 +SubtleCrypto:::encrypt:::4 +SubtleCrypto:::exportKey:::3 +SubtleCrypto:::generateKey:::4 +SubtleCrypto:::importKey:::6 +SubtleCrypto:::sign:::4 +SubtleCrypto:::unwrapKey:::8 +SubtleCrypto:::verifySignature:::5 +SubtleCrypto:::wrapKey:::5 +SVGAElement:::svgTarget:::0 +SVGAngleTearOff:::convertToSpecifiedUnits:::2 +SVGAngleTearOff:::newValueSpecifiedUnits:::3 +SVGAngleTearOff:::setValue:::2 +SVGAngleTearOff:::setValueAsString:::2 +SVGAngleTearOff:::setValueInSpecifiedUnits:::2 +SVGAngleTearOff:::unitType:::0 +SVGAngleTearOff:::value:::0 +SVGAngleTearOff:::valueAsString:::0 +SVGAngleTearOff:::valueInSpecifiedUnits:::0 +SVGAnimatedAngle:::animVal:::0 +SVGAnimatedAngle:::baseVal:::0 +SVGAnimatedBoolean:::animVal:::0 +SVGAnimatedBoolean:::baseVal:::0 +SVGAnimatedBoolean:::setBaseVal:::2 +SVGAnimatedEnumerationBase:::animVal:::0 +SVGAnimatedEnumerationBase:::baseVal:::0 +SVGAnimatedEnumerationBase:::setBaseVal:::2 +SVGAnimatedInteger:::animVal:::0 +SVGAnimatedInteger:::baseVal:::0 +SVGAnimatedInteger:::setBaseVal:::2 +SVGAnimatedLength:::animVal:::0 +SVGAnimatedLength:::baseVal:::0 +SVGAnimatedLengthList:::animVal:::0 +SVGAnimatedLengthList:::baseVal:::0 +SVGAnimatedNumber:::animVal:::0 +SVGAnimatedNumber:::baseVal:::0 +SVGAnimatedNumberList:::animVal:::0 +SVGAnimatedNumberList:::baseVal:::0 +SVGAnimatedNumber:::setBaseVal:::2 +SVGAnimatedPreserveAspectRatio:::animVal:::0 +SVGAnimatedPreserveAspectRatio:::baseVal:::0 +SVGAnimatedProperty:::animVal:::0 +SVGAnimatedPropertyBase:::contextElement:::0 +SVGAnimatedProperty:::baseVal:::0 +SVGAnimatedProperty:::setBaseVal:::2 +SVGAnimatedRect:::animVal:::0 +SVGAnimatedRect:::baseVal:::0 +SVGAnimatedString:::animVal:::0 +SVGAnimatedString:::baseVal:::0 +SVGAnimatedString:::setBaseVal:::2 +SVGAnimatedTransformList:::animVal:::0 +SVGAnimatedTransformList:::baseVal:::0 +SVGAnimationElement:::beginElement:::0 +SVGAnimationElement:::beginElementAt:::1 +SVGAnimationElement:::endElement:::0 +SVGAnimationElement:::endElementAt:::1 +SVGAnimationElement:::getCurrentTime:::0 +SVGAnimationElement:::getSimpleDuration:::1 +SVGAnimationElement:::getStartTime:::1 +SVGAnimationElement:::onbegin:::0 +SVGAnimationElement:::onend:::0 +SVGAnimationElement:::onrepeat:::0 +SVGAnimationElement:::setOnbegin:::1 +SVGAnimationElement:::setOnend:::1 +SVGAnimationElement:::setOnrepeat:::1 +SVGAnimationElement:::targetElement:::0 +SVGCircleElement:::cx:::0 +SVGCircleElement:::cy:::0 +SVGCircleElement:::r:::0 +SVGClipPathElement:::clipPathUnits:::0 +SVGComponentTransferFunctionElement:::amplitude:::0 +SVGComponentTransferFunctionElement:::exponent:::0 +SVGComponentTransferFunctionElement:::intercept:::0 +SVGComponentTransferFunctionElement:::offset:::0 +SVGComponentTransferFunctionElement:::slope:::0 +SVGComponentTransferFunctionElement:::tableValues:::0 +SVGComponentTransferFunctionElement:::type:::0 +SVGDocumentExtensions:::rootElement:::1 +SVGElement:::blur:::0 +SVGElement:::className:::0 +SVGElement:::dataset:::0 +SVGElement:::focus:::0 +SVGElement:::ownerSVGElement:::0 +SVGElement:::setTabIndex:::1 +SVGElement:::style:::0 +SVGElement:::tabIndex:::0 +SVGElement:::viewportElement:::0 +SVGEllipseElement:::cx:::0 +SVGEllipseElement:::cy:::0 +SVGEllipseElement:::rx:::0 +SVGEllipseElement:::ry:::0 +SVGFEBlendElement:::in1:::0 +SVGFEBlendElement:::in2:::0 +SVGFEBlendElement:::mode:::0 +SVGFEColorMatrixElement:::in1:::0 +SVGFEColorMatrixElement:::type:::0 +SVGFEColorMatrixElement:::values:::0 +SVGFEComponentTransferElement:::in1:::0 +SVGFECompositeElement:::in1:::0 +SVGFECompositeElement:::in2:::0 +SVGFECompositeElement:::k1:::0 +SVGFECompositeElement:::k2:::0 +SVGFECompositeElement:::k3:::0 +SVGFECompositeElement:::k4:::0 +SVGFECompositeElement:::svgOperator:::0 +SVGFEConvolveMatrixElement:::bias:::0 +SVGFEConvolveMatrixElement:::divisor:::0 +SVGFEConvolveMatrixElement:::edgeMode:::0 +SVGFEConvolveMatrixElement:::in1:::0 +SVGFEConvolveMatrixElement:::kernelMatrix:::0 +SVGFEConvolveMatrixElement:::kernelUnitLengthX:::0 +SVGFEConvolveMatrixElement:::kernelUnitLengthY:::0 +SVGFEConvolveMatrixElement:::orderX:::0 +SVGFEConvolveMatrixElement:::orderY:::0 +SVGFEConvolveMatrixElement:::preserveAlpha:::0 +SVGFEConvolveMatrixElement:::targetX:::0 +SVGFEConvolveMatrixElement:::targetY:::0 +SVGFEDiffuseLightingElement:::diffuseConstant:::0 +SVGFEDiffuseLightingElement:::in1:::0 +SVGFEDiffuseLightingElement:::kernelUnitLengthX:::0 +SVGFEDiffuseLightingElement:::kernelUnitLengthY:::0 +SVGFEDiffuseLightingElement:::surfaceScale:::0 +SVGFEDisplacementMapElement:::in1:::0 +SVGFEDisplacementMapElement:::in2:::0 +SVGFEDisplacementMapElement:::scale:::0 +SVGFEDisplacementMapElement:::xChannelSelector:::0 +SVGFEDisplacementMapElement:::yChannelSelector:::0 +SVGFEDistantLightElement:::azimuth:::0 +SVGFEDistantLightElement:::elevation:::0 +SVGFEDropShadowElement:::dx:::0 +SVGFEDropShadowElement:::dy:::0 +SVGFEDropShadowElement:::in1:::0 +SVGFEDropShadowElement:::setStdDeviation:::2 +SVGFEDropShadowElement:::stdDeviationX:::0 +SVGFEDropShadowElement:::stdDeviationY:::0 +SVGFEGaussianBlurElement:::in1:::0 +SVGFEGaussianBlurElement:::setStdDeviation:::2 +SVGFEGaussianBlurElement:::stdDeviationX:::0 +SVGFEGaussianBlurElement:::stdDeviationY:::0 +SVGFEImageElement:::preserveAspectRatio:::0 +SVGFELightElement:::azimuth:::0 +SVGFELightElement:::elevation:::0 +SVGFELightElement:::limitingConeAngle:::0 +SVGFELightElement:::pointsAtX:::0 +SVGFELightElement:::pointsAtY:::0 +SVGFELightElement:::pointsAtZ:::0 +SVGFELightElement:::specularExponent:::0 +SVGFELightElement:::x:::0 +SVGFELightElement:::y:::0 +SVGFELightElement:::z:::0 +SVGFEMergeNodeElement:::in1:::0 +SVGFEMorphologyElement:::in1:::0 +SVGFEMorphologyElement:::radiusX:::0 +SVGFEMorphologyElement:::radiusY:::0 +SVGFEMorphologyElement:::svgOperator:::0 +SVGFEOffsetElement:::dx:::0 +SVGFEOffsetElement:::dy:::0 +SVGFEOffsetElement:::in1:::0 +SVGFEPointLightElement:::x:::0 +SVGFEPointLightElement:::y:::0 +SVGFEPointLightElement:::z:::0 +SVGFESpecularLightingElement:::in1:::0 +SVGFESpecularLightingElement:::kernelUnitLengthX:::0 +SVGFESpecularLightingElement:::kernelUnitLengthY:::0 +SVGFESpecularLightingElement:::specularConstant:::0 +SVGFESpecularLightingElement:::specularExponent:::0 +SVGFESpecularLightingElement:::surfaceScale:::0 +SVGFESpotLightElement:::limitingConeAngle:::0 +SVGFESpotLightElement:::pointsAtX:::0 +SVGFESpotLightElement:::pointsAtY:::0 +SVGFESpotLightElement:::pointsAtZ:::0 +SVGFESpotLightElement:::specularExponent:::0 +SVGFESpotLightElement:::x:::0 +SVGFESpotLightElement:::y:::0 +SVGFESpotLightElement:::z:::0 +SVGFETileElement:::in1:::0 +SVGFETurbulenceElement:::baseFrequencyX:::0 +SVGFETurbulenceElement:::baseFrequencyY:::0 +SVGFETurbulenceElement:::numOctaves:::0 +SVGFETurbulenceElement:::seed:::0 +SVGFETurbulenceElement:::stitchTiles:::0 +SVGFETurbulenceElement:::type:::0 +SVGFilterElement:::filterUnits:::0 +SVGFilterElement:::height:::0 +SVGFilterElement:::primitiveUnits:::0 +SVGFilterElement:::width:::0 +SVGFilterElement:::x:::0 +SVGFilterElement:::y:::0 +SVGFilterPrimitiveStandardAttributes:::height:::0 +SVGFilterPrimitiveStandardAttributes:::result:::0 +SVGFilterPrimitiveStandardAttributes:::width:::0 +SVGFilterPrimitiveStandardAttributes:::x:::0 +SVGFilterPrimitiveStandardAttributes:::y:::0 +SVGFitToViewBox:::preserveAspectRatio:::0 +SVGFitToViewBox:::viewBox:::0 +SVGForeignObjectElement:::height:::0 +SVGForeignObjectElement:::width:::0 +SVGForeignObjectElement:::x:::0 +SVGForeignObjectElement:::y:::0 +SVGGeometryElement:::getPointAtLength:::1 +SVGGeometryElement:::getTotalLength:::0 +SVGGeometryElement:::isPointInFill:::1 +SVGGeometryElement:::isPointInStroke:::1 +SVGGeometryElement:::pathLength:::0 +SVGGradientElement:::gradientTransform:::0 +SVGGradientElement:::gradientUnits:::0 +SVGGradientElement:::spreadMethod:::0 +SVGGraphicsElement:::farthestViewportElement:::0 +SVGGraphicsElement:::getBBoxFromJavascript:::0 +SVGGraphicsElement:::getCTMFromJavascript:::0 +SVGGraphicsElement:::getScreenCTMFromJavascript:::0 +SVGGraphicsElement:::nearestViewportElement:::0 +SVGGraphicsElement:::transform:::0 +SVGImageElement:::height:::0 +SVGImageElement:::preserveAspectRatio:::0 +SVGImageElement:::width:::0 +SVGImageElement:::x:::0 +SVGImageElement:::y:::0 +SVGLengthListTearOff::::::3 +SVGLengthListTearOff:::appendItem:::2 +SVGLengthListTearOff:::clear:::1 +SVGLengthListTearOff:::getItem:::2 +SVGLengthListTearOff:::initialize:::2 +SVGLengthListTearOff:::insertItemBefore:::3 +SVGLengthListTearOff:::length:::0 +SVGLengthListTearOff:::removeItem:::2 +SVGLengthListTearOff:::replaceItem:::3 +SVGLengthTearOff:::convertToSpecifiedUnits:::2 +SVGLengthTearOff:::newValueSpecifiedUnits:::3 +SVGLengthTearOff:::setValue:::2 +SVGLengthTearOff:::setValueAsString:::2 +SVGLengthTearOff:::setValueInSpecifiedUnits:::2 +SVGLengthTearOff:::unitType:::0 +SVGLengthTearOff:::value:::1 +SVGLengthTearOff:::valueAsString:::0 +SVGLengthTearOff:::valueInSpecifiedUnits:::0 +SVGLinearGradientElement:::x1:::0 +SVGLinearGradientElement:::x2:::0 +SVGLinearGradientElement:::y1:::0 +SVGLinearGradientElement:::y2:::0 +SVGLineElement:::x1:::0 +SVGLineElement:::x2:::0 +SVGLineElement:::y1:::0 +SVGLineElement:::y2:::0 +SVGListPropertyTearOffHelper:::appendItem:::2 +SVGListPropertyTearOffHelper:::clear:::1 +SVGListPropertyTearOffHelper:::getItem:::2 +SVGListPropertyTearOffHelper:::initialize:::2 +SVGListPropertyTearOffHelper:::insertItemBefore:::3 +SVGListPropertyTearOffHelper:::length:::0 +SVGListPropertyTearOffHelper:::removeItem:::2 +SVGListPropertyTearOffHelper:::replaceItem:::3 +SVGMarkerElement:::markerHeight:::0 +SVGMarkerElement:::markerUnits:::0 +SVGMarkerElement:::markerWidth:::0 +SVGMarkerElement:::orientAngle:::0 +SVGMarkerElement:::orientType:::0 +SVGMarkerElement:::refX:::0 +SVGMarkerElement:::refY:::0 +SVGMarkerElement:::setOrientToAngle:::1 +SVGMarkerElement:::setOrientToAuto:::0 +SVGMaskElement:::height:::0 +SVGMaskElement:::maskContentUnits:::0 +SVGMaskElement:::maskUnits:::0 +SVGMaskElement:::width:::0 +SVGMaskElement:::x:::0 +SVGMaskElement:::y:::0 +SVGMatrixTearOff:::a:::0 +SVGMatrixTearOff:::b:::0 +SVGMatrixTearOff:::c:::0 +SVGMatrixTearOff:::d:::0 +SVGMatrixTearOff:::e:::0 +SVGMatrixTearOff:::f:::0 +SVGMatrixTearOff:::flipX:::0 +SVGMatrixTearOff:::flipY:::0 +SVGMatrixTearOff:::inverse:::1 +SVGMatrixTearOff:::multiply:::1 +SVGMatrixTearOff:::rotate:::1 +SVGMatrixTearOff:::rotateFromVector:::3 +SVGMatrixTearOff:::scale:::1 +SVGMatrixTearOff:::scaleNonUniform:::2 +SVGMatrixTearOff:::setA:::2 +SVGMatrixTearOff:::setB:::2 +SVGMatrixTearOff:::setC:::2 +SVGMatrixTearOff:::setD:::2 +SVGMatrixTearOff:::setE:::2 +SVGMatrixTearOff:::setF:::2 +SVGMatrixTearOff:::skewX:::1 +SVGMatrixTearOff:::skewY:::1 +SVGMatrixTearOff:::translate:::2 +SVGNumberListTearOff::::::3 +SVGNumberListTearOff:::appendItem:::2 +SVGNumberListTearOff:::clear:::1 +SVGNumberListTearOff:::getItem:::2 +SVGNumberListTearOff:::initialize:::2 +SVGNumberListTearOff:::insertItemBefore:::3 +SVGNumberListTearOff:::length:::0 +SVGNumberListTearOff:::removeItem:::2 +SVGNumberListTearOff:::replaceItem:::3 +SVGNumberTearOff:::setValue:::2 +SVGNumberTearOff:::value:::0 +SVGPathElement:::getPathSegAtLength:::1 +SVGPatternElement:::height:::0 +SVGPatternElement:::patternContentUnits:::0 +SVGPatternElement:::patternTransform:::0 +SVGPatternElement:::patternUnits:::0 +SVGPatternElement:::width:::0 +SVGPatternElement:::x:::0 +SVGPatternElement:::y:::0 +SVGPointListTearOff::::::3 +SVGPointListTearOff:::appendItem:::2 +SVGPointListTearOff:::clear:::1 +SVGPointListTearOff:::getItem:::2 +SVGPointListTearOff:::initialize:::2 +SVGPointListTearOff:::insertItemBefore:::3 +SVGPointListTearOff:::length:::0 +SVGPointListTearOff:::removeItem:::2 +SVGPointListTearOff:::replaceItem:::3 +SVGPointTearOff:::matrixTransform:::1 +SVGPointTearOff:::setX:::2 +SVGPointTearOff:::setY:::2 +SVGPointTearOff:::x:::0 +SVGPointTearOff:::y:::0 +SVGPolyElement:::animatedPoints:::0 +SVGPolyElement:::pointsFromJavascript:::0 +SVGPolygonElement:::animatedPoints:::0 +SVGPolygonElement:::pointsFromJavascript:::0 +SVGPolylineElement:::animatedPoints:::0 +SVGPolylineElement:::pointsFromJavascript:::0 +SVGPreserveAspectRatioTearOff:::align:::0 +SVGPreserveAspectRatioTearOff:::meetOrSlice:::0 +SVGPreserveAspectRatioTearOff:::setAlign:::2 +SVGPreserveAspectRatioTearOff:::setMeetOrSlice:::2 +SVGPropertyTearOffBase:::contextElement:::0 +SVGRadialGradientElement:::cx:::0 +SVGRadialGradientElement:::cy:::0 +SVGRadialGradientElement:::fr:::0 +SVGRadialGradientElement:::fx:::0 +SVGRadialGradientElement:::fy:::0 +SVGRadialGradientElement:::r:::0 +SVGRectElement:::height:::0 +SVGRectElement:::rx:::0 +SVGRectElement:::ry:::0 +SVGRectElement:::width:::0 +SVGRectElement:::x:::0 +SVGRectElement:::y:::0 +SVGRectTearOff:::height:::0 +SVGRectTearOff:::setHeight:::2 +SVGRectTearOff:::setWidth:::2 +SVGRectTearOff:::setX:::2 +SVGRectTearOff:::setY:::2 +SVGRectTearOff:::width:::0 +SVGRectTearOff:::x:::0 +SVGRectTearOff:::y:::0 +SVGScriptElement:::nonce:::0 +SVGScriptElement:::setNonce:::1 +SVGSMILElement:::targetElement:::0 +SVGStopElement:::offset:::0 +SVGStringListTearOff::::::3 +SVGStringListTearOff:::appendItem:::2 +SVGStringListTearOff:::clear:::1 +SVGStringListTearOff:::getItem:::2 +SVGStringListTearOff:::initialize:::2 +SVGStringListTearOff:::insertItemBefore:::3 +SVGStringListTearOff:::length:::0 +SVGStringListTearOff:::removeItem:::2 +SVGStringListTearOff:::replaceItem:::3 +SVGStyleElement:::disabled:::0 +SVGStyleElement:::media:::0 +SVGStyleElement:::setDisabled:::1 +SVGStyleElement:::setMedia:::1 +SVGStyleElement:::setTitle:::1 +SVGStyleElement:::setType:::1 +SVGStyleElement:::sheet:::0 +SVGStyleElement:::title:::0 +SVGStyleElement:::type:::0 +SVGSVGElement:::animationsPaused:::0 +SVGSVGElement:::checkEnclosure:::2 +SVGSVGElement:::checkIntersection:::2 +SVGSVGElement:::createSVGAngle:::0 +SVGSVGElement:::createSVGLength:::0 +SVGSVGElement:::createSVGMatrix:::0 +SVGSVGElement:::createSVGNumber:::0 +SVGSVGElement:::createSVGPoint:::0 +SVGSVGElement:::createSVGRect:::0 +SVGSVGElement:::createSVGTransform:::0 +SVGSVGElement:::createSVGTransformFromMatrix:::1 +SVGSVGElement:::currentScale:::0 +SVGSVGElement:::currentTranslateFromJavascript:::0 +SVGSVGElement:::deselectAll:::0 +SVGSVGElement:::forceRedraw:::0 +SVGSVGElement:::getCurrentTime:::0 +SVGSVGElement:::getElementById:::1 +SVGSVGElement:::getEnclosureList:::2 +SVGSVGElement:::getIntersectionList:::2 +SVGSVGElement:::height:::0 +SVGSVGElement:::pauseAnimations:::0 +SVGSVGElement:::setCurrentScale:::1 +SVGSVGElement:::setCurrentTime:::1 +SVGSVGElement:::suspendRedraw:::1 +SVGSVGElement:::unpauseAnimations:::0 +SVGSVGElement:::unsuspendRedraw:::1 +SVGSVGElement:::unsuspendRedrawAll:::0 +SVGSVGElement:::width:::0 +SVGSVGElement:::x:::0 +SVGSVGElement:::y:::0 +SVGTests:::requiredExtensions:::0 +SVGTests:::systemLanguage:::0 +SVGTextContentElement:::getCharNumAtPosition:::2 +SVGTextContentElement:::getComputedTextLength:::0 +SVGTextContentElement:::getEndPositionOfChar:::2 +SVGTextContentElement:::getExtentOfChar:::2 +SVGTextContentElement:::getNumberOfChars:::0 +SVGTextContentElement:::getRotationOfChar:::2 +SVGTextContentElement:::getStartPositionOfChar:::2 +SVGTextContentElement:::getSubStringLength:::3 +SVGTextContentElement:::lengthAdjust:::0 +SVGTextContentElement:::selectSubString:::3 +SVGTextContentElement:::textLength:::0 +SVGTextPathElement:::method:::0 +SVGTextPathElement:::spacing:::0 +SVGTextPathElement:::startOffset:::0 +SVGTextPositioningElement:::dx:::0 +SVGTextPositioningElement:::dy:::0 +SVGTextPositioningElement:::rotate:::0 +SVGTextPositioningElement:::x:::0 +SVGTextPositioningElement:::y:::0 +SVGTransformListTearOff::::::3 +SVGTransformListTearOff:::appendItem:::2 +SVGTransformListTearOff:::clear:::1 +SVGTransformListTearOff:::consolidate:::1 +SVGTransformListTearOff:::createSVGTransformFromMatrix:::1 +SVGTransformListTearOff:::getItem:::2 +SVGTransformListTearOff:::initialize:::2 +SVGTransformListTearOff:::insertItemBefore:::3 +SVGTransformListTearOff:::length:::0 +SVGTransformListTearOff:::removeItem:::2 +SVGTransformListTearOff:::replaceItem:::3 +SVGTransformTearOff:::angle:::0 +SVGTransformTearOff:::matrix:::0 +SVGTransformTearOff:::setMatrix:::2 +SVGTransformTearOff:::setRotate:::4 +SVGTransformTearOff:::setScale:::3 +SVGTransformTearOff:::setSkewX:::2 +SVGTransformTearOff:::setSkewY:::2 +SVGTransformTearOff:::setTranslate:::3 +SVGTransformTearOff:::transformType:::0 +SVGURIReference:::href:::0 +SVGUseElement:::height:::0 +SVGUseElement:::width:::0 +SVGUseElement:::x:::0 +SVGUseElement:::y:::0 +SVGZoomAndPan:::setZoomAndPan:::2 +SVGZoomAndPan:::zoomAndPan:::0 +SyncEvent:::lastChance:::0 +SyncEvent:::tag:::0 +SyncManager:::getTags:::1 +SyncManager:::registerFunction:::2 +TaskAttributionTiming:::containerId:::0 +TaskAttributionTiming:::containerName:::0 +TaskAttributionTiming:::containerSrc:::0 +TaskAttributionTiming:::containerType:::0 +Text:::assignedSlotForBinding:::0 +TextControlElement:::autocapitalize:::0 +TextControlElement:::maxLength:::0 +TextControlElement:::minLength:::0 +TextControlElement:::select:::0 +TextControlElement:::selectionDirection:::0 +TextControlElement:::selectionEnd:::0 +TextControlElement:::selectionStart:::0 +TextControlElement:::setAutocapitalize:::1 +TextControlElement:::setMaxLength:::2 +TextControlElement:::setMinLength:::2 +TextControlElement:::setRangeText:::2 +TextControlElement:::setRangeText:::5 +TextControlElement:::setSelectionDirection:::1 +TextControlElement:::setSelectionEnd:::1 +TextControlElement:::setSelectionRangeForBinding:::3 +TextControlElement:::setSelectionStart:::1 +TextControlElement:::setValue:::2 +TextControlElement:::value:::0 +TextDecoder:::decode:::1 +TextDecoder:::decode:::2 +TextDecoder:::decode:::3 +TextDecoder:::encoding:::0 +TextDecoder:::fatal:::0 +TextDecoder:::ignoreBOM:::0 +TextDetector:::detect:::2 +TextEncoder:::encode:::0 +TextEncoder:::encode:::1 +TextEncoder:::encoding:::0 +TextEvent:::data:::0 +TextEvent:::initTextEvent:::0 +TextEvent:::initTextEvent:::1 +TextEvent:::initTextEvent:::2 +TextEvent:::initTextEvent:::3 +TextEvent:::initTextEvent:::4 +TextEvent:::initTextEvent:::5 +Text:::getDestinationInsertionPoints:::0 +TextMetrics:::actualBoundingBoxAscent:::0 +TextMetrics:::actualBoundingBoxDescent:::0 +TextMetrics:::actualBoundingBoxLeft:::0 +TextMetrics:::actualBoundingBoxRight:::0 +TextMetrics:::alphabeticBaseline:::0 +TextMetrics:::emHeightAscent:::0 +TextMetrics:::emHeightDescent:::0 +TextMetrics:::fontBoundingBoxAscent:::0 +TextMetrics:::fontBoundingBoxDescent:::0 +TextMetrics:::hangingBaseline:::0 +TextMetrics:::ideographicBaseline:::0 +TextMetrics:::width:::0 +Text:::splitText:::2 +TextTrack:::activeCues:::0 +TextTrack:::addCue:::1 +TextTrackCue:::endTime:::0 +TextTrackCue:::id:::0 +TextTrackCueList::::::1 +TextTrackCueList:::getCueById:::1 +TextTrackCueList:::length:::0 +TextTrackCue:::onenter:::0 +TextTrackCue:::onexit:::0 +TextTrackCue:::pauseOnExit:::0 +TextTrack:::cues:::0 +TextTrackCue:::setEndTime:::1 +TextTrackCue:::setId:::1 +TextTrackCue:::setOnenter:::1 +TextTrackCue:::setOnexit:::1 +TextTrackCue:::setPauseOnExit:::1 +TextTrackCue:::setStartTime:::1 +TextTrackCue:::startTime:::0 +TextTrackCue:::track:::0 +TextTrack:::id:::0 +TextTrack:::kind:::0 +TextTrack:::label:::0 +TextTrack:::language:::0 +TextTrackList::::::1 +TextTrackList:::getTrackById:::1 +TextTrackList:::length:::0 +TextTrackList:::onaddtrack:::0 +TextTrackList:::onchange:::0 +TextTrackList:::onremovetrack:::0 +TextTrackList:::setOnaddtrack:::1 +TextTrackList:::setOnchange:::1 +TextTrackList:::setOnremovetrack:::1 +TextTrack:::mode:::0 +TextTrack:::oncuechange:::0 +TextTrack:::removeCue:::2 +TextTrack:::setMode:::1 +TextTrack:::setOncuechange:::1 +Text:::wholeText:::0 +# Things straddling gen and non-gn code: +TimeRanges:::end:::2 +TimeRanges:::length:::0 +TimeRanges:::start:::2 +# TODO(lukasza): Despite being defined in NavigatorStorageUtils.idl (without +# TODO(lukasza): No idea why use_output_parameter_for_result incorrectly returns +Touch:::clientX:::0 +Touch:::clientY:::0 +TouchEvent:::altKey:::0 +TouchEvent:::changedTouches:::0 +TouchEvent:::ctrlKey:::0 +TouchEvent:::metaKey:::0 +TouchEvent:::shiftKey:::0 +TouchEvent:::targetTouches:::0 +TouchEvent:::touches:::0 +Touch:::force:::0 +Touch:::identifier:::0 +TouchList:::item:::1 +TouchList:::length:::0 +Touch:::pageX:::0 +Touch:::pageY:::0 +Touch:::radiusX:::0 +Touch:::radiusY:::0 +Touch:::region:::0 +Touch:::rotationAngle:::0 +Touch:::screenX:::0 +Touch:::screenY:::0 +Touch:::target:::0 +TrackBase:::id:::0 +TrackBase:::kind:::0 +TrackBase:::label:::0 +TrackBase:::language:::0 +TrackBase:::owner:::0 +TrackDefault:::byteStreamTrackID:::0 +TrackDefault:::kinds:::0 +TrackDefault:::label:::0 +TrackDefault:::language:::0 +TrackDefaultList:::item:::1 +TrackDefaultList:::length:::0 +TrackDefault:::type:::0 +TrackEvent:::track:::1 +TrackListBase:::getTrackById:::1 +TrackListBase:::length:::0 +TrackListBase:::owner:::0 +TransitionEvent:::elapsedTime:::0 +TransitionEvent:::propertyName:::0 +TransitionEvent:::pseudoElement:::0 +TreeWalker:::currentNode:::0 +TreeWalker:::filter:::0 +TreeWalker:::firstChild:::1 +TreeWalker:::lastChild:::1 +TreeWalker:::nextNode:::1 +TreeWalker:::nextSibling:::1 +TreeWalker:::parentNode:::1 +TreeWalker:::previousNode:::1 +TreeWalker:::previousSibling:::1 +TreeWalker:::root:::0 +TreeWalker:::setCurrentNode:::1 +TreeWalker:::whatToShow:::0 +TypeConversions:::setTestByte:::1 +TypeConversions:::setTestByteString:::0 +TypeConversions:::setTestByteString:::1 +TypeConversions:::setTestLong:::1 +TypeConversions:::setTestLongLong:::1 +TypeConversions:::setTestOctet:::1 +TypeConversions:::setTestShort:::1 +TypeConversions:::setTestUnsignedLong:::1 +TypeConversions:::setTestUnsignedLongLong:::1 +TypeConversions:::setTestUnsignedShort:::1 +TypeConversions:::setTestUSVString:::0 +TypeConversions:::setTestUSVString:::1 +TypeConversions:::testByte:::0 +TypeConversions:::testByteString:::0 +TypeConversions:::testLong:::0 +TypeConversions:::testLongLong:::0 +TypeConversions:::testOctet:::0 +TypeConversions:::testShort:::0 +TypeConversions:::testUnsignedLong:::0 +TypeConversions:::testUnsignedLongLong:::0 +TypeConversions:::testUnsignedShort:::0 +TypeConversions:::testUSVString:::0 +# types involved are unions and/or dictionaries): +UIEvent:::detail:::0 +UIEvent:::initUIEvent:::0 +UIEvent:::initUIEvent:::1 +UIEvent:::initUIEvent:::2 +UIEvent:::initUIEvent:::3 +UIEvent:::initUIEvent:::4 +UIEvent:::initUIEvent:::5 +UIEvent:::sourceCapabilities:::0 +UIEvent:::view:::0 +UIEvent:::which:::0 +UIEventWithKeyState:::altKey:::0 +UIEventWithKeyState:::ctrlKey:::0 +UIEventWithKeyState:::getModifierState:::1 +UIEventWithKeyState:::metaKey:::0 +UIEventWithKeyState:::shiftKey:::0 +UnderlyingSourceBase:::cancelWrapper:::1 +UnderlyingSourceBase:::cancelWrapper:::2 +UnderlyingSourceBase:::notifyLockAcquired:::0 +UnderlyingSourceBase:::notifyLockReleased:::0 +UnderlyingSourceBase:::pull:::1 +UnderlyingSourceBase:::startWrapper:::2 +UnionTypesTest:::doubleOrInternalEnumArg:::1 +UnionTypesTest:::doubleOrStringArg:::0 +UnionTypesTest:::doubleOrStringArg:::1 +UnionTypesTest:::doubleOrStringArrayArg:::1 +UnionTypesTest:::doubleOrStringOrStringArrayArg:::1 +UnionTypesTest:::doubleOrStringOrStringArrayAttribute:::1 +UnionTypesTest:::doubleOrStringOrStringSequenceArg:::1 +UnionTypesTest:::doubleOrStringSequenceArg:::1 +UnionTypesTest:::nodeListOrElementArg:::1 +UnionTypesTest:::nodeListOrElementOrNullArg:::1 +UnionTypesTest:::setDoubleOrStringOrStringArrayAttribute:::1 +URLFileAPI:::createObjectURL:::3 +URLFileAPI:::revokeObjectURL:::2 +URLMediaSource:::createObjectURL:::2 +URLMediaStream:::createObjectURL:::2 +URLSearchParams:::append:::2 +URLSearchParams:::deleteAllWithName:::1 +URLSearchParams:::get:::1 +URLSearchParams:::getAll:::1 +URLSearchParams:::has:::1 +URLSearchParams:::set:::2 +URLSearchParams:::toString:::0 +URLUtilsReadOnly:::hash:::0 +URLUtilsReadOnly:::host:::0 +URLUtilsReadOnly:::hostname:::0 +URLUtilsReadOnly:::href:::0 +URLUtilsReadOnly:::origin:::0 +URLUtilsReadOnly:::pathname:::0 +URLUtilsReadOnly:::port:::0 +URLUtilsReadOnly:::protocol:::0 +URLUtilsReadOnly:::search:::0 +USBAlternateInterface:::alternateSetting:::0 +USBAlternateInterface:::endpoints:::0 +USBAlternateInterface:::interfaceClass:::0 +USBAlternateInterface:::interfaceName:::0 +USBAlternateInterface:::interfaceProtocol:::0 +USBAlternateInterface:::interfaceSubclass:::0 +USBConfiguration:::configurationName:::0 +USBConfiguration:::configurationValue:::0 +USBConfiguration:::interfaces:::0 +USBConnectionEvent:::device:::0 +USBDevice:::claimInterface:::2 +USBDevice:::clearHalt:::3 +USBDevice:::close:::1 +USBDevice:::configuration:::0 +USBDevice:::configurations:::0 +USBDevice:::controlTransferIn:::3 +USBDevice:::controlTransferOut:::2 +USBDevice:::controlTransferOut:::3 +USBDevice:::deviceClass:::0 +USBDevice:::deviceProtocol:::0 +USBDevice:::deviceSubclass:::0 +USBDevice:::deviceVersionMajor:::0 +USBDevice:::deviceVersionMinor:::0 +USBDevice:::deviceVersionSubminor:::0 +USBDevice:::isochronousTransferIn:::3 +USBDevice:::isochronousTransferOut:::4 +USBDevice:::manufacturerName:::0 +USBDevice:::open:::1 +USBDevice:::opened:::0 +USBDevice:::productId:::0 +USBDevice:::productName:::0 +USBDevice:::releaseInterface:::2 +USBDevice:::reset:::1 +USBDevice:::selectAlternateInterface:::3 +USBDevice:::selectConfiguration:::2 +USBDevice:::serialNumber:::0 +USBDevice:::transferIn:::3 +USBDevice:::transferOut:::3 +USBDevice:::usbVersionMajor:::0 +USBDevice:::usbVersionMinor:::0 +USBDevice:::usbVersionSubminor:::0 +USBDevice:::vendorId:::0 +USBEndpoint:::direction:::0 +USBEndpoint:::endpointNumber:::0 +USBEndpoint:::packetSize:::0 +USBEndpoint:::type:::0 +USB:::getDevices:::1 +USBInterface:::alternate:::0 +USBInterface:::alternates:::0 +USBInterface:::claimed:::0 +USBInterface:::interfaceNumber:::0 +USBInTransferResult:::data:::0 +USBInTransferResult:::status:::0 +USBIsochronousInTransferPacket:::data:::0 +USBIsochronousInTransferPacket:::status:::0 +USBIsochronousInTransferResult:::data:::0 +USBIsochronousInTransferResult:::packets:::0 +USBIsochronousOutTransferPacket:::bytesWritten:::0 +USBIsochronousOutTransferPacket:::status:::0 +USBIsochronousOutTransferResult:::packets:::0 +USB:::onconnect:::0 +USB:::ondisconnect:::0 +USBOutTransferResult:::bytesWritten:::0 +USBOutTransferResult:::status:::0 +USB:::requestDevice:::2 +USB:::setOnconnect:::1 +USB:::setOndisconnect:::1 +ValidityState:::badInput:::0 +ValidityState:::customError:::0 +ValidityState:::patternMismatch:::0 +ValidityState:::rangeOverflow:::0 +ValidityState:::rangeUnderflow:::0 +ValidityState:::stepMismatch:::0 +ValidityState:::tooLong:::0 +ValidityState:::tooShort:::0 +ValidityState:::typeMismatch:::0 +ValidityState:::valid:::0 +ValidityState:::valueMissing:::0 +VideoPlaybackQuality:::corruptedVideoFrames:::0 +VideoPlaybackQuality:::creationTime:::0 +VideoPlaybackQuality:::droppedVideoFrames:::0 +VideoPlaybackQuality:::totalVideoFrames:::0 +VideoTrack:::id:::0 +VideoTrack:::kind:::0 +VideoTrack:::label:::0 +VideoTrack:::language:::0 +VideoTrackList::::::1 +VideoTrackList:::getTrackById:::1 +VideoTrackList:::length:::0 +VideoTrackList:::onaddtrack:::0 +VideoTrackList:::onchange:::0 +VideoTrackList:::onremovetrack:::0 +VideoTrackList:::selectedIndex:::0 +VideoTrackList:::setOnaddtrack:::1 +VideoTrackList:::setOnchange:::1 +VideoTrackList:::setOnremovetrack:::1 +VideoTrack:::selected:::0 +VideoTrack:::setSelected:::1 +VoidCallback:::handleEvent:::0 +VRDisplay:::cancelAnimationFrame:::1 +VRDisplay:::capabilities:::0 +VRDisplayCapabilities:::canPresent:::0 +VRDisplayCapabilities:::hasExternalDisplay:::0 +VRDisplayCapabilities:::hasPosition:::0 +VRDisplayCapabilities:::maxLayers:::0 +VRDisplay:::depthFar:::0 +VRDisplay:::depthNear:::0 +VRDisplay:::displayId:::0 +VRDisplay:::displayName:::0 +VRDisplayEvent:::display:::0 +VRDisplayEvent:::reason:::0 +VRDisplay:::exitPresent:::1 +VRDisplay:::getEyeParameters:::1 +VRDisplay:::getFrameData:::1 +VRDisplay:::getLayers:::0 +VRDisplay:::isPresenting:::0 +VRDisplay:::requestAnimationFrame:::1 +VRDisplay:::requestPresent:::2 +VRDisplay:::setDepthFar:::1 +VRDisplay:::setDepthNear:::1 +VRDisplay:::stageParameters:::0 +VRDisplay:::submitFrame:::0 +VREyeParameters:::offset:::0 +VREyeParameters:::renderHeight:::0 +VREyeParameters:::renderWidth:::0 +VRFrameData:::leftProjectionMatrix:::0 +VRFrameData:::leftViewMatrix:::0 +VRFrameData:::pose:::0 +VRFrameData:::rightProjectionMatrix:::0 +VRFrameData:::rightViewMatrix:::0 +VRPose:::angularAcceleration:::0 +VRPose:::angularVelocity:::0 +VRPose:::linearAcceleration:::0 +VRPose:::linearVelocity:::0 +VRPose:::orientation:::0 +VRPose:::position:::0 +VRStageParameters:::sittingToStandingTransform:::0 +VRStageParameters:::sizeX:::0 +VRStageParameters:::sizeZ:::0 +VTTCue:::align:::0 +VTTCue:::getCueAsHTML:::0 +VTTCue:::line:::1 +VTTCue:::position:::1 +VTTCue:::region:::0 +VTTCue:::setAlign:::1 +VTTCue:::setLine:::1 +VTTCue:::setPosition:::2 +VTTCue:::setRegion:::1 +VTTCue:::setSize:::2 +VTTCue:::setSnapToLines:::1 +VTTCue:::setText:::1 +VTTCue:::setVertical:::1 +VTTCue:::size:::0 +VTTCue:::snapToLines:::0 +VTTCue:::text:::0 +VTTCue:::vertical:::0 +VTTRegion:::lines:::0 +VTTRegion:::regionAnchorX:::0 +VTTRegion:::regionAnchorY:::0 +VTTRegion:::scroll:::0 +VTTRegion:::setLines:::2 +VTTRegion:::setRegionAnchorX:::2 +VTTRegion:::setRegionAnchorY:::2 +VTTRegion:::setScroll:::1 +VTTRegion:::setViewportAnchorX:::2 +VTTRegion:::setViewportAnchorY:::2 +VTTRegion:::setWidth:::2 +VTTRegion:::viewportAnchorX:::0 +VTTRegion:::viewportAnchorY:::0 +VTTRegion:::width:::0 +WaveShaperNode:::curve:::0 +WaveShaperNode:::oversample:::0 +WaveShaperNode:::setCurve:::2 +WaveShaperNode:::setOversample:::1 +WebAuthentication:::getAssertion:::2 +WebAuthentication:::getAssertion:::3 +WebAuthentication:::makeCredential:::4 +WebAuthentication:::makeCredential:::5 +WebGL2RenderingContextBase:::beginQuery:::2 +WebGL2RenderingContextBase:::beginTransformFeedback:::1 +WebGL2RenderingContextBase:::bindBufferBase:::3 +WebGL2RenderingContextBase:::bindBufferRange:::5 +WebGL2RenderingContextBase:::bindSampler:::2 +WebGL2RenderingContextBase:::bindTransformFeedback:::2 +WebGL2RenderingContextBase:::bindVertexArray:::1 +WebGL2RenderingContextBase:::blitFramebuffer:::10 +WebGL2RenderingContextBase:::bufferData:::3 +WebGL2RenderingContextBase:::bufferData:::4 +WebGL2RenderingContextBase:::bufferData:::5 +WebGL2RenderingContextBase:::bufferSubData:::4 +WebGL2RenderingContextBase:::bufferSubData:::5 +WebGL2RenderingContextBase:::clearBufferfi:::4 +WebGL2RenderingContextBase:::clearBufferfv:::3 +WebGL2RenderingContextBase:::clearBufferiv:::3 +WebGL2RenderingContextBase:::clearBufferuiv:::3 +WebGL2RenderingContextBase:::clientWaitSync:::3 +WebGL2RenderingContextBase:::compressedTexImage2D:::8 +WebGL2RenderingContextBase:::compressedTexImage2D:::9 +WebGL2RenderingContextBase:::compressedTexImage3D:::10 +WebGL2RenderingContextBase:::compressedTexImage3D:::8 +WebGL2RenderingContextBase:::compressedTexImage3D:::9 +WebGL2RenderingContextBase:::compressedTexSubImage2D:::10 +WebGL2RenderingContextBase:::compressedTexSubImage2D:::9 +WebGL2RenderingContextBase:::compressedTexSubImage3D:::10 +WebGL2RenderingContextBase:::compressedTexSubImage3D:::11 +WebGL2RenderingContextBase:::compressedTexSubImage3D:::12 +WebGL2RenderingContextBase:::copyBufferSubData:::5 +WebGL2RenderingContextBase:::copyTexSubImage3D:::9 +WebGL2RenderingContextBase:::createQuery:::0 +WebGL2RenderingContextBase:::createSampler:::0 +WebGL2RenderingContextBase:::createTransformFeedback:::0 +WebGL2RenderingContextBase:::createVertexArray:::0 +WebGL2RenderingContextBase:::deleteQuery:::1 +WebGL2RenderingContextBase:::deleteSampler:::1 +WebGL2RenderingContextBase:::deleteSync:::1 +WebGL2RenderingContextBase:::deleteTransformFeedback:::1 +WebGL2RenderingContextBase:::deleteVertexArray:::1 +WebGL2RenderingContextBase:::drawArraysInstanced:::4 +WebGL2RenderingContextBase:::drawBuffers:::1 +WebGL2RenderingContextBase:::drawElementsInstanced:::5 +WebGL2RenderingContextBase:::drawRangeElements:::6 +WebGL2RenderingContextBase:::endQuery:::1 +WebGL2RenderingContextBase:::endTransformFeedback:::0 +WebGL2RenderingContextBase:::fenceSync:::2 +WebGL2RenderingContextBase:::framebufferTextureLayer:::5 +WebGL2RenderingContextBase:::getActiveUniformBlockName:::2 +WebGL2RenderingContextBase:::getActiveUniformBlockParameter:::4 +WebGL2RenderingContextBase:::getActiveUniforms:::4 +WebGL2RenderingContextBase:::getBufferSubData:::3 +WebGL2RenderingContextBase:::getBufferSubData:::4 +WebGL2RenderingContextBase:::getBufferSubData:::5 +WebGL2RenderingContextBase:::getFragDataLocation:::2 +WebGL2RenderingContextBase:::getIndexedParameter:::3 +WebGL2RenderingContextBase:::getInternalformatParameter:::4 +WebGL2RenderingContextBase:::getQuery:::3 +WebGL2RenderingContextBase:::getQueryParameter:::3 +WebGL2RenderingContextBase:::getSamplerParameter:::3 +WebGL2RenderingContextBase:::getSyncParameter:::3 +WebGL2RenderingContextBase:::getTransformFeedbackVarying:::2 +WebGL2RenderingContextBase:::getUniformBlockIndex:::2 +WebGL2RenderingContextBase:::getUniformIndices:::3 +WebGL2RenderingContextBase:::invalidateFramebuffer:::2 +WebGL2RenderingContextBase:::invalidateSubFramebuffer:::6 +WebGL2RenderingContextBase:::isQuery:::1 +WebGL2RenderingContextBase:::isSampler:::1 +WebGL2RenderingContextBase:::isSync:::1 +WebGL2RenderingContextBase:::isTransformFeedback:::1 +WebGL2RenderingContextBase:::isVertexArray:::1 +WebGL2RenderingContextBase:::pauseTransformFeedback:::0 +WebGL2RenderingContextBase:::readBuffer:::1 +WebGL2RenderingContextBase:::readPixels:::7 +WebGL2RenderingContextBase:::readPixels:::8 +WebGL2RenderingContextBase:::renderbufferStorageMultisample:::5 +WebGL2RenderingContextBase:::resumeTransformFeedback:::0 +WebGL2RenderingContextBase:::samplerParameterf:::3 +WebGL2RenderingContextBase:::samplerParameteri:::3 +WebGL2RenderingContextBase:::texImage2D:::10 +WebGL2RenderingContextBase:::texImage2D:::9 +WebGL2RenderingContextBase:::texImage3D:::10 +WebGL2RenderingContextBase:::texImage3D:::11 +WebGL2RenderingContextBase:::texStorage2D:::5 +WebGL2RenderingContextBase:::texStorage3D:::6 +WebGL2RenderingContextBase:::texSubImage2D:::10 +WebGL2RenderingContextBase:::texSubImage2D:::9 +WebGL2RenderingContextBase:::texSubImage3D:::11 +WebGL2RenderingContextBase:::texSubImage3D:::12 +WebGL2RenderingContextBase:::transformFeedbackVaryings:::3 +WebGL2RenderingContextBase:::uniform1fv:::3 +WebGL2RenderingContextBase:::uniform1fv:::4 +WebGL2RenderingContextBase:::uniform1iv:::3 +WebGL2RenderingContextBase:::uniform1iv:::4 +WebGL2RenderingContextBase:::uniform1ui:::2 +WebGL2RenderingContextBase:::uniform1uiv:::2 +WebGL2RenderingContextBase:::uniform1uiv:::3 +WebGL2RenderingContextBase:::uniform1uiv:::4 +WebGL2RenderingContextBase:::uniform2fv:::3 +WebGL2RenderingContextBase:::uniform2fv:::4 +WebGL2RenderingContextBase:::uniform2iv:::3 +WebGL2RenderingContextBase:::uniform2iv:::4 +WebGL2RenderingContextBase:::uniform2ui:::3 +WebGL2RenderingContextBase:::uniform2uiv:::2 +WebGL2RenderingContextBase:::uniform2uiv:::3 +WebGL2RenderingContextBase:::uniform2uiv:::4 +WebGL2RenderingContextBase:::uniform3fv:::3 +WebGL2RenderingContextBase:::uniform3fv:::4 +WebGL2RenderingContextBase:::uniform3iv:::3 +WebGL2RenderingContextBase:::uniform3iv:::4 +WebGL2RenderingContextBase:::uniform3ui:::4 +WebGL2RenderingContextBase:::uniform3uiv:::2 +WebGL2RenderingContextBase:::uniform3uiv:::3 +WebGL2RenderingContextBase:::uniform3uiv:::4 +WebGL2RenderingContextBase:::uniform4fv:::3 +WebGL2RenderingContextBase:::uniform4fv:::4 +WebGL2RenderingContextBase:::uniform4iv:::3 +WebGL2RenderingContextBase:::uniform4iv:::4 +WebGL2RenderingContextBase:::uniform4ui:::5 +WebGL2RenderingContextBase:::uniform4uiv:::2 +WebGL2RenderingContextBase:::uniform4uiv:::3 +WebGL2RenderingContextBase:::uniform4uiv:::4 +WebGL2RenderingContextBase:::uniformBlockBinding:::3 +WebGL2RenderingContextBase:::uniformMatrix2fv:::4 +WebGL2RenderingContextBase:::uniformMatrix2fv:::5 +WebGL2RenderingContextBase:::uniformMatrix2x3fv:::3 +WebGL2RenderingContextBase:::uniformMatrix2x3fv:::4 +WebGL2RenderingContextBase:::uniformMatrix2x3fv:::5 +WebGL2RenderingContextBase:::uniformMatrix2x4fv:::3 +WebGL2RenderingContextBase:::uniformMatrix2x4fv:::4 +WebGL2RenderingContextBase:::uniformMatrix2x4fv:::5 +WebGL2RenderingContextBase:::uniformMatrix3fv:::4 +WebGL2RenderingContextBase:::uniformMatrix3fv:::5 +WebGL2RenderingContextBase:::uniformMatrix3x2fv:::3 +WebGL2RenderingContextBase:::uniformMatrix3x2fv:::4 +WebGL2RenderingContextBase:::uniformMatrix3x2fv:::5 +WebGL2RenderingContextBase:::uniformMatrix3x4fv:::3 +WebGL2RenderingContextBase:::uniformMatrix3x4fv:::4 +WebGL2RenderingContextBase:::uniformMatrix3x4fv:::5 +WebGL2RenderingContextBase:::uniformMatrix4fv:::4 +WebGL2RenderingContextBase:::uniformMatrix4fv:::5 +WebGL2RenderingContextBase:::uniformMatrix4x2fv:::3 +WebGL2RenderingContextBase:::uniformMatrix4x2fv:::4 +WebGL2RenderingContextBase:::uniformMatrix4x2fv:::5 +WebGL2RenderingContextBase:::uniformMatrix4x3fv:::3 +WebGL2RenderingContextBase:::uniformMatrix4x3fv:::4 +WebGL2RenderingContextBase:::uniformMatrix4x3fv:::5 +WebGL2RenderingContextBase:::vertexAttribDivisor:::2 +WebGL2RenderingContextBase:::vertexAttribI4i:::5 +WebGL2RenderingContextBase:::vertexAttribI4iv:::2 +WebGL2RenderingContextBase:::vertexAttribI4ui:::5 +WebGL2RenderingContextBase:::vertexAttribI4uiv:::2 +WebGL2RenderingContextBase:::vertexAttribIPointer:::5 +WebGL2RenderingContextBase:::waitSync:::3 +WebGLActiveInfo:::name:::0 +WebGLActiveInfo:::size:::0 +WebGLActiveInfo:::type:::0 +WebGLContextEvent:::statusMessage:::0 +WebGLDebugShaders:::getTranslatedShaderSource:::1 +WebGLDrawBuffers:::drawBuffersWEBGL:::1 +WebGLExtension:::canvas:::0 +WebGLGetBufferSubDataAsync:::getBufferSubDataAsync:::4 +WebGLGetBufferSubDataAsync:::getBufferSubDataAsync:::5 +WebGLGetBufferSubDataAsync:::getBufferSubDataAsync:::6 +WebGLLoseContext:::loseContext:::0 +WebGLLoseContext:::restoreContext:::0 +WebGLRenderingContextBase:::activeTexture:::1 +WebGLRenderingContextBase:::attachShader:::2 +WebGLRenderingContextBase:::bindAttribLocation:::3 +WebGLRenderingContextBase:::bindBuffer:::2 +WebGLRenderingContextBase:::bindFramebuffer:::2 +WebGLRenderingContextBase:::bindRenderbuffer:::2 +WebGLRenderingContextBase:::bindTexture:::2 +WebGLRenderingContextBase:::blendColor:::4 +WebGLRenderingContextBase:::blendEquation:::1 +WebGLRenderingContextBase:::blendEquationSeparate:::2 +WebGLRenderingContextBase:::blendFunc:::2 +WebGLRenderingContextBase:::blendFuncSeparate:::4 +WebGLRenderingContextBase:::bufferData:::3 +WebGLRenderingContextBase:::bufferSubData:::3 +WebGLRenderingContextBase:::checkFramebufferStatus:::1 +WebGLRenderingContextBase:::clear:::1 +WebGLRenderingContextBase:::clearColor:::4 +WebGLRenderingContextBase:::clearDepth:::1 +WebGLRenderingContextBase:::clearStencil:::1 +WebGLRenderingContextBase:::colorMask:::4 +WebGLRenderingContextBase:::commit:::2 +WebGLRenderingContextBase:::compileShader:::1 +WebGLRenderingContextBase:::compressedTexImage2D:::7 +WebGLRenderingContextBase:::compressedTexSubImage2D:::8 +WebGLRenderingContextBase:::copyTexImage2D:::8 +WebGLRenderingContextBase:::copyTexSubImage2D:::8 +WebGLRenderingContextBase:::createBuffer:::0 +WebGLRenderingContextBase:::createFramebuffer:::0 +WebGLRenderingContextBase:::createProgram:::0 +WebGLRenderingContextBase:::createRenderbuffer:::0 +WebGLRenderingContextBase:::createShader:::1 +WebGLRenderingContextBase:::createTexture:::0 +WebGLRenderingContextBase:::cullFace:::1 +WebGLRenderingContextBase:::deleteBuffer:::1 +WebGLRenderingContextBase:::deleteFramebuffer:::1 +WebGLRenderingContextBase:::deleteProgram:::1 +WebGLRenderingContextBase:::deleteRenderbuffer:::1 +WebGLRenderingContextBase:::deleteShader:::1 +WebGLRenderingContextBase:::deleteTexture:::1 +WebGLRenderingContextBase:::depthFunc:::1 +WebGLRenderingContextBase:::depthMask:::1 +WebGLRenderingContextBase:::depthRange:::2 +WebGLRenderingContextBase:::detachShader:::2 +WebGLRenderingContextBase:::disable:::1 +WebGLRenderingContextBase:::disableVertexAttribArray:::1 +WebGLRenderingContextBase:::drawArrays:::3 +WebGLRenderingContextBase:::drawElements:::4 +WebGLRenderingContextBase:::drawingBufferHeight:::0 +WebGLRenderingContextBase:::drawingBufferWidth:::0 +WebGLRenderingContextBase:::enable:::1 +WebGLRenderingContextBase:::enableVertexAttribArray:::1 +WebGLRenderingContextBase:::finish:::0 +WebGLRenderingContextBase:::flush:::0 +WebGLRenderingContextBase:::framebufferRenderbuffer:::4 +WebGLRenderingContextBase:::framebufferTexture2D:::5 +WebGLRenderingContextBase:::frontFace:::1 +WebGLRenderingContextBase:::generateMipmap:::1 +WebGLRenderingContextBase:::getActiveAttrib:::2 +WebGLRenderingContextBase:::getActiveUniform:::2 +WebGLRenderingContextBase:::getAttachedShaders:::2 +WebGLRenderingContextBase:::getAttribLocation:::2 +WebGLRenderingContextBase:::getBufferParameter:::3 +WebGLRenderingContextBase:::getContextAttributes:::0 +WebGLRenderingContextBase:::getError:::0 +WebGLRenderingContextBase:::getExtension:::2 +WebGLRenderingContextBase:::getFramebufferAttachmentParameter:::4 +WebGLRenderingContextBase:::getHTMLOrOffscreenCanvas:::1 +WebGLRenderingContextBase:::getParameter:::2 +WebGLRenderingContextBase:::getProgramInfoLog:::1 +WebGLRenderingContextBase:::getProgramParameter:::3 +WebGLRenderingContextBase:::getRenderbufferParameter:::3 +WebGLRenderingContextBase:::getShaderInfoLog:::1 +WebGLRenderingContextBase:::getShaderParameter:::3 +WebGLRenderingContextBase:::getShaderPrecisionFormat:::2 +WebGLRenderingContextBase:::getShaderSource:::1 +WebGLRenderingContextBase:::getSupportedExtensions:::1 +WebGLRenderingContextBase:::getTexParameter:::3 +WebGLRenderingContextBase:::getUniform:::3 +WebGLRenderingContextBase:::getUniformLocation:::2 +WebGLRenderingContextBase:::getVertexAttrib:::3 +WebGLRenderingContextBase:::getVertexAttribOffset:::2 +WebGLRenderingContextBase:::hint:::2 +WebGLRenderingContextBase:::isBuffer:::1 +WebGLRenderingContextBase:::isContextLost:::0 +WebGLRenderingContextBase:::isEnabled:::1 +WebGLRenderingContextBase:::isFramebuffer:::1 +WebGLRenderingContextBase:::isProgram:::1 +WebGLRenderingContextBase:::isRenderbuffer:::1 +WebGLRenderingContextBase:::isShader:::1 +WebGLRenderingContextBase:::isTexture:::1 +WebGLRenderingContextBase:::lineWidth:::1 +WebGLRenderingContextBase:::linkProgram:::1 +WebGLRenderingContextBase:::pixelStorei:::2 +WebGLRenderingContextBase:::polygonOffset:::2 +WebGLRenderingContextBase:::readPixels:::7 +WebGLRenderingContextBase:::renderbufferStorage:::4 +WebGLRenderingContextBase:::sampleCoverage:::2 +WebGLRenderingContextBase:::scissor:::4 +WebGLRenderingContextBase:::shaderSource:::2 +WebGLRenderingContextBase:::stencilFunc:::3 +WebGLRenderingContextBase:::stencilFuncSeparate:::4 +WebGLRenderingContextBase:::stencilMask:::1 +WebGLRenderingContextBase:::stencilMaskSeparate:::2 +WebGLRenderingContextBase:::stencilOp:::3 +WebGLRenderingContextBase:::stencilOpSeparate:::4 +WebGLRenderingContextBase:::texImage2D:::6 +WebGLRenderingContextBase:::texImage2D:::7 +WebGLRenderingContextBase:::texImage2D:::9 +WebGLRenderingContextBase:::texParameterf:::3 +WebGLRenderingContextBase:::texParameteri:::3 +WebGLRenderingContextBase:::texSubImage2D:::7 +WebGLRenderingContextBase:::texSubImage2D:::8 +WebGLRenderingContextBase:::texSubImage2D:::9 +WebGLRenderingContextBase:::uniform1f:::2 +WebGLRenderingContextBase:::uniform1fv:::2 +WebGLRenderingContextBase:::uniform1i:::2 +WebGLRenderingContextBase:::uniform1iv:::2 +WebGLRenderingContextBase:::uniform2f:::3 +WebGLRenderingContextBase:::uniform2fv:::2 +WebGLRenderingContextBase:::uniform2i:::3 +WebGLRenderingContextBase:::uniform2iv:::2 +WebGLRenderingContextBase:::uniform3f:::4 +WebGLRenderingContextBase:::uniform3fv:::2 +WebGLRenderingContextBase:::uniform3i:::4 +WebGLRenderingContextBase:::uniform3iv:::2 +WebGLRenderingContextBase:::uniform4f:::5 +WebGLRenderingContextBase:::uniform4fv:::2 +WebGLRenderingContextBase:::uniform4i:::5 +WebGLRenderingContextBase:::uniform4iv:::2 +WebGLRenderingContextBase:::uniformMatrix2fv:::3 +WebGLRenderingContextBase:::uniformMatrix3fv:::3 +WebGLRenderingContextBase:::uniformMatrix4fv:::3 +WebGLRenderingContextBase:::useProgram:::1 +WebGLRenderingContextBase:::validateProgram:::1 +WebGLRenderingContextBase:::vertexAttrib1f:::2 +WebGLRenderingContextBase:::vertexAttrib1fv:::2 +WebGLRenderingContextBase:::vertexAttrib2f:::3 +WebGLRenderingContextBase:::vertexAttrib2fv:::2 +WebGLRenderingContextBase:::vertexAttrib3f:::4 +WebGLRenderingContextBase:::vertexAttrib3fv:::2 +WebGLRenderingContextBase:::vertexAttrib4f:::5 +WebGLRenderingContextBase:::vertexAttrib4fv:::2 +WebGLRenderingContextBase:::vertexAttribPointer:::6 +WebGLRenderingContextBase:::viewport:::4 +WebGLShaderPrecisionFormat:::precision:::0 +WebGLShaderPrecisionFormat:::rangeMax:::0 +WebGLShaderPrecisionFormat:::rangeMin:::0 +WebGLTexture:::lastUploadedVideoHeight:::0 +WebGLTexture:::lastUploadedVideoTimestamp:::0 +WebGLTexture:::lastUploadedVideoWidth:::0 +WheelEvent:::deltaMode:::0 +WheelEvent:::deltaX:::0 +WheelEvent:::deltaY:::0 +WheelEvent:::deltaZ:::0 +WheelEvent:::wheelDelta:::0 +WheelEvent:::wheelDeltaX:::0 +WheelEvent:::wheelDeltaY:::0 +WindowAnimationWorklet:::animationWorklet:::1 +WindowAudioWorklet:::audioWorklet:::1 +WindowBase64:::atob:::2 +WindowBase64:::btoa:::2 +WindowGetComputedStyle:::getComputedStyleMap:::2 +WindowGetComputedStyle:::getComputedStyleMap:::3 +WindowPaintWorklet:::paintWorklet:::1 +WorkerGlobalScope:::addressSpaceForBindings:::0 +WorkerGlobalScope:::close:::0 +WorkerGlobalScopeCrypto:::crypto:::1 +WorkerGlobalScopeFileSystem:::webkitRequestFileSystem:::3 +WorkerGlobalScopeFileSystem:::webkitRequestFileSystem:::4 +WorkerGlobalScopeFileSystem:::webkitRequestFileSystem:::5 +WorkerGlobalScopeFileSystem:::webkitRequestFileSystemSync:::4 +WorkerGlobalScopeFileSystem:::webkitResolveLocalFileSystemSyncURL:::3 +WorkerGlobalScopeFileSystem:::webkitResolveLocalFileSystemURL:::3 +WorkerGlobalScopeFileSystem:::webkitResolveLocalFileSystemURL:::4 +WorkerGlobalScope:::importScripts:::2 +WorkerGlobalScope:::isSecureContextForBindings:::0 +WorkerGlobalScope:::location:::0 +WorkerGlobalScope:::navigator:::0 +WorkerGlobalScope:::onerror:::0 +WorkerGlobalScope:::onrejectionhandled:::0 +WorkerGlobalScope:::onunhandledrejection:::0 +WorkerGlobalScope:::origin:::0 +WorkerGlobalScopePerformance:::performance:::1 +WorkerGlobalScope:::self:::0 +WorkerGlobalScope:::setOnerror:::1 +WorkerGlobalScope:::setOnrejectionhandled:::1 +WorkerGlobalScope:::setOnunhandledrejection:::1 +WorkerInternals:::collectGarbage:::1 +WorkerInternals:::countDeprecation:::2 +WorkerInternals:::countFeature:::2 +WorkerInternalsFetch:::getInternalResponseURLList:::2 +WorkerInternals:::originTrialsTest:::0 +WorkerNavigatorBudget:::budget:::1 +WorkerNavigatorNetworkInformation:::connection:::2 +WorkerNavigatorPermissions:::permissions:::1 +WorkerNavigatorStorageQuota:::storage:::1 +Worker:::onmessage:::0 +WorkerPerformance:::clearMarks:::0 +WorkerPerformance:::clearMarks:::1 +WorkerPerformance:::clearMeasures:::0 +WorkerPerformance:::clearMeasures:::1 +WorkerPerformance:::clearResourceTimings:::0 +WorkerPerformance:::getEntries:::0 +WorkerPerformance:::getEntriesByName:::1 +WorkerPerformance:::getEntriesByName:::2 +WorkerPerformance:::getEntriesByType:::1 +WorkerPerformance:::mark:::2 +WorkerPerformance:::measure:::2 +WorkerPerformance:::measure:::3 +WorkerPerformance:::measure:::4 +WorkerPerformance:::memory:::0 +WorkerPerformance:::now:::0 +WorkerPerformance:::onresourcetimingbufferfull:::0 +WorkerPerformance:::setOnresourcetimingbufferfull:::1 +WorkerPerformance:::setResourceTimingBufferSize:::1 +Worker:::postMessage:::3 +Worker:::postMessage:::4 +Worker:::setOnmessage:::1 +Worker:::terminate:::0 +Worklet:::import:::2 +WrapperTypeInfo:::domTemplate:::2 +XMLHttpRequest:::abort:::0 +XMLHttpRequestEventTarget:::onabort:::0 +XMLHttpRequestEventTarget:::onerror:::0 +XMLHttpRequestEventTarget:::onload:::0 +XMLHttpRequestEventTarget:::onloadend:::0 +XMLHttpRequestEventTarget:::onloadstart:::0 +XMLHttpRequestEventTarget:::onprogress:::0 +XMLHttpRequestEventTarget:::ontimeout:::0 +XMLHttpRequestEventTarget:::setOnabort:::1 +XMLHttpRequestEventTarget:::setOnerror:::1 +XMLHttpRequestEventTarget:::setOnload:::1 +XMLHttpRequestEventTarget:::setOnloadend:::1 +XMLHttpRequestEventTarget:::setOnloadstart:::1 +XMLHttpRequestEventTarget:::setOnprogress:::1 +XMLHttpRequestEventTarget:::setOntimeout:::1 +XMLHttpRequest:::getAllResponseHeaders:::0 +XMLHttpRequest:::getResponseHeader:::1 +XMLHttpRequest:::onreadystatechange:::0 +XMLHttpRequest:::open:::3 +XMLHttpRequest:::open:::4 +XMLHttpRequest:::open:::5 +XMLHttpRequest:::open:::6 +XMLHttpRequest:::overrideMimeType:::2 +XMLHttpRequest:::readyState:::0 +XMLHttpRequest:::response:::1 +XMLHttpRequest:::responseText:::1 +XMLHttpRequest:::responseType:::0 +XMLHttpRequest:::responseURL:::0 +XMLHttpRequest:::responseXML:::1 +XMLHttpRequest:::send:::1 +XMLHttpRequest:::send:::2 +XMLHttpRequest:::setOnreadystatechange:::1 +XMLHttpRequest:::setRequestHeader:::3 +XMLHttpRequest:::setResponseType:::2 +XMLHttpRequest:::setTimeout:::2 +XMLHttpRequest:::setWithCredentials:::2 +XMLHttpRequest:::status:::0 +XMLHttpRequest:::statusText:::0 +XMLHttpRequest:::timeout:::0 +XMLHttpRequest:::upload:::0 +XMLHttpRequest:::withCredentials:::0 +XMLSerializer:::serializeToString:::1 +XPathEvaluator:::createExpression:::2 +XPathEvaluator:::createExpression:::3 +XPathEvaluator:::createNSResolver:::1 +XPathEvaluator:::evaluate:::3 +XPathEvaluator:::evaluate:::4 +XPathEvaluator:::evaluate:::5 +XPathEvaluator:::evaluate:::6 +XPathExpression:::evaluate:::2 +XPathExpression:::evaluate:::3 +XPathExpression:::evaluate:::4 +XPathNSResolver:::lookupNamespaceURI:::0 +XPathNSResolver:::lookupNamespaceURI:::1 +XPathResult:::booleanValue:::1 +XPathResult:::invalidIteratorState:::0 +XPathResult:::iterateNext:::1 +XPathResult:::numberValue:::1 +XPathResult:::resultType:::0 +XPathResult:::singleNodeValue:::1 +XPathResult:::snapshotItem:::2 +XPathResult:::snapshotLength:::1 +XPathResult:::stringValue:::1 +XSLTProcessor:::clearParameters:::0 +XSLTProcessor:::getParameter:::2 +XSLTProcessor:::importStylesheet:::1 +XSLTProcessor:::removeParameter:::2 +XSLTProcessor:::reset:::0 +XSLTProcessor:::setParameter:::3 +XSLTProcessor:::transformToDocument:::1 +XSLTProcessor:::transformToFragment:::2
diff --git a/tools/blink_rename_merge_helper/data/manual.patch b/tools/blink_rename_merge_helper/data/manual.patch new file mode 100644 index 0000000..af3bd94 --- /dev/null +++ b/tools/blink_rename_merge_helper/data/manual.patch
@@ -0,0 +1,10498 @@ +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java +index c2bd1b22ea50..102447ddc935 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java +@@ -347,7 +347,7 @@ public class ShortcutHelper { + public static Intent createWebappShortcutIntentForTesting(String id, String url) { + assert !ThreadUtils.runningOnUiThread(); + return createWebappShortcutIntent(id, null, url, getScopeFromUrl(url), null, null, null, +- WEBAPP_SHORTCUT_VERSION, WebDisplayMode.Standalone, 0, 0, 0, false); ++ WEBAPP_SHORTCUT_VERSION, WebDisplayMode.kStandalone, 0, 0, 0, false); + } + + /** +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java +index 86f7d30baa9c..3bdab611244f 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java +@@ -322,14 +322,14 @@ public class RemoteMediaPlayerBridge { + Log.d(TAG, "onRouteAvailabilityChange: " + mRouteIsAvailable + ", " + mIsPlayable); + if (mNativeRemoteMediaPlayerBridge == 0) return; + +- int availability = WebRemotePlaybackAvailability.DeviceNotAvailable; ++ int availability = WebRemotePlaybackAvailability.kDeviceNotAvailable; + if (!mRouteIsAvailable && !mIsPlayable) { +- availability = WebRemotePlaybackAvailability.SourceNotSupported; ++ availability = WebRemotePlaybackAvailability.kSourceNotSupported; + } else if (mRouteIsAvailable && mIsPlayable) { +- availability = WebRemotePlaybackAvailability.DeviceAvailable; ++ availability = WebRemotePlaybackAvailability.kDeviceAvailable; + } else if (mRouteIsAvailable) { + // mIsPlayable is false here. +- availability = WebRemotePlaybackAvailability.SourceNotCompatible; ++ availability = WebRemotePlaybackAvailability.kSourceNotCompatible; + } + nativeOnRouteAvailabilityChanged(mNativeRemoteMediaPlayerBridge, availability); + } +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java +index 713931b2b5b2..6c6188991500 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java +@@ -76,7 +76,7 @@ public class TabWebContentsDelegateAndroid extends WebContentsDelegateAndroid { + + private FindMatchRectsListener mFindMatchRectsListener; + +- private int mDisplayMode = WebDisplayMode.Browser; ++ private int mDisplayMode = WebDisplayMode.kBrowser; + + protected Handler mHandler; + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java +index 41bbb50df489..b05dda7d5c6f 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java +@@ -331,19 +331,19 @@ public class WebApkInfo extends WebappInfo { + */ + private static int displayModeFromString(String displayMode) { + if (displayMode == null) { +- return WebDisplayMode.Undefined; ++ return WebDisplayMode.kUndefined; + } + + if (displayMode.equals("fullscreen")) { +- return WebDisplayMode.Fullscreen; ++ return WebDisplayMode.kFullscreen; + } else if (displayMode.equals("standalone")) { +- return WebDisplayMode.Standalone; ++ return WebDisplayMode.kStandalone; + } else if (displayMode.equals("minimal-ui")) { +- return WebDisplayMode.MinimalUi; ++ return WebDisplayMode.kMinimalUi; + } else if (displayMode.equals("browser")) { +- return WebDisplayMode.Browser; ++ return WebDisplayMode.kBrowser; + } else { +- return WebDisplayMode.Undefined; ++ return WebDisplayMode.kUndefined; + } + } + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java +index 87214d24d97f..33c6e5f2c5b3 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java +@@ -132,7 +132,7 @@ public class WebappActivity extends FullScreenActivity { + getActivityTab().addObserver(createTabObserver()); + getActivityTab().getTabWebContentsDelegateAndroid().setDisplayMode( + mWebappInfo.displayMode()); +- if (mWebappInfo.displayMode() == WebDisplayMode.Fullscreen) { ++ if (mWebappInfo.displayMode() == WebDisplayMode.kFullscreen) { + enterImmersiveMode(); + } + } +@@ -473,13 +473,13 @@ public class WebappActivity extends FullScreenActivity { + return new ChromeFullscreenManager(this, false) { + @Override + public void setPersistentFullscreenMode(boolean enabled) { +- if (mWebappInfo.displayMode() == WebDisplayMode.Fullscreen) return; ++ if (mWebappInfo.displayMode() == WebDisplayMode.kFullscreen) return; + super.setPersistentFullscreenMode(enabled); + } + + @Override + public boolean getPersistentFullscreenMode() { +- if (mWebappInfo.displayMode() == WebDisplayMode.Fullscreen) return false; ++ if (mWebappInfo.displayMode() == WebDisplayMode.kFullscreen) return false; + return super.getPersistentFullscreenMode(); + } + }; +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java +index 3aafbd3bec43..cbcc62bb7996 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java +@@ -206,7 +206,7 @@ public class WebappDataStorage { + mPreferences.getString(KEY_SHORT_NAME, null), + ShortcutHelper.decodeBitmapFromString( + mPreferences.getString(KEY_ICON, null)), version, +- mPreferences.getInt(KEY_DISPLAY_MODE, WebDisplayMode.Standalone), ++ mPreferences.getInt(KEY_DISPLAY_MODE, WebDisplayMode.kStandalone), + mPreferences.getInt(KEY_ORIENTATION, ScreenOrientationValues.DEFAULT), + mPreferences.getLong(KEY_THEME_COLOR, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING), +@@ -261,7 +261,7 @@ public class WebappDataStorage { + // "Standalone" was the original assumed default for all web apps. + editor.putInt(KEY_DISPLAY_MODE, IntentUtils.safeGetIntExtra( + shortcutIntent, ShortcutHelper.EXTRA_DISPLAY_MODE, +- WebDisplayMode.Standalone)); ++ WebDisplayMode.kStandalone)); + editor.putInt(KEY_ORIENTATION, IntentUtils.safeGetIntExtra( + shortcutIntent, ShortcutHelper.EXTRA_ORIENTATION, + ScreenOrientationValues.DEFAULT)); +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java +index a48690831de6..2e8f8bfaa098 100644 +--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java +@@ -108,7 +108,7 @@ public class WebappInfo { + String url = urlFromIntent(intent); + String scope = IntentUtils.safeGetStringExtra(intent, ShortcutHelper.EXTRA_SCOPE); + int displayMode = IntentUtils.safeGetIntExtra( +- intent, ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.Standalone); ++ intent, ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.kStandalone); + int orientation = IntentUtils.safeGetIntExtra( + intent, ShortcutHelper.EXTRA_ORIENTATION, ScreenOrientationValues.DEFAULT); + int source = sourceFromIntent(intent); +diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java +index d8ae60845cac..cecc3c8e107d 100644 +--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java ++++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java +@@ -43,7 +43,7 @@ public class WebApkUpdateManagerTest extends ChromeTabbedActivityTestBase { + private static final String WEBAPK_SHORT_NAME = "Manifest test app"; + private static final String WEBAPK_ICON_URL = "/chrome/test/data/banners/image-512px.png"; + private static final String WEBAPK_ICON_MURMUR2_HASH = "7742433188808797392"; +- private static final int WEBAPK_DISPLAY_MODE = WebDisplayMode.Standalone; ++ private static final int WEBAPK_DISPLAY_MODE = WebDisplayMode.kStandalone; + private static final int WEBAPK_ORIENTATION = ScreenOrientationValues.LANDSCAPE; + private static final long WEBAPK_THEME_COLOR = 2147483648L; + private static final long WEBAPK_BACKGROUND_COLOR = 2147483648L; +diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java +index 3cb4531e5c35..914478019354 100644 +--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java ++++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappInfoTest.java +@@ -33,7 +33,7 @@ public class WebappInfoTest { + String url = "about:blank"; + + WebappInfo info = WebappInfo.create(id, url, null, null, name, shortName, +- WebDisplayMode.Standalone, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, ++ WebDisplayMode.kStandalone, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); + Assert.assertNotNull(info); +@@ -49,7 +49,7 @@ public class WebappInfoTest { + String url = "http://google.com"; + + WebappInfo info = WebappInfo.create(id, url, null, null, name, shortName, +- WebDisplayMode.Standalone, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, ++ WebDisplayMode.kStandalone, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); + Assert.assertNotNull(info); +@@ -144,10 +144,10 @@ public class WebappInfoTest { + String url = "http://money.cnn.com"; + + WebappInfo info = WebappInfo.create(id, url, null, null, name, shortName, +- WebDisplayMode.Fullscreen, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, ++ WebDisplayMode.kFullscreen, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); +- Assert.assertEquals(WebDisplayMode.Fullscreen, info.displayMode()); ++ Assert.assertEquals(WebDisplayMode.kFullscreen, info.displayMode()); + Assert.assertEquals(ScreenOrientationValues.DEFAULT, info.orientation()); + Assert.assertEquals(ShortcutSource.UNKNOWN, info.source()); + } +@@ -164,7 +164,7 @@ public class WebappInfoTest { + long backgroundColor = 0xFF0000FFL; + + WebappInfo info = WebappInfo.create(id, url, null, null, name, shortName, +- WebDisplayMode.Standalone, ScreenOrientationValues.DEFAULT, ++ WebDisplayMode.kStandalone, ScreenOrientationValues.DEFAULT, + ShortcutSource.UNKNOWN, themeColor, backgroundColor, false); + Assert.assertEquals(themeColor, info.themeColor()); + Assert.assertEquals(backgroundColor, info.backgroundColor()); +@@ -180,7 +180,7 @@ public class WebappInfoTest { + String url = "http://money.cnn.com"; + + WebappInfo info = WebappInfo.create(id, url, null, null, name, shortName, +- WebDisplayMode.Standalone, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, ++ WebDisplayMode.kStandalone, ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); + Assert.assertEquals(ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, info.themeColor()); +@@ -231,9 +231,9 @@ public class WebappInfoTest { + @Feature({"Webapps"}) + public void testIntentDisplayMode() { + Intent intent = createIntentWithUrlAndId(); +- intent.putExtra(ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.MinimalUi); ++ intent.putExtra(ShortcutHelper.EXTRA_DISPLAY_MODE, WebDisplayMode.kMinimalUi); + WebappInfo info = WebappInfo.create(intent); +- Assert.assertEquals(WebDisplayMode.MinimalUi, info.displayMode()); ++ Assert.assertEquals(WebDisplayMode.kMinimalUi, info.displayMode()); + } + + @Test +diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java +index c1e05f901d56..e316e4e44393 100644 +--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java ++++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java +@@ -74,7 +74,7 @@ public class WebappModeTest extends MultiActivityTestBase { + } + + WebappInfo webappInfo = WebappInfo.create(id, url, null, new WebappInfo.Icon(icon), title, +- null, WebDisplayMode.Standalone, ScreenOrientationValues.PORTRAIT, ++ null, WebDisplayMode.kStandalone, ScreenOrientationValues.PORTRAIT, + ShortcutSource.UNKNOWN, ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, + ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING, false); + webappInfo.setWebappIntentExtras(intent); +diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java +index 34a80cee3114..5fbf4dbce9df 100644 +--- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java ++++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java +@@ -86,7 +86,7 @@ public class WebApkInfoTest { + Assert.assertEquals(SCOPE, info.scopeUri().toString()); + Assert.assertEquals(NAME, info.name()); + Assert.assertEquals(SHORT_NAME, info.shortName()); +- Assert.assertEquals(WebDisplayMode.MinimalUi, info.displayMode()); ++ Assert.assertEquals(WebDisplayMode.kMinimalUi, info.displayMode()); + Assert.assertEquals(ScreenOrientationValues.PORTRAIT, info.orientation()); + Assert.assertTrue(info.hasValidThemeColor()); + Assert.assertEquals(1L, info.themeColor()); +diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java +index b74e80d32fa6..204ceb8f989b 100644 +--- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java ++++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkUpdateManagerTest.java +@@ -61,7 +61,7 @@ public class WebApkUpdateManagerTest { + private static final String SHORT_NAME = "Short Name"; + private static final String ICON_URL = "/icon.png"; + private static final String ICON_MURMUR2_HASH = "3"; +- private static final int DISPLAY_MODE = WebDisplayMode.Undefined; ++ private static final int DISPLAY_MODE = WebDisplayMode.kUndefined; + private static final int ORIENTATION = ScreenOrientationValues.DEFAULT; + private static final long THEME_COLOR = 1L; + private static final long BACKGROUND_COLOR = 2L; +diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java +index c0b6fbca4602..cf3f252a067c 100644 +--- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java ++++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebappDataStorageTest.java +@@ -239,7 +239,7 @@ public class WebappDataStorageTest { + final String name = "name"; + final String shortName = "shortName"; + final Bitmap icon = createBitmap(); +- final int displayMode = WebDisplayMode.Standalone; ++ final int displayMode = WebDisplayMode.kStandalone; + final int orientation = 1; + final long themeColor = 2; + final long backgroundColor = 3; +diff --git a/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc b/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc +index 290e258dbdeb..472a1a771761 100644 +--- a/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc ++++ b/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc +@@ -82,7 +82,7 @@ TEST_F(PepperGamepadHostTest, ValidateGamepadsMatch) { + size_t ppapi_items_length_cap = ppapi::WebKitGamepads::kItemsLengthCap; + EXPECT_EQ(webkit_items_length_cap, ppapi_items_length_cap); + +- for (size_t i = 0; i < web_gamepads.itemsLengthCap; i++) { ++ for (size_t i = 0; i < webkit_items_length_cap; i++) { + EXPECT_EQ(AddressDiff(&web_gamepads.items[0], &web_gamepads), + AddressDiff(&ppapi_gamepads.items[0], &ppapi_gamepads)); + } +diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java +index 912e9b6dfac0..73c07186b53d 100644 +--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java ++++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeAdapter.java +@@ -252,19 +252,19 @@ public class ImeAdapter { + private static int getModifiers(int metaState) { + int modifiers = 0; + if ((metaState & KeyEvent.META_SHIFT_ON) != 0) { +- modifiers |= WebInputEventModifier.ShiftKey; ++ modifiers |= WebInputEventModifier.kShiftKey; + } + if ((metaState & KeyEvent.META_ALT_ON) != 0) { +- modifiers |= WebInputEventModifier.AltKey; ++ modifiers |= WebInputEventModifier.kAltKey; + } + if ((metaState & KeyEvent.META_CTRL_ON) != 0) { +- modifiers |= WebInputEventModifier.ControlKey; ++ modifiers |= WebInputEventModifier.kControlKey; + } + if ((metaState & KeyEvent.META_CAPS_LOCK_ON) != 0) { +- modifiers |= WebInputEventModifier.CapsLockOn; ++ modifiers |= WebInputEventModifier.kCapsLockOn; + } + if ((metaState & KeyEvent.META_NUM_LOCK_ON) != 0) { +- modifiers |= WebInputEventModifier.NumLockOn; ++ modifiers |= WebInputEventModifier.kNumLockOn; + } + return modifiers; + } +@@ -563,7 +563,7 @@ public class ImeAdapter { + + mViewEmbedder.onImeEvent(); + long timestampMs = SystemClock.uptimeMillis(); +- nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.RawKeyDown, 0, ++ nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.kRawKeyDown, 0, + timestampMs, COMPOSITION_KEY_CODE, 0, false, unicodeFromKeyEvent); + + if (isCommit) { +@@ -573,7 +573,7 @@ public class ImeAdapter { + mNativeImeAdapterAndroid, text, text.toString(), newCursorPosition); + } + +- nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.KeyUp, 0, timestampMs, ++ nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.kKeyUp, 0, timestampMs, + COMPOSITION_KEY_CODE, 0, false, unicodeFromKeyEvent); + return true; + } +@@ -591,9 +591,9 @@ public class ImeAdapter { + int action = event.getAction(); + int type; + if (action == KeyEvent.ACTION_DOWN) { +- type = WebInputEventType.KeyDown; ++ type = WebInputEventType.kKeyDown; + } else if (action == KeyEvent.ACTION_UP) { +- type = WebInputEventType.KeyUp; ++ type = WebInputEventType.kKeyUp; + } else { + // In theory, KeyEvent.ACTION_MULTIPLE is a valid value, but in practice + // this seems to have been quietly deprecated and we've never observed +@@ -619,10 +619,10 @@ public class ImeAdapter { + boolean deleteSurroundingText(int beforeLength, int afterLength) { + mViewEmbedder.onImeEvent(); + if (!isValid()) return false; +- nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.RawKeyDown, 0, ++ nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.kRawKeyDown, 0, + SystemClock.uptimeMillis(), COMPOSITION_KEY_CODE, 0, false, 0); + nativeDeleteSurroundingText(mNativeImeAdapterAndroid, beforeLength, afterLength); +- nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.KeyUp, 0, ++ nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.kKeyUp, 0, + SystemClock.uptimeMillis(), COMPOSITION_KEY_CODE, 0, false, 0); + return true; + } +@@ -638,11 +638,11 @@ public class ImeAdapter { + boolean deleteSurroundingTextInCodePoints(int beforeLength, int afterLength) { + mViewEmbedder.onImeEvent(); + if (!isValid()) return false; +- nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.RawKeyDown, 0, ++ nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.kRawKeyDown, 0, + SystemClock.uptimeMillis(), COMPOSITION_KEY_CODE, 0, false, 0); + nativeDeleteSurroundingTextInCodePoints( + mNativeImeAdapterAndroid, beforeLength, afterLength); +- nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.KeyUp, 0, ++ nativeSendKeyEvent(mNativeImeAdapterAndroid, null, WebInputEventType.kKeyUp, 0, + SystemClock.uptimeMillis(), COMPOSITION_KEY_CODE, 0, false, 0); + return true; + } +diff --git a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java +index 8d44066f49df..f6957c54f7bd 100644 +--- a/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java ++++ b/content/public/android/java/src/org/chromium/content/browser/input/ImeUtils.java +@@ -41,7 +41,7 @@ public class ImeUtils { + outAttrs.inputType = + EditorInfo.TYPE_CLASS_TEXT | EditorInfo.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT; + +- if ((inputFlags & WebTextInputFlags.AutocompleteOff) != 0) { ++ if ((inputFlags & WebTextInputFlags.kAutocompleteOff) != 0) { + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS; + } + +@@ -50,13 +50,13 @@ public class ImeUtils { + if (inputType == TextInputType.TEXT) { + // Normal text field + imeAction = EditorInfo.IME_ACTION_GO; +- if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) { ++ if ((inputFlags & WebTextInputFlags.kAutocorrectOff) == 0) { + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; + } + } else if (inputType == TextInputType.TEXT_AREA + || inputType == TextInputType.CONTENT_EDITABLE) { + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE; +- if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) { ++ if ((inputFlags & WebTextInputFlags.kAutocorrectOff) == 0) { + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; + } + imeAction = EditorInfo.IME_ACTION_NONE; +@@ -100,7 +100,7 @@ public class ImeUtils { + case WebTextInputMode.kKanaName: + case WebTextInputMode.kKataKana: + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE; +- if ((inputFlags & WebTextInputFlags.AutocorrectOff) == 0) { ++ if ((inputFlags & WebTextInputFlags.kAutocorrectOff) == 0) { + outAttrs.inputType |= EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT; + } + imeAction = EditorInfo.IME_ACTION_NONE; +@@ -132,11 +132,11 @@ public class ImeUtils { + // type. This is not using AutocapitalizeNone because Android does not autocapitalize by + // default and there is no way to express no capitalization. + // Autocapitalize is meant as a hint to the virtual keyboard. +- if ((inputFlags & WebTextInputFlags.AutocapitalizeCharacters) != 0) { ++ if ((inputFlags & WebTextInputFlags.kAutocapitalizeCharacters) != 0) { + outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; +- } else if ((inputFlags & WebTextInputFlags.AutocapitalizeWords) != 0) { ++ } else if ((inputFlags & WebTextInputFlags.kAutocapitalizeWords) != 0) { + outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS; +- } else if ((inputFlags & WebTextInputFlags.AutocapitalizeSentences) != 0) { ++ } else if ((inputFlags & WebTextInputFlags.kAutocapitalizeSentences) != 0) { + outAttrs.inputType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES; + } + // Content editable doesn't use autocapitalize so we need to set it manually. +diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc +index b0b4185d8f1a..4b04fe960c61 100644 +--- a/content/renderer/renderer_blink_platform_impl.cc ++++ b/content/renderer/renderer_blink_platform_impl.cc +@@ -568,7 +568,8 @@ void RendererBlinkPlatformImpl::SandboxSupport::GetFallbackFontForCharacter( + return; + } + +- GetFallbackFontForCharacter(character, preferred_locale, fallbackFont); ++ content::GetFallbackFontForCharacter(character, preferred_locale, ++ fallbackFont); + unicode_font_families_.insert(std::make_pair(character, *fallbackFont)); + } + +diff --git a/mojo/public/cpp/bindings/lib/wtf_hash_util.h b/mojo/public/cpp/bindings/lib/wtf_hash_util.h +index 0125e8951016..d4cd505c713d 100644 +--- a/mojo/public/cpp/bindings/lib/wtf_hash_util.h ++++ b/mojo/public/cpp/bindings/lib/wtf_hash_util.h +@@ -59,10 +59,10 @@ size_t WTFHash(size_t seed, const T& value) { + + template <typename T> + struct StructPtrHashFn { +- static unsigned hash(const StructPtr<T>& value) { ++ static unsigned GetHash(const StructPtr<T>& value) { + return value.Hash(kHashSeed); + } +- static bool equal(const StructPtr<T>& left, const StructPtr<T>& right) { ++ static bool Equal(const StructPtr<T>& left, const StructPtr<T>& right) { + return left.Equals(right); + } + static const bool safe_to_compare_to_empty_or_deleted = false; +@@ -70,10 +70,10 @@ struct StructPtrHashFn { + + template <typename T> + struct InlinedStructPtrHashFn { +- static unsigned hash(const InlinedStructPtr<T>& value) { ++ static unsigned GetHash(const InlinedStructPtr<T>& value) { + return value.Hash(kHashSeed); + } +- static bool equal(const InlinedStructPtr<T>& left, ++ static bool Equal(const InlinedStructPtr<T>& left, + const InlinedStructPtr<T>& right) { + return left.Equals(right); + } +diff --git a/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc b/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc +index 959d25b36853..04f14b5cef7d 100644 +--- a/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc ++++ b/mojo/public/cpp/bindings/tests/wtf_hash_unittest.cc +@@ -37,21 +37,21 @@ TEST_F(WTFHashTest, Enum) { + // Just check that this template instantiation compiles. + + // Top-level. +- ASSERT_EQ(WTF::DefaultHash<blink::TopLevelEnum>::Hash().hash( ++ ASSERT_EQ(WTF::DefaultHash<blink::TopLevelEnum>::Hash().GetHash( + blink::TopLevelEnum::E0), +- WTF::DefaultHash<blink::TopLevelEnum>::Hash().hash( ++ WTF::DefaultHash<blink::TopLevelEnum>::Hash().GetHash( + blink::TopLevelEnum::E0)); + + // Nested in struct. +- ASSERT_EQ(WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().hash( ++ ASSERT_EQ(WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().GetHash( + blink::TestWTFStruct::NestedEnum::E0), +- WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().hash( ++ WTF::DefaultHash<blink::TestWTFStruct::NestedEnum>::Hash().GetHash( + blink::TestWTFStruct::NestedEnum::E0)); + + // Nested in interface. +- ASSERT_EQ(WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().hash( ++ ASSERT_EQ(WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().GetHash( + blink::TestWTF::NestedEnum::E0), +- WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().hash( ++ WTF::DefaultHash<blink::TestWTF::NestedEnum>::Hash().GetHash( + blink::TestWTF::NestedEnum::E0)); + } + +diff --git a/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl +index aecb32e10b5a..c334a52f9833 100644 +--- a/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl ++++ b/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl +@@ -94,14 +94,14 @@ struct hash<{{enum_name}}> + {%- set deleted_value_unused = "false" if empty_value in enum|all_enum_values else "true" %} + namespace WTF { + struct {{hash_fn_name}} { +- static unsigned hash(const {{enum_name}}& value) { ++ static unsigned GetHash(const {{enum_name}}& value) { + using utype = std::underlying_type<{{enum_name}}>::type; +- return DefaultHash<utype>::Hash().hash(static_cast<utype>(value)); ++ return DefaultHash<utype>::Hash().GetHash(static_cast<utype>(value)); + } +- static bool equal(const {{enum_name}}& left, const {{enum_name}}& right) { ++ static bool Equal(const {{enum_name}}& left, const {{enum_name}}& right) { + return left == right; + } +- static const bool safeToCompareToEmptyOrDeleted = true; ++ static const bool safe_to_compare_to_empty_or_deleted = true; + }; + + template <> +@@ -117,13 +117,13 @@ struct HashTraits<{{enum_name}}> + static_assert({{deleted_value_unused}}, + "{{deleted_value}} is a reserved enum value"); + static const bool hasIsEmptyValueFunction = true; +- static bool isEmptyValue(const {{enum_name}}& value) { ++ static bool IsEmptyValue(const {{enum_name}}& value) { + return value == static_cast<{{enum_name}}>({{empty_value}}); + } +- static void constructDeletedValue({{enum_name}}& slot, bool) { ++ static void ConstructDeletedValue({{enum_name}}& slot, bool) { + slot = static_cast<{{enum_name}}>({{deleted_value}}); + } +- static bool isDeletedValue(const {{enum_name}}& value) { ++ static bool IsDeletedValue(const {{enum_name}}& value) { + return value == static_cast<{{enum_name}}>({{deleted_value}}); + } + }; +diff --git a/third_party/WebKit/Source/BUILD.gn b/third_party/WebKit/Source/BUILD.gn +index 25832deae572..7edbabc456c8 100644 +--- a/third_party/WebKit/Source/BUILD.gn ++++ b/third_party/WebKit/Source/BUILD.gn +@@ -28,7 +28,7 @@ declare_args() { + # Set to true to have the clang Blink GC plugin use Chromium-style naming + # rather than legacy Blink name. + # TODO(https://crbug.com/675879): Remove this option after the Blink rename. +- blink_gc_plugin_option_use_chromium_style_naming = false ++ blink_gc_plugin_option_use_chromium_style_naming = true + } + + # features --------------------------------------------------------------------- +diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp +index 2794c9c6b805..e135329d746a 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp +@@ -278,7 +278,7 @@ void DOMWrapperWorld::RegisterDOMObjectHolder(v8::Isolate* isolate, + DOMObjectHolder<T>::Create(isolate, object, wrapper)); + } + +-template void DOMWrapperWorld::registerDOMObjectHolder(v8::Isolate*, ++template void DOMWrapperWorld::RegisterDOMObjectHolder(v8::Isolate*, + ScriptFunction*, + v8::Local<v8::Value>); + +diff --git a/third_party/WebKit/Source/bindings/core/v8/Iterable.h b/third_party/WebKit/Source/bindings/core/v8/Iterable.h +index 02edb4b07616..ab0d76dd1030 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/Iterable.h ++++ b/third_party/WebKit/Source/bindings/core/v8/Iterable.h +@@ -17,7 +17,7 @@ namespace blink { + template <typename KeyType, typename ValueType> + class Iterable { + public: +- Iterator* KeysForBinding(ScriptState* script_state, ++ Iterator* keysForBinding(ScriptState* script_state, + ExceptionState& exception_state) { + IterationSource* source = this->StartIteration(script_state, exception_state); + if (!source) +@@ -25,7 +25,7 @@ class Iterable { + return new IterableIterator<KeySelector>(source); + } + +- Iterator* ValuesForBinding(ScriptState* script_state, ++ Iterator* valuesForBinding(ScriptState* script_state, + ExceptionState& exception_state) { + IterationSource* source = this->StartIteration(script_state, exception_state); + if (!source) +@@ -33,7 +33,7 @@ class Iterable { + return new IterableIterator<ValueSelector>(source); + } + +- Iterator* EntriesForBinding(ScriptState* script_state, ++ Iterator* entriesForBinding(ScriptState* script_state, + ExceptionState& exception_state) { + IterationSource* source = this->StartIteration(script_state, exception_state); + if (!source) +@@ -41,7 +41,7 @@ class Iterable { + return new IterableIterator<EntrySelector>(source); + } + +- void ForEachForBinding(ScriptState* script_state, ++ void forEachForBinding(ScriptState* script_state, + const ScriptValue& this_value, + const ScriptValue& callback, + const ScriptValue& this_arg, +@@ -172,7 +172,7 @@ template <typename KeyType, typename ValueType> + class PairIterable : public Iterable<KeyType, ValueType> { + public: + Iterator* GetIterator(ScriptState* script_state, ExceptionState& exception_state) { +- return this->EntriesForBinding(script_state, exception_state); ++ return this->entriesForBinding(script_state, exception_state); + } + }; + +diff --git a/third_party/WebKit/Source/bindings/core/v8/Maplike.h b/third_party/WebKit/Source/bindings/core/v8/Maplike.h +index 7bbcd9160370..62f1d1ff21d9 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/Maplike.h ++++ b/third_party/WebKit/Source/bindings/core/v8/Maplike.h +@@ -14,14 +14,14 @@ namespace blink { + template <typename KeyType, typename ValueType> + class Maplike : public PairIterable<KeyType, ValueType> { + public: +- bool HasForBinding(ScriptState* script_state, ++ bool hasForBinding(ScriptState* script_state, + const KeyType& key, + ExceptionState& exception_state) { + ValueType value; + return GetMapEntry(script_state, key, value, exception_state); + } + +- ScriptValue GetForBinding(ScriptState* script_state, ++ ScriptValue getForBinding(ScriptState* script_state, + const KeyType& key, + ExceptionState& exception_state) { + ValueType value; +diff --git a/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp b/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp +index bb7e95832076..33c07976b1cd 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/NativeValueTraitsImplTest.cpp +@@ -27,7 +27,7 @@ TEST(NativeValueTraitsImplTest, IDLInterface) { + V8TestingScope scope; + { + DummyExceptionStateForTesting exception_state; +- Internals* internals = NativeValueTraits<Internals>::nativeValue( ++ Internals* internals = NativeValueTraits<Internals>::NativeValue( + scope.GetIsolate(), v8::Number::New(scope.GetIsolate(), 42), exception_state); + EXPECT_TRUE(exception_state.HadException()); + EXPECT_EQ("Unable to convert value to Internals.", +@@ -37,7 +37,7 @@ TEST(NativeValueTraitsImplTest, IDLInterface) { + { + DummyExceptionStateForTesting exception_state; + TestSequenceCallback* callback_function = +- NativeValueTraits<TestSequenceCallback>::nativeValue( ++ NativeValueTraits<TestSequenceCallback>::NativeValue( + scope.GetIsolate(), v8::Undefined(scope.GetIsolate()), exception_state); + EXPECT_TRUE(exception_state.HadException()); + EXPECT_EQ("Unable to convert value to TestSequenceCallback.", +diff --git a/third_party/WebKit/Source/bindings/core/v8/V8StringResource.cpp b/third_party/WebKit/Source/bindings/core/v8/V8StringResource.cpp +index e5348575de05..ec5b68f1870a 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/V8StringResource.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/V8StringResource.cpp +@@ -148,9 +148,9 @@ StringType V8StringToWebCoreString(v8::Local<v8::String> v8_string, + // Explicitly instantiate the above template with the expected + // parameterizations, to ensure the compiler generates the code; otherwise link + // errors can result in GCC 4.4. +-template String v8StringToWebCoreString<String>(v8::Local<v8::String>, ++template String V8StringToWebCoreString<String>(v8::Local<v8::String>, + ExternalMode); +-template AtomicString v8StringToWebCoreString<AtomicString>( ++template AtomicString V8StringToWebCoreString<AtomicString>( + v8::Local<v8::String>, + ExternalMode); + +diff --git a/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp b/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp +index 70d45aba5db4..0620f20e2d72 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/V8V0CustomElementLifecycleCallbacks.cpp +@@ -113,9 +113,9 @@ V8V0CustomElementLifecycleCallbacks::V8V0CustomElementLifecycleCallbacks( + attribute_changed_(script_state->GetIsolate(), attribute_changed) { + prototype_.SetPhantom(); + +-#define MAKE_WEAK(Var, _) \ +- if (!m_##Var.IsEmpty()) \ +- m_##Var.SetPhantom(); ++#define MAKE_WEAK(Var, Ignored) \ ++ if (!Var##_.IsEmpty()) \ ++ Var##_.SetPhantom(); + + CALLBACK_LIST(MAKE_WEAK) + #undef MAKE_WEAK +diff --git a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.cpp b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.cpp +index 805cc73ce41a..8d755cc37182 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.cpp +@@ -6,7 +6,7 @@ + + namespace blink { + +-static_assert(offsetof(struct WrapperTypeInfo, ginEmbedder) == ++static_assert(offsetof(struct WrapperTypeInfo, gin_embedder) == + offsetof(struct gin::WrapperInfo, embedder), + "offset of WrapperTypeInfo.ginEmbedder must be the same as " + "gin::WrapperInfo.embedder"); +diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp +index c9a5c5213ec4..353883b7e95d 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLPlugInElementCustom.cpp +@@ -46,7 +46,7 @@ template <typename ElementType> + void GetScriptableObjectProperty( + const AtomicString& name, + const v8::PropertyCallbackInfo<v8::Value>& info) { +- HTMLPlugInElement* impl = ElementType::ToImpl(info.Holder()); ++ HTMLPlugInElement* impl = ElementType::toImpl(info.Holder()); + RefPtr<SharedPersistent<v8::Object>> wrapper = impl->PluginWrapper(); + if (!wrapper) + return; +@@ -75,7 +75,7 @@ void SetScriptableObjectProperty( + const v8::PropertyCallbackInfo<v8::Value>& info) { + ASSERT(!value.IsEmpty()); + +- HTMLPlugInElement* impl = ElementType::ToImpl(info.Holder()); ++ HTMLPlugInElement* impl = ElementType::toImpl(info.Holder()); + RefPtr<SharedPersistent<v8::Object>> wrapper = impl->PluginWrapper(); + if (!wrapper) + return; +diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8PerformanceObserverCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8PerformanceObserverCustom.cpp +index cf6e7736f300..ed610fbdf46a 100644 +--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8PerformanceObserverCustom.cpp ++++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8PerformanceObserverCustom.cpp +@@ -53,7 +53,7 @@ void V8PerformanceObserver::constructorCustom( + ScriptState* script_state = ScriptState::ForReceiverObject(info); + v8::Local<v8::Function> v8_callback = v8::Local<v8::Function>::Cast(info[0]); + PerformanceObserverCallback* callback = +- PerformanceObserverCallback::create(script_state, v8_callback); ++ PerformanceObserverCallback::Create(script_state, v8_callback); + + PerformanceObserver* observer = PerformanceObserver::Create( + CurrentExecutionContext(isolate), performance, callback); +diff --git a/third_party/WebKit/Source/bindings/modules/v8/DictionaryHelperForModules.cpp b/third_party/WebKit/Source/bindings/modules/v8/DictionaryHelperForModules.cpp +index 5ea221df963e..a183941442b4 100644 +--- a/third_party/WebKit/Source/bindings/modules/v8/DictionaryHelperForModules.cpp ++++ b/third_party/WebKit/Source/bindings/modules/v8/DictionaryHelperForModules.cpp +@@ -29,10 +29,10 @@ + + namespace blink { + +-template bool DictionaryHelper::get(const Dictionary&, ++template bool DictionaryHelper::Get(const Dictionary&, + const StringView& key, + Member<Headers>& value); +-template bool DictionaryHelper::get(const Dictionary&, ++template bool DictionaryHelper::Get(const Dictionary&, + const StringView& key, + Member<PasswordCredential>& value); + +diff --git a/third_party/WebKit/Source/bindings/modules/v8/V8ServiceWorkerMessageEventInternal.h b/third_party/WebKit/Source/bindings/modules/v8/V8ServiceWorkerMessageEventInternal.h +index 5ee1b78459f2..64caee6b9bbc 100644 +--- a/third_party/WebKit/Source/bindings/modules/v8/V8ServiceWorkerMessageEventInternal.h ++++ b/third_party/WebKit/Source/bindings/modules/v8/V8ServiceWorkerMessageEventInternal.h +@@ -58,8 +58,8 @@ void V8ServiceWorkerMessageEventInternal::ConstructorCustom( + + // TODO(bashi): Workaround for http://crbug.com/529941. We need to store + // |data| as a private value to avoid cyclic references. +- if (event_init_dict.HasData()) { +- v8::Local<v8::Value> v8_data = event_init_dict.Data().V8Value(); ++ if (event_init_dict.hasData()) { ++ v8::Local<v8::Value> v8_data = event_init_dict.data().V8Value(); + V8PrivateProperty::GetMessageEventCachedData(isolate).Set(wrapper, v8_data); + if (DOMWrapperWorld::Current(isolate).IsIsolatedWorld()) { + impl->SetSerializedData( +@@ -85,7 +85,7 @@ void V8ServiceWorkerMessageEventInternal::DataAttributeGetterCustom( + + v8::Local<v8::Value> data; + if (SerializedScriptValue* serialized_value = event->SerializedData()) { +- MessagePortArray ports = event->Ports(); ++ MessagePortArray ports = event->ports(); + SerializedScriptValue::DeserializeOptions options; + options.message_ports = &ports; + data = serialized_value->Deserialize(isolate, options); +diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp +index 129b2ee75f1b..259c13851f9b 100644 +--- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp ++++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8IDBObserverCustom.cpp +@@ -45,7 +45,7 @@ void V8IDBObserver::constructorCustom( + ScriptState* script_state = ScriptState::ForReceiverObject(info); + v8::Local<v8::Function> v8_callback = v8::Local<v8::Function>::Cast(info[0]); + IDBObserverCallback* callback = +- IDBObserverCallback::create(script_state, v8_callback); ++ IDBObserverCallback::Create(script_state, v8_callback); + IDBObserver* observer = IDBObserver::Create(callback); + if (exception_state.HadException()) + return; +diff --git a/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py b/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py +index ab5bbe6336fe..fd548e39bac1 100755 +--- a/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py ++++ b/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py +@@ -29,7 +29,7 @@ _INIT_PARTIAL_INTERFACE = """%s + + namespace blink { + +-void initPartialInterfacesInModules() { ++void InitPartialInterfacesInModules() { + %s + } + +diff --git a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py +index c8b592fba81f..16824c5c7ae4 100644 +--- a/third_party/WebKit/Source/bindings/scripts/idl_definitions.py ++++ b/third_party/WebKit/Source/bindings/scripts/idl_definitions.py +@@ -528,7 +528,7 @@ class IdlLiteral(object): + if self.value: + return '"%s"' % self.value + else: +- return 'WTF::emptyString' ++ return 'WTF::g_empty_string' + if self.idl_type == 'integer': + return '%d' % self.value + if self.idl_type == 'float': +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +index da3f3371db5b..e3eb374a3031 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +@@ -281,7 +281,7 @@ def getter_context(interface, attribute, context): + + def v8_set_return_value_statement(for_main_world=False): + if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attributes: +- return 'v8SetReturnValue(info, v8Value)' ++ return 'V8SetReturnValue(info, v8Value)' + return idl_type.v8_set_return_value( + cpp_value, extended_attributes=extended_attributes, script_wrappable='impl', + for_main_world=for_main_world, is_static=attribute.is_static) +@@ -319,14 +319,14 @@ def getter_expression(interface, attribute, context): + # Needed to handle getter expressions returning Type& as the + # use site for |expression| expects Type*. + if attribute.idl_type.is_interface_type and len(arguments) == 0: +- return 'WTF::getPtr(%s)' % expression ++ return 'WTF::GetPtr(%s)' % expression + return expression + + + CONTENT_ATTRIBUTE_GETTER_NAMES = { +- 'boolean': 'fastHasAttribute', +- 'long': 'getIntegralAttribute', +- 'unsigned long': 'getUnsignedIntegralAttribute', ++ 'boolean': 'FastHasAttribute', ++ 'long': 'GetIntegralAttribute', ++ 'unsigned long': 'GetUnsignedIntegralAttribute', + } + + +@@ -339,7 +339,7 @@ def getter_base_name(interface, attribute, arguments): + content_attribute_name = extended_attributes['Reflect'] or attribute.name.lower() + if content_attribute_name in ['class', 'id', 'name']: + # Special-case for performance optimization. +- return 'get%sAttribute' % content_attribute_name.capitalize() ++ return 'Get%sAttribute' % content_attribute_name.capitalize() + + arguments.append(scoped_content_attribute_name(interface, attribute)) + +@@ -347,8 +347,8 @@ def getter_base_name(interface, attribute, arguments): + if base_idl_type in CONTENT_ATTRIBUTE_GETTER_NAMES: + return CONTENT_ATTRIBUTE_GETTER_NAMES[base_idl_type] + if 'URL' in attribute.extended_attributes: +- return 'getURLAttribute' +- return 'fastGetAttribute' ++ return 'GetURLAttribute' ++ return 'FastGetAttribute' + + + def is_keep_alive_for_gc(interface, attribute): +@@ -394,7 +394,9 @@ def setter_context(interface, attribute, interfaces, context): + (target_attribute_name, target_interface_name)) + + if ('Replaceable' in attribute.extended_attributes): +- context['cpp_setter'] = 'v8CallBoolean(info.Holder()->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), propertyName, v8Value))' ++ context['cpp_setter'] = ( ++ 'V8CallBoolean(info.Holder()->CreateDataProperty(' + ++ 'info.GetIsolate()->GetCurrentContext(), propertyName, v8Value))') + return + + extended_attributes = attribute.extended_attributes +@@ -449,13 +451,13 @@ def setter_expression(interface, attribute, context): + attribute.name == 'onerror'): + includes.add('bindings/core/v8/V8ErrorHandler.h') + arguments.append( +- 'V8EventListenerHelper::ensureEventListener<V8ErrorHandler>(' + +- 'v8Value, true, ScriptState::forReceiverObject(info))') ++ 'V8EventListenerHelper::EnsureEventListener<V8ErrorHandler>(' + ++ 'v8Value, true, ScriptState::ForReceiverObject(info))') + else: + arguments.append( +- 'V8EventListenerHelper::getEventListener(' + +- 'ScriptState::forReceiverObject(info), v8Value, true, ' + +- 'ListenerFindOrCreate)') ++ 'V8EventListenerHelper::GetEventListener(' + ++ 'ScriptState::ForReceiverObject(info), v8Value, true, ' + ++ 'kListenerFindOrCreate)') + else: + arguments.append('cppValue') + if context['is_setter_raises_exception']: +@@ -465,9 +467,9 @@ def setter_expression(interface, attribute, context): + + + CONTENT_ATTRIBUTE_SETTER_NAMES = { +- 'boolean': 'setBooleanAttribute', +- 'long': 'setIntegralAttribute', +- 'unsigned long': 'setUnsignedIntegralAttribute', ++ 'boolean': 'SetBooleanAttribute', ++ 'long': 'SetIntegralAttribute', ++ 'unsigned long': 'SetUnsignedIntegralAttribute', + } + + +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py b/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py +index 37be007b8e64..b1589544c0f6 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_callback_function.py +@@ -57,7 +57,7 @@ def callback_function_context(callback_function): + 'return_value': idl_type.v8_value_to_local_cpp_value( + callback_function.extended_attributes, + 'v8ReturnValue', 'cppValue', +- isolate='m_scriptState->isolate()', ++ isolate='m_scriptState->GetIsolate()', + bailout_return_value='false'), + }) + +@@ -70,8 +70,8 @@ def arguments_context(arguments, return_cpp_type): + return { + 'argument_name': '%sArgument' % argument.name, + 'cpp_value_to_v8_value': argument.idl_type.cpp_value_to_v8_value( +- argument.name, isolate='m_scriptState->isolate()', +- creation_context='m_scriptState->context()->Global()'), ++ argument.name, isolate='m_scriptState->GetIsolate()', ++ creation_context='m_scriptState->GetContext()->Global()'), + } + + argument_declarations = [ +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py +index 524972196b19..a3f97e73a56f 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py +@@ -116,8 +116,8 @@ def arguments_context(arguments, call_with_this_handle): + return { + 'handle': '%sHandle' % argument.name, + 'cpp_value_to_v8_value': argument.idl_type.cpp_value_to_v8_value( +- argument.name, isolate='m_scriptState->isolate()', +- creation_context='m_scriptState->context()->Global()'), ++ argument.name, isolate='m_scriptState->GetIsolate()', ++ creation_context='m_scriptState->GetContext()->Global()'), + } + + argument_declarations = ['ScriptValue thisValue'] if call_with_this_handle else [] +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py b/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py +index 14af42f00089..66fd18f16b8a 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py +@@ -209,12 +209,14 @@ def member_impl_context(member, interfaces_info, header_includes, + def has_method_expression(): + if nullable_indicator_name: + return nullable_indicator_name +- elif idl_type.is_enum or idl_type.is_string_type or idl_type.is_union_type: ++ elif idl_type.is_union_type: + return '!m_%s.isNull()' % cpp_name ++ elif idl_type.is_enum or idl_type.is_string_type: ++ return '!m_%s.IsNull()' % cpp_name + elif idl_type.name in ['Any', 'Object']: +- return '!(m_{0}.isEmpty() || m_{0}.isNull() || m_{0}.isUndefined())'.format(cpp_name) ++ return '!(m_{0}.IsEmpty() || m_{0}.IsNull() || m_{0}.IsUndefined())'.format(cpp_name) + elif idl_type.name == 'Dictionary': +- return '!m_%s.isUndefinedOrNull()' % cpp_name ++ return '!m_%s.IsUndefinedOrNull()' % cpp_name + else: + return 'm_%s' % cpp_name + +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_interface.py +index 623d03d975e0..ec4dfe7974b1 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_interface.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_interface.py +@@ -214,7 +214,7 @@ def interface_context(interface, interfaces): + # as in the WebIDL spec? + is_immutable_prototype = is_global or 'ImmutablePrototype' in extended_attributes + +- wrapper_class_id = ('NodeClassId' if inherits_interface(interface.name, 'Node') else 'ObjectClassId') ++ wrapper_class_id = ('kNodeClassId' if inherits_interface(interface.name, 'Node') else 'kObjectClassId') + + # [ActiveScriptWrappable] must be accompanied with [DependentLifetime]. + if active_scriptwrappable and not is_dependent_lifetime: +@@ -250,7 +250,7 @@ def interface_context(interface, interfaces): + 'is_node': inherits_interface(interface.name, 'Node'), + 'is_partial': interface.is_partial, + 'is_typed_array_type': is_typed_array_type, +- 'lifetime': 'Dependent' if is_dependent_lifetime else 'Independent', ++ 'lifetime': 'kDependent' if is_dependent_lifetime else 'kIndependent', + 'measure_as': v8_utilities.measure_as(interface, None), # [MeasureAs] + 'needs_runtime_enabled_installer': needs_runtime_enabled_installer, + 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_function_name(interface), +@@ -551,7 +551,7 @@ def methods_context(interface): + implemented_as=implemented_as) + + if not interface.has_indexed_elements: +- iterator_method = generated_iterator_method('iterator', implemented_as='iterator') ++ iterator_method = generated_iterator_method('iterator', implemented_as='GetIterator') + + if interface.iterable or interface.maplike or interface.setlike: + non_overridable_methods = [] +@@ -1037,7 +1037,7 @@ def resolution_tests_methods(effective_overloads): + try: + method = next(method for idl_type, method in idl_types_methods + if idl_type.is_nullable) +- test = 'isUndefinedOrNull(%s)' % cpp_value ++ test = 'IsUndefinedOrNull(%s)' % cpp_value + yield test, method + except StopIteration: + pass +@@ -1286,11 +1286,11 @@ def property_getter(getter, cpp_arguments): + if idl_type.use_output_parameter_for_result: + return 'result.isNull()' + if idl_type.is_string_type: +- return 'result.isNull()' ++ return 'result.IsNull()' + if idl_type.is_interface_type: + return '!result' + if idl_type.base_type in ('any', 'object'): +- return 'result.isEmpty()' ++ return 'result.IsEmpty()' + return '' + + extended_attributes = getter.extended_attributes +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_methods.py b/third_party/WebKit/Source/bindings/scripts/v8_methods.py +index 81263b8df8ab..97f74ac844e0 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_methods.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_methods.py +@@ -322,9 +322,9 @@ def cpp_value(interface, method, number_of_arguments): + cpp_arguments.append('result') + + if method.name == 'Constructor': +- base_name = 'create' ++ base_name = 'Create' + elif method.name == 'NamedConstructor': +- base_name = 'createForJSConstructor' ++ base_name = 'CreateForJSConstructor' + else: + base_name = v8_utilities.cpp_name(method) + +@@ -343,7 +343,7 @@ def v8_set_return_value(interface_name, method, cpp_value, for_main_world=False) + if use_local_result(method): + if idl_type.is_explicit_nullable: + # result is of type Nullable<T> +- cpp_value = 'result.get()' ++ cpp_value = 'result.Get()' + else: + cpp_value = 'result' + +@@ -362,8 +362,8 @@ def v8_value_to_local_cpp_variadic_value(method, argument, index, return_promise + vector_type = 'Vector' + + return { +- 'assign_expression': 'toImplArguments<%s<%s>>(info, %s, exceptionState)' % (vector_type, this_cpp_type, index), +- 'check_expression': 'exceptionState.hadException()', ++ 'assign_expression': 'ToImplArguments<%s<%s>>(info, %s, exceptionState)' % (vector_type, this_cpp_type, index), ++ 'check_expression': 'exceptionState.HadException()', + 'cpp_type': this_cpp_type, + 'cpp_name': argument.name, + 'declare_variable': False, +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py +index 8bbe2763d317..6c14c4bbfa97 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_types.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py +@@ -149,11 +149,11 @@ def cpp_type(idl_type, extended_attributes=None, raw_type=False, used_as_rvalue_ + """ + def string_mode(): + if idl_type.is_nullable: +- return 'TreatNullAndUndefinedAsNullString' ++ return 'kTreatNullAndUndefinedAsNullString' + if extended_attributes.get('TreatNullAs') == 'EmptyString': +- return 'TreatNullAsEmptyString' ++ return 'kTreatNullAsEmptyString' + if extended_attributes.get('TreatNullAs') == 'NullString': +- return 'TreatNullAsNullString' ++ return 'kTreatNullAsNullString' + return '' + + extended_attributes = extended_attributes or {} +@@ -506,12 +506,12 @@ V8_VALUE_TO_CPP_VALUE = { + # Basic + 'DOMString': '{v8_value}', + # Interface types +- 'FlexibleArrayBufferView': 'toFlexibleArrayBufferView({isolate}, {v8_value}, {variable_name}, allocateFlexibleArrayBufferViewStorage({v8_value}))', +- 'NodeFilter': 'toNodeFilter({v8_value}, info.Holder(), ScriptState::current({isolate}))', +- 'Promise': 'ScriptPromise::cast(ScriptState::current({isolate}), {v8_value})', +- 'ScriptValue': 'ScriptValue(ScriptState::current({isolate}), {v8_value})', +- 'Window': 'toDOMWindow({isolate}, {v8_value})', +- 'XPathNSResolver': 'toXPathNSResolver(ScriptState::current({isolate}), {v8_value})', ++ 'FlexibleArrayBufferView': 'ToFlexibleArrayBufferView({isolate}, {v8_value}, {variable_name}, allocateFlexibleArrayBufferViewStorage({v8_value}))', ++ 'NodeFilter': 'ToNodeFilter({v8_value}, info.Holder(), ScriptState::Current({isolate}))', ++ 'Promise': 'ScriptPromise::Cast(ScriptState::Current({isolate}), {v8_value})', ++ 'ScriptValue': 'ScriptValue(ScriptState::Current({isolate}), {v8_value})', ++ 'Window': 'ToDOMWindow({isolate}, {v8_value})', ++ 'XPathNSResolver': 'ToXPathNSResolver(ScriptState::Current({isolate}), {v8_value})', + } + + +@@ -584,11 +584,11 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name + base_idl_type = 'FlexibleArrayBufferView' + + if idl_type.is_integer_type: +- configuration = 'NormalConversion' ++ configuration = 'kNormalConversion' + if 'EnforceRange' in extended_attributes: +- configuration = 'EnforceRange' ++ configuration = 'kEnforceRange' + elif 'Clamp' in extended_attributes: +- configuration = 'Clamp' ++ configuration = 'kClamp' + arguments = ', '.join([v8_value, 'exceptionState', configuration]) + elif idl_type.v8_conversion_needs_exception_state: + arguments = ', '.join([v8_value, 'exceptionState']) +@@ -602,19 +602,20 @@ def v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name + '{v8_value}->Is{idl_type}() ? ' + 'V8{idl_type}::toImpl(v8::Local<v8::{idl_type}>::Cast({v8_value})) : 0') + elif idl_type.is_union_type: +- nullable = 'UnionTypeConversionMode::Nullable' if idl_type.includes_nullable_type else 'UnionTypeConversionMode::NotNullable' ++ nullable = 'UnionTypeConversionMode::kNullable' if idl_type.includes_nullable_type \ ++ else 'UnionTypeConversionMode::kNotNullable' + cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, {variable_name}, %s, exceptionState)' % nullable + elif idl_type.use_output_parameter_for_result: + cpp_expression_format = 'V8{idl_type}::toImpl({isolate}, {v8_value}, {variable_name}, exceptionState)' + elif idl_type.is_callback_function: + cpp_expression_format = ( +- '{idl_type}::create(ScriptState::current({isolate}), {v8_value})') ++ '{idl_type}::Create(ScriptState::Current({isolate}), {v8_value})') + elif idl_type.v8_conversion_needs_exception_state: + # Effectively, this if branch means everything with v8_conversion_needs_exception_state == True + # except for unions, sequences and dictionary interfaces. + base_idl_type = native_value_traits_type_name(idl_type) + cpp_expression_format = ( +- 'NativeValueTraits<{idl_type}>::nativeValue({isolate}, {arguments})') ++ 'NativeValueTraits<{idl_type}>::NativeValue({isolate}, {arguments})') + else: + cpp_expression_format = ( + 'V8{idl_type}::toImplWithTypeCheck({isolate}, {v8_value})') +@@ -632,7 +633,7 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, + if (native_array_element_type.is_interface_type and + native_array_element_type.name != 'Dictionary'): + this_cpp_type = None +- expression_format = 'toMemberNativeArray<{native_array_element_type}>({v8_value}, {index}, {isolate}, exceptionState)' ++ expression_format = 'ToMemberNativeArray<{native_array_element_type}>({v8_value}, {index}, {isolate}, exceptionState)' + else: + this_cpp_type = native_array_element_type.cpp_type + if native_array_element_type.is_dictionary or native_array_element_type.is_union_type: +@@ -641,11 +642,11 @@ def v8_value_to_cpp_value_array_or_sequence(native_array_element_type, v8_value, + vector_type = 'Vector' + if native_array_element_type.is_primitive_type: + value_type = native_value_traits_type_name(native_array_element_type) +- expression_format = ('toImplArray<%s<{cpp_type}>, %s>' ++ expression_format = ('ToImplArray<%s<{cpp_type}>, %s>' + '({v8_value}, {index}, {isolate}, ' + 'exceptionState)' % (vector_type, value_type)) + else: +- expression_format = ('toImplArray<%s<{cpp_type}>>' ++ expression_format = ('ToImplArray<%s<{cpp_type}>>' + '({v8_value}, {index}, {isolate}, ' + 'exceptionState)' % vector_type) + +@@ -677,7 +678,7 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl + if idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state: + # Types for which conversion can fail and that need error handling. + +- check_expression = 'exceptionState.hadException()' ++ check_expression = 'exceptionState.HadException()' + + if idl_type.is_dictionary or idl_type.is_union_type: + set_expression = cpp_value +@@ -689,9 +690,9 @@ def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variabl + # as the condition here would be wrong. + if not idl_type.v8_conversion_needs_exception_state: + if use_exception_state: +- check_expression = '!%s.prepare(exceptionState)' % variable_name ++ check_expression = '!%s.Prepare(exceptionState)' % variable_name + else: +- check_expression = '!%s.prepare()' % variable_name ++ check_expression = '!%s.Prepare()' % variable_name + elif not idl_type.v8_conversion_is_trivial and not idl_type.is_callback_function: + return { + 'error_message': 'no V8 -> C++ conversion for IDL type: %s' % idl_type.name +@@ -767,8 +768,8 @@ def preprocess_idl_type_and_value(idl_type, cpp_value, extended_attributes): + extended_attributes = extended_attributes or {} + if ('Reflect' in extended_attributes and + idl_type.base_type in ['unsigned long', 'unsigned short']): +- cpp_value = cpp_value.replace('getUnsignedIntegralAttribute', +- 'getIntegralAttribute') ++ cpp_value = cpp_value.replace('GetUnsignedIntegralAttribute', ++ 'GetIntegralAttribute') + cpp_value = 'std::max(0, static_cast<int>(%s))' % cpp_value + return idl_type, cpp_value + +@@ -777,7 +778,7 @@ def v8_conversion_type(idl_type, extended_attributes): + """Returns V8 conversion type, adding any additional includes. + + The V8 conversion type is used to select the C++ -> V8 conversion function +- or v8SetReturnValue* function; it can be an idl_type, a cpp_type, or a ++ or V8SetReturnValue* function; it can be an idl_type, a cpp_type, or a + separate name for the type of conversion (e.g., 'DOMWrapper'). + """ + extended_attributes = extended_attributes or {} +@@ -815,7 +816,7 @@ def v8_conversion_type(idl_type, extended_attributes): + return 'Dictionary' + + # Data type with potential additional includes +- if base_idl_type in V8_SET_RETURN_VALUE: # Special v8SetReturnValue treatment ++ if base_idl_type in V8_SET_RETURN_VALUE: # Special V8SetReturnValue treatment + return base_idl_type + + # Pointer type +@@ -825,40 +826,40 @@ IdlTypeBase.v8_conversion_type = v8_conversion_type + + + V8_SET_RETURN_VALUE = { +- 'boolean': 'v8SetReturnValueBool(info, {cpp_value})', +- 'DOMString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())', +- 'ByteString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())', +- 'USVString': 'v8SetReturnValueString(info, {cpp_value}, info.GetIsolate())', +- 'StringOrNull': 'v8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())', ++ 'boolean': 'V8SetReturnValueBool(info, {cpp_value})', ++ 'DOMString': 'V8SetReturnValueString(info, {cpp_value}, info.GetIsolate())', ++ 'ByteString': 'V8SetReturnValueString(info, {cpp_value}, info.GetIsolate())', ++ 'USVString': 'V8SetReturnValueString(info, {cpp_value}, info.GetIsolate())', ++ 'StringOrNull': 'V8SetReturnValueStringOrNull(info, {cpp_value}, info.GetIsolate())', + 'void': '', +- # All the int types below are converted to (u)int32_t in the v8SetReturnValue{Int,Unsigned}() calls. ++ # All the int types below are converted to (u)int32_t in the V8SetReturnValue{Int,Unsigned}() calls. + # The 64-bit int types have already been converted to double when V8_SET_RETURN_VALUE is used, so they are not + # listed here. +- 'int8_t': 'v8SetReturnValueInt(info, {cpp_value})', +- 'int16_t': 'v8SetReturnValueInt(info, {cpp_value})', +- 'int32_t': 'v8SetReturnValueInt(info, {cpp_value})', +- 'uint8_t': 'v8SetReturnValueUnsigned(info, {cpp_value})', +- 'uint16_t': 'v8SetReturnValueUnsigned(info, {cpp_value})', +- 'uint32_t': 'v8SetReturnValueUnsigned(info, {cpp_value})', +- # No special v8SetReturnValue* function (set value directly) +- 'float': 'v8SetReturnValue(info, {cpp_value})', +- 'unrestricted float': 'v8SetReturnValue(info, {cpp_value})', +- 'double': 'v8SetReturnValue(info, {cpp_value})', +- 'unrestricted double': 'v8SetReturnValue(info, {cpp_value})', +- # No special v8SetReturnValue* function, but instead convert value to V8 +- # and then use general v8SetReturnValue. +- 'array': 'v8SetReturnValue(info, {cpp_value})', +- 'FrozenArray': 'v8SetReturnValue(info, {cpp_value})', +- 'Date': 'v8SetReturnValue(info, {cpp_value})', +- 'EventHandler': 'v8SetReturnValue(info, {cpp_value})', +- 'ScriptValue': 'v8SetReturnValue(info, {cpp_value})', +- 'SerializedScriptValue': 'v8SetReturnValue(info, {cpp_value})', ++ 'int8_t': 'V8SetReturnValueInt(info, {cpp_value})', ++ 'int16_t': 'V8SetReturnValueInt(info, {cpp_value})', ++ 'int32_t': 'V8SetReturnValueInt(info, {cpp_value})', ++ 'uint8_t': 'V8SetReturnValueUnsigned(info, {cpp_value})', ++ 'uint16_t': 'V8SetReturnValueUnsigned(info, {cpp_value})', ++ 'uint32_t': 'V8SetReturnValueUnsigned(info, {cpp_value})', ++ # No special V8SetReturnValue* function (set value directly) ++ 'float': 'V8SetReturnValue(info, {cpp_value})', ++ 'unrestricted float': 'V8SetReturnValue(info, {cpp_value})', ++ 'double': 'V8SetReturnValue(info, {cpp_value})', ++ 'unrestricted double': 'V8SetReturnValue(info, {cpp_value})', ++ # No special V8SetReturnValue* function, but instead convert value to V8 ++ # and then use general V8SetReturnValue. ++ 'array': 'V8SetReturnValue(info, {cpp_value})', ++ 'FrozenArray': 'V8SetReturnValue(info, {cpp_value})', ++ 'Date': 'V8SetReturnValue(info, {cpp_value})', ++ 'EventHandler': 'V8SetReturnValue(info, {cpp_value})', ++ 'ScriptValue': 'V8SetReturnValue(info, {cpp_value})', ++ 'SerializedScriptValue': 'V8SetReturnValue(info, {cpp_value})', + # Records. +- 'Record': 'v8SetReturnValue(info, ToV8({cpp_value}, info.Holder(), info.GetIsolate()))', ++ 'Record': 'V8SetReturnValue(info, ToV8({cpp_value}, info.Holder(), info.GetIsolate()))', + # DOMWrapper +- 'DOMWrapperForMainWorld': 'v8SetReturnValueForMainWorld(info, {cpp_value})', +- 'DOMWrapperFast': 'v8SetReturnValueFast(info, {cpp_value}, {script_wrappable})', +- 'DOMWrapperDefault': 'v8SetReturnValue(info, {cpp_value})', ++ 'DOMWrapperForMainWorld': 'V8SetReturnValueForMainWorld(info, {cpp_value})', ++ 'DOMWrapperFast': 'V8SetReturnValueFast(info, {cpp_value}, {script_wrappable})', ++ 'DOMWrapperDefault': 'V8SetReturnValue(info, {cpp_value})', + # If [CheckSecurity=ReturnValue] is specified, the returned object must be + # wrapped in its own realm, which can be different from the realm of the + # receiver object. +@@ -871,23 +872,23 @@ V8_SET_RETURN_VALUE = { + # need to pass |creationContext| in for ToV8(DOMWindow*). + # Window.frameElement is implemented with [Custom]. + 'DOMWrapperAcrossContext': ( +- 'v8SetReturnValue(info, ToV8({cpp_value}, ' + ++ 'V8SetReturnValue(info, ToV8({cpp_value}, ' + + 'ToV8(impl->contentWindow(), v8::Local<v8::Object>(), ' + + 'info.GetIsolate()).As<v8::Object>(), info.GetIsolate()))'), + # Note that static attributes and operations do not check whether |this| is + # an instance of the interface nor |this|'s creation context is the same as + # the current context. So we must always use the current context as the + # creation context of the DOM wrapper for the return value. +- 'DOMWrapperStatic': 'v8SetReturnValue(info, {cpp_value}, info.GetIsolate()->GetCurrentContext()->Global())', ++ 'DOMWrapperStatic': 'V8SetReturnValue(info, {cpp_value}, info.GetIsolate()->GetCurrentContext()->Global())', + # Generic dictionary type +- 'Dictionary': 'v8SetReturnValue(info, {cpp_value})', ++ 'Dictionary': 'V8SetReturnValue(info, {cpp_value})', + 'DictionaryStatic': '#error not implemented yet', + # Nullable dictionaries +- 'NullableDictionary': 'v8SetReturnValue(info, result.get())', +- 'NullableDictionaryStatic': 'v8SetReturnValue(info, result.get(), info.GetIsolate()->GetCurrentContext()->Global())', ++ 'NullableDictionary': 'V8SetReturnValue(info, result.Get())', ++ 'NullableDictionaryStatic': 'V8SetReturnValue(info, result.Get(), info.GetIsolate()->GetCurrentContext()->Global())', + # Union types or dictionaries +- 'DictionaryOrUnion': 'v8SetReturnValue(info, result)', +- 'DictionaryOrUnionStatic': 'v8SetReturnValue(info, result, info.GetIsolate()->GetCurrentContext()->Global())', ++ 'DictionaryOrUnion': 'V8SetReturnValue(info, result)', ++ 'DictionaryOrUnionStatic': 'V8SetReturnValue(info, result, info.GetIsolate()->GetCurrentContext()->Global())', + } + + +@@ -912,7 +913,7 @@ def v8_set_return_value(idl_type, cpp_value, extended_attributes=None, script_wr + this_v8_conversion_type = idl_type.v8_conversion_type(extended_attributes) + # SetReturn-specific overrides + if this_v8_conversion_type in ['Date', 'EventHandler', 'ScriptValue', 'SerializedScriptValue', 'array', 'FrozenArray']: +- # Convert value to V8 and then use general v8SetReturnValue ++ # Convert value to V8 and then use general V8SetReturnValue + cpp_value = idl_type.cpp_value_to_v8_value(cpp_value, extended_attributes=extended_attributes) + if this_v8_conversion_type == 'DOMWrapper': + this_v8_conversion_type = dom_wrapper_conversion_type() +@@ -929,11 +930,11 @@ IdlTypeBase.v8_set_return_value = v8_set_return_value + + CPP_VALUE_TO_V8_VALUE = { + # Built-in types +- 'Date': 'v8DateOrNaN({isolate}, {cpp_value})', +- 'DOMString': 'v8String({isolate}, {cpp_value})', +- 'ByteString': 'v8String({isolate}, {cpp_value})', +- 'USVString': 'v8String({isolate}, {cpp_value})', +- 'boolean': 'v8Boolean({cpp_value}, {isolate})', ++ 'Date': 'V8DateOrNaN({isolate}, {cpp_value})', ++ 'DOMString': 'V8String({isolate}, {cpp_value})', ++ 'ByteString': 'V8String({isolate}, {cpp_value})', ++ 'USVString': 'V8String({isolate}, {cpp_value})', ++ 'boolean': 'V8Boolean({cpp_value}, {isolate})', + # All the int types below are converted to (u)int32_t in the v8::Integer::New*() calls. + # The 64-bit int types have already been converted to double when CPP_VALUE_TO_V8_VALUE is used, so they are not + # listed here. +@@ -948,20 +949,20 @@ CPP_VALUE_TO_V8_VALUE = { + 'double': 'v8::Number::New({isolate}, {cpp_value})', + 'unrestricted double': 'v8::Number::New({isolate}, {cpp_value})', + 'void': 'v8Undefined()', +- 'StringOrNull': '{cpp_value}.isNull() ? v8::Local<v8::Value>(v8::Null({isolate})) : v8String({isolate}, {cpp_value})', ++ 'StringOrNull': '{cpp_value}.IsNull() ? v8::Local<v8::Value>(v8::Null({isolate})) : V8String({isolate}, {cpp_value})', + # Special cases +- 'Dictionary': '{cpp_value}.v8Value()', ++ 'Dictionary': '{cpp_value}.V8Value()', + 'EventHandler': ( + '{cpp_value} ? ' + +- 'V8AbstractEventListener::cast({cpp_value})->getListenerOrNull(' + +- '{isolate}, impl->getExecutionContext()) : ' + ++ 'V8AbstractEventListener::Cast({cpp_value})->GetListenerOrNull(' + ++ '{isolate}, impl->GetExecutionContext()) : ' + + 'v8::Null({isolate}).As<v8::Value>()'), + 'Record': 'ToV8({cpp_value}, {creation_context}, {isolate})', +- 'ScriptValue': '{cpp_value}.v8Value()', +- 'SerializedScriptValue': 'v8Deserialize({isolate}, {cpp_value})', ++ 'ScriptValue': '{cpp_value}.V8Value()', ++ 'SerializedScriptValue': 'V8Deserialize({isolate}, {cpp_value})', + # General + 'array': 'ToV8({cpp_value}, {creation_context}, {isolate})', +- 'FrozenArray': 'freezeV8Object(ToV8({cpp_value}, {creation_context}, {isolate}), {isolate})', ++ 'FrozenArray': 'FreezeV8Object(ToV8({cpp_value}, {creation_context}, {isolate}), {isolate})', + 'DOMWrapper': 'ToV8({cpp_value}, {creation_context}, {isolate})', + # Passing nullable dictionaries isn't a pattern currently used + # anywhere in the web platform, and more work would be needed in +@@ -1035,7 +1036,7 @@ IdlArrayOrSequenceType.literal_cpp_value = array_or_sequence_literal_cpp_value + + def cpp_type_has_null_value(idl_type): + # - String types (String/AtomicString) represent null as a null string, +- # i.e. one for which String::isNull() returns true. ++ # i.e. one for which String::IsNull() returns true. + # - Enum types, as they are implemented as Strings. + # - Interface types (raw pointer or RefPtr/PassRefPtr) represent null as + # a null pointer. +diff --git a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py +index dec531fd2a4f..17cb07c104d9 100644 +--- a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py ++++ b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py +@@ -200,8 +200,8 @@ CALL_WITH_ARGUMENTS = { + 'ScriptState': 'scriptState', + 'ExecutionContext': 'executionContext', + 'ScriptArguments': 'scriptArguments', +- 'CurrentWindow': 'currentDOMWindow(info.GetIsolate())', +- 'EnteredWindow': 'enteredDOMWindow(info.GetIsolate())', ++ 'CurrentWindow': 'CurrentDOMWindow(info.GetIsolate())', ++ 'EnteredWindow': 'EnteredDOMWindow(info.GetIsolate())', + 'Document': 'document', + 'ThisValue': 'ScriptValue(scriptState, info.Holder())', + } +@@ -243,16 +243,16 @@ def deprecate_as(member): + + # [Exposed] + EXPOSED_EXECUTION_CONTEXT_METHOD = { +- 'AnimationWorklet': 'isAnimationWorkletGlobalScope', +- 'AudioWorklet': 'isAudioWorkletGlobalScope', +- 'CompositorWorker': 'isCompositorWorkerGlobalScope', +- 'DedicatedWorker': 'isDedicatedWorkerGlobalScope', +- 'PaintWorklet': 'isPaintWorkletGlobalScope', +- 'ServiceWorker': 'isServiceWorkerGlobalScope', +- 'SharedWorker': 'isSharedWorkerGlobalScope', +- 'Window': 'isDocument', +- 'Worker': 'isWorkerGlobalScope', +- 'Worklet': 'isWorkletGlobalScope', ++ 'AnimationWorklet': 'IsAnimationWorkletGlobalScope', ++ 'AudioWorklet': 'IsAudioWorkletGlobalScope', ++ 'CompositorWorker': 'IsCompositorWorkerGlobalScope', ++ 'DedicatedWorker': 'IsDedicatedWorkerGlobalScope', ++ 'PaintWorklet': 'IsPaintWorkletGlobalScope', ++ 'ServiceWorker': 'IsServiceWorkerGlobalScope', ++ 'SharedWorker': 'IsSharedWorkerGlobalScope', ++ 'Window': 'IsDocument', ++ 'Worker': 'IsWorkerGlobalScope', ++ 'Worklet': 'IsWorkletGlobalScope', + } + + +@@ -344,7 +344,7 @@ def secure_context(member, interface): + """Returns C++ code that checks whether an interface/method/attribute/etc. is exposed + to the current context.""" + if 'SecureContext' in member.extended_attributes or 'SecureContext' in interface.extended_attributes: +- return "executionContext->isSecureContext()" ++ return "executionContext->IsSecureContext()" + return None + + +@@ -478,9 +478,9 @@ def on_instance(interface, member): + if member.is_static: + return False + +- # TODO(yukishiino): Remove a hack for toString once we support +- # Symbol.toStringTag. +- if (interface.name == 'Window' and member.name == 'toString'): ++ # TODO(yukishiino): Remove a hack for ToString once we support ++ # Symbol.ToStringTag. ++ if interface.name == 'Window' and member.name == 'ToString': + return False + + # TODO(yukishiino): Implement "interface object" and its [[Call]] method +@@ -624,7 +624,7 @@ def named_property_getter(interface): + if ('getter' in method.specials and + len(method.arguments) == 1 and + str(method.arguments[0].idl_type) == 'DOMString')) +- getter.name = getter.name or 'anonymousNamedGetter' ++ getter.name = getter.name or 'AnonymousNamedGetter' + return getter + except StopIteration: + return None +diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl +index a43b7d2bd2fc..87ee2a8f6f49 100644 +--- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl +@@ -10,7 +10,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {%- endif %}) { + {% filter format_remove_duplicates(['ExceptionState exceptionState']) %} + {% set define_exception_state -%} +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "{{interface_name}}", "{{attribute.name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", "{{attribute.name}}"); + {%- endset %} + + {% if attribute.is_lenient_this %} +@@ -28,15 +28,15 @@ const v8::FunctionCallbackInfo<v8::Value>& info + // [SaveSameObject] + {% set same_object_private_key = interface_name + attribute.name[0]|capitalize + attribute.name[1:] %} + // If you see a compile error that +- // V8PrivateProperty::getSameObject{{same_object_private_key}} ++ // V8PrivateProperty::GetSameObject{{same_object_private_key}} + // is not defined, then you need to register your attribute at + // V8_PRIVATE_PROPERTY_FOR_EACH defined in V8PrivateProperty.h as + // X(SameObject, {{same_object_private_key}}) +- auto privateSameObject = V8PrivateProperty::getSameObject{{same_object_private_key}}(info.GetIsolate()); ++ auto privateSameObject = V8PrivateProperty::GetSameObject{{same_object_private_key}}(info.GetIsolate()); + { +- v8::Local<v8::Value> v8Value = privateSameObject.getOrEmpty(holder); ++ v8::Local<v8::Value> v8Value = privateSameObject.GetOrEmpty(holder); + if (!v8Value.IsEmpty()) { +- v8SetReturnValue(info, v8Value); ++ V8SetReturnValue(info, v8Value); + return; + } + } +@@ -51,7 +51,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info + // Same-origin attribute getters are never exposed via the cross-origin + // interceptors. Since same-origin access requires a LocalDOMWindow, it is + // safe to downcast here. +- LocalDOMWindow* impl = toLocalDOMWindow({{v8_class}}::toImpl(holder)); ++ LocalDOMWindow* impl = ToLocalDOMWindow({{v8_class}}::toImpl(holder)); + {% endif %}{# attribute.is_check_security_for_receiver #} + {% else %} + {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); +@@ -61,12 +61,12 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% if attribute.cached_attribute_validation_method %} + // [CachedAttribute] + V8PrivateProperty::Symbol propertySymbol = +- V8PrivateProperty::getSymbol(info.GetIsolate(), ++ V8PrivateProperty::GetSymbol(info.GetIsolate(), + "{{cpp_class}}#{{attribute.name.capitalize()}}"); + if (!impl->{{attribute.cached_attribute_validation_method}}()) { +- v8::Local<v8::Value> v8Value = propertySymbol.getOrUndefined(holder); ++ v8::Local<v8::Value> v8Value = propertySymbol.GetOrUndefined(holder); + if (!v8Value->IsUndefined()) { +- v8SetReturnValue(info, v8Value); ++ V8SetReturnValue(info, v8Value); + return; + } + } +@@ -76,35 +76,35 @@ const v8::FunctionCallbackInfo<v8::Value>& info + // Perform a security check for the receiver object. + {{define_exception_state}} + {% if local_dom_window_only %} +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), uncheckedImpl, exceptionState)) { ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), uncheckedImpl, exceptionState)) { + {% else %} +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) { ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), impl, exceptionState)) { + {% endif %}{# local_dom_window_only #} +- v8SetReturnValueNull(info); ++ V8SetReturnValueNull(info); + return; + } + {% if local_dom_window_only %} +- LocalDOMWindow* impl = toLocalDOMWindow(uncheckedImpl); ++ LocalDOMWindow* impl = ToLocalDOMWindow(uncheckedImpl); + {% endif %}{# local_dom_window_only #} + {% endif %} + + {% if attribute.is_check_security_for_return_value %} + // Perform a security check for the returned object. + {{define_exception_state}} +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), {{attribute.cpp_value}}, exceptionState)) { +- v8SetReturnValueNull(info); ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), {{attribute.cpp_value}}, exceptionState)) { ++ V8SetReturnValueNull(info); + return; + } + {% endif %} + + {% if attribute.is_call_with_execution_context %} +- ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); ++ ExecutionContext* executionContext = CurrentExecutionContext(info.GetIsolate()); + {% endif %} + {% if attribute.is_call_with_script_state %} + {% if attribute.is_static %} +- ScriptState* scriptState = ScriptState::forFunctionObject(info); ++ ScriptState* scriptState = ScriptState::ForFunctionObject(info); + {% else %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + {% endif %} + {% if attribute.is_getter_raises_exception %} +@@ -124,7 +124,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% endif %} + + {% if attribute.is_getter_raises_exception %} +- if (UNLIKELY(exceptionState.hadException())) ++ if (UNLIKELY(exceptionState.HadException())) + return; + {% endif %} + +@@ -138,12 +138,12 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% if attribute.cached_attribute_validation_method %} + // [CachedAttribute] + v8::Local<v8::Value> v8Value({{attribute.cpp_value_to_v8_value}}); +- propertySymbol.set(holder, v8Value); ++ propertySymbol.Set(holder, v8Value); + {% endif %} + + {% if attribute.is_explicit_nullable %} + if (isNull) { +- v8SetReturnValueNull(info); ++ V8SetReturnValueNull(info); + return; + } + {% endif %} +@@ -151,12 +151,12 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% if attribute.is_keep_alive_for_gc %} + // Keep the wrapper object for the return value alive as long as |this| + // object is alive in order to save creation time of the wrapper object. +- if ({{attribute.cpp_value}} && DOMDataStore::setReturnValue{{world_suffix}}(info.GetReturnValue(), {{attribute.cpp_value}})) ++ if ({{attribute.cpp_value}} && DOMDataStore::SetReturnValue{{world_suffix}}(info.GetReturnValue(), {{attribute.cpp_value}})) + return; + v8::Local<v8::Value> v8Value(ToV8({{attribute.cpp_value}}, holder, info.GetIsolate())); +- V8PrivateProperty::getSymbol( ++ V8PrivateProperty::GetSymbol( + info.GetIsolate(), "KeepAlive#{{interface_name}}#{{attribute.name}}") +- .set(holder, v8Value); ++ .Set(holder, v8Value); + {% endif %} + + {% if world_suffix %} +@@ -167,7 +167,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info + + {% if attribute.is_save_same_object %} + // [SaveSameObject] +- privateSameObject.set(holder, info.GetReturnValue().Get()); ++ privateSameObject.Set(holder, info.GetReturnValue().Get()); + {% endif %} + {% endfilter %}{# format_remove_duplicates #} + } +@@ -181,16 +181,16 @@ const v8::FunctionCallbackInfo<v8::Value>& info + one of those. If not, set it to the empty string. + http://www.whatwg.org/specs/web-apps/current-work/#limited-to-only-known-values #} + {% if reflect_empty %} +-if ({{cpp_value}}.isNull()) { ++if ({{cpp_value}}.IsNull()) { + {% if reflect_missing %} + {{cpp_value}} = "{{reflect_missing}}"; + {% else %} + ; + {% endif %} +-} else if ({{cpp_value}}.isEmpty()) { ++} else if ({{cpp_value}}.IsEmpty()) { + {{cpp_value}} = "{{reflect_empty}}"; + {% else %} +-if ({{cpp_value}}.isEmpty()) { ++if ({{cpp_value}}.IsEmpty()) { + {# FIXME: should use [ReflectEmpty] instead; need to change IDL files #} + {% if reflect_missing %} + {{cpp_value}} = "{{reflect_missing}}"; +@@ -199,7 +199,7 @@ if ({{cpp_value}}.isEmpty()) { + {% endif %} + {% endif %} + {% for value in reflect_only_values %} +-} else if (equalIgnoringASCIICase({{cpp_value}}, "{{value}}")) { ++} else if (EqualIgnoringASCIICase({{cpp_value}}, "{{value}}")) { + {{cpp_value}} = "{{value}}"; + {% endfor %} + } else { +@@ -217,26 +217,26 @@ v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info + const v8::FunctionCallbackInfo<v8::Value>& info + {%- endif %}) { + {% if attribute.deprecate_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{attribute.deprecate_as}}); + {% endif %} + + {% if attribute.measure_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{attribute.measure_as('AttributeGetter')}}); + {% endif %} + + {% if world_suffix in attribute.activity_logging_world_list_for_getter %} + {% if attribute.is_static %} +- ScriptState* scriptState = ScriptState::forFunctionObject(info); ++ ScriptState* scriptState = ScriptState::ForFunctionObject(info); + {% else %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} +- V8PerContextData* contextData = scriptState->perContextData(); ++ V8PerContextData* contextData = scriptState->PerContextData(); + if ( + {%- if attribute.activity_logging_world_check -%} +- scriptState->world().isIsolatedWorld() && {# one space at the end #} ++ scriptState->World().IsIsolatedWorld() && {# one space at the end #} + {%- endif -%} +- contextData && contextData->activityLogger()) { +- contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute.name}}"); ++ contextData && contextData->ActivityLogger()) { ++ contextData->ActivityLogger()->LogGetter("{{interface_name}}.{{attribute.name}}"); + } + {% endif %} + +@@ -253,7 +253,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% macro attribute_cached_property_key(attribute) %} + v8::Local<v8::Private> {{v8_class_or_partial}}::{{attribute.name}}CachedPropertyKey(v8::Isolate* isolate) + { +- return V8PrivateProperty::get{{attribute.cached_accessor_name}}(isolate).getPrivate(); ++ return V8PrivateProperty::Get{{attribute.cached_accessor_name}}(isolate).GetPrivate(); + } + {% endmacro %} + +@@ -262,14 +262,14 @@ v8::Local<v8::Private> {{v8_class_or_partial}}::{{attribute.name}}CachedProperty + {% macro constructor_getter_callback(attribute, world_suffix) %} + void {{v8_class_or_partial}}::{{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) { + {% if attribute.deprecate_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{attribute.deprecate_as}}); + {% endif %} + + {% if attribute.measure_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{attribute.measure_as('ConstructorGetter')}}); + {% endif %} + +- v8ConstructorAttributeGetter(property, info); ++ V8ConstructorAttributeGetter(property, info); + } + {% endmacro %} + +@@ -289,7 +289,7 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + ALLOW_UNUSED_LOCAL(isolate); + + {% set define_exception_state -%} +- ExceptionState exceptionState(isolate, ExceptionState::SetterContext, "{{interface_name}}", "{{attribute.name}}"); ++ ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "{{interface_name}}", "{{attribute.name}}"); + {%- endset %} + + {% if attribute.is_lenient_this %} +@@ -303,7 +303,7 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + v8::Local<v8::Object> holder = info.Holder(); + {% if attribute.is_put_forwards %} + {{cpp_class}}* proxyImpl = {{v8_class}}::toImpl(holder); +- {{attribute.cpp_type}} impl = WTF::getPtr(proxyImpl->{{attribute.name}}()); ++ {{attribute.cpp_type}} impl = WTF::GetPtr(proxyImpl->{{attribute.name}}()); + if (!impl) + return; + {% else %} +@@ -315,7 +315,7 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + // Same-origin attributes setters are never exposed via the cross-origin + // interceptors. Since same-origin access requires a LocalDOMWindow, it is + // safe to downcast here. +- LocalDOMWindow* impl = toLocalDOMWindow({{v8_class}}::toImpl(holder)); ++ LocalDOMWindow* impl = ToLocalDOMWindow({{v8_class}}::toImpl(holder)); + {% endif %}{# attribute.is_check_security_for_receiver #} + {% else %} + {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); +@@ -327,15 +327,15 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + // Perform a security check for the receiver object. + {{define_exception_state}} + {% if local_dom_window_only %} +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(isolate), uncheckedImpl, exceptionState)) { ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(isolate), uncheckedImpl, exceptionState)) { + {% else %} +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(isolate), impl, exceptionState)) { ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(isolate), impl, exceptionState)) { + {% endif %}{# local_dom_window_only #} +- v8SetReturnValue(info, v8Value); ++ V8SetReturnValue(info, v8Value); + return; + } + {% if local_dom_window_only %} +- LocalDOMWindow* impl = toLocalDOMWindow(uncheckedImpl); ++ LocalDOMWindow* impl = ToLocalDOMWindow(uncheckedImpl); + {% endif %}{# local_dom_window_only #} + {% endif %} + +@@ -356,7 +356,7 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + // Prepare the value to be set. + {% if attribute.idl_type == 'EventHandler' %} + {% if not is_node %} +- moveEventListenerToNewWrapper(isolate, holder, {{attribute.event_handler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex); ++ MoveEventListenerToNewWrapper(isolate, holder, {{attribute.event_handler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex); + {% endif %} + {% else %}{# not EventHandler #} + {{v8_value_to_local_cpp_value(attribute) | indent(2)}} +@@ -364,8 +364,8 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + + {% if attribute.has_type_checking_interface %} + // Type check per: http://heycam.github.io/webidl/#es-interface +- if (!cppValue{% if attribute.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) { +- exceptionState.throwTypeError("The provided value is not of type '{{attribute.idl_type}}'."); ++ if (!cppValue{% if attribute.is_nullable %} && !IsUndefinedOrNull(v8Value){% endif %}) { ++ exceptionState.ThrowTypeError("The provided value is not of type '{{attribute.idl_type}}'."); + return; + } + {% endif %} +@@ -375,35 +375,35 @@ v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info + // Returns undefined without setting the value if the value is invalid. + DummyExceptionStateForTesting dummyExceptionState; + {{declare_enum_validation_variable(attribute.enum_values) | indent(2)}} +- if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), "{{attribute.enum_type}}", dummyExceptionState)) { +- currentExecutionContext(isolate)->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, dummyExceptionState.message())); ++ if (!IsValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), "{{attribute.enum_type}}", dummyExceptionState)) { ++ CurrentExecutionContext(isolate)->AddConsoleMessage(ConsoleMessage::Create(kJSMessageSource, kWarningMessageLevel, dummyExceptionState.Message())); + return; + } + {% endif %} + + {% if attribute.is_call_with_execution_context or attribute.is_setter_call_with_execution_context %} +- ExecutionContext* executionContext = currentExecutionContext(isolate); ++ ExecutionContext* executionContext = CurrentExecutionContext(isolate); + {% endif %} + + {% if attribute.is_call_with_script_state %} + {% if attribute.is_static %} +- ScriptState* scriptState = ScriptState::forFunctionObject(info); ++ ScriptState* scriptState = ScriptState::ForFunctionObject(info); + {% else %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + {% endif %} + + {% if attribute.is_replaceable %} +- v8::Local<v8::String> propertyName = v8AtomicString(isolate, "{{attribute.name}}"); ++ v8::Local<v8::String> propertyName = V8AtomicString(isolate, "{{attribute.name}}"); + {% endif %} + {{attribute.cpp_setter}}; + + {% if attribute.cached_attribute_validation_method %} + // [CachedAttribute] + // Invalidate the cached value. +- V8PrivateProperty::getSymbol( ++ V8PrivateProperty::GetSymbol( + isolate, "{{cpp_class}}#{{attribute.name.capitalize()}}") +- .deleteProperty(holder, v8::Undefined(isolate)); ++ .DeleteProperty(holder, v8::Undefined(isolate)); + {% endif %} + } + {% endfilter %}{# format_remove_duplicates #} +@@ -423,26 +423,26 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% endif %} + + {% if attribute.deprecate_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{attribute.deprecate_as}}); + {% endif %} + + {% if attribute.measure_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{attribute.measure_as('AttributeSetter')}}); + {% endif %} + + {% if world_suffix in attribute.activity_logging_world_list_for_setter %} + {% if attribute.is_static %} +- ScriptState* scriptState = ScriptState::forFunctionObject(info); ++ ScriptState* scriptState = ScriptState::ForFunctionObject(info); + {% else %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} +- V8PerContextData* contextData = scriptState->perContextData(); ++ V8PerContextData* contextData = scriptState->PerContextData(); + if ( + {%- if attribute.activity_logging_world_check -%} +- scriptState->world().isIsolatedWorld() && {# one space at the end #} ++ scriptState->World().IsIsolatedWorld() && {# one space at the end #} + {%- endif -%} +- contextData && contextData->activityLogger()) { +- contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute.name}}", v8Value); ++ contextData && contextData->ActivityLogger()) { ++ contextData->ActivityLogger()->LogSetter("{{interface_name}}.{{attribute.name}}", v8Value); + } + {% endif %} + +@@ -473,7 +473,7 @@ const v8::FunctionCallbackInfo<v8::Value>& info + {% set getter_callback = '%s::%sConstructorGetterCallback' % (v8_class_or_partial, attribute.name) %} + {% else %} + {% set getter_callback = 'V8%s::NamedConstructorAttributeGetter' % (attribute.constructor_type) +- if attribute.is_named_constructor else 'v8ConstructorAttributeGetter' %} ++ if attribute.is_named_constructor else 'V8ConstructorAttributeGetter' %} + {% endif %} + {% set setter_callback = 'nullptr' %} + {% else %}{# regular attributes #} +@@ -492,17 +492,17 @@ const v8::FunctionCallbackInfo<v8::Value>& info + '%s::%sCachedPropertyKey' % (v8_class_or_partial, attribute.name) + if attribute.is_cached_accessor else + 'nullptr' %} +-{% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder' +- if attribute.is_lenient_this else 'V8DOMConfiguration::CheckHolder' %} ++{% set holder_check = 'V8DOMConfiguration::kDoNotCheckHolder' ++ if attribute.is_lenient_this else 'V8DOMConfiguration::kCheckHolder' %} + {% if attribute.is_per_world_bindings %} + {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} + {% set setter_callback_for_main_world = + '%sForMainWorld' % setter_callback + if attribute.has_setter else 'nullptr' %} +-{"{{attribute.name}}", {{getter_callback_for_main_world}}, {{setter_callback_for_main_world}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_attribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfiguration::MainWorld}, +-{"{{attribute.name}}", {{getter_callback}}, {{setter_callback}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_attribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfiguration::NonMainWorlds} ++{"{{attribute.name}}", {{getter_callback_for_main_world}}, {{setter_callback_for_main_world}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_attribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfiguration::kMainWorld}, ++{"{{attribute.name}}", {{getter_callback}}, {{setter_callback}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_attribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfiguration::kNonMainWorlds} + {%- else %} +-{"{{attribute.name}}", {{getter_callback}}, {{setter_callback}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_attribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfiguration::AllWorlds} ++{"{{attribute.name}}", {{getter_callback}}, {{setter_callback}}, {{cached_accessor_callback}}, {{wrapper_type_info}}, {{property_attribute}}, {{property_location(attribute)}}, {{holder_check}}, V8DOMConfiguration::kAllWorlds} + {%- endif %} + {%- endmacro %} + +@@ -516,7 +516,7 @@ static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration[] = + {{attribute_configuration(attribute)}} + }; + for (const auto& accessorConfig : accessorConfiguration) +- V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfig); ++ V8DOMConfiguration::InstallAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfig); + {% endfilter %}{# runtime_enabled #} + {% endfilter %}{# secure_context #} + {% endfilter %}{# exposed #} +diff --git a/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl +index 8390f85535d9..16735eb1a9fd 100644 +--- a/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl +@@ -12,43 +12,43 @@ + namespace blink { + + // static +-{{cpp_class}}* {{cpp_class}}::create(ScriptState* scriptState, v8::Local<v8::Value> callback) { +- if (isUndefinedOrNull(callback)) ++{{cpp_class}}* {{cpp_class}}::Create(ScriptState* scriptState, v8::Local<v8::Value> callback) { ++ if (IsUndefinedOrNull(callback)) + return nullptr; + return new {{cpp_class}}(scriptState, v8::Local<v8::Function>::Cast(callback)); + } + + {{cpp_class}}::{{cpp_class}}(ScriptState* scriptState, v8::Local<v8::Function> callback) + : m_scriptState(scriptState), +- m_callback(scriptState->isolate(), this, callback) { +- DCHECK(!m_callback.isEmpty()); ++ m_callback(scriptState->GetIsolate(), this, callback) { ++ DCHECK(!m_callback.IsEmpty()); + } + + DEFINE_TRACE_WRAPPERS({{cpp_class}}) { +- visitor->traceWrappers(m_callback.cast<v8::Value>()); ++ visitor->TraceWrappers(m_callback.Cast<v8::Value>()); + } + + bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { +- if (m_callback.isEmpty()) ++ if (m_callback.IsEmpty()) + return false; + +- if (!m_scriptState->contextIsValid()) ++ if (!m_scriptState->ContextIsValid()) + return false; + +- ExecutionContext* context = m_scriptState->getExecutionContext(); ++ ExecutionContext* context = m_scriptState->GetExecutionContext(); + DCHECK(context); +- if (context->isContextSuspended() || context->isContextDestroyed()) ++ if (context->IsContextSuspended() || context->IsContextDestroyed()) + return false; + + // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK. + // crbug.com/653769 + DummyExceptionStateForTesting exceptionState; +- ScriptState::Scope scope(m_scriptState.get()); +- v8::Isolate* isolate = m_scriptState->isolate(); ++ ScriptState::Scope scope(m_scriptState.Get()); ++ v8::Isolate* isolate = m_scriptState->GetIsolate(); + + v8::Local<v8::Value> thisValue = ToV8( + scriptWrappable, +- m_scriptState->context()->Global(), ++ m_scriptState->GetContext()->Global(), + isolate); + + {% for argument in arguments %} +@@ -64,7 +64,7 @@ bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { + exceptionCatcher.SetVerbose(true); + + v8::Local<v8::Value> v8ReturnValue; +- if (!V8ScriptRunner::callFunction(m_callback.newLocal(isolate), ++ if (!V8ScriptRunner::CallFunction(m_callback.NewLocal(isolate), + context, + thisValue, + {{arguments | length}}, +@@ -80,10 +80,10 @@ bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) { + return true; + } + +-{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { +- {{cpp_class}}* nativeValue = {{cpp_class}}::create(ScriptState::current(isolate), value); ++{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { ++ {{cpp_class}}* nativeValue = {{cpp_class}}::Create(ScriptState::Current(isolate), value); + if (!nativeValue) +- exceptionState.throwTypeError("Unable to convert value to {{callback_function_name}}."); ++ exceptionState.ThrowTypeError("Unable to convert value to {{callback_function_name}}."); + return nativeValue; + } + +diff --git a/third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl b/third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl +index 6528813495e1..745995a5df37 100644 +--- a/third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl +@@ -18,7 +18,7 @@ class {{forward_declaration}}; + + class {{exported}}{{cpp_class}} final : public GarbageCollectedFinalized<{{cpp_class}}>, public TraceWrapperBase { + public: +- static {{cpp_class}}* create(ScriptState*, v8::Local<v8::Value> callback); ++ static {{cpp_class}}* Create(ScriptState*, v8::Local<v8::Value> callback); + + ~{{cpp_class}}() = default; + +@@ -28,7 +28,7 @@ class {{exported}}{{cpp_class}} final : public GarbageCollectedFinalized<{{cpp_c + bool call({{argument_declarations | join(', ')}}); + + v8::Local<v8::Function> v8Value(v8::Isolate* isolate) { +- return m_callback.newLocal(isolate); ++ return m_callback.NewLocal(isolate); + } + + private: +@@ -40,7 +40,7 @@ class {{exported}}{{cpp_class}} final : public GarbageCollectedFinalized<{{cpp_c + + template <> + struct NativeValueTraits<{{cpp_class}}> : public NativeValueTraitsBase<{{cpp_class}}> { +- {{exported}}static {{cpp_class}}* nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); ++ {{exported}}static {{cpp_class}}* NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); + }; + + } // namespace blink +diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl +index 420c27645fe3..e3109b5bdfe5 100644 +--- a/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/callback_interface.cpp.tmpl +@@ -11,29 +11,29 @@ namespace blink { + + {{v8_class}}::{{v8_class}}(v8::Local<v8::Function> callback, ScriptState* scriptState) + : m_scriptState(scriptState) { +- m_callback.set(scriptState->isolate(), callback); ++ m_callback.Set(scriptState->GetIsolate(), callback); + } + + {{v8_class}}::~{{v8_class}}() {} + + DEFINE_TRACE({{v8_class}}) { +- {{cpp_class}}::trace(visitor); ++ {{cpp_class}}::Trace(visitor); + } + + {% for method in methods if not method.is_custom %} + {{method.cpp_type}} {{v8_class}}::{{method.name}}({{method.argument_declarations | join(', ')}}) { + {% set return_default = 'return true' + if method.idl_type == 'boolean' else 'return' %}{# void #} +- ExecutionContext* executionContext = m_scriptState->getExecutionContext(); +- if (!executionContext || executionContext->isContextSuspended() || +- executionContext->isContextDestroyed()) ++ ExecutionContext* executionContext = m_scriptState->GetExecutionContext(); ++ if (!executionContext || executionContext->IsContextSuspended() || ++ executionContext->IsContextDestroyed()) + {{return_default}}; +- if (!m_scriptState->contextIsValid()) ++ if (!m_scriptState->ContextIsValid()) + {{return_default}}; + +- ScriptState::Scope scope(m_scriptState.get()); ++ ScriptState::Scope scope(m_scriptState.Get()); + {% if method.call_with_this_handle %} +- v8::Local<v8::Value> thisHandle = thisValue.v8Value(); ++ v8::Local<v8::Value> thisHandle = thisValue.V8Value(); + {% endif %} + + {% for argument in method.arguments %} +@@ -46,13 +46,13 @@ DEFINE_TRACE({{v8_class}}) { + v8::Local<v8::Value> *argv = 0; + {% endif %} + +- v8::Isolate* isolate = m_scriptState->isolate(); ++ v8::Isolate* isolate = m_scriptState->GetIsolate(); + {% set this_handle_parameter = 'thisHandle' + if method.call_with_this_handle else 'v8::Undefined(isolate)' %} + {% if method.idl_type == 'boolean' %} + v8::TryCatch exceptionCatcher(isolate); + exceptionCatcher.SetVerbose(true); +- V8ScriptRunner::callFunction(m_callback.newLocal(isolate), ++ V8ScriptRunner::CallFunction(m_callback.NewLocal(isolate), + executionContext, + {{this_handle_parameter}}, + {{method.arguments | length}}, +@@ -60,8 +60,8 @@ DEFINE_TRACE({{v8_class}}) { + isolate); + return !exceptionCatcher.HasCaught(); + {% else %}{# void #} +- V8ScriptRunner::callFunction(m_callback.newLocal(isolate), +- m_scriptState->getExecutionContext(), ++ V8ScriptRunner::CallFunction(m_callback.NewLocal(isolate), ++ m_scriptState->GetExecutionContext(), + {{this_handle_parameter}}, + {{method.arguments | length}}, + argv, +diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl b/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl +index e8d141217241..a38934ce1fe8 100644 +--- a/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl +@@ -12,7 +12,7 @@ namespace blink { + + class {{v8_class}} final : public {{cpp_class}} { + public: +- static {{v8_class}}* create(v8::Local<v8::Function> callback, ScriptState* scriptState) { ++ static {{v8_class}}* Create(v8::Local<v8::Function> callback, ScriptState* scriptState) { + return new {{v8_class}}(callback, scriptState); + } + +diff --git a/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl +index 9940b50bd4bd..ff8dc553801c 100644 +--- a/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/constants.cpp.tmpl +@@ -2,17 +2,17 @@ + {% macro constant_getter_callback(constant) %} + void {{v8_class_or_partial}}::{{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) { + {% if constant.deprecate_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{constant.deprecate_as}}); + {% endif %} + {% if constant.measure_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{constant.measure_as('ConstantGetter')}}); + {% endif %} + {% if constant.idl_type in ('Double', 'Float') %} +- v8SetReturnValue(info, {{constant.value}}); ++ V8SetReturnValue(info, {{constant.value}}); + {% elif constant.idl_type == 'String' %} +- v8SetReturnValueString(info, "{{constant.value}}"); ++ V8SetReturnValueString(info, "{{constant.value}}"); + {% else %} +- v8SetReturnValueInt(info, {{constant.value}}); ++ V8SetReturnValueInt(info, {{constant.value}}); + {% endif %} + } + {% endmacro %} +@@ -27,7 +27,7 @@ const V8DOMConfiguration::ConstantConfiguration {{v8_class}}Constants[] = { + {{constant_configuration(constant)}}, + {% endfor %} + }; +-V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTemplate, {{v8_class}}Constants, WTF_ARRAY_LENGTH({{v8_class}}Constants)); ++V8DOMConfiguration::InstallConstants(isolate, interfaceTemplate, prototypeTemplate, {{v8_class}}Constants, WTF_ARRAY_LENGTH({{v8_class}}Constants)); + {% endif %} + {# Runtime-enabled constants #} + {% for group in constants | runtime_enabled_constants | groupby('runtime_enabled_feature_name') %} +@@ -35,13 +35,13 @@ V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTempla + {% for constant in group.list %} + {% set constant_name = constant.name.title().replace('_', '') %} + const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configuration = {{constant_configuration(constant)}}; +-V8DOMConfiguration::installConstant(isolate, interfaceTemplate, prototypeTemplate, constant{{constant_name}}Configuration); ++V8DOMConfiguration::InstallConstant(isolate, interfaceTemplate, prototypeTemplate, constant{{constant_name}}Configuration); + {% endfor %} + {% endfilter %} + {% endfor %} + {# Constants with [DeprecateAs] or [MeasureAs] #} + {% for constant in constants | has_special_getter %} +-V8DOMConfiguration::installConstantWithGetter(isolate, interfaceTemplate, prototypeTemplate, "{{constant.name}}", {{v8_class_or_partial}}::{{constant.name}}ConstantGetterCallback); ++V8DOMConfiguration::InstallConstantWithGetter(isolate, interfaceTemplate, prototypeTemplate, "{{constant.name}}", {{v8_class_or_partial}}::{{constant.name}}ConstantGetterCallback); + {% endfor %} + {# Check constants #} + {% if not do_not_check_constants %} +@@ -63,5 +63,5 @@ static_assert({{constant.value}} == {{constant_cpp_class}}::{{constant.reflected + {# 'Short', 'Long' etc. #} + {% set value = '%s, 0' % constant.value %} + {% endif %} +-{"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_type}}} ++{"{{constant.name}}", {{value}}, V8DOMConfiguration::kConstantType{{constant.idl_type}}} + {%- endmacro %} +diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl +index 46b5735d58d8..f9865bb7afa4 100644 +--- a/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl +@@ -51,10 +51,10 @@ void {{cpp_class}}::{{member.null_setter_name}}() { + + DEFINE_TRACE({{cpp_class}}) { + {% for member in members if member.is_traceable %} +- visitor->trace(m_{{member.cpp_name}}); ++ visitor->Trace(m_{{member.cpp_name}}); + {% endfor %} + {% if parent_cpp_class %} +- {{parent_cpp_class}}::trace(visitor); ++ {{parent_cpp_class}}::Trace(visitor); + {% endif %} + } + +diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_impl.h.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_impl.h.tmpl +index 1324d882fe9e..7c904e5ee5aa 100644 +--- a/third_party/WebKit/Source/bindings/templates/dictionary_impl.h.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/dictionary_impl.h.tmpl +@@ -32,7 +32,7 @@ class {{exported}}{{cpp_class}}{% if parent_cpp_class %} : public {{parent_cpp_c + {% endif %} + + {% endfor %} +- v8::Local<v8::Value> toV8Impl(v8::Local<v8::Object>, v8::Isolate*) const override; ++ v8::Local<v8::Value> ToV8Impl(v8::Local<v8::Object>, v8::Isolate*) const override; + DECLARE_VIRTUAL_TRACE(); + + private: +diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl +index cad3566b8f85..7b718cb97970 100644 +--- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp.tmpl +@@ -17,16 +17,16 @@ static const v8::Eternal<v8::Name>* eternal{{v8_class}}Keys(v8::Isolate* isolate + "{{member.name}}", + {% endfor %} + }; +- return V8PerIsolateData::from(isolate)->findOrCreateEternalNameCache( ++ return V8PerIsolateData::From(isolate)->FindOrCreateEternalNameCache( + kKeys, kKeys, WTF_ARRAY_LENGTH(kKeys)); + } + {% endif %} + + {% from 'utilities.cpp.tmpl' import v8_value_to_local_cpp_value %} + void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{cpp_class}}& impl, ExceptionState& exceptionState) { +- if (isUndefinedOrNull(v8Value)) { ++ if (IsUndefinedOrNull(v8Value)) { + {% if required_member_names %} +- exceptionState.throwTypeError("Missing required member(s): {{required_member_names|join(', ')}}."); ++ exceptionState.ThrowTypeError("Missing required member(s): {{required_member_names|join(', ')}}."); + {% endif %} + return; + } +@@ -35,7 +35,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + // Do nothing. + return; + {% else %} +- exceptionState.throwTypeError("cannot convert to dictionary."); ++ exceptionState.ThrowTypeError("cannot convert to dictionary."); + return; + {% endif %} + } +@@ -44,7 +44,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + + {% if parent_v8_class %} + {{parent_v8_class}}::toImpl(isolate, v8Value, impl, exceptionState); +- if (exceptionState.hadException()) ++ if (exceptionState.HadException()) + return; + + {% endif %} +@@ -58,12 +58,12 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + {% filter runtime_enabled(member.runtime_enabled_feature_name) %} + v8::Local<v8::Value> {{member.name}}Value; + if (!v8Object->Get(context, keys[{{loop.index0}}].Get(isolate)).ToLocal(&{{member.name}}Value)) { +- exceptionState.rethrowV8Exception(block.Exception()); ++ exceptionState.RethrowV8Exception(block.Exception()); + return; + } + if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { + {% if member.is_required %} +- exceptionState.throwTypeError("required member {{member.name}} is undefined."); ++ exceptionState.ThrowTypeError("required member {{member.name}} is undefined."); + return; + {% else %} + // Do nothing. +@@ -74,22 +74,22 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + {% endif %} + } else { + {% if member.deprecate_as %} +- Deprecation::countDeprecation(currentExecutionContext(isolate), UseCounter::{{member.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(isolate), UseCounter::k{{member.deprecate_as}}); + {% endif %} + {{v8_value_to_local_cpp_value(member) | indent}} + {% if member.is_interface_type %} + if (!{{member.name}}) { +- exceptionState.throwTypeError("member {{member.name}} is not of type {{member.idl_type}}."); ++ exceptionState.ThrowTypeError("member {{member.name}} is not of type {{member.idl_type}}."); + return; + } + {% endif %} + {% if member.enum_values %} + {{declare_enum_validation_variable(member.enum_values) | indent}} +- if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validValues), "{{member.enum_type}}", exceptionState)) ++ if (!IsValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validValues), "{{member.enum_type}}", exceptionState)) + return; + {% elif member.is_object %} +- if (!{{member.name}}.isObject()) { +- exceptionState.throwTypeError("member {{member.name}} is not an object."); ++ if (!{{member.name}}.IsObject()) { ++ exceptionState.ThrowTypeError("member {{member.name}} is not an object."); + return; + } + {% endif %} +@@ -100,7 +100,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + {% endfor %} + } + +-v8::Local<v8::Value> {{cpp_class}}::toV8Impl(v8::Local<v8::Object> creationContext, v8::Isolate* isolate) const { ++v8::Local<v8::Value> {{cpp_class}}::ToV8Impl(v8::Local<v8::Object> creationContext, v8::Isolate* isolate) const { + v8::Local<v8::Object> v8Object = v8::Object::New(isolate); + if (!toV8{{cpp_class}}(*this, v8Object, creationContext, isolate)) + return v8::Undefined(isolate); +@@ -122,7 +122,7 @@ bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictiona + bool {{member.name}}HasValueOrDefault = false; + if (impl.{{member.has_method_name}}()) { + {% if member.is_object %} +- DCHECK(impl.{{member.getter_name}}().isObject()); ++ DCHECK(impl.{{member.getter_name}}().IsObject()); + {% endif %} + {{member.name}}Value = {{member.cpp_value_to_v8_value}}; + {{member.name}}HasValueOrDefault = true; +@@ -144,7 +144,7 @@ bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictiona + If there is not, then the compiler will inline this call into the only branch that sets it to true. + Either way, the code is efficient and the variable is completely elided. #} + if ({{member.name}}HasValueOrDefault && +- !v8CallBoolean(dictionary->CreateDataProperty(context, keys[{{loop.index0}}].Get(isolate), {{member.name}}Value))) { ++ !V8CallBoolean(dictionary->CreateDataProperty(context, keys[{{loop.index0}}].Get(isolate), {{member.name}}Value))) { + return false; + } + +@@ -152,7 +152,7 @@ bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictiona + return true; + } + +-{{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { ++{{cpp_class}} NativeValueTraits<{{cpp_class}}>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { + {{cpp_class}} impl; + {{v8_class}}::toImpl(isolate, value, impl, exceptionState); + return impl; +diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl +index 59e14fdb5a2d..39d821385fc4 100644 +--- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.h.tmpl +@@ -20,18 +20,18 @@ class {{v8_class}} { + {{exported}}bool toV8{{cpp_class}}(const {{cpp_class}}&, v8::Local<v8::Object> dictionary, v8::Local<v8::Object> creationContext, v8::Isolate*); + + template <class CallbackInfo> +-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl) { +- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate())); ++inline void V8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl) { ++ V8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate())); + } + + template <class CallbackInfo> +-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl, v8::Local<v8::Object> creationContext) { +- v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate())); ++inline void V8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl, v8::Local<v8::Object> creationContext) { ++ V8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate())); + } + + template <> + struct NativeValueTraits<{{cpp_class}}> : public NativeValueTraitsBase<{{cpp_class}}> { +- {{exported}}static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); ++ {{exported}}static {{cpp_class}} NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); + }; + + template <> +diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl +index e840b30e4d2e..289ea7ebb4ac 100644 +--- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl +@@ -6,7 +6,7 @@ + {% set getter = indexed_property_getter %} + static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { + {% if getter.is_raises_exception %} +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::IndexedGetterContext, "{{interface_name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedGetterContext, "{{interface_name}}"); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); +@@ -18,10 +18,10 @@ static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo + if (index >= impl->length()) + return; // Returns undefined due to out-of-range. + +- {% set getter_name = getter.name or 'anonymousIndexedGetter' %} ++ {% set getter_name = getter.name or 'AnonymousIndexedGetter' %} + {% set getter_arguments = ['index'] %} + {% if getter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% set getter_arguments = ['scriptState'] + getter_arguments %} + {% endif %} + {% if getter.is_raises_exception %} +@@ -50,7 +50,7 @@ void {{v8_class_or_partial}}::indexedPropertyGetterCallback(uint32_t index, cons + + {% else %}{# otherwise, named property #} + +- const AtomicString& propertyName = AtomicString::number(index); ++ const AtomicString& propertyName = AtomicString::Number(index); + + {% if getter.is_custom %} + {{v8_class}}::namedPropertyGetterCustom(propertyName, info); +@@ -72,7 +72,7 @@ void {{v8_class_or_partial}}::indexedPropertyGetterCallback(uint32_t index, cons + {% set setter = indexed_property_setter %} + static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + {% if setter.has_exception_state %} +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::IndexedSetterContext, "{{interface_name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedSetterContext, "{{interface_name}}"); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); +@@ -80,16 +80,16 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, + {% if setter.has_type_checking_interface %} + {# Type checking for interface types (if interface not implemented, throw + TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} +- if (!propertyValue{% if setter.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) { +- exceptionState.throwTypeError("The provided value is not of type '{{setter.idl_type}}'."); ++ if (!propertyValue{% if setter.is_nullable %} && !IsUndefinedOrNull(v8Value){% endif %}) { ++ exceptionState.ThrowTypeError("The provided value is not of type '{{setter.idl_type}}'."); + return; + } + {% endif %} + +- {% set setter_name = setter.name or 'anonymousIndexedSetter' %} ++ {% set setter_name = setter.name or 'AnonymousIndexedSetter' %} + {% set setter_arguments = ['index', 'propertyValue'] %} + {% if setter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% set setter_arguments = ['scriptState'] + setter_arguments %} + {% endif %} + {% if setter.is_raises_exception %} +@@ -97,12 +97,12 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, + {% endif %} + bool result = impl->{{setter_name}}({{setter_arguments | join(', ')}}); + {% if setter.is_raises_exception %} +- if (exceptionState.hadException()) ++ if (exceptionState.HadException()) + return; + {% endif %} + if (!result) + return; +- v8SetReturnValue(info, v8Value); ++ V8SetReturnValue(info, v8Value); + } + + {% endif %} +@@ -128,7 +128,7 @@ void {{v8_class_or_partial}}::indexedPropertySetterCallback(uint32_t index, v8:: + + {% else %}{# otherwise, named property #} + +- const AtomicString& propertyName = AtomicString::number(index); ++ const AtomicString& propertyName = AtomicString::Number(index); + + {% if setter.is_custom %} + {{v8_class}}::namedPropertySetterCustom(propertyName, v8Value, info); +@@ -149,15 +149,15 @@ void {{v8_class_or_partial}}::indexedPropertySetterCallback(uint32_t index, v8:: + {% set deleter = indexed_property_deleter %} + static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info) { + {% if deleter.is_raises_exception %} +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::IndexedDeletionContext, "{{interface_name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedDeletionContext, "{{interface_name}}"); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); + +- {% set deleter_name = deleter.name or 'anonymousIndexedDeleter' %} ++ {% set deleter_name = deleter.name or 'AnonymousIndexedDeleter' %} + {% set deleter_arguments = ['index'] %} + {% if deleter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% set deleter_arguments = ['scriptState'] + deleter_arguments %} + {% endif %} + {% if deleter.is_raises_exception %} +@@ -165,12 +165,12 @@ static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf + {% endif %} + DeleteResult result = impl->{{deleter_name}}({{deleter_arguments | join(', ')}}); + {% if deleter.is_raises_exception %} +- if (exceptionState.hadException()) ++ if (exceptionState.HadException()) + return; + {% endif %} +- if (result == DeleteUnknownProperty) ++ if (result == kDeleteUnknownProperty) + return; +- v8SetReturnValue(info, result == DeleteSuccess); ++ V8SetReturnValue(info, result == kDeleteSuccess); + } + + {% endif %} +@@ -196,7 +196,7 @@ void {{v8_class_or_partial}}::indexedPropertyDeleterCallback(uint32_t index, con + + {% else %}{# otherwise, named property #} + +- const AtomicString& propertyName = AtomicString::number(index); ++ const AtomicString& propertyName = AtomicString::Number(index); + + {% if deleter.is_custom %} + {{v8_class}}::namedPropertyDeleterCustom(propertyName, info); +@@ -217,11 +217,11 @@ void {{v8_class_or_partial}}::indexedPropertyDeleterCallback(uint32_t index, con + {% set getter = named_property_getter %} + static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Value>& info) { + {% if getter.is_raises_exception %} +- const CString& nameInUtf8 = name.utf8(); +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "{{interface_name}}", nameInUtf8.data()); ++ const CString& nameInUtf8 = name.Utf8(); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", nameInUtf8.Data()); + {% endif %} + {% if getter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); +@@ -247,7 +247,7 @@ static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall + void {{v8_class_or_partial}}::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + if (!name->IsString()) + return; +- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); ++ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); + + {% if getter.is_custom %} + {{v8_class}}::namedPropertyGetterCustom(propertyName, info); +@@ -267,11 +267,11 @@ void {{v8_class_or_partial}}::namedPropertyGetterCallback(v8::Local<v8::Name> na + {% set setter = named_property_setter %} + static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + {% if setter.has_exception_state %} +- const CString& nameInUtf8 = name.utf8(); +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "{{interface_name}}", nameInUtf8.data()); ++ const CString& nameInUtf8 = name.Utf8(); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kSetterContext, "{{interface_name}}", nameInUtf8.Data()); + {% endif %} + {% if setter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); +@@ -279,13 +279,13 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v + {% if setter.has_type_checking_interface %} + {# Type checking for interface types (if interface not implemented, throw + TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} +- if (!propertyValue{% if setter.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) { +- exceptionState.throwTypeError("The provided value is not of type '{{setter.idl_type}}'."); ++ if (!propertyValue{% if setter.is_nullable %} && !IsUndefinedOrNull(v8Value){% endif %}) { ++ exceptionState.ThrowTypeError("The provided value is not of type '{{setter.idl_type}}'."); + return; + } + {% endif %} + +- {% set setter_name = setter.name or 'anonymousNamedSetter' %} ++ {% set setter_name = setter.name or 'AnonymousNamedSetter' %} + {% set setter_arguments = ['name', 'propertyValue'] %} + {% if setter.is_call_with_script_state %} + {% set setter_arguments = ['scriptState'] + setter_arguments %} +@@ -295,12 +295,12 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v + {% endif %} + bool result = impl->{{setter_name}}({{setter_arguments | join(', ')}}); + {% if setter.is_raises_exception %} +- if (exceptionState.hadException()) ++ if (exceptionState.HadException()) + return; + {% endif %} + if (!result) + return; +- v8SetReturnValue(info, v8Value); ++ V8SetReturnValue(info, v8Value); + } + + {% endif %} +@@ -314,7 +314,7 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v + void {{v8_class_or_partial}}::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { + if (!name->IsString()) + return; +- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); ++ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); + + {% if setter.is_ce_reactions %} + CEReactionsScope ceReactionsScope; +@@ -337,16 +337,16 @@ void {{v8_class_or_partial}}::namedPropertySetterCallback(v8::Local<v8::Name> na + {% set deleter = named_property_deleter %} + static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Boolean>& info) { + {% if deleter.is_raises_exception %} +- const CString& nameInUtf8 = name.utf8(); +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::DeletionContext, "{{interface_name}}", nameInUtf8.data()); ++ const CString& nameInUtf8 = name.Utf8(); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kDeletionContext, "{{interface_name}}", nameInUtf8.Data()); + {% endif %} + {% if deleter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); + +- {% set deleter_name = deleter.name or 'anonymousNamedDeleter' %} ++ {% set deleter_name = deleter.name or 'AnonymousNamedDeleter' %} + {% set deleter_arguments = ['name'] %} + {% if deleter.is_call_with_script_state %} + {% set deleter_arguments = ['scriptState'] + deleter_arguments %} +@@ -356,12 +356,12 @@ static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal + {% endif %} + DeleteResult result = impl->{{deleter_name}}({{deleter_arguments | join(', ')}}); + {% if deleter.is_raises_exception %} +- if (exceptionState.hadException()) ++ if (exceptionState.HadException()) + return; + {% endif %} +- if (result == DeleteUnknownProperty) ++ if (result == kDeleteUnknownProperty) + return; +- v8SetReturnValue(info, result == DeleteSuccess); ++ V8SetReturnValue(info, result == kDeleteSuccess); + } + + {% endif %} +@@ -375,7 +375,7 @@ static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal + void {{v8_class_or_partial}}::namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info) { + if (!name->IsString()) + return; +- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); ++ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); + + {% if deleter.is_ce_reactions %} + CEReactionsScope ceReactionsScope; +@@ -400,10 +400,10 @@ void {{v8_class_or_partial}}::namedPropertyDeleterCallback(v8::Local<v8::Name> n + {# If there is an enumerator, there MUST be a query method to properly + communicate property attributes. #} + static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Integer>& info) { +- const CString& nameInUtf8 = name.utf8(); +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "{{interface_name}}", nameInUtf8.data()); ++ const CString& nameInUtf8 = name.Utf8(); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", nameInUtf8.Data()); + {% if getter.is_call_with_script_state %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); +@@ -412,10 +412,10 @@ static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb + {% if getter.is_call_with_script_state %} + {% set getter_arguments = ['scriptState'] + getter_arguments %} + {% endif %} +- bool result = impl->namedPropertyQuery({{getter_arguments | join(', ')}}); ++ bool result = impl->NamedPropertyQuery({{getter_arguments | join(', ')}}); + if (!result) + return; +- v8SetReturnValueInt(info, v8::None); ++ V8SetReturnValueInt(info, v8::None); + } + + {% endif %} +@@ -429,7 +429,7 @@ static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb + void {{v8_class_or_partial}}::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) { + if (!name->IsString()) + return; +- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); ++ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); + + {% if getter.is_custom_property_query %} + {{v8_class}}::namedPropertyQueryCustom(propertyName, info); +@@ -447,15 +447,15 @@ void {{v8_class_or_partial}}::namedPropertyQueryCallback(v8::Local<v8::Name> nam + {% if named_property_getter and named_property_getter.is_enumerable and + not named_property_getter.is_custom_property_enumerator %} + static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) { +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationContext, "{{interface_name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kEnumerationContext, "{{interface_name}}"); + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); + + Vector<String> names; +- impl->namedPropertyEnumerator(names, exceptionState); +- if (exceptionState.hadException()) ++ impl->NamedPropertyEnumerator(names, exceptionState); ++ if (exceptionState.HadException()) + return; +- v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>()); ++ V8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>()); + } + + {% endif %} +@@ -492,8 +492,8 @@ static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo + return; + {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); + v8::String::Utf8Value methodName(name); +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "{{interface_name}}", *methodName); +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) { ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kSetterContext, "{{interface_name}}", *methodName); ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), impl, exceptionState)) { + return; + } + +@@ -503,8 +503,8 @@ static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo + // {{method.name}}OriginSafeMethodGetter{{world_suffix}} defined in + // methods.cpp.tmpl + {% endraw %} +- V8PrivateProperty::getSymbol(info.GetIsolate(), *methodName) +- .set(v8::Local<v8::Object>::Cast(info.Holder()), v8Value); ++ V8PrivateProperty::GetSymbol(info.GetIsolate(), *methodName) ++ .Set(v8::Local<v8::Object>::Cast(info.Holder()), v8Value); + } + {% endif %} + {% endblock %} +@@ -523,16 +523,16 @@ void {{v8_class_or_partial}}::{{cpp_class}}OriginSafeMethodSetterCallback(v8::Lo + {% from 'methods.cpp.tmpl' import generate_constructor with context %} + {% if named_constructor %} + {% set active_scriptwrappable_inheritance = +- 'InheritFromActiveScriptWrappable' ++ 'kInheritFromActiveScriptWrappable' + if active_scriptwrappable else +- 'NotInheritFromActiveScriptWrappable' %} ++ 'kNotInheritFromActiveScriptWrappable' %} + // Suppress warning: global constructors, because struct WrapperTypeInfo is trivial + // and does not depend on another global objects. + #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wglobal-constructors" + #endif +-const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::trace, {{v8_class}}::traceWrappers, {{prepare_prototype_and_interface_object_func or 'nullptr'}}, "{{interface_name}}", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}} }; ++const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::Trace, {{v8_class}}::TraceWrappers, {{prepare_prototype_and_interface_object_func or 'nullptr'}}, "{{interface_name}}", 0, WrapperTypeInfo::kWrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}} }; + #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) + #pragma clang diagnostic pop + #endif +@@ -540,17 +540,17 @@ const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde + {{generate_constructor(named_constructor)}} + v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) { + static int domTemplateKey; // This address is used for a key to look up the dom template. +- V8PerIsolateData* data = V8PerIsolateData::from(isolate); +- v8::Local<v8::FunctionTemplate> result = data->findInterfaceTemplate(world, &domTemplateKey); ++ V8PerIsolateData* data = V8PerIsolateData::From(isolate); ++ v8::Local<v8::FunctionTemplate> result = data->FindInterfaceTemplate(world, &domTemplateKey); + if (!result.IsEmpty()) + return result; + + result = v8::FunctionTemplate::New(isolate, {{v8_class}}ConstructorCallback); + v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate(); + instanceTemplate->SetInternalFieldCount({{v8_class}}::internalFieldCount); +- result->SetClassName(v8AtomicString(isolate, "{{named_constructor.name}}")); ++ result->SetClassName(V8AtomicString(isolate, "{{named_constructor.name}}")); + result->Inherit({{v8_class}}::domTemplate(isolate, world)); +- data->setInterfaceTemplate(world, &domTemplateKey, result); ++ data->SetInterfaceTemplate(world, &domTemplateKey, result); + return result; + } + +@@ -558,29 +558,29 @@ void {{v8_class}}Constructor::NamedConstructorAttributeGetter( + v8::Local<v8::Name> propertyName, + const v8::PropertyCallbackInfo<v8::Value>& info) { + v8::Local<v8::Context> creationContext = info.Holder()->CreationContext(); +- V8PerContextData* perContextData = V8PerContextData::from(creationContext); ++ V8PerContextData* perContextData = V8PerContextData::From(creationContext); + if (!perContextData) { + // TODO(yukishiino): Return a valid named constructor even after the context is detached + return; + } + +- v8::Local<v8::Function> namedConstructor = perContextData->constructorForType(&{{v8_class}}Constructor::wrapperTypeInfo); ++ v8::Local<v8::Function> namedConstructor = perContextData->ConstructorForType(&{{v8_class}}Constructor::wrapperTypeInfo); + + // Set the prototype of named constructors to the regular constructor. +- auto privateProperty = V8PrivateProperty::getNamedConstructorInitialized(info.GetIsolate()); ++ auto privateProperty = V8PrivateProperty::GetNamedConstructorInitialized(info.GetIsolate()); + v8::Local<v8::Context> currentContext = info.GetIsolate()->GetCurrentContext(); +- v8::Local<v8::Value> privateValue = privateProperty.getOrEmpty(namedConstructor); ++ v8::Local<v8::Value> privateValue = privateProperty.GetOrEmpty(namedConstructor); + + if (privateValue.IsEmpty()) { +- v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_class}}::wrapperTypeInfo); +- v8::Local<v8::Value> interfacePrototype = interface->Get(currentContext, v8AtomicString(info.GetIsolate(), "prototype")).ToLocalChecked(); +- bool result = namedConstructor->Set(currentContext, v8AtomicString(info.GetIsolate(), "prototype"), interfacePrototype).ToChecked(); ++ v8::Local<v8::Function> interface = perContextData->ConstructorForType(&{{v8_class}}::wrapperTypeInfo); ++ v8::Local<v8::Value> interfacePrototype = interface->Get(currentContext, V8AtomicString(info.GetIsolate(), "prototype")).ToLocalChecked(); ++ bool result = namedConstructor->Set(currentContext, V8AtomicString(info.GetIsolate(), "prototype"), interfacePrototype).ToChecked(); + if (!result) + return; +- privateProperty.set(namedConstructor, v8::True(info.GetIsolate())); ++ privateProperty.Set(namedConstructor, v8::True(info.GetIsolate())); + } + +- v8SetReturnValue(info, namedConstructor); ++ V8SetReturnValue(info, namedConstructor); + } + + {% endif %} +@@ -590,7 +590,7 @@ void {{v8_class}}Constructor::NamedConstructorAttributeGetter( + {% block overloaded_constructor %} + {% if constructor_overloads %} + static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "{{interface_name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "{{interface_name}}"); + {# 2. Initialize argcount to be min(maxarg, n). #} + switch (std::min({{constructor_overloads.maxarg}}, info.Length())) { + {# 3. Remove from S all entries whose type list is not of length argcount. #} +@@ -611,16 +611,16 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + {# Report full list of valid arities if gaps and above minimum #} + {% if constructor_overloads.valid_arities %} + if (info.Length() >= {{constructor_overloads.length}}) { +- exceptionState.throwTypeError(ExceptionMessages::invalidArity("{{constructor_overloads.valid_arities}}", info.Length())); ++ exceptionState.ThrowTypeError(ExceptionMessages::InvalidArity("{{constructor_overloads.valid_arities}}", info.Length())); + return; + } + {% endif %} + {# Otherwise just report "not enough arguments" #} +- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments({{constructor_overloads.length}}, info.Length())); ++ exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments({{constructor_overloads.length}}, info.Length())); + return; + } + {# No match, throw error #} +- exceptionState.throwTypeError("No matching constructor signature."); ++ exceptionState.ThrowTypeError("No matching constructor signature."); + } + + {% endif %} +@@ -632,22 +632,22 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { + {% if constructors or has_custom_constructor or has_event_constructor or has_html_constructor %} + void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + {% if measure_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{measure_as('Constructor')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{measure_as('Constructor')}}); + {% endif %} + if (!info.IsConstructCall()) { +- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("{{interface_name}}")); ++ V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("{{interface_name}}")); + return; + } + +- if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) { +- v8SetReturnValue(info, info.Holder()); ++ if (ConstructorMode::Current(info.GetIsolate()) == ConstructorMode::kWrapExistingObject) { ++ V8SetReturnValue(info, info.Holder()); + return; + } + + {% if has_custom_constructor %} + {{v8_class}}::constructorCustom(info); + {% elif has_html_constructor %} +- V8HTMLConstructor::htmlConstructor(info, {{v8_class}}::wrapperTypeInfo, HTMLElementType::k{{interface_name}}); ++ V8HTMLConstructor::HtmlConstructor(info, {{v8_class}}::wrapperTypeInfo, HTMLElementType::k{{interface_name}}); + {% else %} + {{cpp_class}}V8Internal::constructor(info); + {% endif %} +@@ -672,7 +672,7 @@ void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value> + {% set property_attribute = + 'static_cast<v8::PropertyAttribute>(%s)' % + ' | '.join(method.property_attributes or ['v8::None']) %} +-{% set holder_check = 'V8DOMConfiguration::CheckHolder' %} ++{% set holder_check = 'V8DOMConfiguration::kCheckHolder' %} + static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttributeConfiguration[] = { + {% if method.is_per_world_bindings %} + {% set getter_callback_for_main_world = '%sForMainWorld' % getter_callback %} +@@ -681,11 +681,11 @@ static const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSaf + {"{{method.name}}", {{getter_callback_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, V8DOMConfiguration::MainWorld}, + {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, nullptr, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, V8DOMConfiguration::NonMainWorlds}} + {% else %} +- {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, nullptr, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, V8DOMConfiguration::AllWorlds} ++ {"{{method.name}}", {{getter_callback}}, {{setter_callback}}, nullptr, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, V8DOMConfiguration::kAllWorlds} + {% endif %} + }; + for (const auto& attributeConfig : {{method.name}}OriginSafeAttributeConfiguration) +- V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{prototype_template}}, attributeConfig); ++ V8DOMConfiguration::InstallAttribute(isolate, world, {{instance_template}}, {{prototype_template}}, attributeConfig); + {%- endmacro %} + + +@@ -701,7 +701,7 @@ for (const auto& attributeConfig : {{method.name}}OriginSafeAttributeConfigurati + '%s::indexedPropertyDeleterCallback' % v8_class_or_partial + if indexed_property_deleter or named_property_deleter else 'nullptr' %} + {% set indexed_property_enumerator_callback = +- 'indexedPropertyEnumerator<%s>' % cpp_class ++ 'IndexedPropertyEnumerator<%s>' % cpp_class + if indexed_property_getter.is_enumerable else 'nullptr' %} + {% set property_handler_flags = + 'v8::PropertyHandlerFlags::kNone' %} +@@ -745,7 +745,7 @@ v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig({{named_propert + {% if not is_array_buffer_or_view %} + v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) { + {% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8_class) if has_partial_interface else 'install%sTemplate' % v8_class %} +- return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), {{installTemplateFunction}}); ++ return V8DOMConfiguration::DomClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), {{installTemplateFunction}}); + } + + {% endif %} +@@ -758,15 +758,15 @@ v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate, + v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObject(v8::Isolate* isolate, const DOMWrapperWorld& world) { + v8::Local<v8::FunctionTemplate> parentTemplate = V8{{parent_interface}}::domTemplate(isolate, world); + +- v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode); +- namedPropertiesObjectFunctionTemplate->SetClassName(v8AtomicString(isolate, "{{interface_name}}Properties")); ++ v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::IsValidConstructorMode); ++ namedPropertiesObjectFunctionTemplate->SetClassName(V8AtomicString(isolate, "{{interface_name}}Properties")); + namedPropertiesObjectFunctionTemplate->Inherit(parentTemplate); + + v8::Local<v8::ObjectTemplate> namedPropertiesObjectTemplate = namedPropertiesObjectFunctionTemplate->PrototypeTemplate(); + namedPropertiesObjectTemplate->SetInternalFieldCount({{v8_class}}::internalFieldCount); + // Named Properties object has SetPrototype method of Immutable Prototype Exotic Objects + namedPropertiesObjectTemplate->SetImmutableProto(); +- V8DOMConfiguration::setClassString(isolate, namedPropertiesObjectTemplate, "{{interface_name}}Properties"); ++ V8DOMConfiguration::SetClassString(isolate, namedPropertiesObjectTemplate, "{{interface_name}}Properties"); + {{install_named_property_handler('namedPropertiesObjectTemplate') | indent(2)}} + + return namedPropertiesObjectFunctionTemplate; +@@ -781,11 +781,11 @@ v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObjec + {% if not is_array_buffer_or_view %} + + bool {{v8_class}}::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { +- return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); ++ return V8PerIsolateData::From(isolate)->HasInstance(&wrapperTypeInfo, v8Value); + } + + v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) { +- return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); ++ return V8PerIsolateData::From(isolate)->FindInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); + } + + {% endif %} +@@ -799,19 +799,19 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V + DCHECK(object->Is{{interface_name}}()); + v8::Local<v8::{{interface_name}}> v8buffer = object.As<v8::{{interface_name}}>(); + if (v8buffer->IsExternal()) { +- const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object); ++ const WrapperTypeInfo* wrapperTypeInfo = ToWrapperTypeInfo(object); + CHECK(wrapperTypeInfo); +- CHECK_EQ(wrapperTypeInfo->ginEmbedder, gin::kEmbedderBlink); +- return toScriptWrappable(object)->toImpl<{{cpp_class}}>(); ++ CHECK_EQ(wrapperTypeInfo->gin_embedder, gin::kEmbedderBlink); ++ return ToScriptWrappable(object)->ToImpl<{{cpp_class}}>(); + } + + // Transfer the ownership of the allocated memory to an {{interface_name}} without + // copying. + v8::{{interface_name}}::Contents v8Contents = v8buffer->Externalize(); +- WTF::ArrayBufferContents::DataHandle data(v8Contents.Data(), WTF::ArrayBufferContents::freeMemory); +- WTF::ArrayBufferContents contents(std::move(data), v8Contents.ByteLength(), WTF::ArrayBufferContents::{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared); +- {{cpp_class}}* buffer = {{cpp_class}}::create(contents); +- v8::Local<v8::Object> associatedWrapper = buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeInfo(), object); ++ WTF::ArrayBufferContents::DataHandle data(v8Contents.Data(), WTF::ArrayBufferContents::FreeMemory); ++ WTF::ArrayBufferContents contents(std::move(data), v8Contents.ByteLength(), WTF::ArrayBufferContents::k{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared); ++ {{cpp_class}}* buffer = {{cpp_class}}::Create(contents); ++ v8::Local<v8::Object> associatedWrapper = buffer->AssociateWithWrapper(v8::Isolate::GetCurrent(), buffer->GetWrapperTypeInfo(), object); + DCHECK(associatedWrapper == object); + + return buffer; +@@ -820,9 +820,9 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V + {% elif interface_name == 'ArrayBufferView' %} + {{cpp_class}}* V8ArrayBufferView::toImpl(v8::Local<v8::Object> object) { + DCHECK(object->IsArrayBufferView()); +- ScriptWrappable* scriptWrappable = toScriptWrappable(object); ++ ScriptWrappable* scriptWrappable = ToScriptWrappable(object); + if (scriptWrappable) +- return scriptWrappable->toImpl<{{cpp_class}}>(); ++ return scriptWrappable->ToImpl<{{cpp_class}}>(); + + if (object->IsInt8Array()) + return V8Int8Array::toImpl(object); +@@ -852,24 +852,24 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V + {% elif is_array_buffer_or_view %} + {{cpp_class}}* {{v8_class}}::toImpl(v8::Local<v8::Object> object) { + DCHECK(object->Is{{interface_name}}()); +- ScriptWrappable* scriptWrappable = toScriptWrappable(object); ++ ScriptWrappable* scriptWrappable = ToScriptWrappable(object); + if (scriptWrappable) +- return scriptWrappable->toImpl<{{cpp_class}}>(); ++ return scriptWrappable->ToImpl<{{cpp_class}}>(); + + v8::Local<v8::{{interface_name}}> v8View = object.As<v8::{{interface_name}}>(); + v8::Local<v8::Object> arrayBuffer = v8View->Buffer(); + {{cpp_class}}* typedArray = nullptr; + if (arrayBuffer->IsArrayBuffer()) { +- typedArray = {{cpp_class}}::create(V8ArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length()); ++ typedArray = {{cpp_class}}::Create(V8ArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length()); + } else if (arrayBuffer->IsSharedArrayBuffer()) { +- typedArray = {{cpp_class}}::create(V8SharedArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length()); ++ typedArray = {{cpp_class}}::Create(V8SharedArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length()); + } else { + NOTREACHED(); + } +- v8::Local<v8::Object> associatedWrapper = typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrapperTypeInfo(), object); ++ v8::Local<v8::Object> associatedWrapper = typedArray->AssociateWithWrapper(v8::Isolate::GetCurrent(), typedArray->GetWrapperTypeInfo(), object); + DCHECK(associatedWrapper == object); + +- return typedArray->toImpl<{{cpp_class}}>(); ++ return typedArray->ToImpl<{{cpp_class}}>(); + } + + {% endif %} +@@ -891,10 +891,10 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V + + {##############################################################################} + {% block native_value_traits %} +-{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { ++{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { + {{cpp_class}}* nativeValue = {{v8_class}}::toImplWithTypeCheck(isolate, value); + if (!nativeValue) +- exceptionState.throwTypeError("Unable to convert value to {{interface_name}}."); ++ exceptionState.ThrowTypeError("Unable to convert value to {{interface_name}}."); + return nativeValue; + } + +@@ -926,7 +926,7 @@ void {{v8_class}}::updateWrapperTypeInfo( + installRuntimeEnabledFunction; + {% endif %} + if (preparePrototypeAndInterfaceObjectFunction) { +- {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = ++ {{v8_class}}::wrapperTypeInfo.prepare_prototype_and_interface_object_function = + preparePrototypeAndInterfaceObjectFunction; + } + } +diff --git a/third_party/WebKit/Source/bindings/templates/interface.h.tmpl b/third_party/WebKit/Source/bindings/templates/interface.h.tmpl +index 88b5b51865f1..a87f5d0a4ebe 100644 +--- a/third_party/WebKit/Source/bindings/templates/interface.h.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/interface.h.tmpl +@@ -39,7 +39,7 @@ class {{v8_class}} { + {{exported}}static v8::Local<v8::FunctionTemplate> domTemplateForNamedPropertiesObject(v8::Isolate*, const DOMWrapperWorld&); + {% endif %} + static {{cpp_class}}* toImpl(v8::Local<v8::Object> object) { +- return toScriptWrappable(object)->toImpl<{{cpp_class}}>(); ++ return ToScriptWrappable(object)->ToImpl<{{cpp_class}}>(); + } + {% endif %} + {{exported}}static {{cpp_class}}* toImplWithTypeCheck(v8::Isolate*, v8::Local<v8::Value>); +@@ -48,11 +48,11 @@ class {{v8_class}} { + {% else %} + {{exported}}static const WrapperTypeInfo wrapperTypeInfo; + {% endif %} +- static void trace(Visitor* visitor, ScriptWrappable* scriptWrappable) { +- visitor->trace(scriptWrappable->toImpl<{{cpp_class}}>()); ++ static void Trace(Visitor* visitor, ScriptWrappable* scriptWrappable) { ++ visitor->Trace(scriptWrappable->ToImpl<{{cpp_class}}>()); + } +- static void traceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) { +- visitor->traceWrappers(scriptWrappable->toImpl<{{cpp_class}}>()); ++ static void TraceWrappers(WrapperVisitor* visitor, ScriptWrappable* scriptWrappable) { ++ visitor->TraceWrappers(scriptWrappable->ToImpl<{{cpp_class}}>()); + } + {% for method in methods %} + {% if method.is_custom %} +@@ -120,7 +120,7 @@ class {{v8_class}} { + {% set custom_internal_field_counter = 0 %} + {% if is_event_target and not is_node %} + {# Event listeners on DOM nodes are explicitly supported in the GC controller. #} +- static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; ++ static const int eventListenerCacheIndex = kV8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; + {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} + {% endif %} + {# persistentHandleIndex must be the last field, if it is present. +@@ -128,7 +128,7 @@ class {{v8_class}} { + FIXME: Remove this internal field, and share one field for either: + * a persistent handle (if the object is in oilpan) or + * a C++ pointer to the DOM object (if the object is not in oilpan) #} +- static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; ++ static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount + {{custom_internal_field_counter}}; + {# End custom internal fields #} + {% if prepare_prototype_and_interface_object_func %} + {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Context>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate); +@@ -275,7 +275,7 @@ class {{v8_class}} { + {% endif %} + template <> + struct NativeValueTraits<{{cpp_class}}> : public NativeValueTraitsBase<{{cpp_class}}> { +- {{exported}}static {{cpp_class}}* nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); ++ {{exported}}static {{cpp_class}}* NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); + }; + + template <> +diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl +index c4826362fc0b..83b24c6ac27c 100644 +--- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl +@@ -11,12 +11,12 @@ namespace blink { + {% set dom_template = '%s::domTemplate' % v8_class if not is_array_buffer_or_view else '0' %} + {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface + if parent_interface else '0' %} +-{% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else +- 'WrapperTypeObjectPrototype' %} ++{% set wrapper_type_prototype = 'kWrapperTypeExceptionPrototype' if is_exception else ++ 'kWrapperTypeObjectPrototype' %} + {% set active_scriptwrappable_inheritance = +- 'InheritFromActiveScriptWrappable' ++ 'kInheritFromActiveScriptWrappable' + if active_scriptwrappable else +- 'NotInheritFromActiveScriptWrappable' %} ++ 'kNotInheritFromActiveScriptWrappable' %} + + {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %} + {% if not is_partial %} +@@ -26,7 +26,7 @@ namespace blink { + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wglobal-constructors" + #endif +-{{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrappers, {{prepare_prototype_and_interface_object_func or 'nullptr'}}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}} }; ++{{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::Trace, {{v8_class}}::TraceWrappers, {{prepare_prototype_and_interface_object_func or 'nullptr'}}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{lifetime}} }; + #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) + #pragma clang diagnostic pop + #endif +@@ -35,7 +35,7 @@ namespace blink { + // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}}.h. + // For details, see the comment of DEFINE_WRAPPERTYPEINFO in + // bindings/core/v8/ScriptWrappable.h. +-const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperTypeInfo; ++const WrapperTypeInfo& {{cpp_class}}::wrapper_type_info_ = {{v8_class}}::wrapperTypeInfo; + {% endif %} + + {% if active_scriptwrappable %} +@@ -46,8 +46,8 @@ static_assert( + "[ActiveScriptWrappable] extended attribute in the IDL file. " + "Be consistent."); + static_assert( +- !std::is_same<decltype(&{{cpp_class}}::hasPendingActivity), +- decltype(&ScriptWrappable::hasPendingActivity)>::value, ++ !std::is_same<decltype(&{{cpp_class}}::HasPendingActivity), ++ decltype(&ScriptWrappable::HasPendingActivity)>::value, + "{{cpp_class}} is not overriding hasPendingActivity(), but is specifying " + "[ActiveScriptWrappable] extended attribute in the IDL file. " + "Be consistent."); +@@ -59,8 +59,8 @@ static_assert( + "[ActiveScriptWrappable] extended attribute in the IDL file. " + "Be consistent."); + static_assert( +- std::is_same<decltype(&{{cpp_class}}::hasPendingActivity), +- decltype(&ScriptWrappable::hasPendingActivity)>::value, ++ std::is_same<decltype(&{{cpp_class}}::HasPendingActivity), ++ decltype(&ScriptWrappable::HasPendingActivity)>::value, + "{{cpp_class}} is overriding hasPendingActivity(), but is not specifying " + "[ActiveScriptWrappable] extended attribute in the IDL file. " + "Be consistent."); +@@ -240,10 +240,10 @@ bool {{v8_class_or_partial}}::securityCheck(v8::Local<v8::Context> accessingCont + return false; // the frame is gone. + + const DOMWindow* targetWindow = V8Window::toImpl(window); +- return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(accessingContext), targetWindow, BindingSecurity::ErrorReportOption::DoNotReport); ++ return BindingSecurity::ShouldAllowAccessTo(ToLocalDOMWindow(accessingContext), targetWindow, BindingSecurity::ErrorReportOption::kDoNotReport); + {% elif interface_name == 'Location' %} + {{cpp_class}}* impl = {{v8_class}}::toImpl(accessedObject); +- return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(accessingContext), impl, BindingSecurity::ErrorReportOption::DoNotReport); ++ return BindingSecurity::ShouldAllowAccessTo(ToLocalDOMWindow(accessingContext), impl, BindingSecurity::ErrorReportOption::kDoNotReport); + {% else %} + #error "Unexpected security check for interface {{interface_name}}" + {% endif %} +@@ -253,7 +253,7 @@ bool {{v8_class_or_partial}}::securityCheck(v8::Local<v8::Context> accessingCont + void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { + if (!name->IsString()) + return; +- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); ++ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); + + for (const auto& attribute : {{cpp_class_or_partial}}V8Internal::kCrossOriginAttributeTable) { + if (propertyName == attribute.name && attribute.getter) { +@@ -269,9 +269,9 @@ void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, c + {{cpp_class}}V8Internal::namedPropertyGetter(propertyName, info); + {% endif %} + {% else %} +- BindingSecurity::failedAccessCheckFor( ++ BindingSecurity::FailedAccessCheckFor( + info.GetIsolate(), +- {{v8_class}}::toImpl(info.Holder())->frame()); ++ {{v8_class}}::toImpl(info.Holder())->GetFrame()); + {% endif %} + } + {% endif %} +@@ -280,7 +280,7 @@ void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, c + void {{v8_class_or_partial}}::crossOriginNamedSetter(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) { + if (!name->IsString()) + return; +- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>()); ++ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>()); + + for (const auto& attribute : {{cpp_class_or_partial}}V8Internal::kCrossOriginAttributeTable) { + if (propertyName == attribute.name && attribute.setter) { +@@ -293,9 +293,9 @@ void {{v8_class_or_partial}}::crossOriginNamedSetter(v8::Local<v8::Name> name, v + an access check failure: there are no custom named setters that are + accessible from a cross-origin context. #} + +- BindingSecurity::failedAccessCheckFor( ++ BindingSecurity::FailedAccessCheckFor( + info.GetIsolate(), +- {{v8_class}}::toImpl(info.Holder())->frame()); ++ {{v8_class}}::toImpl(info.Holder())->GetFrame()); + } + {% endif %} + +@@ -307,7 +307,7 @@ void {{v8_class_or_partial}}::crossOriginNamedEnumerator(const v8::PropertyCallb + + // Use the current context as the creation context, as a cross-origin access + // may involve an object that does not have a creation context. +- v8SetReturnValue(info, ++ V8SetReturnValue(info, + ToV8(names, info.GetIsolate()->GetCurrentContext()->Global(), + info.GetIsolate()).As<v8::Array>()); + } +@@ -417,7 +417,7 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo + 'V8%s::domTemplate(isolate, world)' % parent_interface + if parent_interface else + 'v8::Local<v8::FunctionTemplate>()' %} +- V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interfaceName, {{parent_interface_template}}, {{v8_class}}::internalFieldCount); ++ V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interface_name, {{parent_interface_template}}, {{v8_class}}::internalFieldCount); + {% if constructors or has_custom_constructor or has_event_constructor or has_html_constructor %} + interfaceTemplate->SetCallHandler({{v8_class}}::constructorCallback); + interfaceTemplate->SetLength({{interface_length}}); +@@ -456,16 +456,16 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo + {{install_constants() | indent(2)}} + {% endif %} + {% if data_attributes %} +- V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class}}); ++ V8DOMConfiguration::InstallAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class}}); + {% endif %} + {% if lazy_data_attributes %} +- V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sLazyDataAttributes)' % v8_class}}); ++ V8DOMConfiguration::InstallLazyDataAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sLazyDataAttributes)' % v8_class}}); + {% endif %} + {% if accessors %} +- V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class}}); ++ V8DOMConfiguration::InstallAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class}}); + {% endif %} + {% if methods | has_method_configuration(is_partial) %} +- V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sMethods)' % v8_class}}); ++ V8DOMConfiguration::InstallMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sMethods)' % v8_class}}); + {% endif %} + + {% if has_access_check_callbacks and not is_partial %} +@@ -485,13 +485,13 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo + {{attribute_configuration(attribute) | indent(2)}} + }; + for (const auto& attributeConfig : attribute{{attribute.name}}Configuration) +- V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, prototypeTemplate, attributeConfig); ++ V8DOMConfiguration::InstallAttribute(isolate, world, instanceTemplate, prototypeTemplate, attributeConfig); + {% else %} + static const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration[] = { + {{attribute_configuration(attribute) | indent(2)}} + }; + for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) +- V8DOMConfiguration::installAccessor(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessorConfig); ++ V8DOMConfiguration::InstallAccessor(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessorConfig); + {% endif %} + {% endfor %} + {% endfilter %} +@@ -515,10 +515,10 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo + {% endif %} + // For value iterators, the properties below must originally be set to the corresponding ones in %ArrayPrototype%. + // See https://heycam.github.io/webidl/#es-iterators. +- prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "entries"), v8::kArrayProto_entries); +- prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "forEach"), v8::kArrayProto_forEach); +- prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "keys"), v8::kArrayProto_keys); +- prototypeTemplate->SetIntrinsicDataProperty(v8AtomicString(isolate, "values"), v8::kArrayProto_values); ++ prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "entries"), v8::kArrayProto_entries); ++ prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "forEach"), v8::kArrayProto_forEach); ++ prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "keys"), v8::kArrayProto_keys); ++ prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "values"), v8::kArrayProto_values); + {% endif %} + {% endif %} + +@@ -526,8 +526,8 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo + {% filter exposed(iterator_method.exposed_test) %} + {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %} + // Iterator (@@iterator) +- static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, {{v8_class_or_partial}}::iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess }; +- V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature, symbolKeyedIteratorConfiguration); ++ static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, {{v8_class_or_partial}}::iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess }; ++ V8DOMConfiguration::InstallMethod(isolate, world, prototypeTemplate, signature, symbolKeyedIteratorConfiguration); + {% endfilter %} + {% endfilter %} + {% endif %} +@@ -605,13 +605,13 @@ void {{v8_class_or_partial}}::installRuntimeEnabledFeatures(v8::Isolate* isolate + {{attribute_configuration(attribute) | indent(2)}} + }; + for (const auto& attributeConfig : attribute{{attribute.name}}Configuration) +- V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attributeConfig); ++ V8DOMConfiguration::InstallAttribute(isolate, world, instance, prototype, attributeConfig); + {% else %} + static const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration[] = { + {{attribute_configuration(attribute) | indent(2)}} + }; + for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) +- V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, interface, signature, accessorConfig); ++ V8DOMConfiguration::InstallAccessor(isolate, world, instance, prototype, interface, signature, accessorConfig); + {% endif %} + {% endfor %} + {% endfilter %} +@@ -667,20 +667,20 @@ void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons + {{attribute_configuration(attribute) | indent(2)}} + }; + for (const auto& attributeConfig : attribute{{attribute.name}}Configuration) +- V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attributeConfig); ++ V8DOMConfiguration::InstallAttribute(isolate, world, instance, prototype, attributeConfig); + {% else %} + static const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration[] = { + {{attribute_configuration(attribute) | indent(2)}} + }; + for (const auto& accessorConfig : accessor{{attribute.name}}Configuration) +- V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, interface, signature, accessorConfig); ++ V8DOMConfiguration::InstallAccessor(isolate, world, instance, prototype, interface, signature, accessorConfig); + {% endif %} + {% endfor %} + {# Origin-Trial-enabled constants #} + {% for constant in feature.constants %} + {% set constant_name = constant.name.title().replace('_', '') %} + const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configuration = {{constant_configuration(constant)}}; +- V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{constant_name}}Configuration); ++ V8DOMConfiguration::InstallConstant(isolate, interface, prototype, constant{{constant_name}}Configuration); + {% endfor %} + {# Origin-Trial-enabled methods (no overloads) #} + {% for method in feature.methods %} +@@ -689,16 +689,16 @@ void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons + {{method_configuration(method) | indent(2)}} + }; + for (const auto& methodConfig : method{{method_name}}Configuration) +- V8DOMConfiguration::installMethod(isolate, world, instance, prototype, interface, signature, methodConfig); ++ V8DOMConfiguration::InstallMethod(isolate, world, instance, prototype, interface, signature, methodConfig); + {% endfor %} + } + + void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) { +- V8PerContextData* perContextData = V8PerContextData::from(scriptState->context()); +- v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class}}::wrapperTypeInfo); +- v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_class}}::wrapperTypeInfo); ++ V8PerContextData* perContextData = V8PerContextData::From(scriptState->GetContext()); ++ v8::Local<v8::Object> prototype = perContextData->PrototypeForType(&{{v8_class}}::wrapperTypeInfo); ++ v8::Local<v8::Function> interface = perContextData->ConstructorForType(&{{v8_class}}::wrapperTypeInfo); + ALLOW_UNUSED_LOCAL(interface); +- install{{feature.name}}(scriptState->isolate(), scriptState->world(), instance, prototype, interface); ++ install{{feature.name}}(scriptState->GetIsolate(), scriptState->World(), instance, prototype, interface); + } + {% if not feature.needs_instance %} + +@@ -729,20 +729,20 @@ void {{v8_class_or_partial}}::preparePrototypeAndInterfaceObject(v8::Local<v8::C + v8::Isolate* isolate = context->GetIsolate(); + {% if has_conditional_attributes_on_prototype or methods | conditionally_exposed(is_partial) %} + v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate); +- ExecutionContext* executionContext = toExecutionContext(context); ++ ExecutionContext* executionContext = ToExecutionContext(context); + DCHECK(executionContext); + {% endif %} + + {% if unscopables %} + v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); + v8::Local<v8::Object> unscopables; +- if (v8CallBoolean(prototypeObject->HasOwnProperty(context, unscopablesSymbol))) ++ if (V8CallBoolean(prototypeObject->HasOwnProperty(context, unscopablesSymbol))) + unscopables = prototypeObject->Get(context, unscopablesSymbol).ToLocalChecked().As<v8::Object>(); + else + unscopables = v8::Object::New(isolate); + {% for name, runtime_enabled_feature_name in unscopables %} + {% filter runtime_enabled(runtime_enabled_feature_name) %} +- unscopables->CreateDataProperty(context, v8AtomicString(isolate, "{{name}}"), v8::True(isolate)).FromJust(); ++ unscopables->CreateDataProperty(context, V8AtomicString(isolate, "{{name}}"), v8::True(isolate)).FromJust(); + {% endfilter %} + {% endfor %} + prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopables).FromJust(); +diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl +index 8033b620f5a2..71453338eb3a 100644 +--- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl +@@ -7,7 +7,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const + 'ExceptionState exceptionState', + 'ScriptState* scriptState = ']) %} + {% set define_exception_state -%} +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{method.name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "{{interface_name}}", "{{method.name}}"); + {%- endset %} + + {% set function_call = func_call_with_prep_of_args(method, world_suffix) %} +@@ -22,7 +22,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const + + {% if not method.is_static %} + {% if method.returns_promise %} +- // V8DOMConfiguration::DoNotCheckHolder ++ // V8DOMConfiguration::kDoNotCheckHolder + // Make sure that info.Holder() really points to an instance of the type. + if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate())) { + {{throw_type_error(method, '"Illegal invocation"')}} +@@ -33,7 +33,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const + // Same-origin methods are never exposed via the cross-origin interceptors. + // Since same-origin access requires a LocalDOMWindow, it is safe to downcast + // here. +- LocalDOMWindow* impl = toLocalDOMWindow({{v8_class}}::toImpl(info.Holder())); ++ LocalDOMWindow* impl = ToLocalDOMWindow({{v8_class}}::toImpl(info.Holder())); + {% else %} + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); + {% endif %}{# interface_name == 'Window' and not method.is_cross_origin #} +@@ -42,17 +42,17 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const + {# Security checks #} + {% if method.is_check_security_for_return_value %} + {{define_exception_state}} +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), {{method.cpp_value}}, exceptionState)) { +- v8SetReturnValueNull(info); ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), {{method.cpp_value}}, exceptionState)) { ++ V8SetReturnValueNull(info); + return; + } + {% endif %} + + {% if 'scriptState' in function_call %} + {% if method.is_static %} +- ScriptState* scriptState = ScriptState::forFunctionObject(info); ++ ScriptState* scriptState = ScriptState::ForFunctionObject(info); + {% else %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + {% endif %} + +@@ -85,7 +85,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const + {% if method.number_of_required_arguments and not method.overload_index %} + if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { + {{throw_type_error(method, +- 'ExceptionMessages::notEnoughArguments(%(expected)d, info.Length())' ++ 'ExceptionMessages::NotEnoughArguments(%(expected)d, info.Length())' + | format(expected=method.number_of_required_arguments))}} + return; + } +@@ -139,21 +139,21 @@ if (UNLIKELY(numArgsPassed <= {{argument.index}})) { + {% if argument.is_callback_interface %} + {# FIXME: remove EventListener special case #} + {% if argument.idl_type == 'EventListener' %} +-{% if method.name == 'removeEventListener' or method.name == 'removeListener' %} +-{{argument.name}} = V8EventListenerHelper::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOnly); +-{% else %}{# method.name == 'addEventListener' #} +-{{argument.name}} = V8EventListenerHelper::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOrCreate); ++{% if method.name == 'RemoveEventListener' or method.name == 'RemoveListener' %} ++{{argument.name}} = V8EventListenerHelper::GetEventListener(ScriptState::Current(info.GetIsolate()), info[{{argument.index}}], false, kListenerFindOnly); ++{% else %}{# method.name == 'AddEventListener' #} ++{{argument.name}} = V8EventListenerHelper::GetEventListener(ScriptState::Current(info.GetIsolate()), info[{{argument.index}}], false, kListenerFindOrCreate); + {% endif %}{# method.name #} + {% else %}{# argument.idl_type == 'EventListener' #} + {# Callback functions must be functions: + http://www.w3.org/TR/WebIDL/#es-callback-function #} + {% if argument.is_optional %} +-if (!isUndefinedOrNull(info[{{argument.index}}])) { ++if (!IsUndefinedOrNull(info[{{argument.index}}])) { + if (!info[{{argument.index}}]->IsFunction()) { + {{throw_argument_error(method, argument, "The callback provided as parameter %(index)d is not a function.")}} + return; + } +- {{argument.name}} = V8{{argument.idl_type}}::create(v8::Local<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::current(info.GetIsolate())); ++ {{argument.name}} = V8{{argument.idl_type}}::Create(v8::Local<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::Current(info.GetIsolate())); + } else { + {{argument.name}} = nullptr; + } +@@ -162,11 +162,11 @@ if (info.Length() <= {{argument.index}} || !{% if argument.is_nullable %}(info[{ + {{throw_argument_error(method, argument, "The callback provided as parameter %(index)d is not a function.")}} + return; + } +-{{argument.name}} = {% if argument.is_nullable %}info[{{argument.index}}]->IsNull() ? nullptr : {% endif %}V8{{argument.idl_type}}::create(v8::Local<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::current(info.GetIsolate())); ++{{argument.name}} = {% if argument.is_nullable %}info[{{argument.index}}]->IsNull() ? nullptr : {% endif %}V8{{argument.idl_type}}::Create(v8::Local<v8::Function>::Cast(info[{{argument.index}}]), ScriptState::Current(info.GetIsolate())); + {% endif %}{# argument.is_optional #} + {% endif %}{# argument.idl_type == 'EventListener' #} + {% elif argument.is_callback_function %} +-if ({% if argument.is_nullable %}!isUndefinedOrNull(info[{{argument.index}}]) && {% endif %}!(info[{{argument.index}}]->IsObject() && v8::Local<v8::Object>::Cast(info[{{argument.index}}])->IsCallable())) { ++if ({% if argument.is_nullable %}!IsUndefinedOrNull(info[{{argument.index}}]) && {% endif %}!(info[{{argument.index}}]->IsObject() && v8::Local<v8::Object>::Cast(info[{{argument.index}}])->IsCallable())) { + {{throw_argument_error(method, argument, "The callback provided as parameter %(index)d is not a function.")}} + return; + } +@@ -183,14 +183,14 @@ for (int i = {{argument.index}}; i < info.Length(); ++i) { + {% if not argument.use_permissive_dictionary_conversion %} + {# Dictionaries must have type Undefined, Null or Object: + http://heycam.github.io/webidl/#es-dictionary #} +-if (!isUndefinedOrNull(info[{{argument.index}}]) && !info[{{argument.index}}]->IsObject()) { ++if (!IsUndefinedOrNull(info[{{argument.index}}]) && !info[{{argument.index}}]->IsObject()) { + {{throw_argument_error(method, argument, "parameter %(index)d ('%(name)s') is not an object.")}} + return; + } + {% endif %}{# not argument.use_permissive_dictionary_conversion #} + {{v8_value_to_local_cpp_value(argument)}} + {% elif argument.is_explicit_nullable %} +-if (!isUndefinedOrNull(info[{{argument.index}}])) { ++if (!IsUndefinedOrNull(info[{{argument.index}}])) { + {{v8_value_to_local_cpp_value(argument) | indent(2)}} + } + {% else %}{# argument.is_nullable #} +@@ -203,7 +203,7 @@ if (!isUndefinedOrNull(info[{{argument.index}}])) { + throw a TypeError), per http://www.w3.org/TR/WebIDL/#es-interface + Note: for variadic arguments, the type checking is done for each matched + argument instead; see argument.is_variadic_wrapper_type code-path above. #} +-if (!{{argument.name}}{% if argument.is_nullable %} && !isUndefinedOrNull(info[{{argument.index}}]){% endif %}) { ++if (!{{argument.name}}{% if argument.is_nullable %} && !IsUndefinedOrNull(info[{{argument.index}}]){% endif %}) { + {{throw_argument_error(method, argument, "parameter %(index)d is not of type '%(type)s'.")}} + return; + } +@@ -211,13 +211,13 @@ if (!{{argument.name}}{% if argument.is_nullable %} && !isUndefinedOrNull(info[{ + {# Invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #} + {% set enum_variable = 'valid' + argument.name[0].upper() + argument.name[1:] + 'Values' %} + {{declare_enum_validation_variable(argument.enum_values, enum_variable)}} +-if (!isValidEnum({{argument.name}}, {{enum_variable}}, WTF_ARRAY_LENGTH({{enum_variable}}), "{{argument.enum_type}}", exceptionState)) { ++if (!IsValidEnum({{argument.name}}, {{enum_variable}}, WTF_ARRAY_LENGTH({{enum_variable}}), "{{argument.enum_type}}", exceptionState)) { + return; + } + {% elif argument.idl_type == 'Promise' %} + {# We require this for our implementation of promises, though not in spec: + http://heycam.github.io/webidl/#es-promise #} +-if (!{{argument.name}}.isUndefinedOrNull() && !{{argument.name}}.isObject()) { ++if (!{{argument.name}}.IsUndefinedOrNull() && !{{argument.name}}.IsObject()) { + {{throw_argument_error(method, argument, "parameter %(index)d ('%(name)s') is not an object.")}} + return; + } +@@ -234,15 +234,15 @@ if (!{{argument.name}}.isUndefinedOrNull() && !{{argument.name}}.isObject()) { + {% if method.is_call_with_execution_context %} + {# [ConstructorCallWith=ExecutionContext] #} + {# [CallWith=ExecutionContext] #} +-ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); ++ExecutionContext* executionContext = CurrentExecutionContext(info.GetIsolate()); + {% endif %} + {% if method.is_call_with_script_arguments %} + {# [CallWith=ScriptArguments] #} +-ScriptArguments* scriptArguments(ScriptArguments::create(scriptState, info, {{method.number_of_arguments}})); ++ScriptArguments* scriptArguments(ScriptArguments::Create(scriptState, info, {{method.number_of_arguments}})); + {% endif %} + {% if method.is_call_with_document %} + {# [ConstructorCallWith=Document] #} +-Document& document = *toDocument(currentExecutionContext(info.GetIsolate())); ++Document& document = *ToDocument(CurrentExecutionContext(info.GetIsolate())); + {% endif %} + {# Call #} + {% if method.idl_type == 'void' %} +@@ -257,7 +257,7 @@ Document& document = *toDocument(currentExecutionContext(info.GetIsolate())); + {% endif %} + {# Post-call #} + {% if method.is_raises_exception %} +-if (exceptionState.hadException()) { ++if (exceptionState.HadException()) { + return; + } + {% endif %} +@@ -265,14 +265,14 @@ if (exceptionState.hadException()) { + {% if method.is_new_object and not method.do_not_test_new_object %} + // [NewObject] must always create a new wrapper. Check that a wrapper + // does not exist yet. +-DCHECK(!result || DOMDataStore::getWrapper(result, info.GetIsolate()).IsEmpty()); ++DCHECK(!result || DOMDataStore::GetWrapper(result, info.GetIsolate()).IsEmpty()); + {% endif %} + {% if method.is_constructor %} + {{generate_constructor_wrapper(method)}} + {%- elif v8_set_return_value %} + {% if method.is_explicit_nullable %} +-if (result.isNull()) +- v8SetReturnValueNull(info); ++if (result.IsNull()) ++ V8SetReturnValueNull(info); + else + {{v8_set_return_value}}; + {% else %} +@@ -288,11 +288,11 @@ else + {##############################################################################} + {% macro throw_type_error(method, error_message) %} + {% if method.has_exception_state or method.returns_promise %} +-exceptionState.throwTypeError({{error_message}}); ++exceptionState.ThrowTypeError({{error_message}}); + {%- elif method.is_constructor %} +-V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToConstruct("{{interface_name}}", {{error_message}})); ++V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToConstruct("{{interface_name}}", {{error_message}})); + {%- else %} +-V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("{{method.name}}", "{{interface_name}}", {{error_message}})); ++V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::FailedToExecute("{{method.name}}", "{{interface_name}}", {{error_message}})); + {%- endif %} + {% endmacro %} + +@@ -338,10 +338,10 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI + {% set fall_through_to_partial_overloads = not is_partial and overloads.has_partial_overloads %} + + {% if overloads.measure_all_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{overloads.measure_all_as}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{overloads.measure_all_as}}); + {% endif %} + {% if overloads.deprecate_all_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{overloads.deprecate_all_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{overloads.deprecate_all_as}}); + {% endif %} + + {# First resolve by length #} +@@ -360,10 +360,10 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI + {% filter runtime_enabled(not overloads.runtime_enabled_all and method.runtime_enabled_feature_name) %} + if ({{test}}) { + {% if method.measure_as and not overloads.measure_all_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{method.measure_as('Method')}}); + {% endif %} + {% if method.deprecate_as and not overloads.deprecate_all_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{method.deprecate_as}}); + {% endif %} + {{method.name}}{{method.overload_index}}Method{{world_suffix}}(info); + return; +@@ -387,7 +387,7 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI + + {% else %}{# fall_through_to_partial_overloads #} + +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{overloads.name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "{{interface_name}}", "{{overloads.name}}"); + {% if overloads.returns_promise_all %} + ExceptionToRejectPromiseScope rejectPromiseScope(info, exceptionState); + {% endif %} +@@ -395,18 +395,18 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI + if (isArityError) { + {% if overloads.length != 0 %} + if (info.Length() < {{overloads.length}}) { +- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments({{overloads.length}}, info.Length())); ++ exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments({{overloads.length}}, info.Length())); + return; + } + {% endif %} + {% if overloads.valid_arities %} + if (info.Length() >= {{overloads.length}}) { +- exceptionState.throwTypeError(ExceptionMessages::invalidArity("{{overloads.valid_arities}}", info.Length())); ++ exceptionState.ThrowTypeError(ExceptionMessages::InvalidArity("{{overloads.valid_arities}}", info.Length())); + return; + } + {% endif %} + } +- exceptionState.throwTypeError("No function was found that matched the signature provided."); ++ exceptionState.ThrowTypeError("No function was found that matched the signature provided."); + + {% endif %}{# fall_through_to_partial_overloads #} + } +@@ -416,27 +416,27 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI + {##############################################################################} + {% macro generate_post_message_impl(method) %} + static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v8::FunctionCallbackInfo<v8::Value>& info) { +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, interfaceName, "postMessage"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, interfaceName, "postMessage"); + if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { +- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments({{method.number_of_required_arguments}}, info.Length())); ++ exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments({{method.number_of_required_arguments}}, info.Length())); + return; + } + + Transferables transferables; + if (info.Length() > 1) { + const int transferablesArgIndex = 1; +- if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState)) { ++ if (!SerializedScriptValue::ExtractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState)) { + return; + } + } + + RefPtr<SerializedScriptValue> message; +- if (instance->canTransferArrayBuffersAndImageBitmaps()) { ++ if (instance->CanTransferArrayBuffersAndImageBitmaps()) { + // This instance supports sending array buffers by move semantics. + SerializedScriptValue::SerializeOptions options; + options.transferables = &transferables; +- message = SerializedScriptValue::serialize(info.GetIsolate(), info[0], options, exceptionState); +- if (exceptionState.hadException()) ++ message = SerializedScriptValue::Serialize(info.GetIsolate(), info[0], options, exceptionState); ++ if (exceptionState.HadException()) + return; + } else { + // This instance doesn't support sending array buffers and image bitmaps +@@ -447,30 +447,30 @@ static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, + // Clear references to array buffers and image bitmaps from transferables + // so that the serializer can consider the array buffers as + // non-transferable and serialize them into the message. +- ArrayBufferArray transferableArrayBuffers = transferables.arrayBuffers; +- transferables.arrayBuffers.clear(); +- ImageBitmapArray transferableImageBitmaps = transferables.imageBitmaps; +- transferables.imageBitmaps.clear(); ++ ArrayBufferArray transferableArrayBuffers = transferables.array_buffers; ++ transferables.array_buffers.Clear(); ++ ImageBitmapArray transferableImageBitmaps = transferables.image_bitmaps; ++ transferables.image_bitmaps.Clear(); + SerializedScriptValue::SerializeOptions options; + options.transferables = &transferables; +- message = SerializedScriptValue::serialize(info.GetIsolate(), info[0], options, exceptionState); +- if (exceptionState.hadException()) ++ message = SerializedScriptValue::Serialize(info.GetIsolate(), info[0], options, exceptionState); ++ if (exceptionState.HadException()) + return; + + // Neuter the original array buffers on the sender context. +- SerializedScriptValue::transferArrayBufferContents(info.GetIsolate(), transferableArrayBuffers, exceptionState); +- if (exceptionState.hadException()) ++ SerializedScriptValue::TransferArrayBufferContents(info.GetIsolate(), transferableArrayBuffers, exceptionState); ++ if (exceptionState.HadException()) + return; + // Neuter the original image bitmaps on the sender context. +- SerializedScriptValue::transferImageBitmapContents(info.GetIsolate(), transferableImageBitmaps, exceptionState); +- if (exceptionState.hadException()) ++ SerializedScriptValue::TransferImageBitmapContents(info.GetIsolate(), transferableImageBitmaps, exceptionState); ++ if (exceptionState.HadException()) + return; + } + + // FIXME: Only pass scriptState/exceptionState if instance really requires it. +- ScriptState* scriptState = ScriptState::current(info.GetIsolate()); +- message->unregisterMemoryAllocatedWithCurrentScriptContext(); +- instance->postMessage(scriptState, message.get(), transferables.messagePorts, exceptionState); ++ ScriptState* scriptState = ScriptState::Current(info.GetIsolate()); ++ message->UnregisterMemoryAllocatedWithCurrentScriptContext(); ++ instance->postMessage(scriptState, message.Get(), transferables.message_ports, exceptionState); + } + {% endmacro %} + +@@ -480,23 +480,23 @@ static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, + void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) { + {% if not method.overloads %}{# Overloaded methods are measured in overload_resolution_method() #} + {% if method.measure_as %} +- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}}); ++ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{method.measure_as('Method')}}); + {% endif %} + {% if method.deprecate_as %} +- Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); ++ Deprecation::CountDeprecation(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{method.deprecate_as}}); + {% endif %} + {% endif %}{# not method.overloads #} + {% if world_suffix in method.activity_logging_world_list %} + {% if method.is_static %} +- ScriptState* scriptState = ScriptState::forFunctionObject(info); ++ ScriptState* scriptState = ScriptState::ForFunctionObject(info); + {% else %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} +- V8PerContextData* contextData = scriptState->perContextData(); +- if (contextData && contextData->activityLogger()) { +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{method.name}}"); +- Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); +- contextData->activityLogger()->logMethod("{{interface_name}}.{{method.name}}", info.Length(), loggerArgs.data()); ++ V8PerContextData* contextData = scriptState->PerContextData(); ++ if (contextData && contextData->ActivityLogger()) { ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "{{interface_name}}", "{{method.name}}"); ++ Vector<v8::Local<v8::Value>> loggerArgs = ToImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState); ++ contextData->ActivityLogger()->LogMethod("{{interface_name}}.{{method.name}}", info.Length(), loggerArgs.Data()); + } + {% endif %} + {% if method.is_ce_reactions %} +@@ -520,17 +520,17 @@ void {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}(cons + properly supports the incumbent realm. #} + static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::PropertyCallbackInfo<v8::Value>& info) { + static int domTemplateKey; // This address is used for a key to look up the dom template. +- V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); +- const DOMWrapperWorld& world = DOMWrapperWorld::world(info.GetIsolate()->GetCurrentContext()); +- v8::Local<v8::FunctionTemplate> interfaceTemplate = data->findInterfaceTemplate(world, &{{v8_class}}::wrapperTypeInfo); ++ V8PerIsolateData* data = V8PerIsolateData::From(info.GetIsolate()); ++ const DOMWrapperWorld& world = DOMWrapperWorld::World(info.GetIsolate()->GetCurrentContext()); ++ v8::Local<v8::FunctionTemplate> interfaceTemplate = data->FindInterfaceTemplate(world, &{{v8_class}}::wrapperTypeInfo); + v8::Local<v8::Signature> signature = v8::Signature::New(info.GetIsolate(), interfaceTemplate); + +- v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperationTemplate(world, &domTemplateKey, {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), signature, {{method.length}}); ++ v8::Local<v8::FunctionTemplate> methodTemplate = data->FindOrCreateOperationTemplate(world, &domTemplateKey, {{v8_class_or_partial}}::{{method.name}}MethodCallback{{world_suffix}}, V8Undefined(), signature, {{method.length}}); + // Return the function by default, unless the user script has overwritten it. +- v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked()); ++ V8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked()); + + {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); +- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, BindingSecurity::ErrorReportOption::DoNotReport)) { ++ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), impl, BindingSecurity::ErrorReportOption::kDoNotReport)) { + return; + } + +@@ -539,10 +539,10 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop + // {{cpp_class}}OriginSafeMethodSetter defined in interface.cpp.tmpl. + {% endraw %} + V8PrivateProperty::Symbol propertySymbol = +- V8PrivateProperty::getSymbol(info.GetIsolate(), "{{method.name}}"); ++ V8PrivateProperty::GetSymbol(info.GetIsolate(), "{{method.name}}"); + v8::Local<v8::Object> holder = v8::Local<v8::Object>::Cast(info.Holder()); +- if (propertySymbol.hasValue(holder)) { +- v8SetReturnValue(info, propertySymbol.getOrUndefined(holder)); ++ if (propertySymbol.HasValue(holder)) { ++ V8SetReturnValue(info, propertySymbol.GetOrUndefined(holder)); + } + } + {% endmacro %} +@@ -564,21 +564,21 @@ static void {{name}}(const v8::FunctionCallbackInfo<v8::Value>& info) { + + {% if constructor.is_named_constructor %} + if (!info.IsConstructCall()) { +- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("{{constructor.name}}")); ++ V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("{{constructor.name}}")); + return; + } + +- if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) { +- v8SetReturnValue(info, info.Holder()); ++ if (ConstructorMode::Current(info.GetIsolate()) == ConstructorMode::kWrapExistingObject) { ++ V8SetReturnValue(info, info.Holder()); + return; + } + {% endif %} + + {% if 'exceptionState' in function_call %} +- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "{{interface_name}}"); ++ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "{{interface_name}}"); + {% endif %} + {% if 'scriptState' in function_call %} +- ScriptState* scriptState = ScriptState::forReceiverObject(info); ++ ScriptState* scriptState = ScriptState::ForReceiverObject(info); + {% endif %} + + {{function_call | indent(2)}} +@@ -592,8 +592,8 @@ static void {{name}}(const v8::FunctionCallbackInfo<v8::Value>& info) { + if constructor.is_named_constructor else + '') %} + v8::Local<v8::Object> wrapper = info.Holder(); +-wrapper = impl->associateWithWrapper(info.GetIsolate(), &{{constructor_class}}::wrapperTypeInfo, wrapper); +-v8SetReturnValue(info, wrapper); ++wrapper = impl->AssociateWithWrapper(info.GetIsolate(), &{{constructor_class}}::wrapperTypeInfo, wrapper); ++V8SetReturnValue(info, wrapper); + {% endmacro %} + + +@@ -608,17 +608,17 @@ v8SetReturnValue(info, wrapper); + {% set property_attribute = + 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attributes) + if method.property_attributes else 'v8::None' %} +-{% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder' +- if method.returns_promise else 'V8DOMConfiguration::CheckHolder' %} +-{% set access_check = 'V8DOMConfiguration::CheckAccess' +- if method.is_check_security_for_receiver else 'V8DOMConfiguration::DoNotCheckAccess' %} ++{% set holder_check = 'V8DOMConfiguration::kDoNotCheckHolder' ++ if method.returns_promise else 'V8DOMConfiguration::kCheckHolder' %} ++{% set access_check = 'V8DOMConfiguration::kCheckAccess' ++ if method.is_check_security_for_receiver else 'V8DOMConfiguration::kDoNotCheckAccess' %} + {% if method.is_per_world_bindings %} + {% set method_callback_for_main_world = + '%s::%sMethodCallbackForMainWorld' % (v8_class_or_partial, method.name) %} +-{"{{method.name}}", {{method_callback_for_main_world}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, {{access_check}}, V8DOMConfiguration::MainWorld}, +-{"{{method.name}}", {{method_callback}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, {{access_check}}, V8DOMConfiguration::NonMainWorlds} ++{"{{method.name}}", {{method_callback_for_main_world}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, {{access_check}}, V8DOMConfiguration::kMainWorld}, ++{"{{method.name}}", {{method_callback}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, {{access_check}}, V8DOMConfiguration::kNonMainWorlds} + {%- else %} +-{"{{method.name}}", {{method_callback}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, {{access_check}}, V8DOMConfiguration::AllWorlds} ++{"{{method.name}}", {{method_callback}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}, {{access_check}}, V8DOMConfiguration::kAllWorlds} + {%- endif %} + {%- endmacro %} + +@@ -629,7 +629,7 @@ const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration + {{method_configuration(method) | indent(2)}} + }; + for (const auto& methodConfig : {{method.name}}MethodConfiguration) +- V8DOMConfiguration::installMethod(isolate, world, {{instance_template}}, {{prototype_template}}, {{interface_template}}, {{signature}}, methodConfig); ++ V8DOMConfiguration::InstallMethod(isolate, world, {{instance_template}}, {{prototype_template}}, {{interface_template}}, {{signature}}, methodConfig); + {%- endmacro %} + + +@@ -650,7 +650,7 @@ const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration + {{method_configuration(method) | indent(2)}} + }; + for (const auto& methodConfig : {{method.name}}MethodConfiguration) +- V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, methodConfig); ++ V8DOMConfiguration::InstallMethod(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, methodConfig); + {% endfilter %}{# runtime_enabled() #} + {% endfilter %}{# exposed() #} + {% endfilter %}{# secure_context() #} +diff --git a/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl +index ff2eca5b997b..02dca6c3f7a3 100644 +--- a/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl +@@ -36,7 +36,7 @@ void {{cpp_class}}::set{{member.type_name}}({{member.rvalue_cpp_type}} value) { + {% if member.enum_values %} + NonThrowableExceptionState exceptionState; + {{declare_enum_validation_variable(member.enum_values) | indent(2)}} +- if (!isValidEnum(value, validValues, WTF_ARRAY_LENGTH(validValues), "{{member.type_name}}", exceptionState)) { ++ if (!IsValidEnum(value, validValues, WTF_ARRAY_LENGTH(validValues), "{{member.type_name}}", exceptionState)) { + NOTREACHED(); + return; + } +@@ -58,7 +58,7 @@ void {{cpp_class}}::set{{member.type_name}}({{member.rvalue_cpp_type}} value) { + + DEFINE_TRACE({{cpp_class}}) { + {% for member in members if member.is_traceable %} +- visitor->trace(m_{{member.cpp_name}}); ++ visitor->Trace(m_{{member.cpp_name}}); + {% endfor %} + } + +@@ -69,12 +69,12 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + {# The numbers in the following comments refer to the steps described in + http://heycam.github.io/webidl/#es-union #} + {# 1. null or undefined #} +- if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value)) ++ if (conversionMode == UnionTypeConversionMode::kNullable && IsUndefinedOrNull(v8Value)) + return; + + {% if dictionary_type %} + {# 3. Dictionaries for null or undefined #} +- if (isUndefinedOrNull(v8Value)) { ++ if (IsUndefinedOrNull(v8Value)) { + {{v8_value_to_local_cpp_value(dictionary_type) | indent}} + impl.set{{dictionary_type.type_name}}(cppValue); + return; +@@ -130,7 +130,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + {# TODO(bashi): Support 11.5 Callback interface when we need it #} + {# 11.6. Objects #} + {% if object_type %} +- if (isUndefinedOrNull(v8Value) || v8Value->IsObject()) { ++ if (IsUndefinedOrNull(v8Value) || v8Value->IsObject()) { + {{v8_value_to_local_cpp_value(object_type) | indent}} + impl.set{{object_type.type_name}}(cppValue); + return; +@@ -162,7 +162,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + {{v8_value_to_local_cpp_value(string_type) | indent}} + {% if string_type.enum_values %} + {{declare_enum_validation_variable(string_type.enum_values) | indent}} +- if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), "{{string_type.type_name}}", exceptionState)) ++ if (!IsValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), "{{string_type.type_name}}", exceptionState)) + return; + {% endif %} + impl.set{{string_type.type_name}}(cppValue); +@@ -186,7 +186,7 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ + + {% else %} + {# 17. TypeError #} +- exceptionState.throwTypeError("The provided value is not of type '{{type_string}}'"); ++ exceptionState.ThrowTypeError("The provided value is not of type '{{type_string}}'"); + {% endif %} + } + +@@ -205,9 +205,9 @@ v8::Local<v8::Value> ToV8(const {{cpp_class}}& impl, v8::Local<v8::Object> creat + return v8::Local<v8::Value>(); + } + +-{{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { ++{{cpp_class}} NativeValueTraits<{{cpp_class}}>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) { + {{cpp_class}} impl; +- {{v8_class}}::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState); ++ {{v8_class}}::toImpl(isolate, value, impl, UnionTypeConversionMode::kNotNullable, exceptionState); + return impl; + } + +diff --git a/third_party/WebKit/Source/bindings/templates/union_container.h.tmpl b/third_party/WebKit/Source/bindings/templates/union_container.h.tmpl +index 29453cfaf6d8..e6ca782b6298 100644 +--- a/third_party/WebKit/Source/bindings/templates/union_container.h.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/union_container.h.tmpl +@@ -56,18 +56,18 @@ class {{v8_class}} final { + {{exported}}v8::Local<v8::Value> ToV8(const {{cpp_class}}&, v8::Local<v8::Object>, v8::Isolate*); + + template <class CallbackInfo> +-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl) { +- v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate())); ++inline void V8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl) { ++ V8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate())); + } + + template <class CallbackInfo> +-inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl, v8::Local<v8::Object> creationContext) { +- v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate())); ++inline void V8SetReturnValue(const CallbackInfo& callbackInfo, {{cpp_class}}& impl, v8::Local<v8::Object> creationContext) { ++ V8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate())); + } + + template <> + struct NativeValueTraits<{{cpp_class}}> : public NativeValueTraitsBase<{{cpp_class}}> { +- {{exported}}static {{cpp_class}} nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); ++ {{exported}}static {{cpp_class}} NativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); + }; + + template <> +diff --git a/third_party/WebKit/Source/bindings/templates/utilities.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/utilities.cpp.tmpl +index 1e23d92f1a19..5040010b78ed 100644 +--- a/third_party/WebKit/Source/bindings/templates/utilities.cpp.tmpl ++++ b/third_party/WebKit/Source/bindings/templates/utilities.cpp.tmpl +@@ -43,25 +43,25 @@ const char* {{enum_variable}}[] = { + {% macro property_location(member) %} + {% set property_location_list = [] %} + {% if member.on_instance %} +-{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnInstance'] %} ++{% set property_location_list = property_location_list + ['V8DOMConfiguration::kOnInstance'] %} + {% endif %} + {% if member.on_prototype %} +-{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnPrototype'] %} ++{% set property_location_list = property_location_list + ['V8DOMConfiguration::kOnPrototype'] %} + {% endif %} + {% if member.on_interface %} +-{% set property_location_list = property_location_list + ['V8DOMConfiguration::OnInterface'] %} ++{% set property_location_list = property_location_list + ['V8DOMConfiguration::kOnInterface'] %} + {% endif %} + {{property_location_list | join(' | ')}} + {%- endmacro %} + + + {% macro check_origin_trial(member, isolate="info.GetIsolate()") -%} +-ExecutionContext* executionContext = currentExecutionContext({{isolate}}); ++ExecutionContext* executionContext = CurrentExecutionContext({{isolate}}); + String errorMessage; + if (!{{member.origin_trial_enabled_function}}(executionContext, errorMessage)) { +- v8SetReturnValue(info, v8::Undefined(info.GetIsolate())); +- if (!errorMessage.isEmpty()) { +- executionContext->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, errorMessage)); ++ V8SetReturnValue(info, v8::Undefined(info.GetIsolate())); ++ if (!errorMessage.IsEmpty()) { ++ executionContext->AddConsoleMessage(ConsoleMessage::Create(kJSMessageSource, kErrorMessageLevel, errorMessage)); + } + return; + } +diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py +index 03bf4aaa816b..29475a0ad2e7 100755 +--- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py ++++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py +@@ -62,7 +62,7 @@ NONPROPERTIES = [ + 'type_name': 'bool', 'inherited': False, 'independent': False}, + {'name': 'StyleType', 'field_template': 'storage_only', 'size': 6, 'default_value': '0', + 'type_name': 'PseudoId', 'inherited': False, 'independent': False}, +- {'name': 'PseudoBits', 'field_template': 'storage_only', 'size': 8, 'default_value': 'PseudoIdNone', ++ {'name': 'PseudoBits', 'field_template': 'storage_only', 'size': 8, 'default_value': 'kPseudoIdNone', + 'type_name': 'PseudoId', 'inherited': False, 'independent': False}, + # True if 'underline solid' is the only text decoration on this element. + {'name': 'HasSimpleUnderline', 'field_template': 'storage_only', 'size': 1, 'default_value': 'false', +@@ -105,7 +105,7 @@ class Field(object): + """ + + def __init__(self, field_role, name_for_methods, property_name, type_name, +- field_template, size, default_value, **kwargs): ++ field_template, size, default_value, properties, **kwargs): + """Creates a new field.""" + self.name = class_member_name(name_for_methods) + self.property_name = property_name +@@ -129,11 +129,14 @@ class Field(object): + self.is_inherited_method_name = method_name(join_name(name_for_methods, 'is inherited')) + + # Method names +- getter_prefix = 'Get' if name_for_methods == self.type_name else '' +- self.getter_method_name = method_name(join_name(getter_prefix, name_for_methods)) +- self.setter_method_name = method_name(join_name('set', name_for_methods)) +- self.initial_method_name = method_name(join_name('initial', name_for_methods)) +- self.resetter_method_name = method_name(join_name('reset', name_for_methods)) ++ if 'getter' in properties and not self.is_inherited_flag: ++ self.getter_method_name = properties['getter'] ++ else: ++ getter_prefix = 'Get' if name_for_methods == self.type_name else '' ++ self.getter_method_name = method_name(join_name(getter_prefix, name_for_methods)) ++ self.setter_method_name = method_name(join_name('Set', name_for_methods)) ++ self.initial_method_name = method_name(join_name('Initial', name_for_methods)) ++ self.resetter_method_name = method_name(join_name('Reset', name_for_methods)) + + # If the size of the field is not None, it means it is a bit field + self.is_bit_field = self.size is not None +@@ -221,6 +224,7 @@ def _create_field(field_role, property_): + field_template=property_['field_template'], + size=size, + default_value=default_value, ++ properties=property_, + ) + + +@@ -237,6 +241,7 @@ def _create_inherited_flag_field(property_): + field_template='primitive', + size=1, + default_value='true', ++ properties=property_, + ) + + +diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py b/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py +index 80df8355a5d8..1fa4eba59cf0 100755 +--- a/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py ++++ b/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py +@@ -24,11 +24,11 @@ class CSSPropertyMetadataWriter(css_properties.CSSProperties): + def generate_css_property_metadata_cpp(self): + return { + 'properties_including_aliases': self._properties_including_aliases, +- 'switches': [('is_descriptor', 'isDescriptor'), +- ('is_property', 'isProperty'), +- ('interpolable', 'isInterpolableProperty'), +- ('inherited', 'isInheritedProperty'), +- ('supports_percentage', 'propertySupportsPercentage'), ++ 'switches': [('is_descriptor', 'IsDescriptor'), ++ ('is_property', 'IsProperty'), ++ ('interpolable', 'IsInterpolableProperty'), ++ ('inherited', 'IsInheritedProperty'), ++ ('supports_percentage', 'PropertySupportsPercentage'), + ], + 'first_enum_value': self._first_enum_value, + } +diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_names.py b/third_party/WebKit/Source/build/scripts/make_css_property_names.py +index b3e05b07a39d..949c1825d049 100755 +--- a/third_party/WebKit/Source/build/scripts/make_css_property_names.py ++++ b/third_party/WebKit/Source/build/scripts/make_css_property_names.py +@@ -122,7 +122,7 @@ struct Property; + %%define class-name %(class_name)sHash + %%define lookup-function-name findPropertyImpl + %%define hash-function-name property_hash_function +-%%define slot-name nameOffset ++%%define slot-name name_offset + %%define word-array-name property_word_list + %%enum + %%%% +@@ -133,7 +133,7 @@ struct Property; + #pragma clang diagnostic pop + #endif + +-const Property* findProperty(const char* str, unsigned int len) { ++const Property* FindProperty(const char* str, unsigned int len) { + return %(class_name)sHash::findPropertyImpl(str, len); + } + +@@ -149,7 +149,7 @@ const AtomicString& getPropertyNameAtomicString(CSSPropertyID id) { + static AtomicString* propertyStrings = + new AtomicString[lastUnresolvedCSSProperty]; // Leaked. + AtomicString& propertyString = propertyStrings[index]; +- if (propertyString.isNull()) { ++ if (propertyString.IsNull()) { + propertyString = AtomicString(propertyNameStringsPool + + propertyNameStringsOffsets[index]); + } +@@ -158,7 +158,7 @@ const AtomicString& getPropertyNameAtomicString(CSSPropertyID id) { + + String getPropertyNameString(CSSPropertyID id) { + // We share the StringImpl with the AtomicStrings. +- return getPropertyNameAtomicString(id).getString(); ++ return getPropertyNameAtomicString(id).GetString(); + } + + String getJSPropertyName(CSSPropertyID id) { +@@ -166,7 +166,7 @@ String getJSPropertyName(CSSPropertyID id) { + const char* cssPropertyName = getPropertyName(id); + const char* propertyNamePointer = cssPropertyName; + if (!propertyNamePointer) +- return emptyString; ++ return g_empty_string; + + char* resultPointer = result; + while (char character = *propertyNamePointer++) { +@@ -175,7 +175,7 @@ String getJSPropertyName(CSSPropertyID id) { + if (!nextCharacter) + break; + character = (propertyNamePointer - 2 != cssPropertyName) +- ? toASCIIUpper(nextCharacter) : nextCharacter; ++ ? ToASCIIUpper(nextCharacter) : nextCharacter; + } + *resultPointer++ = character; + } +diff --git a/third_party/WebKit/Source/build/scripts/make_css_tokenizer_codepoints.py b/third_party/WebKit/Source/build/scripts/make_css_tokenizer_codepoints.py +index d7e81d50e012..ce9cb40bdb22 100755 +--- a/third_party/WebKit/Source/build/scripts/make_css_tokenizer_codepoints.py ++++ b/third_party/WebKit/Source/build/scripts/make_css_tokenizer_codepoints.py +@@ -18,7 +18,7 @@ CPP_TEMPLATE = """ + + // Auto-generated by {module_pyname} + +-const CSSTokenizer::CodePoint CSSTokenizer::codePoints[{array_size}] = {{ ++const CSSTokenizer::CodePoint CSSTokenizer::kCodePoints[{array_size}] = {{ + {token_lines} + }}; + const unsigned codePointsNumber = {array_size}; +@@ -26,30 +26,30 @@ const unsigned codePointsNumber = {array_size}; + + + def token_type(i): +- codepoints = {'(': 'leftParenthesis', +- ')': 'rightParenthesis', +- '[': 'leftBracket', +- ']': 'rightBracket', +- '{': 'leftBrace', +- '}': 'rightBrace', +- '+': 'plusOrFullStop', +- '.': 'plusOrFullStop', +- '-': 'hyphenMinus', +- '*': 'asterisk', +- '<': 'lessThan', +- ',': 'comma', +- '/': 'solidus', +- '\\': 'reverseSolidus', +- ':': 'colon', +- ';': 'semiColon', +- '#': 'hash', +- '^': 'circumflexAccent', +- '$': 'dollarSign', +- '|': 'verticalLine', +- '~': 'tilde', +- '@': 'commercialAt', +- 'u': 'letterU', +- 'U': 'letterU', ++ codepoints = {'(': 'LeftParenthesis', ++ ')': 'RightParenthesis', ++ '[': 'LeftBracket', ++ ']': 'RightBracket', ++ '{': 'LeftBrace', ++ '}': 'RightBrace', ++ '+': 'PlusOrFullStop', ++ '.': 'PlusOrFullStop', ++ '-': 'HyphenMinus', ++ '*': 'Asterisk', ++ '<': 'LessThan', ++ ',': 'Comma', ++ '/': 'Solidus', ++ '\\': 'ReverseSolidus', ++ ':': 'Colon', ++ ';': 'SemiColon', ++ '#': 'Hash', ++ '^': 'CircumflexAccent', ++ '$': 'DollarSign', ++ '|': 'VerticalLine', ++ '~': 'Tilde', ++ '@': 'CommercialAt', ++ 'u': 'LetterU', ++ 'U': 'LetterU', + } + c = chr(i) + if c in codepoints: +@@ -57,15 +57,15 @@ def token_type(i): + whitespace = '\n\r\t\f ' + quotes = '"\'' + if c in whitespace: +- return 'whiteSpace' ++ return 'WhiteSpace' + if c.isdigit(): +- return 'asciiDigit' ++ return 'AsciiDigit' + if c.isalpha() or c == '_': +- return 'nameStart' ++ return 'NameStart' + if c in quotes: +- return 'stringStart' ++ return 'StringStart' + if i == 0: +- return 'endOfFile' ++ return 'EndOfFile' + + + class MakeCSSTokenizerCodePointsWriter(in_generator.Writer): +diff --git a/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py b/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py +index 71c4efc6f4d8..96546ca5997a 100755 +--- a/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py ++++ b/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py +@@ -77,7 +77,7 @@ struct Value; + %%define class-name %(class_name)sHash + %%define lookup-function-name findValueImpl + %%define hash-function-name value_hash_function +-%%define slot-name nameOffset ++%%define slot-name name_offset + %%define word-array-name value_word_list + %%pic + %%enum +@@ -89,7 +89,7 @@ struct Value; + #pragma clang diagnostic pop + #endif + +-const Value* findValue(const char* str, unsigned int len) { ++const Value* FindValue(const char* str, unsigned int len) { + return CSSValueKeywordsHash::findValueImpl(str, len); + } + +@@ -101,9 +101,9 @@ const char* getValueName(CSSValueID id) { + bool isValueAllowedInMode(unsigned short id, CSSParserMode mode) { + switch (id) { + %(ua_sheet_mode_values_keywords)s +- return isUASheetBehavior(mode); ++ return IsUASheetBehavior(mode); + %(quirks_mode_or_ua_sheet_mode_values_keywords)s +- return isUASheetBehavior(mode) || isQuirksModeBehavior(mode); ++ return IsUASheetBehavior(mode) || IsQuirksModeBehavior(mode); + default: + return true; + } +diff --git a/third_party/WebKit/Source/build/scripts/make_instrumenting_probes.py b/third_party/WebKit/Source/build/scripts/make_instrumenting_probes.py +index 0b7105acdb14..d769096f5657 100644 +--- a/third_party/WebKit/Source/build/scripts/make_instrumenting_probes.py ++++ b/third_party/WebKit/Source/build/scripts/make_instrumenting_probes.py +@@ -24,6 +24,7 @@ third_party_dir = os.path.normpath(os.path.join(module_path, os.pardir, os.pardi + sys.path.insert(1, third_party_dir) + import jinja2 + ++from name_utilities import method_name + + def _json5_loads(lines): + # Use json5.loads when json5 is available. Currently we use simple +@@ -245,6 +246,7 @@ template_context = { + "files": files, + "agents": build_observers(), + "config": config, ++ "method_name": method_name, + "name": base_name, + "input_file": os.path.basename(input_path) + } +diff --git a/third_party/WebKit/Source/build/scripts/make_media_features.py b/third_party/WebKit/Source/build/scripts/make_media_features.py +index b1041248ebb3..22db17424d2a 100755 +--- a/third_party/WebKit/Source/build/scripts/make_media_features.py ++++ b/third_party/WebKit/Source/build/scripts/make_media_features.py +@@ -19,6 +19,7 @@ class MakeMediaFeaturesWriter(json5_generator.Writer): + filters = { + 'symbol': media_feature_symbol.getMediaFeatureSymbolWithSuffix(''), + 'to_macro_style': name_utilities.to_macro_style, ++ 'upper_first_letter': name_utilities.upper_first_letter, + } + + def __init__(self, json5_file_path): +diff --git a/third_party/WebKit/Source/build/scripts/make_style_builder.py b/third_party/WebKit/Source/build/scripts/make_style_builder.py +index 70cc8e98e3e8..f73c570bc698 100755 +--- a/third_party/WebKit/Source/build/scripts/make_style_builder.py ++++ b/third_party/WebKit/Source/build/scripts/make_style_builder.py +@@ -57,16 +57,16 @@ class StyleBuilderWriter(css_properties.CSSProperties): + name = property['name_for_methods'] + simple_type_name = str(property['type_name']).split('::')[-1] + set_if_none(property, 'type_name', 'E' + name) +- set_if_none(property, 'getter', lower_first(name) if simple_type_name != name else 'get' + name) +- set_if_none(property, 'setter', 'set' + name) ++ set_if_none(property, 'getter', name if simple_type_name != name else 'Get' + name) ++ set_if_none(property, 'setter', 'Set' + name) + set_if_none(property, 'inherited', False) +- set_if_none(property, 'initial', 'initial' + name) ++ set_if_none(property, 'initial', 'Initial' + name) + if property['custom_all']: + property['custom_initial'] = True + property['custom_inherit'] = True + property['custom_value'] = True + if property['inherited']: +- property['is_inherited_setter'] = 'set' + name + 'IsInherited' ++ property['is_inherited_setter'] = 'Set' + name + 'IsInherited' + property['should_declare_functions'] = not property['use_handlers_for'] and not property['longhands'] \ + and not property['direction_aware'] and not property['builder_skip'] \ + and property['is_property'] +diff --git a/third_party/WebKit/Source/build/scripts/name_utilities.py b/third_party/WebKit/Source/build/scripts/name_utilities.py +index cd4dad7997db..df4b8436ffa4 100644 +--- a/third_party/WebKit/Source/build/scripts/name_utilities.py ++++ b/third_party/WebKit/Source/build/scripts/name_utilities.py +@@ -148,11 +148,12 @@ def enum_value_name(name): + + + def class_member_name(name): +- return 'm_' + lower_camel_case(name) ++ lower_case_words = [word.lower() for word in split_name(name)] ++ return "_".join(lower_case_words) + "_" + + + def method_name(name): +- return lower_camel_case(name) ++ return upper_camel_case(name) + + + def join_name(*names): +diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl +index 776272850292..f865a43e9902 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl +@@ -23,7 +23,7 @@ KeywordTable createKeywordTable() { + {% for keywordValueID in property.keywordIDs %} + {{property.lower_camel_name}}Keywords.push_back({{keywordValueID}}); + {% endfor %} +- table.set({{property_id}}, {{property.lower_camel_name}}Keywords); ++ table.Set({{property_id}}, {{property.lower_camel_name}}Keywords); + } + {% endfor %} + return table; +@@ -36,9 +36,9 @@ KeywordTable& keywordTable() { + + } // namespace + +-bool CSSOMKeywords::validKeywordForProperty(CSSPropertyID id, ++bool CSSOMKeywords::ValidKeywordForProperty(CSSPropertyID id, + const CSSKeywordValue& keyword) { +- CSSValueID valueID = keyword.keywordValueID(); ++ CSSValueID valueID = keyword.KeywordValueID(); + if (valueID == CSSValueInvalid) { + return false; + } +@@ -49,12 +49,12 @@ bool CSSOMKeywords::validKeywordForProperty(CSSPropertyID id, + return true; + } + +- const KeywordTable::iterator tableIterator = keywordTable().find(id); ++ const KeywordTable::iterator tableIterator = keywordTable().Find(id); + if (tableIterator == keywordTable().end()) { + return false; + } + +- return tableIterator->value.contains(valueID); ++ return tableIterator->value.Contains(valueID); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl +index 33b93b0688df..7c90430ad536 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/CSSOMTypes.cpp.tmpl +@@ -12,35 +12,35 @@ + + namespace blink { + +-bool CSSOMTypes::propertyCanTake(CSSPropertyID id, ++bool CSSOMTypes::PropertyCanTake(CSSPropertyID id, + const CSSStyleValue& styleValue) { + // Shortcut special case. +- if (styleValue.type() == CSSStyleValue::SimpleLengthType || +- styleValue.type() == CSSStyleValue::CalcLengthType) { +- if (toCSSLengthValue(styleValue).containsPercent() && +- !CSSPropertyMetadata::propertySupportsPercentage(id)) { ++ if (styleValue.GetType() == CSSStyleValue::kSimpleLengthType || ++ styleValue.GetType() == CSSStyleValue::kCalcLengthType) { ++ if (ToCSSLengthValue(styleValue).ContainsPercent() && ++ !CSSPropertyMetadata::PropertySupportsPercentage(id)) { + return false; + } +- } else if (styleValue.type() == CSSStyleValue::KeywordType) { ++ } else if (styleValue.GetType() == CSSStyleValue::kKeywordType) { + // Keywords are also handled differently. +- return CSSOMKeywords::validKeywordForProperty( +- id, toCSSKeywordValue(styleValue)); +- } else if (styleValue.type() == CSSStyleValue::Unknown) { ++ return CSSOMKeywords::ValidKeywordForProperty( ++ id, ToCSSKeywordValue(styleValue)); ++ } else if (styleValue.GetType() == CSSStyleValue::kUnknown) { + // The check happens later in this case. + return true; + } + +- return CSSOMTypes::propertyCanTakeType(id, styleValue.type()); ++ return CSSOMTypes::PropertyCanTakeType(id, styleValue.GetType()); + } + +-bool CSSOMTypes::propertyCanTakeType(CSSPropertyID id, ++bool CSSOMTypes::PropertyCanTakeType(CSSPropertyID id, + CSSStyleValue::StyleValueType type) { + switch (id) { + {% for property_id, property in properties.items() if property.typedom_types %} + case {{property_id}}: + return ( + {% for type in property.typedom_types %} +- {{ "|| " if not loop.first }}type == CSSStyleValue::{{type}}Type ++ {{ "|| " if not loop.first }}type == CSSStyleValue::k{{type}}Type + {% endfor %} + ); + {% endfor %} +diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl +index 108509aced5c..61c62cd85310 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl +@@ -16,17 +16,17 @@ CSSPrimitiveValue::UnitType cssPrimitiveValueUnitFromTrie( + DCHECK(length); + {% macro trie_return_statement(unit_name) %}CSSPrimitiveValue::UnitType::{{unit_name}}{% endmacro %} + {{ trie_length_switch(length_tries, trie_return_statement, True) | indent(4) }} +- return CSSPrimitiveValue::UnitType::Unknown; ++ return CSSPrimitiveValue::UnitType::kUnknown; + } + + } // namespace + +-CSSPrimitiveValue::UnitType CSSPrimitiveValue::stringToUnitType( ++CSSPrimitiveValue::UnitType CSSPrimitiveValue::StringToUnitType( + const LChar* characters8, unsigned length) { + return cssPrimitiveValueUnitFromTrie(characters8, length); + } + +-CSSPrimitiveValue::UnitType CSSPrimitiveValue::stringToUnitType( ++CSSPrimitiveValue::UnitType CSSPrimitiveValue::StringToUnitType( + const UChar* characters16, unsigned length) { + return cssPrimitiveValueUnitFromTrie(characters16, length); + } +diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl +index ea16a173d3ba..b78f752ae39a 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.cpp.tmpl +@@ -50,7 +50,7 @@ static size_t CSSDescriptorIndices[] = { + {% endfor %} + }; + +-const CSSPropertyDescriptor& CSSPropertyDescriptor::get(CSSPropertyID id) { ++const CSSPropertyDescriptor& CSSPropertyDescriptor::Get(CSSPropertyID id) { + return cssPropertyDescriptors[CSSDescriptorIndices[id]]; + } + +diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.h.tmpl +index 6012ba22efae..33f5a674c2c6 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.h.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyDescriptor.h.tmpl +@@ -19,7 +19,7 @@ struct CSSPropertyDescriptor { + // Returns the corresponding CSSPropertyDescriptor for a given CSSPropertyID. + // Use this function to access the API for a property. Returns a descriptor + // with isValid set to false if no descriptor exists for this ID. +- static const CSSPropertyDescriptor& get(CSSPropertyID); ++ static const CSSPropertyDescriptor& Get(CSSPropertyID); + }; + + } // namespace blink +diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl +index d834f5483d5e..219fbc6a1bbf 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl +@@ -17,10 +17,10 @@ bool CSSPropertyMetadata::{{function_name}}(CSSPropertyID unresolvedProperty) { + {% for property in properties_including_aliases if property[flag] %} + case {{property.property_id}}: + {% endfor %} +- {% if function_name in ("isInheritedProperty", "isProperty") %} ++ {% if function_name in ("IsInheritedProperty", "IsProperty") %} + case CSSPropertyVariable: + {% endif %} +- {% if function_name == "isProperty" %} ++ {% if function_name == "IsProperty" %} + case CSSPropertyApplyAtRule: + {% endif %} + return true; +@@ -30,7 +30,7 @@ bool CSSPropertyMetadata::{{function_name}}(CSSPropertyID unresolvedProperty) { + } + {% endfor %} + +-char CSSPropertyMetadata::repetitionSeparator(CSSPropertyID unresolvedProperty) { ++char CSSPropertyMetadata::RepetitionSeparator(CSSPropertyID unresolvedProperty) { + switch (unresolvedProperty) { + {% for property in properties_including_aliases if property.separator %} + case {{property.property_id}}: +@@ -41,11 +41,11 @@ char CSSPropertyMetadata::repetitionSeparator(CSSPropertyID unresolvedProperty) + } + } + +-bool CSSPropertyMetadata::propertyIsRepeated(CSSPropertyID unresolvedProperty) { +- return repetitionSeparator(unresolvedProperty) != 0; ++bool CSSPropertyMetadata::PropertyIsRepeated(CSSPropertyID unresolvedProperty) { ++ return RepetitionSeparator(unresolvedProperty) != 0; + } + +-bool CSSPropertyMetadata::isEnabledProperty(CSSPropertyID unresolvedProperty) { ++bool CSSPropertyMetadata::IsEnabledProperty(CSSPropertyID unresolvedProperty) { + CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); + static std::bitset<numCSSProperties>* enabledProperties = nullptr; + if (!enabledProperties) { +@@ -69,13 +69,13 @@ bool CSSPropertyMetadata::isEnabledProperty(CSSPropertyID unresolvedProperty) { + return RuntimeEnabledFeatures::cssApplyAtRulesEnabled(); + } + +-void CSSPropertyMetadata::filterEnabledCSSPropertiesIntoVector( ++void CSSPropertyMetadata::FilterEnabledCSSPropertiesIntoVector( + const CSSPropertyID* properties, + size_t propertyCount, + Vector<CSSPropertyID>& outVector) { + for (unsigned i = 0; i < propertyCount; i++) { + CSSPropertyID property = properties[i]; +- if (isEnabledProperty(property)) ++ if (IsEnabledProperty(property)) + outVector.push_back(property); + } + } +diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl +index 4c8ec2878b49..16f0ab40d9eb 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl +@@ -17,21 +17,21 @@ struct SameSizeAsComputedStyleBase { + // ensure that the buckets are placed so that each takes up at most 1 word. + ASSERT_SIZE(ComputedStyleBase, SameSizeAsComputedStyleBase); + +-void ComputedStyleBase::inheritFrom(const ComputedStyleBase& inheritParent, ++void ComputedStyleBase::InheritFrom(const ComputedStyleBase& inheritParent, + IsAtShadowBoundary isAtShadowBoundary) { + {% for field in fields if field.is_inherited %} + {{field.name}} = inheritParent.{{field.name}}; + {% endfor %} + } + +-void ComputedStyleBase::copyNonInheritedFromCached( ++void ComputedStyleBase::CopyNonInheritedFromCached( + const ComputedStyleBase& other) { + {% for field in fields if (field.is_property and not field.is_inherited) or field.is_inherited_flag %} + {{field.name}} = other.{{field.name}}; + {% endfor %} + } + +-void ComputedStyleBase::propagateIndependentInheritedProperties( ++void ComputedStyleBase::PropagateIndependentInheritedProperties( + const ComputedStyleBase& parentStyle) { + {% for field in fields if field.is_property and field.is_independent %} + if ({{field.is_inherited_method_name}}()) +diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl +index 5325ec38c198..03a48012e77d 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl +@@ -33,7 +33,7 @@ namespace blink { + // in ComputedStyle.h. + class CORE_EXPORT ComputedStyleBase { + public: +- inline bool independentInheritedEqual(const ComputedStyleBase& o) const { ++ inline bool IndependentInheritedEqual(const ComputedStyleBase& o) const { + return ( + {% for field in fields if field.is_inherited and field.is_independent %} + {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} +@@ -41,7 +41,7 @@ class CORE_EXPORT ComputedStyleBase { + ); + } + +- inline bool nonIndependentInheritedEqual(const ComputedStyleBase& o) const { ++ inline bool NonIndependentInheritedEqual(const ComputedStyleBase& o) const { + return ( + {% for field in fields if field.is_inherited and not field.is_independent %} + {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} +@@ -49,11 +49,11 @@ class CORE_EXPORT ComputedStyleBase { + ); + } + +- inline bool inheritedEqual(const ComputedStyleBase& o) const { +- return independentInheritedEqual(o) && nonIndependentInheritedEqual(o); ++ inline bool InheritedEqual(const ComputedStyleBase& o) const { ++ return IndependentInheritedEqual(o) && NonIndependentInheritedEqual(o); + } + +- inline bool nonInheritedEqual(const ComputedStyleBase& o) const { ++ inline bool NonInheritedEqual(const ComputedStyleBase& o) const { + return ( + {% for field in fields if field.is_property and not field.is_inherited %} + {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} +@@ -62,17 +62,17 @@ class CORE_EXPORT ComputedStyleBase { + } + + enum IsAtShadowBoundary { +- AtShadowBoundary, +- NotAtShadowBoundary, ++ kAtShadowBoundary, ++ kNotAtShadowBoundary, + }; +- void inheritFrom(const ComputedStyleBase& inheritParent, +- IsAtShadowBoundary isAtShadowBoundary = NotAtShadowBoundary); ++ void InheritFrom(const ComputedStyleBase& inheritParent, ++ IsAtShadowBoundary isAtShadowBoundary = kNotAtShadowBoundary); + +- void copyNonInheritedFromCached(const ComputedStyleBase& other); ++ void CopyNonInheritedFromCached(const ComputedStyleBase& other); + + // Copies the values of any independent inherited properties from the parent + // style that are marked as inherited by this style. +- void propagateIndependentInheritedProperties( ++ void PropagateIndependentInheritedProperties( + const ComputedStyleBase& parentStyle); + + // Fields. +diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl +index 280201db8ac5..4dfd11502eb9 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl +@@ -38,12 +38,12 @@ static {{namespace}}Element* {{tag|symbol}}Constructor( + CreateElementFlags flags) { + {% if tag.runtimeEnabled %} + if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled()) +- return {{fallback_interface}}::create({{tag|symbol}}Tag, document); ++ return {{fallback_interface}}::Create({{tag|symbol}}Tag, document); + {% endif %} +- return {{tag.interface}}::create( ++ return {{tag.interface}}::Create( + {%- if tag.multipleTagNames %}{{tag|symbol}}Tag, {% endif -%} + document +- {%- if tag.constructorNeedsCreatedByParser %}, flags & CreatedByParser{% endif -%} ++ {%- if tag.constructorNeedsCreatedByParser %}, flags & kCreatedByParser{% endif -%} + ); + } + {% endfor %} +@@ -64,7 +64,7 @@ static void create{{namespace}}FunctionMap() { + {% endfor %} + }; + for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) +- g_constructors->set(data[i].tag.localName(), data[i].func); ++ g_constructors->Set(data[i].tag.LocalName(), data[i].func); + } + + {{namespace}}Element* {{namespace}}ElementFactory::create{{namespace}}Element( +@@ -82,23 +82,23 @@ static void create{{namespace}}FunctionMap() { + // TODO(dominicc): When the HTML parser can pass an error + // reporting ExceptionState, and "v0" custom elements have been + // removed, consolidate custom element creation into one place. +- if (flags != CreatedByCreateElement && CustomElement::shouldCreateCustomElement(localName)) { +- QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI); +- if (flags & AsynchronousCustomElements) +- return CustomElement::createCustomElementAsync(document, tagName); +- return CustomElement::createCustomElementSync(document, tagName); ++ if (flags != kCreatedByCreateElement && CustomElement::ShouldCreateCustomElement(localName)) { ++ QualifiedName tagName(g_null_atom, localName, HTMLNames::xhtmlNamespaceURI); ++ if (flags & kAsynchronousCustomElements) ++ return CustomElement::CreateCustomElementAsync(document, tagName); ++ return CustomElement::CreateCustomElementSync(document, tagName); + } + {% endif %} + +- if (document.registrationContext() && +- V0CustomElement::isValidName(localName)) { +- Element* element = document.registrationContext()->createCustomTagElement( +- document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI)); +- SECURITY_DCHECK(element->is{{namespace}}Element()); +- return to{{namespace}}Element(element); ++ if (document.RegistrationContext() && ++ V0CustomElement::IsValidName(localName)) { ++ Element* element = document.RegistrationContext()->CreateCustomTagElement( ++ document, QualifiedName(g_null_atom, localName, {{namespace_prefix}}NamespaceURI)); ++ SECURITY_DCHECK(element->Is{{namespace}}Element()); ++ return To{{namespace}}Element(element); + } + +- return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI), document); ++ return {{fallback_interface}}::Create(QualifiedName(g_null_atom, localName, {{namespace_prefix}}NamespaceURI), document); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl +index e684bc32724f..8bd30a00d1e8 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl +@@ -22,7 +22,7 @@ class {{namespace}}ElementFactory { + static {{namespace}}Element* create{{namespace}}Element( + const AtomicString& localName, + Document&, +- CreateElementFlags flags = CreatedByParser); ++ CreateElementFlags flags = kCreatedByParser); + }; + + } // namespace blink +diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.cpp.tmpl +index 4d6828a42b74..3bc573e57226 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.cpp.tmpl +@@ -14,7 +14,7 @@ using namespace {{namespace}}Names; + StringImpl* lookup{{namespace}}Tag(const UChar* data, unsigned length) { + DCHECK(data); + DCHECK(length); +- {% macro trie_return_statement(tag) %}{{tag}}Tag.localName().impl(){% endmacro %} ++ {% macro trie_return_statement(tag) %}{{tag}}Tag.LocalName().Impl(){% endmacro %} + {{ trie_length_switch(length_tries, trie_return_statement, false) | indent(4) }} + return nullptr; + } +diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl +index fafe78021108..4afbeca8ad77 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl +@@ -17,13 +17,13 @@ void createHTMLTypeMap() { + DCHECK(!html_type_map); + html_type_map = new HTMLTypeMap; + {% for tag in tags|sort %} +- html_type_map->set(AtomicString("{{tag.name}}"), HTMLElementType::k{{tag.interface}}); ++ html_type_map->Set(AtomicString("{{tag.name}}"), HTMLElementType::k{{tag.interface}}); + {% endfor %} + } + + HTMLElementType htmlElementTypeForTag(const AtomicString& tagName) { + if (!html_type_map) createHTMLTypeMap(); +- if (html_type_map->contains(tagName)) { ++ if (html_type_map->Contains(tagName)) { + {% for tag in tags|sort %} + {% if tag.runtimeEnabled %} + if (tagName == "{{tag.name}}") { +diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl +index 35ca29d97c3c..4ea2e9657a03 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl +@@ -21,23 +21,23 @@ inline bool is{{tag.interface}}(const {{namespace}}Element& element) { + if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled()) + return false; + {% endif %} +- return element.hasTagName({{namespace}}Names::{{tag|symbol}}Tag); ++ return element.HasTagName({{namespace}}Names::{{tag|symbol}}Tag); + } + inline bool is{{tag.interface}}(const {{namespace}}Element* element) { + return element && is{{tag.interface}}(*element); + } + inline bool is{{tag.interface}}(const Node& node) { +- return node.is{{namespace}}Element() && is{{tag.interface}}(to{{namespace}}Element(node)); ++ return node.Is{{namespace}}Element() && is{{tag.interface}}(To{{namespace}}Element(node)); + } + inline bool is{{tag.interface}}(const Node* node) { + return node && is{{tag.interface}}(*node); + } + template <> +-inline bool isElementOfType<const {{tag.interface}}>(const Node& node) { ++inline bool IsElementOfType<const {{tag.interface}}>(const Node& node) { + return is{{tag.interface}}(node); + } + template <> +-inline bool isElementOfType<const {{tag.interface}}>(const {{namespace}}Element& element) { ++inline bool IsElementOfType<const {{tag.interface}}>(const {{namespace}}Element& element) { + return is{{tag.interface}}(element); + } + +@@ -47,8 +47,8 @@ inline bool isElementOfType<const {{tag.interface}}>(const {{namespace}}Element& + // unsafe due to multiple inheritence. + + {% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} +-#define to{{tag.interface}}(x) blink::toElement<blink::{{tag.interface}}>(x) +-#define to{{tag.interface}}OrDie(x) blink::toElementOrDie<blink::{{tag.interface}}>(x) ++#define to{{tag.interface}}(x) blink::ToElement<blink::{{tag.interface}}>(x) ++#define to{{tag.interface}}OrDie(x) blink::ToElementOrDie<blink::{{tag.interface}}>(x) + {% endfor %} + + {% if namespace == "HTML" %} +diff --git a/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl +index b5fa84794be1..b552329352a7 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/EventFactory.cpp.tmpl +@@ -13,17 +13,17 @@ + + namespace blink { + +-{{namespace}}* {{namespace}}{{suffix}}Factory::create(ExecutionContext* executionContext, const String& type) { ++{{namespace}}* {{namespace}}{{suffix}}Factory::Create(ExecutionContext* executionContext, const String& type) { + {% for event in events if event|script_name|create_event_whitelist or event|script_name|create_event_measure_whitelist %} + {% if event|script_name|create_event_whitelist or event|script_name|create_event_measure_whitelist %} +- if (equalIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { ++ if (EqualIgnoringCase(type, "{{event|script_name}}"){% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { + {% else %} + if (type == "{{event|script_name}}"{% if event.RuntimeEnabled %} && RuntimeEnabledFeatures::{{event.RuntimeEnabled|lower_first}}(){% endif %}) { + {% endif %} + {% if not event|script_name|create_event_whitelist %} +- UseCounter::count(executionContext, UseCounter::{{event|script_name|measure_name}}); ++ UseCounter::Count(executionContext, UseCounter::k{{event|script_name|measure_name}}); + {% endif %} +- return {{event|cpp_name}}::create(); ++ return {{event|cpp_name}}::Create(); + } + {% endfor %} + return nullptr; +diff --git a/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl +index 4db548ba0847..6dd319b62f24 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl +@@ -28,7 +28,7 @@ void {{sink_class}}::add{{class_name}}({{class_name}}* agent) { + + void {{sink_class}}::remove{{class_name}}({{class_name}}* agent) { + m_{{getter_name}}s.erase(agent); +- m_has{{class_name}}s = !m_{{getter_name}}s.isEmpty(); ++ m_has{{class_name}}s = !m_{{getter_name}}s.IsEmpty(); + } + + {% endfor -%} +@@ -37,7 +37,7 @@ DEFINE_TRACE({{sink_class}}) + { + {% for agent in agents %} + {% set getter_name = agent | agent_name_to_class | to_lower_case %} +- visitor->trace(m_{{getter_name}}s); ++ visitor->Trace(m_{{getter_name}}s); + {% endfor %} + } + +@@ -50,8 +50,8 @@ namespace probe { + {%- endmacro %} + + {% macro probe_body(probe, common_name) %} +-{% set agent_probe_name = common_name or probe.name %} +- {{sink_class}}* sink = to{{sink_class}}({{probe.params[0].name}}); ++{% set agent_probe_name = method_name(common_name or probe.name) %} ++ {{sink_class}}* sink = To{{sink_class}}({{probe.params[0].name}}); + if (!sink) + return; + {% for param in probe.params %} +@@ -77,11 +77,11 @@ namespace probe { + {%- if not loop.last %}, + {% endif %} + {% endfor %} { +-{% call probe_body(probe, "will") %}*this{% endcall %} ++{% call probe_body(probe, "Will") %}*this{% endcall %} + } + + {{probe.name}}::~{{probe.name}}() { +-{% call probe_body(probe, "did") %}*this{% endcall %} ++{% call probe_body(probe, "Did") %}*this{% endcall %} + } + + {% else -%} +diff --git a/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.cpp.tmpl +index 5eb67dfdd737..66cdd9a0314d 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.cpp.tmpl +@@ -11,7 +11,7 @@ namespace blink { + InternalSettingsGenerated::InternalSettingsGenerated(Page* page) + : m_page(page) + {% for setting in settings if setting.type|to_idl_type %} +- , m_{{setting.name}}(page->settings().get{{setting.name|upper_first}}()) ++ , m_{{setting.name}}(page->GetSettings().Get{{setting.name|upper_first}}()) + {% endfor %} + { + } +@@ -20,18 +20,18 @@ InternalSettingsGenerated::~InternalSettingsGenerated() {} + + void InternalSettingsGenerated::resetToConsistentState() { + {% for setting in settings if setting.type|to_idl_type %} +- m_page->settings().set{{setting.name|upper_first}}(m_{{setting.name}}); ++ m_page->GetSettings().Set{{setting.name|upper_first}}(m_{{setting.name}}); + {% endfor %} + } + {% for setting in settings if setting.type|to_idl_type %} + + void InternalSettingsGenerated::set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) { +- m_page->settings().set{{setting.name|upper_first}}({{setting.name}}); ++ m_page->GetSettings().Set{{setting.name|upper_first}}({{setting.name}}); + } + {% endfor %} + + DEFINE_TRACE(InternalSettingsGenerated) { +- visitor->trace(m_page); ++ visitor->Trace(m_page); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl +index 3621be2e6045..01f860bcebc2 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl +@@ -35,7 +35,7 @@ void init{{suffix}}() { + }; + + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kNames); i++) { +- StringImpl* stringImpl = StringImpl::createStatic(kNames[i].name, kNames[i].length, kNames[i].hash); ++ StringImpl* stringImpl = StringImpl::CreateStatic(kNames[i].name, kNames[i].length, kNames[i].hash); + void* address = reinterpret_cast<AtomicString*>(&{{suffix}}NamesStorage) + i; + new (address) AtomicString(stringImpl); + } +diff --git a/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl +index 69f37ea04db7..25f9ba9f46e4 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl +@@ -25,7 +25,7 @@ const {{namespace}}QualifiedName& {{tag|symbol}}Tag = reinterpret_cast<{{namespa + + + std::unique_ptr<const {{namespace}}QualifiedName*[]> get{{namespace}}Tags() { +- std::unique_ptr<const {{namespace}}QualifiedName*[]> tags = wrapArrayUnique(new const {{namespace}}QualifiedName*[{{namespace}}TagsCount]); ++ std::unique_ptr<const {{namespace}}QualifiedName*[]> tags = WrapArrayUnique(new const {{namespace}}QualifiedName*[{{namespace}}TagsCount]); + for (size_t i = 0; i < {{namespace}}TagsCount; i++) + tags[i] = reinterpret_cast<{{namespace}}QualifiedName*>(&{{suffix}}TagStorage) + i; + return tags; +@@ -42,7 +42,7 @@ const QualifiedName& {{attr|symbol}}Attr = reinterpret_cast<QualifiedName*>(&{{s + + {% if namespace != 'HTML' %} + std::unique_ptr<const QualifiedName*[]> get{{namespace}}Attrs() { +- std::unique_ptr<const QualifiedName*[]> attrs = wrapArrayUnique(new const QualifiedName*[{{namespace}}AttrsCount]); ++ std::unique_ptr<const QualifiedName*[]> attrs = WrapArrayUnique(new const QualifiedName*[{{namespace}}AttrsCount]); + for (size_t i = 0; i < {{namespace}}AttrsCount; i++) + attrs[i] = reinterpret_cast<QualifiedName*>(&{{suffix}}AttrStorage) + i; + return attrs; +@@ -77,11 +77,11 @@ void init() { + {% endif %} + size_t attr_i = 0; + for (size_t i = 0; i < WTF_ARRAY_LENGTH(kNames); i++) { +- StringImpl* stringImpl = StringImpl::createStatic(kNames[i].name, kNames[i].length, kNames[i].hash); ++ StringImpl* stringImpl = StringImpl::CreateStatic(kNames[i].name, kNames[i].length, kNames[i].hash); + {% if tags %} + if (kNames[i].isTag) { + void* address = reinterpret_cast<{{namespace}}QualifiedName*>(&{{suffix}}TagStorage) + tag_i; +- QualifiedName::createStatic(address, stringImpl, {{namespace_prefix}}NS); ++ QualifiedName::CreateStatic(address, stringImpl, {{namespace_prefix}}NS); + tag_i++; + } + +@@ -90,9 +90,9 @@ void init() { + {% endif %} + void* address = reinterpret_cast<QualifiedName*>(&{{suffix}}AttrStorage) + attr_i; + {% if use_namespace_for_attrs %} +- QualifiedName::createStatic(address, stringImpl, {{namespace_prefix}}NS); ++ QualifiedName::CreateStatic(address, stringImpl, {{namespace_prefix}}NS); + {% else %} +- QualifiedName::createStatic(address, stringImpl); ++ QualifiedName::CreateStatic(address, stringImpl); + {% endif %} + attr_i++; + } +diff --git a/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl +index d4a56ab0eb1f..e357f3b1c269 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/MediaFeatures.h.tmpl +@@ -6,7 +6,9 @@ + + #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \ + {% for entry in entries %} +- macro({{entry|symbol}}){% if not loop.last %} \ ++ {% set constant_prefix = entry | symbol %} ++ {% set method_prefix = constant_prefix | upper_first_letter %} ++ macro({{constant_prefix}}, {{method_prefix}}){% if not loop.last %} \ + {% endif %} + {% endfor %} + +diff --git a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl +index 5d81ac5a16a7..4b222bdf05eb 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.cpp.tmpl +@@ -22,9 +22,9 @@ bool OriginTrials::{{feature.first_lowered_name}}Enabled(ExecutionContext* execu + {%- endfor %} + {% endif %} + +- OriginTrialContext* context =OriginTrialContext::from(executionContext, +- OriginTrialContext::DontCreateIfNotExists); +- return context && context->isTrialEnabled("{{feature.origin_trial_feature_name}}"); ++ OriginTrialContext* context =OriginTrialContext::From(executionContext, ++ OriginTrialContext::kDontCreateIfNotExists); ++ return context && context->IsTrialEnabled("{{feature.origin_trial_feature_name}}"); + {% if feature.origin_trial_os %} + #else + return false; +diff --git a/third_party/WebKit/Source/build/scripts/templates/SettingsMacros.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/SettingsMacros.h.tmpl +index c21f1b65b446..18e5f9cca31a 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/SettingsMacros.h.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/SettingsMacros.h.tmpl +@@ -6,8 +6,8 @@ + + #define SETTINGS_GETTERS_AND_SETTERS \ + {% for setting in settings %} +- {{setting.type|to_passing_type}} get{{setting.name|upper_first}}() const { return m_{{setting.name}}; } \ +- void set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}); \ ++ {{setting.type|to_passing_type}} Get{{setting.name|upper_first}}() const { return m_{{setting.name}}; } \ ++ void Set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}); \ + {% endfor %} + void setFromStrings(const String& name, const String& value); + // End of SETTINGS_GETTERS_AND_SETTERS. +@@ -32,31 +32,31 @@ + + #define SETTINGS_SETTER_BODIES \ + {% for setting in settings %} +-void Settings::set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) { \ ++void Settings::Set{{setting.name|upper_first}}({{setting.type|to_passing_type}} {{setting.name}}) { \ + if (m_{{setting.name}} == {{setting.name}}) \ + return; \ + m_{{setting.name}} = {{setting.name}}; \ + {% if setting.invalidate %} +- invalidate(SettingsDelegate::{{setting.invalidate}}Change); \ ++ Invalidate(SettingsDelegate::k{{setting.invalidate}}Change); \ + {% endif %} + } \ + {% endfor %} + void Settings::setFromStrings(const String& name, const String& value) { \ + {% for setting in settings %} + if (name == "{{setting.name}}") { \ +- set{{setting.name|upper_first}}( \ ++ Set{{setting.name|upper_first}}( \ + {% if setting.type == 'String' %} + value \ + {% elif setting.type == 'bool' %} +- value.isEmpty() || value == "true" \ ++ value.IsEmpty() || value == "true" \ + {% elif setting.type == 'int' %} +- value.toInt() \ ++ value.ToInt() \ + {% elif setting.type == 'float' %} +- value.toFloat() \ ++ value.ToFloat() \ + {% elif setting.type == 'double' %} +- value.toDouble() \ ++ value.ToDouble() \ + {% else %} +- static_cast<{{setting.type}}>(value.toInt()) \ ++ static_cast<{{setting.type}}>(value.ToInt()) \ + {% endif %} + ); \ + return; \ +diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl +index e439323a69db..f615e4d4e51c 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilder.cpp.tmpl +@@ -12,7 +12,7 @@ + + namespace blink { + +-void StyleBuilder::applyProperty(CSSPropertyID property, ++void StyleBuilder::ApplyProperty(CSSPropertyID property, + StyleResolverState& state, + const CSSValue& value, + bool isInitial, +@@ -40,9 +40,9 @@ void StyleBuilder::applyProperty(CSSPropertyID property, + case {{property_id}}: + {% endfor %} + { +- CSSPropertyID resolvedProperty = CSSProperty::resolveDirectionAwareProperty(property, state.style()->direction(), state.style()->getWritingMode()); ++ CSSPropertyID resolvedProperty = CSSProperty::ResolveDirectionAwareProperty(property, state.Style()->Direction(), state.Style()->GetWritingMode()); + ASSERT(resolvedProperty != property); +- applyProperty(resolvedProperty, state, value); ++ ApplyProperty(resolvedProperty, state, value); + return; + } + {% for property_id, property in properties.items() if property.builder_skip %} +diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl +index 1f7243f64ce0..4e81b0f414f9 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl +@@ -29,11 +29,11 @@ void StyleBuilderFunctions::applyValue{{property_id}}(StyleResolverState& state, + {%- endmacro %} + {% macro set_value(property) %} + {% if property.svg %} +-state.style()->accessSVGStyle().{{property.setter}} ++state.Style()->AccessSVGStyle().{{property.setter}} + {%- elif property.font %} +-state.fontBuilder().{{property.setter}} ++state.GetFontBuilder().{{property.setter}} + {%- else %} +-state.style()->{{property.setter}} ++state.Style()->{{property.setter}} + {%- endif %} + {% endmacro %} + {% macro convert_and_set_value(property) %} +@@ -41,13 +41,13 @@ state.style()->{{property.setter}} + {{set_value(property)}}(StyleBuilderConverter::{{property.converter}}(state, value)); + {# TODO(sashab): Remove this list from this file. #} + {% elif property.type_name in ['short', 'unsigned short', 'int', 'unsigned int', 'unsigned', 'float', 'LineClampValue'] %} +-{{set_value(property)}}(toCSSPrimitiveValue(value).convertTo<{{property.type_name}}>()); ++{{set_value(property)}}(ToCSSPrimitiveValue(value).ConvertTo<{{property.type_name}}>()); + {%- else %} +-{{set_value(property)}}(toCSSIdentifierValue(value).convertTo<{{property.type_name}}>()); ++{{set_value(property)}}(ToCSSIdentifierValue(value).ConvertTo<{{property.type_name}}>()); + {%- endif %} + {% endmacro %} + {% macro set_is_inherited(property) %} +-state.style()->{{property.is_inherited_setter}} ++state.Style()->{{property.is_inherited_setter}} + {% endmacro %} + + namespace blink { +@@ -72,11 +72,11 @@ namespace blink { + {% if not property.custom_inherit %} + {{declare_inherit_function(property_id)}} { + {% if property.svg %} +- {{set_value(property)}}(state.parentStyle()->svgStyle().{{property.getter}}()); ++ {{set_value(property)}}(state.ParentStyle()->SvgStyle().{{property.getter}}()); + {% elif property.font %} +- {{set_value(property)}}(state.parentFontDescription().{{property.getter}}()); ++ {{set_value(property)}}(state.ParentFontDescription().{{property.getter}}()); + {% else %} +- {{set_value(property)}}(state.parentStyle()->{{property.getter}}()); ++ {{set_value(property)}}(state.ParentStyle()->{{property.getter}}()); + {% endif %} + {% if property.independent %} + {{set_is_inherited(property)}}(true); +@@ -96,26 +96,26 @@ namespace blink { + {% endfor %} + + {% macro apply_animation(property_id, attribute, animation) %} +-{% set vector = attribute|lower_first + "List()" %} ++{% set vector = attribute + "List()" %} + {{declare_initial_function(property_id)}} { +- CSS{{animation}}Data& data = state.style()->access{{animation}}s(); +- data.{{vector}}.clear(); +- data.{{vector}}.push_back(CSS{{animation}}Data::initial{{attribute}}()); ++ CSS{{animation}}Data& data = state.Style()->Access{{animation}}s(); ++ data.{{vector}}.Clear(); ++ data.{{vector}}.push_back(CSS{{animation}}Data::Initial{{attribute}}()); + } + + {{declare_inherit_function(property_id)}} { +- const CSS{{animation}}Data* parentData = state.parentStyle()->{{animation|lower}}s(); ++ const CSS{{animation}}Data* parentData = state.ParentStyle()->{{animation}}s(); + if (!parentData) + applyInitial{{property_id}}(state); + else +- state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}}; ++ state.Style()->Access{{animation}}s().{{vector}} = parentData->{{vector}}; + } + + {{declare_value_function(property_id)}} { +- CSS{{animation}}Data& data = state.style()->access{{animation}}s(); +- data.{{vector}}.clear(); +- for (auto& listValue : toCSSValueList(value)) +- data.{{vector}}.push_back(CSSToStyleMap::mapAnimation{{attribute}}(*listValue)); ++ CSS{{animation}}Data& data = state.Style()->Access{{animation}}s(); ++ data.{{vector}}.Clear(); ++ for (auto& listValue : ToCSSValueList(value)) ++ data.{{vector}}.push_back(CSSToStyleMap::MapAnimation{{attribute}}(*listValue)); + } + {% endmacro %} + {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} +@@ -133,130 +133,130 @@ namespace blink { + + {% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identity='CSSValueAuto') %} + {% set property = properties[property_id] %} +-{% set auto_getter = auto_getter or 'hasAuto' + property.name_for_methods %} +-{% set auto_setter = auto_setter or 'setHasAuto' + property.name_for_methods %} ++{% set auto_getter = auto_getter or 'HasAuto' + property.name_for_methods %} ++{% set auto_setter = auto_setter or 'SetHasAuto' + property.name_for_methods %} + {{declare_initial_function(property_id)}} { +- state.style()->{{auto_setter}}(); ++ state.Style()->{{auto_setter}}(); + } + + {{declare_inherit_function(property_id)}} { +- if (state.parentStyle()->{{auto_getter}}()) +- state.style()->{{auto_setter}}(); ++ if (state.ParentStyle()->{{auto_getter}}()) ++ state.Style()->{{auto_setter}}(); + else +- {{set_value(property)}}(state.parentStyle()->{{property.getter}}()); ++ {{set_value(property)}}(state.ParentStyle()->{{property.getter}}()); + } + + {{declare_value_function(property_id)}} { +- if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID() == {{auto_identity}}) +- state.style()->{{auto_setter}}(); ++ if (value.IsIdentifierValue() && ToCSSIdentifierValue(value).GetValueID() == {{auto_identity}}) ++ state.Style()->{{auto_setter}}(); + else + {{convert_and_set_value(property)}} + } + {% endmacro %} + {{apply_auto('CSSPropertyClip')}} + {{apply_auto('CSSPropertyColumnCount')}} +-{{apply_auto('CSSPropertyColumnGap', auto_getter='hasNormalColumnGap', auto_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal')}} ++{{apply_auto('CSSPropertyColumnGap', auto_getter='HasNormalColumnGap', auto_setter='SetHasNormalColumnGap', auto_identity='CSSValueNormal')}} + {{apply_auto('CSSPropertyColumnWidth')}} + {{apply_auto('CSSPropertyZIndex')}} + + static bool lengthMatchesAllSides(const LengthBox& lengthBox, + const Length& length) { +- return (lengthBox.left() == length && +- lengthBox.right() == length && +- lengthBox.top() == length && +- lengthBox.bottom() == length); ++ return (lengthBox.Left() == length && ++ lengthBox.Right() == length && ++ lengthBox.Top() == length && ++ lengthBox.Bottom() == length); + } + + static bool borderImageLengthMatchesAllSides( + const BorderImageLengthBox& borderImageLengthBox, + const BorderImageLength& borderImageLength) { +- return (borderImageLengthBox.left() == borderImageLength && +- borderImageLengthBox.right() == borderImageLength && +- borderImageLengthBox.top() == borderImageLength && +- borderImageLengthBox.bottom() == borderImageLength); ++ return (borderImageLengthBox.Left() == borderImageLength && ++ borderImageLengthBox.Right() == borderImageLength && ++ borderImageLengthBox.Top() == borderImageLength && ++ borderImageLengthBox.Bottom() == borderImageLength); + } + + {% macro apply_border_image_modifier(property_id, modifier_type) %} + {% set is_mask_box = 'MaskBox' in property_id %} +-{% set getter = 'maskBoxImage' if is_mask_box else 'borderImage' %} +-{% set setter = 'setMaskBoxImage' if is_mask_box else 'setBorderImage' %} ++{% set getter = 'MaskBoxImage' if is_mask_box else 'BorderImage' %} ++{% set setter = 'SetMaskBoxImage' if is_mask_box else 'SetBorderImage' %} + {{ declare_initial_function(property_id) }} { +- const NinePieceImage& currentImage = state.style()->{{getter}}(); ++ const NinePieceImage& currentImage = state.Style()->{{getter}}(); + {# Check for equality in case we can bail out before creating a new NinePieceImage. #} + {% if modifier_type == 'Outset' %} +- if (borderImageLengthMatchesAllSides(currentImage.outset(), +- BorderImageLength(Length(0, Fixed)))) ++ if (borderImageLengthMatchesAllSides(currentImage.Outset(), ++ BorderImageLength(Length(0, kFixed)))) + return; + {% elif modifier_type == 'Repeat' %} +- if (currentImage.horizontalRule() == StretchImageRule && +- currentImage.verticalRule() == StretchImageRule) ++ if (currentImage.HorizontalRule() == kStretchImageRule && ++ currentImage.VerticalRule() == kStretchImageRule) + return; + {% elif modifier_type == 'Slice' and is_mask_box %} + // Masks have a different initial value for slices. Preserve the value of 0 + // for backwards compatibility. +- if (currentImage.fill() == true && +- lengthMatchesAllSides(currentImage.imageSlices(), Length(0, Fixed))) ++ if (currentImage.Fill() == true && ++ lengthMatchesAllSides(currentImage.ImageSlices(), Length(0, kFixed))) + return; + {% elif modifier_type == 'Slice' and not is_mask_box %} +- if (currentImage.fill() == false && +- lengthMatchesAllSides(currentImage.imageSlices(), Length(100, Percent))) ++ if (currentImage.Fill() == false && ++ lengthMatchesAllSides(currentImage.ImageSlices(), Length(100, kPercent))) + return; + {% elif modifier_type == 'Width' and is_mask_box %} + // Masks have a different initial value for widths. Preserve the value of + // 'auto' for backwards compatibility. +- if (borderImageLengthMatchesAllSides(currentImage.borderSlices(), +- BorderImageLength(Length(Auto)))) ++ if (borderImageLengthMatchesAllSides(currentImage.BorderSlices(), ++ BorderImageLength(Length(kAuto)))) + return; + {% elif modifier_type == 'Width' and not is_mask_box %} +- if (borderImageLengthMatchesAllSides(currentImage.borderSlices(), ++ if (borderImageLengthMatchesAllSides(currentImage.BorderSlices(), + BorderImageLength(1.0))) + return; + {% endif %} + + NinePieceImage image(currentImage); + {% if modifier_type == 'Outset' %} +- image.setOutset(Length(0, Fixed)); ++ image.SetOutset(Length(0, kFixed)); + {% elif modifier_type == 'Repeat' %} +- image.setHorizontalRule(StretchImageRule); +- image.setVerticalRule(StretchImageRule); ++ image.SetHorizontalRule(kStretchImageRule); ++ image.SetVerticalRule(kStretchImageRule); + {% elif modifier_type == 'Slice' and is_mask_box %} +- image.setImageSlices(LengthBox({{ (['Length(0, Fixed)']*4) | join(', ') }})); +- image.setFill(true); ++ image.SetImageSlices(LengthBox({{ (['Length(0, kFixed)']*4) | join(', ') }})); ++ image.SetFill(true); + {% elif modifier_type == 'Slice' and not is_mask_box %} +- image.setImageSlices(LengthBox({{ (['Length(100, Percent)']*4) | join(', ') }})); +- image.setFill(false); ++ image.SetImageSlices(LengthBox({{ (['Length(100, kPercent)']*4) | join(', ') }})); ++ image.SetFill(false); + {% elif modifier_type == 'Width' %} +- image.setBorderSlices({{ 'Length(Auto)' if is_mask_box else '1.0' }}); ++ image.SetBorderSlices({{ 'Length(kAuto)' if is_mask_box else '1.0' }}); + {% endif %} +- state.style()->{{setter}}(image); ++ state.Style()->{{setter}}(image); + } + + {{declare_inherit_function(property_id)}} { +- NinePieceImage image(state.style()->{{getter}}()); ++ NinePieceImage image(state.Style()->{{getter}}()); + {% if modifier_type == 'Outset' %} +- image.copyOutsetFrom(state.parentStyle()->{{getter}}()); ++ image.CopyOutsetFrom(state.ParentStyle()->{{getter}}()); + {% elif modifier_type == 'Repeat' %} +- image.copyRepeatFrom(state.parentStyle()->{{getter}}()); ++ image.CopyRepeatFrom(state.ParentStyle()->{{getter}}()); + {% elif modifier_type == 'Slice' %} +- image.copyImageSlicesFrom(state.parentStyle()->{{getter}}()); ++ image.CopyImageSlicesFrom(state.ParentStyle()->{{getter}}()); + {% elif modifier_type == 'Width' %} +- image.copyBorderSlicesFrom(state.parentStyle()->{{getter}}()); ++ image.CopyBorderSlicesFrom(state.ParentStyle()->{{getter}}()); + {% endif %} +- state.style()->{{setter}}(image); ++ state.Style()->{{setter}}(image); + } + + {{declare_value_function(property_id)}} { +- NinePieceImage image(state.style()->{{getter}}()); ++ NinePieceImage image(state.Style()->{{getter}}()); + {% if modifier_type == 'Outset' %} +- image.setOutset(CSSToStyleMap::mapNinePieceImageQuad(state, value)); ++ image.SetOutset(CSSToStyleMap::MapNinePieceImageQuad(state, value)); + {% elif modifier_type == 'Repeat' %} +- CSSToStyleMap::mapNinePieceImageRepeat(state, value, image); ++ CSSToStyleMap::MapNinePieceImageRepeat(state, value, image); + {% elif modifier_type == 'Slice' %} +- CSSToStyleMap::mapNinePieceImageSlice(state, value, image); ++ CSSToStyleMap::MapNinePieceImageSlice(state, value, image); + {% elif modifier_type == 'Width' %} +- image.setBorderSlices(CSSToStyleMap::mapNinePieceImageQuad(state, value)); ++ image.SetBorderSlices(CSSToStyleMap::MapNinePieceImageQuad(state, value)); + {% endif %} +- state.style()->{{setter}}(image); ++ state.Style()->{{setter}}(image); + } + {% endmacro %} + {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}} +@@ -271,44 +271,44 @@ static bool borderImageLengthMatchesAllSides( + {% macro apply_value_border_image_source(property_id) %} + {{declare_value_function(property_id)}} { + {% set property = properties[property_id] %} +- {{set_value(property)}}(state.styleImage({{property_id}}, value)); ++ {{set_value(property)}}(state.GetStyleImage({{property_id}}, value)); + } + {% endmacro %} + {{apply_value_border_image_source('CSSPropertyBorderImageSource')}} + {{apply_value_border_image_source('CSSPropertyWebkitMaskBoxImageSource')}} + +-{% macro apply_color(property_id, initial_color='StyleColor::currentColor') %} ++{% macro apply_color(property_id, initial_color='StyleColor::CurrentColor') %} + {% set property = properties[property_id] %} +-{% set visited_link_setter = 'setVisitedLink' + property.name_for_methods %} ++{% set visited_link_setter = 'SetVisitedLink' + property.name_for_methods %} + {{declare_initial_function(property_id)}} { + StyleColor color = {{initial_color}}(); +- if (state.applyPropertyToRegularStyle()) ++ if (state.ApplyPropertyToRegularStyle()) + {{set_value(property)}}(color); +- if (state.applyPropertyToVisitedLinkStyle()) +- state.style()->{{visited_link_setter}}(color); ++ if (state.ApplyPropertyToVisitedLinkStyle()) ++ state.Style()->{{visited_link_setter}}(color); + } + + {{declare_inherit_function(property_id)}} { + // Visited link style can never explicitly inherit from parent visited link + // style so no separate getters are needed. +- StyleColor color = state.parentStyle()->{{property.getter}}(); +- if (state.applyPropertyToRegularStyle()) ++ StyleColor color = state.ParentStyle()->{{property.getter}}(); ++ if (state.ApplyPropertyToRegularStyle()) + {{set_value(property)}}(color); +- if (state.applyPropertyToVisitedLinkStyle()) +- state.style()->{{visited_link_setter}}(color); ++ if (state.ApplyPropertyToVisitedLinkStyle()) ++ state.Style()->{{visited_link_setter}}(color); + } + + {{declare_value_function(property_id)}} + { +- if (state.applyPropertyToRegularStyle()) +- {{set_value(property)}}(StyleBuilderConverter::convertStyleColor(state, value)); +- if (state.applyPropertyToVisitedLinkStyle()) { +- state.style()->{{visited_link_setter}}( +- StyleBuilderConverter::convertStyleColor(state, value, true)); ++ if (state.ApplyPropertyToRegularStyle()) ++ {{set_value(property)}}(StyleBuilderConverter::ConvertStyleColor(state, value)); ++ if (state.ApplyPropertyToVisitedLinkStyle()) { ++ state.Style()->{{visited_link_setter}}( ++ StyleBuilderConverter::ConvertStyleColor(state, value, true)); + } + } + {% endmacro %} +-{{apply_color('CSSPropertyBackgroundColor', initial_color='ComputedStyle::initialBackgroundColor') }} ++{{apply_color('CSSPropertyBackgroundColor', initial_color='ComputedStyle::InitialBackgroundColor') }} + {{apply_color('CSSPropertyBorderBottomColor')}} + {{apply_color('CSSPropertyBorderLeftColor')}} + {{apply_color('CSSPropertyBorderRightColor')}} +@@ -323,144 +323,145 @@ static bool borderImageLengthMatchesAllSides( + {% macro apply_counter(property_id, action) %} + {% set property = properties[property_id] %} + {{declare_initial_function(property_id)}} { +- state.style()->clear{{action}}Directives(); ++ state.Style()->Clear{{action}}Directives(); + } + + {{declare_inherit_function(property_id)}} { +- const CounterDirectiveMap* parentMap = state.parentStyle()->counterDirectives(); ++ const CounterDirectiveMap* parentMap = state.ParentStyle()->GetCounterDirectives(); + if (!parentMap) + return; + +- CounterDirectiveMap& map = state.style()->accessCounterDirectives(); +- DCHECK(!parentMap->isEmpty()); ++ CounterDirectiveMap& map = state.Style()->AccessCounterDirectives(); ++ DCHECK(!parentMap->IsEmpty()); + + typedef CounterDirectiveMap::const_iterator Iterator; + Iterator end = parentMap->end(); + for (Iterator it = parentMap->begin(); it != end; ++it) { +- CounterDirectives& directives = map.insert(it->key, CounterDirectives()).storedValue->value; +- directives.inherit{{action}}(it->value); ++ CounterDirectives& directives = map.insert(it->key, CounterDirectives()).stored_value->value; ++ directives.Inherit{{action}}(it->value); + } + } + + {{declare_value_function(property_id)}} { +- state.style()->clear{{action}}Directives(); ++ state.Style()->Clear{{action}}Directives(); + +- if (!value.isValueList()) { +- DCHECK(value.isIdentifierValue()); +- DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone); ++ if (!value.IsValueList()) { ++ DCHECK(value.IsIdentifierValue()); ++ DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueNone); + return; + } + +- CounterDirectiveMap& map = state.style()->accessCounterDirectives(); ++ CounterDirectiveMap& map = state.Style()->AccessCounterDirectives(); + +- const CSSValueList& list = toCSSValueList(value); ++ const CSSValueList& list = ToCSSValueList(value); + + for (size_t i = 0; i < list.length(); ++i) { +- const CSSValuePair& pair = toCSSValuePair(list.item(i)); +- AtomicString identifier(toCSSCustomIdentValue(pair.first()).value()); +- int value = toCSSPrimitiveValue(pair.second()).getIntValue(); ++ const CSSValuePair& pair = ToCSSValuePair(list.Item(i)); ++ AtomicString identifier(ToCSSCustomIdentValue(pair.First()).Value()); ++ int value = ToCSSPrimitiveValue(pair.Second()).GetIntValue(); + CounterDirectives& directives = +- map.insert(identifier, CounterDirectives()).storedValue->value; ++ map.insert(identifier, CounterDirectives()).stored_value->value; + {% if action == 'Reset' %} +- directives.setResetValue(value); ++ directives.SetResetValue(value); + {% else %} +- directives.addIncrementValue(value); ++ directives.AddIncrementValue(value); + {% endif %} + } +- DCHECK(!map.isEmpty()); ++ DCHECK(!map.IsEmpty()); + } + {% endmacro %} + {{apply_counter('CSSPropertyCounterIncrement', 'Increment')}} + {{apply_counter('CSSPropertyCounterReset', 'Reset')}} + +-{% macro apply_fill_layer(property_id, fill_type) %} ++{% macro apply_fill_layer(property_id, fill_type, fill_type_getter = None) %} + {% set layer_type = 'Background' if 'Background' in property_id else 'Mask' %} +-{% set fill_layer_type = layer_type + 'FillLayer' %} +-{% set access_layers = 'access' + layer_type + 'Layers' %} +-{% set map_fill = 'mapFill' + fill_type %} ++{% set fill_layer_type = 'k' + layer_type + 'FillLayer' %} ++{% set access_layers = 'Access' + layer_type + 'Layers' %} ++{% set map_fill = 'MapFill' + fill_type %} ++{% set fill_type_getter = fill_type_getter or fill_type %} + {{declare_initial_function(property_id)}} { +- FillLayer* currChild = &state.style()->{{access_layers}}(); +- currChild->set{{fill_type}}(FillLayer::initialFill{{fill_type}}({{fill_layer_type}})); +- for (currChild = currChild->next(); currChild; currChild = currChild->next()) +- currChild->clear{{fill_type}}(); ++FillLayer* currChild = &state.Style()->{{access_layers}}(); ++currChild->Set{{fill_type}}(FillLayer::InitialFill{{fill_type}}({{fill_layer_type}})); ++for (currChild = currChild->Next(); currChild; currChild = currChild->Next()) ++ currChild->Clear{{fill_type}}(); + } + + {{declare_inherit_function(property_id)}} { +- FillLayer* currChild = &state.style()->{{access_layers}}(); +- FillLayer* prevChild = 0; +- const FillLayer* currParent = &state.parentStyle()->{{layer_type|lower}}Layers(); +- while (currParent && currParent->is{{fill_type}}Set()) { ++FillLayer* currChild = &state.Style()->{{access_layers}}(); ++FillLayer* prevChild = 0; ++const FillLayer* currParent = &state.ParentStyle()->{{layer_type}}Layers(); ++while (currParent && currParent->Is{{fill_type}}Set()) { + if (!currChild) +- currChild = prevChild->ensureNext(); +- currChild->set{{fill_type}}(currParent->{{fill_type|lower_first}}()); ++ currChild = prevChild->EnsureNext(); ++ currChild->Set{{fill_type}}(currParent->{{fill_type_getter}}()); + prevChild = currChild; +- currChild = prevChild->next(); +- currParent = currParent->next(); ++ currChild = prevChild->Next(); ++ currParent = currParent->Next(); + } + + while (currChild) { + // Reset any remaining layers to not have the property set. +- currChild->clear{{fill_type}}(); +- currChild = currChild->next(); ++ currChild->Clear{{fill_type}}(); ++ currChild = currChild->Next(); + } + } + + {{declare_value_function(property_id)}} { +- FillLayer* currChild = &state.style()->{{access_layers}}(); ++ FillLayer* currChild = &state.Style()->{{access_layers}}(); + FillLayer* prevChild = 0; +- if (value.isValueList() && !value.isImageSetValue()) { ++ if (value.IsValueList() && !value.IsImageSetValue()) { + // Walk each value and put it into a layer, creating new layers as needed. +- const CSSValueList& valueList = toCSSValueList(value); ++ const CSSValueList& valueList = ToCSSValueList(value); + for (unsigned int i = 0; i < valueList.length(); i++) { + if (!currChild) +- currChild = prevChild->ensureNext(); +- CSSToStyleMap::{{map_fill}}(state, currChild, valueList.item(i)); ++ currChild = prevChild->EnsureNext(); ++ CSSToStyleMap::{{map_fill}}(state, currChild, valueList.Item(i)); + prevChild = currChild; +- currChild = currChild->next(); ++ currChild = currChild->Next(); + } + } else { + CSSToStyleMap::{{map_fill}}(state, currChild, value); +- currChild = currChild->next(); ++ currChild = currChild->Next(); + } + while (currChild) { + // Reset all remaining layers to not have the property set. +- currChild->clear{{fill_type}}(); +- currChild = currChild->next(); ++ currChild->Clear{{fill_type}}(); ++ currChild = currChild->Next(); + } + } + {% endmacro %} + {{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}} + {{apply_fill_layer('CSSPropertyBackgroundBlendMode', 'BlendMode')}} + {{apply_fill_layer('CSSPropertyBackgroundClip', 'Clip')}} +-{{apply_fill_layer('CSSPropertyBackgroundImage', 'Image')}} ++{{apply_fill_layer('CSSPropertyBackgroundImage', 'Image', 'GetImage')}} + {{apply_fill_layer('CSSPropertyBackgroundOrigin', 'Origin')}} + {{apply_fill_layer('CSSPropertyBackgroundPositionX', 'XPosition')}} + {{apply_fill_layer('CSSPropertyBackgroundPositionY', 'YPosition')}} + {{apply_fill_layer('CSSPropertyBackgroundRepeatX', 'RepeatX')}} + {{apply_fill_layer('CSSPropertyBackgroundRepeatY', 'RepeatY')}} +-{{apply_fill_layer('CSSPropertyBackgroundSize', 'Size')}} ++{{apply_fill_layer('CSSPropertyBackgroundSize', 'Size', 'size')}} + {{apply_fill_layer('CSSPropertyMaskSourceType', 'MaskSourceType')}} + {{apply_fill_layer('CSSPropertyWebkitMaskClip', 'Clip')}} + {{apply_fill_layer('CSSPropertyWebkitMaskComposite', 'Composite')}} +-{{apply_fill_layer('CSSPropertyWebkitMaskImage', 'Image')}} ++{{apply_fill_layer('CSSPropertyWebkitMaskImage', 'Image', 'GetImage')}} + {{apply_fill_layer('CSSPropertyWebkitMaskOrigin', 'Origin')}} + {{apply_fill_layer('CSSPropertyWebkitMaskPositionX', 'XPosition')}} + {{apply_fill_layer('CSSPropertyWebkitMaskPositionY', 'YPosition')}} + {{apply_fill_layer('CSSPropertyWebkitMaskRepeatX', 'RepeatX')}} + {{apply_fill_layer('CSSPropertyWebkitMaskRepeatY', 'RepeatY')}} +-{{apply_fill_layer('CSSPropertyWebkitMaskSize', 'Size')}} ++{{apply_fill_layer('CSSPropertyWebkitMaskSize', 'Size', 'size')}} + + {% macro apply_grid_template(property_id, type) %} + {{declare_initial_function(property_id)}} { +- state.style()->setGridTemplate{{type}}s(ComputedStyle::initialGridTemplate{{type}}s()); +- state.style()->setNamedGrid{{type}}Lines(ComputedStyle::initialNamedGrid{{type}}Lines()); +- state.style()->setOrderedNamedGrid{{type}}Lines(ComputedStyle::initialOrderedNamedGrid{{type}}Lines()); ++ state.Style()->SetGridTemplate{{type}}s(ComputedStyle::InitialGridTemplate{{type}}s()); ++ state.Style()->SetNamedGrid{{type}}Lines(ComputedStyle::InitialNamedGrid{{type}}Lines()); ++ state.Style()->SetOrderedNamedGrid{{type}}Lines(ComputedStyle::InitialOrderedNamedGrid{{type}}Lines()); + } + + {{declare_inherit_function(property_id)}} { +- state.style()->setGridTemplate{{type}}s(state.parentStyle()->gridTemplate{{type}}s()); +- state.style()->setNamedGrid{{type}}Lines(state.parentStyle()->namedGrid{{type}}Lines()); +- state.style()->setOrderedNamedGrid{{type}}Lines(state.parentStyle()->orderedNamedGrid{{type}}Lines()); ++ state.Style()->SetGridTemplate{{type}}s(state.ParentStyle()->GridTemplate{{type}}s()); ++ state.Style()->SetNamedGrid{{type}}Lines(state.ParentStyle()->NamedGrid{{type}}Lines()); ++ state.Style()->SetOrderedNamedGrid{{type}}Lines(state.ParentStyle()->OrderedNamedGrid{{type}}Lines()); + } + + {{declare_value_function(property_id)}} { +@@ -470,29 +471,29 @@ static bool borderImageLengthMatchesAllSides( + OrderedNamedGridLines orderedNamedGridLines; + NamedGridLinesMap autoRepeatNamedGridLines; + OrderedNamedGridLines autoRepeatOrderedNamedGridLines; +- AutoRepeatType autoRepeatType = ComputedStyle::initialGridAutoRepeatType(); ++ AutoRepeatType autoRepeatType = ComputedStyle::InitialGridAutoRepeatType(); + size_t autoRepeatInsertionPoint = +- ComputedStyle::initialGridAutoRepeatInsertionPoint(); +- StyleBuilderConverter::convertGridTrackList( ++ ComputedStyle::InitialGridAutoRepeatInsertionPoint(); ++ StyleBuilderConverter::ConvertGridTrackList( + value, trackSizes, namedGridLines, orderedNamedGridLines, + autoRepeatTrackSizes, autoRepeatNamedGridLines, + autoRepeatOrderedNamedGridLines, autoRepeatInsertionPoint, + autoRepeatType, state); +- const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea(); +- if (!namedGridAreas.isEmpty()) { +- StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea( +- namedGridAreas, namedGridLines, For{{type}}s); ++ const NamedGridAreaMap& namedGridAreas = state.Style()->NamedGridArea(); ++ if (!namedGridAreas.IsEmpty()) { ++ StyleBuilderConverter::CreateImplicitNamedGridLinesFromGridArea( ++ namedGridAreas, namedGridLines, kFor{{type}}s); + } +- state.style()->setGridTemplate{{type}}s(trackSizes); +- state.style()->setNamedGrid{{type}}Lines(namedGridLines); +- state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); +- state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); +- state.style()->setGridAutoRepeat{{type}}sInsertionPoint( ++ state.Style()->SetGridTemplate{{type}}s(trackSizes); ++ state.Style()->SetNamedGrid{{type}}Lines(namedGridLines); ++ state.Style()->SetOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); ++ state.Style()->SetGridAutoRepeat{{type}}s(autoRepeatTrackSizes); ++ state.Style()->SetGridAutoRepeat{{type}}sInsertionPoint( + autoRepeatInsertionPoint); +- state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines); +- state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines( ++ state.Style()->SetAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines); ++ state.Style()->SetAutoRepeatOrderedNamedGrid{{type}}Lines( + autoRepeatOrderedNamedGridLines); +- state.style()->setGridAutoRepeat{{type}}sType(autoRepeatType); ++ state.Style()->SetGridAutoRepeat{{type}}sType(autoRepeatType); + } + {% endmacro %} + {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} +@@ -502,54 +503,54 @@ static bool borderImageLengthMatchesAllSides( + {% set property = properties[property_id] %} + {{declare_initial_function(property_id)}} { + {{set_value(property)}}( +- SVGComputedStyle::initial{{paint_type}}Type(), +- SVGComputedStyle::initial{{paint_type}}Color(), +- SVGComputedStyle::initial{{paint_type}}Uri(), +- state.applyPropertyToRegularStyle(), +- state.applyPropertyToVisitedLinkStyle()); ++ SVGComputedStyle::Initial{{paint_type}}Type(), ++ SVGComputedStyle::Initial{{paint_type}}Color(), ++ SVGComputedStyle::Initial{{paint_type}}Uri(), ++ state.ApplyPropertyToRegularStyle(), ++ state.ApplyPropertyToVisitedLinkStyle()); + } + + {{declare_inherit_function(property_id)}} { +- const SVGComputedStyle& svgParentStyle = state.parentStyle()->svgStyle(); ++ const SVGComputedStyle& svgParentStyle = state.ParentStyle()->SvgStyle(); + {{set_value(property)}}( +- svgParentStyle.{{paint_type|lower_first}}Type(), +- svgParentStyle.{{paint_type|lower_first}}Color(), +- svgParentStyle.{{paint_type|lower_first}}Uri(), +- state.applyPropertyToRegularStyle(), +- state.applyPropertyToVisitedLinkStyle()); ++ svgParentStyle.{{paint_type}}Type(), ++ svgParentStyle.{{paint_type}}Color(), ++ svgParentStyle.{{paint_type}}Uri(), ++ state.ApplyPropertyToRegularStyle(), ++ state.ApplyPropertyToVisitedLinkStyle()); + } + + {{declare_value_function(property_id)}} { + const CSSValue* localValue = &value; + String url; +- if (value.isValueList()) { +- const CSSValueList& list = toCSSValueList(value); ++ if (value.IsValueList()) { ++ const CSSValueList& list = ToCSSValueList(value); + DCHECK_EQ(list.length(), 2U); +- url = toCSSURIValue(list.item(0)).value(); +- localValue = &list.item(1); ++ url = ToCSSURIValue(list.Item(0)).Value(); ++ localValue = &list.Item(1); + } + + Color color; + SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR; +- if (localValue->isURIValue()) { ++ if (localValue->IsURIValue()) { + paintType = SVG_PAINTTYPE_URI; +- url = toCSSURIValue(localValue)->value(); +- } else if (localValue->isIdentifierValue() && +- toCSSIdentifierValue(localValue)->getValueID() == CSSValueNone) { +- paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE; +- } else if (localValue->isIdentifierValue() && +- toCSSIdentifierValue(localValue)->getValueID() == CSSValueCurrentcolor) { +- color = state.style()->color(); +- paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR ++ url = ToCSSURIValue(localValue)->Value(); ++ } else if (localValue->IsIdentifierValue() && ++ ToCSSIdentifierValue(localValue)->GetValueID() == CSSValueNone) { ++ paintType = url.IsEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE; ++ } else if (localValue->IsIdentifierValue() && ++ ToCSSIdentifierValue(localValue)->GetValueID() == CSSValueCurrentcolor) { ++ color = state.Style()->GetColor(); ++ paintType = url.IsEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR + : SVG_PAINTTYPE_URI_CURRENTCOLOR; + } else { +- color = StyleBuilderConverter::convertColor(state, *localValue); +- paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR ++ color = StyleBuilderConverter::ConvertColor(state, *localValue); ++ paintType = url.IsEmpty() ? SVG_PAINTTYPE_RGBCOLOR + : SVG_PAINTTYPE_URI_RGBCOLOR; + } + {{set_value(property)}}(paintType, color, url, +- state.applyPropertyToRegularStyle(), +- state.applyPropertyToVisitedLinkStyle()); ++ state.ApplyPropertyToRegularStyle(), ++ state.ApplyPropertyToVisitedLinkStyle()); + } + {% endmacro %} + {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} +diff --git a/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl +index effe6d2129ac..c470d935b256 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl +@@ -63,7 +63,7 @@ void getMatchingShorthandsForLonghand( + {% for longhand_id, shorthands in longhands_dictionary.items() %} + case {{longhand_id}}: { + {% for shorthand in shorthands %} +- result->uncheckedAppend({{shorthand.lower_camel_name}}Shorthand()); ++ result->UncheckedAppend({{shorthand.lower_camel_name}}Shorthand()); + {% endfor %} + break; + } +diff --git a/third_party/WebKit/Source/build/scripts/templates/macros.tmpl b/third_party/WebKit/Source/build/scripts/templates/macros.tmpl +index d8617410ef2a..0a0496d0efbe 100644 +--- a/third_party/WebKit/Source/build/scripts/templates/macros.tmpl ++++ b/third_party/WebKit/Source/build/scripts/templates/macros.tmpl +@@ -14,7 +14,7 @@ + if ( + {%- for c in name -%} + {%- if lowercase_data -%} +- {{ " && " if not loop.first }}toASCIILower(data[{{index + loop.index0}}]) == '{{c}}' ++ {{ " && " if not loop.first }}ToASCIILower(data[{{index + loop.index0}}]) == '{{c}}' + {%- else -%} + {{ " && " if not loop.first }}data[{{index + loop.index0}}] == '{{c}}' + {%- endif -%} +@@ -33,7 +33,7 @@ return {{ return_macro(value) }}; + {{ trie_leaf(index, trie, return_macro, lowercase_data) -}} + {% else %} + {% if lowercase_data %} +-switch (toASCIILower(data[{{index}}])) { ++switch (ToASCIILower(data[{{index}}])) { + {% else %} + switch (data[{{index}}]) { + {% endif %} +diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp +index b0c102c45cc8..d0f55e844c09 100644 +--- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp ++++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp +@@ -112,7 +112,7 @@ PassRefPtr<Image> CSSGradientValue::GetImage(const LayoutObject& layout_object, + + // Need to look up our size. Create a string of width*height to use as a + // hash key. +- Image* result = GetImage(&layout_object, size); ++ Image* result = this->CSSImageGeneratorValue::GetImage(&layout_object, size); + if (result) + return result; + } +diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.json5 b/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.json5 +index a83d9399b3a2..63babdd2798d 100644 +--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.json5 ++++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.json5 +@@ -8,111 +8,111 @@ + data: [ + { + name: "em", +- unit_type: "Ems", ++ unit_type: "kEms", + }, + { + name: "ex", +- unit_type: "Exs", ++ unit_type: "kExs", + }, + { + name: "px", +- unit_type: "Pixels", ++ unit_type: "kPixels", + }, + { + name: "cm", +- unit_type: "Centimeters", ++ unit_type: "kCentimeters", + }, + { + name: "mm", +- unit_type: "Millimeters", ++ unit_type: "kMillimeters", + }, + { + name: "in", +- unit_type: "Inches", ++ unit_type: "kInches", + }, + { + name: "pt", +- unit_type: "Points", ++ unit_type: "kPoints", + }, + { + name: "pc", +- unit_type: "Picas", ++ unit_type: "kPicas", + }, + { + name: "deg", +- unit_type: "Degrees", ++ unit_type: "kDegrees", + }, + { + name: "rad", +- unit_type: "Radians", ++ unit_type: "kRadians", + }, + { + name: "grad", +- unit_type: "Gradians", ++ unit_type: "kGradians", + }, + { + name: "ms", +- unit_type: "Milliseconds", ++ unit_type: "kMilliseconds", + }, + { + name: "s", +- unit_type: "Seconds", ++ unit_type: "kSeconds", + }, + { + name: "hz", +- unit_type: "Hertz", ++ unit_type: "kHertz", + }, + { + name: "khz", +- unit_type: "Kilohertz", ++ unit_type: "kKilohertz", + }, + { + name: "dpi", +- unit_type: "DotsPerInch", ++ unit_type: "kDotsPerInch", + }, + { + name: "dpcm", +- unit_type: "DotsPerCentimeter", ++ unit_type: "kDotsPerCentimeter", + }, + { + name: "dppx", +- unit_type: "DotsPerPixel", ++ unit_type: "kDotsPerPixel", + }, + { + name: "vw", +- unit_type: "ViewportWidth", ++ unit_type: "kViewportWidth", + }, + { + name: "vh", +- unit_type: "ViewportHeight", ++ unit_type: "kViewportHeight", + }, + { + name: "vmin", +- unit_type: "ViewportMin", ++ unit_type: "kViewportMin", + }, + { + name: "vmax", +- unit_type: "ViewportMax", ++ unit_type: "kViewportMax", + }, + { + name: "rem", +- unit_type: "Rems", ++ unit_type: "kRems", + }, + { + name: "fr", +- unit_type: "Fraction", ++ unit_type: "kFraction", + }, + { + name: "turn", +- unit_type: "Turns", ++ unit_type: "kTurns", + }, + { + name: "ch", +- unit_type: "Chs", ++ unit_type: "kChs", + }, + { + name: "__qem", +- unit_type: "QuirkyEms", ++ unit_type: "kQuirkyEms", + }, + ], + } +diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 +index 8f5725cdb950..77e1a944f3d6 100644 +--- a/third_party/WebKit/Source/core/css/CSSProperties.json5 ++++ b/third_party/WebKit/Source/core/css/CSSProperties.json5 +@@ -200,7 +200,7 @@ + type_name: { + }, + +- // - converter: "convertRadius" ++ // - converter: "ConvertRadius" + // The StyleBuilder will call the specified function on StyleBuilderConverter + // to convert a CSSValue to an appropriate platform value + converter: { +@@ -353,7 +353,7 @@ + name: "font-family", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontFamily", ++ converter: "ConvertFontFamily", + is_descriptor: true, + font: true, + inherited: true, +@@ -373,9 +373,9 @@ + name: "font-size", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontSize", ++ converter: "ConvertFontSize", + font: true, +- getter: "getSize", ++ getter: "GetSize", + inherited: true, + interpolable: true, + name_for_methods: "Size", +@@ -385,7 +385,7 @@ + name: "font-size-adjust", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontSizeAdjust", ++ converter: "ConvertFontSizeAdjust", + font: true, + inherited: true, + interpolable: true, +@@ -415,7 +415,7 @@ + name: "font-variant-ligatures", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontVariantLigatures", ++ converter: "ConvertFontVariantLigatures", + font: true, + inherited: true, + name_for_methods: "VariantLigatures", +@@ -426,7 +426,7 @@ + name: "font-variant-caps", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontVariantCaps", ++ converter: "ConvertFontVariantCaps", + font: true, + inherited: true, + name_for_methods: "VariantCaps", +@@ -436,7 +436,7 @@ + name: "font-variant-numeric", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontVariantNumeric", ++ converter: "ConvertFontVariantNumeric", + font: true, + inherited: true, + name_for_methods: "VariantNumeric", +@@ -444,7 +444,7 @@ + }, + { + name: "font-weight", +- converter: "convertFontWeight", ++ converter: "ConvertFontWeight", + is_descriptor: true, + font: true, + inherited: true, +@@ -455,7 +455,7 @@ + }, + { + name: "font-feature-settings", +- converter: "convertFontFeatureSettings", ++ converter: "ConvertFontFeatureSettings", + is_descriptor: true, + font: true, + inherited: true, +@@ -466,7 +466,7 @@ + name: "font-variation-settings", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFontVariationSettings", ++ converter: "ConvertFontVariationSettings", + font: true, + inherited: true, + name_for_methods: "VariationSettings", +@@ -539,15 +539,15 @@ + name: "align-content", + api_methods: ["parseSingleValue"], + api_class: "CSSPropertyAPIAlignOrJustifyContent", +- converter: "convertContentAlignmentData", +- initial: "initialContentAlignment", ++ converter: "ConvertContentAlignmentData", ++ initial: "InitialContentAlignment", + }, + { + name: "align-items", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertSelfOrDefaultAlignmentData", +- initial: "initialDefaultAlignment", ++ converter: "ConvertSelfOrDefaultAlignmentData", ++ initial: "InitialDefaultAlignment", + }, + { + name: "alignment-baseline", +@@ -557,13 +557,13 @@ + api_class: "CSSPropertyAPIAlignOrJustifySelf", + api_methods: ["parseSingleValue"], + name: "align-self", +- converter: "convertSelfOrDefaultAlignmentData", +- initial: "initialSelfAlignment", ++ converter: "ConvertSelfOrDefaultAlignmentData", ++ initial: "InitialSelfAlignment", + }, + { + name: "backdrop-filter", + api_class: "CSSPropertyAPIFilter", +- converter: "convertFilterOperations", ++ converter: "ConvertFilterOperations", + interpolable: true, + runtime_flag: "CSSBackdropFilter", + }, +@@ -637,21 +637,21 @@ + name: "border-bottom-left-radius", + api_class: "CSSPropertyAPIBorderRadius", + api_methods: ["parseSingleValue"], +- converter: "convertRadius", +- initial: "initialBorderRadius", ++ converter: "ConvertRadius", ++ initial: "InitialBorderRadius", + interpolable: true, + }, + { + name: "border-bottom-right-radius", + api_class: "CSSPropertyAPIBorderRadius", + api_methods: ["parseSingleValue"], +- converter: "convertRadius", +- initial: "initialBorderRadius", ++ converter: "ConvertRadius", ++ initial: "InitialBorderRadius", + interpolable: true, + }, + { + name: "border-bottom-style", +- initial: "initialBorderStyle", ++ initial: "InitialBorderStyle", + type_name: "EBorderStyle", + keywords: ["none"], + typedom_types: ["Image"], +@@ -659,8 +659,8 @@ + { + name: "border-bottom-width", + api_class: "CSSPropertyAPIBorderWidth", +- converter: "convertLineWidth<float>", +- initial: "initialBorderWidth", ++ converter: "ConvertLineWidth<float>", ++ initial: "InitialBorderWidth", + interpolable: true, + keywords: ["thin", "medium", "thick"], + typedom_types: ["Length"], +@@ -712,7 +712,7 @@ + }, + { + name: "border-left-style", +- initial: "initialBorderStyle", ++ initial: "InitialBorderStyle", + type_name: "EBorderStyle", + keywords: ["none"], + typedom_types: ["Image"], +@@ -720,8 +720,8 @@ + { + name: "border-left-width", + api_class: "CSSPropertyAPIBorderWidth", +- converter: "convertLineWidth<float>", +- initial: "initialBorderWidth", ++ converter: "ConvertLineWidth<float>", ++ initial: "InitialBorderWidth", + interpolable: true, + keywords: ["thin", "medium", "thick"], + typedom_types: ["Length"], +@@ -733,7 +733,7 @@ + }, + { + name: "border-right-style", +- initial: "initialBorderStyle", ++ initial: "InitialBorderStyle", + type_name: "EBorderStyle", + keywords: ["none"], + typedom_types: ["Image"], +@@ -741,8 +741,8 @@ + { + name: "border-right-width", + api_class: "CSSPropertyAPIBorderWidth", +- converter: "convertLineWidth<float>", +- initial: "initialBorderWidth", ++ converter: "ConvertLineWidth<float>", ++ initial: "InitialBorderWidth", + interpolable: true, + keywords: ["thin", "medium", "thick"], + typedom_types: ["Length"], +@@ -756,21 +756,21 @@ + name: "border-top-left-radius", + api_class: "CSSPropertyAPIBorderRadius", + api_methods: ["parseSingleValue"], +- converter: "convertRadius", +- initial: "initialBorderRadius", ++ converter: "ConvertRadius", ++ initial: "InitialBorderRadius", + interpolable: true, + }, + { + name: "border-top-right-radius", + api_class: "CSSPropertyAPIBorderRadius", + api_methods: ["parseSingleValue"], +- converter: "convertRadius", +- initial: "initialBorderRadius", ++ converter: "ConvertRadius", ++ initial: "InitialBorderRadius", + interpolable: true, + }, + { + name: "border-top-style", +- initial: "initialBorderStyle", ++ initial: "InitialBorderStyle", + type_name: "EBorderStyle", + keywords: ["none"], + typedom_types: ["Image"], +@@ -778,8 +778,8 @@ + { + name: "border-top-width", + api_class: "CSSPropertyAPIBorderWidth", +- converter: "convertLineWidth<float>", +- initial: "initialBorderWidth", ++ converter: "ConvertLineWidth<float>", ++ initial: "InitialBorderWidth", + interpolable: true, + keywords: ["thin", "medium", "thick"], + supports_percentage: true, +@@ -789,8 +789,8 @@ + name: "bottom", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", +- initial: "initialOffset", ++ converter: "ConvertLengthOrAuto", ++ initial: "InitialOffset", + interpolable: true, + keywords: ["auto"], + supports_percentage: true, +@@ -798,7 +798,7 @@ + }, + { + name: "box-shadow", +- converter: "convertShadowList", ++ converter: "ConvertShadowList", + interpolable: true, + }, + "box-sizing", +@@ -862,7 +862,7 @@ + name: "clip", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertClip", ++ converter: "ConvertClip", + custom_all: true, + interpolable: true, + }, +@@ -870,7 +870,7 @@ + name: "clip-path", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertClipPath", ++ converter: "ConvertClipPath", + interpolable: true, + }, + { +@@ -903,7 +903,7 @@ + name: "contain", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFlags<Containment>", ++ converter: "ConvertFlags<Containment>", + runtime_flag: "CSSContainment", + }, + { +@@ -945,20 +945,20 @@ + { + name: "cx", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + svg: true, + }, + { + name: "cy", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + svg: true, + }, + { + name: "d", +- converter: "convertPathOrNone", ++ converter: "ConvertPathOrNone", + interpolable: true, + svg: true, + }, +@@ -993,14 +993,14 @@ + custom_all: true, + inherited: true, + interpolable: true, +- setter: "setFillPaint", ++ setter: "SetFillPaint", + svg: true, + }, + { + name: "fill-opacity", + api_class: "CSSPropertyAPIOpacity", + api_methods: ["parseSingleValue"], +- converter: "convertNumberOrPercentage", ++ converter: "ConvertNumberOrPercentage", + inherited: true, + interpolable: true, + svg: true, +@@ -1014,14 +1014,14 @@ + { + name: "filter", + api_class: "CSSPropertyAPIFilter", +- converter: "convertFilterOperations", ++ converter: "ConvertFilterOperations", + interpolable: true, + }, + { + name: "flex-basis", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", ++ converter: "ConvertLengthOrAuto", + interpolable: true, + }, + "flex-direction", +@@ -1050,7 +1050,7 @@ + name: "flood-color", + api_class: "CSSPropertyAPIColor", + api_methods: ["parseSingleValue"], +- converter: "convertColor", ++ converter: "ConvertColor", + interpolable: true, + svg: true, + }, +@@ -1058,62 +1058,62 @@ + name: "flood-opacity", + api_class: "CSSPropertyAPIOpacity", + api_methods: ["parseSingleValue"], +- converter: "convertNumberOrPercentage", ++ converter: "ConvertNumberOrPercentage", + interpolable: true, + svg: true, + }, + { + name: "grid-auto-columns", + api_class: "CSSPropertyAPIGridAutoLine", +- converter: "convertGridTrackSizeList", ++ converter: "ConvertGridTrackSizeList", + runtime_flag: "CSSGridLayout", + }, + { + name: "grid-auto-flow", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertGridAutoFlow", ++ converter: "ConvertGridAutoFlow", + runtime_flag: "CSSGridLayout", + type_name: "GridAutoFlow", + }, + { + name: "grid-auto-rows", + api_class: "CSSPropertyAPIGridAutoLine", +- converter: "convertGridTrackSizeList", ++ converter: "ConvertGridTrackSizeList", + runtime_flag: "CSSGridLayout", + }, + { + name: "grid-column-end", +- converter: "convertGridPosition", ++ converter: "ConvertGridPosition", + runtime_flag: "CSSGridLayout", + api_class: "CSSPropertyAPIGridLine", + }, + { + name: "grid-column-gap", +- converter: "convertLength", ++ converter: "ConvertLength", + runtime_flag: "CSSGridLayout", + }, + { + name: "grid-column-start", + api_class: "CSSPropertyAPIGridLine", +- converter: "convertGridPosition", ++ converter: "ConvertGridPosition", + runtime_flag: "CSSGridLayout", + }, + { + name: "grid-row-end", + api_class: "CSSPropertyAPIGridLine", +- converter: "convertGridPosition", ++ converter: "ConvertGridPosition", + runtime_flag: "CSSGridLayout", + }, + { + name: "grid-row-gap", +- converter: "convertLength", ++ converter: "ConvertLength", + runtime_flag: "CSSGridLayout", + }, + { + name: "grid-row-start", + api_class: "CSSPropertyAPIGridLine", +- converter: "convertGridPosition", ++ converter: "ConvertGridPosition", + runtime_flag: "CSSGridLayout", + }, + { +@@ -1137,9 +1137,9 @@ + { + name: "height", + api_class: "CSSPropertyAPIWidthOrHeight", +- converter: "convertLengthSizing", ++ converter: "ConvertLengthSizing", + is_descriptor: true, +- initial: "initialSize", ++ initial: "InitialSize", + interpolable: true, + keywords: ["auto", "fit-content", "min-content", "max-content"], + supports_percentage: true, +@@ -1159,7 +1159,7 @@ + name: "image-orientation", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertImageOrientation", ++ converter: "ConvertImageOrientation", + inherited: true, + name_for_methods: "RespectImageOrientation", + runtime_flag: "ImageOrientation", +@@ -1169,31 +1169,31 @@ + name: "justify-content", + api_class: "CSSPropertyAPIAlignOrJustifyContent", + api_methods: ["parseSingleValue"], +- converter: "convertContentAlignmentData", +- initial: "initialContentAlignment", ++ converter: "ConvertContentAlignmentData", ++ initial: "InitialContentAlignment", + }, + { + name: "justify-items", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertSelfOrDefaultAlignmentData", +- initial: "initialSelfAlignment", ++ converter: "ConvertSelfOrDefaultAlignmentData", ++ initial: "InitialSelfAlignment", + runtime_flag: "CSSGridLayout", + }, + { + name: "justify-self", + api_class: "CSSPropertyAPIAlignOrJustifySelf", + api_methods: ["parseSingleValue"], +- converter: "convertSelfOrDefaultAlignmentData", +- initial: "initialSelfAlignment", ++ converter: "ConvertSelfOrDefaultAlignmentData", ++ initial: "InitialSelfAlignment", + runtime_flag: "CSSGridLayout", + }, + { + name: "left", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", +- initial: "initialOffset", ++ converter: "ConvertLengthOrAuto", ++ initial: "InitialOffset", + interpolable: true, + keywords: ["auto"], + supports_percentage: true, +@@ -1203,16 +1203,16 @@ + name: "letter-spacing", + api_class: "CSSPropertyAPILetterAndWordSpacing", + api_methods: ["parseSingleValue"], +- converter: "convertSpacing", ++ converter: "ConvertSpacing", + inherited: true, +- initial: "initialLetterWordSpacing", ++ initial: "InitialLetterWordSpacing", + interpolable: true, + }, + { + name: "lighting-color", + api_class: "CSSPropertyAPIColor", + api_methods: ["parseSingleValue"], +- converter: "convertColor", ++ converter: "ConvertColor", + interpolable: true, + svg: true, + }, +@@ -1220,8 +1220,8 @@ + name: "line-height", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertLineHeight", +- getter: "specifiedLineHeight", ++ converter: "ConvertLineHeight", ++ getter: "SpecifiedLineHeight", + inherited: true, + interpolable: true, + }, +@@ -1229,7 +1229,7 @@ + name: "line-height-step", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<uint8_t>", ++ converter: "ConvertComputedLength<uint8_t>", + inherited: true, + runtime_flag: "CSSSnapSize", + }, +@@ -1263,38 +1263,38 @@ + name: "margin-bottom", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertQuirkyLength", +- initial: "initialMargin", ++ converter: "ConvertQuirkyLength", ++ initial: "InitialMargin", + interpolable: true, + }, + { + name: "margin-left", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertQuirkyLength", +- initial: "initialMargin", ++ converter: "ConvertQuirkyLength", ++ initial: "InitialMargin", + interpolable: true, + }, + { + name: "margin-right", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertQuirkyLength", +- initial: "initialMargin", ++ converter: "ConvertQuirkyLength", ++ initial: "InitialMargin", + interpolable: true, + }, + { + name: "margin-top", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertQuirkyLength", +- initial: "initialMargin", ++ converter: "ConvertQuirkyLength", ++ initial: "InitialMargin", + interpolable: true, + }, + { + name: "marker-end", + api_class: "CSSPropertyAPIMarker", +- converter: "convertFragmentIdentifier", ++ converter: "ConvertFragmentIdentifier", + inherited: true, + name_for_methods: "MarkerEndResource", + svg: true, +@@ -1302,7 +1302,7 @@ + { + name: "marker-mid", + api_class: "CSSPropertyAPIMarker", +- converter: "convertFragmentIdentifier", ++ converter: "ConvertFragmentIdentifier", + inherited: true, + name_for_methods: "MarkerMidResource", + svg: true, +@@ -1310,7 +1310,7 @@ + { + name: "marker-start", + api_class: "CSSPropertyAPIMarker", +- converter: "convertFragmentIdentifier", ++ converter: "ConvertFragmentIdentifier", + inherited: true, + name_for_methods: "MarkerStartResource", + svg: true, +@@ -1318,7 +1318,7 @@ + { + name: "mask", + api_class: "CSSPropertyAPIMarker", +- converter: "convertFragmentIdentifier", ++ converter: "ConvertFragmentIdentifier", + name_for_methods: "MaskerResource", + svg: true, + }, +@@ -1333,32 +1333,32 @@ + }, + { + name: "max-height", +- converter: "convertLengthMaxSizing", ++ converter: "ConvertLengthMaxSizing", + is_descriptor: true, +- initial: "initialMaxSize", ++ initial: "InitialMaxSize", + interpolable: true, + }, + { + name: "max-width", +- converter: "convertLengthMaxSizing", ++ converter: "ConvertLengthMaxSizing", + is_descriptor: true, +- initial: "initialMaxSize", ++ initial: "InitialMaxSize", + interpolable: true, + }, + { + name: "min-height", + api_class: "CSSPropertyAPIWidthOrHeight", +- converter: "convertLengthSizing", ++ converter: "ConvertLengthSizing", + is_descriptor: true, +- initial: "initialMinSize", ++ initial: "InitialMinSize", + interpolable: true, + }, + { + name: "min-width", + api_class: "CSSPropertyAPIWidthOrHeight", +- converter: "convertLengthSizing", ++ converter: "ConvertLengthSizing", + is_descriptor: true, +- initial: "initialMinSize", ++ initial: "InitialMinSize", + interpolable: true, + }, + { +@@ -1384,46 +1384,46 @@ + }, + { + name: "object-position", +- converter: "convertPosition", ++ converter: "ConvertPosition", + interpolable: true, + }, + { + name: "offset-anchor", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertPositionOrAuto", ++ converter: "ConvertPositionOrAuto", + interpolable: true, + runtime_flag: "CSSOffsetPositionAnchor", + }, + { + name: "offset-distance", + api_class: true, +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + }, + { + name: "offset-path", +- converter: "convertPathOrNone", ++ converter: "ConvertPathOrNone", + }, + { + name: "offset-position", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertPositionOrAuto", ++ converter: "ConvertPositionOrAuto", + interpolable: true, + runtime_flag: "CSSOffsetPositionAnchor", + }, + { + name: "offset-rotate", + api_class: "CSSPropertyAPIOffsetRotate", +- converter: "convertOffsetRotate", ++ converter: "ConvertOffsetRotate", + interpolable: true, + runtime_flag: "CSSOffsetRotate", + }, + { + name: "offset-rotation", + api_class: "CSSPropertyAPIOffsetRotate", +- converter: "convertOffsetRotate", ++ converter: "ConvertOffsetRotate", + interpolable: true, + runtime_flag: "CSSOffsetRotation", + }, +@@ -1460,7 +1460,7 @@ + name: "outline-offset", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<int>", ++ converter: "ConvertComputedLength<int>", + interpolable: true, + }, + { +@@ -1471,7 +1471,7 @@ + name: "outline-width", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertLineWidth<unsigned short>", ++ converter: "ConvertLineWidth<unsigned short>", + interpolable: true, + }, + { +@@ -1510,51 +1510,51 @@ + name: "padding-bottom", + api_class: "CSSPropertyAPIPadding", + api_methods: ["parseSingleValue"], +- converter: "convertLength", +- initial: "initialPadding", ++ converter: "ConvertLength", ++ initial: "InitialPadding", + interpolable: true, + }, + { + name: "padding-left", + api_class: "CSSPropertyAPIPadding", + api_methods: ["parseSingleValue"], +- converter: "convertLength", +- initial: "initialPadding", ++ converter: "ConvertLength", ++ initial: "InitialPadding", + interpolable: true, + }, + { + name: "padding-right", + api_class: "CSSPropertyAPIPadding", + api_methods: ["parseSingleValue"], +- converter: "convertLength", +- initial: "initialPadding", ++ converter: "ConvertLength", ++ initial: "InitialPadding", + interpolable: true, + }, + { + name: "padding-top", + api_class: "CSSPropertyAPIPadding", + api_methods: ["parseSingleValue"], +- converter: "convertLength", +- initial: "initialPadding", ++ converter: "ConvertLength", ++ initial: "InitialPadding", + interpolable: true, + }, + { + name: "paint-order", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertPaintOrder", ++ converter: "ConvertPaintOrder", + inherited: true, + svg: true, + }, + { + name: "perspective", + api_class: "CSSPropertyAPIPerspective", +- converter: "convertPerspective", ++ converter: "ConvertPerspective", + interpolable: true, + }, + { + name: "perspective-origin", +- converter: "convertPosition", ++ converter: "ConvertPosition", + interpolable: true, + }, + { +@@ -1572,6 +1572,7 @@ + custom_inherit: true, + default_value: "static", + field_template: "keyword", ++ getter: "GetPosition", + keywords: [ + "static", "relative", "absolute", "fixed", "sticky", + ], +@@ -1580,7 +1581,7 @@ + name: "quotes", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertQuotes", ++ converter: "ConvertQuotes", + inherited: true, + }, + { +@@ -1591,8 +1592,8 @@ + name: "right", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", +- initial: "initialOffset", ++ converter: "ConvertLengthOrAuto", ++ initial: "InitialOffset", + interpolable: true, + keywords: ["auto"], + supports_percentage: true, +@@ -1601,7 +1602,7 @@ + { + name: "r", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + svg: true, + }, +@@ -1609,7 +1610,7 @@ + name: "rx", + api_class: "CSSPropertyAPIRadius", + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", ++ converter: "ConvertLengthOrAuto", + interpolable: true, + svg: true, + }, +@@ -1617,7 +1618,7 @@ + name: "ry", + api_class: "CSSPropertyAPIRadius", + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", ++ converter: "ConvertLengthOrAuto", + interpolable: true, + svg: true, + }, +@@ -1633,24 +1634,24 @@ + }, + { + name: "scroll-snap-points-x", +- converter: "convertSnapPoints", ++ converter: "ConvertSnapPoints", + runtime_flag: "CSSScrollSnapPoints", + }, + { + name: "scroll-snap-points-y", +- converter: "convertSnapPoints", ++ converter: "ConvertSnapPoints", + runtime_flag: "CSSScrollSnapPoints", + }, + { + name: "scroll-snap-destination", +- converter: "convertPosition", ++ converter: "ConvertPosition", + runtime_flag: "CSSScrollSnapPoints", + }, + { + name: "scroll-snap-coordinate", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertSnapCoordinates", ++ converter: "ConvertSnapCoordinates", + runtime_flag: "CSSScrollSnapPoints", + }, + { +@@ -1664,14 +1665,14 @@ + name: "shape-margin", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + }, + { + name: "shape-outside", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertShapeValue", ++ converter: "ConvertShapeValue", + interpolable: true, + typedom_types: ["Image"], + }, +@@ -1694,7 +1695,7 @@ + name: "stop-color", + api_class: "CSSPropertyAPIColor", + api_methods: ["parseSingleValue"], +- converter: "convertColor", ++ converter: "ConvertColor", + interpolable: true, + svg: true, + }, +@@ -1702,7 +1703,7 @@ + name: "stop-opacity", + api_class: "CSSPropertyAPIOpacity", + api_methods: ["parseSingleValue"], +- converter: "convertNumberOrPercentage", ++ converter: "ConvertNumberOrPercentage", + interpolable: true, + svg: true, + }, +@@ -1713,14 +1714,14 @@ + custom_all: true, + inherited: true, + interpolable: true, +- setter: "setStrokePaint", ++ setter: "SetStrokePaint", + svg: true, + }, + { + name: "stroke-dasharray", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertStrokeDasharray", ++ converter: "ConvertStrokeDasharray", + inherited: true, + interpolable: true, + name_for_methods: "StrokeDashArray", +@@ -1729,7 +1730,7 @@ + { + name: "stroke-dashoffset", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertLength", ++ converter: "ConvertLength", + inherited: true, + interpolable: true, + name_for_methods: "StrokeDashOffset", +@@ -1763,7 +1764,7 @@ + name: "stroke-opacity", + api_class: "CSSPropertyAPIOpacity", + api_methods: ["parseSingleValue"], +- converter: "convertNumberOrPercentage", ++ converter: "ConvertNumberOrPercentage", + inherited: true, + interpolable: true, + svg: true, +@@ -1771,7 +1772,7 @@ + { + name: "stroke-width", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertUnzoomedLength", ++ converter: "ConvertUnzoomedLength", + inherited: true, + interpolable: true, + svg: true, +@@ -1788,7 +1789,7 @@ + name: "tab-size", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrTabSpaces", ++ converter: "ConvertLengthOrTabSpaces", + inherited: true, + type_name: "TabSize", + }, +@@ -1799,6 +1800,7 @@ + inherited: true, + default_value: "start", + field_template: "keyword", ++ getter: "GetTextAlign", + keywords: [ + "left", "right", "center", "justify", "webkitLeft", "webkitRight", "webkitCenter", "start", "end", + ], +@@ -1837,7 +1839,7 @@ + { + name: "text-decoration-line", + api_class: "CSSPropertyAPITextDecorationLine", +- converter: "convertFlags<TextDecoration>", ++ converter: "ConvertFlags<TextDecoration>", + name_for_methods: "TextDecoration", + runtime_flag: "CSS3TextDecorations", + type_name: "TextDecoration", +@@ -1846,7 +1848,7 @@ + name: "text-decoration-skip", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFlags<TextDecorationSkip>", ++ converter: "ConvertFlags<TextDecorationSkip>", + inherited: true, + runtime_flag: "CSS3TextDecorations", + type_name: "TextDecorationSkip", +@@ -1877,7 +1879,7 @@ + { + name: "text-shadow", + api_class: "CSSPropertyAPIShadow", +- converter: "convertShadowList", ++ converter: "ConvertShadowList", + inherited: true, + interpolable: true, + }, +@@ -1885,7 +1887,7 @@ + name: "text-size-adjust", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertTextSizeAdjust", ++ converter: "ConvertTextSizeAdjust", + inherited: true, + type_name: "TextSizeAdjust", + }, +@@ -1909,8 +1911,8 @@ + name: "top", + api_class: "CSSPropertyAPIMargin", + api_methods: ["parseSingleValue"], +- converter: "convertLengthOrAuto", +- initial: "initialOffset", ++ converter: "ConvertLengthOrAuto", ++ initial: "InitialOffset", + interpolable: true, + keywords: ["auto"], + supports_percentage: true, +@@ -1920,12 +1922,12 @@ + name: "touch-action", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertFlags<TouchAction>", ++ converter: "ConvertFlags<TouchAction>", + type_name: "TouchAction", + }, + { + name: "transform", +- converter: "convertTransformOperations", ++ converter: "ConvertTransformOperations", + interpolable: true, + keywords: ["none"], + typedom_types: ["Transform"], +@@ -1941,7 +1943,8 @@ + name: "transform-origin", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertTransformOrigin", ++ converter: "ConvertTransformOrigin", ++ getter: "GetTransformOrigin", + interpolable: true, + }, + { +@@ -1952,7 +1955,7 @@ + name: "translate", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertTranslate", ++ converter: "ConvertTranslate", + interpolable: true, + runtime_flag: "CSSIndependentTransformProperties", + }, +@@ -1960,7 +1963,7 @@ + name: "rotate", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertRotate", ++ converter: "ConvertRotate", + interpolable: true, + runtime_flag: "CSSIndependentTransformProperties", + }, +@@ -1968,7 +1971,7 @@ + name: "scale", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertScale", ++ converter: "ConvertScale", + interpolable: true, + runtime_flag: "CSSIndependentTransformProperties", + }, +@@ -2006,14 +2009,14 @@ + { + name: "x", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + svg: true, + }, + { + name: "y", + api_class: "CSSPropertyAPIStrokeOrLength", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + svg: true, + }, +@@ -2037,7 +2040,7 @@ + name: "-webkit-border-horizontal-spacing", + api_class: "CSSPropertyAPIWebkitBorderSpacing", + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<short>", ++ converter: "ConvertComputedLength<short>", + inherited: true, + interpolable: true, + name_for_methods: "HorizontalBorderSpacing", +@@ -2046,13 +2049,13 @@ + name: "-webkit-border-image", + api_class: true, + custom_value: true, +- initial: "initialNinePieceImage", ++ initial: "InitialNinePieceImage", + }, + { + name: "-webkit-border-vertical-spacing", + api_class: "CSSPropertyAPIWebkitBorderSpacing", + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<short>", ++ converter: "ConvertComputedLength<short>", + inherited: true, + interpolable: true, + name_for_methods: "VerticalBorderSpacing", +@@ -2092,7 +2095,7 @@ + "-webkit-box-pack", + { + name: "-webkit-box-reflect", +- converter: "convertBoxReflect", ++ converter: "ConvertBoxReflect", + }, + { + name: "column-count", +@@ -2106,7 +2109,7 @@ + name: "column-gap", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<float>", ++ converter: "ConvertComputedLength<float>", + custom_all: true, + interpolable: true, + }, +@@ -2119,14 +2122,14 @@ + }, + { + name: "column-rule-style", +- initial: "initialBorderStyle", ++ initial: "InitialBorderStyle", + type_name: "EBorderStyle", + }, + { + name: "column-rule-width", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertLineWidth<unsigned short>", ++ converter: "ConvertLineWidth<unsigned short>", + interpolable: true, + }, + { +@@ -2139,7 +2142,7 @@ + name: "column-width", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<float>", ++ converter: "ConvertComputedLength<float>", + custom_all: true, + interpolable: true, + }, +@@ -2147,12 +2150,12 @@ + name: "-webkit-highlight", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertString<CSSValueNone>", ++ converter: "ConvertString<CSSValueNone>", + inherited: true, + }, + { + name: "-webkit-hyphenate-character", +- converter: "convertString<CSSValueAuto>", ++ converter: "ConvertString<CSSValueAuto>", + inherited: true, + name_for_methods: "HyphenationString", + }, +@@ -2260,13 +2263,13 @@ + { + name: "-webkit-perspective-origin-x", + api_class: "CSSPropertyAPIWebkitOriginX", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + }, + { + name: "-webkit-perspective-origin-y", + api_class: "CSSPropertyAPIWebkitOriginY", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + }, + { +@@ -2281,11 +2284,11 @@ + name: "-webkit-rtl-ordering", + independent: true, + inherited: true, +- initial: "initialRtlOrdering", ++ initial: "InitialRtlOrdering", + default_value: "logical", + field_template: "keyword", + keywords: ["logical", "visual"], +- setter: "setRtlOrdering", ++ setter: "SetRtlOrdering", + type_name: "EOrder", + }, + { +@@ -2297,7 +2300,7 @@ + name: "-webkit-tap-highlight-color", + api_class: "CSSPropertyAPIColor", + api_methods: ["parseSingleValue"], +- converter: "convertColor", ++ converter: "ConvertColor", + inherited: true, + }, + { +@@ -2348,26 +2351,26 @@ + name: "-webkit-text-stroke-width", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertTextStrokeWidth", ++ converter: "ConvertTextStrokeWidth", + inherited: true, + }, + { + name: "-webkit-transform-origin-x", + api_class: "CSSPropertyAPIWebkitOriginX", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + }, + { + name: "-webkit-transform-origin-y", + api_class: "CSSPropertyAPIWebkitOriginY", +- converter: "convertLength", ++ converter: "ConvertLength", + interpolable: true, + }, + { + name: "-webkit-transform-origin-z", + api_class: true, + api_methods: ["parseSingleValue"], +- converter: "convertComputedLength<float>", ++ converter: "ConvertComputedLength<float>", + interpolable: true, + }, + "-webkit-user-drag", +@@ -2398,9 +2401,9 @@ + { + name: "width", + api_class: "CSSPropertyAPIWidthOrHeight", +- converter: "convertLengthSizing", ++ converter: "ConvertLengthSizing", + is_descriptor: true, +- initial: "initialSize", ++ initial: "InitialSize", + interpolable: true, + keywords: ["auto", "fit-content", "min-content", "max-content"], + supports_percentage: true, +@@ -2420,9 +2423,9 @@ + name: "word-spacing", + api_class: "CSSPropertyAPILetterAndWordSpacing", + api_methods: ["parseSingleValue"], +- converter: "convertSpacing", ++ converter: "ConvertSpacing", + inherited: true, +- initial: "initialLetterWordSpacing", ++ initial: "InitialLetterWordSpacing", + interpolable: true, + }, + // UAs must treat 'word-wrap' as an alternate name for the 'overflow-wrap' property. So using the same handlers. +diff --git a/third_party/WebKit/Source/core/css/CSSRuleList.h b/third_party/WebKit/Source/core/css/CSSRuleList.h +index a9c7859610c4..12dc32810cc7 100644 +--- a/third_party/WebKit/Source/core/css/CSSRuleList.h ++++ b/third_party/WebKit/Source/core/css/CSSRuleList.h +@@ -89,7 +89,7 @@ class LiveCSSRuleList final : public CSSRuleList { + unsigned length() const override { return rule_->length(); } + CSSRule* item(unsigned index) const override { return rule_->Item(index); } + CSSStyleSheet* GetStyleSheet() const override { +- return rule_->ParentStyleSheet(); ++ return rule_->parentStyleSheet(); + } + + Member<Rule> rule_; +diff --git a/third_party/WebKit/Source/core/css/CSSValue.h b/third_party/WebKit/Source/core/css/CSSValue.h +index 930809772e42..14f7acc953c5 100644 +--- a/third_party/WebKit/Source/core/css/CSSValue.h ++++ b/third_party/WebKit/Source/core/css/CSSValue.h +@@ -43,7 +43,7 @@ class CORE_EXPORT CSSValue : public GarbageCollectedFinalized<CSSValue> { + const char* type_name = "blink::CSSValue"; + return ThreadHeap::AllocateOnArenaIndex( + state, size, +- is_eager ? BlinkGC::kEagerSweepArenaIndex : BlinkGC::CSSValueArenaIndex, ++ is_eager ? BlinkGC::kEagerSweepArenaIndex : BlinkGC::kCSSValueArenaIndex, + GCInfoTrait<CSSValue>::Index(), type_name); + } + +diff --git a/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp b/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp +index b2e864e935f5..00f1a5e10b6d 100644 +--- a/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp ++++ b/third_party/WebKit/Source/core/css/ElementRuleCollector.cpp +@@ -257,7 +257,7 @@ CSSRule* ElementRuleCollector::FindStyleRule(CSSRuleCollection* css_rules, + return nullptr; + CSSRule* result = 0; + for (unsigned i = 0; i < css_rules->length() && !result; ++i) { +- CSSRule* css_rule = css_rules->Item(i); ++ CSSRule* css_rule = css_rules->item(i); + CSSRule::Type css_rule_type = css_rule->type(); + if (css_rule_type == CSSRule::kStyleRule) { + CSSStyleRule* css_style_rule = ToCSSStyleRule(css_rule); +diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp +index 23ba22269edb..8b250f82c7e7 100644 +--- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp ++++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp +@@ -254,7 +254,7 @@ ScriptPromise FontFaceSet::ready(ScriptState* script_state) { + return ready_->Promise(script_state->World()); + } + +-FontFaceSet* FontFaceSet::AddForBinding(ScriptState*, ++FontFaceSet* FontFaceSet::addForBinding(ScriptState*, + FontFace* font_face, + ExceptionState&) { + DCHECK(font_face); +@@ -273,7 +273,7 @@ FontFaceSet* FontFaceSet::AddForBinding(ScriptState*, + return this; + } + +-void FontFaceSet::ClearForBinding(ScriptState*, ExceptionState&) { ++void FontFaceSet::clearForBinding(ScriptState*, ExceptionState&) { + if (!InActiveDocumentContext() || non_css_connected_faces_.IsEmpty()) + return; + CSSFontSelector* font_selector = GetDocument()->GetStyleEngine().FontSelector(); +@@ -287,7 +287,7 @@ void FontFaceSet::ClearForBinding(ScriptState*, ExceptionState&) { + font_selector->FontFaceInvalidated(); + } + +-bool FontFaceSet::DeleteForBinding(ScriptState*, ++bool FontFaceSet::deleteForBinding(ScriptState*, + FontFace* font_face, + ExceptionState&) { + DCHECK(font_face); +@@ -307,7 +307,7 @@ bool FontFaceSet::DeleteForBinding(ScriptState*, + return false; + } + +-bool FontFaceSet::HasForBinding(ScriptState*, ++bool FontFaceSet::hasForBinding(ScriptState*, + FontFace* font_face, + ExceptionState&) const { + DCHECK(font_face); +diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.h b/third_party/WebKit/Source/core/css/FontFaceSet.h +index f2a136766d1b..f995527d6d45 100644 +--- a/third_party/WebKit/Source/core/css/FontFaceSet.h ++++ b/third_party/WebKit/Source/core/css/FontFaceSet.h +@@ -74,10 +74,10 @@ class CORE_EXPORT FontFaceSet final : public EventTargetWithInlineData, + ScriptPromise load(ScriptState*, const String& font, const String& text); + ScriptPromise ready(ScriptState*); + +- FontFaceSet* AddForBinding(ScriptState*, FontFace*, ExceptionState&); +- void ClearForBinding(ScriptState*, ExceptionState&); +- bool DeleteForBinding(ScriptState*, FontFace*, ExceptionState&); +- bool HasForBinding(ScriptState*, FontFace*, ExceptionState&) const; ++ FontFaceSet* addForBinding(ScriptState*, FontFace*, ExceptionState&); ++ void clearForBinding(ScriptState*, ExceptionState&); ++ bool deleteForBinding(ScriptState*, FontFace*, ExceptionState&); ++ bool hasForBinding(ScriptState*, FontFace*, ExceptionState&) const; + + size_t size() const; + AtomicString status() const; +diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp +index 78c7d5dfc70c..b51d722a7c5f 100644 +--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp ++++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp +@@ -798,8 +798,9 @@ static bool ColorGamutMediaFeatureEval(const MediaQueryExpValue& value, + void MediaQueryEvaluator::Init() { + // Create the table. + g_function_map = new FunctionMap; +-#define ADD_TO_FUNCTIONMAP(name) \ +- g_function_map->Set(name##MediaFeature.Impl(), name##MediaFeatureEval); ++#define ADD_TO_FUNCTIONMAP(constantPrefix, methodPrefix) \ ++ g_function_map->Set(constantPrefix##MediaFeature.Impl(), \ ++ methodPrefix##MediaFeatureEval); + CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(ADD_TO_FUNCTIONMAP); + #undef ADD_TO_FUNCTIONMAP + } +diff --git a/third_party/WebKit/Source/core/css/StylePropertySet.cpp b/third_party/WebKit/Source/core/css/StylePropertySet.cpp +index 68b0b997ea86..e48e537120db 100644 +--- a/third_party/WebKit/Source/core/css/StylePropertySet.cpp ++++ b/third_party/WebKit/Source/core/css/StylePropertySet.cpp +@@ -136,9 +136,9 @@ int ImmutableStylePropertySet::FindPropertyIndex(T property) const { + + return -1; + } +-template CORE_EXPORT int ImmutableStylePropertySet::findPropertyIndex( ++template CORE_EXPORT int ImmutableStylePropertySet::FindPropertyIndex( + CSSPropertyID) const; +-template CORE_EXPORT int ImmutableStylePropertySet::findPropertyIndex( ++template CORE_EXPORT int ImmutableStylePropertySet::FindPropertyIndex( + AtomicString) const; + + DEFINE_TRACE_AFTER_DISPATCH(ImmutableStylePropertySet) { +@@ -178,9 +178,9 @@ String StylePropertySet::GetPropertyValue(T property) const { + return SerializeShorthand(*this, property); + } + template CORE_EXPORT String +- StylePropertySet::getPropertyValue<CSSPropertyID>(CSSPropertyID) const; ++ StylePropertySet::GetPropertyValue<CSSPropertyID>(CSSPropertyID) const; + template CORE_EXPORT String +- StylePropertySet::getPropertyValue<AtomicString>(AtomicString) const; ++ StylePropertySet::GetPropertyValue<AtomicString>(AtomicString) const; + + template <typename T> + const CSSValue* StylePropertySet::GetPropertyCSSValue(T property) const { +@@ -190,9 +190,9 @@ const CSSValue* StylePropertySet::GetPropertyCSSValue(T property) const { + return &PropertyAt(found_property_index).Value(); + } + template CORE_EXPORT const CSSValue* +- StylePropertySet::getPropertyCSSValue<CSSPropertyID>(CSSPropertyID) const; ++ StylePropertySet::GetPropertyCSSValue<CSSPropertyID>(CSSPropertyID) const; + template CORE_EXPORT const CSSValue* +- StylePropertySet::getPropertyCSSValue<AtomicString>(AtomicString) const; ++ StylePropertySet::GetPropertyCSSValue<AtomicString>(AtomicString) const; + + DEFINE_TRACE(StylePropertySet) { + if (is_mutable_) +@@ -247,9 +247,9 @@ bool MutableStylePropertySet::RemoveProperty(T property, String* return_text) { + int found_property_index = FindPropertyIndex(property); + return RemovePropertyAtIndex(found_property_index, return_text); + } +-template CORE_EXPORT bool MutableStylePropertySet::removeProperty(CSSPropertyID, ++template CORE_EXPORT bool MutableStylePropertySet::RemoveProperty(CSSPropertyID, + String*); +-template CORE_EXPORT bool MutableStylePropertySet::removeProperty(AtomicString, ++template CORE_EXPORT bool MutableStylePropertySet::RemoveProperty(AtomicString, + String*); + + template <typename T> +@@ -259,9 +259,9 @@ bool StylePropertySet::PropertyIsImportant(T property) const { + return PropertyAt(found_property_index).IsImportant(); + return ShorthandIsImportant(property); + } +-template bool StylePropertySet::propertyIsImportant<CSSPropertyID>( ++template bool StylePropertySet::PropertyIsImportant<CSSPropertyID>( + CSSPropertyID) const; +-template bool StylePropertySet::propertyIsImportant<AtomicString>( ++template bool StylePropertySet::PropertyIsImportant<AtomicString>( + AtomicString) const; + + bool StylePropertySet::ShorthandIsImportant(CSSPropertyID property_id) const { +@@ -574,9 +574,9 @@ int MutableStylePropertySet::FindPropertyIndex(T property) const { + + return (it == end) ? -1 : it - begin; + } +-template CORE_EXPORT int MutableStylePropertySet::findPropertyIndex( ++template CORE_EXPORT int MutableStylePropertySet::FindPropertyIndex( + CSSPropertyID) const; +-template CORE_EXPORT int MutableStylePropertySet::findPropertyIndex( ++template CORE_EXPORT int MutableStylePropertySet::FindPropertyIndex( + AtomicString) const; + + DEFINE_TRACE_AFTER_DISPATCH(MutableStylePropertySet) { +diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +index c6b1b7192695..5115f6fe8985 100644 +--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ++++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp +@@ -1834,7 +1834,7 @@ const CSSValue* CSSPropertyParser::ParseSingleValue( + // other properties, those properties will be taken out of the switch + // statement. + const CSSPropertyDescriptor& css_property_desc = +- CSSPropertyDescriptor::get(property); ++ CSSPropertyDescriptor::Get(property); + if (css_property_desc.parseSingleValue) { + DCHECK(context_); + return css_property_desc.parseSingleValue(range_, *context_); +@@ -3366,7 +3366,7 @@ bool CSSPropertyParser::ParseShorthand(CSSPropertyID unresolved_property, + // other properties, those properties will be taken out of the switch + // statement. + const CSSPropertyDescriptor& css_property_desc = +- CSSPropertyDescriptor::get(property); ++ CSSPropertyDescriptor::Get(property); + if (css_property_desc.parseShorthand) + return css_property_desc.parseShorthand(important, range_, context_); + +diff --git a/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp b/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp +index bdcc92e9b951..b4549c73b1f2 100644 +--- a/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp ++++ b/third_party/WebKit/Source/core/css/parser/CSSTokenizer.cpp +@@ -210,7 +210,7 @@ CSSParserToken CSSTokenizer::SemiColon(UChar cc) { + return CSSParserToken(kSemicolonToken); + } + +-CSSParserToken CSSTokenizer::GetHash(UChar cc) { ++CSSParserToken CSSTokenizer::Hash(UChar cc) { + UChar next_char = input_.PeekWithoutReplacement(0); + if (IsNameCodePoint(next_char) || + TwoCharsAreValidEscape(next_char, input_.PeekWithoutReplacement(1))) { +@@ -338,12 +338,12 @@ CSSParserToken CSSTokenizer::ConsumeNumber() { + sign = kMinusSign; + } + +- number_length = input_.SkipWhilePredicate<isASCIIDigit>(number_length); ++ number_length = input_.SkipWhilePredicate<IsASCIIDigit>(number_length); + next = input_.PeekWithoutReplacement(number_length); + if (next == '.' && + IsASCIIDigit(input_.PeekWithoutReplacement(number_length + 1))) { + type = kNumberValueType; +- number_length = input_.SkipWhilePredicate<isASCIIDigit>(number_length + 2); ++ number_length = input_.SkipWhilePredicate<IsASCIIDigit>(number_length + 2); + next = input_.PeekWithoutReplacement(number_length); + } + +@@ -351,11 +351,11 @@ CSSParserToken CSSTokenizer::ConsumeNumber() { + next = input_.PeekWithoutReplacement(number_length + 1); + if (IsASCIIDigit(next)) { + type = kNumberValueType; +- number_length = input_.SkipWhilePredicate<isASCIIDigit>(number_length + 1); ++ number_length = input_.SkipWhilePredicate<IsASCIIDigit>(number_length + 1); + } else if ((next == '+' || next == '-') && + IsASCIIDigit(input_.PeekWithoutReplacement(number_length + 2))) { + type = kNumberValueType; +- number_length = input_.SkipWhilePredicate<isASCIIDigit>(number_length + 3); ++ number_length = input_.SkipWhilePredicate<IsASCIIDigit>(number_length + 3); + } + } + +diff --git a/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h b/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h +index b5d5f8789aab..32da368e0007 100644 +--- a/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h ++++ b/third_party/WebKit/Source/core/css/parser/CSSTokenizer.h +@@ -82,7 +82,7 @@ class CORE_EXPORT CSSTokenizer { + CSSParserToken Solidus(UChar); + CSSParserToken Colon(UChar); + CSSParserToken SemiColon(UChar); +- CSSParserToken GetHash(UChar); ++ CSSParserToken Hash(UChar); + CSSParserToken CircumflexAccent(UChar); + CSSParserToken DollarSign(UChar); + CSSParserToken VerticalLine(UChar); +diff --git a/third_party/WebKit/Source/core/css/parser/CSSTokenizerTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSTokenizerTest.cpp +index 46df1978e07f..2de2e4f5d22c 100644 +--- a/third_party/WebKit/Source/core/css/parser/CSSTokenizerTest.cpp ++++ b/third_party/WebKit/Source/core/css/parser/CSSTokenizerTest.cpp +@@ -141,22 +141,22 @@ DEFINE_TOKEN(Whitespace, (kWhitespaceToken)) + DEFINE_TOKEN(Colon, (kColonToken)); + DEFINE_TOKEN(Semicolon, (kSemicolonToken)); + DEFINE_TOKEN(Comma, (kCommaToken)); +-DEFINE_TOKEN(Include_match, (kIncludeMatchToken)); +-DEFINE_TOKEN(Dash_match, (kDashMatchToken)); +-DEFINE_TOKEN(Prefix_match, (kPrefixMatchToken)); +-DEFINE_TOKEN(Suffix_match, (kSuffixMatchToken)); +-DEFINE_TOKEN(Substring_match, (kSubstringMatchToken)); ++DEFINE_TOKEN(IncludeMatch, (kIncludeMatchToken)); ++DEFINE_TOKEN(DashMatch, (kDashMatchToken)); ++DEFINE_TOKEN(PrefixMatch, (kPrefixMatchToken)); ++DEFINE_TOKEN(SuffixMatch, (kSuffixMatchToken)); ++DEFINE_TOKEN(SubstringMatch, (kSubstringMatchToken)); + DEFINE_TOKEN(Column, (kColumnToken)); + DEFINE_TOKEN(Cdo, (kCDOToken)); + DEFINE_TOKEN(Cdc, (kCDCToken)); +-DEFINE_TOKEN(Left_parenthesis, (kLeftParenthesisToken)); +-DEFINE_TOKEN(Right_parenthesis, (kRightParenthesisToken)); +-DEFINE_TOKEN(Left_bracket, (kLeftBracketToken)); +-DEFINE_TOKEN(Right_bracket, (kRightBracketToken)); +-DEFINE_TOKEN(Left_brace, (kLeftBraceToken)); +-DEFINE_TOKEN(Right_brace, (kRightBraceToken)); +-DEFINE_TOKEN(Bad_string, (kBadStringToken)); +-DEFINE_TOKEN(Bad_url, (kBadUrlToken)); ++DEFINE_TOKEN(LeftParenthesis, (kLeftParenthesisToken)); ++DEFINE_TOKEN(RightParenthesis, (kRightParenthesisToken)); ++DEFINE_TOKEN(LeftBracket, (kLeftBracketToken)); ++DEFINE_TOKEN(RightBracket, (kRightBracketToken)); ++DEFINE_TOKEN(LeftBrace, (kLeftBraceToken)); ++DEFINE_TOKEN(RightBrace, (kRightBraceToken)); ++DEFINE_TOKEN(BadString, (kBadStringToken)); ++DEFINE_TOKEN(BadUrl, (kBadUrlToken)); + + String FromUChar32(UChar32 c) { + StringBuilder input; +diff --git a/third_party/WebKit/Source/core/dom/ElementTraversal.h b/third_party/WebKit/Source/core/dom/ElementTraversal.h +index 4da55073b7c9..4c425226b24b 100644 +--- a/third_party/WebKit/Source/core/dom/ElementTraversal.h ++++ b/third_party/WebKit/Source/core/dom/ElementTraversal.h +@@ -281,7 +281,7 @@ template <class ElementType> + template <class NodeType> + inline ElementType* Traversal<ElementType>::FirstChildTemplate( + NodeType& current) { +- Node* node = current.FirstChild(); ++ Node* node = current.firstChild(); + while (node && !IsElementOfType<const ElementType>(*node)) + node = node->nextSibling(); + return ToElement<ElementType>(node); +@@ -319,7 +319,7 @@ template <class ElementType> + template <class NodeType> + inline ElementType* Traversal<ElementType>::LastChildTemplate( + NodeType& current) { +- Node* node = current.LastChild(); ++ Node* node = current.lastChild(); + while (node && !IsElementOfType<const ElementType>(*node)) + node = node->previousSibling(); + return ToElement<ElementType>(node); +@@ -340,7 +340,7 @@ template <class ElementType> + template <class NodeType> + inline ElementType* Traversal<ElementType>::FirstWithinTemplate( + NodeType& current) { +- Node* node = current.FirstChild(); ++ Node* node = current.firstChild(); + while (node && !IsElementOfType<const ElementType>(*node)) + node = NodeTraversal::Next(*node, ¤t); + return ToElement<ElementType>(node); +diff --git a/third_party/WebKit/Source/core/dom/Node.h b/third_party/WebKit/Source/core/dom/Node.h +index 161d5afde984..6ef44061ca60 100644 +--- a/third_party/WebKit/Source/core/dom/Node.h ++++ b/third_party/WebKit/Source/core/dom/Node.h +@@ -167,7 +167,7 @@ class CORE_EXPORT Node : public EventTarget { + const char* type_name = "blink::Node"; + return ThreadHeap::AllocateOnArenaIndex( + state, size, +- is_eager ? BlinkGC::kEagerSweepArenaIndex : BlinkGC::NodeArenaIndex, ++ is_eager ? BlinkGC::kEagerSweepArenaIndex : BlinkGC::kNodeArenaIndex, + GCInfoTrait<EventTarget>::Index(), type_name); + } + +diff --git a/third_party/WebKit/Source/core/dom/NodeTraversal.h b/third_party/WebKit/Source/core/dom/NodeTraversal.h +index 1097a4c5228f..e7c6314bc54d 100644 +--- a/third_party/WebKit/Source/core/dom/NodeTraversal.h ++++ b/third_party/WebKit/Source/core/dom/NodeTraversal.h +@@ -349,22 +349,22 @@ NodeTraversal::StartsAfter(const Node& start) { + + template <class NodeType> + inline Node* NodeTraversal::TraverseNextTemplate(NodeType& current) { +- if (current.HasChildren()) +- return current.FirstChild(); +- if (current.NextSibling()) +- return current.NextSibling(); ++ if (current.hasChildren()) ++ return current.firstChild(); ++ if (current.nextSibling()) ++ return current.nextSibling(); + return NextAncestorSibling(current); + } + + template <class NodeType> + inline Node* NodeTraversal::TraverseNextTemplate(NodeType& current, + const Node* stay_within) { +- if (current.HasChildren()) +- return current.FirstChild(); ++ if (current.hasChildren()) ++ return current.firstChild(); + if (current == stay_within) + return 0; +- if (current.NextSibling()) +- return current.NextSibling(); ++ if (current.nextSibling()) ++ return current.nextSibling(); + return NextAncestorSibling(current, stay_within); + } + +@@ -392,7 +392,7 @@ inline Node& NodeTraversal::HighestAncestorOrSelf(Node& current) { + + template <class NodeType> + inline Node* NodeTraversal::ChildAtTemplate(NodeType& parent, unsigned index) { +- Node* child = parent.FirstChild(); ++ Node* child = parent.firstChild(); + while (child && index--) + child = child->nextSibling(); + return child; +diff --git a/third_party/WebKit/Source/core/editing/EditingCommandTest.cpp b/third_party/WebKit/Source/core/editing/EditingCommandTest.cpp +index afcae11323e1..f9a42305f223 100644 +--- a/third_party/WebKit/Source/core/editing/EditingCommandTest.cpp ++++ b/third_party/WebKit/Source/core/editing/EditingCommandTest.cpp +@@ -19,7 +19,7 @@ struct CommandNameEntry { + }; + + const CommandNameEntry kCommandNameEntries[] = { +-#define V(name) {#name, WebEditingCommandType::name}, ++#define V(name) {#name, WebEditingCommandType::k##name}, + FOR_EACH_BLINK_EDITING_COMMAND_NAME(V) + #undef V + }; +diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +index 3d664fbdbb5a..ba61fa7dee19 100644 +--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp ++++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +@@ -88,7 +88,7 @@ struct CommandNameEntry { + }; + + const CommandNameEntry kCommandNameEntries[] = { +-#define V(name) {#name, WebEditingCommandType::name}, ++#define V(name) {#name, WebEditingCommandType::k##name}, + FOR_EACH_BLINK_EDITING_COMMAND_NAME(V) + #undef V + }; +diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommandNames.h b/third_party/WebKit/Source/core/editing/commands/EditorCommandNames.h +index 2b99df14310a..312b4c9c34c9 100644 +--- a/third_party/WebKit/Source/core/editing/commands/EditorCommandNames.h ++++ b/third_party/WebKit/Source/core/editing/commands/EditorCommandNames.h +@@ -9,146 +9,148 @@ namespace blink { + + // Must be ordered in a case-folding manner for binary search. Covered by unit + // tests in EditingCommandTest.cpp (not able to use static_assert) ++ /* DO NOT SUBMIT - conflict resolution helper: ++ * Important to have AlignCenter instead of kAlignCenter below. */ + #define FOR_EACH_BLINK_EDITING_COMMAND_NAME(V) \ +- V(kAlignCenter) \ +- V(kAlignJustified) \ +- V(kAlignLeft) \ +- V(kAlignRight) \ +- V(kBackColor) \ +- V(kBackwardDelete) \ +- V(kBold) \ +- V(kCopy) \ +- V(kCreateLink) \ +- V(kCut) \ +- V(kDefaultParagraphSeparator) \ +- V(kDelete) \ +- V(kDeleteBackward) \ +- V(kDeleteBackwardByDecomposingPreviousCharacter) \ +- V(kDeleteForward) \ +- V(kDeleteToBeginningOfLine) \ +- V(kDeleteToBeginningOfParagraph) \ +- V(kDeleteToEndOfLine) \ +- V(kDeleteToEndOfParagraph) \ +- V(kDeleteToMark) \ +- V(kDeleteWordBackward) \ +- V(kDeleteWordForward) \ +- V(kFindString) \ +- V(kFontName) \ +- V(kFontSize) \ +- V(kFontSizeDelta) \ +- V(kForeColor) \ +- V(kFormatBlock) \ +- V(kForwardDelete) \ +- V(kHiliteColor) \ +- V(kIgnoreSpelling) \ +- V(kIndent) \ +- V(kInsertBacktab) \ +- V(kInsertHorizontalRule) \ +- V(kInsertHTML) \ +- V(kInsertImage) \ +- V(kInsertLineBreak) \ +- V(kInsertNewline) \ +- V(kInsertNewlineInQuotedContent) \ +- V(kInsertOrderedList) \ +- V(kInsertParagraph) \ +- V(kInsertTab) \ +- V(kInsertText) \ +- V(kInsertUnorderedList) \ +- V(kItalic) \ +- V(kJustifyCenter) \ +- V(kJustifyFull) \ +- V(kJustifyLeft) \ +- V(kJustifyNone) \ +- V(kJustifyRight) \ +- V(kMakeTextWritingDirectionLeftToRight) \ +- V(kMakeTextWritingDirectionNatural) \ +- V(kMakeTextWritingDirectionRightToLeft) \ +- V(kMoveBackward) \ +- V(kMoveBackwardAndModifySelection) \ +- V(kMoveDown) \ +- V(kMoveDownAndModifySelection) \ +- V(kMoveForward) \ +- V(kMoveForwardAndModifySelection) \ +- V(kMoveLeft) \ +- V(kMoveLeftAndModifySelection) \ +- V(kMovePageDown) \ +- V(kMovePageDownAndModifySelection) \ +- V(kMovePageUp) \ +- V(kMovePageUpAndModifySelection) \ +- V(kMoveParagraphBackward) \ +- V(kMoveParagraphBackwardAndModifySelection) \ +- V(kMoveParagraphForward) \ +- V(kMoveParagraphForwardAndModifySelection) \ +- V(kMoveRight) \ +- V(kMoveRightAndModifySelection) \ +- V(kMoveToBeginningOfDocument) \ +- V(kMoveToBeginningOfDocumentAndModifySelection) \ +- V(kMoveToBeginningOfLine) \ +- V(kMoveToBeginningOfLineAndModifySelection) \ +- V(kMoveToBeginningOfParagraph) \ +- V(kMoveToBeginningOfParagraphAndModifySelection) \ +- V(kMoveToBeginningOfSentence) \ +- V(kMoveToBeginningOfSentenceAndModifySelection) \ +- V(kMoveToEndOfDocument) \ +- V(kMoveToEndOfDocumentAndModifySelection) \ +- V(kMoveToEndOfLine) \ +- V(kMoveToEndOfLineAndModifySelection) \ +- V(kMoveToEndOfParagraph) \ +- V(kMoveToEndOfParagraphAndModifySelection) \ +- V(kMoveToEndOfSentence) \ +- V(kMoveToEndOfSentenceAndModifySelection) \ +- V(kMoveToLeftEndOfLine) \ +- V(kMoveToLeftEndOfLineAndModifySelection) \ +- V(kMoveToRightEndOfLine) \ +- V(kMoveToRightEndOfLineAndModifySelection) \ +- V(kMoveUp) \ +- V(kMoveUpAndModifySelection) \ +- V(kMoveWordBackward) \ +- V(kMoveWordBackwardAndModifySelection) \ +- V(kMoveWordForward) \ +- V(kMoveWordForwardAndModifySelection) \ +- V(kMoveWordLeft) \ +- V(kMoveWordLeftAndModifySelection) \ +- V(kMoveWordRight) \ +- V(kMoveWordRightAndModifySelection) \ +- V(kOutdent) \ +- V(kOverWrite) \ +- V(kPaste) \ +- V(kPasteAndMatchStyle) \ +- V(kPasteGlobalSelection) \ +- V(kPrint) \ +- V(kRedo) \ +- V(kRemoveFormat) \ +- V(kScrollLineDown) \ +- V(kScrollLineUp) \ +- V(kScrollPageBackward) \ +- V(kScrollPageForward) \ +- V(kScrollToBeginningOfDocument) \ +- V(kScrollToEndOfDocument) \ +- V(kSelectAll) \ +- V(kSelectLine) \ +- V(kSelectParagraph) \ +- V(kSelectSentence) \ +- V(kSelectToMark) \ +- V(kSelectWord) \ +- V(kSetMark) \ +- V(kStrikethrough) \ +- V(kStyleWithCSS) \ +- V(kSubscript) \ +- V(kSuperscript) \ +- V(kSwapWithMark) \ +- V(kToggleBold) \ +- V(kToggleItalic) \ +- V(kToggleUnderline) \ +- V(kTranspose) \ +- V(kUnderline) \ +- V(kUndo) \ +- V(kUnlink) \ +- V(kUnscript) \ +- V(kUnselect) \ +- V(kUseCSS) \ +- V(kYank) \ +- V(kYankAndSelect) ++ V(AlignCenter) \ ++ V(AlignJustified) \ ++ V(AlignLeft) \ ++ V(AlignRight) \ ++ V(BackColor) \ ++ V(BackwardDelete) \ ++ V(Bold) \ ++ V(Copy) \ ++ V(CreateLink) \ ++ V(Cut) \ ++ V(DefaultParagraphSeparator) \ ++ V(Delete) \ ++ V(DeleteBackward) \ ++ V(DeleteBackwardByDecomposingPreviousCharacter) \ ++ V(DeleteForward) \ ++ V(DeleteToBeginningOfLine) \ ++ V(DeleteToBeginningOfParagraph) \ ++ V(DeleteToEndOfLine) \ ++ V(DeleteToEndOfParagraph) \ ++ V(DeleteToMark) \ ++ V(DeleteWordBackward) \ ++ V(DeleteWordForward) \ ++ V(FindString) \ ++ V(FontName) \ ++ V(FontSize) \ ++ V(FontSizeDelta) \ ++ V(ForeColor) \ ++ V(FormatBlock) \ ++ V(ForwardDelete) \ ++ V(HiliteColor) \ ++ V(IgnoreSpelling) \ ++ V(Indent) \ ++ V(InsertBacktab) \ ++ V(InsertHorizontalRule) \ ++ V(InsertHTML) \ ++ V(InsertImage) \ ++ V(InsertLineBreak) \ ++ V(InsertNewline) \ ++ V(InsertNewlineInQuotedContent) \ ++ V(InsertOrderedList) \ ++ V(InsertParagraph) \ ++ V(InsertTab) \ ++ V(InsertText) \ ++ V(InsertUnorderedList) \ ++ V(Italic) \ ++ V(JustifyCenter) \ ++ V(JustifyFull) \ ++ V(JustifyLeft) \ ++ V(JustifyNone) \ ++ V(JustifyRight) \ ++ V(MakeTextWritingDirectionLeftToRight) \ ++ V(MakeTextWritingDirectionNatural) \ ++ V(MakeTextWritingDirectionRightToLeft) \ ++ V(MoveBackward) \ ++ V(MoveBackwardAndModifySelection) \ ++ V(MoveDown) \ ++ V(MoveDownAndModifySelection) \ ++ V(MoveForward) \ ++ V(MoveForwardAndModifySelection) \ ++ V(MoveLeft) \ ++ V(MoveLeftAndModifySelection) \ ++ V(MovePageDown) \ ++ V(MovePageDownAndModifySelection) \ ++ V(MovePageUp) \ ++ V(MovePageUpAndModifySelection) \ ++ V(MoveParagraphBackward) \ ++ V(MoveParagraphBackwardAndModifySelection) \ ++ V(MoveParagraphForward) \ ++ V(MoveParagraphForwardAndModifySelection) \ ++ V(MoveRight) \ ++ V(MoveRightAndModifySelection) \ ++ V(MoveToBeginningOfDocument) \ ++ V(MoveToBeginningOfDocumentAndModifySelection) \ ++ V(MoveToBeginningOfLine) \ ++ V(MoveToBeginningOfLineAndModifySelection) \ ++ V(MoveToBeginningOfParagraph) \ ++ V(MoveToBeginningOfParagraphAndModifySelection) \ ++ V(MoveToBeginningOfSentence) \ ++ V(MoveToBeginningOfSentenceAndModifySelection) \ ++ V(MoveToEndOfDocument) \ ++ V(MoveToEndOfDocumentAndModifySelection) \ ++ V(MoveToEndOfLine) \ ++ V(MoveToEndOfLineAndModifySelection) \ ++ V(MoveToEndOfParagraph) \ ++ V(MoveToEndOfParagraphAndModifySelection) \ ++ V(MoveToEndOfSentence) \ ++ V(MoveToEndOfSentenceAndModifySelection) \ ++ V(MoveToLeftEndOfLine) \ ++ V(MoveToLeftEndOfLineAndModifySelection) \ ++ V(MoveToRightEndOfLine) \ ++ V(MoveToRightEndOfLineAndModifySelection) \ ++ V(MoveUp) \ ++ V(MoveUpAndModifySelection) \ ++ V(MoveWordBackward) \ ++ V(MoveWordBackwardAndModifySelection) \ ++ V(MoveWordForward) \ ++ V(MoveWordForwardAndModifySelection) \ ++ V(MoveWordLeft) \ ++ V(MoveWordLeftAndModifySelection) \ ++ V(MoveWordRight) \ ++ V(MoveWordRightAndModifySelection) \ ++ V(Outdent) \ ++ V(OverWrite) \ ++ V(Paste) \ ++ V(PasteAndMatchStyle) \ ++ V(PasteGlobalSelection) \ ++ V(Print) \ ++ V(Redo) \ ++ V(RemoveFormat) \ ++ V(ScrollLineDown) \ ++ V(ScrollLineUp) \ ++ V(ScrollPageBackward) \ ++ V(ScrollPageForward) \ ++ V(ScrollToBeginningOfDocument) \ ++ V(ScrollToEndOfDocument) \ ++ V(SelectAll) \ ++ V(SelectLine) \ ++ V(SelectParagraph) \ ++ V(SelectSentence) \ ++ V(SelectToMark) \ ++ V(SelectWord) \ ++ V(SetMark) \ ++ V(Strikethrough) \ ++ V(StyleWithCSS) \ ++ V(Subscript) \ ++ V(Superscript) \ ++ V(SwapWithMark) \ ++ V(ToggleBold) \ ++ V(ToggleItalic) \ ++ V(ToggleUnderline) \ ++ V(Transpose) \ ++ V(Underline) \ ++ V(Undo) \ ++ V(Unlink) \ ++ V(Unscript) \ ++ V(Unselect) \ ++ V(UseCSS) \ ++ V(Yank) \ ++ V(YankAndSelect) + + } // namespace blink + +diff --git a/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp b/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp +index 8ca9beb43bd9..408e70201827 100644 +--- a/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp ++++ b/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.cpp +@@ -202,7 +202,7 @@ String SerializeNodes(MarkupAccumulator& accumulator, + return accumulator.ToString(); + } + +-template String serializeNodes<EditingStrategy>(MarkupAccumulator&, ++template String SerializeNodes<EditingStrategy>(MarkupAccumulator&, + Node&, + EChildrenOnly); + +diff --git a/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.h b/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.h +index 9064252faa9d..4ce1662b8684 100644 +--- a/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.h ++++ b/third_party/WebKit/Source/core/editing/serializers/MarkupAccumulator.h +@@ -83,7 +83,7 @@ class MarkupAccumulator { + template <typename Strategy> + String SerializeNodes(MarkupAccumulator&, Node&, EChildrenOnly); + +-extern template String serializeNodes<EditingStrategy>(MarkupAccumulator&, ++extern template String SerializeNodes<EditingStrategy>(MarkupAccumulator&, + Node&, + EChildrenOnly); + +diff --git a/third_party/WebKit/Source/core/events/EventTarget.h b/third_party/WebKit/Source/core/events/EventTarget.h +index 3251d895e7be..45f2e4ba4bf7 100644 +--- a/third_party/WebKit/Source/core/events/EventTarget.h ++++ b/third_party/WebKit/Source/core/events/EventTarget.h +@@ -243,10 +243,10 @@ class GC_PLUGIN_IGNORE("513199") CORE_EXPORT EventTargetWithInlineData + // FIXME: These macros should be split into separate DEFINE and DECLARE + // macros to avoid causing so many header includes. + #define DEFINE_ATTRIBUTE_EVENT_LISTENER(attribute) \ +- EventListener* On##attribute() { \ ++ EventListener* on##attribute() { \ + return this->GetAttributeEventListener(EventTypeNames::attribute); \ + } \ +- void SetOn##attribute(EventListener* listener) { \ ++ void setOn##attribute(EventListener* listener) { \ + this->SetAttributeEventListener(EventTypeNames::attribute, listener); \ + } + +diff --git a/third_party/WebKit/Source/core/frame/Settings.json5 b/third_party/WebKit/Source/core/frame/Settings.json5 +index fb80e35663d9..d9b7c509b3fd 100644 +--- a/third_party/WebKit/Source/core/frame/Settings.json5 ++++ b/third_party/WebKit/Source/core/frame/Settings.json5 +@@ -106,7 +106,7 @@ + + { + name: "editingBehaviorType", +- initial: "editingBehaviorTypeForPlatform()", ++ initial: "EditingBehaviorTypeForPlatform()", + type: "EditingBehaviorType", + }, + +@@ -356,7 +356,7 @@ + }, + { + name: "selectTrailingWhitespaceEnabled", +- initial: "defaultSelectTrailingWhitespaceEnabled", ++ initial: "kDefaultSelectTrailingWhitespaceEnabled", + }, + + { +@@ -366,7 +366,7 @@ + + { + name: "selectionStrategy", +- initial: "SelectionStrategy::Character", ++ initial: "SelectionStrategy::kCharacter", + type: "SelectionStrategy", + }, + +@@ -504,7 +504,7 @@ + }, + { + name: "displayModeOverride", +- initial: "WebDisplayModeUndefined", ++ initial: "kWebDisplayModeUndefined", + invalidate: "MediaQuery", + type: "WebDisplayMode", + }, +@@ -523,7 +523,7 @@ + }, + { + name: "imageAnimationPolicy", +- initial: "ImageAnimationPolicyAllowed", ++ initial: "kImageAnimationPolicyAllowed", + type: "ImageAnimationPolicy", + }, + +@@ -631,14 +631,14 @@ + // V8 supports different types of caching. Used by V8 bindings. + { + name: "v8CacheOptions", +- initial: "V8CacheOptionsDefault", ++ initial: "kV8CacheOptionsDefault", + type: "V8CacheOptions", + }, + + // V8 code cache for CacheStorage supports three types of strategies (none, normal and aggressive). + { + name: "v8CacheStrategiesForCacheStorage", +- initial: "V8CacheStrategiesForCacheStorage::Default", ++ initial: "V8CacheStrategiesForCacheStorage::kDefault", + type: "V8CacheStrategiesForCacheStorage", + }, + +@@ -647,13 +647,13 @@ + // has pointerType coarse *and* fine). + { + name: "availablePointerTypes", +- initial: "PointerTypeNone", ++ initial: "kPointerTypeNone", + invalidate: "MediaQuery", + type: "int", + }, + { + name: "availableHoverTypes", +- initial: "HoverTypeNone", ++ initial: "kHoverTypeNone", + invalidate: "MediaQuery", + type: "int", + }, +@@ -661,13 +661,13 @@ + // These values specify properties of the user's primary pointing device only. + { + name: "primaryPointerType", +- initial: "PointerTypeNone", ++ initial: "kPointerTypeNone", + invalidate: "MediaQuery", + type: "PointerType", + }, + { + name: "primaryHoverType", +- initial: "HoverTypeNone", ++ initial: "kHoverTypeNone", + invalidate: "MediaQuery", + type: "HoverType", + }, +@@ -744,7 +744,7 @@ + // used by content embedders to specify custom style on certain platforms. + { + name: "viewportStyle", +- initial: "WebViewportStyle::Default", ++ initial: "WebViewportStyle::kDefault", + invalidate: "ViewportRule", + type: "WebViewportStyle", + }, +@@ -753,7 +753,7 @@ + // by this setting. + { + name: "textTrackKindUserPreference", +- initial: "TextTrackKindUserPreference::Default", ++ initial: "TextTrackKindUserPreference::kDefault", + invalidate: "TextTrackKindUserPreference", + type: "TextTrackKindUserPreference", + }, +@@ -803,7 +803,7 @@ + + { + name: "progressBarCompletion", +- initial: "ProgressBarCompletion::LoadEvent", ++ initial: "ProgressBarCompletion::kLoadEvent", + type: "ProgressBarCompletion", + }, + +@@ -854,7 +854,7 @@ + // to enable it have been shipped. + { + name: "passiveListenerDefault", +- initial: "PassiveListenerDefault::False", ++ initial: "PassiveListenerDefault::kFalse", + type: "PassiveListenerDefault", + }, + +diff --git a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +index e01d1744b991..7be8232ddbc8 100644 +--- a/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp ++++ b/third_party/WebKit/Source/core/frame/SubresourceIntegrity.cpp +@@ -338,9 +338,9 @@ SubresourceIntegrity::ParseIntegrityAttribute( + WTF::String digest; + HashAlgorithm algorithm; + +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + current_integrity_end = position; +- skipUntil<UChar, isASCIISpace>(current_integrity_end, end); ++ skipUntil<UChar, IsASCIISpace>(current_integrity_end, end); + + // Algorithm parsing errors are non-fatal (the subresource should + // still be loaded) because strong hash algorithms should be used +@@ -351,7 +351,7 @@ SubresourceIntegrity::ParseIntegrityAttribute( + if (parse_result == kAlgorithmUnknown) { + // Unknown hash algorithms are treated as if they're not present, + // and thus are not marked as an error, they're just skipped. +- skipUntil<UChar, isASCIISpace>(position, end); ++ skipUntil<UChar, IsASCIISpace>(position, end); + if (execution_context) { + LogErrorToConsole("Error parsing 'integrity' attribute ('" + attribute + + "'). The specified hash algorithm must be one of " +@@ -366,7 +366,7 @@ SubresourceIntegrity::ParseIntegrityAttribute( + + if (parse_result == kAlgorithmUnparsable) { + error = true; +- skipUntil<UChar, isASCIISpace>(position, end); ++ skipUntil<UChar, IsASCIISpace>(position, end); + if (execution_context) { + LogErrorToConsole("Error parsing 'integrity' attribute ('" + attribute + + "'). The hash algorithm must be one of 'sha256', " +@@ -384,7 +384,7 @@ SubresourceIntegrity::ParseIntegrityAttribute( + + if (!ParseDigest(position, current_integrity_end, digest)) { + error = true; +- skipUntil<UChar, isASCIISpace>(position, end); ++ skipUntil<UChar, IsASCIISpace>(position, end); + if (execution_context) { + LogErrorToConsole( + "Error parsing 'integrity' attribute ('" + attribute + +diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +index 86b460e05b40..b1ea8ce0757a 100644 +--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp ++++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.cpp +@@ -42,7 +42,7 @@ String GetSha256String(const String& content) { + + template <typename CharType> + inline bool IsASCIIAlphanumericOrHyphen(CharType c) { +- return isASCIIAlphanumeric(c) || c == '-'; ++ return IsASCIIAlphanumeric(c) || c == '-'; + } + + ContentSecurityPolicyHashAlgorithm ConvertHashAlgorithmToCSPHashAlgorithm( +@@ -981,7 +981,7 @@ bool CSPDirectiveList::ParseDirective(const UChar* begin, + ASSERT(value.IsEmpty()); + + const UChar* position = begin; +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + + // Empty directive (e.g. ";;;"). Exit early. + if (position == end) +@@ -1003,14 +1003,14 @@ bool CSPDirectiveList::ParseDirective(const UChar* begin, + if (position == end) + return true; + +- if (!skipExactly<UChar, isASCIISpace>(position, end)) { ++ if (!skipExactly<UChar, IsASCIISpace>(position, end)) { + skipWhile<UChar, IsNotASCIISpace>(position, end); + policy_->ReportUnsupportedDirective( + String(name_begin, position - name_begin)); + return false; + } + +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + + const UChar* value_begin = position; + skipWhile<UChar, IsCSPDirectiveValueCharacter>(position, end); +@@ -1044,7 +1044,7 @@ void CSPDirectiveList::ParseRequireSRIFor(const String& name, + const UChar* end = position + characters.size(); + + while (position < end) { +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + + const UChar* token_begin = position; + skipWhile<UChar, IsNotASCIISpace>(position, end); +@@ -1103,7 +1103,7 @@ void CSPDirectiveList::ParseReportURI(const String& name, const String& value) { + const UChar* end = position + characters.size(); + + while (position < end) { +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + + const UChar* url_begin = position; + skipWhile<UChar, IsNotASCIISpace>(position, end); +diff --git a/third_party/WebKit/Source/core/frame/csp/MediaListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/MediaListDirective.cpp +index dec89e08e0b3..92d163a45cb9 100644 +--- a/third_party/WebKit/Source/core/frame/csp/MediaListDirective.cpp ++++ b/third_party/WebKit/Source/core/frame/csp/MediaListDirective.cpp +@@ -39,7 +39,7 @@ void MediaListDirective::Parse(const UChar* begin, const UChar* end) { + while (position < end) { + // _____ OR _____mime1/mime1 + // ^ ^ +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + if (position == end) + return; + +diff --git a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp +index 8eb452f1296a..b6a6d07cc55c 100644 +--- a/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp ++++ b/third_party/WebKit/Source/core/frame/csp/SourceListDirective.cpp +@@ -37,14 +37,14 @@ SourceListDirective::SourceListDirective(const String& name, + } + + static bool IsSourceListNone(const UChar* begin, const UChar* end) { +- skipWhile<UChar, isASCIISpace>(begin, end); ++ skipWhile<UChar, IsASCIISpace>(begin, end); + + const UChar* position = begin; + skipWhile<UChar, IsSourceCharacter>(position, end); + if (!EqualIgnoringCase("'none'", StringView(begin, position - begin))) + return false; + +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + if (position != end) + return false; + +@@ -128,7 +128,7 @@ void SourceListDirective::Parse(const UChar* begin, const UChar* end) { + + const UChar* position = begin; + while (position < end) { +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + if (position == end) + return; + +@@ -422,7 +422,7 @@ bool SourceListDirective::ParseScheme(const UChar* begin, + + const UChar* position = begin; + +- if (!skipExactly<UChar, isASCIIAlpha>(position, end)) ++ if (!skipExactly<UChar, IsASCIIAlpha>(position, end)) + return false; + + skipWhile<UChar, IsSchemeContinuationCharacter>(position, end); +@@ -531,7 +531,7 @@ bool SourceListDirective::ParsePort( + } + + const UChar* position = begin; +- skipWhile<UChar, isASCIIDigit>(position, end); ++ skipWhile<UChar, IsASCIIDigit>(position, end); + + if (position != end) + return false; +diff --git a/third_party/WebKit/Source/core/html/HTMLCollection.h b/third_party/WebKit/Source/core/html/HTMLCollection.h +index 513aa1064d34..2b4489b1fa2f 100644 +--- a/third_party/WebKit/Source/core/html/HTMLCollection.h ++++ b/third_party/WebKit/Source/core/html/HTMLCollection.h +@@ -42,7 +42,7 @@ class HTMLCollectionIterator { + public: + explicit HTMLCollectionIterator(const CollectionType* collection) + : collection_(collection) {} +- NodeType* operator*() { return collection_->Item(index_); } ++ NodeType* operator*() { return collection_->item(index_); } + + void operator++() { + if (index_ < collection_->length()) +diff --git a/third_party/WebKit/Source/core/html/HTMLDimension.cpp b/third_party/WebKit/Source/core/html/HTMLDimension.cpp +index a41ec91d0832..5f87f3fd9fe7 100644 +--- a/third_party/WebKit/Source/core/html/HTMLDimension.cpp ++++ b/third_party/WebKit/Source/core/html/HTMLDimension.cpp +@@ -155,14 +155,14 @@ static bool ParseDimensionValue(const CharacterType* current, + skipWhile<CharacterType, IsHTMLSpace>(current, end); + // Deviation: HTML allows '+' here. + const CharacterType* number_start = current; +- if (!skipExactly<CharacterType, isASCIIDigit>(current, end)) ++ if (!skipExactly<CharacterType, IsASCIIDigit>(current, end)) + return false; +- skipWhile<CharacterType, isASCIIDigit>(current, end); ++ skipWhile<CharacterType, IsASCIIDigit>(current, end); + if (skipExactly<CharacterType>(current, end, '.')) { + // Deviation: HTML requires a digit after the full stop to be able to treat + // the value as a percentage (if not, the '.' will considered "garbage", + // yielding a regular length.) Gecko and Edge does not. +- skipWhile<CharacterType, isASCIIDigit>(current, end); ++ skipWhile<CharacterType, IsASCIIDigit>(current, end); + } + bool ok; + double value = CharactersToDouble(number_start, current - number_start, &ok); +diff --git a/third_party/WebKit/Source/core/html/parser/create-html-entity-table b/third_party/WebKit/Source/core/html/parser/create-html-entity-table +index f0a7918a2b9f..33bb73c77f1e 100755 +--- a/third_party/WebKit/Source/core/html/parser/create-html-entity-table ++++ b/third_party/WebKit/Source/core/html/parser/create-html-entity-table +@@ -199,17 +199,17 @@ for letter in string.ascii_lowercase: + output_file.write("%d\n" % entity_count) + output_file.write("""}; + +-const LChar* HTMLEntityTable::entityString(const HTMLEntityTableEntry& entry) ++const LChar* HTMLEntityTable::EntityString(const HTMLEntityTableEntry& entry) + { +- return staticEntityStringStorage + entry.entityOffset; ++ return staticEntityStringStorage + entry.entity_offset; + } + +-LChar HTMLEntityTableEntry::lastCharacter() const ++LChar HTMLEntityTableEntry::LastCharacter() const + { +- return HTMLEntityTable::entityString(*this)[length - 1]; ++ return HTMLEntityTable::EntityString(*this)[length - 1]; + } + +-const HTMLEntityTableEntry* HTMLEntityTable::firstEntryStartingWith(UChar c) ++const HTMLEntityTableEntry* HTMLEntityTable::FirstEntryStartingWith(UChar c) + { + if (c >= 'A' && c <= 'Z') + return &staticEntityTable[uppercaseOffset[c - 'A']]; +@@ -218,7 +218,7 @@ const HTMLEntityTableEntry* HTMLEntityTable::firstEntryStartingWith(UChar c) + return 0; + } + +-const HTMLEntityTableEntry* HTMLEntityTable::lastEntryStartingWith(UChar c) ++const HTMLEntityTableEntry* HTMLEntityTable::LastEntryStartingWith(UChar c) + { + if (c >= 'A' && c <= 'Z') + return &staticEntityTable[uppercaseOffset[c - 'A' + 1]] - 1; +@@ -227,12 +227,12 @@ const HTMLEntityTableEntry* HTMLEntityTable::lastEntryStartingWith(UChar c) + return 0; + } + +-const HTMLEntityTableEntry* HTMLEntityTable::firstEntry() ++const HTMLEntityTableEntry* HTMLEntityTable::FirstEntry() + { + return &staticEntityTable[0]; + } + +-const HTMLEntityTableEntry* HTMLEntityTable::lastEntry() ++const HTMLEntityTableEntry* HTMLEntityTable::LastEntry() + { + return &staticEntityTable[%s - 1]; + } +diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp +index 5a9bf4eb2980..cb32813f65db 100644 +--- a/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp ++++ b/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp +@@ -110,7 +110,7 @@ String VTTScanner::RestOfInputAsString() { + } + + unsigned VTTScanner::ScanDigits(int& number) { +- Run run_of_digits = CollectWhile<isASCIIDigit>(); ++ Run run_of_digits = CollectWhile<IsASCIIDigit>(); + if (run_of_digits.IsEmpty()) { + number = 0; + return 0; +@@ -134,11 +134,11 @@ unsigned VTTScanner::ScanDigits(int& number) { + } + + bool VTTScanner::ScanFloat(float& number) { +- Run integer_run = CollectWhile<isASCIIDigit>(); ++ Run integer_run = CollectWhile<IsASCIIDigit>(); + SeekTo(integer_run.end()); + Run decimal_run(GetPosition(), GetPosition(), is8_bit_); + if (Scan('.')) { +- decimal_run = CollectWhile<isASCIIDigit>(); ++ decimal_run = CollectWhile<IsASCIIDigit>(); + SeekTo(decimal_run.end()); + } + +diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp +index 340d50764ea0..b4bb86bc4725 100644 +--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp ++++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp +@@ -997,7 +997,7 @@ static CSSKeyframesRule* FindKeyframesRule(CSSRuleCollection* css_rules, + StyleRuleKeyframes* keyframes_rule) { + CSSKeyframesRule* result = 0; + for (unsigned j = 0; css_rules && j < css_rules->length() && !result; ++j) { +- CSSRule* css_rule = css_rules->Item(j); ++ CSSRule* css_rule = css_rules->item(j); + if (css_rule->type() == CSSRule::kKeyframesRule) { + CSSKeyframesRule* css_style_rule = ToCSSKeyframesRule(css_rule); + if (css_style_rule->Keyframes() == keyframes_rule) +diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp +index 5a443d8849e0..ade7b996934e 100644 +--- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp ++++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp +@@ -514,7 +514,7 @@ void CollectFlatRules(RuleList rule_list, CSSRuleVector* result) { + return; + + for (unsigned i = 0, size = rule_list->length(); i < size; ++i) { +- CSSRule* rule = rule_list->Item(i); ++ CSSRule* rule = rule_list->item(i); + + // The result->append()'ed types should be exactly the same as in + // flattenSourceData(). +diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp +index a900cd9c3fa4..f1b3366f4800 100644 +--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp ++++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp +@@ -219,96 +219,96 @@ void SetNodeInfo(TracedValue* value, + const char* PseudoTypeToString(CSSSelector::PseudoType pseudo_type) { + switch (pseudo_type) { + #define DEFINE_STRING_MAPPING(pseudoType) \ +- case CSSSelector::pseudoType: \ ++ case CSSSelector::k##pseudoType: \ + return #pseudoType; +- DEFINE_STRING_MAPPING(kPseudoUnknown) +- DEFINE_STRING_MAPPING(kPseudoEmpty) +- DEFINE_STRING_MAPPING(kPseudoFirstChild) +- DEFINE_STRING_MAPPING(kPseudoFirstOfType) +- DEFINE_STRING_MAPPING(kPseudoLastChild) +- DEFINE_STRING_MAPPING(kPseudoLastOfType) +- DEFINE_STRING_MAPPING(kPseudoOnlyChild) +- DEFINE_STRING_MAPPING(kPseudoOnlyOfType) +- DEFINE_STRING_MAPPING(kPseudoFirstLine) +- DEFINE_STRING_MAPPING(kPseudoFirstLetter) +- DEFINE_STRING_MAPPING(kPseudoNthChild) +- DEFINE_STRING_MAPPING(kPseudoNthOfType) +- DEFINE_STRING_MAPPING(kPseudoNthLastChild) +- DEFINE_STRING_MAPPING(kPseudoNthLastOfType) +- DEFINE_STRING_MAPPING(kPseudoLink) +- DEFINE_STRING_MAPPING(kPseudoVisited) +- DEFINE_STRING_MAPPING(kPseudoAny) +- DEFINE_STRING_MAPPING(kPseudoAnyLink) +- DEFINE_STRING_MAPPING(kPseudoAutofill) +- DEFINE_STRING_MAPPING(kPseudoHover) +- DEFINE_STRING_MAPPING(kPseudoDrag) +- DEFINE_STRING_MAPPING(kPseudoFocus) +- DEFINE_STRING_MAPPING(kPseudoActive) +- DEFINE_STRING_MAPPING(kPseudoChecked) +- DEFINE_STRING_MAPPING(kPseudoEnabled) +- DEFINE_STRING_MAPPING(kPseudoFullPageMedia) +- DEFINE_STRING_MAPPING(kPseudoDefault) +- DEFINE_STRING_MAPPING(kPseudoDisabled) +- DEFINE_STRING_MAPPING(kPseudoOptional) +- DEFINE_STRING_MAPPING(kPseudoPlaceholderShown) +- DEFINE_STRING_MAPPING(kPseudoRequired) +- DEFINE_STRING_MAPPING(kPseudoReadOnly) +- DEFINE_STRING_MAPPING(kPseudoReadWrite) +- DEFINE_STRING_MAPPING(kPseudoValid) +- DEFINE_STRING_MAPPING(kPseudoInvalid) +- DEFINE_STRING_MAPPING(kPseudoIndeterminate) +- DEFINE_STRING_MAPPING(kPseudoTarget) +- DEFINE_STRING_MAPPING(kPseudoBefore) +- DEFINE_STRING_MAPPING(kPseudoAfter) +- DEFINE_STRING_MAPPING(kPseudoBackdrop) +- DEFINE_STRING_MAPPING(kPseudoLang) +- DEFINE_STRING_MAPPING(kPseudoNot) +- DEFINE_STRING_MAPPING(kPseudoPlaceholder) +- DEFINE_STRING_MAPPING(kPseudoResizer) +- DEFINE_STRING_MAPPING(kPseudoRoot) +- DEFINE_STRING_MAPPING(kPseudoScope) +- DEFINE_STRING_MAPPING(kPseudoScrollbar) +- DEFINE_STRING_MAPPING(kPseudoScrollbarButton) +- DEFINE_STRING_MAPPING(kPseudoScrollbarCorner) +- DEFINE_STRING_MAPPING(kPseudoScrollbarThumb) +- DEFINE_STRING_MAPPING(kPseudoScrollbarTrack) +- DEFINE_STRING_MAPPING(kPseudoScrollbarTrackPiece) +- DEFINE_STRING_MAPPING(kPseudoWindowInactive) +- DEFINE_STRING_MAPPING(kPseudoCornerPresent) +- DEFINE_STRING_MAPPING(kPseudoDecrement) +- DEFINE_STRING_MAPPING(kPseudoIncrement) +- DEFINE_STRING_MAPPING(kPseudoHorizontal) +- DEFINE_STRING_MAPPING(kPseudoVertical) +- DEFINE_STRING_MAPPING(kPseudoStart) +- DEFINE_STRING_MAPPING(kPseudoEnd) +- DEFINE_STRING_MAPPING(kPseudoDoubleButton) +- DEFINE_STRING_MAPPING(kPseudoSingleButton) +- DEFINE_STRING_MAPPING(kPseudoNoButton) +- DEFINE_STRING_MAPPING(kPseudoSelection) +- DEFINE_STRING_MAPPING(kPseudoLeftPage) +- DEFINE_STRING_MAPPING(kPseudoRightPage) +- DEFINE_STRING_MAPPING(kPseudoFirstPage) +- DEFINE_STRING_MAPPING(kPseudoFullScreen) +- DEFINE_STRING_MAPPING(kPseudoFullScreenAncestor) +- DEFINE_STRING_MAPPING(kPseudoInRange) +- DEFINE_STRING_MAPPING(kPseudoOutOfRange) +- DEFINE_STRING_MAPPING(kPseudoWebKitCustomElement) +- DEFINE_STRING_MAPPING(kPseudoBlinkInternalElement) +- DEFINE_STRING_MAPPING(kPseudoCue) +- DEFINE_STRING_MAPPING(kPseudoFutureCue) +- DEFINE_STRING_MAPPING(kPseudoPastCue) +- DEFINE_STRING_MAPPING(kPseudoUnresolved) +- DEFINE_STRING_MAPPING(kPseudoDefined) +- DEFINE_STRING_MAPPING(kPseudoContent) +- DEFINE_STRING_MAPPING(kPseudoHost) +- DEFINE_STRING_MAPPING(kPseudoHostContext) +- DEFINE_STRING_MAPPING(kPseudoShadow) +- DEFINE_STRING_MAPPING(kPseudoSlotted) +- DEFINE_STRING_MAPPING(kPseudoSpatialNavigationFocus) +- DEFINE_STRING_MAPPING(kPseudoListBox) +- DEFINE_STRING_MAPPING(kPseudoHostHasAppearance) +- DEFINE_STRING_MAPPING(kPseudoVideoPersistent) +- DEFINE_STRING_MAPPING(kPseudoVideoPersistentAncestor) ++ DEFINE_STRING_MAPPING(PseudoUnknown) ++ DEFINE_STRING_MAPPING(PseudoEmpty) ++ DEFINE_STRING_MAPPING(PseudoFirstChild) ++ DEFINE_STRING_MAPPING(PseudoFirstOfType) ++ DEFINE_STRING_MAPPING(PseudoLastChild) ++ DEFINE_STRING_MAPPING(PseudoLastOfType) ++ DEFINE_STRING_MAPPING(PseudoOnlyChild) ++ DEFINE_STRING_MAPPING(PseudoOnlyOfType) ++ DEFINE_STRING_MAPPING(PseudoFirstLine) ++ DEFINE_STRING_MAPPING(PseudoFirstLetter) ++ DEFINE_STRING_MAPPING(PseudoNthChild) ++ DEFINE_STRING_MAPPING(PseudoNthOfType) ++ DEFINE_STRING_MAPPING(PseudoNthLastChild) ++ DEFINE_STRING_MAPPING(PseudoNthLastOfType) ++ DEFINE_STRING_MAPPING(PseudoLink) ++ DEFINE_STRING_MAPPING(PseudoVisited) ++ DEFINE_STRING_MAPPING(PseudoAny) ++ DEFINE_STRING_MAPPING(PseudoAnyLink) ++ DEFINE_STRING_MAPPING(PseudoAutofill) ++ DEFINE_STRING_MAPPING(PseudoHover) ++ DEFINE_STRING_MAPPING(PseudoDrag) ++ DEFINE_STRING_MAPPING(PseudoFocus) ++ DEFINE_STRING_MAPPING(PseudoActive) ++ DEFINE_STRING_MAPPING(PseudoChecked) ++ DEFINE_STRING_MAPPING(PseudoEnabled) ++ DEFINE_STRING_MAPPING(PseudoFullPageMedia) ++ DEFINE_STRING_MAPPING(PseudoDefault) ++ DEFINE_STRING_MAPPING(PseudoDisabled) ++ DEFINE_STRING_MAPPING(PseudoOptional) ++ DEFINE_STRING_MAPPING(PseudoPlaceholderShown) ++ DEFINE_STRING_MAPPING(PseudoRequired) ++ DEFINE_STRING_MAPPING(PseudoReadOnly) ++ DEFINE_STRING_MAPPING(PseudoReadWrite) ++ DEFINE_STRING_MAPPING(PseudoValid) ++ DEFINE_STRING_MAPPING(PseudoInvalid) ++ DEFINE_STRING_MAPPING(PseudoIndeterminate) ++ DEFINE_STRING_MAPPING(PseudoTarget) ++ DEFINE_STRING_MAPPING(PseudoBefore) ++ DEFINE_STRING_MAPPING(PseudoAfter) ++ DEFINE_STRING_MAPPING(PseudoBackdrop) ++ DEFINE_STRING_MAPPING(PseudoLang) ++ DEFINE_STRING_MAPPING(PseudoNot) ++ DEFINE_STRING_MAPPING(PseudoPlaceholder) ++ DEFINE_STRING_MAPPING(PseudoResizer) ++ DEFINE_STRING_MAPPING(PseudoRoot) ++ DEFINE_STRING_MAPPING(PseudoScope) ++ DEFINE_STRING_MAPPING(PseudoScrollbar) ++ DEFINE_STRING_MAPPING(PseudoScrollbarButton) ++ DEFINE_STRING_MAPPING(PseudoScrollbarCorner) ++ DEFINE_STRING_MAPPING(PseudoScrollbarThumb) ++ DEFINE_STRING_MAPPING(PseudoScrollbarTrack) ++ DEFINE_STRING_MAPPING(PseudoScrollbarTrackPiece) ++ DEFINE_STRING_MAPPING(PseudoWindowInactive) ++ DEFINE_STRING_MAPPING(PseudoCornerPresent) ++ DEFINE_STRING_MAPPING(PseudoDecrement) ++ DEFINE_STRING_MAPPING(PseudoIncrement) ++ DEFINE_STRING_MAPPING(PseudoHorizontal) ++ DEFINE_STRING_MAPPING(PseudoVertical) ++ DEFINE_STRING_MAPPING(PseudoStart) ++ DEFINE_STRING_MAPPING(PseudoEnd) ++ DEFINE_STRING_MAPPING(PseudoDoubleButton) ++ DEFINE_STRING_MAPPING(PseudoSingleButton) ++ DEFINE_STRING_MAPPING(PseudoNoButton) ++ DEFINE_STRING_MAPPING(PseudoSelection) ++ DEFINE_STRING_MAPPING(PseudoLeftPage) ++ DEFINE_STRING_MAPPING(PseudoRightPage) ++ DEFINE_STRING_MAPPING(PseudoFirstPage) ++ DEFINE_STRING_MAPPING(PseudoFullScreen) ++ DEFINE_STRING_MAPPING(PseudoFullScreenAncestor) ++ DEFINE_STRING_MAPPING(PseudoInRange) ++ DEFINE_STRING_MAPPING(PseudoOutOfRange) ++ DEFINE_STRING_MAPPING(PseudoWebKitCustomElement) ++ DEFINE_STRING_MAPPING(PseudoBlinkInternalElement) ++ DEFINE_STRING_MAPPING(PseudoCue) ++ DEFINE_STRING_MAPPING(PseudoFutureCue) ++ DEFINE_STRING_MAPPING(PseudoPastCue) ++ DEFINE_STRING_MAPPING(PseudoUnresolved) ++ DEFINE_STRING_MAPPING(PseudoDefined) ++ DEFINE_STRING_MAPPING(PseudoContent) ++ DEFINE_STRING_MAPPING(PseudoHost) ++ DEFINE_STRING_MAPPING(PseudoHostContext) ++ DEFINE_STRING_MAPPING(PseudoShadow) ++ DEFINE_STRING_MAPPING(PseudoSlotted) ++ DEFINE_STRING_MAPPING(PseudoSpatialNavigationFocus) ++ DEFINE_STRING_MAPPING(PseudoListBox) ++ DEFINE_STRING_MAPPING(PseudoHostHasAppearance) ++ DEFINE_STRING_MAPPING(PseudoVideoPersistent) ++ DEFINE_STRING_MAPPING(PseudoVideoPersistentAncestor) + #undef DEFINE_STRING_MAPPING + } + +diff --git a/third_party/WebKit/Source/core/inspector/inspector_protocol_config.json b/third_party/WebKit/Source/core/inspector/inspector_protocol_config.json +index 38cb078e43f6..21048f15f2be 100644 +--- a/third_party/WebKit/Source/core/inspector/inspector_protocol_config.json ++++ b/third_party/WebKit/Source/core/inspector/inspector_protocol_config.json +@@ -102,8 +102,8 @@ + + "imported": { + "header": "<v8-inspector-protocol.h>", +- "to_imported_string": "toV8InspectorStringView(%s)", +- "from_imported_string": "toCoreString(%s)", ++ "to_imported_string": "ToV8InspectorStringView(%s)", ++ "from_imported_string": "ToCoreString(%s)", + "namespace": ["v8_inspector", "protocol"], + "options": [ + { +diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h +index 5f55f5210e08..1147cb93f891 100644 +--- a/third_party/WebKit/Source/core/layout/LayoutObject.h ++++ b/third_party/WebKit/Source/core/layout/LayoutObject.h +@@ -2229,54 +2229,54 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, + // https://codereview.chromium.org/44673003 and subsequent relaxations + // of the memory constraints on layout objects. + LayoutObjectBitfields(Node* node) +- : m_selfNeedsLayout(false), +- m_needsPositionedMovementLayout(false), +- m_normalChildNeedsLayout(false), +- m_posChildNeedsLayout(false), +- m_needsSimplifiedNormalFlowLayout(false), +- m_selfNeedsOverflowRecalcAfterStyleChange(false), +- m_childNeedsOverflowRecalcAfterStyleChange(false), +- m_preferredLogicalWidthsDirty(false), +- m_mayNeedPaintInvalidation(false), +- m_mayNeedPaintInvalidationSubtree(false), +- m_mayNeedPaintInvalidationAnimatedBackgroundImage(false), +- m_needsPaintOffsetAndVisualRectUpdate(false), +- m_shouldInvalidateSelection(false), +- m_floating(false), +- m_isAnonymous(!node), +- m_isText(false), +- m_isBox(false), +- m_isInline(true), +- m_isAtomicInlineLevel(false), +- m_horizontalWritingMode(true), +- m_hasLayer(false), +- m_hasOverflowClip(false), +- m_hasTransformRelatedProperty(false), +- m_hasReflection(false), +- m_canContainFixedPositionObjects(false), +- m_hasCounterNodeMap(false), +- m_everHadLayout(false), +- m_ancestorLineBoxDirty(false), +- m_isInsideFlowThread(false), +- m_subtreeChangeListenerRegistered(false), +- m_notifiedOfSubtreeChange(false), +- m_consumesSubtreeChangeNotification(false), +- m_childrenInline(false), +- m_containsInlineWithOutlineAndContinuation(false), +- m_alwaysCreateLineBoxesForLayoutInline(false), +- m_previousBackgroundObscured(false), +- m_isBackgroundAttachmentFixedObject(false), +- m_isScrollAnchorObject(false), +- m_scrollAnchorDisablingStyleChanged(false), +- m_hasBoxDecorationBackground(false), +- m_hasPreviousLocationInBacking(false), +- m_hasPreviousSelectionVisualRect(false), +- m_needsPaintPropertyUpdate(true), +- m_subtreeNeedsPaintPropertyUpdate(true), +- m_descendantNeedsPaintPropertyUpdate(true), +- m_backgroundChangedSinceLastPaintInvalidation(false), +- m_outlineMayBeAffectedByDescendants(false), +- m_previousOutlineMayBeAffectedByDescendants(false), ++ : m_SelfNeedsLayout(false), ++ m_NeedsPositionedMovementLayout(false), ++ m_NormalChildNeedsLayout(false), ++ m_PosChildNeedsLayout(false), ++ m_NeedsSimplifiedNormalFlowLayout(false), ++ m_SelfNeedsOverflowRecalcAfterStyleChange(false), ++ m_ChildNeedsOverflowRecalcAfterStyleChange(false), ++ m_PreferredLogicalWidthsDirty(false), ++ m_MayNeedPaintInvalidation(false), ++ m_MayNeedPaintInvalidationSubtree(false), ++ m_MayNeedPaintInvalidationAnimatedBackgroundImage(false), ++ m_NeedsPaintOffsetAndVisualRectUpdate(false), ++ m_ShouldInvalidateSelection(false), ++ m_Floating(false), ++ m_IsAnonymous(!node), ++ m_IsText(false), ++ m_IsBox(false), ++ m_IsInline(true), ++ m_IsAtomicInlineLevel(false), ++ m_HorizontalWritingMode(true), ++ m_HasLayer(false), ++ m_HasOverflowClip(false), ++ m_HasTransformRelatedProperty(false), ++ m_HasReflection(false), ++ m_CanContainFixedPositionObjects(false), ++ m_HasCounterNodeMap(false), ++ m_EverHadLayout(false), ++ m_AncestorLineBoxDirty(false), ++ m_IsInsideFlowThread(false), ++ m_SubtreeChangeListenerRegistered(false), ++ m_NotifiedOfSubtreeChange(false), ++ m_ConsumesSubtreeChangeNotification(false), ++ m_ChildrenInline(false), ++ m_ContainsInlineWithOutlineAndContinuation(false), ++ m_AlwaysCreateLineBoxesForLayoutInline(false), ++ m_PreviousBackgroundObscured(false), ++ m_IsBackgroundAttachmentFixedObject(false), ++ m_IsScrollAnchorObject(false), ++ m_ScrollAnchorDisablingStyleChanged(false), ++ m_HasBoxDecorationBackground(false), ++ m_HasPreviousLocationInBacking(false), ++ m_HasPreviousSelectionVisualRect(false), ++ m_NeedsPaintPropertyUpdate(true), ++ m_SubtreeNeedsPaintPropertyUpdate(true), ++ m_DescendantNeedsPaintPropertyUpdate(true), ++ m_BackgroundChangedSinceLastPaintInvalidation(false), ++ m_OutlineMayBeAffectedByDescendants(false), ++ m_PreviousOutlineMayBeAffectedByDescendants(false), + positioned_state_(kIsStaticallyPositioned), + selection_state_(SelectionNone), + background_obscuration_state_(kBackgroundObscurationStatusInvalid), +diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp +index 8d498b37e744..200d756df488 100644 +--- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp ++++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp +@@ -88,7 +88,7 @@ void RenderingTest::LoadAhem() { + ScriptState* script_state = ToScriptStateForMainWorld(&page_holder_->GetFrame()); + DummyExceptionStateForTesting exception_state; + FontFaceSet::From(GetDocument()) +- ->AddForBinding(script_state, ahem, exception_state); ++ ->addForBinding(script_state, ahem, exception_state); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.h b/third_party/WebKit/Source/core/layout/line/InlineBox.h +index 78d4dce988ab..bd405ba086c8 100644 +--- a/third_party/WebKit/Source/core/layout/line/InlineBox.h ++++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h +@@ -407,19 +407,19 @@ class CORE_EXPORT InlineBox : public DisplayItemClient { + bool dirty = false, + bool extracted = false, + bool is_horizontal = true) +- : m_firstLine(first_line), +- m_constructed(constructed), ++ : m_FirstLine(first_line), ++ m_Constructed(constructed), + bidi_embedding_level_(0), +- m_dirty(dirty), +- m_extracted(extracted), +- m_hasVirtualLogicalHeight(false), +- m_isHorizontal(is_horizontal), +- m_endsWithBreak(false), +- m_hasSelectedChildrenOrCanHaveLeadingExpansion(false), +- m_knownToHaveNoOverflow(true), +- m_hasEllipsisBoxOrHyphen(false), +- m_dirOverride(false), +- m_isText(false), ++ m_Dirty(dirty), ++ m_Extracted(extracted), ++ m_HasVirtualLogicalHeight(false), ++ m_IsHorizontal(is_horizontal), ++ m_EndsWithBreak(false), ++ m_HasSelectedChildrenOrCanHaveLeadingExpansion(false), ++ m_KnownToHaveNoOverflow(true), ++ m_HasEllipsisBoxOrHyphen(false), ++ m_DirOverride(false), ++ m_IsText(false), + expansion_(0) {} + + // Some of these bits are actually for subclasses and moved here to compact +diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h +index 44f9e1a034d6..4855e8ed0855 100644 +--- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h ++++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.h +@@ -92,7 +92,7 @@ class CORE_EXPORT CSSStyleSheetResource final : public StyleSheetResource { + bool did_notify_first_data_; + }; + +-DEFINE_RESOURCE_TYPE_CASTS(kCSSStyleSheet); ++DEFINE_RESOURCE_TYPE_CASTS(CSSStyleSheet); + + } // namespace blink + +diff --git a/third_party/WebKit/Source/core/loader/resource/FontResource.h b/third_party/WebKit/Source/core/loader/resource/FontResource.h +index f0cdf91d5b54..016f5d11e432 100644 +--- a/third_party/WebKit/Source/core/loader/resource/FontResource.h ++++ b/third_party/WebKit/Source/core/loader/resource/FontResource.h +@@ -110,7 +110,7 @@ class CORE_EXPORT FontResource final : public Resource { + FRIEND_TEST_ALL_PREFIXES(FontResourceTest, CacheAwareFontLoading); + }; + +-DEFINE_RESOURCE_TYPE_CASTS(kFont); ++DEFINE_RESOURCE_TYPE_CASTS(Font); + + class FontResourceClient : public ResourceClient { + public: +diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.h b/third_party/WebKit/Source/core/loader/resource/ImageResource.h +index 272e1bba1051..fd36a598c38d 100644 +--- a/third_party/WebKit/Source/core/loader/resource/ImageResource.h ++++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.h +@@ -172,7 +172,7 @@ class CORE_EXPORT ImageResource final + double last_flush_time_ = 0.; + }; + +-DEFINE_RESOURCE_TYPE_CASTS(kImage); ++DEFINE_RESOURCE_TYPE_CASTS(Image); + + } // namespace blink + +diff --git a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h +index 44b5ebc0ff21..e376ee78550e 100644 +--- a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h ++++ b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h +@@ -97,7 +97,7 @@ class CORE_EXPORT ScriptResource final : public TextResource { + AtomicString script_; + }; + +-DEFINE_RESOURCE_TYPE_CASTS(kScript); ++DEFINE_RESOURCE_TYPE_CASTS(Script); + + } // namespace blink + +diff --git a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h +index 1dcf14feec6a..51375c6d2eb8 100644 +--- a/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h ++++ b/third_party/WebKit/Source/core/loader/resource/XSLStyleSheetResource.h +@@ -63,7 +63,7 @@ class XSLStyleSheetResource final : public StyleSheetResource { + String sheet_; + }; + +-DEFINE_RESOURCE_TYPE_CASTS(kXSLStyleSheet); ++DEFINE_RESOURCE_TYPE_CASTS(XSLStyleSheet); + + } // namespace blink + +diff --git a/third_party/WebKit/Source/core/page/ChromeClient.h b/third_party/WebKit/Source/core/page/ChromeClient.h +index 568eb8d0c4f8..6587f1dfa15a 100644 +--- a/third_party/WebKit/Source/core/page/ChromeClient.h ++++ b/third_party/WebKit/Source/core/page/ChromeClient.h +@@ -45,6 +45,9 @@ + #include "wtf/Vector.h" + #include <memory> + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef CreateWindow ++ + namespace blink { + + class AXObject; +diff --git a/third_party/WebKit/Source/core/page/CreateWindow.h b/third_party/WebKit/Source/core/page/CreateWindow.h +index 297d5a0d9615..9772bc1c5b86 100644 +--- a/third_party/WebKit/Source/core/page/CreateWindow.h ++++ b/third_party/WebKit/Source/core/page/CreateWindow.h +@@ -32,6 +32,9 @@ + #include "core/loader/NavigationPolicy.h" + #include "wtf/text/WTFString.h" + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef CreateWindow ++ + namespace blink { + class LocalFrame; + struct FrameLoadRequest; +diff --git a/third_party/WebKit/Source/core/page/PagePopup.h b/third_party/WebKit/Source/core/page/PagePopup.h +index f7b480aad62f..649e154e6bc1 100644 +--- a/third_party/WebKit/Source/core/page/PagePopup.h ++++ b/third_party/WebKit/Source/core/page/PagePopup.h +@@ -33,6 +33,9 @@ + + #include "wtf/Forward.h" + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef PostMessage ++ + namespace blink { + + class AXObject; +diff --git a/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp b/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp +index 0273b109d3b6..14dd76de78b8 100644 +--- a/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp ++++ b/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp +@@ -27,7 +27,7 @@ FloatClipRecorder::~FloatClipRecorder() { + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) + return; + DisplayItem::Type end_type = +- DisplayItem::floatClipTypeToEndFloatClipType(clip_type_); ++ DisplayItem::FloatClipTypeToEndFloatClipType(clip_type_); + context_.GetPaintController().EndItem<EndFloatClipDisplayItem>(client_, + end_type); + } +diff --git a/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp b/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp +index 1e67ae227bc5..7398947b76b7 100644 +--- a/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp ++++ b/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp +@@ -34,7 +34,7 @@ ScrollRecorder::~ScrollRecorder() { + if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) + return; + context_.GetPaintController().EndItem<EndScrollDisplayItem>( +- client_, DisplayItem::scrollTypeToEndScrollType(begin_item_type_)); ++ client_, DisplayItem::ScrollTypeToEndScrollType(begin_item_type_)); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp b/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp +index a272c772c4d7..dfcc4733477b 100644 +--- a/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp ++++ b/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp +@@ -35,7 +35,7 @@ Transform3DRecorder::~Transform3DRecorder() { + return; + + context_.GetPaintController().EndItem<EndTransform3DDisplayItem>( +- client_, DisplayItem::transform3DTypeToEndTransform3DType(type_)); ++ client_, DisplayItem::Transform3DTypeToEndTransform3DType(type_)); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/core/style/BasicShapes.h b/third_party/WebKit/Source/core/style/BasicShapes.h +index 0e3d555e1b22..ab6bf9c254c0 100644 +--- a/third_party/WebKit/Source/core/style/BasicShapes.h ++++ b/third_party/WebKit/Source/core/style/BasicShapes.h +@@ -75,8 +75,8 @@ class CORE_EXPORT BasicShape : public RefCounted<BasicShape> { + + #define DEFINE_BASICSHAPE_TYPE_CASTS(thisType) \ + DEFINE_TYPE_CASTS(thisType, BasicShape, value, \ +- value->GetType() == BasicShape::thisType##Type, \ +- value.GetType() == BasicShape::thisType##Type) ++ value->GetType() == BasicShape::k##thisType##Type, \ ++ value.GetType() == BasicShape::k##thisType##Type) + + class BasicShapeCenterCoordinate { + DISALLOW_NEW(); +diff --git a/third_party/WebKit/Source/core/svg/SVGFEBlendElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEBlendElement.cpp +index dfc440948244..64e1161adad6 100644 +--- a/third_party/WebKit/Source/core/svg/SVGFEBlendElement.cpp ++++ b/third_party/WebKit/Source/core/svg/SVGFEBlendElement.cpp +@@ -28,8 +28,8 @@ namespace blink { + + static WebBlendMode ToWebBlendMode(SVGFEBlendElement::Mode mode) { + #define MAP_BLEND_MODE(MODENAME) \ +- case SVGFEBlendElement::Mode##MODENAME: \ +- return WebBlendMode##MODENAME ++ case SVGFEBlendElement::kMode##MODENAME: \ ++ return kWebBlendMode##MODENAME + + switch (mode) { + MAP_BLEND_MODE(Normal); +diff --git a/third_party/WebKit/Source/core/svg/SVGLengthContext.h b/third_party/WebKit/Source/core/svg/SVGLengthContext.h +index c8a9ca8cd295..c42e8f604f9f 100644 +--- a/third_party/WebKit/Source/core/svg/SVGLengthContext.h ++++ b/third_party/WebKit/Source/core/svg/SVGLengthContext.h +@@ -45,9 +45,9 @@ class SVGLengthContext { + SVGUnitTypes::SVGUnitType type, + const FloatRect& viewport) { + return ResolveRectangle( +- context, type, viewport, *context->X()->CurrentValue(), +- *context->Y()->CurrentValue(), *context->Width()->CurrentValue(), +- *context->Height()->CurrentValue()); ++ context, type, viewport, *context->x()->CurrentValue(), ++ *context->y()->CurrentValue(), *context->width()->CurrentValue(), ++ *context->height()->CurrentValue()); + } + + static FloatRect ResolveRectangle(const SVGElement*, +diff --git a/third_party/WebKit/Source/core/svg/SVGViewSpec.h b/third_party/WebKit/Source/core/svg/SVGViewSpec.h +index d54520897601..dc614883fb4e 100644 +--- a/third_party/WebKit/Source/core/svg/SVGViewSpec.h ++++ b/third_party/WebKit/Source/core/svg/SVGViewSpec.h +@@ -66,15 +66,15 @@ class SVGViewSpec final : public GarbageCollectedFinalized<SVGViewSpec>, + template <typename T> + void SVGViewSpec::InheritViewAttributesFromElement(T& inherit_from_element) { + if (inherit_from_element.HasValidViewBox()) +- SetViewBox(inherit_from_element.ViewBox()->CurrentValue()->Value()); ++ SetViewBox(inherit_from_element.viewBox()->CurrentValue()->Value()); + +- if (inherit_from_element.PreserveAspectRatio()->IsSpecified()) { ++ if (inherit_from_element.preserveAspectRatio()->IsSpecified()) { + SetPreserveAspectRatio( +- *inherit_from_element.PreserveAspectRatio()->CurrentValue()); ++ *inherit_from_element.preserveAspectRatio()->CurrentValue()); + } + +- if (inherit_from_element.HasAttribute(SVGNames::zoomAndPanAttr)) +- setZoomAndPan(inherit_from_element.ZoomAndPan()); ++ if (inherit_from_element.hasAttribute(SVGNames::zoomAndPanAttr)) ++ setZoomAndPan(inherit_from_element.zoomAndPan()); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/core/svg/properties/SVGAnimatedProperty.h b/third_party/WebKit/Source/core/svg/properties/SVGAnimatedProperty.h +index b5f360a14e5d..193e44b6f1eb 100644 +--- a/third_party/WebKit/Source/core/svg/properties/SVGAnimatedProperty.h ++++ b/third_party/WebKit/Source/core/svg/properties/SVGAnimatedProperty.h +@@ -196,12 +196,12 @@ class SVGAnimatedProperty : public SVGAnimatedPropertyCommon<Property> { + base_value_updated_ = true; + + DCHECK(this->AttributeName() != QualifiedName::Null()); +- this->ContextElement()->InvalidateSVGAttributes(); +- this->ContextElement()->SvgAttributeBaseValChanged(this->AttributeName()); ++ this->contextElement()->InvalidateSVGAttributes(); ++ this->contextElement()->SvgAttributeBaseValChanged(this->AttributeName()); + } + + PrimitiveType animVal() { +- this->ContextElement()->EnsureAttributeAnimValUpdated(); ++ this->contextElement()->EnsureAttributeAnimValUpdated(); + return this->CurrentValue()->Value(); + } + +@@ -260,7 +260,7 @@ class SVGAnimatedProperty<Property, TearOffType, void> + virtual TearOffType* baseVal() { + if (!base_val_tear_off_) { + base_val_tear_off_ = +- TearOffType::Create(this->BaseValue(), this->ContextElement(), ++ TearOffType::Create(this->BaseValue(), this->contextElement(), + kPropertyIsNotAnimVal, this->AttributeName()); + } + return base_val_tear_off_; +@@ -269,7 +269,7 @@ class SVGAnimatedProperty<Property, TearOffType, void> + TearOffType* animVal() { + if (!anim_val_tear_off_) { + anim_val_tear_off_ = +- TearOffType::Create(this->CurrentValue(), this->ContextElement(), ++ TearOffType::Create(this->CurrentValue(), this->contextElement(), + kPropertyIsAnimVal, this->AttributeName()); + } + return anim_val_tear_off_; +diff --git a/third_party/WebKit/Source/core/testing/InternalSettings.cpp b/third_party/WebKit/Source/core/testing/InternalSettings.cpp +index 401a8ae6ed9e..6473d431735a 100644 +--- a/third_party/WebKit/Source/core/testing/InternalSettings.cpp ++++ b/third_party/WebKit/Source/core/testing/InternalSettings.cpp +@@ -370,7 +370,7 @@ void InternalSettings::setDefaultVideoPosterURL( + } + + DEFINE_TRACE(InternalSettings) { +- InternalSettingsGenerated::trace(visitor); ++ InternalSettingsGenerated::Trace(visitor); + Supplement<Page>::Trace(visitor); + } + +diff --git a/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp b/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp +index f64d3b25b1b8..a39be84bffb6 100644 +--- a/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp ++++ b/third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp +@@ -46,7 +46,7 @@ class PerformanceBaseTest : public ::testing::Test { + v8::Local<v8::Function> callback = + v8::Function::New(script_state->GetContext(), nullptr).ToLocalChecked(); + base_ = new TestPerformanceBase(script_state); +- cb_ = PerformanceObserverCallback::create(script_state, callback); ++ cb_ = PerformanceObserverCallback::Create(script_state, callback); + observer_ = PerformanceObserver::Create(script_state->GetExecutionContext(), + base_, cb_); + } +diff --git a/third_party/WebKit/Source/core/timing/PerformanceObserverTest.cpp b/third_party/WebKit/Source/core/timing/PerformanceObserverTest.cpp +index f869b60bf9fd..0e345a1ee341 100644 +--- a/third_party/WebKit/Source/core/timing/PerformanceObserverTest.cpp ++++ b/third_party/WebKit/Source/core/timing/PerformanceObserverTest.cpp +@@ -33,7 +33,7 @@ class PerformanceObserverTest : public ::testing::Test { + v8::Local<v8::Function> callback = + v8::Function::New(script_state->GetContext(), nullptr).ToLocalChecked(); + base_ = new MockPerformanceBase(script_state); +- cb_ = PerformanceObserverCallback::create(script_state, callback); ++ cb_ = PerformanceObserverCallback::Create(script_state, callback); + observer_ = PerformanceObserver::Create(script_state->GetExecutionContext(), + base_, cb_); + } +diff --git a/third_party/WebKit/Source/core/xml/XPathGrammar.y b/third_party/WebKit/Source/core/xml/XPathGrammar.y +index 28d326b48ac4..2b0737fc171e 100644 +--- a/third_party/WebKit/Source/core/xml/XPathGrammar.y ++++ b/third_party/WebKit/Source/core/xml/XPathGrammar.y +@@ -38,11 +38,11 @@ + + void* yyFastMalloc(size_t size) + { +- return WTF::Partitions::fastMalloc(size, nullptr); ++ return WTF::Partitions::FastMalloc(size, nullptr); + } + + #define YYMALLOC yyFastMalloc +-#define YYFREE WTF::Partitions::fastFree ++#define YYFREE WTF::Partitions::FastFree + + #define YYENABLE_NLS 0 + #define YYLTYPE_IS_TRIVIAL 1 +@@ -73,7 +73,7 @@ using namespace XPath; + + %{ + +-static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); } ++static int xpathyylex(YYSTYPE* yylval) { return Parser::Current()->Lex(yylval); } + static void xpathyyerror(void*, const char*) { } + + %} +@@ -121,19 +121,19 @@ static void xpathyyerror(void*, const char*) { } + Expr: + OrExpr + { +- parser->m_topExpr = $1; ++ parser->top_expr_ = $1; + } + ; + + LocationPath: + RelativeLocationPath + { +- $$->setAbsolute(false); ++ $$->SetAbsolute(false); + } + | + AbsoluteLocationPath + { +- $$->setAbsolute(true); ++ $$->SetAbsolute(true); + } + ; + +@@ -151,7 +151,7 @@ AbsoluteLocationPath: + DescendantOrSelf RelativeLocationPath + { + $$ = $2; +- $$->insertFirstStep($1); ++ $$->InsertFirstStep($1); + } + ; + +@@ -159,18 +159,18 @@ RelativeLocationPath: + Step + { + $$ = new LocationPath; +- $$->appendStep($1); ++ $$->AppendStep($1); + } + | + RelativeLocationPath '/' Step + { +- $$->appendStep($3); ++ $$->AppendStep($3); + } + | + RelativeLocationPath DescendantOrSelf Step + { +- $$->appendStep($2); +- $$->appendStep($3); ++ $$->AppendStep($2); ++ $$->AppendStep($3); + } + ; + +@@ -178,25 +178,25 @@ Step: + NodeTest OptionalPredicateList + { + if ($2) +- $$ = new Step(Step::ChildAxis, *$1, *$2); ++ $$ = new Step(Step::kChildAxis, *$1, *$2); + else +- $$ = new Step(Step::ChildAxis, *$1); ++ $$ = new Step(Step::kChildAxis, *$1); + } + | + NAMETEST OptionalPredicateList + { + AtomicString localName; + AtomicString namespaceURI; +- if (!parser->expandQName(*$1, localName, namespaceURI)) { +- parser->m_gotNamespaceError = true; ++ if (!parser->ExpandQName(*$1, localName, namespaceURI)) { ++ parser->got_namespace_error_ = true; + YYABORT; + } + + if ($2) +- $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$2); ++ $$ = new Step(Step::kChildAxis, Step::NodeTest(Step::NodeTest::kNameTest, localName, namespaceURI), *$2); + else +- $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI)); +- parser->deleteString($1); ++ $$ = new Step(Step::kChildAxis, Step::NodeTest(Step::NodeTest::kNameTest, localName, namespaceURI)); ++ parser->DeleteString($1); + } + | + AxisSpecifier NodeTest OptionalPredicateList +@@ -211,16 +211,16 @@ Step: + { + AtomicString localName; + AtomicString namespaceURI; +- if (!parser->expandQName(*$2, localName, namespaceURI)) { +- parser->m_gotNamespaceError = true; ++ if (!parser->ExpandQName(*$2, localName, namespaceURI)) { ++ parser->got_namespace_error_ = true; + YYABORT; + } + + if ($3) +- $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$3); ++ $$ = new Step($1, Step::NodeTest(Step::NodeTest::kNameTest, localName, namespaceURI), *$3); + else +- $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI)); +- parser->deleteString($2); ++ $$ = new Step($1, Step::NodeTest(Step::NodeTest::kNameTest, localName, namespaceURI)); ++ parser->DeleteString($2); + } + | + AbbreviatedStep +@@ -231,7 +231,7 @@ AxisSpecifier: + | + '@' + { +- $$ = Step::AttributeAxis; ++ $$ = Step::kAttributeAxis; + } + ; + +@@ -239,26 +239,26 @@ NodeTest: + NODETYPE '(' ')' + { + if (*$1 == "node") +- $$ = new Step::NodeTest(Step::NodeTest::AnyNodeTest); ++ $$ = new Step::NodeTest(Step::NodeTest::kAnyNodeTest); + else if (*$1 == "text") +- $$ = new Step::NodeTest(Step::NodeTest::TextNodeTest); ++ $$ = new Step::NodeTest(Step::NodeTest::kTextNodeTest); + else if (*$1 == "comment") +- $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest); ++ $$ = new Step::NodeTest(Step::NodeTest::kCommentNodeTest); + +- parser->deleteString($1); ++ parser->DeleteString($1); + } + | + PI '(' ')' + { +- $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest); +- parser->deleteString($1); ++ $$ = new Step::NodeTest(Step::NodeTest::kProcessingInstructionNodeTest); ++ parser->DeleteString($1); + } + | + PI '(' LITERAL ')' + { +- $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $3->stripWhiteSpace()); +- parser->deleteString($1); +- parser->deleteString($3); ++ $$ = new Step::NodeTest(Step::NodeTest::kProcessingInstructionNodeTest, $3->StripWhiteSpace()); ++ parser->DeleteString($1); ++ parser->DeleteString($3); + } + ; + +@@ -294,19 +294,19 @@ Predicate: + DescendantOrSelf: + SLASHSLASH + { +- $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); ++ $$ = new Step(Step::kDescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTest)); + } + ; + + AbbreviatedStep: + '.' + { +- $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); ++ $$ = new Step(Step::kSelfAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTest)); + } + | + DOTDOT + { +- $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); ++ $$ = new Step(Step::kParentAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTest)); + } + ; + +@@ -314,7 +314,7 @@ PrimaryExpr: + VARIABLEREFERENCE + { + $$ = new VariableReference(*$1); +- parser->deleteString($1); ++ parser->DeleteString($1); + } + | + '(' Expr ')' +@@ -325,13 +325,13 @@ PrimaryExpr: + LITERAL + { + $$ = new StringExpression(*$1); +- parser->deleteString($1); ++ parser->DeleteString($1); + } + | + NUMBER + { +- $$ = new Number($1->toDouble()); +- parser->deleteString($1); ++ $$ = new Number($1->ToDouble()); ++ parser->DeleteString($1); + } + | + FunctionCall +@@ -340,18 +340,18 @@ PrimaryExpr: + FunctionCall: + FUNCTIONNAME '(' ')' + { +- $$ = createFunction(*$1); ++ $$ = CreateFunction(*$1); + if (!$$) + YYABORT; +- parser->deleteString($1); ++ parser->DeleteString($1); + } + | + FUNCTIONNAME '(' ArgumentList ')' + { +- $$ = createFunction(*$1, *$3); ++ $$ = CreateFunction(*$1, *$3); + if (!$$) + YYABORT; +- parser->deleteString($1); ++ parser->DeleteString($1); + } + ; + +@@ -378,8 +378,8 @@ UnionExpr: + UnionExpr '|' PathExpr + { + $$ = new Union; +- $$->addSubExpression($1); +- $$->addSubExpression($3); ++ $$->AddSubExpression($1); ++ $$->AddSubExpression($3); + } + ; + +@@ -393,14 +393,14 @@ PathExpr: + | + FilterExpr '/' RelativeLocationPath + { +- $3->setAbsolute(true); ++ $3->SetAbsolute(true); + $$ = new blink::XPath::Path($1, $3); + } + | + FilterExpr DescendantOrSelf RelativeLocationPath + { +- $3->insertFirstStep($2); +- $3->setAbsolute(true); ++ $3->InsertFirstStep($2); ++ $3->SetAbsolute(true); + $$ = new blink::XPath::Path($1, $3); + } + ; +@@ -419,7 +419,7 @@ OrExpr: + | + OrExpr OR AndExpr + { +- $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3); ++ $$ = new LogicalOp(LogicalOp::kOP_Or, $1, $3); + } + ; + +@@ -428,7 +428,7 @@ AndExpr: + | + AndExpr AND EqualityExpr + { +- $$ = new LogicalOp(LogicalOp::OP_And, $1, $3); ++ $$ = new LogicalOp(LogicalOp::kOP_And, $1, $3); + } + ; + +@@ -455,12 +455,12 @@ AdditiveExpr: + | + AdditiveExpr PLUS MultiplicativeExpr + { +- $$ = new NumericOp(NumericOp::OP_Add, $1, $3); ++ $$ = new NumericOp(NumericOp::kOP_Add, $1, $3); + } + | + AdditiveExpr MINUS MultiplicativeExpr + { +- $$ = new NumericOp(NumericOp::OP_Sub, $1, $3); ++ $$ = new NumericOp(NumericOp::kOP_Sub, $1, $3); + } + ; + +@@ -479,7 +479,7 @@ UnaryExpr: + MINUS UnaryExpr + { + $$ = new Negative; +- $$->addSubExpression($2); ++ $$->AddSubExpression($2); + } + ; + +diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp +index 28ae7c41c6db..c3bc1d263505 100644 +--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp ++++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp +@@ -290,7 +290,7 @@ class MockImageBufferSurfaceForOverwriteTesting + MockImageBufferSurfaceForOverwriteTesting* surface_ptr = mock_surface.get(); \ + CanvasElement().CreateImageBufferUsingSurfaceForTesting( \ + std::move(mock_surface)); \ +- EXPECT_CALL(*surface_ptr, willOverwriteCanvas()).Times(EXPECTED_OVERDRAWS); \ ++ EXPECT_CALL(*surface_ptr, WillOverwriteCanvas()).Times(EXPECTED_OVERDRAWS); \ + Context2d()->save(); + + #define TEST_OVERDRAW_FINALIZE \ +diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp +index cc56a5a3a5ee..4ed52c3a2315 100644 +--- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp ++++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp +@@ -110,7 +110,7 @@ void FileSystemCallbacksBase::HandleEventOrScheduleCallback(CB* callback, + WTF::Bind(&CB::handleEvent, WrapPersistent(callback), + WrapPersistent(arg))); + } else { +- callback->HandleEvent(arg); ++ callback->handleEvent(arg); + } + } + execution_context_.Clear(); +@@ -125,7 +125,7 @@ void FileSystemCallbacksBase::HandleEventOrScheduleCallback(CB* callback) { + execution_context_.Get(), + WTF::Bind(&CB::handleEvent, WrapPersistent(callback))); + } else { +- callback->HandleEvent(); ++ callback->handleEvent(); + } + } + execution_context_.Clear(); +diff --git a/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h b/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h +index 98d524d5a067..83517bd49209 100644 +--- a/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h ++++ b/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h +@@ -83,9 +83,9 @@ class SyncCallbackHelper final + return new SuccessCallbackImpl(helper); + } + +- virtual void HandleEvent() { helper_->SetError(FileError::kOK); } ++ virtual void handleEvent() { helper_->SetError(FileError::kOK); } + +- virtual void HandleEvent(CallbackArg arg) { helper_->SetResult(arg); } ++ virtual void handleEvent(CallbackArg arg) { helper_->SetResult(arg); } + + DEFINE_INLINE_TRACE() { + visitor->Trace(helper_); +diff --git a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp +index bbd3197ab48d..f58777b37dfa 100644 +--- a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp ++++ b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp +@@ -60,7 +60,7 @@ static void SampleGamepads(ListType* into) { + for (unsigned i = 0; i < WebGamepads::kItemsLengthCap; ++i) { + WebGamepad& web_gamepad = gamepads.items[i]; + if (web_gamepad.connected) { +- GamepadType* gamepad = into->Item(i); ++ GamepadType* gamepad = into->item(i); + if (!gamepad) + gamepad = GamepadType::Create(); + SampleGamepad(i, *gamepad, web_gamepad); +diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +index c260269e4133..6b0d0f3cdd62 100644 +--- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp ++++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +@@ -691,7 +691,7 @@ T* FindExistingTrackById(const TrackListBase<T>& track_list, const String& id) { + // one that we had in previous init segments. + if (track_list.length() == 1) + return track_list.AnonymousIndexedGetter(0); +- return track_list.GetTrackById(id); ++ return track_list.getTrackById(id); + } + + const TrackDefault* SourceBuffer::GetTrackDefault( +diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp +index 2febf45b01b7..d30cdba23446 100644 +--- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp ++++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp +@@ -21,7 +21,7 @@ + #include "wtf/Threading.h" + + #define NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, type_name, value, max) \ +- case NotificationImageLoader::Type::type_name: { \ ++ case NotificationImageLoader::Type::k##type_name: { \ + DEFINE_THREAD_SAFE_STATIC_LOCAL( \ + CustomCountHistogram, metric##type_name##Histogram, \ + new CustomCountHistogram("Notifications." #metric "." #type_name, \ +@@ -32,10 +32,10 @@ + + #define NOTIFICATION_HISTOGRAM_COUNTS(metric, type, value, max) \ + switch (type) { \ +- NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, kImage, value, max) \ +- NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, kIcon, value, max) \ +- NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, kBadge, value, max) \ +- NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, kActionIcon, value, max) \ ++ NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, Image, value, max) \ ++ NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, Icon, value, max) \ ++ NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, Badge, value, max) \ ++ NOTIFICATION_PER_TYPE_HISTOGRAM_COUNTS(metric, ActionIcon, value, max) \ + } + + namespace { +diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp +index 1f8c5d845984..a23506422b51 100644 +--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp ++++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp +@@ -132,35 +132,35 @@ static const int kCompleteTimeoutSeconds = 60; + template <typename T> + void ValidateShippingOptionOrPaymentItem(const T& item, + ExceptionState& exception_state) { +- if (!item.HasLabel() || item.Label().IsEmpty()) { ++ if (!item.hasLabel() || item.label().IsEmpty()) { + exception_state.ThrowTypeError("Item label required"); + return; + } + +- if (!item.HasAmount()) { ++ if (!item.hasAmount()) { + exception_state.ThrowTypeError("Currency amount required"); + return; + } + +- if (!item.Amount().hasCurrency()) { ++ if (!item.amount().hasCurrency()) { + exception_state.ThrowTypeError("Currency code required"); + return; + } + +- if (!item.Amount().hasValue()) { ++ if (!item.amount().hasValue()) { + exception_state.ThrowTypeError("Currency value required"); + return; + } + + String error_message; + if (!PaymentsValidators::IsValidCurrencyCodeFormat( +- item.Amount().currency(), item.Amount().currencySystem(), ++ item.amount().currency(), item.amount().currencySystem(), + &error_message)) { + exception_state.ThrowTypeError(error_message); + return; + } + +- if (!PaymentsValidators::IsValidAmountFormat(item.Amount().value(), ++ if (!PaymentsValidators::IsValidAmountFormat(item.amount().value(), + &error_message)) { + exception_state.ThrowTypeError(error_message); + return; +diff --git a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp +index cf9ffa7667cb..532c643c0ef2 100644 +--- a/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp ++++ b/third_party/WebKit/Source/modules/payments/PaymentTestHelper.cpp +@@ -45,13 +45,13 @@ void SetValues(PaymentItemOrPaymentShippingOption& original, + } + + if (data != kPaymentTestDataAmount || modification_type != kPaymentTestRemoveKey) +- original.SetAmount(item_amount); ++ original.setAmount(item_amount); + + if (data == kPaymentTestDataLabel) { + if (modification_type == kPaymentTestOverwriteValue) +- original.SetLabel(value_to_use); ++ original.setLabel(value_to_use); + } else { +- original.SetLabel("Label"); ++ original.setLabel("Label"); + } + } + +diff --git a/third_party/WebKit/Source/modules/permissions/Permissions.cpp b/third_party/WebKit/Source/modules/permissions/Permissions.cpp +index e1533dc6a1c7..1a2054d2e5de 100644 +--- a/third_party/WebKit/Source/modules/permissions/Permissions.cpp ++++ b/third_party/WebKit/Source/modules/permissions/Permissions.cpp +@@ -47,7 +47,7 @@ PermissionDescriptorPtr ParsePermission(ScriptState* script_state, + const Dictionary raw_permission, + ExceptionState& exception_state) { + PermissionDescriptor permission = +- NativeValueTraits<PermissionDescriptor>::nativeValue( ++ NativeValueTraits<PermissionDescriptor>::NativeValue( + script_state->GetIsolate(), raw_permission.V8Value(), exception_state); + + if (exception_state.HadException()) { +@@ -62,7 +62,7 @@ PermissionDescriptorPtr ParsePermission(ScriptState* script_state, + return CreatePermissionDescriptor(PermissionName::NOTIFICATIONS); + if (name == "push") { + PushPermissionDescriptor push_permission = +- NativeValueTraits<PushPermissionDescriptor>::nativeValue( ++ NativeValueTraits<PushPermissionDescriptor>::NativeValue( + script_state->GetIsolate(), raw_permission.V8Value(), exception_state); + if (exception_state.HadException()) { + exception_state.ThrowTypeError(exception_state.Message()); +@@ -81,7 +81,7 @@ PermissionDescriptorPtr ParsePermission(ScriptState* script_state, + } + if (name == "midi") { + MidiPermissionDescriptor midi_permission = +- NativeValueTraits<MidiPermissionDescriptor>::nativeValue( ++ NativeValueTraits<MidiPermissionDescriptor>::NativeValue( + script_state->GetIsolate(), raw_permission.V8Value(), exception_state); + return CreateMidiPermissionDescriptor(midi_permission.sysex()); + } +diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp b/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp +index 51f9aef1af77..7838441ba10d 100644 +--- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp ++++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp +@@ -235,7 +235,7 @@ TEST_F(RemotePlaybackTest, DisableRemotePlaybackCancelsAvailabilityCallbacks) { + + MockFunction* callback_function = MockFunction::Create(scope.GetScriptState()); + RemotePlaybackAvailabilityCallback* availability_callback = +- RemotePlaybackAvailabilityCallback::create(scope.GetScriptState(), ++ RemotePlaybackAvailabilityCallback::Create(scope.GetScriptState(), + callback_function->Bind()); + + // The initial call upon registering will not happen as it's posted on the +diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h +index b56e8256924d..e1fa69650bbe 100644 +--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h ++++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h +@@ -1017,7 +1017,7 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, + + template <typename T> + IntRect GetTextureSourceSize(T* texture_source) { +- return IntRect(0, 0, texture_source->Width(), texture_source->Height()); ++ return IntRect(0, 0, texture_source->width(), texture_source->height()); + } + + template <typename T> +@@ -1031,8 +1031,8 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, + DCHECK(function_name); + DCHECK(selecting_sub_rectangle); + DCHECK(image); +- int image_width = static_cast<int>(image->Width()); +- int image_height = static_cast<int>(image->Height()); ++ int image_width = static_cast<int>(image->width()); ++ int image_height = static_cast<int>(image->height()); + *selecting_sub_rectangle = + !(sub_rect.X() == 0 && sub_rect.Y() == 0 && + sub_rect.Width() == image_width && sub_rect.Height() == image_height); +diff --git a/third_party/WebKit/Source/platform/ColorData.gperf b/third_party/WebKit/Source/platform/ColorData.gperf +index 6bbfb4b24e9a..d7fd2dbdc21c 100644 +--- a/third_party/WebKit/Source/platform/ColorData.gperf ++++ b/third_party/WebKit/Source/platform/ColorData.gperf +@@ -180,7 +180,7 @@ yellowgreen, 0xff9acd32 + #pragma clang diagnostic pop + #endif + +-const struct NamedColor* findColor(const char* str, unsigned len) { ++const struct NamedColor* FindColor(const char* str, unsigned len) { + return ColorDataHash::findColorImpl(str, len); + } + +diff --git a/third_party/WebKit/Source/platform/Cursor.h b/third_party/WebKit/Source/platform/Cursor.h +index 73e25713cfc0..4b9fe6dd117b 100644 +--- a/third_party/WebKit/Source/platform/Cursor.h ++++ b/third_party/WebKit/Source/platform/Cursor.h +@@ -32,6 +32,9 @@ + #include "wtf/Assertions.h" + #include "wtf/RefPtr.h" + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef CopyCursor ++ + namespace blink { + + class PLATFORM_EXPORT Cursor { +diff --git a/third_party/WebKit/Source/platform/fonts/Font.h b/third_party/WebKit/Source/platform/fonts/Font.h +index 4be370b79eab..dcb2cc2a0605 100644 +--- a/third_party/WebKit/Source/platform/fonts/Font.h ++++ b/third_party/WebKit/Source/platform/fonts/Font.h +@@ -41,6 +41,9 @@ + #include "platform/wtf/MathExtras.h" + #include "platform/wtf/text/CharacterNames.h" + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef DrawText ++ + namespace blink { + + struct CharacterRange; +diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp +index 5f83d92046b3..5e4cc32fa9a6 100644 +--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp ++++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp +@@ -461,16 +461,16 @@ const NodeType* GeometryMapper::LowestCommonAncestor(const NodeType* a, + // Explicitly instantiate the template for all supported types. This allows + // placing the template implementation in this .cpp file. See + // http://stackoverflow.com/a/488989 for more. +-template const EffectPaintPropertyNode* GeometryMapper::lowestCommonAncestor( ++template const EffectPaintPropertyNode* GeometryMapper::LowestCommonAncestor( + const EffectPaintPropertyNode*, + const EffectPaintPropertyNode*); +-template const TransformPaintPropertyNode* GeometryMapper::lowestCommonAncestor( ++template const TransformPaintPropertyNode* GeometryMapper::LowestCommonAncestor( + const TransformPaintPropertyNode*, + const TransformPaintPropertyNode*); +-template const ClipPaintPropertyNode* GeometryMapper::lowestCommonAncestor( ++template const ClipPaintPropertyNode* GeometryMapper::LowestCommonAncestor( + const ClipPaintPropertyNode*, + const ClipPaintPropertyNode*); +-template const ScrollPaintPropertyNode* GeometryMapper::lowestCommonAncestor( ++template const ScrollPaintPropertyNode* GeometryMapper::LowestCommonAncestor( + const ScrollPaintPropertyNode*, + const ScrollPaintPropertyNode*); + +diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp +index 42e697888294..74a849fa5f41 100644 +--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp ++++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp +@@ -108,23 +108,23 @@ const static float kTestEpsilon = 1e-6; + #define CHECK_MAPPINGS(inputRect, expectedVisualRect, expectedTransformedRect, \ + expectedTransformToAncestor, \ + expectedClipInAncestorSpace, localPropertyTreeState, \ +- ancestorPropertyTreeState, hasRadius) \ ++ ancestorPropertyTreeState) \ + do { \ + FloatClipRect float_rect(inputRect); \ + GeometryMapper::LocalToAncestorVisualRect( \ + localPropertyTreeState, ancestorPropertyTreeState, float_rect); \ + EXPECT_RECT_EQ(expectedVisualRect, float_rect.Rect()); \ +- EXPECT_EQ(hasRadius, float_rect.hasRadius()); \ ++ EXPECT_EQ(has_radius, float_rect.HasRadius()); \ + FloatClipRect float_clip_rect; \ + float_clip_rect = GeometryMapper::LocalToAncestorClipRect( \ + localPropertyTreeState, ancestorPropertyTreeState); \ +- EXPECT_EQ(hasRadius, float_clip_rect.hasRadius()); \ ++ EXPECT_EQ(has_radius, float_clip_rect.HasRadius()); \ + EXPECT_CLIP_RECT_EQ(expectedClipInAncestorSpace, float_clip_rect); \ + float_rect.SetRect(inputRect); \ + GeometryMapper::SourceToDestinationVisualRect( \ + localPropertyTreeState, ancestorPropertyTreeState, float_rect); \ + EXPECT_RECT_EQ(expectedVisualRect, float_rect.Rect()); \ +- EXPECT_EQ(hasRadius, float_rect.hasRadius()); \ ++ EXPECT_EQ(has_radius, float_rect.HasRadius()); \ + FloatRect test_mapped_rect = inputRect; \ + GeometryMapper::LocalToAncestorRect(localPropertyTreeState.Transform(), \ + ancestorPropertyTreeState.Transform(), \ +@@ -149,10 +149,10 @@ const static float kTestEpsilon = 1e-6; + DCHECK(output_clip_for_testing); \ + EXPECT_EQ(expectedClipInAncestorSpace, *output_clip_for_testing) \ + << "expected: " << expectedClipInAncestorSpace.Rect().ToString() \ +- << " (hasRadius: " << expectedClipInAncestorSpace.hasRadius() \ ++ << " (hasRadius: " << expectedClipInAncestorSpace.HasRadius() \ + << ") " \ + << "actual: " << output_clip_for_testing->Rect().ToString() \ +- << " (hasRadius: " << output_clip_for_testing->hasRadius() << ")"; \ ++ << " (hasRadius: " << output_clip_for_testing->HasRadius() << ")"; \ + } \ + } while (false) + +@@ -162,8 +162,7 @@ TEST_F(GeometryMapperTest, Root) { + bool has_radius = false; + CHECK_MAPPINGS(input, input, input, + TransformPaintPropertyNode::Root()->Matrix(), FloatClipRect(), +- PropertyTreeState::Root(), PropertyTreeState::Root(), +- Has_radius); ++ PropertyTreeState::Root(), PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, IdentityTransform) { +@@ -178,7 +177,7 @@ TEST_F(GeometryMapperTest, IdentityTransform) { + + bool has_radius = false; + CHECK_MAPPINGS(input, input, input, transform->Matrix(), FloatClipRect(), +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, TranslationTransform) { +@@ -195,7 +194,7 @@ TEST_F(GeometryMapperTest, TranslationTransform) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, transform->Matrix(), FloatClipRect(), +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + + GeometryMapper::AncestorToLocalRect(TransformPaintPropertyNode::Root(), + local_state.Transform(), output); +@@ -218,7 +217,7 @@ TEST_F(GeometryMapperTest, RotationAndScaleTransform) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, transform_matrix, FloatClipRect(), +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, RotationAndScaleTransformWithTransformOrigin) { +@@ -238,7 +237,7 @@ TEST_F(GeometryMapperTest, RotationAndScaleTransformWithTransformOrigin) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, transform_matrix, FloatClipRect(), +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, NestedTransforms) { +@@ -263,7 +262,7 @@ TEST_F(GeometryMapperTest, NestedTransforms) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, final, FloatClipRect(), local_state, +- PropertyTreeState::Root(), Has_radius); ++ PropertyTreeState::Root()); + + // Check the cached matrix for the intermediate transform. + EXPECT_EQ(rotate_transform, *GetTransform(transform1.Get(), +@@ -293,7 +292,7 @@ TEST_F(GeometryMapperTest, NestedTransformsFlattening) { + FloatRect output = final.MapRect(input); + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, final, FloatClipRect(), local_state, +- PropertyTreeState::Root(), Has_radius); ++ PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, NestedTransformsScaleAndTranslation) { +@@ -320,7 +319,7 @@ TEST_F(GeometryMapperTest, NestedTransformsScaleAndTranslation) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, final, FloatClipRect(), local_state, +- PropertyTreeState::Root(), Has_radius); ++ PropertyTreeState::Root()); + + // Check the cached matrix for the intermediate transform. + EXPECT_EQ(scale_transform, *GetTransform(transform1.Get(), +@@ -351,7 +350,7 @@ TEST_F(GeometryMapperTest, NestedTransformsIntermediateDestination) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, output, scale_transform, FloatClipRect(), +- local_state, intermediate_state, Has_radius); ++ local_state, intermediate_state); + } + + TEST_F(GeometryMapperTest, SimpleClip) { +@@ -373,7 +372,7 @@ TEST_F(GeometryMapperTest, SimpleClip) { + ->Matrix(), // Transform matrix to ancestor space + FloatClipRect(clip->ClipRect().Rect()), // Clip rect in + // ancestor space +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, RoundedClip) { +@@ -399,7 +398,7 @@ TEST_F(GeometryMapperTest, RoundedClip) { + TransformPaintPropertyNode::Root() + ->Matrix(), // Transform matrix to ancestor space + expected_clip, // Clip rect in ancestor space +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, TwoClips) { +@@ -434,7 +433,7 @@ TEST_F(GeometryMapperTest, TwoClips) { + ->Matrix(), // Transform matrix to ancestor space + clip_rect, // Clip rect in ancestor space + local_state, +- ancestor_state, Has_radius); ++ ancestor_state); + + ancestor_state.SetClip(clip1.Get()); + FloatRect output2(10, 10, 50, 50); +@@ -449,7 +448,7 @@ TEST_F(GeometryMapperTest, TwoClips) { + TransformPaintPropertyNode::Root() + ->Matrix(), // Transform matrix to ancestor space + clip_rect2, // Clip rect in ancestor space +- local_state, ancestor_state, Has_radius); ++ local_state, ancestor_state); + } + + TEST_F(GeometryMapperTest, TwoClipsTransformAbove) { +@@ -487,7 +486,7 @@ TEST_F(GeometryMapperTest, TwoClipsTransformAbove) { + ->Matrix(), // Transform matrix to ancestor space + expected_clip, // Clip rect in ancestor space + local_state, +- ancestor_state, Has_radius); ++ ancestor_state); + + expected_clip.SetRect(clip1->ClipRect().Rect()); + local_state.SetClip(clip1.Get()); +@@ -499,7 +498,7 @@ TEST_F(GeometryMapperTest, TwoClipsTransformAbove) { + ->Matrix(), // Transform matrix to ancestor space + expected_clip, // Clip rect in ancestor space + local_state, +- ancestor_state, Has_radius); ++ ancestor_state); + } + + TEST_F(GeometryMapperTest, ClipBeforeTransform) { +@@ -530,7 +529,7 @@ TEST_F(GeometryMapperTest, ClipBeforeTransform) { + rotate_transform, // Transform matrix to ancestor space + FloatClipRect(rotate_transform.MapRect( + clip->ClipRect().Rect())), // Clip rect in ancestor space +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, ClipAfterTransform) { +@@ -560,7 +559,7 @@ TEST_F(GeometryMapperTest, ClipAfterTransform) { + rotate_transform.MapRect(input), // Transformed rect (not clipped) + rotate_transform, // Transform matrix to ancestor space + FloatClipRect(clip->ClipRect().Rect()), // Clip rect in ancestor space +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, TwoClipsWithTransformBetween) { +@@ -595,7 +594,7 @@ TEST_F(GeometryMapperTest, TwoClipsWithTransformBetween) { + rotate_transform.MapRect(input), // Transformed rect (not clipped) + rotate_transform, // Transform matrix to ancestor space + FloatClipRect(clip1->ClipRect().Rect()), // Clip rect in ancestor space +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + { +@@ -621,7 +620,7 @@ TEST_F(GeometryMapperTest, TwoClipsWithTransformBetween) { + rotate_transform.MapRect(input), // Transformed rect (not clipped) + rotate_transform, // Transform matrix to ancestor space + FloatClipRect(mapped_clip), // Clip rect in ancestor space +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + } + +@@ -844,7 +843,7 @@ TEST_F(GeometryMapperTest, FilterWithClipsAndTransforms) { + transform_above_effect->Matrix() * transform_below_effect->Matrix(); + CHECK_MAPPINGS(input, output, FloatRect(0, 0, 300, 300), combined_transform, + FloatClipRect(FloatRect(30, 30, 270, 270)), local_state, +- PropertyTreeState::Root(), Has_radius); ++ PropertyTreeState::Root()); + } + + TEST_F(GeometryMapperTest, ReflectionWithPaintOffset) { +@@ -866,7 +865,7 @@ TEST_F(GeometryMapperTest, ReflectionWithPaintOffset) { + + bool has_radius = false; + CHECK_MAPPINGS(input, output, input, TransformationMatrix(), FloatClipRect(), +- local_state, PropertyTreeState::Root(), Has_radius); ++ local_state, PropertyTreeState::Root()); + } + + } // namespace blink +diff --git a/third_party/WebKit/Source/platform/graphics/paint/Transform3DDisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/Transform3DDisplayItem.h +index cab430ff6902..cce437517d11 100644 +--- a/third_party/WebKit/Source/platform/graphics/paint/Transform3DDisplayItem.h ++++ b/third_party/WebKit/Source/platform/graphics/paint/Transform3DDisplayItem.h +@@ -65,7 +65,7 @@ class PLATFORM_EXPORT EndTransform3DDisplayItem final + private: + #if DCHECK_IS_ON() + bool IsEndAndPairedWith(DisplayItem::Type other_type) const final { +- return DisplayItem::transform3DTypeToEndTransform3DType(other_type) == ++ return DisplayItem::Transform3DTypeToEndTransform3DType(other_type) == + GetType(); + } + #endif +diff --git a/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp b/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp +index 05254db57f83..fa57166259d0 100644 +--- a/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp ++++ b/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.cpp +@@ -363,11 +363,11 @@ void DrawPlatformFocusRing(const PrimitiveType& primitive, + #endif + } + +-template void PLATFORM_EXPORT drawPlatformFocusRing<SkRect>(const SkRect&, ++template void PLATFORM_EXPORT DrawPlatformFocusRing<SkRect>(const SkRect&, + PaintCanvas*, + SkColor, + float width); +-template void PLATFORM_EXPORT drawPlatformFocusRing<SkPath>(const SkPath&, ++template void PLATFORM_EXPORT DrawPlatformFocusRing<SkPath>(const SkPath&, + PaintCanvas*, + SkColor, + float width); +diff --git a/third_party/WebKit/Source/platform/heap/BlinkGC.h b/third_party/WebKit/Source/platform/heap/BlinkGC.h +index 75b64328d42d..e31efb9f6a76 100644 +--- a/third_party/WebKit/Source/platform/heap/BlinkGC.h ++++ b/third_party/WebKit/Source/platform/heap/BlinkGC.h +@@ -48,8 +48,10 @@ using MovingObjectCallback = void (*)(void* callback_data, + #define FOR_EACH_TYPED_ARENA(H) \ + H(Node) \ + H(CSSValue) ++ /* DO NOT SUBMIT - Conflict resolution helper: ++ * Important to have CSSValue and Node rather than kCSSValue or kNode above */ + +-#define TypedArenaEnumName(Type) Type##ArenaIndex, ++#define TypedArenaEnumName(Type) k##Type##ArenaIndex, + + class PLATFORM_EXPORT BlinkGC final { + STATIC_ONLY(BlinkGC); +diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp +index c5d6e9e3df05..071a06ccb1d3 100644 +--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp ++++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp +@@ -722,7 +722,7 @@ class IntNode : public GarbageCollected<IntNode> { + ThreadState* state = ThreadState::Current(); + const char* type_name = WTF_HEAP_PROFILER_TYPE_NAME(IntNode); + return ThreadHeap::AllocateOnArenaIndex( +- state, size, BlinkGC::NodeArenaIndex, GCInfoTrait<IntNode>::Index(), ++ state, size, BlinkGC::kNodeArenaIndex, GCInfoTrait<IntNode>::Index(), + type_name); + } + +diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp +index d9a3a4c8d0c2..b526834d3d86 100644 +--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp ++++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp +@@ -1031,7 +1031,7 @@ void ThreadState::PostSweep() { + time_for_sweep_histogram.Count(accumulated_sweeping_time_); + + #define COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(GCReason) \ +- case BlinkGC::GCReason: { \ ++ case BlinkGC::k##GCReason: { \ + DEFINE_STATIC_LOCAL(CustomCountHistogram, histogram, \ + ("BlinkGC.CollectionRate_" #GCReason, 1, 100, 20)); \ + histogram.Count(static_cast<int>(100 * collection_rate)); \ +@@ -1039,12 +1039,12 @@ void ThreadState::PostSweep() { + } + + switch (heap_->LastGCReason()) { +- COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(kIdleGC) +- COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(kPreciseGC) +- COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(kConservativeGC) +- COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(kForcedGC) +- COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(kMemoryPressureGC) +- COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(kPageNavigationGC) ++ COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(IdleGC) ++ COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(PreciseGC) ++ COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(ConservativeGC) ++ COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(ForcedGC) ++ COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(MemoryPressureGC) ++ COUNT_COLLECTION_RATE_HISTOGRAM_BY_GC_REASON(PageNavigationGC) + default: + break; + } +@@ -1357,11 +1357,11 @@ void ThreadState::TakeSnapshot(SnapshotType type) { + number_of_heaps_reported++; \ + switch (type) { \ + case SnapshotType::kHeapSnapshot: \ +- arenas_[BlinkGC::ArenaType##ArenaIndex]->TakeSnapshot( \ ++ arenas_[BlinkGC::k##ArenaType##ArenaIndex]->TakeSnapshot( \ + heaps_dump_name + "/" #ArenaType, info); \ + break; \ + case SnapshotType::kFreelistSnapshot: \ +- arenas_[BlinkGC::ArenaType##ArenaIndex]->TakeFreelistSnapshot( \ ++ arenas_[BlinkGC::k##ArenaType##ArenaIndex]->TakeFreelistSnapshot( \ + heaps_dump_name + "/" #ArenaType); \ + break; \ + default: \ +@@ -1369,6 +1369,8 @@ void ThreadState::TakeSnapshot(SnapshotType type) { + } \ + } + ++ /* DO NOT SUBMIT - Conflict resolution helper: ++ * Important to use NormalPage instead of kNormalPage1 below */ + SNAPSHOT_HEAP(NormalPage1); + SNAPSHOT_HEAP(NormalPage2); + SNAPSHOT_HEAP(NormalPage3); +@@ -1381,6 +1383,8 @@ void ThreadState::TakeSnapshot(SnapshotType type) { + SNAPSHOT_HEAP(InlineVector); + SNAPSHOT_HEAP(HashTable); + SNAPSHOT_HEAP(LargeObject); ++ /* DO NOT SUBMIT - Conflict resolution helper: ++ * Important to use LargeObject instead of kLargeObject above */ + FOR_EACH_TYPED_ARENA(SNAPSHOT_HEAP); + + ASSERT(number_of_heaps_reported == BlinkGC::kNumberOfArenas); +diff --git a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm.S b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm.S +index 4e2f9912c953..af961fe1a5d5 100644 +--- a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm.S ++++ b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm.S +@@ -31,12 +31,12 @@ + + /* + * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*); +- * extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) ++ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) + */ + +-.type pushAllRegisters, %function +-.global pushAllRegisters +-.hidden pushAllRegisters ++.type PushAllRegisters, %function ++.global PushAllRegisters ++.hidden PushAllRegisters + #ifdef __thumb__ + /* In THUMB Mode jump to ARM stub via bx to ensure CPU mode switch. + * FIXME: This trampoline is provided to workaround bugs in +@@ -46,7 +46,7 @@ + .align 2 + .code 16 + .thumb_func +-pushAllRegisters: ++PushAllRegisters: + adr r3, pushAllRegistersARM + bx r3 + +@@ -59,7 +59,7 @@ pushAllRegistersARM: + /* ARM Mode */ + .align 4 + .code 32 +-pushAllRegisters: ++PushAllRegisters: + #endif + /* Push all callee-saved registers and save return address. */ + push {r4-r11, lr} +diff --git a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm64.S b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm64.S +index 7bb988d0d153..a6f31555e6f4 100644 +--- a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm64.S ++++ b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_arm64.S +@@ -31,13 +31,13 @@ + + /* + * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*); +- * extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) ++ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) + */ + +-.type pushAllRegisters, %function +-.global pushAllRegisters +-.hidden pushAllRegisters +-pushAllRegisters: ++.type PushAllRegisters, %function ++.global PushAllRegisters ++.hidden PushAllRegisters ++PushAllRegisters: + /* Save return address. */ + sub sp, sp, #96 + stp x19, x20, [sp, #80] +diff --git a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips.S b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips.S +index 820209fbc022..f2b22bda65fd 100644 +--- a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips.S ++++ b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips.S +@@ -31,13 +31,13 @@ + + /* + * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*); +- * extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) ++ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) + */ + +-.type pushAllRegisters, %function +-.global pushAllRegisters +-.hidden pushAllRegisters +-pushAllRegisters: ++.type PushAllRegisters, %function ++.global PushAllRegisters ++.hidden PushAllRegisters ++PushAllRegisters: + // Reserve space for callee-saved registers, return address, + // as well as for the callee arguments. + addiu $sp,$sp,-56 +diff --git a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips64.S b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips64.S +index 2805b5c4336a..71d04553403e 100644 +--- a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips64.S ++++ b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_mips64.S +@@ -4,13 +4,13 @@ + + /* + * typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*); +- * extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) ++ * extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) + */ + +-.type pushAllRegisters, %function +-.global pushAllRegisters +-.hidden pushAllRegisters +-pushAllRegisters: ++.type PushAllRegisters, %function ++.global PushAllRegisters ++.hidden PushAllRegisters ++PushAllRegisters: + // Push all callee-saves registers to get them + // on the stack for conservative stack scanning. + // Reserve space for callee-saved registers and return address. +diff --git a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_x86.asm b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_x86.asm +index 35fa2c978e7c..8374167f880d 100644 +--- a/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_x86.asm ++++ b/third_party/WebKit/Source/platform/heap/asm/SaveRegisters_x86.asm +@@ -65,13 +65,13 @@ + %endif + + ;; typedef void (*PushAllRegistersCallback)(SafePointBarrier*, ThreadState*, intptr_t*); +-;; extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) ++;; extern "C" void PushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegistersCallback) + +- global mangle(pushAllRegisters) PRIVATE ++ global mangle(PushAllRegisters) PRIVATE + + %if X64POSIX + +-mangle(pushAllRegisters): ++mangle(PushAllRegisters): + ;; Push all callee-saves registers to get them + ;; on the stack for conservative stack scanning. + ;; We maintain 16-byte alignment at calls (required on Mac). +@@ -98,7 +98,7 @@ mangle(pushAllRegisters): + + %elif X64WIN + +-mangle(pushAllRegisters): ++mangle(PushAllRegisters): + ;; Push all callee-saves registers to get them + ;; on the stack for conservative stack scanning. + ;; There is an 8-byte return address on the stack and we push +@@ -126,7 +126,7 @@ mangle(pushAllRegisters): + + %elif IA32 + +-mangle(pushAllRegisters): ++mangle(PushAllRegisters): + ;; Push all callee-saves registers to get them + ;; on the stack for conservative stack scanning. + ;; We maintain 16-byte alignment at calls (required on +diff --git a/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoderTest.cpp b/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoderTest.cpp +index e7e8e359e9b3..58565098ca2c 100644 +--- a/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoderTest.cpp ++++ b/third_party/WebKit/Source/platform/image-encoders/JPEGImageEncoderTest.cpp +@@ -35,10 +35,11 @@ TEST_F(RGBAtoRGBTest, testOpaqueCaseEven8pixels) { + + unsigned char expected[] = {255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0, 0, 0, + 255, 0, 0, 255, 0, 0, 255, 0, 0, 255, 0}; ++ // TODO(dcheng): Make this all constexpr. + #if OS(WIN) + // Windows release bot can't be reasoned with (compiler error C2131). +- static const constexpr size_t kPixels = sizeof(canvas) / kChannelsRGBA; +- static const constexpr size_t kRgbSize = kPixels * kChannelsRGB; ++ static const constexpr size_t pixels = sizeof(canvas) / kChannelsRGBA; ++ static const constexpr size_t rgb_size = pixels * kChannelsRGB; + #else + const size_t pixels = CalculateRGBAPixels(sizeof(canvas)); + const size_t rgb_size = CalculateRGBOutputSize(sizeof(canvas)); +@@ -47,7 +48,7 @@ TEST_F(RGBAtoRGBTest, testOpaqueCaseEven8pixels) { + unsigned char output[rgb_size]; + memset(output, 0, rgb_size); + +- blink::RGBAtoRGB(canvas, static_cast<unsigned>(kPixels), output); ++ blink::RGBAtoRGB(canvas, static_cast<unsigned>(pixels), output); + + EXPECT_EQ(memcmp(expected, output, rgb_size), 0); + } +diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.h b/third_party/WebKit/Source/platform/loader/fetch/Resource.h +index 24bd426833e6..2f7cc0fe071a 100644 +--- a/third_party/WebKit/Source/platform/loader/fetch/Resource.h ++++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.h +@@ -499,10 +499,10 @@ class ResourceFactory { + Resource::Type type_; + }; + +-#define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ +- DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ +- resource->GetType() == Resource::typeName, \ +- resource.GetType() == Resource::typeName); ++#define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ ++ DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ ++ resource->GetType() == Resource::k##typeName, \ ++ resource.GetType() == Resource::k##typeName); + + } // namespace blink + +diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp +index aa70c1cc6112..cc5a5814a797 100644 +--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp ++++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp +@@ -69,7 +69,7 @@ enum SriResourceIntegrityMismatchEvent { + }; + + #define DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, name) \ +- case Resource::name: { \ ++ case Resource::k##name: { \ + DEFINE_THREAD_SAFE_STATIC_LOCAL( \ + EnumerationHistogram, resource_histogram, \ + new EnumerationHistogram( \ +@@ -79,21 +79,21 @@ enum SriResourceIntegrityMismatchEvent { + } + + #define DEFINE_RESOURCE_HISTOGRAM(prefix) \ +- switch (factory.GetType()) { \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kCSSStyleSheet) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kFont) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kImage) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kImportResource) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kLinkPrefetch) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kMainResource) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kManifest) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kMedia) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kMock) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kRaw) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kScript) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kSVGDocument) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kTextTrack) \ +- DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, kXSLStyleSheet) \ ++ switch (factory.GetType()) { \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, CSSStyleSheet) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Font) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Image) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, ImportResource) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, LinkPrefetch) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, MainResource) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Manifest) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Media) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Mock) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Raw) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, Script) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, SVGDocument) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, TextTrack) \ ++ DEFINE_SINGLE_RESOURCE_HISTOGRAM(prefix, XSLStyleSheet) \ + } + + void AddRedirectsToTimingInfo(Resource* resource, ResourceTimingInfo* info) { +diff --git a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp +index 716c26cc11d0..0669e5002f8f 100644 +--- a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp ++++ b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp +@@ -167,7 +167,7 @@ const UChar* ParseSuboriginName(const UChar* begin, + + const UChar* position = begin; + +- if (!skipExactly<UChar, isASCIILower>(position, end)) { ++ if (!skipExactly<UChar, IsASCIILower>(position, end)) { + messages.push_back("Invalid character \'" + String(position, 1) + + "\' in suborigin. First character must be a lower case " + "alphabetic character."); +@@ -769,7 +769,7 @@ bool ParseSuboriginHeader(const String& header, + const UChar* position = characters.Data(); + const UChar* end = position + characters.size(); + +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + + String name; + position = ParseSuboriginName(position, end, name, messages); +@@ -782,7 +782,7 @@ bool ParseSuboriginHeader(const String& header, + suborigin->SetName(name); + + while (position < end) { +- skipWhile<UChar, isASCIISpace>(position, end); ++ skipWhile<UChar, IsASCIISpace>(position, end); + if (position == end) + return true; + +diff --git a/third_party/WebKit/Source/platform/text/CharacterPropertyDataGenerator.cpp b/third_party/WebKit/Source/platform/text/CharacterPropertyDataGenerator.cpp +index 9b4bd1f2af06..55c4d36e8c21 100644 +--- a/third_party/WebKit/Source/platform/text/CharacterPropertyDataGenerator.cpp ++++ b/third_party/WebKit/Source/platform/text/CharacterPropertyDataGenerator.cpp +@@ -54,8 +54,8 @@ static void GenerateUTrieSerialized(FILE* fp, int32_t size, uint8_t* array) { + fprintf(fp, + "#include <cstdint>\n\n" + "namespace blink {\n\n" +- "extern const int32_t serializedCharacterDataSize = %d;\n" +- "extern const uint8_t serializedCharacterData[] = {", ++ "extern const int32_t kSerializedCharacterDataSize = %d;\n" ++ "extern const uint8_t kSerializedCharacterData[] = {", + size); + for (int32_t i = 0; i < size;) { + fprintf(fp, "\n "); +diff --git a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp +index b140636fef7b..15584d38b78b 100644 +--- a/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp ++++ b/third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp +@@ -85,7 +85,7 @@ OriginAccessEntry::OriginAccessEntry(const String& protocol, + ASSERT(subdomain_setting >= kAllowSubdomains || + subdomain_setting <= kDisallowSubdomains); + +- host_is_ip_address_ = HostIsIPAddress(host); ++ host_is_ip_address_ = blink::HostIsIPAddress(host); + + // Look for top-level domains, either with or without an additional dot. + if (!host_is_ip_address_) { +diff --git a/third_party/WebKit/Source/platform/wtf/ASCIICType.h b/third_party/WebKit/Source/platform/wtf/ASCIICType.h +index 9d38fc9f6400..8361a8f22705 100644 +--- a/third_party/WebKit/Source/platform/wtf/ASCIICType.h ++++ b/third_party/WebKit/Source/platform/wtf/ASCIICType.h +@@ -87,7 +87,7 @@ inline bool IsASCIIPrintable(CharType c) { + } + + /* +- Statistics from a run of Apple's page load test for callers of isASCIISpace: ++ Statistics from a run of Apple's page load test for callers of IsASCIISpace: + + character count + --------- ----- +diff --git a/third_party/WebKit/Source/platform/wtf/RetainPtr.h b/third_party/WebKit/Source/platform/wtf/RetainPtr.h +index 2eb497f52d9f..1322eb2a1832 100644 +--- a/third_party/WebKit/Source/platform/wtf/RetainPtr.h ++++ b/third_party/WebKit/Source/platform/wtf/RetainPtr.h +@@ -293,14 +293,6 @@ inline RetainPtr<T> AdoptNS(T o) { + return RetainPtr<T>(kAdoptNS, o); + } + +-// Helper function for creating a RetainPtr using template argument deduction. +-template <typename T> +-WARN_UNUSED_RESULT inline RetainPtr<T> RetainPtr(T); +-template <typename T> +-inline RetainPtr<T> RetainPtr(T o) { +- return RetainPtr<T>(o); +-} +- + template <typename T> + struct HashTraits<RetainPtr<T>> : SimpleClassHashTraits<RetainPtr<T>> {}; + +@@ -336,6 +328,5 @@ using WTF::kAdoptNS; + using WTF::AdoptCF; + using WTF::AdoptNS; + using WTF::RetainPtr; +-using WTF::RetainPtr; + + #endif // WTF_RetainPtr_h +diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp b/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp +index 4ede6071cd55..da8757354fbb 100644 +--- a/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp ++++ b/third_party/WebKit/Source/platform/wtf/text/StringImpl.cpp +@@ -104,7 +104,7 @@ static void fillWithSnippet(const StringImpl* string, Vector<char>& snippet) { + size_t i; + for (i = 0; i < string->length() && i < kMaxSnippetLength; ++i) { + UChar c = (*string)[i]; +- if (isASCIIPrintable(c)) ++ if (IsASCIIPrintable(c)) + snippet.append(c); + else + snippet.append('?'); +diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h +index 5ee41f295263..be9864e4c047 100644 +--- a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h ++++ b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h +@@ -825,7 +825,7 @@ static inline int CodePointCompare(const StringImpl* string1, + } + + static inline bool IsSpaceOrNewline(UChar c) { +- // Use isASCIISpace() for basic Latin-1. ++ // Use IsASCIISpace() for basic Latin-1. + // This will include newlines, which aren't included in Unicode DirWS. + return c <= 0x7F + ? WTF::IsASCIISpace(c) +diff --git a/third_party/WebKit/Source/web/WebPagePopupImpl.h b/third_party/WebKit/Source/web/WebPagePopupImpl.h +index ea3cd4a01296..38f21b310965 100644 +--- a/third_party/WebKit/Source/web/WebPagePopupImpl.h ++++ b/third_party/WebKit/Source/web/WebPagePopupImpl.h +@@ -36,6 +36,9 @@ + #include "public/web/WebPagePopup.h" + #include "web/PageWidgetDelegate.h" + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef PostMessage ++ + namespace blink { + + class CompositorAnimationHost; +diff --git a/third_party/WebKit/Source/web/WebSettingsImpl.cpp b/third_party/WebKit/Source/web/WebSettingsImpl.cpp +index 79d6c3f1ca9d..451f22e94867 100644 +--- a/third_party/WebKit/Source/web/WebSettingsImpl.cpp ++++ b/third_party/WebKit/Source/web/WebSettingsImpl.cpp +@@ -62,7 +62,7 @@ WebSettingsImpl::WebSettingsImpl(Settings* settings, + + void WebSettingsImpl::SetFromStrings(const WebString& name, + const WebString& value) { +- settings_->SetFromStrings(name, value); ++ settings_->setFromStrings(name, value); + } + + void WebSettingsImpl::SetStandardFontFamily(const WebString& font, +diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py +index 0872b56b1b83..bc274c0eba49 100644 +--- a/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py ++++ b/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/cpp.py +@@ -2828,37 +2828,8 @@ def check_identifier_name_in_declaration(filename, line_number, line, file_state + + is_function_arguments = is_function_arguments or character_after_identifier == '(' + +- # Remove "m_" and "s_" to allow them. +- modified_identifier = sub(r'(^|(?<=::))[ms]_', '', identifier) +- if not file_state.is_objective_c() and modified_identifier.find('_') >= 0: +- # Various exceptions to the rule: JavaScript op codes functions, const_iterator. +- if (not (filename.find('JavaScriptCore') >= 0 and modified_identifier.find('op_') >= 0) +- and not (filename.find('gtk') >= 0 and modified_identifier.startswith('webkit_') >= 0) +- and not (filename.find('StructTraits.h') >= 0) +- and not modified_identifier.startswith('tst_') +- and not modified_identifier.startswith('webkit_dom_object_') +- and not modified_identifier.startswith('webkit_soup') +- and not modified_identifier.startswith('NPN_') +- and not modified_identifier.startswith('NPP_') +- and not modified_identifier.startswith('NP_') +- and not modified_identifier.startswith('qt_') +- and not modified_identifier.startswith('_q_') +- and not modified_identifier.startswith('cairo_') +- and not modified_identifier.startswith('Ecore_') +- and not modified_identifier.startswith('Eina_') +- and not modified_identifier.startswith('Evas_') +- and not modified_identifier.startswith('Ewk_') +- and not modified_identifier.startswith('cti_') +- and not modified_identifier.find('::qt_') >= 0 +- and not modified_identifier.find('::_q_') >= 0 +- and not modified_identifier == 'const_iterator' +- and not modified_identifier == 'vm_throw' +- and not modified_identifier == 'DFG_OPERATION'): +- error(line_number, 'readability/naming/underscores', 4, identifier + +- " is incorrectly named. Don't use underscores in your identifier names.") +- + # Check for variables named 'l', these are too easy to confuse with '1' in some fonts +- if modified_identifier == 'l': ++ if identifier == 'l': + error(line_number, 'readability/naming', 4, identifier + + " is incorrectly named. Don't use the single letter 'l' as an identifier name.") + +diff --git a/third_party/WebKit/public/platform/WebData.h b/third_party/WebKit/public/platform/WebData.h +index 6bed5f7a0cfd..70f9d425336d 100644 +--- a/third_party/WebKit/public/platform/WebData.h ++++ b/third_party/WebKit/public/platform/WebData.h +@@ -83,12 +83,12 @@ class BLINK_PLATFORM_EXPORT WebData { + #else + template <class C> + WebData(const C& c) { +- Assign(c.Data(), c.size()); ++ Assign(c.data(), c.size()); + } + + template <class C> + WebData& operator=(const C& c) { +- Assign(c.Data(), c.size()); ++ Assign(c.data(), c.size()); + return *this; + } + #endif +diff --git a/third_party/WebKit/public/platform/WebFont.h b/third_party/WebKit/public/platform/WebFont.h +index b39db27692cf..864dcc9ce558 100644 +--- a/third_party/WebKit/public/platform/WebFont.h ++++ b/third_party/WebKit/public/platform/WebFont.h +@@ -10,6 +10,9 @@ + #include "WebCommon.h" + #include <memory> + ++// To avoid conflicts with the CreateWindow macro from the Windows SDK... ++#undef DrawText ++ + namespace blink { + + struct WebFloatPoint; +diff --git a/third_party/WebKit/public/platform/WebInputEvent.h b/third_party/WebKit/public/platform/WebInputEvent.h +index 44fc8f300a49..e162d8c88f28 100644 +--- a/third_party/WebKit/public/platform/WebInputEvent.h ++++ b/third_party/WebKit/public/platform/WebInputEvent.h +@@ -310,43 +310,43 @@ class WebInputEvent { + + static const char* GetName(WebInputEvent::Type type) { + #define CASE_TYPE(t) \ +- case WebInputEvent::t: \ ++ case WebInputEvent::k##t: \ + return #t + switch (type) { +- CASE_TYPE(kUndefined); +- CASE_TYPE(kMouseDown); +- CASE_TYPE(kMouseUp); +- CASE_TYPE(kMouseMove); +- CASE_TYPE(kMouseEnter); +- CASE_TYPE(kMouseLeave); +- CASE_TYPE(kContextMenu); +- CASE_TYPE(kMouseWheel); +- CASE_TYPE(kRawKeyDown); +- CASE_TYPE(kKeyDown); +- CASE_TYPE(kKeyUp); +- CASE_TYPE(kChar); +- CASE_TYPE(kGestureScrollBegin); +- CASE_TYPE(kGestureScrollEnd); +- CASE_TYPE(kGestureScrollUpdate); +- CASE_TYPE(kGestureFlingStart); +- CASE_TYPE(kGestureFlingCancel); +- CASE_TYPE(kGestureShowPress); +- CASE_TYPE(kGestureTap); +- CASE_TYPE(kGestureTapUnconfirmed); +- CASE_TYPE(kGestureTapDown); +- CASE_TYPE(kGestureTapCancel); +- CASE_TYPE(kGestureDoubleTap); +- CASE_TYPE(kGestureTwoFingerTap); +- CASE_TYPE(kGestureLongPress); +- CASE_TYPE(kGestureLongTap); +- CASE_TYPE(kGesturePinchBegin); +- CASE_TYPE(kGesturePinchEnd); +- CASE_TYPE(kGesturePinchUpdate); +- CASE_TYPE(kTouchStart); +- CASE_TYPE(kTouchMove); +- CASE_TYPE(kTouchEnd); +- CASE_TYPE(kTouchCancel); +- CASE_TYPE(kTouchScrollStarted); ++ CASE_TYPE(Undefined); ++ CASE_TYPE(MouseDown); ++ CASE_TYPE(MouseUp); ++ CASE_TYPE(MouseMove); ++ CASE_TYPE(MouseEnter); ++ CASE_TYPE(MouseLeave); ++ CASE_TYPE(ContextMenu); ++ CASE_TYPE(MouseWheel); ++ CASE_TYPE(RawKeyDown); ++ CASE_TYPE(KeyDown); ++ CASE_TYPE(KeyUp); ++ CASE_TYPE(Char); ++ CASE_TYPE(GestureScrollBegin); ++ CASE_TYPE(GestureScrollEnd); ++ CASE_TYPE(GestureScrollUpdate); ++ CASE_TYPE(GestureFlingStart); ++ CASE_TYPE(GestureFlingCancel); ++ CASE_TYPE(GestureShowPress); ++ CASE_TYPE(GestureTap); ++ CASE_TYPE(GestureTapUnconfirmed); ++ CASE_TYPE(GestureTapDown); ++ CASE_TYPE(GestureTapCancel); ++ CASE_TYPE(GestureDoubleTap); ++ CASE_TYPE(GestureTwoFingerTap); ++ CASE_TYPE(GestureLongPress); ++ CASE_TYPE(GestureLongTap); ++ CASE_TYPE(GesturePinchBegin); ++ CASE_TYPE(GesturePinchEnd); ++ CASE_TYPE(GesturePinchUpdate); ++ CASE_TYPE(TouchStart); ++ CASE_TYPE(TouchMove); ++ CASE_TYPE(TouchEnd); ++ CASE_TYPE(TouchCancel); ++ CASE_TYPE(TouchScrollStarted); + default: + NOTREACHED(); + return "";
diff --git a/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/auto_squasher.py b/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/auto_squasher.py new file mode 100755 index 0000000..a9eb2f3f --- /dev/null +++ b/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/auto_squasher.py
@@ -0,0 +1,23 @@ +#!/usr/bin/env python +# Copyright 2017 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. +"""Simple utility to help squash multiple commits into one.""" + +import sys + + +def main(): + with open(sys.argv[1], 'r+') as f: + lines = f.readlines() + for i, line in enumerate(lines): + if i: + if line.startswith('pick '): + lines[i] = line.replace('pick ', 'squash ', 1) + f.seek(0) + f.truncate() + f.write('\n'.join(lines)) + + +if __name__ == '__main__': + sys.exit(main())
diff --git a/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/driver.py b/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/driver.py index 79b024f..7b8d1de 100644 --- a/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/driver.py +++ b/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/driver.py
@@ -2,9 +2,492 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import argparse +import hashlib +import json +import os +import shutil +import subprocess import sys +import tempfile + +_BEFORE_RENAME_COMMIT = '5e27d4b8d16d9830e52a44a44b4ff501a2a2e667' +_RENAME_COMMIT = '1c4d759e44259650dfb2c426a7f997d2d0bc73dc' +_AFTER_RENAME_COMMIT = 'b0bf8e8ed34ba40acece03baa19446a5d91b009d' +_DEVNULL = open(os.devnull, 'w') +_SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) +_GIT_CONFIG_BRANCH_RECORDS = 'branch.%s.blink-rename-resolver-records' +_GIT_ATTRIBUTES_PATH = os.path.join('.git', 'info', 'attributes') + + +class _MergeTool(object): + """Scoper object for using the Blink Rename merge driver helper.""" + + def __init__(self): + self.__attributes_backup = None + + def __enter__(self): + _check_call_git( + ['config', 'merge.blink-rename.name', 'blink rename merge helper']) + # Note: while it would be possible to encode the path to the records + # directory here, it's easier to pass it as an environmental variable, to + # avoid weird escaping issues. + _check_call_git([ + 'config', 'merge.blink-rename.driver', + '%s %%O %%A %%B %%P' % os.path.join(_SCRIPT_DIR, 'merge.py') + ]) + _check_call_git(['config', 'merge.blink-rename.recursive', 'binary']) + + if os.path.exists(_GIT_ATTRIBUTES_PATH): + filemode = 'r+' + else: + filemode = 'w' + with open(_GIT_ATTRIBUTES_PATH, filemode) as attributes_file: + if filemode == 'r+': + self.__attributes_backup = attributes_file.read() + attributes_file.seek(0) + attributes_file.truncate() + attributes_file.write('# Blink Rename merge helper\n') + attributes_file.write('*.cc merge=blink-rename\n') + attributes_file.write('*.cpp merge=blink-rename\n') + attributes_file.write('*.mm merge=blink-rename\n') + attributes_file.write('*.h merge=blink-rename\n') + + def __exit__(self, exc_type, exc_value, traceback): + _check_call_git(['config', '--remove-section', 'merge.blink-rename']) + if self.__attributes_backup: + try: + with open(_GIT_ATTRIBUTES_PATH, 'w') as attributes_file: + attributes_file.write(self.__attributes_backup) + except IOError: + print 'ERROR: Failed to restore original %s file' % _GIT_ATTRIBUTES_PATH + print ' Original contents:' + print self.__attributes_backup + else: + os.remove(_GIT_ATTRIBUTES_PATH) + + +def _call_gclient(args): + if sys.platform == 'win32': + args = ['gclient.bat'] + args + else: + args = ['gclient'] + args + return subprocess.call(args) + + +def _build_ninja_command(args): + if sys.platform == 'win32': + return ['ninja.exe'] + args + else: + return ['ninja'] + args + + +def _call_ninja_silently(args): + # Eat output, since only the return value is important. + return subprocess.call( + _build_ninja_command(args), stdout=_DEVNULL, stderr=_DEVNULL) + + +def _call_ninja(args): + return subprocess.call(_build_ninja_command(args)) + + +def _build_git_command(args): + if sys.platform == 'win32': + return ['git.bat'] + args + else: + return ['git'] + args + + +def _call_git(args, **kwargs): + return subprocess.call(_build_git_command(args), **kwargs) + + +def _check_call_git(args, **kwargs): + return subprocess.check_call(_build_git_command(args), **kwargs) + + +def _check_call_git_and_get_output(args, **kwargs): + return subprocess.check_output(_build_git_command(args), **kwargs) + + +def _check_call_python(args): + if sys.platform == 'win32': + args = ['python.exe'] + args + else: + args = ['python'] + args + return subprocess.check_call(args) + + +def _is_clean_tree(): + return _call_git(['diff-index', '--quiet', 'HEAD']) == 0 + + +def _ensure_clean_tree(): + if not _is_clean_tree(): + print 'ERROR: cannot proceed with a dirty tree. Please commit or stash ' + print ' changes.' + sys.exit(1) + + +def _get_branch_info(): + current_branch = _check_call_git_and_get_output( + ['rev-parse', '--symbolic-full-name', 'HEAD']).strip() + print 'INFO: current branch: %s' % current_branch + + tracking_branch = None + try: + tracking_branch = _check_call_git_and_get_output( + ['rev-parse', '--symbolic-full-name', 'HEAD@{upstream}']).strip() + except subprocess.CalledProcessError: + # Likely failed because there's no tracking branch info. Fall through and + # fail out. + pass + if not tracking_branch: + print 'ERROR: no tracking branch found. Bailing out...' + print ' If you want to track origin/master, then run:' + print ' git branch --set-upstream-to origin/master' + sys.exit(1) + + print 'INFO: tracking branch: %s' % tracking_branch + return current_branch, tracking_branch + + +def _commit_is_ancestor_of(ancestor, commit): + # merge-base --is-ancestor returns 0 if |ancestor| is the ancestor of + # |commit|. + return _call_git(['merge-base', '--is-ancestor', ancestor, commit]) == 0 + + +def _ensure_origin_contains_commit(): + if not _commit_is_ancestor_of(_RENAME_COMMIT, 'refs/remotes/origin/master'): + _check_call_git(['fetch', 'origin']) + + +def _prompt_yes_or_no(question, default='yes'): + choices = { + 'yes': True, + 'y': True, + 'no': False, + 'n': False, + } + assert default in choices + + if default == 'yes': + prompt = '[Y/n]' + elif default == 'no': + prompt = '[y/N]' + else: + prompt = '[y/n]' + + while True: + choice = raw_input('%s %s? ' % (question, prompt)).lower() + if default and not choice: + return choices[default] + elif choice in choices: + return choices[choice] + else: + print 'Please answer Yes or No.' + + +def _dump_edits_for_debugging(edits): + fd, debug_path = tempfile.mkstemp() + print 'INFO: dumping raw edits to %s' % debug_path + os.write(fd, edits) + os.close(fd) + + +def _prompt_for_squash(commits_in_branch): + print('WARNING: there are %d commits in branch that are not upstream.' % + commits_in_branch) + print ' Squashing into one commit is required to continue.' + if _prompt_yes_or_no('Automatically squash into one commit'): + auto_squasher = os.path.join(_SCRIPT_DIR, 'auto_squasher.py') + return _call_git( + ['rebase', '-i', 'HEAD~%d' % commits_in_branch], + env=dict(os.environ, + GIT_SEQUENCE_EDITOR='python %s' % auto_squasher)) == 0 + else: + sys.exit(1) + + +def _prepare_branch(current_branch, + tracking_branch, + build_dir, + jobs, + rebase=True): + if not build_dir: + print 'ERROR: the build directory must be specified with -C when running ' + print ' --prepare mode.' + sys.exit(1) + if not _commit_is_ancestor_of(_BEFORE_RENAME_COMMIT, tracking_branch): + print 'ERROR: tracking branch not prepared yet; run --prepare on tracking ' + print ' branch first.' + sys.exit(1) + if (tracking_branch != 'refs/remotes/origin/master' and + _commit_is_ancestor_of(_RENAME_COMMIT, tracking_branch)): + print 'ERROR: tracking branch already contains rename commit; bailing out ' + print ' since the tool cannot handle this automatically.' + sys.exit(1) + if _commit_is_ancestor_of(_RENAME_COMMIT, 'HEAD'): + print 'ERROR: current branch appears to already be updated.' + sys.exit(1) + + commits_in_branch = int( + _check_call_git_and_get_output([ + 'rev-list', '--left-only', '--count', 'HEAD...%s' % tracking_branch + ])) + if rebase and commits_in_branch != 1: + if _prompt_for_squash(commits_in_branch): + commits_in_branch = 1 + + update_args = [] + if rebase: + update_args.append('rebase') + else: + update_args.append('merge') + if tracking_branch == 'refs/remotes/origin/master': + update_args.append(_BEFORE_RENAME_COMMIT) + if _call_git(update_args) != 0: + print 'ERROR: failed to update branch to the commit before the rename.' + print ' Fix any conflicts and try running with --prepare again.' + sys.exit(1) + + if _call_gclient(['sync']): + print 'ERROR: gclient sync returned a non-zero exit code.' + print ' Please fix the errors and try running with --prepare again.' + sys.exit(1) + + changed_files = _check_call_git_and_get_output( + ['diff', '--name-only', + 'HEAD~%d' % commits_in_branch]).strip().split('\n') + # Filter changed files out to only the ones that still exist and that ninja + # knows about. + clang_scripts_dir = os.path.join('tools', 'clang', 'scripts') + _check_call_python( + [os.path.join(clang_scripts_dir, 'generate_compdb.py'), build_dir]) + with open(os.path.join(build_dir, 'compile_commands.json')) as f: + compile_db = json.loads(f.read()) + files_in_db = set([ + os.path.realpath(os.path.join(build_dir, entry['file'])) + for entry in compile_db + ]) + changed_buildable_files = [ + f for f in changed_files if os.path.realpath(f) in files_in_db + ] + + if not changed_buildable_files: + print 'INFO: This branch does not appear to change files that this script ' + print ' can help automatically rebase. Exiting...' + sys.exit(0) + + # 'touch' changed files to force a rebuild. + for f in changed_buildable_files: + os.utime(f, None) + + # -d keeprsp is only needed for Windows, but it doesn't hurt to have it + # elsewhere. + ninja_args = ['-C', build_dir, '-d', 'keeprsp'] + if jobs: + ninja_args.extend(['-j', jobs]) + # Source files are specified relative to the root of the build directory. + targets = [ + '%s^' % os.path.relpath(f, build_dir) for f in changed_buildable_files + ] + ninja_args.extend(targets) + if _call_ninja(ninja_args): + print 'ERROR: Cannot continue, ninja failed!' + sys.exit(1) + + staging_dir = os.path.abspath( + os.path.join(os.getcwd(), 'tools', 'blink_rename_merge_helper', + 'staging')) + blocklist_path = os.path.join(staging_dir, 'data', 'idl_blocklist.txt') + clang_tool_args = [ + 'python', os.path.join(clang_scripts_dir, 'run_tool.py'), + '--tool-args=--method-blocklist=%s' % blocklist_path, + 'rewrite_to_chrome_style', build_dir + ] + clang_tool_args.extend(changed_buildable_files) + clang_tool_output = subprocess.check_output( + clang_tool_args, + env=dict( + os.environ, + PATH='%s%s%s' % (os.path.join(staging_dir, 'bin'), os.pathsep, + os.environ['PATH']))) + + # Extract the edits from the clang tool's output. + p = subprocess.Popen( + ['python', os.path.join(clang_scripts_dir, 'extract_edits.py')], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE) + edits, dummy_stderr = p.communicate(input=clang_tool_output) + if p.returncode != 0: + print 'ERROR: extracting edits from clang tool output failed.' + sys.exit(1) + + _dump_edits_for_debugging(edits) + + # And apply them. Note this this intentionally uses changed_files instead of + # changed_buildable_files, as changes to header files, etc should also be + # recorded. + p = subprocess.Popen( + ['python', os.path.join(clang_scripts_dir, 'apply_edits.py'), build_dir] + + changed_files, + stdin=subprocess.PIPE) + p.communicate(input=edits) + if p.returncode != 0: + print 'WARNING: failed to apply %d edits from clang tool.' % -p.returncode + if not _prompt_yes_or_no('Continue (generally safe)', default='yes'): + sys.exit(1) + + # Use git apply with --include + apply_manual_patch_args = [ + 'apply', '--reject', os.path.join(staging_dir, 'data', 'manual.patch') + ] + for f in changed_files: + apply_manual_patch_args.append('--include=%s' % f) + if _call_git(apply_manual_patch_args) != 0: + print 'ERROR: failed to apply manual patches. Please manually resolve ' + print ' conflicts (without committing) and re-run the tool with ' + print ' --finish-prepare.' + sys.exit(1) + + _finish_prepare_branch(current_branch) + + +def _finish_prepare_branch(current_branch): + _check_call_git(['cl', 'format']) + + # Record changed files in a temporary data store for later use in conflict + # resolution. + files_to_save = _check_call_git_and_get_output( + ['diff', '--name-only']).strip().split() + if not files_to_save: + print 'INFO: no changed files. Exiting...' + sys.exit(0) + + record_dir = tempfile.mkdtemp() + print 'INFO: saving changed files to %s' % record_dir + + for file_to_save in files_to_save: + # Skip files that are deleted, since resolving those conflicts should be + # trivial. + # TODO(dcheng): Be more clever and stage this fact somehow? + if not os.path.isfile(file_to_save): + continue + print 'Saving %s' % file_to_save + shutil.copyfile(file_to_save, + os.path.join(record_dir, + hashlib.sha256(file_to_save).hexdigest())) + + _check_call_git( + ['config', _GIT_CONFIG_BRANCH_RECORDS % current_branch, record_dir]) + _check_call_git(['reset', '--hard']) + print 'INFO: finished preparing branch %s' % current_branch + + +def _update_branch(current_branch, tracking_branch, rebase=True): + if not _commit_is_ancestor_of(_BEFORE_RENAME_COMMIT, tracking_branch): + print 'ERROR: tracking branch not prepared yet; run --prepare on tracking ' + print ' branch first.' + sys.exit(1) + if not _commit_is_ancestor_of(_RENAME_COMMIT, tracking_branch): + print 'ERROR: tracking branch not updated yet; run --update on tracking ' + print ' branch first.' + sys.exit(1) + if tracking_branch != 'refs/remotes/origin/master' and _commit_is_ancestor_of( + _AFTER_RENAME_COMMIT, tracking_branch): + print 'WARNING: tracking branch is already ahead of the rename commit.' + print ' The reliability of the tool will be much lower.' + if not _prompt_yes_or_no('Continue', default='no'): + sys.exit(1) + if not _commit_is_ancestor_of(_BEFORE_RENAME_COMMIT, 'HEAD'): + print 'ERROR: current branch not yet prepared; run --prepare first.' + sys.exit(1) + if _commit_is_ancestor_of(_RENAME_COMMIT, 'HEAD'): + print 'ERROR: current branch appears to already be updated.' + sys.exit(1) + prepared_records = None + try: + prepared_records = _check_call_git_and_get_output( + ['config', '--get', + _GIT_CONFIG_BRANCH_RECORDS % current_branch]).strip() + except subprocess.CalledProcessError: + # Likely failed because it's not set. Fall through and fail out + pass + if not prepared_records: + print 'ERROR: current branch is not prepared yet; run --prepare first.' + sys.exit(1) + + if not os.path.isdir(prepared_records): + print 'ERROR: records directory %s is invalid.' % prepared_records + sys.exit(1) + + # TODO(dcheng): Ideally this part would be automated, but I'm failing to think + # of a nice way to do it... + args = [] + if rebase: + args.append('rebase') + else: + args.append('merge') + if tracking_branch == 'refs/remotes/origin/master': + args.append(_RENAME_COMMIT) + with _MergeTool(): + if _call_git( + args, env=dict(os.environ, + BLINK_RENAME_RECORDS_PATH=prepared_records)) != 0: + print 'ERROR: failed to update. Please resolve any remaining conflicts ' + print ' manually.' + + print 'INFO: updated branch %s' % current_branch def run(): - print 'Hello World!' - print sys.argv + # run.py made a poor life choice. Workaround that here by (hopefully) changing + # the working directory back to the git repo root. + os.chdir(os.path.join('..', '..')) + + parser = argparse.ArgumentParser() + parser.add_argument('-C', metavar='DIR', help='Path to build directory.') + parser.add_argument( + '-j', metavar='N', help='Number of ninja jobs to run in parallel.') + parser.add_argument( + '--merge', + action='store_true', + help='Use merge instead of rebase to update the branch. Not recommended.') + tool_mode = parser.add_mutually_exclusive_group(required=True) + tool_mode.add_argument( + '--prepare', + action='store_true', + help='Prepare the branch for updating across the rename commit.') + tool_mode.add_argument( + '--finish-prepare', + action='store_true', + help='Finish preparing the branch for updating across the rename commit.') + tool_mode.add_argument( + '--update', + action='store_true', + help='Update the branch across the rename commit.') + args = parser.parse_args() + + current_branch, tracking_branch = _get_branch_info() + + if tracking_branch != 'refs/remotes/origin/master': + print 'WARNING: The script is more fragile when the tracking branch ' + print ' is not refs/remotes/origin/master.' + # Default to danger mode. + if not _prompt_yes_or_no('Continue', default='yes'): + sys.exit(1) + + _ensure_origin_contains_commit() + + if args.prepare: + _ensure_clean_tree() + _prepare_branch(current_branch, tracking_branch, args.C, args.j, + not args.merge) + elif args.finish_prepare: + _finish_prepare_branch(current_branch) + else: + _ensure_clean_tree() + _update_branch(current_branch, tracking_branch, not args.merge)
diff --git a/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/merge.py b/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/merge.py new file mode 100755 index 0000000..69df1a7 --- /dev/null +++ b/tools/blink_rename_merge_helper/pylib/blink_rename_merge_helper/merge.py
@@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Copyright 2017 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. +"""Merge driver for the Blink rename merge helper.""" + +import hashlib +import os +import shutil +import subprocess +import sys + + +def main(): + if len(sys.argv) < 5: + print('usage: %s <base> <current> <others> <path in the tree>' % + sys.argv[0]) + sys.exit(1) + + base, current, others, file_name_in_tree = sys.argv[1:5] + + # If set, try to resolve conflicts based on the precalculated file. + if 'BLINK_RENAME_RECORDS_PATH' in os.environ: + file_hash = hashlib.sha256(file_name_in_tree).hexdigest() + saved_file = os.path.join(os.environ['BLINK_RENAME_RECORDS_PATH'], + file_hash) + if os.path.isfile(saved_file): + print 'Using pre-recorded conflict resolution for %s' % file_name_in_tree + shutil.copyfile(saved_file, current) + shutil.copyfile(others, base) + + return subprocess.call(['git', 'merge-file', '-Lcurrent', '-Lbase', '-Lother', + current, base, others]) + + +if __name__ == '__main__': + sys.exit(main())
diff --git a/tools/blink_rename_merge_helper/run.py b/tools/blink_rename_merge_helper/run.py index cff45fb3..2387e278 100755 --- a/tools/blink_rename_merge_helper/run.py +++ b/tools/blink_rename_merge_helper/run.py
@@ -79,16 +79,15 @@ Performs update checks and stages any required binaries.""" - def __init__(self, depot_tools, components_path_override): + def __init__(self, depot_tools, components_manifest_name): """Bootstrapper constructor. Args: depot_tools: a wrapper for invoking depot_tools. - components_path_override: If set, used as the path for the COMPONENTS file - rather than using the copy in the Google Storage bucket. + components_manifest_name: The name of the components manifest. """ self.__depot_tools = depot_tools - self.__components_path_override = components_path_override + self.__components_manifest_name = components_manifest_name self.__tmpdir = None def __enter__(self): @@ -118,11 +117,10 @@ """Fetches info about the latest components from google storage. The return value should be a dict of component names to SHA1 hashes.""" - components_path = self.__components_path_override - if not components_path: - components_path = os.path.join(self.__tmpdir, 'COMPONENTS') - self.__depot_tools.call_gsutil( - 'cp', 'gs://chromium-blink-rename/COMPONENTS', components_path) + components_path = os.path.join(self.__tmpdir, 'COMPONENTS') + self.__depot_tools.call_gsutil( + 'cp', 'gs://chromium-blink-rename/%s' % self.__components_manifest_name, + components_path) with open(components_path) as f: return json.loads(f.read()) @@ -130,7 +128,8 @@ def main(): # Intentionally suppress help. These are internal testing flags. parser = argparse.ArgumentParser(add_help=False) - parser.add_argument('--components-file') + parser.add_argument('--components-manifest-name', default='COMPONENTS') + parser.add_argument('--pylib-path') args, remaining_argv = parser.parse_known_args() script_dir = os.path.dirname(os.path.realpath(__file__)) @@ -143,11 +142,13 @@ return 1 print 'Checking for updates...' - with Bootstrapper(depot_tools, args.components_file) as bootstrapper: + with Bootstrapper(depot_tools, args.components_manifest_name) as bootstrapper: bootstrapper.update() # Import stage 2 and launch it. - tool_pylib = os.path.abspath(os.path.join(script_dir, 'staging/pylib')) + tool_pylib = args.pylib_path + if not tool_pylib: + tool_pylib = os.path.abspath(os.path.join(script_dir, 'staging/pylib')) sys.path.insert(0, tool_pylib) from blink_rename_merge_helper import driver # Note: for compatibility with older versions of run.py, set sys.argv to the
diff --git a/tools/clang/scripts/apply_edits.py b/tools/clang/scripts/apply_edits.py index 7d373a9..5bc8d27 100755 --- a/tools/clang/scripts/apply_edits.py +++ b/tools/clang/scripts/apply_edits.py
@@ -147,10 +147,10 @@ error_count += tmp_error_count done_files += 1 percentage = (float(done_files) / len(edits)) * 100 - sys.stderr.write('Applied %d edits (%d errors) to %d files [%.2f%%]\r' % + sys.stdout.write('Applied %d edits (%d errors) to %d files [%.2f%%]\r' % (edit_count, error_count, done_files, percentage)) - sys.stderr.write('\n') + sys.stdout.write('\n') return -error_count
diff --git a/tools/clang/scripts/extract_edits.py b/tools/clang/scripts/extract_edits.py index b0df9c3..0eb7cf6 100755 --- a/tools/clang/scripts/extract_edits.py +++ b/tools/clang/scripts/extract_edits.py
@@ -45,6 +45,9 @@ def main(): + # TODO(dcheng): extract_edits.py should normalize paths. Doing this in + # apply_edits.py is too late, as a common use case is to apply edits from many + # different platforms. unique_lines = set() inside_marker_lines = False for line in sys.stdin:
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 9ea9c3b..59793169 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -95436,6 +95436,52 @@ <int value="1915" label="CanRequestURLNonHTTPContainingNewline"/> <int value="1916" label="GetGamepads"/> <int value="1917" label="V8SVGPathElement_GetPathSegAtLength_Method"/> + <int value="1918" label="MediaStreamConstraintsAudio"/> + <int value="1919" label="MediaStreamConstraintsAudioUnconstrained"/> + <int value="1920" label="MediaStreamConstraintsVideo"/> + <int value="1921" label="MediaStreamConstraintsVideoUnconstrained"/> + <int value="1922" label="MediaStreamConstraintsWidth"/> + <int value="1923" label="MediaStreamConstraintsHeight"/> + <int value="1924" label="MediaStreamConstraintsAspectRatio"/> + <int value="1925" label="MediaStreamConstraintsFrameRate"/> + <int value="1926" label="MediaStreamConstraintsFacingMode"/> + <int value="1927" label="MediaStreamConstraintsVolume"/> + <int value="1928" label="MediaStreamConstraintsSampleRate"/> + <int value="1929" label="MediaStreamConstraintsSampleSize"/> + <int value="1930" label="MediaStreamConstraintsEchoCancellation"/> + <int value="1931" label="MediaStreamConstraintsLatency"/> + <int value="1932" label="MediaStreamConstraintsChannelCount"/> + <int value="1933" label="MediaStreamConstraintsDeviceIdAudio"/> + <int value="1934" label="MediaStreamConstraintsDeviceIdVideo"/> + <int value="1935" label="MediaStreamConstraintsDisableLocalEcho"/> + <int value="1936" label="MediaStreamConstraintsGroupIdAudio"/> + <int value="1937" label="MediaStreamConstraintsGroupIdVideo"/> + <int value="1938" label="MediaStreamConstraintsVideoKind"/> + <int value="1939" label="MediaStreamConstraintsDepthNear"/> + <int value="1940" label="MediaStreamConstraintsDepthFar"/> + <int value="1941" label="MediaStreamConstraintsFocalLengthX"/> + <int value="1942" label="MediaStreamConstraintsFocalLengthY"/> + <int value="1943" label="MediaStreamConstraintsMediaStreamSourceAudio"/> + <int value="1944" label="MediaStreamConstraintsMediaStreamSourceVideo"/> + <int value="1945" label="MediaStreamConstraintsRenderToAssociatedSink"/> + <int value="1946" label="MediaStreamConstraintsHotwordEnabled"/> + <int value="1947" label="MediaStreamConstraintsGoogEchoCancellation"/> + <int value="1948" + label="MediaStreamConstraintsGoogExperimentalEchoCancellation"/> + <int value="1949" label="MediaStreamConstraintsGoogAutoGainControl"/> + <int value="1950" + label="MediaStreamConstraintsGoogExperimentalAutoGainControl"/> + <int value="1951" label="MediaStreamConstraintsGoogNoiseSuppression"/> + <int value="1952" label="MediaStreamConstraintsGoogHighpassFilter"/> + <int value="1953" label="MediaStreamConstraintsGoogTypingNoiseDetection"/> + <int value="1954" + label="MediaStreamConstraintsGoogExperimentalNoiseSuppression"/> + <int value="1955" label="MediaStreamConstraintsGoogBeamforming"/> + <int value="1956" label="MediaStreamConstraintsGoogArrayGeometry"/> + <int value="1957" label="MediaStreamConstraintsGoogAudioMirroring"/> + <int value="1958" label="MediaStreamConstraintsGoogDAEchoCancellation"/> + <int value="1959" label="MediaStreamConstraintsGoogNoiseReduction"/> + <int value="1960" label="MediaStreamConstraintsGoogPowerLineFrequency"/> </enum> <enum name="FetchRequestMode" type="int"> @@ -121768,6 +121814,13 @@ <affected-histogram name="Net.RequestTime2.Success"/> </histogram_suffixes> +<histogram_suffixes name="NetHttpContentLengthType" separator="."> + <suffix name="Http"/> + <suffix name="Https"/> + <suffix name="Video"/> + <affected-histogram name="Net.HttpContentLength"/> +</histogram_suffixes> + <histogram_suffixes name="NetHttpProxyConnectLatencySecure" separator="."> <owner>tbansal@chromium.org</owner> <suffix name="Insecure" label="Insecure proxy"/>
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index b83b08fe..7e736a5 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc
@@ -502,6 +502,8 @@ void Compositor::DidReceiveCompositorFrameAck() { ++activated_frame_count_; + for (auto& observer : observer_list_) + observer.OnCompositingEnded(this); } void Compositor::DidSubmitCompositorFrame() {
diff --git a/ui/compositor/compositor_observer.h b/ui/compositor/compositor_observer.h index 0fbb032..5c0d3db 100644 --- a/ui/compositor/compositor_observer.h +++ b/ui/compositor/compositor_observer.h
@@ -31,6 +31,9 @@ virtual void OnCompositingStarted(Compositor* compositor, base::TimeTicks start_time) = 0; + // Called when compositing completes: the present to screen has completed. + virtual void OnCompositingEnded(Compositor* compositor) = 0; + // Called when the compositor lock state changes. virtual void OnCompositingLockStateChanged(Compositor* compositor) = 0;
diff --git a/ui/compositor/compositor_unittest.cc b/ui/compositor/compositor_unittest.cc index 03e93fb..7115bd4 100644 --- a/ui/compositor/compositor_unittest.cc +++ b/ui/compositor/compositor_unittest.cc
@@ -95,6 +95,7 @@ void OnCompositingDidCommit(Compositor* compositor) override {} void OnCompositingStarted(Compositor* compositor, base::TimeTicks start_time) override {} + void OnCompositingEnded(Compositor* compositor) override {} void OnCompositingLockStateChanged(Compositor* compositor) override { changed_ = true; locked_ = compositor->IsLocked(); @@ -330,14 +331,14 @@ compositor()->SetScaleAndSize(1.0f, gfx::Size(10, 10)); DCHECK(compositor()->IsVisible()); compositor()->ScheduleDraw(); - DrawWaiterForTest::WaitForCompositingStarted(compositor()); + DrawWaiterForTest::WaitForCompositingEnded(compositor()); compositor()->SetVisible(false); EXPECT_EQ(gfx::kNullAcceleratedWidget, compositor()->ReleaseAcceleratedWidget()); compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); compositor()->SetVisible(true); compositor()->ScheduleDraw(); - DrawWaiterForTest::WaitForCompositingStarted(compositor()); + DrawWaiterForTest::WaitForCompositingEnded(compositor()); compositor()->SetRootLayer(nullptr); }
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc index 865504a..0783ff0 100644 --- a/ui/compositor/layer_unittest.cc +++ b/ui/compositor/layer_unittest.cc
@@ -188,7 +188,7 @@ void DrawTree(Layer* root) { GetCompositor()->SetRootLayer(root); GetCompositor()->ScheduleDraw(); - WaitForDraw(); + WaitForSwap(); } void ReadPixels(SkBitmap* bitmap) { @@ -222,6 +222,10 @@ ui::DrawWaiterForTest::WaitForCompositingStarted(GetCompositor()); } + void WaitForSwap() { + ui::DrawWaiterForTest::WaitForCompositingEnded(GetCompositor()); + } + void WaitForCommit() { ui::DrawWaiterForTest::WaitForCommit(GetCompositor()); } @@ -364,11 +368,12 @@ TestCompositorObserver() = default; bool committed() const { return committed_; } - bool started() const { return started_; } + bool notified() const { return started_ && ended_; } void Reset() { committed_ = false; started_ = false; + ended_ = false; } private: @@ -381,12 +386,15 @@ started_ = true; } + void OnCompositingEnded(Compositor* compositor) override { ended_ = true; } + void OnCompositingLockStateChanged(Compositor* compositor) override {} void OnCompositingShuttingDown(Compositor* compositor) override {} bool committed_ = false; bool started_ = false; + bool ended_ = false; DISALLOW_COPY_AND_ASSIGN(TestCompositorObserver); }; @@ -1309,7 +1317,7 @@ // Explicitly called DrawTree should cause the observers to be notified. // NOTE: this call to DrawTree sets l1 to be the compositor's root layer. DrawTree(l1.get()); - EXPECT_TRUE(observer.started()); + EXPECT_TRUE(observer.notified()); // ScheduleDraw without any visible change should cause a commit. observer.Reset(); @@ -1320,26 +1328,26 @@ // Moving, but not resizing, a layer should alert the observers. observer.Reset(); l2->SetBounds(gfx::Rect(0, 0, 350, 350)); - WaitForDraw(); - EXPECT_TRUE(observer.started()); + WaitForSwap(); + EXPECT_TRUE(observer.notified()); // So should resizing a layer. observer.Reset(); l2->SetBounds(gfx::Rect(0, 0, 400, 400)); - WaitForDraw(); - EXPECT_TRUE(observer.started()); + WaitForSwap(); + EXPECT_TRUE(observer.notified()); // Opacity changes should alert the observers. observer.Reset(); l2->SetOpacity(0.5f); - WaitForDraw(); - EXPECT_TRUE(observer.started()); + WaitForSwap(); + EXPECT_TRUE(observer.notified()); // So should setting the opacity back. observer.Reset(); l2->SetOpacity(1.0f); - WaitForDraw(); - EXPECT_TRUE(observer.started()); + WaitForSwap(); + EXPECT_TRUE(observer.notified()); // Setting the transform of a layer should alert the observers. observer.Reset(); @@ -1348,17 +1356,17 @@ transform.Rotate(90.0); transform.Translate(-200.0, -200.0); l2->SetTransform(transform); - WaitForDraw(); - EXPECT_TRUE(observer.started()); + WaitForSwap(); + EXPECT_TRUE(observer.notified()); GetCompositor()->RemoveObserver(&observer); // Opacity changes should no longer alert the removed observer. observer.Reset(); l2->SetOpacity(0.5f); - WaitForDraw(); + WaitForSwap(); - EXPECT_FALSE(observer.started()); + EXPECT_FALSE(observer.notified()); } // Checks that modifying the hierarchy correctly affects final composite.
diff --git a/ui/compositor/test/draw_waiter_for_test.cc b/ui/compositor/test/draw_waiter_for_test.cc index e92e1a1..cd2e513 100644 --- a/ui/compositor/test/draw_waiter_for_test.cc +++ b/ui/compositor/test/draw_waiter_for_test.cc
@@ -14,6 +14,11 @@ waiter.WaitImpl(compositor); } +void DrawWaiterForTest::WaitForCompositingEnded(Compositor* compositor) { + DrawWaiterForTest waiter(WAIT_FOR_COMPOSITING_ENDED); + waiter.WaitImpl(compositor); +} + // static void DrawWaiterForTest::WaitForCommit(Compositor* compositor) { DrawWaiterForTest waiter(WAIT_FOR_COMMIT); @@ -44,6 +49,11 @@ wait_run_loop_->Quit(); } +void DrawWaiterForTest::OnCompositingEnded(Compositor* compositor) { + if (wait_event_ == WAIT_FOR_COMPOSITING_ENDED) + wait_run_loop_->Quit(); +} + void DrawWaiterForTest::OnCompositingLockStateChanged(Compositor* compositor) {} void DrawWaiterForTest::OnCompositingShuttingDown(Compositor* compositor) {}
diff --git a/ui/compositor/test/draw_waiter_for_test.h b/ui/compositor/test/draw_waiter_for_test.h index 173bed91..f60657cf 100644 --- a/ui/compositor/test/draw_waiter_for_test.h +++ b/ui/compositor/test/draw_waiter_for_test.h
@@ -25,6 +25,9 @@ // not to draw. static void WaitForCompositingStarted(Compositor* compositor); + // Waits for a swap to be completed from the compositor. + static void WaitForCompositingEnded(Compositor* compositor); + // Waits for a commit instead of a draw. static void WaitForCommit(Compositor* compositor); @@ -32,6 +35,7 @@ enum WaitEvent { WAIT_FOR_COMMIT, WAIT_FOR_COMPOSITING_STARTED, + WAIT_FOR_COMPOSITING_ENDED, }; DrawWaiterForTest(WaitEvent wait_event); ~DrawWaiterForTest() override; @@ -42,6 +46,7 @@ void OnCompositingDidCommit(Compositor* compositor) override; void OnCompositingStarted(Compositor* compositor, base::TimeTicks start_time) override; + void OnCompositingEnded(Compositor* compositor) override; void OnCompositingLockStateChanged(Compositor* compositor) override; void OnCompositingShuttingDown(Compositor* compositor) override;
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc index 1a2e313..911147a 100644 --- a/ui/events/blink/input_handler_proxy.cc +++ b/ui/events/blink/input_handler_proxy.cc
@@ -557,6 +557,10 @@ return; } + // NonCompositedScrollReasons should only be set on the main thread. + DCHECK( + !cc::MainThreadScrollingReason::HasNonCompositedScrollReasons(reasons)); + // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly // greater than the sample value. kMainThreadScrollingReasonCount doesn't // include the NotScrollingOnMain enum but the histograms do so adding
diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc index b6c0702..5c2a462 100644 --- a/ui/native_theme/native_theme_aura.cc +++ b/ui/native_theme/native_theme_aura.cc
@@ -200,11 +200,11 @@ if (use_overlay_scrollbars_) { // Constants used for painting overlay scrollbar thumb. - constexpr SkAlpha kOverlayScrollbarFillAlphaNormal = 0x4D; - constexpr SkAlpha kOverlayScrollbarFillAlphaHovered = 0x80; - constexpr SkAlpha kOverlayScrollbarFillAlphaPressed = 0x80; + constexpr SkAlpha kOverlayScrollbarFillAlphaNormal = 0x80; + constexpr SkAlpha kOverlayScrollbarFillAlphaHovered = 0xB3; + constexpr SkAlpha kOverlayScrollbarFillAlphaPressed = 0xB3; constexpr SkAlpha kOverlayScrollbarStrokeAlphaNormal = 0x4D; - constexpr SkAlpha kOverlayScrollbarStrokeAlphaHovered = 0x58; + constexpr SkAlpha kOverlayScrollbarStrokeAlphaHovered = 0x80; constexpr SkAlpha kOverlayScrollbarStrokeAlphaPressed = 0x80; // Indexed by ScrollbarOverlayColorTheme.
diff --git a/ui/snapshot/snapshot_aura_unittest.cc b/ui/snapshot/snapshot_aura_unittest.cc index 90d1375..97d4ac44 100644 --- a/ui/snapshot/snapshot_aura_unittest.cc +++ b/ui/snapshot/snapshot_aura_unittest.cc
@@ -126,7 +126,7 @@ void WaitForDraw() { helper_->host()->compositor()->ScheduleDraw(); - ui::DrawWaiterForTest::WaitForCompositingStarted( + ui::DrawWaiterForTest::WaitForCompositingEnded( helper_->host()->compositor()); }
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index f6856dd..7c3d7bbf 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -296,6 +296,8 @@ "layout/layout_constants.h", "layout/layout_manager.cc", "layout/layout_manager.h", + "layout/layout_provider.cc", + "layout/layout_provider.h", "linux_ui/linux_ui.cc", "linux_ui/linux_ui.h", "linux_ui/status_icon_linux.cc",
diff --git a/ui/views/animation/square_ink_drop_ripple.cc b/ui/views/animation/square_ink_drop_ripple.cc index ea1e6a0..3e253b0 100644 --- a/ui/views/animation/square_ink_drop_ripple.cc +++ b/ui/views/animation/square_ink_drop_ripple.cc
@@ -18,6 +18,8 @@ #include "ui/views/animation/ink_drop_painted_layer_delegates.h" #include "ui/views/view.h" +namespace views { + namespace { // The minimum scale factor to use when scaling rectangle layers. Smaller values @@ -127,42 +129,14 @@ // Returns the InkDropState sub animation duration for the given |state|. base::TimeDelta GetAnimationDuration(InkDropSubAnimations state) { return base::TimeDelta::FromMilliseconds( - (views::InkDropRipple::UseFastAnimations() + (InkDropRipple::UseFastAnimations() ? 1 - : views::InkDropRipple::kSlowAnimationDurationFactor) * + : InkDropRipple::kSlowAnimationDurationFactor) * kAnimationDurationInMs[state]); } -// Calculates a Transform for a circle layer. The transform will be set up to -// translate by -|center_offset|, scale, and then translate to the target point -// defined by |target_center_x| and |target_center_y|. -gfx::Transform CalculateCircleTransform(const gfx::Vector2dF& center_offset, - float scale, - float target_center_x, - float target_center_y) { - gfx::Transform transform; - transform.Translate(target_center_x, target_center_y); - transform.Scale(scale, scale); - transform.Translate(-center_offset.x(), -center_offset.y()); - return transform; -} - -// Calculates a Transform for a rectangle layer. The transform will be set up to -// translate by -|center_offset| and then scale by the |x_scale| and |y_scale| -// factors. -gfx::Transform CalculateRectTransform(const gfx::Vector2dF& center_offset, - float x_scale, - float y_scale) { - gfx::Transform transform; - transform.Scale(x_scale, y_scale); - transform.Translate(-center_offset.x(), -center_offset.y()); - return transform; -} - } // namespace -namespace views { - SquareInkDropRipple::SquareInkDropRipple(const gfx::Size& large_size, int large_corner_radius, const gfx::Size& small_size, @@ -176,6 +150,7 @@ large_corner_radius_(large_corner_radius), small_size_(small_size), small_corner_radius_(small_corner_radius), + center_point_(center_point), circle_layer_delegate_(new CircleLayerDelegate( color, std::min(large_size_.width(), large_size_.height()) / 2)), @@ -190,10 +165,6 @@ root_layer_.SetMasksToBounds(false); root_layer_.SetBounds(gfx::Rect(large_size_)); - gfx::Transform transform; - transform.Translate(center_point.x(), center_point.y()); - root_layer_.SetTransform(transform); - SetStateToHidden(); } @@ -265,7 +236,6 @@ case InkDropState::ACTION_PENDING: DCHECK_EQ(InkDropState::HIDDEN, old_ink_drop_state) << " old_ink_drop_state=" << ToString(old_ink_drop_state); - ; AnimateToOpacity(visible_opacity_, GetAnimationDuration(ACTION_PENDING_FADE_IN), ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, @@ -460,14 +430,29 @@ } void SquareInkDropRipple::CalculateRectTransforms( - const gfx::Size& size, + const gfx::Size& desired_size, float corner_radius, InkDropTransforms* transforms_out) const { - DCHECK_GE(size.width() / 2.0f, corner_radius) + DCHECK_GE(desired_size.width() / 2.0f, corner_radius) << "The circle's diameter should not be greater than the total width."; - DCHECK_GE(size.height() / 2.0f, corner_radius) + DCHECK_GE(desired_size.height() / 2.0f, corner_radius) << "The circle's diameter should not be greater than the total height."; + gfx::SizeF size(desired_size); + // This function can be called before the layer's been added to a view, + // either at construction time or in tests. + if (root_layer_.GetCompositor()) { + // Modify |desired_size| so that the ripple aligns to pixel bounds. + const float dsf = root_layer_.GetCompositor()->device_scale_factor(); + gfx::RectF ripple_bounds((gfx::PointF(center_point_)), gfx::SizeF()); + ripple_bounds.Inset(-gfx::InsetsF(desired_size.height() / 2.0f, + desired_size.width() / 2.0f)); + ripple_bounds.Scale(dsf); + ripple_bounds = gfx::RectF(gfx::ToEnclosingRect(ripple_bounds)); + ripple_bounds.Scale(1.0f / dsf); + size = ripple_bounds.size(); + } + // The shapes are drawn such that their center points are not at the origin. // Thus we use the CalculateCircleTransform() and CalculateRectTransform() // methods to calculate the complex Transforms. @@ -479,44 +464,58 @@ const float circle_target_x_offset = size.width() / 2.0f - corner_radius; const float circle_target_y_offset = size.height() / 2.0f - corner_radius; - const gfx::Vector2dF circle_center_offset = - circle_layer_delegate_->GetCenteringOffset(); (*transforms_out)[TOP_LEFT_CIRCLE] = CalculateCircleTransform( - circle_center_offset, circle_scale, -circle_target_x_offset, - -circle_target_y_offset); + circle_scale, -circle_target_x_offset, -circle_target_y_offset); + (*transforms_out)[TOP_RIGHT_CIRCLE] = CalculateCircleTransform( + circle_scale, circle_target_x_offset, -circle_target_y_offset); + (*transforms_out)[BOTTOM_RIGHT_CIRCLE] = CalculateCircleTransform( + circle_scale, circle_target_x_offset, circle_target_y_offset); + (*transforms_out)[BOTTOM_LEFT_CIRCLE] = CalculateCircleTransform( + circle_scale, -circle_target_x_offset, circle_target_y_offset); - (*transforms_out)[TOP_RIGHT_CIRCLE] = - CalculateCircleTransform(circle_center_offset, circle_scale, - circle_target_x_offset, -circle_target_y_offset); + const float rect_delegate_width = rect_layer_delegate_->size().width(); + const float rect_delegate_height = rect_layer_delegate_->size().height(); - (*transforms_out)[BOTTOM_RIGHT_CIRCLE] = - CalculateCircleTransform(circle_center_offset, circle_scale, - circle_target_x_offset, circle_target_y_offset); - - (*transforms_out)[BOTTOM_LEFT_CIRCLE] = - CalculateCircleTransform(circle_center_offset, circle_scale, - -circle_target_x_offset, circle_target_y_offset); - - const float rect_delegate_width = - static_cast<float>(rect_layer_delegate_->size().width()); - const float rect_delegate_height = - static_cast<float>(rect_layer_delegate_->size().height()); - - const gfx::Vector2dF rect_center_offset = - rect_layer_delegate_->GetCenteringOffset(); (*transforms_out)[HORIZONTAL_RECT] = CalculateRectTransform( - rect_center_offset, std::max(kMinimumRectScale, size.width() / rect_delegate_width), std::max(kMinimumRectScale, (size.height() - 2.0f * corner_radius) / rect_delegate_height)); (*transforms_out)[VERTICAL_RECT] = CalculateRectTransform( - rect_center_offset, std::max(kMinimumRectScale, (size.width() - 2.0f * corner_radius) / rect_delegate_width), std::max(kMinimumRectScale, size.height() / rect_delegate_height)); } +gfx::Transform SquareInkDropRipple::CalculateCircleTransform( + float scale, + float target_center_x, + float target_center_y) const { + gfx::Transform transform; + // Offset for the center point of the ripple. + transform.Translate(center_point_.x(), center_point_.y()); + // Move circle to target. + transform.Translate(target_center_x, target_center_y); + transform.Scale(scale, scale); + // Align center point of the painted circle. + const gfx::Vector2dF circle_center_offset = + circle_layer_delegate_->GetCenteringOffset(); + transform.Translate(-circle_center_offset.x(), -circle_center_offset.y()); + return transform; +} + +gfx::Transform SquareInkDropRipple::CalculateRectTransform( + float x_scale, + float y_scale) const { + gfx::Transform transform; + transform.Translate(center_point_.x(), center_point_.y()); + transform.Scale(x_scale, y_scale); + const gfx::Vector2dF rect_center_offset = + rect_layer_delegate_->GetCenteringOffset(); + transform.Translate(-rect_center_offset.x(), -rect_center_offset.y()); + return transform; +} + void SquareInkDropRipple::GetCurrentTransforms( InkDropTransforms* transforms_out) const { for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
diff --git a/ui/views/animation/square_ink_drop_ripple.h b/ui/views/animation/square_ink_drop_ripple.h index 99913360..8b34df8 100644 --- a/ui/views/animation/square_ink_drop_ripple.h +++ b/ui/views/animation/square_ink_drop_ripple.h
@@ -131,15 +131,25 @@ // Updates all of the Transforms in |transforms_out| for a circle of the given // |size|. - void CalculateCircleTransforms(const gfx::Size& size, + void CalculateCircleTransforms(const gfx::Size& desired_size, InkDropTransforms* transforms_out) const; // Updates all of the Transforms in |transforms_out| for a rounded rectangle - // of the given |size| and |corner_radius|. - void CalculateRectTransforms(const gfx::Size& size, + // of the given |desired_size| and |corner_radius|. The effective size may + // differ from |desired_size| at certain scale factors to make sure the ripple + // is pixel-aligned. + void CalculateRectTransforms(const gfx::Size& desired_size, float corner_radius, InkDropTransforms* transforms_out) const; + // Calculates a Transform for a circle layer. + gfx::Transform CalculateCircleTransform(float scale, + float target_center_x, + float target_center_y) const; + + // Calculates a Transform for a rectangle layer. + gfx::Transform CalculateRectTransform(float x_scale, float y_scale) const; + // Updates all of the Transforms in |transforms_out| to the current Transforms // of the painted shape Layers. void GetCurrentTransforms(InkDropTransforms* transforms_out) const; @@ -159,7 +169,7 @@ ActivatedShape activated_shape_; // Ink drop opacity when it is visible. - const float visible_opacity_; + float visible_opacity_; // Maximum size that an ink drop will be drawn to for any InkDropState whose // final frame should be large. @@ -177,6 +187,9 @@ // InkDropState whose final frame should be small. const int small_corner_radius_; + // The center point of the ripple, relative to the root layer's origin. + gfx::Point center_point_; + // ui::LayerDelegate to paint circles for all the circle layers. std::unique_ptr<CircleLayerDelegate> circle_layer_delegate_;
diff --git a/ui/views/animation/square_ink_drop_ripple_unittest.cc b/ui/views/animation/square_ink_drop_ripple_unittest.cc index 81b9a6d..d5bf210 100644 --- a/ui/views/animation/square_ink_drop_ripple_unittest.cc +++ b/ui/views/animation/square_ink_drop_ripple_unittest.cc
@@ -15,6 +15,7 @@ #include "ui/views/animation/ink_drop_state.h" #include "ui/views/animation/test/square_ink_drop_ripple_test_api.h" #include "ui/views/animation/test/test_ink_drop_ripple_observer.h" +#include "ui/views/test/widget_test.h" namespace views { namespace test { @@ -31,7 +32,7 @@ return transformed_point; } -class SquareInkDropRippleCalculateTransformsTest : public testing::Test { +class SquareInkDropRippleCalculateTransformsTest : public WidgetTest { public: SquareInkDropRippleCalculateTransformsTest(); ~SquareInkDropRippleCalculateTransformsTest() override; @@ -238,5 +239,76 @@ } } +TEST_F(SquareInkDropRippleCalculateTransformsTest, RippleIsPixelAligned) { + // Create a ripple that would not naturally be pixel aligned at a fractional + // scale factor. + const gfx::Point center(14, 14); + const gfx::Rect drawn_rect_bounds(0, 0, 10, 10); + SquareInkDropRipple ink_drop_ripple(drawn_rect_bounds.size(), 2, + gfx::Size(1, 1), // unimportant + 1, center, SK_ColorBLACK, 0.175f); + SquareInkDropRippleTestApi test_api(&ink_drop_ripple); + + // Add to a widget so we can control the DSF. + auto* widget = CreateTopLevelPlatformWidget(); + widget->SetBounds(gfx::Rect(0, 0, 100, 100)); + auto* host_view = new View(); + host_view->SetPaintToLayer(); + widget->GetContentsView()->AddChildView(host_view); + host_view->layer()->Add(ink_drop_ripple.GetRootLayer()); + + // Test a variety of scale factors and target transform sizes. + std::vector<float> dsfs({1.0f, 1.25f, 1.5f, 2.0f, 3.0f}); + std::vector<int> target_sizes({5, 7, 11, 13, 31}); + + for (float dsf : dsfs) { + for (int target_size : target_sizes) { + SCOPED_TRACE(testing::Message() + << "target_size=" << target_size << " dsf=" << dsf); + host_view->layer()->GetCompositor()->SetScaleAndSize(dsf, + gfx::Size(100, 100)); + + SquareInkDropRippleTestApi::InkDropTransforms transforms; + test_api.CalculateRectTransforms(gfx::Size(target_size, target_size), 0, + &transforms); + + // Checks that a rectangle is integer-aligned modulo floating point error. + auto verify_bounds = [](const gfx::RectF& rect) { + float float_min_x = rect.x(); + float float_min_y = rect.y(); + float float_max_x = rect.right(); + float float_max_y = rect.bottom(); + + int min_x = gfx::ToRoundedInt(float_min_x); + int min_y = gfx::ToRoundedInt(float_min_y); + int max_x = gfx::ToRoundedInt(float_max_x); + int max_y = gfx::ToRoundedInt(float_max_y); + + EXPECT_LT(std::abs(min_x - float_min_x), 0.01f); + EXPECT_LT(std::abs(min_y - float_min_y), 0.01f); + EXPECT_LT(std::abs(max_x - float_max_x), 0.01f); + EXPECT_LT(std::abs(max_y - float_max_y), 0.01f); + }; + + // When you feed in the bounds of the rectangle layer delegate, no matter + // what the target size was you should get an integer aligned bounding + // box. + gfx::Transform transform = transforms[PaintedShape::HORIZONTAL_RECT]; + gfx::RectF horizontal_rect(drawn_rect_bounds); + transform.TransformRect(&horizontal_rect); + horizontal_rect.Scale(dsf); + verify_bounds(horizontal_rect); + + transform = transforms[PaintedShape::VERTICAL_RECT]; + gfx::RectF vertical_rect(drawn_rect_bounds); + transform.TransformRect(&vertical_rect); + vertical_rect.Scale(dsf); + verify_bounds(vertical_rect); + } + } + + widget->CloseNow(); +} + } // namespace test } // namespace views
diff --git a/ui/views/bubble/bubble_dialog_delegate.cc b/ui/views/bubble/bubble_dialog_delegate.cc index 4820775..3278b6f 100644 --- a/ui/views/bubble/bubble_dialog_delegate.cc +++ b/ui/views/bubble/bubble_dialog_delegate.cc
@@ -15,8 +15,8 @@ #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/focus/view_storage.h" #include "ui/views/layout/layout_constants.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/style/platform_style.h" -#include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/window/dialog_client_view.h" @@ -215,9 +215,9 @@ accept_events_(true), adjust_if_offscreen_(true), parent_window_(NULL) { - ViewsDelegate* views_delegate = ViewsDelegate::GetInstance(); - margins_ = views_delegate->GetInsetsMetric(InsetsMetric::BUBBLE_CONTENTS); - title_margins_ = views_delegate->GetInsetsMetric(InsetsMetric::DIALOG_TITLE); + LayoutProvider* provider = LayoutProvider::Get(); + margins_ = provider->GetInsetsMetric(INSETS_BUBBLE_CONTENTS); + title_margins_ = provider->GetInsetsMetric(INSETS_DIALOG_TITLE); if (anchor_view) SetAnchorView(anchor_view); UpdateColorsFromTheme(GetNativeTheme());
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index 7ba6184..bf3df7e 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc
@@ -31,8 +31,8 @@ #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/layout_constants.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/resources/grit/views_resources.h" -#include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" #include "ui/views/window/client_view.h" @@ -312,8 +312,8 @@ return; // The close button is positioned somewhat closer to the edge of the bubble. - const int close_margin = ViewsDelegate::GetInstance()->GetDistanceMetric( - DistanceMetric::CLOSE_BUTTON_MARGIN); + const int close_margin = + LayoutProvider::Get()->GetDistanceMetric(DISTANCE_CLOSE_BUTTON_MARGIN); close_->SetPosition( gfx::Point(contents_bounds.right() - close_margin - close_->width(), contents_bounds.y() + close_margin));
diff --git a/ui/views/controls/button/image_button_factory.cc b/ui/views/controls/button/image_button_factory.cc index 5905b46..e1cafa9 100644 --- a/ui/views/controls/button/image_button_factory.cc +++ b/ui/views/controls/button/image_button_factory.cc
@@ -10,8 +10,8 @@ #include "ui/views/border.h" #include "ui/views/controls/button/custom_button.h" #include "ui/views/controls/button/image_button.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/painter.h" -#include "ui/views/views_delegate.h" namespace views { @@ -22,9 +22,8 @@ button->SetImageAlignment(ImageButton::ALIGN_CENTER, ImageButton::ALIGN_MIDDLE); button->SetFocusPainter(nullptr); - button->SetBorder( - CreateEmptyBorder(ViewsDelegate::GetInstance()->GetInsetsMetric( - InsetsMetric::VECTOR_IMAGE_BUTTON_PADDING))); + button->SetBorder(CreateEmptyBorder( + LayoutProvider::Get()->GetInsetsMetric(INSETS_VECTOR_IMAGE_BUTTON))); return button; }
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc index 21707e8..d114946 100644 --- a/ui/views/controls/button/label_button.cc +++ b/ui/views/controls/button/label_button.cc
@@ -26,9 +26,9 @@ #include "ui/views/background.h" #include "ui/views/controls/button/label_button_border.h" #include "ui/views/layout/layout_constants.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" -#include "ui/views/views_delegate.h" #include "ui/views/window/dialog_delegate.h" namespace { @@ -92,8 +92,8 @@ is_default_(false), style_(STYLE_TEXTBUTTON), border_is_themed_border_(true), - image_label_spacing_(ViewsDelegate::GetInstance()->GetDistanceMetric( - DistanceMetric::RELATED_CONTROL_HORIZONTAL)), + image_label_spacing_(LayoutProvider::Get()->GetDistanceMetric( + DISTANCE_RELATED_CONTROL_HORIZONTAL)), horizontal_alignment_(gfx::ALIGN_LEFT) { SetAnimationDuration(kHoverAnimationDurationMs); SetTextInternal(text);
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc index 4453f2a..9e9e780 100644 --- a/ui/views/controls/button/md_text_button.cc +++ b/ui/views/controls/button/md_text_button.cc
@@ -19,9 +19,9 @@ #include "ui/views/border.h" #include "ui/views/controls/button/blue_button.h" #include "ui/views/controls/focus_ring.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/painter.h" #include "ui/views/style/platform_style.h" -#include "ui/views/views_delegate.h" namespace views { @@ -193,8 +193,8 @@ set_has_ink_drop_action_on_click(true); SetHorizontalAlignment(gfx::ALIGN_CENTER); SetFocusForPlatform(); - const int minimum_width = ViewsDelegate::GetInstance()->GetDistanceMetric( - DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH); + const int minimum_width = LayoutProvider::Get()->GetDistanceMetric( + DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH); SetMinSize(gfx::Size(minimum_width, 0)); SetFocusPainter(nullptr); label()->SetAutoColorReadabilityEnabled(false); @@ -240,9 +240,8 @@ // TODO(estade): can we get rid of the platform style border hoopla if // we apply the MD treatment to all buttons, even GTK buttons? - const int horizontal_padding = - ViewsDelegate::GetInstance()->GetDistanceMetric( - DistanceMetric::BUTTON_HORIZONTAL_PADDING); + const int horizontal_padding = LayoutProvider::Get()->GetDistanceMetric( + DISTANCE_BUTTON_HORIZONTAL_PADDING); SetBorder(CreateEmptyBorder(top_padding, horizontal_padding, bottom_padding, horizontal_padding)); }
diff --git a/ui/views/controls/scroll_view_unittest.cc b/ui/views/controls/scroll_view_unittest.cc index 9db57d8..f0cbb5bc 100644 --- a/ui/views/controls/scroll_view_unittest.cc +++ b/ui/views/controls/scroll_view_unittest.cc
@@ -268,6 +268,7 @@ } void OnCompositingStarted(ui::Compositor* compositor, base::TimeTicks start_time) override {} + void OnCompositingEnded(ui::Compositor* compositor) override {} void OnCompositingLockStateChanged(ui::Compositor* compositor) override {} void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
diff --git a/ui/views/examples/dialog_example.cc b/ui/views/examples/dialog_example.cc index 56be1b8..895db3c 100644 --- a/ui/views/examples/dialog_example.cc +++ b/ui/views/examples/dialog_example.cc
@@ -16,7 +16,7 @@ #include "ui/views/layout/fill_layout.h" #include "ui/views/layout/grid_layout.h" #include "ui/views/layout/layout_constants.h" -#include "ui/views/views_delegate.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_client_view.h" @@ -132,8 +132,8 @@ const float kStretchy = 1.f; const int horizontal_spacing = - ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_BUTTON_HORIZONTAL); + views::LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_BUTTON_HORIZONTAL); GridLayout* layout = GridLayout::CreatePanel(container); container->SetLayoutManager(layout); ColumnSet* column_set = layout->AddColumnSet(kFieldsColumnId); @@ -186,10 +186,10 @@ void DialogExample::StartRowWithLabel(GridLayout* layout, const char* label) { const float kFixedVerticalResize = 0.f; - layout->StartRowWithPadding( - kFixedVerticalResize, kFieldsColumnId, kFixedVerticalResize, - ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_CONTROL_VERTICAL)); + layout->StartRowWithPadding(kFixedVerticalResize, kFieldsColumnId, + kFixedVerticalResize, + views::LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL)); layout->AddView(new Label(base::ASCIIToUTF16(label))); }
diff --git a/ui/views/layout/grid_layout.cc b/ui/views/layout/grid_layout.cc index 6de7a05a1..9704ac5 100644 --- a/ui/views/layout/grid_layout.cc +++ b/ui/views/layout/grid_layout.cc
@@ -10,8 +10,8 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "ui/views/layout/layout_constants.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/view.h" -#include "ui/views/views_delegate.h" #include "ui/views/window/dialog_delegate.h" namespace views { @@ -652,8 +652,7 @@ // static GridLayout* GridLayout::CreatePanel(View* host) { GridLayout* layout = new GridLayout(host); - layout->SetInsets( - ViewsDelegate::GetInstance()->GetInsetsMetric(InsetsMetric::PANEL)); + layout->SetInsets(LayoutProvider::Get()->GetInsetsMetric(INSETS_PANEL)); host->SetLayoutManager(layout); return layout; }
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc new file mode 100644 index 0000000..926916d1 --- /dev/null +++ b/ui/views/layout/layout_provider.cc
@@ -0,0 +1,77 @@ +// Copyright 2017 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/views/layout/layout_provider.h" + +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "ui/base/material_design/material_design_controller.h" +#include "ui/views/layout/layout_constants.h" +#include "ui/views/views_delegate.h" + +namespace views { + +namespace { +LayoutProvider* g_layout_delegate = nullptr; +} + +LayoutProvider::LayoutProvider() { + g_layout_delegate = this; +} + +LayoutProvider::~LayoutProvider() { + if (this == g_layout_delegate) + g_layout_delegate = nullptr; +} + +// static +LayoutProvider* LayoutProvider::Get() { + return g_layout_delegate; +} + +gfx::Insets LayoutProvider::GetInsetsMetric(int metric) const { + DCHECK_LT(metric, VIEWS_INSETS_MAX); + switch (metric) { + case InsetsMetric::INSETS_DIALOG_BUTTON: + return gfx::Insets(0, kButtonHEdgeMarginNew, kButtonVEdgeMarginNew, + kButtonHEdgeMarginNew); + case InsetsMetric::INSETS_DIALOG_TITLE: + return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew, 0, + kButtonHEdgeMarginNew); + case InsetsMetric::INSETS_BUBBLE_CONTENTS: + return gfx::Insets(kPanelVertMargin, kPanelHorizMargin); + case InsetsMetric::INSETS_PANEL: + return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew); + case InsetsMetric::INSETS_VECTOR_IMAGE_BUTTON: + return gfx::Insets(kVectorButtonExtraTouchSize); + } + NOTREACHED(); + return gfx::Insets(); +} + +int LayoutProvider::GetDistanceMetric(int metric) const { + DCHECK_GE(metric, VIEWS_INSETS_MAX); + switch (metric) { + case DistanceMetric::DISTANCE_CLOSE_BUTTON_MARGIN: + return kCloseButtonMargin; + case DistanceMetric::DISTANCE_RELATED_BUTTON_HORIZONTAL: + return kRelatedButtonHSpacing; + case DistanceMetric::DISTANCE_RELATED_CONTROL_HORIZONTAL: + return kRelatedControlHorizontalSpacing; + case DistanceMetric::DISTANCE_RELATED_CONTROL_VERTICAL: + return kRelatedControlVerticalSpacing; + case DistanceMetric::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH: + return kDialogMinimumButtonWidth; + case DistanceMetric::DISTANCE_BUTTON_HORIZONTAL_PADDING: + return kButtonHorizontalPadding; + } + NOTREACHED(); + return 0; +} + +const TypographyProvider& LayoutProvider::GetTypographyProvider() const { + return typography_provider_; +} + +} // namespace views \ No newline at end of file
diff --git a/ui/views/layout/layout_provider.h b/ui/views/layout/layout_provider.h new file mode 100644 index 0000000..f00238f --- /dev/null +++ b/ui/views/layout/layout_provider.h
@@ -0,0 +1,94 @@ +// Copyright 2017 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_VIEWS_LAYOUT_LAYOUT_PROVIDER_H_ +#define UI_VIEWS_LAYOUT_LAYOUT_PROVIDER_H_ + +#include "base/macros.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/views/style/typography_provider.h" +#include "ui/views/views_export.h" + +namespace views { + +enum InsetsMetric { + // Embedders can extend this enum with additional values that are understood + // by the LayoutProvider implementation. Embedders define enum values from + // VIEWS_INSETS_END. Values named beginning with "INSETS_" represent the + // actual Insets: the rest are markers. + VIEWS_INSETS_START = 0, + + // The margins around the contents area of a bubble (popover)-style dialog. + INSETS_BUBBLE_CONTENTS = VIEWS_INSETS_START, + // The margins around the button row of a dialog. + INSETS_DIALOG_BUTTON, + // The margins around the icon/title of a dialog. + INSETS_DIALOG_TITLE, + // The margins that should be applied around a panel GridLayout. + INSETS_PANEL, + // Padding to add to vector image buttons to increase their click and touch + // target size. + INSETS_VECTOR_IMAGE_BUTTON, + + // Embedders must start Insets enum values from this value. + VIEWS_INSETS_END, + + // All Insets enum values must be below this value. + VIEWS_INSETS_MAX = 0x1000 +}; + +enum DistanceMetric { + // DistanceMetric enum values must always be greater than any InsetsMetric + // value. This allows the code to verify at runtime that arguments of the + // two types have not been interchanged. + VIEWS_DISTANCE_START = VIEWS_INSETS_MAX, + + // The default padding to add on each side of a button's label. + DISTANCE_BUTTON_HORIZONTAL_PADDING = VIEWS_DISTANCE_START, + // The distance between a dialog's edge and the close button in the upper + // trailing corner. + DISTANCE_CLOSE_BUTTON_MARGIN, + // The default minimum width of a dialog button. + DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH, + // The spacing between a pair of related horizontal buttons, used for + // dialog layout. + DISTANCE_RELATED_BUTTON_HORIZONTAL, + // Horizontal spacing between controls that are logically related. + DISTANCE_RELATED_CONTROL_HORIZONTAL, + // The spacing between a pair of related vertical controls, used for + // dialog layout. + DISTANCE_RELATED_CONTROL_VERTICAL, + + // Embedders must start DistanceMetric enum values from here. + VIEWS_DISTANCE_END +}; + +class VIEWS_EXPORT LayoutProvider { + public: + LayoutProvider(); + virtual ~LayoutProvider(); + + // This should never return nullptr. + static LayoutProvider* Get(); + + // Returns the insets metric according to the given enumeration element. + virtual gfx::Insets GetInsetsMetric(int metric) const; + + // Returns the distance metric between elements according to the given + // enumeration element. + virtual int GetDistanceMetric(int metric) const; + + // Returns the TypographyProvider, used to configure text properties such as + // font, weight, color, size, and line height. Never null. + virtual const TypographyProvider& GetTypographyProvider() const; + + private: + DefaultTypographyProvider typography_provider_; + + DISALLOW_COPY_AND_ASSIGN(LayoutProvider); +}; + +} // namespace views + +#endif // UI_VIEWS_LAYOUT_LAYOUT_PROVIDER_H_
diff --git a/ui/views/mus/aura_init.cc b/ui/views/mus/aura_init.cc index fe7406c..7f73dc1 100644 --- a/ui/views/mus/aura_init.cc +++ b/ui/views/mus/aura_init.cc
@@ -19,6 +19,7 @@ #include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_paths.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/mus/mus_client.h" #include "ui/views/style/typography_provider.h" #include "ui/views/views_delegate.h" @@ -44,11 +45,7 @@ Widget::InitParams* params, internal::NativeWidgetDelegate* delegate) override {} - const TypographyProvider& GetTypographyProvider() const override { - return typography_provider_; - } - - DefaultTypographyProvider typography_provider_; + LayoutProvider layout_provider_; DISALLOW_COPY_AND_ASSIGN(MusViewsDelegate); };
diff --git a/ui/views/style/typography.cc b/ui/views/style/typography.cc index 404c76e..034d56d 100644 --- a/ui/views/style/typography.cc +++ b/ui/views/style/typography.cc
@@ -5,8 +5,8 @@ #include "ui/views/style/typography.h" #include "base/logging.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/style/typography_provider.h" -#include "ui/views/views_delegate.h" namespace views { namespace style { @@ -22,19 +22,19 @@ const gfx::FontList& GetFont(int text_context, int text_style) { ValidateContextAndStyle(text_context, text_style); - return ViewsDelegate::GetInstance()->GetTypographyProvider().GetFont( - text_context, text_style); + return LayoutProvider::Get()->GetTypographyProvider().GetFont(text_context, + text_style); } SkColor GetColor(int text_context, int text_style) { ValidateContextAndStyle(text_context, text_style); - return ViewsDelegate::GetInstance()->GetTypographyProvider().GetColor( - text_context, text_style); + return LayoutProvider::Get()->GetTypographyProvider().GetColor(text_context, + text_style); } int GetLineHeight(int text_context, int text_style) { ValidateContextAndStyle(text_context, text_style); - return ViewsDelegate::GetInstance()->GetTypographyProvider().GetLineHeight( + return LayoutProvider::Get()->GetTypographyProvider().GetLineHeight( text_context, text_style); }
diff --git a/ui/views/test/scoped_views_test_helper.cc b/ui/views/test/scoped_views_test_helper.cc index 05727db..7a8da8d 100644 --- a/ui/views/test/scoped_views_test_helper.cc +++ b/ui/views/test/scoped_views_test_helper.cc
@@ -22,7 +22,7 @@ ScopedViewsTestHelper::ScopedViewsTestHelper( std::unique_ptr<TestViewsDelegate> views_delegate) - : views_delegate_(std::move(views_delegate)), + : test_views_delegate_(std::move(views_delegate)), platform_test_helper_(PlatformTestHelper::Create()) { // The ContextFactory must exist before any Compositors are created. ui::ContextFactory* context_factory = nullptr; @@ -30,8 +30,8 @@ platform_test_helper_->InitializeContextFactory(&context_factory, &context_factory_private); - views_delegate_->set_context_factory(context_factory); - views_delegate_->set_context_factory_private(context_factory_private); + test_views_delegate_->set_context_factory(context_factory); + test_views_delegate_->set_context_factory_private(context_factory_private); test_helper_.reset(ViewsTestHelper::Create(base::MessageLoopForUI::current(), context_factory, @@ -49,7 +49,7 @@ test_helper_->TearDown(); test_helper_.reset(); - views_delegate_.reset(); + test_views_delegate_.reset(); // The Mus PlatformTestHelper has state that is deleted by // ui::TerminateContextFactoryForTests().
diff --git a/ui/views/test/scoped_views_test_helper.h b/ui/views/test/scoped_views_test_helper.h index bac1de0..c9f83d78 100644 --- a/ui/views/test/scoped_views_test_helper.h +++ b/ui/views/test/scoped_views_test_helper.h
@@ -37,14 +37,16 @@ // the RootWindow. Everywhere else, null. gfx::NativeWindow GetContext(); - TestViewsDelegate* views_delegate() { return views_delegate_.get(); }; + TestViewsDelegate* test_views_delegate() { + return test_views_delegate_.get(); + } PlatformTestHelper* platform_test_helper() { return platform_test_helper_.get(); } private: - std::unique_ptr<TestViewsDelegate> views_delegate_; + std::unique_ptr<TestViewsDelegate> test_views_delegate_; std::unique_ptr<ViewsTestHelper> test_helper_; std::unique_ptr<PlatformTestHelper> platform_test_helper_;
diff --git a/ui/views/test/test_views_delegate.h b/ui/views/test/test_views_delegate.h index 222548f..377ea061 100644 --- a/ui/views/test/test_views_delegate.h +++ b/ui/views/test/test_views_delegate.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "build/build_config.h" -#include "ui/views/style/typography_provider.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/views_delegate.h" namespace views { @@ -40,6 +40,13 @@ context_factory_private_ = context_factory_private; } + // For convenience, we create a layout provider by default, but embedders + // that use their own layout provider subclasses may need to set those classes + // as the layout providers for their tests. + void set_layout_provider(std::unique_ptr<LayoutProvider> layout_provider) { + layout_provider_.swap(layout_provider); + } + // ViewsDelegate: #if defined(OS_WIN) HICON GetSmallWindowIcon() const override; @@ -48,14 +55,14 @@ internal::NativeWidgetDelegate* delegate) override; ui::ContextFactory* GetContextFactory() override; ui::ContextFactoryPrivate* GetContextFactoryPrivate() override; - const TypographyProvider& GetTypographyProvider() const override; private: ui::ContextFactory* context_factory_; ui::ContextFactoryPrivate* context_factory_private_; bool use_desktop_native_widgets_; bool use_transparent_windows_; - DefaultTypographyProvider typography_provider_; + std::unique_ptr<LayoutProvider> layout_provider_ = + base::MakeUnique<LayoutProvider>(); DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate); };
diff --git a/ui/views/test/test_views_delegate_aura.cc b/ui/views/test/test_views_delegate_aura.cc index 6571971..cf4588a 100644 --- a/ui/views/test/test_views_delegate_aura.cc +++ b/ui/views/test/test_views_delegate_aura.cc
@@ -59,8 +59,4 @@ return nullptr; } -const TypographyProvider& TestViewsDelegate::GetTypographyProvider() const { - return typography_provider_; -} - } // namespace views
diff --git a/ui/views/test/test_views_delegate_mac.mm b/ui/views/test/test_views_delegate_mac.mm index f2f72a0..6c9a574 100644 --- a/ui/views/test/test_views_delegate_mac.mm +++ b/ui/views/test/test_views_delegate_mac.mm
@@ -38,8 +38,4 @@ return context_factory_private_; } -const TypographyProvider& TestViewsDelegate::GetTypographyProvider() const { - return typography_provider_; -} - } // namespace views
diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h index ebdc440..96763d0 100644 --- a/ui/views/test/views_test_base.h +++ b/ui/views/test/views_test_base.h
@@ -49,8 +49,8 @@ void SimulateNativeDestroy(Widget* widget); protected: - TestViewsDelegate* views_delegate() const { - return test_helper_->views_delegate(); + TestViewsDelegate* test_views_delegate() const { + return test_helper_->test_views_delegate(); } void set_views_delegate(std::unique_ptr<TestViewsDelegate> views_delegate) {
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc index b4b2a1e..42ba4f3 100644 --- a/ui/views/view_unittest.cc +++ b/ui/views/view_unittest.cc
@@ -4211,14 +4211,14 @@ widget()->SetContentsView(content_view); content_view->SetPaintToLayer(); GetRootLayer()->GetCompositor()->ScheduleDraw(); - ui::DrawWaiterForTest::WaitForCompositingStarted( + ui::DrawWaiterForTest::WaitForCompositingEnded( GetRootLayer()->GetCompositor()); GetRootLayer()->SchedulePaint(gfx::Rect(0, 0, 10, 10)); content_view->set_painted(false); // content_view no longer has a dirty rect. Paint from the root and make sure // PaintTrackingView isn't painted. GetRootLayer()->GetCompositor()->ScheduleDraw(); - ui::DrawWaiterForTest::WaitForCompositingStarted( + ui::DrawWaiterForTest::WaitForCompositingEnded( GetRootLayer()->GetCompositor()); EXPECT_FALSE(content_view->painted()); @@ -4226,7 +4226,7 @@ // PaintTrackingView is painted. content_view->layer()->SchedulePaint(gfx::Rect(0, 0, 10, 10)); GetRootLayer()->GetCompositor()->ScheduleDraw(); - ui::DrawWaiterForTest::WaitForCompositingStarted( + ui::DrawWaiterForTest::WaitForCompositingEnded( GetRootLayer()->GetCompositor()); EXPECT_TRUE(content_view->painted()); }
diff --git a/ui/views/views_delegate.cc b/ui/views/views_delegate.cc index e1dda80..a9b3022 100644 --- a/ui/views/views_delegate.cc +++ b/ui/views/views_delegate.cc
@@ -21,6 +21,20 @@ } +ViewsDelegate::ViewsDelegate() + : editing_controller_factory_(new ViewsTouchEditingControllerFactory) { + DCHECK(!views_delegate); + views_delegate = this; + + ui::TouchEditingControllerFactory::SetInstance( + editing_controller_factory_.get()); + +#if defined(USE_AURA) + touch_selection_menu_runner_ = + base::MakeUnique<TouchSelectionMenuRunnerViews>(); +#endif +} + ViewsDelegate::~ViewsDelegate() { ui::TouchEditingControllerFactory::SetInstance(nullptr); @@ -126,54 +140,4 @@ return nullptr; } -gfx::Insets ViewsDelegate::GetInsetsMetric(InsetsMetric metric) const { - switch (metric) { - case InsetsMetric::BUBBLE_CONTENTS: - return gfx::Insets(kPanelVertMargin, kPanelHorizMargin); - case InsetsMetric::DIALOG_BUTTON: - return gfx::Insets(0, kButtonHEdgeMarginNew, kButtonVEdgeMarginNew, - kButtonHEdgeMarginNew); - case InsetsMetric::DIALOG_TITLE: - return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew, 0, - kButtonHEdgeMarginNew); - case InsetsMetric::PANEL: - return gfx::Insets(kPanelVertMargin, kButtonHEdgeMarginNew); - case InsetsMetric::VECTOR_IMAGE_BUTTON_PADDING: - return gfx::Insets(kVectorButtonExtraTouchSize); - } - NOTREACHED(); - return gfx::Insets(); -} - -int ViewsDelegate::GetDistanceMetric(DistanceMetric metric) const { - switch (metric) { - case DistanceMetric::CLOSE_BUTTON_MARGIN: - return kCloseButtonMargin; - case DistanceMetric::RELATED_BUTTON_HORIZONTAL: - return kRelatedButtonHSpacing; - case DistanceMetric::RELATED_CONTROL_HORIZONTAL: - return kRelatedControlHorizontalSpacing; - case DistanceMetric::RELATED_CONTROL_VERTICAL: - return kRelatedControlVerticalSpacing; - case DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH: - return kDialogMinimumButtonWidth; - case DistanceMetric::BUTTON_HORIZONTAL_PADDING: - return kButtonHorizontalPadding; - } - NOTREACHED(); - return 0; -} - -ViewsDelegate::ViewsDelegate() - : views_tsc_factory_(new ViewsTouchEditingControllerFactory) { - DCHECK(!views_delegate); - views_delegate = this; - - ui::TouchEditingControllerFactory::SetInstance(views_tsc_factory_.get()); - -#if defined(USE_AURA) - touch_selection_menu_runner_.reset(new TouchSelectionMenuRunnerViews()); -#endif -} - } // namespace views
diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h index c9d6a1fb..b869e7b3 100644 --- a/ui/views/views_delegate.h +++ b/ui/views/views_delegate.h
@@ -48,7 +48,6 @@ class NativeWidget; class NonClientFrameView; class ViewsTouchEditingControllerFactory; -class TypographyProvider; class View; class Widget; @@ -62,38 +61,6 @@ class NativeWidgetDelegate; } -enum class InsetsMetric { - // The margins around the contents area of a bubble (popover)-style dialog. - BUBBLE_CONTENTS, - // The margins around the button row of a dialog. - DIALOG_BUTTON, - // The margins around the icon/title of a dialog. - DIALOG_TITLE, - // The margins that should be applied around a panel GridLayout. - PANEL, - // Padding to add to vector image buttons to increase their click and touch - // target size. - VECTOR_IMAGE_BUTTON_PADDING, -}; - -enum class DistanceMetric { - // The default padding to add on each side of a button's label. - BUTTON_HORIZONTAL_PADDING, - // The distance between a dialog's edge and the close button in the upper - // trailing corner. - CLOSE_BUTTON_MARGIN, - // The default minimum width of a dialog button. - DIALOG_BUTTON_MINIMUM_WIDTH, - // The spacing between a pair of related horizontal buttons, used for - // dialog layout. - RELATED_BUTTON_HORIZONTAL, - // Horizontal spacing between controls that are logically related. - RELATED_CONTROL_HORIZONTAL, - // The spacing between a pair of related vertical controls, used for - // dialog layout. - RELATED_CONTROL_VERTICAL, -}; - // ViewsDelegate is an interface implemented by an object using the views // framework. It is used to obtain various high level application utilities // and perform some actions such as window placement saving. @@ -249,22 +216,12 @@ // Returns a blocking pool task runner given a TaskRunnerType. virtual scoped_refptr<base::TaskRunner> GetBlockingPoolTaskRunner(); - // Returns the insets metric according to the given enumeration element. - virtual gfx::Insets GetInsetsMetric(InsetsMetric metric) const; - - // Returns the distance metric between elements according to the given - // enumeration element. - virtual int GetDistanceMetric(DistanceMetric metric) const; - - // Returns the TypographyProvider, used to configure text properties such as - // font, weight, color, size, and line height. Never null. - virtual const TypographyProvider& GetTypographyProvider() const = 0; - protected: ViewsDelegate(); private: - std::unique_ptr<ViewsTouchEditingControllerFactory> views_tsc_factory_; + std::unique_ptr<ViewsTouchEditingControllerFactory> + editing_controller_factory_; #if defined(USE_AURA) std::unique_ptr<TouchSelectionMenuRunnerViews> touch_selection_menu_runner_;
diff --git a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc index 862495c..21cd3ff 100644 --- a/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11_unittest.cc
@@ -408,7 +408,7 @@ // ViewsTestBase: void SetUp() override { ViewsTestBase::SetUp(); - views_delegate()->set_use_desktop_native_widgets(true); + test_views_delegate()->set_use_desktop_native_widgets(true); // Create widget to initiate the drags. widget_.reset(new Widget);
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc index 6321b2b3..80a45ec 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc
@@ -380,7 +380,7 @@ void SetUp() override { ViewsTestBase::SetUp(); - views_delegate()->set_use_desktop_native_widgets(true); + test_views_delegate()->set_use_desktop_native_widgets(true); } private:
diff --git a/ui/views/widget/root_view_unittest.cc b/ui/views/widget/root_view_unittest.cc index 54eeee2..c90b99c7 100644 --- a/ui/views/widget/root_view_unittest.cc +++ b/ui/views/widget/root_view_unittest.cc
@@ -577,7 +577,7 @@ widget->CloseNow(); // Also test Aura desktop Widget codepaths. - views_delegate()->set_use_desktop_native_widgets(true); + test_views_delegate()->set_use_desktop_native_widgets(true); delegate = new RootViewTestDialogDelegate(); widget = DialogDelegate::CreateDialogWidget(delegate, GetContext(), nullptr); EXPECT_EQ(1, delegate->layout_count());
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc index 49894fc7..a2f699d 100644 --- a/ui/views/widget/widget_interactive_uitest.cc +++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -968,7 +968,7 @@ // Test that touch selection quick menu is not activated when opened. TEST_F(WidgetTestInteractive, TouchSelectionQuickMenuIsNotActivated) { #if defined(OS_WIN) - views_delegate()->set_use_desktop_native_widgets(true); + test_views_delegate()->set_use_desktop_native_widgets(true); #endif // !defined(OS_WIN) Widget* widget = CreateWidget(); @@ -999,7 +999,7 @@ TEST_F(WidgetTestInteractive, DisableViewDoesNotActivateWidget) { #if defined(OS_WIN) - views_delegate()->set_use_desktop_native_widgets(true); + test_views_delegate()->set_use_desktop_native_widgets(true); #endif // !defined(OS_WIN) // Create first widget and view, activate the widget, and focus the view.
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc index 5d543a7..3cd043e 100644 --- a/ui/views/window/dialog_client_view.cc +++ b/ui/views/window/dialog_client_view.cc
@@ -16,8 +16,8 @@ #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/button/md_text_button.h" #include "ui/views/layout/grid_layout.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/style/platform_style.h" -#include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/window/dialog_delegate.h" @@ -75,8 +75,8 @@ DialogClientView::DialogClientView(Widget* owner, View* contents_view) : ClientView(owner, contents_view), - button_row_insets_(ViewsDelegate::GetInstance()->GetInsetsMetric( - InsetsMetric::DIALOG_BUTTON)) { + button_row_insets_( + LayoutProvider::Get()->GetInsetsMetric(INSETS_DIALOG_BUTTON)) { // Doing this now ensures this accelerator will have lower priority than // one set by the contents view. AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)); @@ -281,8 +281,8 @@ button = MdTextButton::CreateSecondaryUiButton(this, title); } - const int minimum_width = ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH); + const int minimum_width = LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH); button->SetMinSize(gfx::Size(minimum_width, 0)); button->SetGroup(kButtonGroup); @@ -301,8 +301,8 @@ if (GetDialogDelegate()->GetExtraViewPadding(&extra_view_padding)) return extra_view_padding; - return ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_BUTTON_HORIZONTAL); + return LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_BUTTON_HORIZONTAL); } std::array<View*, DialogClientView::kNumButtons> @@ -341,8 +341,8 @@ // They expect GetDialogRelatedControlVerticalSpacing() in this case. // TODO(tapted): Remove this under Harmony. if (insets.top() == 0) { - const int top = ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_CONTROL_VERTICAL); + const int top = LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_CONTROL_VERTICAL); insets.Set(top, insets.left(), insets.bottom(), insets.right()); } @@ -356,8 +356,8 @@ // GetExtraViewSpacing() handles <pad+stretchy>. const int button_spacing = (ok_button_ && cancel_button_) - ? ViewsDelegate::GetInstance()->GetDistanceMetric( - views::DistanceMetric::RELATED_BUTTON_HORIZONTAL) + ? LayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_BUTTON_HORIZONTAL) : 0; constexpr int kButtonRowId = 0;
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc index 05689655..fd977cd 100644 --- a/ui/views/window/dialog_delegate.cc +++ b/ui/views/window/dialog_delegate.cc
@@ -16,8 +16,8 @@ #include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/layout/layout_constants.h" +#include "ui/views/layout/layout_provider.h" #include "ui/views/style/platform_style.h" -#include "ui/views/views_delegate.h" #include "ui/views/widget/widget.h" #include "ui/views/widget/widget_observer.h" #include "ui/views/window/dialog_client_view.h" @@ -201,7 +201,7 @@ Widget* widget, const gfx::Insets& content_margins) { BubbleFrameView* frame = new BubbleFrameView( - ViewsDelegate::GetInstance()->GetInsetsMetric(InsetsMetric::DIALOG_TITLE), + LayoutProvider::Get()->GetInsetsMetric(INSETS_DIALOG_TITLE), content_margins); const BubbleBorder::Shadow kShadow = BubbleBorder::SMALL_SHADOW; std::unique_ptr<BubbleBorder> border(