diff --git a/DEPS b/DEPS
index cb4626a..2ca4243 100644
--- a/DEPS
+++ b/DEPS
@@ -41,11 +41,11 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '311cc6b39a3e5f792dc9081ea19e42b930426b99',
+  'skia_revision': '24a9cec8c47aa0307977616744e3552b0715de4e',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': '2bd685dadeb1eac3466a94e607883274c8b7bddc',
+  'v8_revision': '3024b9faa8799f1e46ebe4beb23e124ab892d269',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling swarming_client
   # and whatever else without interference from each other.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
index ab2d197e..7e51bd5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java
@@ -143,10 +143,6 @@
                 .apply();
     }
 
-    public static void logRendererCrash() {
-        nativeLogRendererCrash();
-    }
-
     /**
      * Updates the metrics services based on a change of consent. This can happen during first-run
      * flow, and when the user changes their preferences.
@@ -205,7 +201,6 @@
     private static native void nativeUpdateMetricsServiceState(boolean mayUpload);
     private native void nativeUmaResumeSession(long nativeUmaSessionStats);
     private native void nativeUmaEndSession(long nativeUmaSessionStats);
-    private static native void nativeLogRendererCrash();
     private static native void nativeRegisterExternalExperiment(
             String studyName, int[] experimentIds);
     private static native void nativeRegisterSyntheticFieldTrial(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
index b2b2d68..34c9e9fa 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java
@@ -17,7 +17,6 @@
 import org.chromium.chrome.browser.AppHooks;
 import org.chromium.chrome.browser.fullscreen.FullscreenManager;
 import org.chromium.chrome.browser.media.MediaCaptureNotificationService;
-import org.chromium.chrome.browser.metrics.UmaSessionStats;
 import org.chromium.chrome.browser.metrics.UmaUtils;
 import org.chromium.chrome.browser.policy.PolicyAuditor;
 import org.chromium.chrome.browser.policy.PolicyAuditor.AuditEvent;
@@ -125,7 +124,7 @@
             rendererCrashStatus = TAB_RENDERER_CRASH_STATUS_SHOWN_IN_FOREGROUND_APP;
             mTab.showSadTab();
             // This is necessary to correlate histogram data with stability counts.
-            UmaSessionStats.logRendererCrash();
+            RecordHistogram.recordBooleanHistogram("Stability.Android.RendererCrash", true);
         }
         RecordHistogram.recordEnumeratedHistogram(
                 "Tab.RendererCrashStatus", rendererCrashStatus, TAB_RENDERER_CRASH_STATUS_MAX);
diff --git a/chrome/browser/android/metrics/uma_session_stats.cc b/chrome/browser/android/metrics/uma_session_stats.cc
index f2a557f1..d4b229ce 100644
--- a/chrome/browser/android/metrics/uma_session_stats.cc
+++ b/chrome/browser/android/metrics/uma_session_stats.cc
@@ -143,18 +143,6 @@
       may_upload);
 }
 
-// Renderer process crashed in the foreground.
-static void LogRendererCrash(JNIEnv*, const JavaParamRef<jclass>&) {
-  DCHECK(g_browser_process);
-  // Increment the renderer crash count in stability metrics.
-  PrefService* pref = g_browser_process->local_state();
-  DCHECK(pref);
-  int value = pref->GetInteger(metrics::prefs::kStabilityRendererCrashCount);
-  pref->SetInteger(metrics::prefs::kStabilityRendererCrashCount, value + 1);
-  // Migrate proto to histogram to repurpose proto count.
-  UMA_HISTOGRAM_BOOLEAN("Stability.Android.RendererCrash", true);
-}
-
 static void RegisterExternalExperiment(
     JNIEnv* env,
     const JavaParamRef<jclass>& clazz,
diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc
index 4bf799d3..2fa67b6 100644
--- a/chrome/browser/chrome_browser_main_android.cc
+++ b/chrome/browser/chrome_browser_main_android.cc
@@ -21,6 +21,7 @@
 #include "components/crash/content/app/breakpad_linux.h"
 #include "components/crash/content/browser/child_process_crash_observer_android.h"
 #include "components/crash/content/browser/crash_dump_observer_android.h"
+#include "components/metrics/stability_metrics_helper.h"
 #include "components/signin/core/browser/signin_manager.h"
 #include "content/public/browser/android/compositor.h"
 #include "content/public/browser/browser_thread.h"
@@ -41,6 +42,15 @@
 int ChromeBrowserMainPartsAndroid::PreCreateThreads() {
   TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreCreateThreads")
 
+  // Auto-detect based on en-US whether secondary locale .pak files exist.
+  ui::SetLoadSecondaryLocalePaks(
+      !ui::GetPathForAndroidLocalePakWithinApk("en-US").empty());
+
+  // |g_browser_process| is created in PreCreateThreads(), this has to be done
+  // before accessing |g_browser_process| below when creating
+  // ChildProcessCrashObserver.
+  int result_code = ChromeBrowserMainParts::PreCreateThreads();
+
   // The ChildProcessCrashObserver must be registered before any child
   // process is created (as it needs to be notified during child
   // process creation). Such processes are created on the
@@ -67,14 +77,13 @@
     PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dump_dir);
     breakpad::CrashDumpObserver::GetInstance()->RegisterClient(
         base::MakeUnique<breakpad::ChildProcessCrashObserver>(
-            crash_dump_dir, kAndroidMinidumpDescriptor));
+            crash_dump_dir, kAndroidMinidumpDescriptor,
+            base::Bind(
+                &metrics::StabilityMetricsHelper::IncreaseRendererCrashCount,
+                g_browser_process->local_state())));
   }
 
-  // Auto-detect based on en-US whether secondary locale .pak files exist.
-  ui::SetLoadSecondaryLocalePaks(
-      !ui::GetPathForAndroidLocalePakWithinApk("en-US").empty());
-
-  return ChromeBrowserMainParts::PreCreateThreads();
+  return result_code;
 }
 
 void ChromeBrowserMainPartsAndroid::PostProfileInit() {
diff --git a/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc b/chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.cc
similarity index 70%
rename from chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc
rename to chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.cc
index 290439b5..7e266ef1 100644
--- a/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.cc
+++ b/chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.cc
@@ -3,7 +3,7 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
-#include "chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.h"
+#include "chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.h"
 
 #include <vector>
 
@@ -33,9 +33,11 @@
 const base::FilePath::CharType kMockTimer[] =
     FILE_PATH_LITERAL("mock_timer.js");
 
-const char kVirtualKeyboardTestDir[] = "chromeos/virtual_keyboard";
+const char kVirtualKeyboardExtensionTestDir[] =
+    "chromeos/virtual_keyboard/default_extension";
 
-const char kBaseKeyboardTestFramework[] = "virtual_keyboard_test_base.js";
+const char kBaseKeyboardExtensionTestFramework[] =
+    "virtual_keyboard_test_base.js";
 
 const char kExtensionId[] = "mppnpdlheglhdfmldimlhpnegondlapf";
 
@@ -46,23 +48,24 @@
 
 }  // namespace
 
-VirtualKeyboardBrowserTestConfig::VirtualKeyboardBrowserTestConfig()
-    : base_framework_(kBaseKeyboardTestFramework),
+DefaultKeyboardExtensionBrowserTestConfig::
+    DefaultKeyboardExtensionBrowserTestConfig()
+    : base_framework_(kBaseKeyboardExtensionTestFramework),
       extension_id_(kExtensionId),
-      test_dir_(kVirtualKeyboardTestDir),
-      url_(kVirtualKeyboardURL) {
-}
+      test_dir_(kVirtualKeyboardExtensionTestDir),
+      url_(kVirtualKeyboardURL) {}
 
-VirtualKeyboardBrowserTestConfig::~VirtualKeyboardBrowserTestConfig() {}
+DefaultKeyboardExtensionBrowserTestConfig::
+    ~DefaultKeyboardExtensionBrowserTestConfig() {}
 
-void VirtualKeyboardBrowserTest::SetUpCommandLine(
+void DefaultKeyboardExtensionBrowserTest::SetUpCommandLine(
     base::CommandLine* command_line) {
   command_line->AppendSwitch(keyboard::switches::kEnableVirtualKeyboard);
 }
 
-void VirtualKeyboardBrowserTest::RunTest(
+void DefaultKeyboardExtensionBrowserTest::RunTest(
     const base::FilePath& file,
-    const VirtualKeyboardBrowserTestConfig& config) {
+    const DefaultKeyboardExtensionBrowserTestConfig& config) {
   ui_test_utils::NavigateToURL(browser(), GURL(config.url_));
   content::WebContents* web_contents =
       browser()->tab_strip_model()->GetActiveWebContents();
@@ -84,14 +87,15 @@
   EXPECT_TRUE(ExecuteWebUIResourceTest(web_contents, resource_ids));
 }
 
-void VirtualKeyboardBrowserTest::ShowVirtualKeyboard() {
+void DefaultKeyboardExtensionBrowserTest::ShowVirtualKeyboard() {
   aura::Window* window = ash::Shell::GetPrimaryRootWindow();
   ui::InputMethod* input_method = window->GetHost()->GetInputMethod();
   ASSERT_TRUE(input_method);
   input_method->ShowImeIfNeeded();
 }
 
-content::RenderViewHost* VirtualKeyboardBrowserTest::GetKeyboardRenderViewHost(
+content::RenderViewHost*
+DefaultKeyboardExtensionBrowserTest::GetKeyboardRenderViewHost(
     const std::string& id) {
   ShowVirtualKeyboard();
   GURL url = extensions::Extension::GetBaseURLFromExtensionId(id);
@@ -110,8 +114,9 @@
   return NULL;
 }
 
-void VirtualKeyboardBrowserTest::InjectJavascript(const base::FilePath& dir,
-                                                  const base::FilePath& file) {
+void DefaultKeyboardExtensionBrowserTest::InjectJavascript(
+    const base::FilePath& dir,
+    const base::FilePath& file) {
   base::FilePath path = ui_test_utils::GetTestFilePath(dir, file);
   std::string library_content;
   ASSERT_TRUE(base::ReadFileToString(path, &library_content)) << path.value();
@@ -119,65 +124,63 @@
   utf8_content_.append(";\n");
 }
 
-// Disabled. http://crbug.com/758697
-IN_PROC_BROWSER_TEST_F(VirtualKeyboardBrowserTest, TypingTest) {
+IN_PROC_BROWSER_TEST_F(DefaultKeyboardExtensionBrowserTest, TypingTest) {
   RunTest(base::FilePath(FILE_PATH_LITERAL("typing_test.js")),
-          VirtualKeyboardBrowserTestConfig());
+          DefaultKeyboardExtensionBrowserTestConfig());
 }
 
-// Disabled. http://crbug.com/758697
-IN_PROC_BROWSER_TEST_F(VirtualKeyboardBrowserTest, LayoutTest) {
+IN_PROC_BROWSER_TEST_F(DefaultKeyboardExtensionBrowserTest, LayoutTest) {
   RunTest(base::FilePath(FILE_PATH_LITERAL("layout_test.js")),
-          VirtualKeyboardBrowserTestConfig());
+          DefaultKeyboardExtensionBrowserTestConfig());
 }
 
-// Disabled. http://crbug.com/758697
-IN_PROC_BROWSER_TEST_F(VirtualKeyboardBrowserTest, ModifierTest) {
+IN_PROC_BROWSER_TEST_F(DefaultKeyboardExtensionBrowserTest, ModifierTest) {
   RunTest(base::FilePath(FILE_PATH_LITERAL("modifier_test.js")),
-          VirtualKeyboardBrowserTestConfig());
+          DefaultKeyboardExtensionBrowserTestConfig());
 }
 
-IN_PROC_BROWSER_TEST_F(VirtualKeyboardBrowserTest, HideKeyboardKeyTest) {
+IN_PROC_BROWSER_TEST_F(DefaultKeyboardExtensionBrowserTest,
+                       HideKeyboardKeyTest) {
   RunTest(base::FilePath(FILE_PATH_LITERAL("hide_keyboard_key_test.js")),
-          VirtualKeyboardBrowserTestConfig());
+          DefaultKeyboardExtensionBrowserTestConfig());
 }
 
-IN_PROC_BROWSER_TEST_F(VirtualKeyboardBrowserTest, IsKeyboardLoaded) {
+IN_PROC_BROWSER_TEST_F(DefaultKeyboardExtensionBrowserTest, IsKeyboardLoaded) {
   content::RenderViewHost* keyboard_rvh =
       GetKeyboardRenderViewHost(kExtensionId);
   ASSERT_TRUE(keyboard_rvh);
   bool loaded = false;
   std::string script = "!!chrome.virtualKeyboardPrivate";
   EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
-      keyboard_rvh,
-      "window.domAutomationController.send(" + script + ");",
+      keyboard_rvh, "window.domAutomationController.send(" + script + ");",
       &loaded));
   // Catches the regression in crbug.com/308653.
   ASSERT_TRUE(loaded);
 }
 
 // Disabled; http://crbug.com/515596
-IN_PROC_BROWSER_TEST_F(VirtualKeyboardBrowserTest, DISABLED_EndToEndTest) {
+IN_PROC_BROWSER_TEST_F(DefaultKeyboardExtensionBrowserTest,
+                       DISABLED_EndToEndTest) {
   // Get the virtual keyboard's render view host.
   content::RenderViewHost* keyboard_rvh =
       GetKeyboardRenderViewHost(kExtensionId);
   ASSERT_TRUE(keyboard_rvh);
 
   // Get the test page's render view host.
-  content::RenderViewHost* browser_rvh = browser()->tab_strip_model()->
-      GetActiveWebContents()->GetRenderViewHost();
+  content::RenderViewHost* browser_rvh =
+      browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost();
   ASSERT_TRUE(browser_rvh);
 
   // Set up the test page.
   GURL url = ui_test_utils::GetTestUrl(
       base::FilePath(),
       base::FilePath(FILE_PATH_LITERAL(
-          "chromeos/virtual_keyboard/end_to_end_test.html")));
+          "chromeos/virtual_keyboard/default_extension/end_to_end_test.html")));
   ui_test_utils::NavigateToURL(browser(), url);
 
   // Press 'a' on keyboard.
   base::FilePath path = ui_test_utils::GetTestFilePath(
-      base::FilePath(FILE_PATH_LITERAL(kVirtualKeyboardTestDir)),
+      base::FilePath(FILE_PATH_LITERAL(kVirtualKeyboardExtensionTestDir)),
       base::FilePath(FILE_PATH_LITERAL("end_to_end_test.js")));
   std::string script;
   ASSERT_TRUE(base::ReadFileToString(path, &script));
@@ -185,8 +188,7 @@
   // Verify 'a' appeared on test page.
   bool success = false;
   EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
-      browser_rvh,
-      "success ? verifyInput('a') : waitForInput('a');",
+      browser_rvh, "success ? verifyInput('a') : waitForInput('a');",
       &success));
   ASSERT_TRUE(success);
 }
diff --git a/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.h b/chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.h
similarity index 72%
rename from chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.h
rename to chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.h
index ff6e052..b028ae12 100644
--- a/chrome/browser/chromeos/extensions/virtual_keyboard_browsertest.h
+++ b/chrome/browser/chromeos/extensions/default_keyboard_extension_browser_test.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 CHROME_BROWSER_CHROMEOS_EXTENSIONS_VIRTUAL_KEYBOARD_BROWSERTEST_H_
-#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_VIRTUAL_KEYBOARD_BROWSERTEST_H_
+#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_DEFAULT_KEYBOARD_EXTENSION_BROWSER_TEST_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_DEFAULT_KEYBOARD_EXTENSION_BROWSER_TEST_H_
 
 #include "base/files/file_path.h"
 #include "chrome/test/base/in_process_browser_test.h"
@@ -12,17 +12,17 @@
 namespace base {
 class CommandLine;
 class FilePath;
-}
+}  // namespace base
 
 namespace content {
 class RenderViewHost;
 }
 
 // See the .cc for default values.
-struct VirtualKeyboardBrowserTestConfig {
-  VirtualKeyboardBrowserTestConfig();
+struct DefaultKeyboardExtensionBrowserTestConfig {
+  DefaultKeyboardExtensionBrowserTestConfig();
 
-  ~VirtualKeyboardBrowserTestConfig();
+  ~DefaultKeyboardExtensionBrowserTestConfig();
 
   // The filename of the base framework. This file should be in |test_dir_|.
   std::string base_framework_;
@@ -37,12 +37,12 @@
   std::string url_;
 };
 
-class VirtualKeyboardBrowserTest : public InProcessBrowserTest {
+class DefaultKeyboardExtensionBrowserTest : public InProcessBrowserTest {
  public:
   // Injects javascript in |file| into the keyboard page and runs the methods in
   // |file| whose names match the expression "test*".
   void RunTest(const base::FilePath& file,
-               const VirtualKeyboardBrowserTestConfig& config);
+               const DefaultKeyboardExtensionBrowserTestConfig& config);
 
   void ShowVirtualKeyboard();
 
@@ -62,4 +62,4 @@
   std::string utf8_content_;
 };
 
-#endif  // CHROME_BROWSER_CHROMEOS_EXTENSIONS_VIRTUAL_KEYBOARD_BROWSERTEST_H_
+#endif  // CHROME_BROWSER_CHROMEOS_EXTENSIONS_DEFAULT_KEYBOARD_EXTENSION_BROWSER_TEST_H_
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc b/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc
index 528e2f9..f098331 100644
--- a/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc
+++ b/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc
@@ -5,6 +5,8 @@
 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h"
 
 #include "base/macros.h"
+#include "base/test/histogram_tester.h"
+#include "build/build_config.h"
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
 #include "chrome/test/base/testing_profile_manager.h"
@@ -69,6 +71,7 @@
 }
 
 TEST_F(ChromeStabilityMetricsProviderTest, NotificationObserver) {
+  base::HistogramTester histogram_tester;
   ChromeStabilityMetricsProvider provider(prefs());
   std::unique_ptr<TestingProfileManager> profile_manager(
       new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
@@ -128,7 +131,13 @@
   // be executed immediately.
   provider.ProvideStabilityMetrics(&system_profile);
 
+#if defined(OS_ANDROID)
+  EXPECT_EQ(
+      2u,
+      histogram_tester.GetAllSamples("Stability.Android.RendererCrash").size());
+#else
   EXPECT_EQ(2, system_profile.stability().renderer_crash_count());
+#endif
   EXPECT_EQ(1, system_profile.stability().renderer_failed_launch_count());
   EXPECT_EQ(0, system_profile.stability().extension_renderer_crash_count());
 
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 312f7fdd..65c6bf28 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -2189,6 +2189,8 @@
         "../browser/chromeos/drive/drive_integration_service_browsertest.cc",
         "../browser/chromeos/extensions/accessibility_features_apitest.cc",
         "../browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc",
+        "../browser/chromeos/extensions/default_keyboard_extension_browser_test.cc",
+        "../browser/chromeos/extensions/default_keyboard_extension_browser_test.h",
         "../browser/chromeos/extensions/echo_private_apitest.cc",
         "../browser/chromeos/extensions/file_manager/file_browser_handler_api_test.cc",
         "../browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc",
@@ -2196,8 +2198,6 @@
         "../browser/chromeos/extensions/info_private_apitest.cc",
         "../browser/chromeos/extensions/input_method_apitest_chromeos.cc",
         "../browser/chromeos/extensions/users_private/users_private_apitest.cc",
-        "../browser/chromeos/extensions/virtual_keyboard_browsertest.cc",
-        "../browser/chromeos/extensions/virtual_keyboard_browsertest.h",
         "../browser/chromeos/extensions/wallpaper_apitest.cc",
         "../browser/chromeos/extensions/wallpaper_manager_browsertest.cc",
         "../browser/chromeos/extensions/wallpaper_private_apitest.cc",
diff --git a/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.html b/chrome/test/data/chromeos/virtual_keyboard/default_extension/end_to_end_test.html
similarity index 100%
rename from chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.html
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/end_to_end_test.html
diff --git a/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js b/chrome/test/data/chromeos/virtual_keyboard/default_extension/end_to_end_test.js
similarity index 96%
rename from chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/end_to_end_test.js
index cd6992e207..ad03ec4 100644
--- a/chrome/test/data/chromeos/virtual_keyboard/end_to_end_test.js
+++ b/chrome/test/data/chromeos/virtual_keyboard/default_extension/end_to_end_test.js
@@ -41,8 +41,8 @@
  */
 function mockTouchEvent(key, eventType) {
   var rect = key.getBoundingClientRect();
-  var x = rect.left + rect.width/2;
-  var y = rect.top + rect.height/2;
+  var x = rect.left + rect.width / 2;
+  var y = rect.top + rect.height / 2;
   var e = document.createEvent('UIEvent');
   e.initUIEvent(eventType, true, true);
   e.touches = [{pageX: x, pageY: y}];
diff --git a/chrome/test/data/chromeos/virtual_keyboard/hide_keyboard_key_test.js b/chrome/test/data/chromeos/virtual_keyboard/default_extension/hide_keyboard_key_test.js
similarity index 100%
rename from chrome/test/data/chromeos/virtual_keyboard/hide_keyboard_key_test.js
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/hide_keyboard_key_test.js
diff --git a/chrome/test/data/chromeos/virtual_keyboard/layout_test.js b/chrome/test/data/chromeos/virtual_keyboard/default_extension/layout_test.js
similarity index 71%
rename from chrome/test/data/chromeos/virtual_keyboard/layout_test.js
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/layout_test.js
index 29620c0a..8eb3ee9 100644
--- a/chrome/test/data/chromeos/virtual_keyboard/layout_test.js
+++ b/chrome/test/data/chromeos/virtual_keyboard/default_extension/layout_test.js
@@ -19,11 +19,12 @@
     key = getSoftKeyView(key);
     for (var i = 1; i < sequence.length; i++) {
       var next = key.nextSibling;
-      assertTrue(!!next,
-                 'Unable to find key to right of "' + sequence[i - 1] + '"');
-      assertTrue(hasLabel(next, sequence[i]),
-                 'Unexpected label: expected: "' + sequence[i] +
-                 '" to follow "' + sequence[i - 1] + '"');
+      assertTrue(
+          !!next, 'Unable to find key to right of "' + sequence[i - 1] + '"');
+      assertTrue(
+          hasLabel(next, sequence[i]),
+          'Unexpected label: expected: "' + sequence[i] + '" to follow "' +
+              sequence[i - 1] + '"');
       key = next;
     }
   });
@@ -34,18 +35,10 @@
  */
 function testFullQwertyLayoutAsync(testDoneCallback) {
   var testCallback = function() {
-    var lowercase = [
-      '`1234567890-=',
-      'qwertyuiop[]\\',
-      'asdfghjkl;\'',
-      'zxcvbnm,./'
-    ];
-    var uppercase = [
-      '~!@#$%^&*()_+',
-      'QWERTYUIOP{}',
-      'ASDFGHJKL:"',
-      'ZXCVBNM<>?'
-    ];
+    var lowercase =
+        ['`1234567890-=', 'qwertyuiop[]\\', 'asdfghjkl;\'', 'zxcvbnm,./'];
+    var uppercase =
+        ['~!@#$%^&*()_+', 'QWERTYUIOP{}', 'ASDFGHJKL:"', 'ZXCVBNM<>?'];
     var view = getActiveView();
     assertTrue(!!view, 'Unable to find active view');
     assertEquals('us', view.id, 'Expecting full layout');
@@ -56,12 +49,8 @@
     verifyLayout(lowercase);
     testDoneCallback();
   };
-  var config = {
-    keyset: 'us',
-    languageCode: 'en',
-    passwordLayout: 'us',
-    name: 'English'
-  };
+  var config =
+      {keyset: 'us', languageCode: 'en', passwordLayout: 'us', name: 'English'};
   onKeyboardReady(testCallback, config);
 }
 
@@ -70,24 +59,11 @@
  */
 function testCompactQwertyLayoutAsync(testDoneCallback) {
   var testCallback = function() {
-    var lowercase = [
-      'qwertyuiop',
-      'asdfghjkl',
-      'zxcvbnm!?'
-    ];
-    var uppercase = [
-      'QWERTYUIOP',
-      'ASDFGHJKL',
-      'ZXCVBNM!?'
-    ];
-    var symbol = [
-      '1234567890',
-      '@#$%&-+()',
-      '\\=*"\':;!?'
-    ];
+    var lowercase = ['qwertyuiop', 'asdfghjkl', 'zxcvbnm!?'];
+    var uppercase = ['QWERTYUIOP', 'ASDFGHJKL', 'ZXCVBNM!?'];
+    var symbol = ['1234567890', '@#$%&-+()', '\\=*"\':;!?'];
     var more = [
-      '~`|',
-      '\u00a3\u00a2\u20ac\u00a5^\u00b0={}',
+      '~`|', '\u00a3\u00a2\u20ac\u00a5^\u00b0={}',
       '\\\u00a9\u00ae\u2122\u2105[]\u00a1\u00bf'
     ];
     var view = getActiveView();
@@ -101,16 +77,18 @@
     // test.
     onKeysetsReady(['us.compact.symbol', 'us.compact.more'], function() {
       onSwitchToKeyset('us.compact.symbol', function() {
-        assertEquals('us-compact-symbol', getActiveView().id,
-                     'Expecting symbol layout');
+        assertEquals(
+            'us-compact-symbol', getActiveView().id, 'Expecting symbol layout');
         verifyLayout(symbol);
         onSwitchToKeyset('us.compact.more', function() {
-          assertEquals('us-compact-more', getActiveView().id,
-                       'Expecting more symbols layout');
+          assertEquals(
+              'us-compact-more', getActiveView().id,
+              'Expecting more symbols layout');
           verifyLayout(more);
           onSwitchToKeyset('us.compact.qwerty', function() {
-            assertEquals('us-compact-qwerty', getActiveView().id,
-                         'Expecting compact text layout');
+            assertEquals(
+                'us-compact-qwerty', getActiveView().id,
+                'Expecting compact text layout');
             verifyLayout(lowercase);
             testDoneCallback();
           });
@@ -137,11 +115,13 @@
   onKeyboardReady(function() {
     var menu = document.querySelector('.inputview-menu-view');
     assertTrue(!!menu, 'Unable to access keyboard menu');
-    assertEquals('none', getComputedStyle(menu)['display'],
-                 'Menu should not be visible until activated');
+    assertEquals(
+        'none', getComputedStyle(menu)['display'],
+        'Menu should not be visible until activated');
     mockTap(findKeyById('Menu'));
-    assertEquals('block', getComputedStyle(menu)['display'],
-                 'Menu should be visible once activated');
+    assertEquals(
+        'block', getComputedStyle(menu)['display'],
+        'Menu should be visible once activated');
     var hwt = menu.querySelector('#handwriting');
     assertFalse(!!hwt, 'Handwriting should be disabled by default');
     testDoneCallback();
@@ -155,30 +135,32 @@
  */
 function testHandwritingLayoutAsync(testDoneCallback) {
   var compactKeysets = [
-    'us.compact.qwerty',
-    'us.compact.symbol',
-    'us.compact.more',
+    'us.compact.qwerty', 'us.compact.symbol', 'us.compact.more',
     'us.compact.numberpad'
   ];
-  var testCallback = function () {
+  var testCallback = function() {
     // Non-active keysets are lazy loaded in order to reduce latency before
     // the virtual keyboard is shown. Wait until the load is complete to
     // continue testing.
     onKeysetsReady(compactKeysets, function() {
       var menu = document.querySelector('.inputview-menu-view');
-      assertEquals('none', getComputedStyle(menu).display,
-                   'Menu should be hidden initially');
+      assertEquals(
+          'none', getComputedStyle(menu).display,
+          'Menu should be hidden initially');
       mockTap(findKeyById('Menu'));
-      assertFalse(menu.hidden,
-                  'Menu should be visible after tapping menu toggle button');
+      assertFalse(
+          menu.hidden,
+          'Menu should be visible after tapping menu toggle button');
       var menuBounds = menu.getBoundingClientRect();
-      assertTrue(menuBounds.width > 0 && menuBounds.height > 0,
-                 'Expect non-zero menu bounds.');
+      assertTrue(
+          menuBounds.width > 0 && menuBounds.height > 0,
+          'Expect non-zero menu bounds.');
       var hwtSelect = menu.querySelector('#handwriting');
       assertTrue(!!hwtSelect, 'Handwriting should be available for testing');
       var hwtSelectBounds = hwtSelect.getBoundingClientRect();
-      assertTrue(hwtSelectBounds.width > 0 && hwtSelectBounds.height > 0,
-                 'Expect non-zero size for hwt select button.');
+      assertTrue(
+          hwtSelectBounds.width > 0 && hwtSelectBounds.height > 0,
+          'Expect non-zero size for hwt select button.');
       onSwitchToKeyset('hwt', function() {
         // The tests below for handwriting part is for material design.
         var view = getActiveView();
@@ -190,7 +172,8 @@
         var backButton = panelView.querySelector('#backToKeyboard');
         assertTrue(!!backButton, 'Unable to find back button.');
         onSwitchToKeyset('us.compact.qwerty', function() {
-          assertEquals('us-compact-qwerty', getActiveView().id,
+          assertEquals(
+              'us-compact-qwerty', getActiveView().id,
               'compact layout is not active.');
           testDoneCallback();
         });
@@ -213,17 +196,19 @@
  * Test that IME switching from the InputView menu works.
  */
 function testKeyboardSwitchIMEAsync(testDoneCallback) {
-  var testCallback = function () {
+  var testCallback = function() {
     // Ensure that the menu key is present and displays the menu when pressed.
     var menu = document.querySelector('.inputview-menu-view');
-    assertEquals('none', getComputedStyle(menu).display,
-                 'Menu should be hidden initially');
+    assertEquals(
+        'none', getComputedStyle(menu).display,
+        'Menu should be hidden initially');
     mockTap(findKeyById('Menu'));
-    assertFalse(menu.hidden,
-                'Menu should be visible after tapping menu toggle button');
+    assertFalse(
+        menu.hidden, 'Menu should be visible after tapping menu toggle button');
     var menuBounds = menu.getBoundingClientRect();
-    assertTrue(menuBounds.width > 0 && menuBounds.height > 0,
-               'Expect non-zero menu bounds.');
+    assertTrue(
+        menuBounds.width > 0 && menuBounds.height > 0,
+        'Expect non-zero menu bounds.');
 
     var imes = menu.querySelectorAll('.inputview-menu-list-indicator-name');
     assertEquals(3, imes.length, 'Unexpected number of IMEs in menu view.');
@@ -236,7 +221,7 @@
 
     // Select the German IME and ensure that the menu is dismissed.
     mockTap(imes[2]);
-    assertEquals('none', menu.style.display, "Menu didn't hide on switch.");
+    assertEquals('none', menu.style.display, 'Menu didn\'t hide on switch.');
 
     testDoneCallback();
   };
diff --git a/chrome/test/data/chromeos/virtual_keyboard/modifier_test.js b/chrome/test/data/chromeos/virtual_keyboard/default_extension/modifier_test.js
similarity index 79%
rename from chrome/test/data/chromeos/virtual_keyboard/modifier_test.js
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/modifier_test.js
index 8a7a6ac6..57f325c 100644
--- a/chrome/test/data/chromeos/virtual_keyboard/modifier_test.js
+++ b/chrome/test/data/chromeos/virtual_keyboard/default_extension/modifier_test.js
@@ -18,12 +18,8 @@
 
     testDoneCallback();
   };
-  var config = {
-    keyset: 'us',
-    languageCode: 'en',
-    passwordLayout: 'us',
-    name: 'English'
-  };
+  var config =
+      {keyset: 'us', languageCode: 'en', passwordLayout: 'us', name: 'English'};
   onKeyboardReady(testCallback, config);
 }
 
@@ -47,12 +43,8 @@
     mockTypeCharacter('a', 0x41, Modifier.NONE);
     testDoneCallback();
   };
-  var config = {
-    keyset: 'us',
-    languageCode: 'en',
-    passwordLayout: 'us',
-    name: 'English'
-  };
+  var config =
+      {keyset: 'us', languageCode: 'en', passwordLayout: 'us', name: 'English'};
   onKeyboardReady(testCallback, config);
 }
 
@@ -64,20 +56,15 @@
     mockTap(findKeyById('ControlLeft'));
     mockTap(findKeyById('AltLeft'));
     mockTap(findKeyById('ShiftLeft'));
-    mockTypeCharacter('A', 0x41,
-                      Modifier.CONTROL | Modifier.ALT | Modifier.SHIFT,
-                      0);
+    mockTypeCharacter(
+        'A', 0x41, Modifier.CONTROL | Modifier.ALT | Modifier.SHIFT, 0);
 
     // Keys should un-stick on a subsequent press.
     mockTypeCharacter('a', 0x41, Modifier.NONE);
     testDoneCallback();
   };
-  var config = {
-    keyset: 'us',
-    languageCode: 'en',
-    passwordLayout: 'us',
-    name: 'English'
-  };
+  var config =
+      {keyset: 'us', languageCode: 'en', passwordLayout: 'us', name: 'English'};
   onKeyboardReady(testCallback, config);
 }
 
@@ -91,11 +78,7 @@
     mockTypeCharacter('a', 0x41, Modifier.NONE);
     testDoneCallback();
   };
-  var config = {
-    keyset: 'us',
-    languageCode: 'en',
-    passwordLayout: 'us',
-    name: 'English'
-  };
+  var config =
+      {keyset: 'us', languageCode: 'en', passwordLayout: 'us', name: 'English'};
   onKeyboardReady(testCallback, config);
 }
diff --git a/chrome/test/data/chromeos/virtual_keyboard/typing_test.js b/chrome/test/data/chromeos/virtual_keyboard/default_extension/typing_test.js
similarity index 100%
rename from chrome/test/data/chromeos/virtual_keyboard/typing_test.js
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/typing_test.js
diff --git a/chrome/test/data/chromeos/virtual_keyboard/virtual_keyboard_test_base.js b/chrome/test/data/chromeos/virtual_keyboard/default_extension/virtual_keyboard_test_base.js
similarity index 88%
rename from chrome/test/data/chromeos/virtual_keyboard/virtual_keyboard_test_base.js
rename to chrome/test/data/chromeos/virtual_keyboard/default_extension/virtual_keyboard_test_base.js
index 2fa60a1c6..0b7739e 100644
--- a/chrome/test/data/chromeos/virtual_keyboard/virtual_keyboard_test_base.js
+++ b/chrome/test/data/chromeos/virtual_keyboard/default_extension/virtual_keyboard_test_base.js
@@ -13,24 +13,15 @@
  * The enumeration of keyset modifiers.
  * @enum {string}
  */
-var KeysetModifier = {
-  NONE: 'none',
-  SHIFT: 'shift',
-  MORE: 'more',
-  SYMBOL: 'symbol'
-};
+var KeysetModifier =
+    {NONE: 'none', SHIFT: 'shift', MORE: 'more', SYMBOL: 'symbol'};
 
 /**
  * Flag values for the shift, control and alt modifiers as defined by
  * EventFlags in "event_constants.h".
  * @type {enum}
  */
-var Modifier = {
-  NONE: 0,
-  SHIFT: 2,
-  CONTROL: 4,
-  ALT: 8
-};
+var Modifier = {NONE: 0, SHIFT: 2, CONTROL: 4, ALT: 8};
 
 /**
  * Display diagnostic messages when debugging tests.
@@ -50,7 +41,6 @@
  *     calls with expectations.
  */
 function mockExtensionApis(mockController) {
-
   /**
    * Mocks methods within a namespace.
    * @param {string} namespace Dot delimited namespace.
@@ -79,22 +69,13 @@
   };
 
   var virtualKeyboardPrivateMethods = [
-    'getKeyboardConfig',
-    'hideKeyboard',
-    'insertText',
-    'lockKeyboard',
-    'moveCursor',
-    'sendKeyEvent',
-    'setMode',
-    'setKeyboardState',
+    'getKeyboardConfig', 'hideKeyboard', 'insertText', 'lockKeyboard',
+    'moveCursor', 'sendKeyEvent', 'setMode', 'setKeyboardState',
     'setHotrodKeyboard'
   ];
 
-  var inputMethodPrivateMethods = [
-    'getCurrentInputMethod',
-    'getInputMethods',
-    'setCurrentInputMethod'
-  ];
+  var inputMethodPrivateMethods =
+      ['getCurrentInputMethod', 'getInputMethods', 'setCurrentInputMethod'];
 
   addMocks('chrome.virtualKeyboardPrivate', virtualKeyboardPrivateMethods);
   addMocks('chrome.inputMethodPrivate', inputMethodPrivateMethods);
@@ -158,25 +139,22 @@
     // sendKeyEvent calls.
     var expectedEvent = expected[0];
     var observedEvent = observed[0];
-    assertEquals(expectedEvent.type,
-                 observedEvent.type,
-                 'Mismatched event types.');
-    assertEquals(expectedEvent.charValue,
-                 observedEvent.charValue,
-                 'Mismatched unicode values for character.');
-    assertEquals(expectedEvent.keyCode,
-                 observedEvent.keyCode,
-                 'Mismatched key codes.');
-    assertEquals(expectedEvent.modifiers,
-                 observedEvent.modifiers,
-                 'Mismatched states for modifiers.');
+    assertEquals(
+        expectedEvent.type, observedEvent.type, 'Mismatched event types.');
+    assertEquals(
+        expectedEvent.charValue, observedEvent.charValue,
+        'Mismatched unicode values for character.');
+    assertEquals(
+        expectedEvent.keyCode, observedEvent.keyCode, 'Mismatched key codes.');
+    assertEquals(
+        expectedEvent.modifiers, observedEvent.modifiers,
+        'Mismatched states for modifiers.');
   };
   chrome.virtualKeyboardPrivate.sendKeyEvent.validateCall = validateSendCall;
 
   var validateLockKeyboard = function(index, expected, observed) {
-    assertEquals(expected[0],
-                 observed[0],
-                 'Mismatched keyboard lock/unlock state.');
+    assertEquals(
+        expected[0], observed[0], 'Mismatched keyboard lock/unlock state.');
   };
   chrome.virtualKeyboardPrivate.lockKeyboard.validateCall =
       validateLockKeyboard;
@@ -235,11 +213,9 @@
   chrome.virtualKeyboardPrivate.keyboardLoaded = function() {
     runTestCallback();
   };
-  window.initializeVirtualKeyboard(config.keyset,
-                                   config.languageCode,
-                                   config.passwordLayout,
-                                   config.name,
-                                   options);
+  window.initializeVirtualKeyboard(
+      config.keyset, config.languageCode, config.passwordLayout, config.name,
+      options);
 }
 
 /**
@@ -276,8 +252,8 @@
  */
 function mockTouchEvent(key, eventType) {
   var rect = key.getBoundingClientRect();
-  var x = rect.left + rect.width/2;
-  var y = rect.top + rect.height/2;
+  var x = rect.left + rect.width / 2;
+  var y = rect.top + rect.height / 2;
   var e = document.createEvent('UIEvent');
   e.initUIEvent(eventType, true, true);
   e.touches = [{pageX: x, pageY: y}];
@@ -422,8 +398,8 @@
     // Set state of shift key.
     var leftShift = activeView.querySelector('#ShiftLeft');
     assertTrue(!!leftShift, 'Unable to find left shift key');
-    var currentShiftState = !!leftShift.querySelector(
-        '.inputview-special-key-highlight');
+    var currentShiftState =
+        !!leftShift.querySelector('.inputview-special-key-highlight');
     if (!currentShiftState) {
       mockTap(leftShift);
     }
diff --git a/chromecast/browser/cast_browser_main_parts.cc b/chromecast/browser/cast_browser_main_parts.cc
index a32ebff..ec44bf6 100644
--- a/chromecast/browser/cast_browser_main_parts.cc
+++ b/chromecast/browser/cast_browser_main_parts.cc
@@ -420,7 +420,8 @@
   breakpad::CrashDumpObserver::Create();
   breakpad::CrashDumpObserver::GetInstance()->RegisterClient(
       base::MakeUnique<breakpad::ChildProcessCrashObserver>(
-          crash_dumps_dir, kAndroidMinidumpDescriptor));
+          crash_dumps_dir, kAndroidMinidumpDescriptor,
+          base::Bind(&base::DoNothing)));
 #else
   base::FilePath home_dir;
   CHECK(PathService::Get(DIR_CAST_HOME, &home_dir));
diff --git a/chromeos/components/tether/ble_connection_manager.cc b/chromeos/components/tether/ble_connection_manager.cc
index 138fe10..e78469ef 100644
--- a/chromeos/components/tether/ble_connection_manager.cc
+++ b/chromeos/components/tether/ble_connection_manager.cc
@@ -303,16 +303,16 @@
 }
 
 void BleConnectionManager::OnReceivedAdvertisementFromDevice(
-    const std::string& device_address,
-    const cryptauth::RemoteDevice& remote_device) {
+    const cryptauth::RemoteDevice& remote_device,
+    device::BluetoothDevice* bluetooth_device) {
   ConnectionMetadata* connection_metadata =
       GetConnectionMetadata(remote_device);
   if (!connection_metadata) {
     // If an advertisement  is received from a device that is not registered,
     // ignore it.
     PA_LOG(WARNING) << "Received an advertisement from a device which is not "
-                    << "registered. Bluetooth address: " << device_address
-                    << ", Remote Device ID: "
+                    << "registered. Bluetooth address: "
+                    << bluetooth_device->GetAddress() << ", Remote Device ID: "
                     << remote_device.GetTruncatedDeviceIdForLogs();
     return;
   }
@@ -320,8 +320,8 @@
   if (connection_metadata->HasSecureChannel()) {
     PA_LOG(WARNING) << "Received another advertisement from a registered "
                     << "device which is already being actively communicated "
-                    << "with. Bluetooth address: " << device_address
-                    << ", Remote Device ID: "
+                    << "with. Bluetooth address: "
+                    << bluetooth_device->GetAddress() << ", Remote Device ID: "
                     << remote_device.GetTruncatedDeviceIdForLogs();
     return;
   }
@@ -330,18 +330,19 @@
                << remote_device.GetTruncatedDeviceIdForLogs() << "\". "
                << "Starting authentication handshake.";
 
+  // Stop trying to connect to that device, since it has been found.
+  StopConnectionAttemptAndMoveToEndOfQueue(remote_device);
+
   // Create a connection to that device.
-  std::unique_ptr<cryptauth::Connection> connection =
-      cryptauth::weave::BluetoothLowEnergyWeaveClientConnection::Factory::
-          NewInstance(remote_device, device_address, adapter_,
-                      device::BluetoothUUID(std::string(kGattServerUuid)));
+  std::unique_ptr<cryptauth::Connection> connection = cryptauth::weave::
+      BluetoothLowEnergyWeaveClientConnection::Factory::NewInstance(
+          remote_device, adapter_, device::BluetoothUUID(kGattServerUuid),
+          bluetooth_device, false /* should_set_low_connection_latency */);
   std::unique_ptr<cryptauth::SecureChannel> secure_channel =
       cryptauth::SecureChannel::Factory::NewInstance(std::move(connection),
                                                      cryptauth_service_);
   connection_metadata->SetSecureChannel(std::move(secure_channel));
 
-  // Stop trying to connect to that device, since a connection already exists.
-  StopConnectionAttemptAndMoveToEndOfQueue(remote_device);
   UpdateConnectionAttempts();
 }
 
diff --git a/chromeos/components/tether/ble_connection_manager.h b/chromeos/components/tether/ble_connection_manager.h
index 5712efc7..3d73ce9 100644
--- a/chromeos/components/tether/ble_connection_manager.h
+++ b/chromeos/components/tether/ble_connection_manager.h
@@ -25,6 +25,10 @@
 class CryptAuthService;
 }  // namespace cryptauth
 
+namespace device {
+class BluetoothDevice;
+}  // namespace device
+
 namespace chromeos {
 
 namespace tether {
@@ -114,8 +118,8 @@
 
   // BleScanner::Observer:
   void OnReceivedAdvertisementFromDevice(
-      const std::string& device_address,
-      const cryptauth::RemoteDevice& remote_device) override;
+      const cryptauth::RemoteDevice& remote_device,
+      device::BluetoothDevice* bluetooth_device) override;
 
  protected:
   void SendMessageReceivedEvent(cryptauth::RemoteDevice remote_device,
diff --git a/chromeos/components/tether/ble_connection_manager_unittest.cc b/chromeos/components/tether/ble_connection_manager_unittest.cc
index 2e4d5f0..47795bd 100644
--- a/chromeos/components/tether/ble_connection_manager_unittest.cc
+++ b/chromeos/components/tether/ble_connection_manager_unittest.cc
@@ -157,10 +157,13 @@
                bool(const cryptauth::RemoteDevice&));
 
   void NotifyReceivedAdvertisementFromDevice(
-      const std::string& device_address,
+      const std::string& bluetooth_address,
       const cryptauth::RemoteDevice& remote_device) {
-    BleScanner::NotifyReceivedAdvertisementFromDevice(device_address,
-                                                      remote_device);
+    device::MockBluetoothDevice device(
+        static_cast<device::MockBluetoothAdapter*>(adapter().get()),
+        0u /* bluetooth_class */, "name", bluetooth_address, false /* paired */,
+        false /* connected */);
+    BleScanner::NotifyReceivedAdvertisementFromDevice(remote_device, &device);
   }
 };
 
@@ -199,14 +202,17 @@
 
   std::unique_ptr<cryptauth::Connection> BuildInstance(
       const cryptauth::RemoteDevice& remote_device,
-      const std::string& device_address,
       scoped_refptr<device::BluetoothAdapter> adapter,
-      const device::BluetoothUUID remote_service_uuid) override {
+      const device::BluetoothUUID remote_service_uuid,
+      device::BluetoothDevice* bluetooth_device,
+      bool should_set_low_connection_latency) override {
     EXPECT_EQ(expected_adapter_, adapter);
     EXPECT_EQ(expected_remote_service_uuid_, remote_service_uuid);
+    EXPECT_FALSE(should_set_low_connection_latency);
 
     return base::WrapUnique<FakeConnectionWithAddress>(
-        new FakeConnectionWithAddress(remote_device, device_address));
+        new FakeConnectionWithAddress(remote_device,
+                                      bluetooth_device->GetAddress()));
   }
 
  private:
diff --git a/chromeos/components/tether/ble_scanner.cc b/chromeos/components/tether/ble_scanner.cc
index c9dfd48a..e5f443b 100644
--- a/chromeos/components/tether/ble_scanner.cc
+++ b/chromeos/components/tether/ble_scanner.cc
@@ -158,10 +158,10 @@
 }
 
 void BleScanner::NotifyReceivedAdvertisementFromDevice(
-    const std::string& device_address,
-    const cryptauth::RemoteDevice& remote_device) {
+    const cryptauth::RemoteDevice& remote_device,
+    device::BluetoothDevice* bluetooth_device) {
   for (auto& observer : observer_list_)
-    observer.OnReceivedAdvertisementFromDevice(device_address, remote_device);
+    observer.OnReceivedAdvertisementFromDevice(remote_device, bluetooth_device);
 }
 
 void BleScanner::NotifyDiscoverySessionStateChanged(
@@ -288,7 +288,7 @@
   // to an instance variable, it is possible that an observer could unregister
   // that device, which would change the value of that pointer.
   const cryptauth::RemoteDevice copy = *identified_device;
-  NotifyReceivedAdvertisementFromDevice(bluetooth_device->GetAddress(), copy);
+  NotifyReceivedAdvertisementFromDevice(copy, bluetooth_device);
 }
 
 }  // namespace tether
diff --git a/chromeos/components/tether/ble_scanner.h b/chromeos/components/tether/ble_scanner.h
index 032dfeb..c7b6a6e9 100644
--- a/chromeos/components/tether/ble_scanner.h
+++ b/chromeos/components/tether/ble_scanner.h
@@ -30,8 +30,8 @@
   class Observer {
    public:
     virtual void OnReceivedAdvertisementFromDevice(
-        const std::string& device_address,
-        const cryptauth::RemoteDevice& remote_device) {}
+        const cryptauth::RemoteDevice& remote_device,
+        device::BluetoothDevice* bluetooth_device) {}
     virtual void OnDiscoverySessionStateChanged(bool discovery_session_active) {
     }
   };
@@ -63,10 +63,12 @@
 
  protected:
   void NotifyReceivedAdvertisementFromDevice(
-      const std::string& device_address,
-      const cryptauth::RemoteDevice& remote_device);
+      const cryptauth::RemoteDevice& remote_device,
+      device::BluetoothDevice* bluetooth_device);
   void NotifyDiscoverySessionStateChanged(bool discovery_session_active);
 
+  scoped_refptr<device::BluetoothAdapter> adapter() { return adapter_; }
+
  private:
   friend class BleScannerTest;
 
diff --git a/chromeos/components/tether/ble_scanner_unittest.cc b/chromeos/components/tether/ble_scanner_unittest.cc
index 70512e5..0b9685b 100644
--- a/chromeos/components/tether/ble_scanner_unittest.cc
+++ b/chromeos/components/tether/ble_scanner_unittest.cc
@@ -45,9 +45,9 @@
 
   // BleScanner::Observer:
   void OnReceivedAdvertisementFromDevice(
-      const std::string& device_address,
-      const cryptauth::RemoteDevice& remote_device) override {
-    device_addresses_.push_back(device_address);
+      const cryptauth::RemoteDevice& remote_device,
+      device::BluetoothDevice* bluetooth_device) override {
+    device_addresses_.push_back(bluetooth_device->GetAddress());
     remote_devices_.push_back(remote_device);
   }
 
diff --git a/components/crash/content/browser/child_process_crash_observer_android.cc b/components/crash/content/browser/child_process_crash_observer_android.cc
index b59a0dd..a8fb820 100644
--- a/components/crash/content/browser/child_process_crash_observer_android.cc
+++ b/components/crash/content/browser/child_process_crash_observer_android.cc
@@ -14,8 +14,16 @@
 
 ChildProcessCrashObserver::ChildProcessCrashObserver(
     const base::FilePath crash_dump_dir,
-    int descriptor_id)
-    : crash_dump_dir_(crash_dump_dir), descriptor_id_(descriptor_id) {}
+    int descriptor_id,
+    const base::Closure& increase_crash_cb)
+    : crash_dump_dir_(crash_dump_dir),
+      descriptor_id_(descriptor_id),
+      increase_crash_cb_(base::Bind(
+          [](base::Closure cb, bool run_cb) {
+            if (run_cb)
+              cb.Run();
+          },
+          increase_crash_cb)) {}
 
 ChildProcessCrashObserver::~ChildProcessCrashObserver() {}
 
@@ -41,12 +49,14 @@
   // This might be called twice for a given child process, with a
   // NOTIFICATION_RENDERER_PROCESS_TERMINATED and then with
   // NOTIFICATION_RENDERER_PROCESS_CLOSED.
-  base::PostTaskWithTraits(
+
+  base::PostTaskWithTraitsAndReplyWithResult(
       FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
       base::Bind(&CrashDumpManager::ProcessMinidumpFileFromChild,
                  base::Unretained(CrashDumpManager::GetInstance()),
                  crash_dump_dir_, child_process_id, process_type,
-                 termination_status, app_state));
+                 termination_status, app_state),
+      increase_crash_cb_);
 }
 
 }  // namespace breakpad
diff --git a/components/crash/content/browser/child_process_crash_observer_android.h b/components/crash/content/browser/child_process_crash_observer_android.h
index fad32f2..d19efb9d 100644
--- a/components/crash/content/browser/child_process_crash_observer_android.h
+++ b/components/crash/content/browser/child_process_crash_observer_android.h
@@ -12,8 +12,12 @@
 
 class ChildProcessCrashObserver : public breakpad::CrashDumpObserver::Client {
  public:
+  // |increase_crash_cb is| the callback to run after processing minidump file.
+  // For now this callback is used to increase render crash counter based on
+  // processing minidump result.
   ChildProcessCrashObserver(const base::FilePath crash_dump_dir,
-                            int descriptor_id);
+                            int descriptor_id,
+                            const base::Closure& increase_crash_cb);
   ~ChildProcessCrashObserver() override;
 
   // breakpad::CrashDumpObserver::Client implementation:
@@ -31,6 +35,8 @@
   // descriptor mappings passed to the child process.
   int descriptor_id_;
 
+  base::Callback<void(bool)> increase_crash_cb_;
+
   DISALLOW_COPY_AND_ASSIGN(ChildProcessCrashObserver);
 };
 
diff --git a/components/crash/content/browser/crash_dump_manager_android.cc b/components/crash/content/browser/crash_dump_manager_android.cc
index d7cadd74..6d204696 100644
--- a/components/crash/content/browser/crash_dump_manager_android.cc
+++ b/components/crash/content/browser/crash_dump_manager_android.cc
@@ -60,18 +60,19 @@
   return base::ScopedFD(minidump_file.TakePlatformFile());
 }
 
-void CrashDumpManager::ProcessMinidumpFileFromChild(
+bool CrashDumpManager::ProcessMinidumpFileFromChild(
     base::FilePath crash_dump_dir,
     base::ProcessHandle pid,
     content::ProcessType process_type,
     base::TerminationStatus termination_status,
     base::android::ApplicationState app_state) {
   base::ThreadRestrictions::AssertIOAllowed();
+  bool increase_crash_count = false;
   base::FilePath minidump_path;
   // If the minidump for a given child process has already been
   // processed, then there is no more work to do.
   if (!GetMinidumpPath(pid, &minidump_path))
-    return;
+    return increase_crash_count;
 
   int64_t file_size = 0;
   int r = base::GetFileSize(minidump_path, &file_size);
@@ -108,6 +109,9 @@
     }
     if (process_type == content::PROCESS_TYPE_RENDERER) {
       if (termination_status == base::TERMINATION_STATUS_OOM_PROTECTED) {
+        // There is a delay for OOM flag to be removed when app goes to
+        // background, so we can't just check for OOM_PROTECTED flag.
+        increase_crash_count = is_running || is_paused;
         UMA_HISTOGRAM_ENUMERATION("Tab.RendererDetailedExitStatus",
                                   exit_status,
                                   ExitStatus::MINIDUMP_STATUS_COUNT);
@@ -128,14 +132,14 @@
     r = base::DeleteFile(minidump_path, false);
     DCHECK(r) << "Failed to delete temporary minidump file "
               << minidump_path.value();
-    return;
+    return increase_crash_count;
   }
 
   // We are dealing with a valid minidump. Copy it to the crash report
   // directory from where Java code will upload it later on.
   if (crash_dump_dir.empty()) {
     NOTREACHED() << "Failed to retrieve the crash dump directory.";
-    return;
+    return increase_crash_count;
   }
   const uint64_t rand = base::RandUint64();
   const std::string filename =
@@ -147,7 +151,7 @@
     LOG(ERROR) << "Failed to move crash dump from " << minidump_path.value()
                << " to " << dest_path.value();
     base::DeleteFile(minidump_path, false);
-    return;
+    return increase_crash_count;
   }
   VLOG(1) << "Crash minidump successfully generated: " << dest_path.value();
 
@@ -158,6 +162,7 @@
   base::android::ScopedJavaLocalRef<jstring> j_dest_path =
       base::android::ConvertUTF8ToJavaString(env, dest_path.value());
   Java_CrashDumpManager_tryToUploadMinidump(env, j_dest_path);
+  return increase_crash_count;
 }
 
 void CrashDumpManager::SetMinidumpPath(int child_process_id,
diff --git a/components/crash/content/browser/crash_dump_manager_android.h b/components/crash/content/browser/crash_dump_manager_android.h
index 6aa58857..5c54c38 100644
--- a/components/crash/content/browser/crash_dump_manager_android.h
+++ b/components/crash/content/browser/crash_dump_manager_android.h
@@ -31,7 +31,8 @@
  public:
   static CrashDumpManager* GetInstance();
 
-  void ProcessMinidumpFileFromChild(base::FilePath crash_dump_dir,
+  // Returns the condition whether we should write the crash to stability proto.
+  bool ProcessMinidumpFileFromChild(base::FilePath crash_dump_dir,
                                     base::ProcessHandle pid,
                                     content::ProcessType process_type,
                                     base::TerminationStatus termination_status,
diff --git a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc
index d0f0466..c3da0c4 100644
--- a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc
+++ b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.cc
@@ -55,14 +55,16 @@
 std::unique_ptr<Connection>
 BluetoothLowEnergyWeaveClientConnection::Factory::NewInstance(
     const RemoteDevice& remote_device,
-    const std::string& device_address,
     scoped_refptr<device::BluetoothAdapter> adapter,
-    const device::BluetoothUUID remote_service_uuid) {
+    const device::BluetoothUUID remote_service_uuid,
+    device::BluetoothDevice* bluetooth_device,
+    bool should_set_low_connection_latency) {
   if (!factory_instance_) {
     factory_instance_ = new Factory();
   }
-  return factory_instance_->BuildInstance(remote_device, device_address,
-                                          adapter, remote_service_uuid);
+  return factory_instance_->BuildInstance(remote_device, adapter,
+                                          remote_service_uuid, bluetooth_device,
+                                          should_set_low_connection_latency);
 }
 
 // static
@@ -74,11 +76,13 @@
 std::unique_ptr<Connection>
 BluetoothLowEnergyWeaveClientConnection::Factory::BuildInstance(
     const RemoteDevice& remote_device,
-    const std::string& device_address,
     scoped_refptr<device::BluetoothAdapter> adapter,
-    const device::BluetoothUUID remote_service_uuid) {
+    const device::BluetoothUUID remote_service_uuid,
+    device::BluetoothDevice* bluetooth_device,
+    bool should_set_low_connection_latency) {
   return base::MakeUnique<BluetoothLowEnergyWeaveClientConnection>(
-      remote_device, device_address, adapter, remote_service_uuid);
+      remote_device, adapter, remote_service_uuid, bluetooth_device,
+      should_set_low_connection_latency);
 }
 
 // static
@@ -131,11 +135,13 @@
 BluetoothLowEnergyWeaveClientConnection::
     BluetoothLowEnergyWeaveClientConnection(
         const RemoteDevice& device,
-        const std::string& device_address,
         scoped_refptr<device::BluetoothAdapter> adapter,
-        const device::BluetoothUUID remote_service_uuid)
+        const device::BluetoothUUID remote_service_uuid,
+        device::BluetoothDevice* bluetooth_device,
+        bool should_set_low_connection_latency)
     : Connection(device),
-      device_address_(device_address),
+      bluetooth_device_(bluetooth_device),
+      should_set_low_connection_latency_(should_set_low_connection_latency),
       adapter_(adapter),
       remote_service_({remote_service_uuid, std::string()}),
       packet_generator_(
@@ -160,6 +166,15 @@
 
 void BluetoothLowEnergyWeaveClientConnection::Connect() {
   DCHECK(sub_status() == SubStatus::DISCONNECTED);
+
+  if (should_set_low_connection_latency_)
+    SetConnectionLatency();
+  else
+    CreateGattConnection();
+}
+
+void BluetoothLowEnergyWeaveClientConnection::SetConnectionLatency() {
+  DCHECK(sub_status() == SubStatus::DISCONNECTED);
   SetSubStatus(SubStatus::WAITING_CONNECTION_LATENCY);
 
   device::BluetoothDevice* bluetooth_device = GetBluetoothDevice();
@@ -182,7 +197,8 @@
 }
 
 void BluetoothLowEnergyWeaveClientConnection::CreateGattConnection() {
-  DCHECK(sub_status() == SubStatus::WAITING_CONNECTION_LATENCY);
+  DCHECK(sub_status() == SubStatus::DISCONNECTED ||
+         sub_status() == SubStatus::WAITING_CONNECTION_LATENCY);
   SetSubStatus(SubStatus::WAITING_GATT_CONNECTION);
 
   device::BluetoothDevice* bluetooth_device = GetBluetoothDevice();
@@ -717,12 +733,12 @@
   // |gatt_connection_|. Unpaired BLE device addresses are ephemeral and are
   // expected to change periodically.
   return gatt_connection_ ? gatt_connection_->GetDeviceAddress()
-                          : device_address_;
+                          : bluetooth_device_->GetAddress();
 }
 
 device::BluetoothDevice*
 BluetoothLowEnergyWeaveClientConnection::GetBluetoothDevice() {
-  return adapter_->GetDevice(GetDeviceAddress());
+  return bluetooth_device_;
 }
 
 device::BluetoothRemoteGattService*
diff --git a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h
index 897d7f6..ca671d0ad 100644
--- a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h
+++ b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h
@@ -57,17 +57,19 @@
    public:
     static std::unique_ptr<Connection> NewInstance(
         const RemoteDevice& remote_device,
-        const std::string& device_address,
         scoped_refptr<device::BluetoothAdapter> adapter,
-        const device::BluetoothUUID remote_service_uuid);
+        const device::BluetoothUUID remote_service_uuid,
+        device::BluetoothDevice* bluetooth_device,
+        bool should_set_low_connection_latency);
     static void SetInstanceForTesting(Factory* factory);
 
    protected:
     virtual std::unique_ptr<Connection> BuildInstance(
         const RemoteDevice& remote_device,
-        const std::string& device_address,
         scoped_refptr<device::BluetoothAdapter> adapter,
-        const device::BluetoothUUID remote_service_uuid);
+        const device::BluetoothUUID remote_service_uuid,
+        device::BluetoothDevice* bluetooth_device,
+        bool should_set_low_connection_latency);
 
    private:
     static Factory* factory_instance_;
@@ -89,9 +91,10 @@
   // necessary to initiate the BLE connection.
   BluetoothLowEnergyWeaveClientConnection(
       const RemoteDevice& remote_device,
-      const std::string& device_address,
       scoped_refptr<device::BluetoothAdapter> adapter,
-      const device::BluetoothUUID remote_service_uuid);
+      const device::BluetoothUUID remote_service_uuid,
+      device::BluetoothDevice* bluetooth_device,
+      bool should_set_low_connection_latency);
 
   ~BluetoothLowEnergyWeaveClientConnection() override;
 
@@ -134,6 +137,10 @@
       device::BluetoothRemoteGattCharacteristic* characteristic,
       const Packet& value) override;
 
+  bool should_set_low_connection_latency() {
+    return should_set_low_connection_latency_;
+  }
+
  private:
   enum WriteRequestType {
     REGULAR,
@@ -217,10 +224,10 @@
   // connection.
   std::string GetReasonForClose();
 
-  // The device to which to connect. This is the starting value, but the device
-  // address may change during the connection because BLE addresses are
-  // ephemeral. Use GetDeviceAddress() to get the most up-to-date address.
-  const std::string device_address_;
+  // The device to which to connect.
+  device::BluetoothDevice* bluetooth_device_;
+
+  bool should_set_low_connection_latency_;
 
   scoped_refptr<device::BluetoothAdapter> adapter_;
   RemoteAttribute remote_service_;
diff --git a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
index 87333d3..c8a00920 100644
--- a/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
+++ b/components/cryptauth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
@@ -210,16 +210,24 @@
  public:
   TestBluetoothLowEnergyWeaveClientConnection(
       const RemoteDevice& remote_device,
-      const std::string& device_address,
       scoped_refptr<device::BluetoothAdapter> adapter,
-      const device::BluetoothUUID remote_service_uuid)
-      : BluetoothLowEnergyWeaveClientConnection(remote_device,
-                                                device_address,
-                                                adapter,
-                                                remote_service_uuid) {}
+      const device::BluetoothUUID remote_service_uuid,
+      device::MockBluetoothDevice* mock_bluetooth_device,
+      bool should_set_low_connection_latency)
+      : BluetoothLowEnergyWeaveClientConnection(
+            remote_device,
+            adapter,
+            remote_service_uuid,
+            mock_bluetooth_device,
+            should_set_low_connection_latency) {}
 
   ~TestBluetoothLowEnergyWeaveClientConnection() override {}
 
+  bool should_set_low_connection_latency() {
+    return BluetoothLowEnergyWeaveClientConnection::
+        should_set_low_connection_latency();
+  }
+
   MOCK_METHOD2(
       CreateCharacteristicsFinder,
       BluetoothLowEnergyCharacteristicsFinder*(
@@ -364,15 +372,15 @@
 
   // Creates a BluetoothLowEnergyWeaveClientConnection and verifies it's in
   // DISCONNECTED state.
-  std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection>
-  CreateConnection() {
+  std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> CreateConnection(
+      bool should_set_low_connection_latency) {
     EXPECT_CALL(*adapter_, AddObserver(_));
     EXPECT_CALL(*adapter_, RemoveObserver(_));
 
     std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
         new TestBluetoothLowEnergyWeaveClientConnection(
-            remote_device_, kTestRemoteDeviceBluetoothAddress, adapter_,
-            service_uuid_));
+            remote_device_, adapter_, service_uuid_,
+            mock_bluetooth_device_.get(), should_set_low_connection_latency));
 
     EXPECT_EQ(connection->sub_status(), SubStatus::DISCONNECTED);
     EXPECT_EQ(connection->status(), Connection::DISCONNECTED);
@@ -396,11 +404,13 @@
   // Transitions |connection| from DISCONNECTED to WAITING_CHARACTERISTICS
   // state, without an existing GATT connection.
   void ConnectGatt(TestBluetoothLowEnergyWeaveClientConnection* connection) {
-    EXPECT_CALL(*mock_bluetooth_device_,
-                SetConnectionLatency(
-                    device::BluetoothDevice::CONNECTION_LATENCY_LOW, _, _))
-        .WillOnce(DoAll(SaveArg<1>(&connection_latency_callback_),
-                        SaveArg<2>(&connection_latency_error_callback_)));
+    if (connection->should_set_low_connection_latency()) {
+      EXPECT_CALL(*mock_bluetooth_device_,
+                  SetConnectionLatency(
+                      device::BluetoothDevice::CONNECTION_LATENCY_LOW, _, _))
+          .WillOnce(DoAll(SaveArg<1>(&connection_latency_callback_),
+                          SaveArg<2>(&connection_latency_error_callback_)));
+    }
 
     // Preparing |connection| for a CreateGattConnection call.
     EXPECT_CALL(*mock_bluetooth_device_, CreateGattConnection(_, _))
@@ -409,12 +419,15 @@
 
     connection->Connect();
 
-    // Handle setting the connection latency.
-    EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_CONNECTION_LATENCY);
-    EXPECT_EQ(connection->status(), Connection::IN_PROGRESS);
-    ASSERT_FALSE(connection_latency_callback_.is_null());
-    ASSERT_FALSE(connection_latency_error_callback_.is_null());
-    connection_latency_callback_.Run();
+    if (connection->should_set_low_connection_latency()) {
+      // Handle setting the connection latency.
+      EXPECT_EQ(connection->sub_status(),
+                SubStatus::WAITING_CONNECTION_LATENCY);
+      EXPECT_EQ(connection->status(), Connection::IN_PROGRESS);
+      ASSERT_FALSE(connection_latency_callback_.is_null());
+      ASSERT_FALSE(connection_latency_error_callback_.is_null());
+      connection_latency_callback_.Run();
+    }
 
     EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_GATT_CONNECTION);
     EXPECT_EQ(connection->status(), Connection::IN_PROGRESS);
@@ -605,21 +618,21 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        CreateAndDestroyWithoutConnectCallDoesntCrash) {
   BluetoothLowEnergyWeaveClientConnection connection(
-      remote_device_, kTestRemoteDeviceBluetoothAddress, adapter_,
-      service_uuid_);
+      remote_device_, adapter_, service_uuid_, mock_bluetooth_device_.get(),
+      true /* should_set_low_connection_latency */);
 }
 
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        DisconnectWithoutConnectDoesntCrash) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   Disconnect(connection.get());
 }
 
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectSuccess) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
   NotifySessionStarted(connection.get());
@@ -629,7 +642,16 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectSuccessDisconnect) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
+  InitializeConnection(connection.get(), kDefaultMaxPacketSize);
+  EXPECT_EQ(connection->sub_status(), SubStatus::CONNECTED);
+  Disconnect(connection.get());
+}
+
+TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
+       ConnectSuccessDisconnect_DoNotSetLowLatency) {
+  std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
+      CreateConnection(false /* should_set_low_connection_latency */));
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
   EXPECT_EQ(connection->sub_status(), SubStatus::CONNECTED);
   Disconnect(connection.get());
@@ -638,7 +660,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectIncompleteDisconnectFromWaitingCharacteristicsState) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   Disconnect(connection.get());
 }
@@ -646,7 +668,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectIncompleteDisconnectFromWaitingNotifySessionState) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
   Disconnect(connection.get());
@@ -655,7 +677,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectIncompleteDisconnectFromWaitingConnectionResponseState) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
   NotifySessionStarted(connection.get());
@@ -665,7 +687,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectFailsCharacteristicsNotFound) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
 
   EXPECT_CALL(*rx_characteristic_, StartNotifySession(_, _)).Times(0);
@@ -683,7 +705,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectFailsCharacteristicsFoundThenUnavailable) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
 
   // Simulate the inability to fetch the characteristic after it was received.
@@ -705,7 +727,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectFailsNotifySessionError) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
 
@@ -723,7 +745,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectFailsErrorSendingConnectionRequest) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
   NotifySessionStarted(connection.get());
@@ -756,7 +778,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ReceiveMessageSmallerThanCharacteristicSize) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
 
   std::string received_bytes;
@@ -772,7 +794,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ReceiveMessageLargerThanCharacteristicSize) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   InitializeConnection(connection.get(), kLargeMaxPacketSize);
 
@@ -792,7 +814,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        SendMessageSmallerThanCharacteristicSize) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
 
   // Expecting a first call of WriteRemoteCharacteristic, after SendMessage is
@@ -818,7 +840,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        SendMessageLargerThanCharacteristicSize) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   InitializeConnection(connection.get(), kLargeMaxPacketSize);
 
@@ -862,7 +884,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        SendMessageKeepsFailing) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
 
   EXPECT_CALL(*tx_characteristic_, WriteRemoteCharacteristic(_, _, _))
@@ -899,7 +921,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ReceiveCloseConnectionTest) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
 
   connection->GattCharacteristicValueChanged(
@@ -913,7 +935,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ReceiverErrorTest) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
 
@@ -938,7 +960,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ReceiverErrorWithPendingWritesTest) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   InitializeConnection(connection.get(), kLargeMaxPacketSize);
 
@@ -977,7 +999,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ObserverDeletesConnectionOnDisconnect) {
   TestBluetoothLowEnergyWeaveClientConnection* connection =
-      CreateConnection().release();
+      CreateConnection(true /* should_set_low_connection_latency */).release();
   connection_observer_->set_delete_on_disconnect(true);
 
   InitializeConnection(connection, kDefaultMaxPacketSize);
@@ -1005,7 +1027,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ObserverDeletesConnectionOnMessageSent) {
   TestBluetoothLowEnergyWeaveClientConnection* connection =
-      CreateConnection().release();
+      CreateConnection(true /* should_set_low_connection_latency */).release();
   connection_observer_->set_delete_on_message_sent(true);
 
   InitializeConnection(connection, kDefaultMaxPacketSize);
@@ -1033,7 +1055,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        WriteConnectionCloseMaxNumberOfTimes) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   InitializeConnection(connection.get(), kDefaultMaxPacketSize);
   EXPECT_EQ(connection->sub_status(), SubStatus::CONNECTED);
@@ -1072,7 +1094,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        ConnectAfterADelayWhenThrottled) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   EXPECT_CALL(*mock_bluetooth_device_,
               SetConnectionLatency(
@@ -1118,7 +1140,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        SetConnectionLatencyError) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   EXPECT_CALL(*mock_bluetooth_device_,
               SetConnectionLatency(
@@ -1156,7 +1178,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        Timeout_ConnectionLatency) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   EXPECT_CALL(*mock_bluetooth_device_,
               SetConnectionLatency(
@@ -1181,7 +1203,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        Timeout_GattConnection) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
 
   EXPECT_CALL(*mock_bluetooth_device_,
               SetConnectionLatency(
@@ -1216,7 +1238,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        Timeout_GattCharacteristics) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_CHARACTERISTICS);
   EXPECT_EQ(connection->status(), Connection::IN_PROGRESS);
@@ -1231,7 +1253,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        Timeout_NotifySession) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
   EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_NOTIFY_SESSION);
@@ -1247,7 +1269,7 @@
 TEST_F(CryptAuthBluetoothLowEnergyWeaveClientConnectionTest,
        Timeout_ConnectionResponse) {
   std::unique_ptr<TestBluetoothLowEnergyWeaveClientConnection> connection(
-      CreateConnection());
+      CreateConnection(true /* should_set_low_connection_latency */));
   ConnectGatt(connection.get());
   CharacteristicsFound(connection.get());
   NotifySessionStarted(connection.get());
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
index 4837dea..eccfaed5 100644
--- a/components/history/core/browser/history_backend.cc
+++ b/components/history/core/browser/history_backend.cc
@@ -1372,6 +1372,8 @@
   if (!db_)
     return;
 
+  base::TimeTicks begin_time = base::TimeTicks::Now();
+
   auto url_filter = backend_client_
                         ? base::Bind(&HistoryBackendClient::IsWebSafe,
                                      base::Unretained(backend_client_.get()))
@@ -1386,6 +1388,9 @@
     MostVisitedURL url = MakeMostVisitedURL(*current_data, redirects);
     result->push_back(url);
   }
+
+  UMA_HISTOGRAM_TIMES("History.QueryMostVisitedURLsTime",
+                      base::TimeTicks::Now() - begin_time);
 }
 
 void HistoryBackend::GetRedirectsFromSpecificVisit(VisitID cur_visit,
diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn
index 98cc357b5..c1bc7f5 100644
--- a/components/metrics/BUILD.gn
+++ b/components/metrics/BUILD.gn
@@ -111,6 +111,7 @@
     "//components/prefs",
     "//components/variations",
     "//components/version_info:version_info",
+    "//extensions/features:features",
     "//third_party/zlib/google:compression_utils",
   ]
 
@@ -355,6 +356,7 @@
     "//components/metrics/public/cpp:call_stack_unit_tests",
     "//components/prefs:test_support",
     "//components/variations",
+    "//extensions/features:features",
     "//mojo/public/cpp/bindings",
     "//net:test_support",
     "//services/service_manager/public/cpp",
diff --git a/components/metrics/DEPS b/components/metrics/DEPS
index bd7bd415..711120e 100644
--- a/components/metrics/DEPS
+++ b/components/metrics/DEPS
@@ -10,6 +10,7 @@
   "+components/variations",
   "+components/version_info",
   "+content/public/test",
+  "+extensions/features",
   "+mojo/public/cpp",
   "+services/service_manager/public/cpp",
   "+third_party/zlib/google",
diff --git a/components/metrics/stability_metrics_helper.cc b/components/metrics/stability_metrics_helper.cc
index 1ba27b9..cf54081 100644
--- a/components/metrics/stability_metrics_helper.cc
+++ b/components/metrics/stability_metrics_helper.cc
@@ -13,10 +13,12 @@
 #include "base/metrics/sparse_histogram.h"
 #include "base/metrics/user_metrics.h"
 #include "build/build_config.h"
+#include "build/buildflag.h"
 #include "components/metrics/metrics_pref_names.h"
 #include "components/metrics/proto/system_profile.pb.h"
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/pref_service.h"
+#include "extensions/features/features.h"
 
 #if defined(OS_WIN)
 #include <windows.h>  // Needed for STATUS_* codes
@@ -164,6 +166,14 @@
   registry->RegisterInt64Pref(prefs::kUninstallMetricsPageLoadCount, 0);
 }
 
+// static
+void StabilityMetricsHelper::IncreaseRendererCrashCount(
+    PrefService* local_state) {
+  // It doesn't use IncrementPrefValue() because the function is static.
+  int value = local_state->GetInteger(prefs::kStabilityRendererCrashCount);
+  local_state->SetInteger(prefs::kStabilityRendererCrashCount, value + 1);
+}
+
 void StabilityMetricsHelper::BrowserChildProcessCrashed() {
   IncrementPrefValue(prefs::kStabilityChildProcessCrashCount);
 }
@@ -189,6 +199,9 @@
     case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
     case base::TERMINATION_STATUS_OOM:
       if (was_extension_process) {
+#if !BUILDFLAG(ENABLE_EXTENSIONS)
+        NOTREACHED();
+#endif
         IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount);
 
         UMA_HISTOGRAM_SPARSE_SLOWLY("CrashExitCodes.Extension",
diff --git a/components/metrics/stability_metrics_helper.h b/components/metrics/stability_metrics_helper.h
index bc9aaed0..a67dad2 100644
--- a/components/metrics/stability_metrics_helper.h
+++ b/components/metrics/stability_metrics_helper.h
@@ -48,11 +48,14 @@
   // Registers local state prefs used by this class.
   static void RegisterPrefs(PrefRegistrySimple* registry);
 
+  // Increments the RendererCrash pref.
+  static void IncreaseRendererCrashCount(PrefService* local_state);
+
  private:
-  // Increment an Integer pref value specified by |path|.
+  // Increments an Integer pref value specified by |path|.
   void IncrementPrefValue(const char* path);
 
-  // Increment a 64-bit Integer pref value specified by |path|.
+  // Increments a 64-bit Integer pref value specified by |path|.
   void IncrementLongPrefsValue(const char* path);
 
   PrefService* local_state_;
diff --git a/components/metrics/stability_metrics_helper_unittest.cc b/components/metrics/stability_metrics_helper_unittest.cc
index 018906d..edc9aaa 100644
--- a/components/metrics/stability_metrics_helper_unittest.cc
+++ b/components/metrics/stability_metrics_helper_unittest.cc
@@ -6,10 +6,12 @@
 
 #include "base/macros.h"
 #include "base/test/histogram_tester.h"
+#include "build/build_config.h"
 #include "components/metrics/proto/system_profile.pb.h"
 #include "components/prefs/pref_service.h"
 #include "components/prefs/scoped_user_pref_update.h"
 #include "components/prefs/testing_pref_service.h"
+#include "extensions/features/features.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace metrics {
@@ -90,7 +92,29 @@
   EXPECT_EQ(1, system_profile.stability().renderer_failed_launch_count());
   EXPECT_EQ(0, system_profile.stability().extension_renderer_crash_count());
 
-  helper.ClearSavedStabilityMetrics();
+  histogram_tester.ExpectUniqueSample("CrashExitCodes.Renderer", 1, 3);
+  histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildCrashes",
+                                     RENDERER_TYPE_RENDERER, 3);
+
+  // One launch failure each.
+  histogram_tester.ExpectBucketCount(
+      "BrowserRenderProcessHost.ChildLaunchFailures", RENDERER_TYPE_RENDERER,
+      1);
+
+  // TERMINATION_STATUS_PROCESS_WAS_KILLED for a renderer.
+  histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildKills",
+                                     RENDERER_TYPE_RENDERER, 1);
+  histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildKills",
+                                     RENDERER_TYPE_EXTENSION, 0);
+  histogram_tester.ExpectBucketCount(
+      "BrowserRenderProcessHost.ChildLaunchFailureCodes", 1, 1);
+}
+
+// Note: ENABLE_EXTENSIONS is set to false in Android
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+TEST_F(StabilityMetricsHelperTest, LogRendererCrashEnableExtensions) {
+  StabilityMetricsHelper helper(prefs());
+  base::HistogramTester histogram_tester;
 
   // Crash and abnormal termination should increment extension crash count.
   helper.LogRendererCrash(true, base::TERMINATION_STATUS_PROCESS_CRASHED, 1);
@@ -101,7 +125,7 @@
   // Failed launch increments extension failed launch count.
   helper.LogRendererCrash(true, base::TERMINATION_STATUS_LAUNCH_FAILED, 1);
 
-  system_profile.Clear();
+  metrics::SystemProfileProto system_profile;
   helper.ProvideStabilityMetrics(&system_profile);
 
   EXPECT_EQ(0, system_profile.stability().renderer_crash_count());
@@ -109,32 +133,15 @@
   EXPECT_EQ(
       1, system_profile.stability().extension_renderer_failed_launch_count());
 
-  // TERMINATION_STATUS_PROCESS_CRASHED, TERMINATION_STATUS_ABNORMAL_TERMINATION
-  // and TERMINATION_STATUS_OOM = 3.
-  histogram_tester.ExpectUniqueSample("CrashExitCodes.Renderer", 1, 3);
-  histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildCrashes",
-                                     RENDERER_TYPE_RENDERER, 3);
-
-  // TERMINATION_STATUS_PROCESS_CRASHED and TERMINATION_STATUS_OOM = 2.
+  histogram_tester.ExpectBucketCount(
+      "BrowserRenderProcessHost.ChildLaunchFailureCodes", 1, 1);
   histogram_tester.ExpectUniqueSample("CrashExitCodes.Extension", 1, 2);
   histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildCrashes",
                                      RENDERER_TYPE_EXTENSION, 2);
-
-  // One launch failure each.
-  histogram_tester.ExpectBucketCount(
-      "BrowserRenderProcessHost.ChildLaunchFailures", RENDERER_TYPE_RENDERER,
-      1);
   histogram_tester.ExpectBucketCount(
       "BrowserRenderProcessHost.ChildLaunchFailures", RENDERER_TYPE_EXTENSION,
       1);
-  histogram_tester.ExpectBucketCount(
-      "BrowserRenderProcessHost.ChildLaunchFailureCodes", 1, 2);
-
-  // TERMINATION_STATUS_PROCESS_WAS_KILLED for a renderer.
-  histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildKills",
-                                     RENDERER_TYPE_RENDERER, 1);
-  histogram_tester.ExpectBucketCount("BrowserRenderProcessHost.ChildKills",
-                                     RENDERER_TYPE_EXTENSION, 0);
 }
+#endif
 
 }  // namespace metrics
diff --git a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
index 1cd3742e..5d4970fb 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
@@ -140,7 +140,7 @@
 
   if (IsRightDevice(device)) {
     PA_LOG(INFO) << "Connecting to device " << device->GetAddress();
-    connection_ = CreateConnection(device->GetAddress());
+    connection_ = CreateConnection(device);
     connection_->AddObserver(this);
     connection_->Connect();
 
@@ -225,10 +225,11 @@
 
 std::unique_ptr<cryptauth::Connection>
 BluetoothLowEnergyConnectionFinder::CreateConnection(
-    const std::string& device_address) {
+    device::BluetoothDevice* bluetooth_device) {
   return cryptauth::weave::BluetoothLowEnergyWeaveClientConnection::Factory::
-      NewInstance(remote_device_, device_address, adapter_,
-                  device::BluetoothUUID(service_uuid_));
+      NewInstance(remote_device_, adapter_,
+                  device::BluetoothUUID(service_uuid_), bluetooth_device,
+                  true /* should_set_low_connection_latency */);
 }
 
 void BluetoothLowEnergyConnectionFinder::OnConnectionStatusChanged(
diff --git a/components/proximity_auth/bluetooth_low_energy_connection_finder.h b/components/proximity_auth/bluetooth_low_energy_connection_finder.h
index 78b6b7a..963d8d8 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder.h
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder.h
@@ -70,7 +70,7 @@
   // Creates a proximity_auth::Connection with the device given by
   // |device_address|. Exposed for testing.
   virtual std::unique_ptr<cryptauth::Connection> CreateConnection(
-      const std::string& device_address);
+      device::BluetoothDevice* bluetooth_device);
 
   // Checks if |device| is advertising the right EID.
   virtual bool IsRightDevice(device::BluetoothDevice* device);
diff --git a/components/proximity_auth/bluetooth_low_energy_connection_finder_unittest.cc b/components/proximity_auth/bluetooth_low_energy_connection_finder_unittest.cc
index a8dd532..ab3d063 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder_unittest.cc
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder_unittest.cc
@@ -108,7 +108,7 @@
 
  protected:
   std::unique_ptr<cryptauth::Connection> CreateConnection(
-      const std::string& device_address) override {
+      device::BluetoothDevice* bluetooth_device) override {
     return base::WrapUnique(CreateConnectionProxy());
   }
 
diff --git a/content/browser/renderer_host/input/mouse_wheel_phase_handler.cc b/content/browser/renderer_host/input/mouse_wheel_phase_handler.cc
index 318561b07..e777e56 100644
--- a/content/browser/renderer_host/input/mouse_wheel_phase_handler.cc
+++ b/content/browser/renderer_host/input/mouse_wheel_phase_handler.cc
@@ -7,6 +7,7 @@
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
 #include "content/browser/renderer_host/render_widget_host_view_base.h"
+#include "ui/events/base_event_utils.h"
 
 namespace content {
 MouseWheelPhaseHandler::MouseWheelPhaseHandler(
@@ -70,6 +71,8 @@
     bool should_route_event) {
   DCHECK(host_view_->wheel_scroll_latching_enabled());
   blink::WebMouseWheelEvent mouse_wheel_event = last_mouse_wheel_event;
+  mouse_wheel_event.SetTimeStampSeconds(
+      ui::EventTimeStampToSeconds(ui::EventTimeForNow()));
   mouse_wheel_event.delta_x = 0;
   mouse_wheel_event.delta_y = 0;
   mouse_wheel_event.phase = blink::WebMouseWheelEvent::kPhaseEnded;
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc
index a6f241b..31cf2f9 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.cc
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -57,6 +57,9 @@
     active_touches_ = 0;
   }
 
+  if (view == wheel_target_.target)
+    wheel_target_.target = nullptr;
+
   // If the target that's being destroyed is in the gesture target map, we
   // replace it with nullptr so that we maintain the 1:1 correspondence between
   // map entries and the touch sequences that underly them.
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.h b/content/browser/renderer_host/render_widget_host_input_event_router.h
index ddd9c72..d6daefb 100644
--- a/content/browser/renderer_host/render_widget_host_input_event_router.h
+++ b/content/browser/renderer_host/render_widget_host_input_event_router.h
@@ -192,6 +192,8 @@
                            InputEventRouterGesturePreventDefaultTargetMapTest);
   FRIEND_TEST_ALL_PREFIXES(SitePerProcessBrowserTest,
                            InputEventRouterTouchpadGestureTargetTest);
+  FRIEND_TEST_ALL_PREFIXES(SitePerProcessMouseWheelBrowserTest,
+                           InputEventRouterWheelTargetTest);
 };
 
 }  // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 1ccc4b7..f8def17 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -1957,6 +1957,8 @@
   view_->OnScrollEvent(&scroll1);
   input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0));
   wheel_event = static_cast<const WebMouseWheelEvent*>(input_event);
+  base::TimeTicks wheel_event_timestamp =
+      ui::EventTimeStampFromSeconds(wheel_event->TimeStampSeconds());
   EXPECT_EQ(WebMouseWheelEvent::kPhaseChanged, wheel_event->phase);
   SendInputEventACK(blink::WebInputEvent::kMouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -1968,6 +1970,7 @@
   EXPECT_EQ(2U, gesture_event->data.scroll_update.delta_y);
   SendInputEventACK(WebInputEvent::kGestureScrollUpdate,
                     INPUT_EVENT_ACK_STATE_CONSUMED);
+
   sink_->ClearMessages();
 
   // Let the MouseWheelPhaseHandler::mouse_wheel_end_dispatch_timer_ fire. A
@@ -1979,10 +1982,13 @@
   base::RunLoop().Run();
 
   input_event = GetInputEventFromMessage(*sink_->GetMessageAt(0));
-  wheel_event = static_cast<const WebMouseWheelEvent*>(input_event);
-  EXPECT_EQ(WebMouseWheelEvent::kPhaseEnded, wheel_event->phase);
-  EXPECT_EQ(0U, wheel_event->delta_x);
-  EXPECT_EQ(0U, wheel_event->delta_y);
+  const WebMouseWheelEvent* wheel_end_event =
+      static_cast<const WebMouseWheelEvent*>(input_event);
+  EXPECT_EQ(WebMouseWheelEvent::kPhaseEnded, wheel_end_event->phase);
+  EXPECT_EQ(0U, wheel_end_event->delta_x);
+  EXPECT_EQ(0U, wheel_end_event->delta_y);
+  EXPECT_GT(ui::EventTimeStampFromSeconds(wheel_end_event->TimeStampSeconds()),
+            wheel_event_timestamp);
   SendInputEventACK(blink::WebInputEvent::kMouseWheel,
                     INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
 
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index bd6f6c1..c099fa0 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -6097,6 +6097,60 @@
   RunTest(pos);
 }
 
+IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelBrowserTest,
+                       InputEventRouterWheelTargetTest) {
+  GURL main_url(embedded_test_server()->GetURL(
+      "/frame_tree/page_with_positioned_nested_frames.html"));
+  EXPECT_TRUE(NavigateToURL(shell(), main_url));
+  auto* rwhv_root = static_cast<RenderWidgetHostViewAura*>(
+      web_contents()->GetRenderWidgetHostView());
+  set_rwhv_root(rwhv_root);
+
+  FrameTreeNode* root = web_contents()->GetFrameTree()->root();
+  ASSERT_EQ(1U, root->child_count());
+
+  GURL frame_url(embedded_test_server()->GetURL(
+      "b.com", "/page_with_scrollable_div.html"));
+  NavigateFrameToURL(root->child_at(0), frame_url);
+
+  // Synchronize with the child and parent renderers to guarantee that the
+  // surface information required for event hit testing is ready.
+  RenderWidgetHostViewBase* child_rwhv = static_cast<RenderWidgetHostViewBase*>(
+      root->child_at(0)->current_frame_host()->GetView());
+  WaitForChildFrameSurfaceReady(root->child_at(0)->current_frame_host());
+
+  RenderWidgetHostInputEventRouter* router =
+      web_contents()->GetInputEventRouter();
+
+  // Send a mouse wheel event to child.
+  gfx::Rect bounds = child_rwhv->GetViewBounds();
+  gfx::Point pos(bounds.x() + 10, bounds.y() + 10);
+  SendMouseWheel(pos);
+
+  if (child_rwhv->wheel_scroll_latching_enabled())
+    EXPECT_EQ(child_rwhv, router->wheel_target_.target);
+  else
+    EXPECT_EQ(nullptr, router->wheel_target_.target);
+
+  // Send a mouse wheel event to the main frame. If wheel scroll latching is
+  // enabled it will be still routed to child till the end of current scrolling
+  // sequence.
+  SendMouseWheel(gfx::Point(10, 10));
+  if (child_rwhv->wheel_scroll_latching_enabled())
+    EXPECT_EQ(child_rwhv, router->wheel_target_.target);
+  else
+    EXPECT_EQ(nullptr, router->wheel_target_.target);
+
+  // Kill the wheel target view process. This must reset the wheel_target_.
+  RenderProcessHost* child_process =
+      root->child_at(0)->current_frame_host()->GetProcess();
+  RenderProcessHostWatcher crash_observer(
+      child_process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
+  child_process->Shutdown(0, false);
+  crash_observer.Wait();
+  EXPECT_EQ(nullptr, router->wheel_target_.target);
+}
+
 // Ensure that a cross-process subframe with a touch-handler can receive touch
 // events.
 IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 4742a43..d2485ed 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -702,6 +702,7 @@
   results->is_monochrome = display.is_monochrome();
   results->device_scale_factor = display.device_scale_factor();
   results->color_space = display.color_space();
+  results->color_space.GetICCProfile(&results->icc_profile);
 
   // The Display rotation and the ScreenInfo orientation are not the same
   // angle. The former is the physical display rotation while the later is the
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 25fb389..abcbb302 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -90,6 +90,7 @@
   content::ScreenInfo results;
   results.device_scale_factor = static_cast<int>(display.device_scale_factor());
   results.color_space = display.color_space();
+  results.color_space.GetICCProfile(&results.icc_profile);
   results.depth = display.color_depth();
   results.depth_per_component = display.depth_per_component();
   results.is_monochrome = display.is_monochrome();
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 673c7aab..5fa19a1 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -160,6 +160,7 @@
 IPC_STRUCT_TRAITS_BEGIN(content::ScreenInfo)
   IPC_STRUCT_TRAITS_MEMBER(device_scale_factor)
   IPC_STRUCT_TRAITS_MEMBER(color_space)
+  IPC_STRUCT_TRAITS_MEMBER(icc_profile)
   IPC_STRUCT_TRAITS_MEMBER(depth)
   IPC_STRUCT_TRAITS_MEMBER(depth_per_component)
   IPC_STRUCT_TRAITS_MEMBER(is_monochrome)
diff --git a/content/public/common/screen_info.h b/content/public/common/screen_info.h
index 0a2afbb..a6ff7c7 100644
--- a/content/public/common/screen_info.h
+++ b/content/public/common/screen_info.h
@@ -9,6 +9,7 @@
 #include "content/public/common/screen_orientation_values.h"
 #include "ui/gfx/color_space.h"
 #include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/icc_profile.h"
 
 namespace content {
 
@@ -26,6 +27,9 @@
     // The color space of the output display.
     gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB();
 
+    // The ICC profile from which |color_space| was derived, if any.
+    gfx::ICCProfile icc_profile;
+
     // The screen depth in bits per pixel
     uint32_t depth = 0;
 
diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc
index e739a42a..581fd69 100644
--- a/content/shell/browser/shell_browser_main_parts.cc
+++ b/content/shell/browser/shell_browser_main_parts.cc
@@ -184,7 +184,8 @@
             switches::kCrashDumpsDir);
     breakpad::CrashDumpObserver::GetInstance()->RegisterClient(
         base::MakeUnique<breakpad::ChildProcessCrashObserver>(
-            crash_dumps_dir, kAndroidMinidumpDescriptor));
+            crash_dumps_dir, kAndroidMinidumpDescriptor,
+            base::Bind(&base::DoNothing)));
   }
 
   return 0;
diff --git a/ios/chrome/browser/web/resources/payment_request.js b/ios/chrome/browser/web/resources/payment_request.js
index 12aad762..9f747e2 100644
--- a/ios/chrome/browser/web/resources/payment_request.js
+++ b/ios/chrome/browser/web/resources/payment_request.js
@@ -1417,8 +1417,8 @@
  * @enum {string}
  */
 var PaymentComplete = {
-  SUCCESS: 'success',
   FAIL: 'fail',
+  SUCCESS: 'success',
   UNKNOWN: 'unknown'
 };
 
diff --git a/services/resource_coordinator/memory_instrumentation/coordinator_impl.h b/services/resource_coordinator/memory_instrumentation/coordinator_impl.h
index b53989c7..41e15d1 100644
--- a/services/resource_coordinator/memory_instrumentation/coordinator_impl.h
+++ b/services/resource_coordinator/memory_instrumentation/coordinator_impl.h
@@ -162,14 +162,16 @@
   void FinalizeGlobalMemoryDumpIfAllManagersReplied();
   QueuedMemoryDumpRequest* GetCurrentRequest();
 
-  mojo::BindingSet<mojom::Coordinator, service_manager::Identity> bindings_;
-
   // Map of registered client processes.
   std::map<mojom::ClientProcess*, std::unique_ptr<ClientInfo>> clients_;
 
   // Outstanding dump requests, enqueued via RequestGlobalMemoryDump().
   std::list<QueuedMemoryDumpRequest> queued_memory_dump_requests_;
 
+  // There may be extant callbacks in |queued_memory_dump_requests_|. The
+  // bindings_ must be closed before destroying the un-run callbacks.
+  mojo::BindingSet<mojom::Coordinator, service_manager::Identity> bindings_;
+
   // Maintains a map of service_manager::Identity -> pid for registered clients.
   std::unique_ptr<ProcessMap> process_map_;
   uint64_t next_dump_id_;
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
index db1d8f6..e2775bf 100644
--- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
+++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -271878,7 +271878,7 @@
    "support"
   ],
   "interfaces/dom.idl": [
-   "f39e0bad95534e2cc59012436ea430fe2a414c05",
+   "915affb8d20dcc9055d3f453efbb893d14fc529b",
    "support"
   ],
   "interfaces/fullscreen.idl": [
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
index 9e21254..d7f91ca 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -456,10 +456,6 @@
 interface CSSSupportsRule : CSSConditionRule
     attribute @@toStringTag
     method constructor
-interface CSSViewportRule : CSSRule
-    attribute @@toStringTag
-    getter style
-    method constructor
 interface Cache
     attribute @@toStringTag
     method add
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
index 46734b3..d58c0a8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -385,10 +385,6 @@
 interface CSSSupportsRule : CSSConditionRule
     attribute @@toStringTag
     method constructor
-interface CSSViewportRule : CSSRule
-    attribute @@toStringTag
-    getter style
-    method constructor
 interface Cache
     attribute @@toStringTag
     method add
diff --git a/third_party/WebKit/LayoutTests/reporting-observer/deprecation.html b/third_party/WebKit/LayoutTests/reporting-observer/deprecation.html
index 30e4123..6e9a18f 100644
--- a/third_party/WebKit/LayoutTests/reporting-observer/deprecation.html
+++ b/third_party/WebKit/LayoutTests/reporting-observer/deprecation.html
@@ -1,5 +1,5 @@
 <!doctype html>
 <script src="../resources/testharness.js"></script>
 <script src="../resources/testharnessreport.js"></script>
-<p>ReportingObserver tests</p>
+<p>Testing deprecation reports and ReportingObserver</p>
 <script src="resources/deprecation.js"></script>
diff --git a/third_party/WebKit/LayoutTests/reporting-observer/intervention.html b/third_party/WebKit/LayoutTests/reporting-observer/intervention.html
new file mode 100644
index 0000000..6e614f81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/reporting-observer/intervention.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<div id="target" style="padding: 10px; background-color: blue;">
+<p>Testing intervention reports and ReportingObserver</p>
+</div>
+
+<script src="resources/intervention.js"></script>
diff --git a/third_party/WebKit/LayoutTests/reporting-observer/resources/intervention.js b/third_party/WebKit/LayoutTests/reporting-observer/resources/intervention.js
new file mode 100644
index 0000000..06ed4195
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/reporting-observer/resources/intervention.js
@@ -0,0 +1,50 @@
+async_test(function(test) {
+  var observer = new ReportingObserver(function(reports, observer) {
+    test.done();
+  window.console.log("************************************** IN OBSERVER");
+    test.step(function() {
+      assert_equals(reports.length, 1);
+
+      // Ensure that the contents of the report are valid.
+      assert_equals(report.type, "intervention");
+      assert_true(report.url.endsWith(
+          "reporting-observer/intervention.html"));
+      assert_true(report.body.sourceFile.endsWith(
+          "reporting-observer/resources/intervention.js"));
+      assert_equals(typeof reports[0].body.lineNumber, "number");
+      assert_equals(typeof reports[0].body.message, "string");
+    });
+
+    test.done();
+  });
+  observer.observe();
+
+  // Cause an intervention.
+
+  var target = document.getElementById('target');
+  var rect = target.getBoundingClientRect();
+  var targetX = rect.left + rect.width / 2;
+  var targetY = rect.top + rect.height / 2;
+  document.body.addEventListener('touchstart', function(e) {
+    window.console.log("************************************** TOUCH " + e.type);
+    e.preventDefault();
+    test.done();
+  });
+
+  var touches = [new Touch({identifier: 1, clientX: targetX, clientY: targetY, target: target})];
+  var touchEventInit = {
+    cancelable: false,
+    touches: touches,
+    targetTouches: touches,
+    changedTouches: touches,
+    view: window
+  };
+  var event = new TouchEvent('touchstart', touchEventInit);
+
+
+  var deadline = performance.now() + 100;
+  while (performance.now() < deadline) {};
+
+
+  document.body.dispatchEvent(event);
+}, "Intervention report");
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index c614d34..cb4e780 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -419,12 +419,15 @@
     V8ThrowException::ThrowError(isolate, "Source file too large.");
     return v8::Local<v8::Script>();
   }
+  // TODO(kouhei) crbug.com/711706 : Plumb nonce/parser_state through
+  // ScriptSourceCode.
+  const ReferrerScriptInfo referrer_info;
   return CompileScript(
       script_state, V8String(isolate, source.Source()), source.Url(),
       source.SourceMapUrl(), source.StartPosition(), source.GetResource(),
       source.Streamer(),
       source.GetResource() ? source.GetResource()->CacheHandler() : nullptr,
-      access_control_status, cache_options);
+      access_control_status, cache_options, referrer_info);
 }
 
 v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript(
@@ -435,7 +438,8 @@
     const TextPosition& text_position,
     CachedMetadataHandler* cache_metadata_handler,
     AccessControlStatus access_control_status,
-    V8CacheOptions v8_cache_options) {
+    V8CacheOptions v8_cache_options,
+    const ReferrerScriptInfo& referrer_info) {
   v8::Isolate* isolate = script_state->GetIsolate();
   if (code.length() >= v8::String::kMaxLength) {
     V8ThrowException::ThrowError(isolate, "Source file too large.");
@@ -444,7 +448,7 @@
   return CompileScript(script_state, V8String(isolate, code), file_name,
                        source_map_url, text_position, nullptr, nullptr,
                        cache_metadata_handler, access_control_status,
-                       v8_cache_options);
+                       v8_cache_options, referrer_info);
 }
 
 v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript(
@@ -459,6 +463,13 @@
     AccessControlStatus access_control_status,
     V8CacheOptions cache_options,
     const ReferrerScriptInfo& referrer_info) {
+  // As specified in [HIMD] Step 5-6, the credentials mode for a classic script
+  // is always "omit".
+  // [HIMD]
+  // https://github.com/tc39/proposal-dynamic-import/blob/master/HTML%20Integration.md#hostimportmoduledynamicallyreferencingscriptormodule-specifier-promisecapability
+  DCHECK_EQ(WebURLRequest::kFetchCredentialsModeOmit,
+            referrer_info.CredentialsMode());
+
   TRACE_EVENT2(
       "v8,devtools.timeline", "v8.compile", "fileName", file_name.Utf8(),
       "data",
@@ -574,10 +585,13 @@
     const String& file_name,
     const TextPosition& script_start_position) {
   v8::Local<v8::Script> script;
-  if (!V8ScriptRunner::CompileScript(script_state, source, file_name, String(),
-                                     script_start_position, nullptr, nullptr,
-                                     nullptr, kSharableCrossOrigin,
-                                     kV8CacheOptionsDefault)
+  // Use default ScriptReferrerInfo here:
+  // - nonce: empty for internal script, and
+  // - parser_state: always "not parser inserted" for internal scripts.
+  if (!V8ScriptRunner::CompileScript(
+           script_state, source, file_name, String(), script_start_position,
+           nullptr, nullptr, nullptr, kSharableCrossOrigin,
+           kV8CacheOptionsDefault, ReferrerScriptInfo())
            .ToLocal(&script))
     return v8::MaybeLocal<v8::Value>();
 
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
index 526690f..8fba3b06 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
@@ -65,23 +65,23 @@
                                                   const TextPosition&,
                                                   CachedMetadataHandler*,
                                                   AccessControlStatus,
-                                                  V8CacheOptions);
+                                                  V8CacheOptions,
+                                                  const ReferrerScriptInfo&);
   // CachedMetadataHandler is set when metadata caching is supported. For
   // normal scripe resources, CachedMetadataHandler is from ScriptResource.
   // For worker script, ScriptResource is null but CachedMetadataHandler may be
   // set. When ScriptStreamer is set, ScriptResource must be set.
-  static v8::MaybeLocal<v8::Script> CompileScript(
-      ScriptState*,
-      v8::Local<v8::String>,
-      const String& file_name,
-      const String& source_map_url,
-      const TextPosition&,
-      ScriptResource*,
-      ScriptStreamer*,
-      CachedMetadataHandler*,
-      AccessControlStatus,
-      V8CacheOptions,
-      const ReferrerScriptInfo& = ReferrerScriptInfo());
+  static v8::MaybeLocal<v8::Script> CompileScript(ScriptState*,
+                                                  v8::Local<v8::String>,
+                                                  const String& file_name,
+                                                  const String& source_map_url,
+                                                  const TextPosition&,
+                                                  ScriptResource*,
+                                                  ScriptStreamer*,
+                                                  CachedMetadataHandler*,
+                                                  AccessControlStatus,
+                                                  V8CacheOptions,
+                                                  const ReferrerScriptInfo&);
   static v8::MaybeLocal<v8::Module> CompileModule(v8::Isolate*,
                                                   const String& source,
                                                   const String& file_name,
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
index 42dca301..a424344 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
@@ -4,6 +4,7 @@
 
 #include "bindings/core/v8/V8ScriptRunner.h"
 
+#include "bindings/core/v8/ReferrerScriptInfo.h"
 #include "bindings/core/v8/V8BindingForCore.h"
 #include "bindings/core/v8/V8BindingForTesting.h"
 #include "core/loader/resource/ScriptResource.h"
@@ -63,7 +64,7 @@
                 script_state, V8String(script_state->GetIsolate(), Code()),
                 Filename(), String(), WTF::TextPosition(), resource_.Get(),
                 nullptr, resource_.Get() ? resource_->CacheHandler() : nullptr,
-                kNotSharableCrossOrigin, cache_options)
+                kNotSharableCrossOrigin, cache_options, ReferrerScriptInfo())
                 .IsEmpty();
   }
 
diff --git a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
index e1cd3cd..c00f376 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp
@@ -268,10 +268,14 @@
 
   v8::Local<v8::Script> compiled_script;
   v8::MaybeLocal<v8::Value> maybe_result;
+  // Use default ReferrerScriptInfo here, as
+  // - A work{er,let} script doesn't have a nonce, and
+  // - a work{er,let} script is always "not parser inserted".
+  ReferrerScriptInfo referrer_info;
   if (V8ScriptRunner::CompileScript(script_state_.Get(), script, file_name,
                                     String(), script_start_position,
                                     cache_handler, kSharableCrossOrigin,
-                                    v8_cache_options)
+                                    v8_cache_options, referrer_info)
           .ToLocal(&compiled_script))
     maybe_result = V8ScriptRunner::RunCompiledScript(isolate_, compiled_script,
                                                      global_scope_);
diff --git a/third_party/WebKit/Source/core/core_idl_files.gni b/third_party/WebKit/Source/core/core_idl_files.gni
index a15ba05..db76887 100644
--- a/third_party/WebKit/Source/core/core_idl_files.gni
+++ b/third_party/WebKit/Source/core/core_idl_files.gni
@@ -167,6 +167,7 @@
                     "frame/DeprecationReport.idl",
                     "frame/External.idl",
                     "frame/History.idl",
+                    "frame/InterventionReport.idl",
                     "frame/Location.idl",
                     "frame/Report.idl",
                     "frame/ReportBody.idl",
diff --git a/third_party/WebKit/Source/core/css/CSSViewportRule.idl b/third_party/WebKit/Source/core/css/CSSViewportRule.idl
index cec67e6..4c1894b 100644
--- a/third_party/WebKit/Source/core/css/CSSViewportRule.idl
+++ b/third_party/WebKit/Source/core/css/CSSViewportRule.idl
@@ -29,6 +29,8 @@
 
 // https://drafts.csswg.org/css-device-adapt/#css-viewport-rule-interface
 
-interface CSSViewportRule : CSSRule {
+[
+    RuntimeEnabled=CSSViewport
+] interface CSSViewportRule : CSSRule {
     readonly attribute CSSStyleDeclaration style;
 };
diff --git a/third_party/WebKit/Source/core/events/TouchEvent.cpp b/third_party/WebKit/Source/core/events/TouchEvent.cpp
index 8733892..1a6a9a9 100644
--- a/third_party/WebKit/Source/core/events/TouchEvent.cpp
+++ b/third_party/WebKit/Source/core/events/TouchEvent.cpp
@@ -28,6 +28,7 @@
 
 #include "core/dom/events/EventDispatcher.h"
 #include "core/frame/FrameConsole.h"
+#include "core/frame/Intervention.h"
 #include "core/frame/LocalDOMWindow.h"
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/UseCounter.h"
@@ -317,9 +318,8 @@
 
   if (!warning_message.IsEmpty() && view() && view()->IsLocalDOMWindow() &&
       view()->GetFrame()) {
-    ToLocalDOMWindow(view())->GetFrame()->Console().AddMessage(
-        ConsoleMessage::Create(message_source, kWarningMessageLevel,
-                               warning_message));
+    Intervention::GenerateReport(ToLocalDOMWindow(view())->GetFrame(),
+                                 warning_message);
   }
 
   if ((type() == EventTypeNames::touchstart ||
diff --git a/third_party/WebKit/Source/core/events/TouchEventTest.cpp b/third_party/WebKit/Source/core/events/TouchEventTest.cpp
index 23801e6..00fe007 100644
--- a/third_party/WebKit/Source/core/events/TouchEventTest.cpp
+++ b/third_party/WebKit/Source/core/events/TouchEventTest.cpp
@@ -84,7 +84,7 @@
               ElementsAre("Ignored attempt to cancel a touchstart event with "
                           "cancelable=false, for example because scrolling is "
                           "in progress and cannot be interrupted."));
-  EXPECT_THAT(MessageSources(), ElementsAre(kJSMessageSource));
+  EXPECT_THAT(MessageSources(), ElementsAre(kInterventionMessageSource));
 
   EXPECT_TRUE(UseCounter::IsCounted(
       GetDocument(), WebFeature::kUncancelableTouchEventPreventDefaulted));
diff --git a/third_party/WebKit/Source/core/frame/BUILD.gn b/third_party/WebKit/Source/core/frame/BUILD.gn
index 42c3061b..df7ae39 100644
--- a/third_party/WebKit/Source/core/frame/BUILD.gn
+++ b/third_party/WebKit/Source/core/frame/BUILD.gn
@@ -56,6 +56,9 @@
     "History.h",
     "HostsUsingFeatures.cpp",
     "HostsUsingFeatures.h",
+    "Intervention.cpp",
+    "Intervention.h",
+    "InterventionReport.h",
     "LayoutSubtreeRootList.cpp",
     "LayoutSubtreeRootList.h",
     "LocalDOMWindow.cpp",
diff --git a/third_party/WebKit/Source/core/frame/Intervention.cpp b/third_party/WebKit/Source/core/frame/Intervention.cpp
new file mode 100644
index 0000000..8569bc2
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/Intervention.cpp
@@ -0,0 +1,41 @@
+// 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 "core/frame/Intervention.h"
+
+#include "core/frame/FrameConsole.h"
+#include "core/frame/InterventionReport.h"
+#include "core/frame/LocalFrame.h"
+#include "core/frame/Report.h"
+#include "core/frame/ReportingContext.h"
+#include "core/inspector/ConsoleMessage.h"
+
+namespace blink {
+
+// static
+void Intervention::GenerateReport(const LocalFrame* frame,
+                                  const String& message) {
+  if (!frame)
+    return;
+
+  // Send the message to the console.
+  frame->Console().AddMessage(ConsoleMessage::Create(
+      kInterventionMessageSource, kWarningMessageLevel, message));
+
+  if (!frame->Client())
+    return;
+
+  // Send the intervention report to any ReportingObservers.
+  Document* document = frame->GetDocument();
+  ReportingContext* reporting_context = ReportingContext::From(document);
+  if (!reporting_context->ObserverExists())
+    return;
+
+  ReportBody* body = new InterventionReport(message, SourceLocation::Capture());
+  Report* report =
+      new Report("intervention", document->Url().GetString(), body);
+  reporting_context->QueueReport(report);
+}
+
+}  // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/Intervention.h b/third_party/WebKit/Source/core/frame/Intervention.h
new file mode 100644
index 0000000..470a8521
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/Intervention.h
@@ -0,0 +1,32 @@
+// 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 Intervention_h
+#define Intervention_h
+
+#include "core/CoreExport.h"
+#include "platform/wtf/Allocator.h"
+#include "platform/wtf/Noncopyable.h"
+#include "platform/wtf/text/WTFString.h"
+
+namespace blink {
+
+class LocalFrame;
+
+class CORE_EXPORT Intervention {
+  DISALLOW_NEW();
+  WTF_MAKE_NONCOPYABLE(Intervention);
+
+ public:
+  Intervention() {}
+  ~Intervention() {}
+
+  // Generates an intervention report, and sends the intervention message to the
+  // console. The report will be routed to any ReportingObservers.
+  static void GenerateReport(const LocalFrame*, const String& message);
+};
+
+}  // namespace blink
+
+#endif  // Intervention_h
diff --git a/third_party/WebKit/Source/core/frame/InterventionReport.h b/third_party/WebKit/Source/core/frame/InterventionReport.h
new file mode 100644
index 0000000..87ebcd9
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/InterventionReport.h
@@ -0,0 +1,37 @@
+// 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 InterventionReport_h
+#define InterventionReport_h
+
+#include "bindings/core/v8/SourceLocation.h"
+#include "core/frame/ReportBody.h"
+
+namespace blink {
+
+// TODO(paulmeyer): Consider refactor with DeprecationReport.h.
+class CORE_EXPORT InterventionReport : public ReportBody {
+  DEFINE_WRAPPERTYPEINFO();
+
+ public:
+  InterventionReport(const String& message,
+                     std::unique_ptr<SourceLocation> location)
+      : message_(message), location_(std::move(location)) {}
+
+  ~InterventionReport() override {}
+
+  String message() const { return message_; }
+  String sourceFile() const { return location_->Url(); }
+  long lineNumber() const { return location_->LineNumber(); }
+
+  DEFINE_INLINE_VIRTUAL_TRACE() { ReportBody::Trace(visitor); }
+
+ private:
+  const String message_;
+  std::unique_ptr<SourceLocation> location_;
+};
+
+}  // namespace blink
+
+#endif  // InterventionReport_h
diff --git a/third_party/WebKit/Source/core/frame/InterventionReport.idl b/third_party/WebKit/Source/core/frame/InterventionReport.idl
new file mode 100644
index 0000000..aa0c81d
--- /dev/null
+++ b/third_party/WebKit/Source/core/frame/InterventionReport.idl
@@ -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.
+
+// https://github.com/WICG/reporting/blob/master/EXPLAINER.md#reportingobserver---observing-reports-from-javascript
+
+[
+    NoInterfaceObject,
+    RuntimeEnabled=ReportingObserver
+] interface InterventionReport : ReportBody {
+  // TODO(paulmeyer): Add additional data, such as id.
+  readonly attribute DOMString message;
+  readonly attribute DOMString sourceFile;
+  readonly attribute long lineNumber;
+};
diff --git a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
index a9e294e..703ffb8 100644
--- a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
@@ -647,11 +647,8 @@
 
 void WebLocalFrameImpl::ExecuteScript(const WebScriptSource& source) {
   DCHECK(GetFrame());
-  TextPosition position(OrdinalNumber::FromOneBasedInt(source.start_line),
-                        OrdinalNumber::First());
   v8::HandleScope handle_scope(ToIsolate(GetFrame()));
-  GetFrame()->GetScriptController().ExecuteScriptInMainWorld(
-      ScriptSourceCode(source.code, source.url, position));
+  GetFrame()->GetScriptController().ExecuteScriptInMainWorld(source);
 }
 
 void WebLocalFrameImpl::ExecuteScriptInIsolatedWorld(
@@ -729,12 +726,9 @@
     const WebScriptSource& source) {
   DCHECK(GetFrame());
 
-  TextPosition position(OrdinalNumber::FromOneBasedInt(source.start_line),
-                        OrdinalNumber::First());
   return GetFrame()
       ->GetScriptController()
-      .ExecuteScriptInMainWorldAndReturnValue(
-          ScriptSourceCode(source.code, source.url, position));
+      .ExecuteScriptInMainWorldAndReturnValue(source);
 }
 
 void WebLocalFrameImpl::RequestExecuteScriptAndReturnValue(
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
index af99eac..fa5366a 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -835,6 +835,9 @@
     if (!ancestor_accessible_node)
       continue;
 
+    if (!ancestor_accessible_node->HasEventListeners(event.type()))
+      continue;
+
     event_path.push_back(ancestor_accessible_node);
   }
 
diff --git a/third_party/WebKit/Source/modules/payments/PaymentCompleter.h b/third_party/WebKit/Source/modules/payments/PaymentCompleter.h
index 66e2e79..13a35f4 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentCompleter.h
+++ b/third_party/WebKit/Source/modules/payments/PaymentCompleter.h
@@ -15,7 +15,7 @@
 
 class MODULES_EXPORT PaymentCompleter : public GarbageCollectedMixin {
  public:
-  enum PaymentComplete { kSuccess, kFail, kUnknown };
+  enum PaymentComplete { kFail, kSuccess, kUnknown };
 
   virtual ScriptPromise Complete(ScriptState*, PaymentComplete result) = 0;
 
diff --git a/third_party/WebKit/Source/modules/payments/PaymentResponse.idl b/third_party/WebKit/Source/modules/payments/PaymentResponse.idl
index d0418e0..8a5bb93 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentResponse.idl
+++ b/third_party/WebKit/Source/modules/payments/PaymentResponse.idl
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-// https://w3c.github.io/browser-payment-api/#idl-def-paymentcomplete
+// https://w3c.github.io/payment-request/#dom-paymentcomplete
 
 enum PaymentComplete {
-    "success",
     "fail",
+    "success",
     "unknown"
 };
 
diff --git a/third_party/WebKit/Source/platform/CalculationValue.h b/third_party/WebKit/Source/platform/CalculationValue.h
index 93c2103..05a0dad0 100644
--- a/third_party/WebKit/Source/platform/CalculationValue.h
+++ b/third_party/WebKit/Source/platform/CalculationValue.h
@@ -42,7 +42,7 @@
  public:
   static RefPtr<CalculationValue> Create(PixelsAndPercent value,
                                          ValueRange range) {
-    return AdoptRef(new CalculationValue(value, range));
+    return WTF::AdoptRef(new CalculationValue(value, range));
   }
 
   float Evaluate(float max_value) const {
diff --git a/third_party/WebKit/Source/platform/DragImageTest.cpp b/third_party/WebKit/Source/platform/DragImageTest.cpp
index c80629fb..857b5171c 100644
--- a/third_party/WebKit/Source/platform/DragImageTest.cpp
+++ b/third_party/WebKit/Source/platform/DragImageTest.cpp
@@ -50,11 +50,11 @@
 class TestImage : public Image {
  public:
   static RefPtr<TestImage> Create(sk_sp<SkImage> image) {
-    return AdoptRef(new TestImage(image));
+    return WTF::AdoptRef(new TestImage(image));
   }
 
   static RefPtr<TestImage> Create(const IntSize& size) {
-    return AdoptRef(new TestImage(size));
+    return WTF::AdoptRef(new TestImage(size));
   }
 
   IntSize Size() const override {
diff --git a/third_party/WebKit/Source/platform/LayoutLocale.cpp b/third_party/WebKit/Source/platform/LayoutLocale.cpp
index 8aa728d..c1454637 100644
--- a/third_party/WebKit/Source/platform/LayoutLocale.cpp
+++ b/third_party/WebKit/Source/platform/LayoutLocale.cpp
@@ -118,7 +118,7 @@
 
   auto result = FontGlobalContext::GetLayoutLocaleMap().insert(locale, nullptr);
   if (result.is_new_entry)
-    result.stored_value->value = AdoptRef(new LayoutLocale(locale));
+    result.stored_value->value = WTF::AdoptRef(new LayoutLocale(locale));
   return result.stored_value->value.Get();
 }
 
@@ -148,7 +148,7 @@
 
 RefPtr<LayoutLocale> LayoutLocale::CreateForTesting(
     const AtomicString& locale) {
-  return AdoptRef(new LayoutLocale(locale));
+  return WTF::AdoptRef(new LayoutLocale(locale));
 }
 
 Hyphenation* LayoutLocale::GetHyphenation() const {
diff --git a/third_party/WebKit/Source/platform/PODArena.h b/third_party/WebKit/Source/platform/PODArena.h
index 98d61c5..d654b3fc 100644
--- a/third_party/WebKit/Source/platform/PODArena.h
+++ b/third_party/WebKit/Source/platform/PODArena.h
@@ -62,7 +62,7 @@
   class FastMallocAllocator : public Allocator {
    public:
     static RefPtr<FastMallocAllocator> Create() {
-      return AdoptRef(new FastMallocAllocator);
+      return WTF::AdoptRef(new FastMallocAllocator);
     }
 
     void* Allocate(size_t size) override {
@@ -76,11 +76,11 @@
   };
 
   // Creates a new PODArena configured with a FastMallocAllocator.
-  static RefPtr<PODArena> Create() { return AdoptRef(new PODArena); }
+  static RefPtr<PODArena> Create() { return WTF::AdoptRef(new PODArena); }
 
   // Creates a new PODArena configured with the given Allocator.
   static RefPtr<PODArena> Create(RefPtr<Allocator> allocator) {
-    return AdoptRef(new PODArena(std::move(allocator)));
+    return WTF::AdoptRef(new PODArena(std::move(allocator)));
   }
 
   // Allocates an object from the arena.
diff --git a/third_party/WebKit/Source/platform/PODFreeListArena.h b/third_party/WebKit/Source/platform/PODFreeListArena.h
index 7f275d0..9239597 100644
--- a/third_party/WebKit/Source/platform/PODFreeListArena.h
+++ b/third_party/WebKit/Source/platform/PODFreeListArena.h
@@ -36,13 +36,13 @@
 class PODFreeListArena : public RefCounted<PODFreeListArena<T>> {
  public:
   static RefPtr<PODFreeListArena> Create() {
-    return AdoptRef(new PODFreeListArena);
+    return WTF::AdoptRef(new PODFreeListArena);
   }
 
   // Creates a new PODFreeListArena configured with the given Allocator.
   static RefPtr<PODFreeListArena> Create(
       RefPtr<PODArena::Allocator> allocator) {
-    return AdoptRef(new PODFreeListArena(std::move(allocator)));
+    return WTF::AdoptRef(new PODFreeListArena(std::move(allocator)));
   }
 
   // Allocates an object from the arena.
diff --git a/third_party/WebKit/Source/platform/SharedBuffer.h b/third_party/WebKit/Source/platform/SharedBuffer.h
index 8ba6315..c57ed56 100644
--- a/third_party/WebKit/Source/platform/SharedBuffer.h
+++ b/third_party/WebKit/Source/platform/SharedBuffer.h
@@ -42,26 +42,28 @@
  public:
   enum : unsigned { kSegmentSize = 0x1000 };
 
-  static RefPtr<SharedBuffer> Create() { return AdoptRef(new SharedBuffer); }
+  static RefPtr<SharedBuffer> Create() {
+    return WTF::AdoptRef(new SharedBuffer);
+  }
 
   HAS_STRICTLY_TYPED_ARG
   static RefPtr<SharedBuffer> Create(STRICTLY_TYPED_ARG(size)) {
     STRICT_ARG_TYPE(size_t);
-    return AdoptRef(new SharedBuffer(size));
+    return WTF::AdoptRef(new SharedBuffer(size));
   }
 
   HAS_STRICTLY_TYPED_ARG
   static RefPtr<SharedBuffer> Create(const char* data,
                                      STRICTLY_TYPED_ARG(size)) {
     STRICT_ARG_TYPE(size_t);
-    return AdoptRef(new SharedBuffer(data, size));
+    return WTF::AdoptRef(new SharedBuffer(data, size));
   }
 
   HAS_STRICTLY_TYPED_ARG
   static RefPtr<SharedBuffer> Create(const unsigned char* data,
                                      STRICTLY_TYPED_ARG(size)) {
     STRICT_ARG_TYPE(size_t);
-    return AdoptRef(new SharedBuffer(data, size));
+    return WTF::AdoptRef(new SharedBuffer(data, size));
   }
 
   static RefPtr<SharedBuffer> AdoptVector(Vector<char>&);
diff --git a/third_party/WebKit/Source/platform/TimerTest.cpp b/third_party/WebKit/Source/platform/TimerTest.cpp
index 7d5040e..707036e 100644
--- a/third_party/WebKit/Source/platform/TimerTest.cpp
+++ b/third_party/WebKit/Source/platform/TimerTest.cpp
@@ -81,7 +81,7 @@
  public:
   class Record final : public RefCounted<Record> {
    public:
-    static RefPtr<Record> Create() { return AdoptRef(new Record); }
+    static RefPtr<Record> Create() { return WTF::AdoptRef(new Record); }
 
     bool TimerHasFired() const { return timer_has_fired_; }
     bool IsDisposed() const { return is_disposed_; }
diff --git a/third_party/WebKit/Source/platform/WebTaskRunner.cpp b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
index 97dec61..d7b9464 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunner.cpp
+++ b/third_party/WebKit/Source/platform/WebTaskRunner.cpp
@@ -145,7 +145,7 @@
                                               WTF::Closure task) {
   DCHECK(RunsTasksInCurrentSequence());
   RefPtr<TaskHandle::Runner> runner =
-      AdoptRef(new TaskHandle::Runner(std::move(task)));
+      WTF::AdoptRef(new TaskHandle::Runner(std::move(task)));
   PostTask(location, WTF::Bind(&TaskHandle::Runner::Run, runner->AsWeakPtr(),
                                TaskHandle(runner)));
   return TaskHandle(runner);
@@ -157,7 +157,7 @@
     TimeDelta delay) {
   DCHECK(RunsTasksInCurrentSequence());
   RefPtr<TaskHandle::Runner> runner =
-      AdoptRef(new TaskHandle::Runner(std::move(task)));
+      WTF::AdoptRef(new TaskHandle::Runner(std::move(task)));
   PostDelayedTask(location,
                   WTF::Bind(&TaskHandle::Runner::Run, runner->AsWeakPtr(),
                             TaskHandle(runner)),
diff --git a/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp b/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp
index 9e4ed4c..9662994 100644
--- a/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp
+++ b/third_party/WebKit/Source/platform/WebTaskRunnerTest.cpp
@@ -39,7 +39,7 @@
 
 TEST(WebTaskRunnerTest, PostCancellableTaskTest) {
   RefPtr<scheduler::FakeWebTaskRunner> task_runner =
-      AdoptRef(new scheduler::FakeWebTaskRunner);
+      WTF::AdoptRef(new scheduler::FakeWebTaskRunner);
 
   // Run without cancellation.
   int count = 0;
@@ -120,7 +120,7 @@
 
 TEST(WebTaskRunnerTest, CancellationCheckerTest) {
   RefPtr<scheduler::FakeWebTaskRunner> task_runner =
-      AdoptRef(new scheduler::FakeWebTaskRunner);
+      WTF::AdoptRef(new scheduler::FakeWebTaskRunner);
 
   int count = 0;
   TaskHandle handle = task_runner->PostCancellableTask(
diff --git a/third_party/WebKit/Source/platform/animation/TimingFunction.cpp b/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
index 55a1fca..5d0d489e 100644
--- a/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
+++ b/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
@@ -24,17 +24,18 @@
 
 CubicBezierTimingFunction* CubicBezierTimingFunction::Preset(
     EaseType ease_type) {
-  DEFINE_STATIC_REF(CubicBezierTimingFunction, ease,
-                    (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE))));
+  DEFINE_STATIC_REF(
+      CubicBezierTimingFunction, ease,
+      (WTF::AdoptRef(new CubicBezierTimingFunction(EaseType::EASE))));
   DEFINE_STATIC_REF(
       CubicBezierTimingFunction, ease_in,
-      (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_IN))));
+      (WTF::AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_IN))));
   DEFINE_STATIC_REF(
       CubicBezierTimingFunction, ease_out,
-      (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_OUT))));
+      (WTF::AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_OUT))));
   DEFINE_STATIC_REF(
       CubicBezierTimingFunction, ease_in_out,
-      (AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_IN_OUT))));
+      (WTF::AdoptRef(new CubicBezierTimingFunction(EaseType::EASE_IN_OUT))));
 
   switch (ease_type) {
     case EaseType::EASE:
diff --git a/third_party/WebKit/Source/platform/animation/TimingFunction.h b/third_party/WebKit/Source/platform/animation/TimingFunction.h
index 67dde1d..deec28945 100644
--- a/third_party/WebKit/Source/platform/animation/TimingFunction.h
+++ b/third_party/WebKit/Source/platform/animation/TimingFunction.h
@@ -68,7 +68,7 @@
  public:
   static LinearTimingFunction* Shared() {
     DEFINE_STATIC_REF(LinearTimingFunction, linear,
-                      (AdoptRef(new LinearTimingFunction())));
+                      (WTF::AdoptRef(new LinearTimingFunction())));
     return linear;
   }
 
@@ -92,7 +92,7 @@
                                                   double y1,
                                                   double x2,
                                                   double y2) {
-    return AdoptRef(new CubicBezierTimingFunction(x1, y1, x2, y2));
+    return WTF::AdoptRef(new CubicBezierTimingFunction(x1, y1, x2, y2));
   }
 
   static CubicBezierTimingFunction* Preset(EaseType);
@@ -155,7 +155,7 @@
 
   static RefPtr<StepsTimingFunction> Create(int steps,
                                             StepPosition step_position) {
-    return AdoptRef(new StepsTimingFunction(steps, step_position));
+    return WTF::AdoptRef(new StepsTimingFunction(steps, step_position));
   }
 
   static StepsTimingFunction* Preset(StepPosition position) {
@@ -199,7 +199,7 @@
 class PLATFORM_EXPORT FramesTimingFunction final : public TimingFunction {
  public:
   static RefPtr<FramesTimingFunction> Create(int frames) {
-    return AdoptRef(new FramesTimingFunction(frames));
+    return WTF::AdoptRef(new FramesTimingFunction(frames));
   }
 
   ~FramesTimingFunction() override {}
diff --git a/third_party/WebKit/Source/platform/audio/AudioBus.cpp b/third_party/WebKit/Source/platform/audio/AudioBus.cpp
index 035eba7..50fe463 100644
--- a/third_party/WebKit/Source/platform/audio/AudioBus.cpp
+++ b/third_party/WebKit/Source/platform/audio/AudioBus.cpp
@@ -54,7 +54,7 @@
   if (number_of_channels > kMaxBusChannels)
     return nullptr;
 
-  return AdoptRef(new AudioBus(number_of_channels, length, allocate));
+  return WTF::AdoptRef(new AudioBus(number_of_channels, length, allocate));
 }
 
 AudioBus::AudioBus(unsigned number_of_channels, size_t length, bool allocate)
diff --git a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp
index 50fc99a..f70b774 100644
--- a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp
+++ b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp
@@ -63,9 +63,9 @@
     unsigned number_of_output_channels,
     const WebAudioLatencyHint& latency_hint,
     RefPtr<SecurityOrigin> security_origin) {
-  return AdoptRef(
-      new AudioDestination(callback, number_of_output_channels, latency_hint,
-                           std::move(security_origin)));
+  return WTF::AdoptRef(new AudioDestination(callback, number_of_output_channels,
+                                            latency_hint,
+                                            std::move(security_origin)));
 }
 
 AudioDestination::AudioDestination(AudioIOCallback& callback,
diff --git a/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp b/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp
index 1081f13..3721b43 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp
+++ b/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp
@@ -56,7 +56,7 @@
     return loader;
   }
 
-  loader = AdoptRef(new HRTFDatabaseLoader(sample_rate));
+  loader = WTF::AdoptRef(new HRTFDatabaseLoader(sample_rate));
   GetLoaderMap().insert(sample_rate, loader.Get());
   loader->LoadAsynchronously();
   return loader;
diff --git a/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp b/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp
index 5e9d015e..04fac35 100644
--- a/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp
+++ b/third_party/WebKit/Source/platform/bindings/DOMWrapperWorld.cpp
@@ -69,7 +69,7 @@
   int world_id = GenerateWorldIdForType(world_type);
   if (world_id == kInvalidWorldId)
     return nullptr;
-  return AdoptRef(new DOMWrapperWorld(isolate, world_type, world_id));
+  return WTF::AdoptRef(new DOMWrapperWorld(isolate, world_type, world_id));
 }
 
 DOMWrapperWorld::DOMWrapperWorld(v8::Isolate* isolate,
@@ -166,7 +166,8 @@
     return world;
   }
 
-  return AdoptRef(new DOMWrapperWorld(isolate, WorldType::kIsolated, world_id));
+  return WTF::AdoptRef(
+      new DOMWrapperWorld(isolate, WorldType::kIsolated, world_id));
 }
 
 typedef HashMap<int, RefPtr<SecurityOrigin>> IsolatedWorldSecurityOriginMap;
diff --git a/third_party/WebKit/Source/platform/bindings/ScriptState.cpp b/third_party/WebKit/Source/platform/bindings/ScriptState.cpp
index 0f8fa5e0..8d846ce 100644
--- a/third_party/WebKit/Source/platform/bindings/ScriptState.cpp
+++ b/third_party/WebKit/Source/platform/bindings/ScriptState.cpp
@@ -11,7 +11,7 @@
 RefPtr<ScriptState> ScriptState::Create(v8::Local<v8::Context> context,
                                         RefPtr<DOMWrapperWorld> world) {
   RefPtr<ScriptState> script_state =
-      AdoptRef(new ScriptState(context, std::move(world)));
+      WTF::AdoptRef(new ScriptState(context, std::move(world)));
   // This ref() is for keeping this ScriptState alive as long as the v8::Context
   // is alive.  This is deref()ed in the weak callback of the v8::Context.
   script_state->Ref();
diff --git a/third_party/WebKit/Source/platform/bindings/SharedPersistent.h b/third_party/WebKit/Source/platform/bindings/SharedPersistent.h
index acef5231..0c14681c 100644
--- a/third_party/WebKit/Source/platform/bindings/SharedPersistent.h
+++ b/third_party/WebKit/Source/platform/bindings/SharedPersistent.h
@@ -48,7 +48,7 @@
  public:
   static RefPtr<SharedPersistent<T>> Create(v8::Local<T> value,
                                             v8::Isolate* isolate) {
-    return AdoptRef(new SharedPersistent<T>(value, isolate));
+    return WTF::AdoptRef(new SharedPersistent<T>(value, isolate));
   }
 
   v8::Local<T> NewLocal(v8::Isolate* isolate) const {
diff --git a/third_party/WebKit/Source/platform/blob/BlobData.h b/third_party/WebKit/Source/platform/blob/BlobData.h
index a717a52d..7aa0f36d 100644
--- a/third_party/WebKit/Source/platform/blob/BlobData.h
+++ b/third_party/WebKit/Source/platform/blob/BlobData.h
@@ -47,7 +47,7 @@
 
 class PLATFORM_EXPORT RawData : public ThreadSafeRefCounted<RawData> {
  public:
-  static RefPtr<RawData> Create() { return AdoptRef(new RawData()); }
+  static RefPtr<RawData> Create() { return WTF::AdoptRef(new RawData()); }
 
   void DetachFromCurrentThread();
 
@@ -223,20 +223,20 @@
  public:
   // For empty blob construction.
   static RefPtr<BlobDataHandle> Create() {
-    return AdoptRef(new BlobDataHandle());
+    return WTF::AdoptRef(new BlobDataHandle());
   }
 
   // For initial creation.
   static RefPtr<BlobDataHandle> Create(std::unique_ptr<BlobData> data,
                                        long long size) {
-    return AdoptRef(new BlobDataHandle(std::move(data), size));
+    return WTF::AdoptRef(new BlobDataHandle(std::move(data), size));
   }
 
   // For deserialization of script values and ipc messages.
   static RefPtr<BlobDataHandle> Create(const String& uuid,
                                        const String& type,
                                        long long size) {
-    return AdoptRef(new BlobDataHandle(uuid, type, size));
+    return WTF::AdoptRef(new BlobDataHandle(uuid, type, size));
   }
 
   static RefPtr<BlobDataHandle> Create(
@@ -245,10 +245,10 @@
       long long size,
       storage::mojom::blink::BlobPtrInfo blob_info) {
     if (blob_info.is_valid()) {
-      return AdoptRef(
+      return WTF::AdoptRef(
           new BlobDataHandle(uuid, type, size, std::move(blob_info)));
     }
-    return AdoptRef(new BlobDataHandle(uuid, type, size));
+    return WTF::AdoptRef(new BlobDataHandle(uuid, type, size));
   }
 
   String Uuid() const { return uuid_.IsolatedCopy(); }
diff --git a/third_party/WebKit/Source/platform/exported/WebAudioBus.cpp b/third_party/WebKit/Source/platform/exported/WebAudioBus.cpp
index fe52a59..9e6484f 100644
--- a/third_party/WebKit/Source/platform/exported/WebAudioBus.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebAudioBus.cpp
@@ -85,7 +85,7 @@
 }
 
 RefPtr<AudioBus> WebAudioBus::Release() {
-  RefPtr<AudioBus> audio_bus(AdoptRef(static_cast<AudioBus*>(private_)));
+  RefPtr<AudioBus> audio_bus(WTF::AdoptRef(static_cast<AudioBus*>(private_)));
   private_ = 0;
   return audio_bus;
 }
diff --git a/third_party/WebKit/Source/platform/exported/WebContentSettingCallbacks.cpp b/third_party/WebKit/Source/platform/exported/WebContentSettingCallbacks.cpp
index c4de50e..3bf7d511 100644
--- a/third_party/WebKit/Source/platform/exported/WebContentSettingCallbacks.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebContentSettingCallbacks.cpp
@@ -15,7 +15,7 @@
  public:
   static RefPtr<WebContentSettingCallbacksPrivate> Create(
       std::unique_ptr<ContentSettingCallbacks> callbacks) {
-    return AdoptRef(
+    return WTF::AdoptRef(
         new WebContentSettingCallbacksPrivate(std::move(callbacks)));
   }
 
diff --git a/third_party/WebKit/Source/platform/exported/WebCryptoAlgorithm.cpp b/third_party/WebKit/Source/platform/exported/WebCryptoAlgorithm.cpp
index 5c50e4a..1cb4fa6 100644
--- a/third_party/WebKit/Source/platform/exported/WebCryptoAlgorithm.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebCryptoAlgorithm.cpp
@@ -325,7 +325,8 @@
 WebCryptoAlgorithm::WebCryptoAlgorithm(
     WebCryptoAlgorithmId id,
     std::unique_ptr<WebCryptoAlgorithmParams> params)
-    : private_(AdoptRef(new WebCryptoAlgorithmPrivate(id, std::move(params)))) {
+    : private_(
+          WTF::AdoptRef(new WebCryptoAlgorithmPrivate(id, std::move(params)))) {
 }
 
 WebCryptoAlgorithm WebCryptoAlgorithm::CreateNull() {
diff --git a/third_party/WebKit/Source/platform/exported/WebCryptoKey.cpp b/third_party/WebKit/Source/platform/exported/WebCryptoKey.cpp
index 4ecca33..a9b46c2 100644
--- a/third_party/WebKit/Source/platform/exported/WebCryptoKey.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebCryptoKey.cpp
@@ -67,7 +67,7 @@
                                   const WebCryptoKeyAlgorithm& algorithm,
                                   WebCryptoKeyUsageMask usages) {
   WebCryptoKey key;
-  key.private_ = AdoptRef(new WebCryptoKeyPrivate(
+  key.private_ = WTF::AdoptRef(new WebCryptoKeyPrivate(
       WTF::WrapUnique(handle), type, extractable, algorithm, usages));
   return key;
 }
diff --git a/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp b/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
index 570ac409..a788d0f 100644
--- a/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebCryptoKeyAlgorithm.cpp
@@ -56,8 +56,8 @@
 WebCryptoKeyAlgorithm::WebCryptoKeyAlgorithm(
     WebCryptoAlgorithmId id,
     std::unique_ptr<WebCryptoKeyAlgorithmParams> params)
-    : private_(
-          AdoptRef(new WebCryptoKeyAlgorithmPrivate(id, std::move(params)))) {}
+    : private_(WTF::AdoptRef(
+          new WebCryptoKeyAlgorithmPrivate(id, std::move(params)))) {}
 
 WebCryptoKeyAlgorithm WebCryptoKeyAlgorithm::AdoptParamsAndCreate(
     WebCryptoAlgorithmId id,
diff --git a/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp b/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp
index 823860faf..acc5ea1 100644
--- a/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebFileSystemCallbacks.cpp
@@ -49,7 +49,8 @@
  public:
   static RefPtr<WebFileSystemCallbacksPrivate> Create(
       std::unique_ptr<AsyncFileSystemCallbacks> callbacks) {
-    return AdoptRef(new WebFileSystemCallbacksPrivate(std::move(callbacks)));
+    return WTF::AdoptRef(
+        new WebFileSystemCallbacksPrivate(std::move(callbacks)));
   }
 
   AsyncFileSystemCallbacks* Callbacks() { return callbacks_.get(); }
diff --git a/third_party/WebKit/Source/platform/exported/WebHTTPLoadInfo.cpp b/third_party/WebKit/Source/platform/exported/WebHTTPLoadInfo.cpp
index fbc4477..317e010 100644
--- a/third_party/WebKit/Source/platform/exported/WebHTTPLoadInfo.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebHTTPLoadInfo.cpp
@@ -37,7 +37,7 @@
 namespace blink {
 
 void WebHTTPLoadInfo::Initialize() {
-  private_ = AdoptRef(new ResourceLoadInfo());
+  private_ = WTF::AdoptRef(new ResourceLoadInfo());
 }
 
 void WebHTTPLoadInfo::Reset() {
diff --git a/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp b/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
index d03e4c8..5160278 100644
--- a/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp
@@ -97,13 +97,13 @@
 RefPtr<WebMediaConstraintsPrivate> WebMediaConstraintsPrivate::Create() {
   WebMediaTrackConstraintSet basic;
   WebVector<WebMediaTrackConstraintSet> advanced;
-  return AdoptRef(new WebMediaConstraintsPrivate(basic, advanced));
+  return WTF::AdoptRef(new WebMediaConstraintsPrivate(basic, advanced));
 }
 
 RefPtr<WebMediaConstraintsPrivate> WebMediaConstraintsPrivate::Create(
     const WebMediaTrackConstraintSet& basic,
     const WebVector<WebMediaTrackConstraintSet>& advanced) {
-  return AdoptRef(new WebMediaConstraintsPrivate(basic, advanced));
+  return WTF::AdoptRef(new WebMediaConstraintsPrivate(basic, advanced));
 }
 
 WebMediaConstraintsPrivate::WebMediaConstraintsPrivate(
diff --git a/third_party/WebKit/Source/platform/exported/WebMediaDeviceInfo.cpp b/third_party/WebKit/Source/platform/exported/WebMediaDeviceInfo.cpp
index 8157640..f1507150 100644
--- a/third_party/WebKit/Source/platform/exported/WebMediaDeviceInfo.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebMediaDeviceInfo.cpp
@@ -62,7 +62,7 @@
     WebMediaDeviceInfo::MediaDeviceKind kind,
     const WebString& label,
     const WebString& group_id) {
-  return AdoptRef(
+  return WTF::AdoptRef(
       new WebMediaDeviceInfoPrivate(device_id, kind, label, group_id));
 }
 
diff --git a/third_party/WebKit/Source/platform/exported/WebPrerender.cpp b/third_party/WebKit/Source/platform/exported/WebPrerender.cpp
index 61848bc..b84c506 100644
--- a/third_party/WebKit/Source/platform/exported/WebPrerender.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebPrerender.cpp
@@ -43,7 +43,7 @@
  public:
   static RefPtr<PrerenderExtraDataContainer> Create(
       WebPrerender::ExtraData* extra_data) {
-    return AdoptRef(new PrerenderExtraDataContainer(extra_data));
+    return WTF::AdoptRef(new PrerenderExtraDataContainer(extra_data));
   }
 
   ~PrerenderExtraDataContainer() override {}
diff --git a/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp b/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
index e2a66d6..fba3942 100644
--- a/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebRTCICECandidate.cpp
@@ -43,7 +43,7 @@
       const WebString& candidate,
       const WebString& sdp_mid,
       unsigned short sdp_m_line_index) {
-    return AdoptRef(
+    return WTF::AdoptRef(
         new WebRTCICECandidatePrivate(candidate, sdp_mid, sdp_m_line_index));
   }
 
diff --git a/third_party/WebKit/Source/platform/exported/WebRTCSessionDescription.cpp b/third_party/WebKit/Source/platform/exported/WebRTCSessionDescription.cpp
index 968cfbf2..7fcd7f9b 100644
--- a/third_party/WebKit/Source/platform/exported/WebRTCSessionDescription.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebRTCSessionDescription.cpp
@@ -58,7 +58,7 @@
 RefPtr<WebRTCSessionDescriptionPrivate> WebRTCSessionDescriptionPrivate::Create(
     const WebString& type,
     const WebString& sdp) {
-  return AdoptRef(new WebRTCSessionDescriptionPrivate(type, sdp));
+  return WTF::AdoptRef(new WebRTCSessionDescriptionPrivate(type, sdp));
 }
 
 WebRTCSessionDescriptionPrivate::WebRTCSessionDescriptionPrivate(
diff --git a/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp b/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
index 83759ee..31780c6 100644
--- a/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebServiceWorkerRequest.cpp
@@ -44,7 +44,7 @@
 };
 
 WebServiceWorkerRequest::WebServiceWorkerRequest()
-    : private_(AdoptRef(new WebServiceWorkerRequestPrivate)) {}
+    : private_(WTF::AdoptRef(new WebServiceWorkerRequestPrivate)) {}
 
 void WebServiceWorkerRequest::Reset() {
   private_.Reset();
diff --git a/third_party/WebKit/Source/platform/exported/WebServiceWorkerResponse.cpp b/third_party/WebKit/Source/platform/exported/WebServiceWorkerResponse.cpp
index 8df3740e..a95d9dc 100644
--- a/third_party/WebKit/Source/platform/exported/WebServiceWorkerResponse.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebServiceWorkerResponse.cpp
@@ -33,7 +33,7 @@
 };
 
 WebServiceWorkerResponse::WebServiceWorkerResponse()
-    : private_(AdoptRef(new WebServiceWorkerResponsePrivate)) {}
+    : private_(WTF::AdoptRef(new WebServiceWorkerResponsePrivate)) {}
 
 void WebServiceWorkerResponse::Reset() {
   private_.Reset();
diff --git a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
index b2fcc0df..a17e498 100644
--- a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
@@ -49,7 +49,7 @@
  public:
   static RefPtr<URLRequestExtraDataContainer> Create(
       WebURLRequest::ExtraData* extra_data) {
-    return AdoptRef(new URLRequestExtraDataContainer(extra_data));
+    return WTF::AdoptRef(new URLRequestExtraDataContainer(extra_data));
   }
 
   ~URLRequestExtraDataContainer() override {}
diff --git a/third_party/WebKit/Source/platform/exported/WebURLResponse.cpp b/third_party/WebKit/Source/platform/exported/WebURLResponse.cpp
index cd048edb..ee21ca9 100644
--- a/third_party/WebKit/Source/platform/exported/WebURLResponse.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebURLResponse.cpp
@@ -51,7 +51,7 @@
  public:
   static RefPtr<URLResponseExtraDataContainer> Create(
       WebURLResponse::ExtraData* extra_data) {
-    return AdoptRef(new URLResponseExtraDataContainer(extra_data));
+    return WTF::AdoptRef(new URLResponseExtraDataContainer(extra_data));
   }
 
   ~URLResponseExtraDataContainer() override {}
diff --git a/third_party/WebKit/Source/platform/fonts/CustomFontData.h b/third_party/WebKit/Source/platform/fonts/CustomFontData.h
index 44a3bd3..20c8b9c 100644
--- a/third_party/WebKit/Source/platform/fonts/CustomFontData.h
+++ b/third_party/WebKit/Source/platform/fonts/CustomFontData.h
@@ -30,7 +30,7 @@
 class PLATFORM_EXPORT CustomFontData : public RefCounted<CustomFontData> {
  public:
   static RefPtr<CustomFontData> Create() {
-    return AdoptRef(new CustomFontData());
+    return WTF::AdoptRef(new CustomFontData());
   }
 
   virtual ~CustomFontData() {}
diff --git a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
index 3ccee3d..d13aa576 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
@@ -154,7 +154,7 @@
     ots_parse_message = decoder.GetErrorString();
     return nullptr;
   }
-  return AdoptRef(
+  return WTF::AdoptRef(
       new FontCustomPlatformData(std::move(typeface), decoder.DecodedSize()));
 }
 
diff --git a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp
index f2a6f0bb..2f647dc 100644
--- a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp
@@ -17,7 +17,7 @@
     const FontDescription& description,
     RefPtr<FontFallbackList> fallback_list,
     FontFallbackPriority font_fallback_priority) {
-  return AdoptRef(new FontFallbackIterator(
+  return WTF::AdoptRef(new FontFallbackIterator(
       description, std::move(fallback_list), font_fallback_priority));
 }
 
@@ -85,14 +85,14 @@
 RefPtr<FontDataForRangeSet> FontFallbackIterator::Next(
     const Vector<UChar32>& hint_list) {
   if (fallback_stage_ == kOutOfLuck)
-    return AdoptRef(new FontDataForRangeSet());
+    return WTF::AdoptRef(new FontDataForRangeSet());
 
   if (fallback_stage_ == kFallbackPriorityFonts) {
     // Only try one fallback priority font,
     // then proceed to regular system fallback.
     fallback_stage_ = kSystemFonts;
-    RefPtr<FontDataForRangeSet> fallback_priority_font_range =
-        AdoptRef(new FontDataForRangeSet(FallbackPriorityFont(hint_list[0])));
+    RefPtr<FontDataForRangeSet> fallback_priority_font_range = WTF::AdoptRef(
+        new FontDataForRangeSet(FallbackPriorityFont(hint_list[0])));
     if (fallback_priority_font_range->HasFontData())
       return UniqueOrNext(std::move(fallback_priority_font_range), hint_list);
     return Next(hint_list);
@@ -103,7 +103,7 @@
     RefPtr<SimpleFontData> system_font = UniqueSystemFontForHintList(hint_list);
     if (system_font) {
       // Fallback fonts are not retained in the FontDataCache.
-      return UniqueOrNext(AdoptRef(new FontDataForRangeSet(system_font)),
+      return UniqueOrNext(WTF::AdoptRef(new FontDataForRangeSet(system_font)),
                           hint_list);
     }
 
@@ -120,7 +120,7 @@
       FontCache::CrashWithFontInfo(&font_description_);
     // Don't skip the LastResort font in uniqueOrNext() since HarfBuzzShaper
     // needs to use this one to place missing glyph boxes.
-    return AdoptRef(new FontDataForRangeSetFromCache(last_resort));
+    return WTF::AdoptRef(new FontDataForRangeSetFromCache(last_resort));
   }
 
   DCHECK(fallback_stage_ == kFontGroupFonts ||
@@ -149,7 +149,7 @@
       // The fontData object that we have here is tracked in m_fontList of
       // FontFallbackList and gets released in the font cache when the
       // FontFallbackList is destroyed.
-      return UniqueOrNext(AdoptRef(new FontDataForRangeSet(non_segmented)),
+      return UniqueOrNext(WTF::AdoptRef(new FontDataForRangeSet(non_segmented)),
                           hint_list);
     }
     return Next(hint_list);
diff --git a/third_party/WebKit/Source/platform/fonts/FontFallbackList.h b/third_party/WebKit/Source/platform/fonts/FontFallbackList.h
index e067110..b42f8d5a 100644
--- a/third_party/WebKit/Source/platform/fonts/FontFallbackList.h
+++ b/third_party/WebKit/Source/platform/fonts/FontFallbackList.h
@@ -42,7 +42,7 @@
 
  public:
   static RefPtr<FontFallbackList> Create() {
-    return AdoptRef(new FontFallbackList());
+    return WTF::AdoptRef(new FontFallbackList());
   }
 
   ~FontFallbackList() { ReleaseFontData(); }
diff --git a/third_party/WebKit/Source/platform/fonts/FontFamily.h b/third_party/WebKit/Source/platform/fonts/FontFamily.h
index 98691f7c..e41c3d22 100644
--- a/third_party/WebKit/Source/platform/fonts/FontFamily.h
+++ b/third_party/WebKit/Source/platform/fonts/FontFamily.h
@@ -63,7 +63,7 @@
 
  public:
   static RefPtr<SharedFontFamily> Create() {
-    return AdoptRef(new SharedFontFamily);
+    return WTF::AdoptRef(new SharedFontFamily);
   }
 
  private:
diff --git a/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h b/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h
index 9e447ccd..d04c83e5 100644
--- a/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h
+++ b/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h
@@ -37,7 +37,7 @@
 class PLATFORM_EXPORT SegmentedFontData : public FontData {
  public:
   static RefPtr<SegmentedFontData> Create() {
-    return AdoptRef(new SegmentedFontData);
+    return WTF::AdoptRef(new SegmentedFontData);
   }
 
   void AppendFace(RefPtr<FontDataForRangeSet> font_data_for_range_set) {
diff --git a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
index bdfd049..4ad38f88 100644
--- a/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
+++ b/third_party/WebKit/Source/platform/fonts/SimpleFontData.h
@@ -74,9 +74,9 @@
       RefPtr<CustomFontData> custom_data = nullptr,
       bool is_text_orientation_fallback = false,
       bool subpixel_ascent_descent = false) {
-    return AdoptRef(new SimpleFontData(platform_data, std::move(custom_data),
-                                       is_text_orientation_fallback,
-                                       subpixel_ascent_descent));
+    return WTF::AdoptRef(new SimpleFontData(
+        platform_data, std::move(custom_data), is_text_orientation_fallback,
+        subpixel_ascent_descent));
   }
 
   const FontPlatformData& PlatformData() const { return platform_data_; }
diff --git a/third_party/WebKit/Source/platform/fonts/UnicodeRangeSetTest.cpp b/third_party/WebKit/Source/platform/fonts/UnicodeRangeSetTest.cpp
index 8d2ed5f..9b48a63 100644
--- a/third_party/WebKit/Source/platform/fonts/UnicodeRangeSetTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/UnicodeRangeSetTest.cpp
@@ -12,7 +12,7 @@
 
 TEST(UnicodeRangeSet, Empty) {
   Vector<UnicodeRange> ranges;
-  RefPtr<UnicodeRangeSet> set = AdoptRef(new UnicodeRangeSet(ranges));
+  RefPtr<UnicodeRangeSet> set = WTF::AdoptRef(new UnicodeRangeSet(ranges));
   EXPECT_TRUE(set->IsEntireRange());
   EXPECT_EQ(0u, set->size());
   EXPECT_FALSE(set->IntersectsWith(String()));
@@ -23,7 +23,7 @@
 TEST(UnicodeRangeSet, SingleCharacter) {
   Vector<UnicodeRange> ranges;
   ranges.push_back(UnicodeRange('b', 'b'));
-  RefPtr<UnicodeRangeSet> set = AdoptRef(new UnicodeRangeSet(ranges));
+  RefPtr<UnicodeRangeSet> set = WTF::AdoptRef(new UnicodeRangeSet(ranges));
   EXPECT_FALSE(set->IsEntireRange());
   EXPECT_FALSE(set->IntersectsWith(String()));
   EXPECT_FALSE(set->IntersectsWith(String("a")));
@@ -40,7 +40,7 @@
   Vector<UnicodeRange> ranges;
   ranges.push_back(UnicodeRange('6', '7'));
   ranges.push_back(UnicodeRange('2', '4'));
-  RefPtr<UnicodeRangeSet> set = AdoptRef(new UnicodeRangeSet(ranges));
+  RefPtr<UnicodeRangeSet> set = WTF::AdoptRef(new UnicodeRangeSet(ranges));
   EXPECT_FALSE(set->IsEntireRange());
   EXPECT_FALSE(set->IntersectsWith(String()));
   EXPECT_FALSE(set->IntersectsWith(String("1")));
@@ -64,7 +64,7 @@
   ranges.push_back(UnicodeRange('1', '1'));
   ranges.push_back(UnicodeRange('3', '5'));
   ranges.push_back(UnicodeRange('4', '6'));
-  RefPtr<UnicodeRangeSet> set = AdoptRef(new UnicodeRangeSet(ranges));
+  RefPtr<UnicodeRangeSet> set = WTF::AdoptRef(new UnicodeRangeSet(ranges));
   ASSERT_EQ(1u, set->size());
   EXPECT_EQ('0', set->RangeAt(0).From());
   EXPECT_EQ('6', set->RangeAt(0).To());
@@ -73,7 +73,7 @@
 TEST(UnicodeRangeSet, Non8Bit) {
   Vector<UnicodeRange> ranges;
   ranges.push_back(UnicodeRange(0x3042, 0x3042));
-  RefPtr<UnicodeRangeSet> set = AdoptRef(new UnicodeRangeSet(ranges));
+  RefPtr<UnicodeRangeSet> set = WTF::AdoptRef(new UnicodeRangeSet(ranges));
   ASSERT_EQ(1u, set->size());
   EXPECT_EQ(0x3042, set->RangeAt(0).From());
   EXPECT_EQ(0x3042, set->RangeAt(0).To());
diff --git a/third_party/WebKit/Source/platform/fonts/opentype/FontSettings.h b/third_party/WebKit/Source/platform/fonts/opentype/FontSettings.h
index ce9601e..ebb80713 100644
--- a/third_party/WebKit/Source/platform/fonts/opentype/FontSettings.h
+++ b/third_party/WebKit/Source/platform/fonts/opentype/FontSettings.h
@@ -65,7 +65,7 @@
 
  public:
   static RefPtr<FontFeatureSettings> Create() {
-    return AdoptRef(new FontFeatureSettings());
+    return WTF::AdoptRef(new FontFeatureSettings());
   }
 
  private:
@@ -79,7 +79,7 @@
 
  public:
   static RefPtr<FontVariationSettings> Create() {
-    return AdoptRef(new FontVariationSettings());
+    return WTF::AdoptRef(new FontVariationSettings());
   }
 
   unsigned GetHash() const;
diff --git a/third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.h b/third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.h
index 7fa1dfb1..4f8a400 100644
--- a/third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.h
+++ b/third_party/WebKit/Source/platform/fonts/opentype/OpenTypeVerticalData.h
@@ -43,7 +43,7 @@
  public:
   static RefPtr<OpenTypeVerticalData> Create(
       const FontPlatformData& platform_data) {
-    return AdoptRef(new OpenTypeVerticalData(platform_data));
+    return WTF::AdoptRef(new OpenTypeVerticalData(platform_data));
   }
 
   bool IsOpenType() const { return !advance_widths_.IsEmpty(); }
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
index fd8d0da..9fcef2b 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.h
@@ -52,7 +52,7 @@
  public:
   static RefPtr<HarfBuzzFace> Create(FontPlatformData* platform_data,
                                      uint64_t unique_id) {
-    return AdoptRef(new HarfBuzzFace(platform_data, unique_id));
+    return WTF::AdoptRef(new HarfBuzzFace(platform_data, unique_id));
   }
   ~HarfBuzzFace();
 
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFontCache.h b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFontCache.h
index bb19c228..22de9e0 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFontCache.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFontCache.h
@@ -66,7 +66,7 @@
  public:
   static RefPtr<HbFontCacheEntry> Create(hb_font_t* hb_font) {
     DCHECK(hb_font);
-    return AdoptRef(new HbFontCacheEntry(hb_font));
+    return WTF::AdoptRef(new HbFontCacheEntry(hb_font));
   }
 
   hb_font_t* HbFont() { return hb_font_.get(); }
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
index 642b509..2f657d44 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
@@ -56,7 +56,7 @@
   static RefPtr<ShapeResult> Create(const Font* font,
                                     unsigned num_characters,
                                     TextDirection direction) {
-    return AdoptRef(new ShapeResult(font, num_characters, direction));
+    return WTF::AdoptRef(new ShapeResult(font, num_characters, direction));
   }
   static RefPtr<ShapeResult> CreateForTabulationCharacters(
       const Font*,
@@ -121,7 +121,7 @@
   ShapeResult(const ShapeResult&);
 
   static RefPtr<ShapeResult> Create(const ShapeResult& other) {
-    return AdoptRef(new ShapeResult(other));
+    return WTF::AdoptRef(new ShapeResult(other));
   }
 
   template <typename TextContainerType>
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizerTest.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizerTest.cpp
index 4bd24db5b..41de0cfa 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizerTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizerTest.cpp
@@ -28,7 +28,7 @@
                        : FontOrientation::kHorizontal);
     RefPtr<OpenTypeVerticalData> vertical_data(
         force_rotation ? OpenTypeVerticalData::Create(platform_data) : nullptr);
-    return AdoptRef(
+    return WTF::AdoptRef(
         new TestSimpleFontData(platform_data, std::move(vertical_data)));
   }
 
diff --git a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
index f24af09..beffe32 100644
--- a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
@@ -28,7 +28,7 @@
     sk_sp<SkImage> image,
     WeakPtr<WebGraphicsContext3DProviderWrapper>&& context_provider_wrapper) {
   DCHECK(image->isTextureBacked());
-  return AdoptRef(new AcceleratedStaticBitmapImage(
+  return WTF::AdoptRef(new AcceleratedStaticBitmapImage(
       std::move(image), std::move(context_provider_wrapper)));
 }
 
@@ -39,7 +39,7 @@
     unsigned texture_id,
     WeakPtr<WebGraphicsContext3DProviderWrapper>&& context_provider_wrapper,
     IntSize mailbox_size) {
-  return AdoptRef(new AcceleratedStaticBitmapImage(
+  return WTF::AdoptRef(new AcceleratedStaticBitmapImage(
       mailbox, sync_token, texture_id, std::move(context_provider_wrapper),
       mailbox_size));
 }
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
index 74e7e8a..6aec98a2 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
@@ -54,7 +54,7 @@
  public:
   static RefPtr<BitmapImage> Create(ImageObserver* observer = 0,
                                     bool is_multipart = false) {
-    return AdoptRef(new BitmapImage(observer, is_multipart));
+    return WTF::AdoptRef(new BitmapImage(observer, is_multipart));
   }
 
   ~BitmapImage() override;
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index 395eb12..b1ef3f2b 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -401,7 +401,7 @@
 
   ResetSkiaTextureBinding(context_provider_wrapper_);
 
-  return AdoptRef(new Canvas2DLayerBridge::ImageInfo(
+  return WTF::AdoptRef(new Canvas2DLayerBridge::ImageInfo(
       std::move(gpu_memory_buffer), image_id, texture_id));
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/ColorSpaceGamut.cpp b/third_party/WebKit/Source/platform/graphics/ColorSpaceGamut.cpp
index d83dabf..bf6386d9 100644
--- a/third_party/WebKit/Source/platform/graphics/ColorSpaceGamut.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ColorSpaceGamut.cpp
@@ -15,9 +15,10 @@
   const gfx::ColorSpace& color_space = screen_info.color_space;
   if (!color_space.IsValid())
     return ColorSpaceGamut::kUnknown;
-
+  // Return the gamut of the color space used for raster (this will return a
+  // wide gamut for HDR profiles).
   return ColorSpaceUtilities::GetColorSpaceGamut(
-      color_space.ToSkColorSpace().get());
+      color_space.GetRasterColorSpace().ToSkColorSpace().get());
 }
 
 ColorSpaceGamut GetColorSpaceGamut(SkColorSpace* color_space) {
diff --git a/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.h b/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.h
index 8534fd3..a07abe4f 100644
--- a/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.h
+++ b/third_party/WebKit/Source/platform/graphics/CrossfadeGeneratedImage.h
@@ -41,9 +41,9 @@
                                                 float percentage,
                                                 IntSize crossfade_size,
                                                 const IntSize& size) {
-    return AdoptRef(new CrossfadeGeneratedImage(std::move(from_image),
-                                                std::move(to_image), percentage,
-                                                crossfade_size, size));
+    return WTF::AdoptRef(
+        new CrossfadeGeneratedImage(std::move(from_image), std::move(to_image),
+                                    percentage, crossfade_size, size));
   }
 
   bool UsesContainerSize() const override { return false; }
diff --git a/third_party/WebKit/Source/platform/graphics/Gradient.cpp b/third_party/WebKit/Source/platform/graphics/Gradient.cpp
index 17533c9..e579565 100644
--- a/third_party/WebKit/Source/platform/graphics/Gradient.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Gradient.cpp
@@ -308,7 +308,8 @@
                                         const FloatPoint& p1,
                                         GradientSpreadMethod spread_method,
                                         ColorInterpolation interpolation) {
-  return AdoptRef(new LinearGradient(p0, p1, spread_method, interpolation));
+  return WTF::AdoptRef(
+      new LinearGradient(p0, p1, spread_method, interpolation));
 }
 
 RefPtr<Gradient> Gradient::CreateRadial(const FloatPoint& p0,
@@ -318,8 +319,8 @@
                                         float aspect_ratio,
                                         GradientSpreadMethod spread_method,
                                         ColorInterpolation interpolation) {
-  return AdoptRef(new RadialGradient(p0, r0, p1, r1, aspect_ratio,
-                                     spread_method, interpolation));
+  return WTF::AdoptRef(new RadialGradient(p0, r0, p1, r1, aspect_ratio,
+                                          spread_method, interpolation));
 }
 
 RefPtr<Gradient> Gradient::CreateConic(const FloatPoint& position,
@@ -328,8 +329,9 @@
                                        float end_angle,
                                        GradientSpreadMethod spread_method,
                                        ColorInterpolation interpolation) {
-  return AdoptRef(new ConicGradient(position, rotation, start_angle, end_angle,
-                                    spread_method, interpolation));
+  return WTF::AdoptRef(new ConicGradient(position, rotation, start_angle,
+                                         end_angle, spread_method,
+                                         interpolation));
 }
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.h b/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.h
index 721017e6..9ca20a2d2 100644
--- a/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.h
+++ b/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.h
@@ -38,7 +38,8 @@
  public:
   static RefPtr<GradientGeneratedImage> Create(RefPtr<Gradient> generator,
                                                const IntSize& size) {
-    return AdoptRef(new GradientGeneratedImage(std::move(generator), size));
+    return WTF::AdoptRef(
+        new GradientGeneratedImage(std::move(generator), size));
   }
 
   ~GradientGeneratedImage() override {}
diff --git a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
index 3a09ff45..1a7ed09 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
+++ b/third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h
@@ -67,7 +67,7 @@
       bool is_multi_frame,
       const ColorBehavior& color_behavior,
       std::vector<SkISize> supported_sizes) {
-    return AdoptRef(new ImageFrameGenerator(
+    return WTF::AdoptRef(new ImageFrameGenerator(
         full_size, is_multi_frame, color_behavior, std::move(supported_sizes)));
   }
 
diff --git a/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp b/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
index d5897e8..dd98d851 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageLayerChromiumTest.cpp
@@ -41,7 +41,7 @@
 class TestImage : public Image {
  public:
   static RefPtr<TestImage> Create(const IntSize& size, bool opaque) {
-    return AdoptRef(new TestImage(size, opaque));
+    return WTF::AdoptRef(new TestImage(size, opaque));
   }
 
   bool CurrentFrameKnownToBeOpaque(
diff --git a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
index fb372bc..f9b2ab2f 100644
--- a/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImagePattern.cpp
@@ -15,7 +15,7 @@
 
 RefPtr<ImagePattern> ImagePattern::Create(RefPtr<Image> image,
                                           RepeatMode repeat_mode) {
-  return AdoptRef(new ImagePattern(std::move(image), repeat_mode));
+  return WTF::AdoptRef(new ImagePattern(std::move(image), repeat_mode));
 }
 
 ImagePattern::ImagePattern(RefPtr<Image> image, RepeatMode repeat_mode)
diff --git a/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h b/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
index 7adafebc..0735cdd 100644
--- a/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
+++ b/third_party/WebKit/Source/platform/graphics/PaintGeneratedImage.h
@@ -16,7 +16,7 @@
  public:
   static RefPtr<PaintGeneratedImage> Create(sk_sp<PaintRecord> record,
                                             const IntSize& size) {
-    return AdoptRef(new PaintGeneratedImage(std::move(record), size));
+    return WTF::AdoptRef(new PaintGeneratedImage(std::move(record), size));
   }
   ~PaintGeneratedImage() override {}
 
diff --git a/third_party/WebKit/Source/platform/graphics/PaintRecordPattern.cpp b/third_party/WebKit/Source/platform/graphics/PaintRecordPattern.cpp
index 0a15207..8c00a2c 100644
--- a/third_party/WebKit/Source/platform/graphics/PaintRecordPattern.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PaintRecordPattern.cpp
@@ -15,7 +15,7 @@
     sk_sp<PaintRecord> record,
     const FloatRect& record_bounds,
     RepeatMode repeat_mode) {
-  return AdoptRef(
+  return WTF::AdoptRef(
       new PaintRecordPattern(std::move(record), record_bounds, repeat_mode));
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
index 3386f142..957bb0f5 100644
--- a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
@@ -99,7 +99,7 @@
     pictures.push_back(std::move(picture));
   }
   if (tiles.size() == 1)
-    return AdoptRef(new PictureSnapshot(std::move(pictures[0])));
+    return WTF::AdoptRef(new PictureSnapshot(std::move(pictures[0])));
   SkPictureRecorder recorder;
   SkCanvas* canvas =
       recorder.beginRecording(union_rect.Width(), union_rect.Height(), 0, 0);
@@ -110,7 +110,8 @@
     pictures[i]->playback(canvas, 0);
     canvas->restore();
   }
-  return AdoptRef(new PictureSnapshot(recorder.finishRecordingAsPicture()));
+  return WTF::AdoptRef(
+      new PictureSnapshot(recorder.finishRecordingAsPicture()));
 }
 
 bool PictureSnapshot::IsEmpty() const {
diff --git a/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h b/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h
index e22943d..470a098 100644
--- a/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h
+++ b/third_party/WebKit/Source/platform/graphics/PlaceholderImage.h
@@ -26,7 +26,7 @@
  public:
   static RefPtr<PlaceholderImage> Create(ImageObserver* observer,
                                          const IntSize& size) {
-    return AdoptRef(new PlaceholderImage(observer, size));
+    return WTF::AdoptRef(new PlaceholderImage(observer, size));
   }
 
   ~PlaceholderImage() override;
diff --git a/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp
index 07f02020..ec37c82 100644
--- a/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/UnacceleratedStaticBitmapImage.cpp
@@ -11,7 +11,7 @@
 RefPtr<UnacceleratedStaticBitmapImage> UnacceleratedStaticBitmapImage::Create(
     sk_sp<SkImage> image) {
   DCHECK(!image->isTextureBacked());
-  return AdoptRef(new UnacceleratedStaticBitmapImage(std::move(image)));
+  return WTF::AdoptRef(new UnacceleratedStaticBitmapImage(std::move(image)));
 }
 
 UnacceleratedStaticBitmapImage::UnacceleratedStaticBitmapImage(
@@ -26,7 +26,7 @@
 
 RefPtr<UnacceleratedStaticBitmapImage> UnacceleratedStaticBitmapImage::Create(
     PaintImage image) {
-  return AdoptRef(new UnacceleratedStaticBitmapImage(std::move(image)));
+  return WTF::AdoptRef(new UnacceleratedStaticBitmapImage(std::move(image)));
 }
 
 UnacceleratedStaticBitmapImage::UnacceleratedStaticBitmapImage(PaintImage image)
diff --git a/third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.h b/third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.h
index 0dade92..94cb482 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.h
+++ b/third_party/WebKit/Source/platform/graphics/filters/DistantLightSource.h
@@ -30,7 +30,7 @@
 class PLATFORM_EXPORT DistantLightSource final : public LightSource {
  public:
   static RefPtr<DistantLightSource> Create(float azimuth, float elevation) {
-    return AdoptRef(new DistantLightSource(azimuth, elevation));
+    return WTF::AdoptRef(new DistantLightSource(azimuth, elevation));
   }
 
   float Azimuth() const { return azimuth_; }
diff --git a/third_party/WebKit/Source/platform/graphics/filters/PointLightSource.h b/third_party/WebKit/Source/platform/graphics/filters/PointLightSource.h
index aaab4bd..ea70a6a2 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/PointLightSource.h
+++ b/third_party/WebKit/Source/platform/graphics/filters/PointLightSource.h
@@ -30,7 +30,7 @@
 class PLATFORM_EXPORT PointLightSource final : public LightSource {
  public:
   static RefPtr<PointLightSource> Create(const FloatPoint3D& position) {
-    return AdoptRef(new PointLightSource(position));
+    return WTF::AdoptRef(new PointLightSource(position));
   }
 
   const FloatPoint3D& GetPosition() const { return position_; }
diff --git a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h
index 8229aaeb..e1b0fdba 100644
--- a/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h
+++ b/third_party/WebKit/Source/platform/graphics/filters/SpotLightSource.h
@@ -34,8 +34,8 @@
                                         const FloatPoint3D& direction,
                                         float specular_exponent,
                                         float limiting_cone_angle) {
-    return AdoptRef(new SpotLightSource(position, direction, specular_exponent,
-                                        limiting_cone_angle));
+    return WTF::AdoptRef(new SpotLightSource(
+        position, direction, specular_exponent, limiting_cone_angle));
   }
 
   const FloatPoint3D& GetPosition() const { return position_; }
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index b44bc82..bfbf1194 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -125,7 +125,7 @@
   if (discard_framebuffer_supported)
     extensions_util->EnsureExtensionEnabled("GL_EXT_discard_framebuffer");
 
-  RefPtr<DrawingBuffer> drawing_buffer = AdoptRef(new DrawingBuffer(
+  RefPtr<DrawingBuffer> drawing_buffer = WTF::AdoptRef(new DrawingBuffer(
       std::move(context_provider), std::move(extensions_util), client,
       discard_framebuffer_supported, want_alpha_channel, premultiplied_alpha,
       preserve, webgl_version, want_depth_buffer, want_stencil_buffer,
@@ -1256,8 +1256,8 @@
     gl_->DeleteFramebuffers(1, &fbo);
   }
 
-  return AdoptRef(new ColorBuffer(this, parameters, size, texture_id, image_id,
-                                  std::move(gpu_memory_buffer)));
+  return WTF::AdoptRef(new ColorBuffer(this, parameters, size, texture_id,
+                                       image_id, std::move(gpu_memory_buffer)));
 }
 
 void DrawingBuffer::AttachColorBufferToReadFramebuffer() {
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h
index 83c2af84..03b41f56 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTestHelpers.h
@@ -396,9 +396,9 @@
     std::unique_ptr<Extensions3DUtil> extensions_util =
         Extensions3DUtil::Create(context_provider->ContextGL());
     RefPtr<DrawingBufferForTests> drawing_buffer =
-        AdoptRef(new DrawingBufferForTests(std::move(context_provider),
-                                           std::move(extensions_util), client,
-                                           preserve));
+        WTF::AdoptRef(new DrawingBufferForTests(std::move(context_provider),
+                                                std::move(extensions_util),
+                                                client, preserve));
     if (!drawing_buffer->Initialize(
             size, use_multisampling != kDisableMultisampling)) {
       drawing_buffer->BeginDestruction();
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
index f9099837..a0ccce4 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/ClipPaintPropertyNode.h
@@ -36,7 +36,7 @@
       RefPtr<const TransformPaintPropertyNode> local_transform_space,
       const FloatRoundedRect& clip_rect,
       CompositingReasons direct_compositing_reasons = kCompositingReasonNone) {
-    return AdoptRef(new ClipPaintPropertyNode(
+    return WTF::AdoptRef(new ClipPaintPropertyNode(
         std::move(parent), std::move(local_transform_space), clip_rect,
         direct_compositing_reasons));
   }
@@ -65,9 +65,9 @@
   // The clone function is used by FindPropertiesNeedingUpdate.h for recording
   // a clip node before it has been updated, to later detect changes.
   RefPtr<ClipPaintPropertyNode> Clone() const {
-    return AdoptRef(new ClipPaintPropertyNode(Parent(), local_transform_space_,
-                                              clip_rect_,
-                                              direct_compositing_reasons_));
+    return WTF::AdoptRef(
+        new ClipPaintPropertyNode(Parent(), local_transform_space_, clip_rect_,
+                                  direct_compositing_reasons_));
   }
 
   // The equality operator is used by FindPropertiesNeedingUpdate.h for checking
diff --git a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
index 43af50f..8f8a0cf 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/EffectPaintPropertyNode.h
@@ -41,7 +41,7 @@
       CompositingReasons direct_compositing_reasons = kCompositingReasonNone,
       const CompositorElementId& compositor_element_id = CompositorElementId(),
       const FloatPoint& paint_offset = FloatPoint()) {
-    return AdoptRef(new EffectPaintPropertyNode(
+    return WTF::AdoptRef(new EffectPaintPropertyNode(
         std::move(parent), std::move(local_transform_space),
         std::move(output_clip), color_filter, std::move(filter), opacity,
         blend_mode, direct_compositing_reasons, compositor_element_id,
@@ -104,7 +104,7 @@
   // The clone function is used by FindPropertiesNeedingUpdate.h for recording
   // an effect node before it has been updated, to later detect changes.
   RefPtr<EffectPaintPropertyNode> Clone() const {
-    return AdoptRef(new EffectPaintPropertyNode(
+    return WTF::AdoptRef(new EffectPaintPropertyNode(
         Parent(), local_transform_space_, output_clip_, color_filter_, filter_,
         opacity_, blend_mode_, direct_compositing_reasons_,
         compositor_element_id_, paint_offset_));
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
index e32ae8a..4c44e8f 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/ScrollPaintPropertyNode.h
@@ -46,7 +46,7 @@
       bool user_scrollable_vertical,
       MainThreadScrollingReasons main_thread_scrolling_reasons,
       CompositorElementId compositor_element_id) {
-    return AdoptRef(new ScrollPaintPropertyNode(
+    return WTF::AdoptRef(new ScrollPaintPropertyNode(
         std::move(parent), bounds_offset, container_bounds, bounds,
         user_scrollable_horizontal, user_scrollable_vertical,
         main_thread_scrolling_reasons, compositor_element_id));
@@ -121,7 +121,7 @@
   // a scroll node before it has been updated, to later detect changes.
   RefPtr<ScrollPaintPropertyNode> Clone() const {
     RefPtr<ScrollPaintPropertyNode> cloned =
-        AdoptRef(new ScrollPaintPropertyNode(
+        WTF::AdoptRef(new ScrollPaintPropertyNode(
             Parent(), bounds_offset_, container_bounds_, bounds_,
             user_scrollable_horizontal_, user_scrollable_vertical_,
             main_thread_scrolling_reasons_, compositor_element_id_));
diff --git a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.cpp b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.cpp
index 617fcdf2..a19a370 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.cpp
@@ -12,7 +12,7 @@
 // scroll node.
 TransformPaintPropertyNode* TransformPaintPropertyNode::Root() {
   DEFINE_STATIC_REF(TransformPaintPropertyNode, root,
-                    AdoptRef(new TransformPaintPropertyNode(
+                    WTF::AdoptRef(new TransformPaintPropertyNode(
                         nullptr, TransformationMatrix(), FloatPoint3D(), false,
                         0, kCompositingReasonNone, CompositorElementId(),
                         ScrollPaintPropertyNode::Root())));
diff --git a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h
index 733a10d..fd65ec28 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h
@@ -50,7 +50,7 @@
       // The scroll compositor element id should be stored on the scroll node.
       DCHECK(!compositor_element_id);
     }
-    return AdoptRef(new TransformPaintPropertyNode(
+    return WTF::AdoptRef(new TransformPaintPropertyNode(
         std::move(parent), matrix, origin, flattens_inherited_transform,
         rendering_context_id, direct_compositing_reasons, compositor_element_id,
         std::move(scroll)));
@@ -132,7 +132,7 @@
   // The clone function is used by FindPropertiesNeedingUpdate.h for recording
   // a transform node before it has been updated, to later detect changes.
   RefPtr<TransformPaintPropertyNode> Clone() const {
-    return AdoptRef(new TransformPaintPropertyNode(
+    return WTF::AdoptRef(new TransformPaintPropertyNode(
         Parent(), matrix_, origin_, flattens_inherited_transform_,
         rendering_context_id_, direct_compositing_reasons_,
         compositor_element_id_, scroll_));
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
index b1a9ca8a..84dd1e5 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -422,7 +422,7 @@
 class OffHeapInt : public RefCounted<OffHeapInt> {
  public:
   static RefPtr<OffHeapInt> Create(int x) {
-    return AdoptRef(new OffHeapInt(x));
+    return WTF::AdoptRef(new OffHeapInt(x));
   }
 
   virtual ~OffHeapInt() { ++destructor_calls_; }
@@ -657,7 +657,7 @@
 
    private:
     explicit PersistentChain(int count) {
-      ref_counted_chain_ = AdoptRef(RefCountedChain::Create(count));
+      ref_counted_chain_ = WTF::AdoptRef(RefCountedChain::Create(count));
     }
 
     RefPtr<RefCountedChain> ref_counted_chain_;
@@ -4614,12 +4614,12 @@
   {
     Set set;
     RefCountedWithDestructor* has_destructor = new RefCountedWithDestructor();
-    set.Add(AdoptRef(has_destructor));
+    set.Add(WTF::AdoptRef(has_destructor));
     EXPECT_FALSE(RefCountedWithDestructor::was_destructed_);
 
     if (add_lots) {
       for (int i = 0; i < 1000; i++) {
-        set.Add(AdoptRef(new RefCountedWithDestructor()));
+        set.Add(WTF::AdoptRef(new RefCountedWithDestructor()));
       }
     }
 
@@ -4640,12 +4640,12 @@
   RefCountedWithDestructor::was_destructed_ = false;
   Set set;
   RefCountedWithDestructor* has_destructor = new RefCountedWithDestructor();
-  set.Add(AdoptRef(has_destructor));
+  set.Add(WTF::AdoptRef(has_destructor));
   EXPECT_FALSE(RefCountedWithDestructor::was_destructed_);
 
   if (add_lots) {
     for (int i = 0; i < 1000; i++) {
-      set.Add(AdoptRef(new RefCountedWithDestructor()));
+      set.Add(WTF::AdoptRef(new RefCountedWithDestructor()));
     }
   }
 
@@ -6076,7 +6076,7 @@
 class SimpleRefValue : public RefCounted<SimpleRefValue> {
  public:
   static RefPtr<SimpleRefValue> Create(int i) {
-    return AdoptRef(new SimpleRefValue(i));
+    return WTF::AdoptRef(new SimpleRefValue(i));
   }
 
   int Value() const { return value_; }
diff --git a/third_party/WebKit/Source/platform/image-decoders/SegmentReader.cpp b/third_party/WebKit/Source/platform/image-decoders/SegmentReader.cpp
index e115db8e1..7fb8cfc 100644
--- a/third_party/WebKit/Source/platform/image-decoders/SegmentReader.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/SegmentReader.cpp
@@ -183,16 +183,16 @@
 
 RefPtr<SegmentReader> SegmentReader::CreateFromSharedBuffer(
     RefPtr<SharedBuffer> buffer) {
-  return AdoptRef(new SharedBufferSegmentReader(std::move(buffer)));
+  return WTF::AdoptRef(new SharedBufferSegmentReader(std::move(buffer)));
 }
 
 RefPtr<SegmentReader> SegmentReader::CreateFromSkData(sk_sp<SkData> data) {
-  return AdoptRef(new DataSegmentReader(std::move(data)));
+  return WTF::AdoptRef(new DataSegmentReader(std::move(data)));
 }
 
 RefPtr<SegmentReader> SegmentReader::CreateFromSkROBuffer(
     sk_sp<SkROBuffer> buffer) {
-  return AdoptRef(new ROBufferSegmentReader(std::move(buffer)));
+  return WTF::AdoptRef(new ROBufferSegmentReader(std::move(buffer)));
 }
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h
index ef3feb9..98e90a10 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/CachedMetadata.h
@@ -49,12 +49,12 @@
   static RefPtr<CachedMetadata> Create(uint32_t data_type_id,
                                        const char* data,
                                        size_t size) {
-    return AdoptRef(new CachedMetadata(data_type_id, data, size));
+    return WTF::AdoptRef(new CachedMetadata(data_type_id, data, size));
   }
 
   static RefPtr<CachedMetadata> CreateFromSerializedData(const char* data,
                                                          size_t size) {
-    return AdoptRef(new CachedMetadata(data, size));
+    return WTF::AdoptRef(new CachedMetadata(data, size));
   }
 
   ~CachedMetadata() {}
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoadTiming.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoadTiming.cpp
index 9632797..50fc0ea 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoadTiming.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoadTiming.cpp
@@ -27,7 +27,7 @@
       push_end_(0) {}
 
 RefPtr<ResourceLoadTiming> ResourceLoadTiming::Create() {
-  return AdoptRef(new ResourceLoadTiming);
+  return WTF::AdoptRef(new ResourceLoadTiming);
 }
 
 RefPtr<ResourceLoadTiming> ResourceLoadTiming::DeepCopy() {
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceTimingInfo.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceTimingInfo.h
index 3958820..e8d4afd6 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceTimingInfo.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceTimingInfo.h
@@ -54,7 +54,7 @@
   static RefPtr<ResourceTimingInfo> Create(const AtomicString& type,
                                            const double time,
                                            bool is_main_resource) {
-    return AdoptRef(new ResourceTimingInfo(type, time, is_main_resource));
+    return WTF::AdoptRef(new ResourceTimingInfo(type, time, is_main_resource));
   }
   static RefPtr<ResourceTimingInfo> Adopt(
       std::unique_ptr<CrossThreadResourceTimingInfoData>);
diff --git a/third_party/WebKit/Source/platform/loader/testing/MockFetchContext.h b/third_party/WebKit/Source/platform/loader/testing/MockFetchContext.h
index e5c9802..0a1410b4 100644
--- a/third_party/WebKit/Source/platform/loader/testing/MockFetchContext.h
+++ b/third_party/WebKit/Source/platform/loader/testing/MockFetchContext.h
@@ -111,7 +111,7 @@
 
   MockFetchContext(LoadPolicy load_policy)
       : load_policy_(load_policy),
-        runner_(AdoptRef(new scheduler::FakeWebTaskRunner)),
+        runner_(WTF::AdoptRef(new scheduler::FakeWebTaskRunner)),
         security_origin_(SecurityOrigin::CreateUnique()),
         frame_scheduler_(new MockFrameScheduler(runner_)),
         complete_(false),
diff --git a/third_party/WebKit/Source/platform/network/EncodedFormData.cpp b/third_party/WebKit/Source/platform/network/EncodedFormData.cpp
index fb09051..b94d6f1 100644
--- a/third_party/WebKit/Source/platform/network/EncodedFormData.cpp
+++ b/third_party/WebKit/Source/platform/network/EncodedFormData.cpp
@@ -46,7 +46,7 @@
 EncodedFormData::~EncodedFormData() {}
 
 RefPtr<EncodedFormData> EncodedFormData::Create() {
-  return AdoptRef(new EncodedFormData);
+  return WTF::AdoptRef(new EncodedFormData);
 }
 
 RefPtr<EncodedFormData> EncodedFormData::Create(const void* data, size_t size) {
@@ -68,7 +68,7 @@
 }
 
 RefPtr<EncodedFormData> EncodedFormData::Copy() const {
-  return AdoptRef(new EncodedFormData(*this));
+  return WTF::AdoptRef(new EncodedFormData(*this));
 }
 
 RefPtr<EncodedFormData> EncodedFormData::DeepCopy() const {
diff --git a/third_party/WebKit/Source/platform/network/NetworkStateNotifierTest.cpp b/third_party/WebKit/Source/platform/network/NetworkStateNotifierTest.cpp
index 08087f3..8ae68be 100644
--- a/third_party/WebKit/Source/platform/network/NetworkStateNotifierTest.cpp
+++ b/third_party/WebKit/Source/platform/network/NetworkStateNotifierTest.cpp
@@ -130,8 +130,8 @@
 class NetworkStateNotifierTest : public ::testing::Test {
  public:
   NetworkStateNotifierTest()
-      : task_runner_(AdoptRef(new FakeWebTaskRunner())),
-        task_runner2_(AdoptRef(new FakeWebTaskRunner())) {
+      : task_runner_(WTF::AdoptRef(new FakeWebTaskRunner())),
+        task_runner2_(WTF::AdoptRef(new FakeWebTaskRunner())) {
     // Initialize connection, so that future calls to setWebConnection issue
     // notifications.
     notifier_.SetWebConnection(kWebConnectionTypeUnknown, 0.0);
diff --git a/third_party/WebKit/Source/platform/network/WebSocketHandshakeRequest.h b/third_party/WebKit/Source/platform/network/WebSocketHandshakeRequest.h
index 30125f6..83e3e98 100644
--- a/third_party/WebKit/Source/platform/network/WebSocketHandshakeRequest.h
+++ b/third_party/WebKit/Source/platform/network/WebSocketHandshakeRequest.h
@@ -46,14 +46,14 @@
     : public RefCounted<WebSocketHandshakeRequest> {
  public:
   static RefPtr<WebSocketHandshakeRequest> Create(const KURL& url) {
-    return AdoptRef(new WebSocketHandshakeRequest(url));
+    return WTF::AdoptRef(new WebSocketHandshakeRequest(url));
   }
   static RefPtr<WebSocketHandshakeRequest> Create() {
-    return AdoptRef(new WebSocketHandshakeRequest);
+    return WTF::AdoptRef(new WebSocketHandshakeRequest);
   }
   static RefPtr<WebSocketHandshakeRequest> Create(
       const WebSocketHandshakeRequest& request) {
-    return AdoptRef(new WebSocketHandshakeRequest(request));
+    return WTF::AdoptRef(new WebSocketHandshakeRequest(request));
   }
   virtual ~WebSocketHandshakeRequest();
 
diff --git a/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc b/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
index da9b6a9..d9ae434 100644
--- a/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/child/web_task_runner_impl.cc
@@ -18,7 +18,7 @@
 
 RefPtr<WebTaskRunnerImpl> WebTaskRunnerImpl::Create(
     scoped_refptr<TaskQueue> task_queue) {
-  return AdoptRef(new WebTaskRunnerImpl(std::move(task_queue)));
+  return WTF::AdoptRef(new WebTaskRunnerImpl(std::move(task_queue)));
 }
 
 bool WebTaskRunnerImpl::RunsTasksInCurrentSequence() {
diff --git a/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc b/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc
index c1cc1ba..bf485c70 100644
--- a/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc
+++ b/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc
@@ -68,7 +68,8 @@
 };
 
 FakeWebTaskRunner::FakeWebTaskRunner()
-    : data_(AdoptRef(new Data)), base_task_runner_(new BaseTaskRunner(data_)) {}
+    : data_(WTF::AdoptRef(new Data)),
+      base_task_runner_(new BaseTaskRunner(data_)) {}
 
 FakeWebTaskRunner::FakeWebTaskRunner(
     RefPtr<Data> data,
diff --git a/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp b/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp
index 1be97533..677b23e 100644
--- a/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp
+++ b/third_party/WebKit/Source/platform/speech/PlatformSpeechSynthesisVoice.cpp
@@ -33,12 +33,12 @@
     const String& lang,
     bool local_service,
     bool is_default) {
-  return AdoptRef(new PlatformSpeechSynthesisVoice(voice_uri, name, lang,
-                                                   local_service, is_default));
+  return WTF::AdoptRef(new PlatformSpeechSynthesisVoice(
+      voice_uri, name, lang, local_service, is_default));
 }
 
 RefPtr<PlatformSpeechSynthesisVoice> PlatformSpeechSynthesisVoice::Create() {
-  return AdoptRef(new PlatformSpeechSynthesisVoice);
+  return WTF::AdoptRef(new PlatformSpeechSynthesisVoice);
 }
 
 PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice(
diff --git a/third_party/WebKit/Source/platform/testing/ArenaTestHelpers.h b/third_party/WebKit/Source/platform/testing/ArenaTestHelpers.h
index e2fd75f..1616fd35 100644
--- a/third_party/WebKit/Source/platform/testing/ArenaTestHelpers.h
+++ b/third_party/WebKit/Source/platform/testing/ArenaTestHelpers.h
@@ -40,7 +40,7 @@
 class TrackedAllocator final : public PODArena::FastMallocAllocator {
  public:
   static RefPtr<TrackedAllocator> Create() {
-    return AdoptRef(new TrackedAllocator);
+    return WTF::AdoptRef(new TrackedAllocator);
   }
 
   void* Allocate(size_t size) override {
diff --git a/third_party/WebKit/Source/platform/text/BidiContext.cpp b/third_party/WebKit/Source/platform/text/BidiContext.cpp
index c8c6080..0c39a1dd 100644
--- a/third_party/WebKit/Source/platform/text/BidiContext.cpp
+++ b/third_party/WebKit/Source/platform/text/BidiContext.cpp
@@ -44,7 +44,8 @@
     bool override,
     BidiEmbeddingSource source,
     BidiContext* parent) {
-  return AdoptRef(new BidiContext(level, direction, override, source, parent));
+  return WTF::AdoptRef(
+      new BidiContext(level, direction, override, source, parent));
 }
 
 RefPtr<BidiContext> BidiContext::Create(unsigned char level,
diff --git a/third_party/WebKit/Source/platform/text/HyphenationTest.cpp b/third_party/WebKit/Source/platform/text/HyphenationTest.cpp
index d9be4e6..5383ba98 100644
--- a/third_party/WebKit/Source/platform/text/HyphenationTest.cpp
+++ b/third_party/WebKit/Source/platform/text/HyphenationTest.cpp
@@ -31,7 +31,7 @@
 };
 
 TEST(HyphenationTest, Get) {
-  RefPtr<Hyphenation> hyphenation = AdoptRef(new NoHyphenation);
+  RefPtr<Hyphenation> hyphenation = WTF::AdoptRef(new NoHyphenation);
   LayoutLocale::SetHyphenationForTesting("en-US", hyphenation);
   EXPECT_EQ(hyphenation.Get(), LayoutLocale::Get("en-US")->GetHyphenation());
 
diff --git a/third_party/WebKit/Source/platform/transforms/IdentityTransformOperation.h b/third_party/WebKit/Source/platform/transforms/IdentityTransformOperation.h
index 16d4220..44808ba 100644
--- a/third_party/WebKit/Source/platform/transforms/IdentityTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/IdentityTransformOperation.h
@@ -33,7 +33,7 @@
     : public TransformOperation {
  public:
   static RefPtr<IdentityTransformOperation> Create() {
-    return AdoptRef(new IdentityTransformOperation());
+    return WTF::AdoptRef(new IdentityTransformOperation());
   }
 
   virtual bool CanBlendWith(const TransformOperation& other) const {
diff --git a/third_party/WebKit/Source/platform/transforms/InterpolatedTransformOperation.h b/third_party/WebKit/Source/platform/transforms/InterpolatedTransformOperation.h
index 3593fd4..5dccdfa9 100644
--- a/third_party/WebKit/Source/platform/transforms/InterpolatedTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/InterpolatedTransformOperation.h
@@ -44,7 +44,8 @@
       const TransformOperations& from,
       const TransformOperations& to,
       double progress) {
-    return AdoptRef(new InterpolatedTransformOperation(from, to, progress));
+    return WTF::AdoptRef(
+        new InterpolatedTransformOperation(from, to, progress));
   }
 
   virtual bool CanBlendWith(const TransformOperation& other) const {
diff --git a/third_party/WebKit/Source/platform/transforms/Matrix3DTransformOperation.h b/third_party/WebKit/Source/platform/transforms/Matrix3DTransformOperation.h
index 13ee278..ece061d88 100644
--- a/third_party/WebKit/Source/platform/transforms/Matrix3DTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/Matrix3DTransformOperation.h
@@ -35,7 +35,7 @@
  public:
   static RefPtr<Matrix3DTransformOperation> Create(
       const TransformationMatrix& matrix) {
-    return AdoptRef(new Matrix3DTransformOperation(matrix));
+    return WTF::AdoptRef(new Matrix3DTransformOperation(matrix));
   }
 
   TransformationMatrix Matrix() const { return matrix_; }
diff --git a/third_party/WebKit/Source/platform/transforms/MatrixTransformOperation.h b/third_party/WebKit/Source/platform/transforms/MatrixTransformOperation.h
index fe70129..1a901eb4 100644
--- a/third_party/WebKit/Source/platform/transforms/MatrixTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/MatrixTransformOperation.h
@@ -39,12 +39,12 @@
                                                  double d,
                                                  double e,
                                                  double f) {
-    return AdoptRef(new MatrixTransformOperation(a, b, c, d, e, f));
+    return WTF::AdoptRef(new MatrixTransformOperation(a, b, c, d, e, f));
   }
 
   static RefPtr<MatrixTransformOperation> Create(
       const TransformationMatrix& t) {
-    return AdoptRef(new MatrixTransformOperation(t));
+    return WTF::AdoptRef(new MatrixTransformOperation(t));
   }
 
   TransformationMatrix Matrix() const {
diff --git a/third_party/WebKit/Source/platform/transforms/PerspectiveTransformOperation.h b/third_party/WebKit/Source/platform/transforms/PerspectiveTransformOperation.h
index 47a8777..a9c0e98 100644
--- a/third_party/WebKit/Source/platform/transforms/PerspectiveTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/PerspectiveTransformOperation.h
@@ -34,7 +34,7 @@
     : public TransformOperation {
  public:
   static RefPtr<PerspectiveTransformOperation> Create(double p) {
-    return AdoptRef(new PerspectiveTransformOperation(p));
+    return WTF::AdoptRef(new PerspectiveTransformOperation(p));
   }
 
   double Perspective() const { return p_; }
diff --git a/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h b/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
index 90a984c..9f61f7a0 100644
--- a/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
@@ -49,7 +49,7 @@
   static RefPtr<RotateTransformOperation> Create(const Rotation& rotation,
                                                  OperationType type) {
     DCHECK(IsMatchingOperationType(type));
-    return AdoptRef(new RotateTransformOperation(rotation, type));
+    return WTF::AdoptRef(new RotateTransformOperation(rotation, type));
   }
 
   bool operator==(const RotateTransformOperation& other) const {
@@ -105,7 +105,7 @@
   static RefPtr<RotateAroundOriginTransformOperation> Create(double angle,
                                                              double origin_x,
                                                              double origin_y) {
-    return AdoptRef(
+    return WTF::AdoptRef(
         new RotateAroundOriginTransformOperation(angle, origin_x, origin_y));
   }
 
diff --git a/third_party/WebKit/Source/platform/transforms/ScaleTransformOperation.h b/third_party/WebKit/Source/platform/transforms/ScaleTransformOperation.h
index 0f5bd70..4b894b7 100644
--- a/third_party/WebKit/Source/platform/transforms/ScaleTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/ScaleTransformOperation.h
@@ -35,14 +35,14 @@
   static RefPtr<ScaleTransformOperation> Create(double sx,
                                                 double sy,
                                                 OperationType type) {
-    return AdoptRef(new ScaleTransformOperation(sx, sy, 1, type));
+    return WTF::AdoptRef(new ScaleTransformOperation(sx, sy, 1, type));
   }
 
   static RefPtr<ScaleTransformOperation> Create(double sx,
                                                 double sy,
                                                 double sz,
                                                 OperationType type) {
-    return AdoptRef(new ScaleTransformOperation(sx, sy, sz, type));
+    return WTF::AdoptRef(new ScaleTransformOperation(sx, sy, sz, type));
   }
 
   bool operator==(const ScaleTransformOperation& other) const {
diff --git a/third_party/WebKit/Source/platform/transforms/SkewTransformOperation.h b/third_party/WebKit/Source/platform/transforms/SkewTransformOperation.h
index 2f151b3f..46e8389 100644
--- a/third_party/WebKit/Source/platform/transforms/SkewTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/SkewTransformOperation.h
@@ -35,7 +35,7 @@
   static RefPtr<SkewTransformOperation> Create(double angle_x,
                                                double angle_y,
                                                OperationType type) {
-    return AdoptRef(new SkewTransformOperation(angle_x, angle_y, type));
+    return WTF::AdoptRef(new SkewTransformOperation(angle_x, angle_y, type));
   }
 
   double AngleX() const { return angle_x_; }
diff --git a/third_party/WebKit/Source/platform/transforms/TranslateTransformOperation.h b/third_party/WebKit/Source/platform/transforms/TranslateTransformOperation.h
index aeb5f71..70e796f3 100644
--- a/third_party/WebKit/Source/platform/transforms/TranslateTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/TranslateTransformOperation.h
@@ -37,14 +37,14 @@
   static RefPtr<TranslateTransformOperation> Create(const Length& tx,
                                                     const Length& ty,
                                                     OperationType type) {
-    return AdoptRef(new TranslateTransformOperation(tx, ty, 0, type));
+    return WTF::AdoptRef(new TranslateTransformOperation(tx, ty, 0, type));
   }
 
   static RefPtr<TranslateTransformOperation> Create(const Length& tx,
                                                     const Length& ty,
                                                     double tz,
                                                     OperationType type) {
-    return AdoptRef(new TranslateTransformOperation(tx, ty, tz, type));
+    return WTF::AdoptRef(new TranslateTransformOperation(tx, ty, tz, type));
   }
 
   bool operator==(const TranslateTransformOperation& other) const {
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
index f4af5272..8b5fd5a 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
@@ -181,22 +181,22 @@
     return origin;
 
   if (ShouldTreatAsUniqueOrigin(url))
-    return AdoptRef(new SecurityOrigin());
+    return WTF::AdoptRef(new SecurityOrigin());
 
   if (ShouldUseInnerURL(url))
-    return AdoptRef(new SecurityOrigin(ExtractInnerURL(url)));
+    return WTF::AdoptRef(new SecurityOrigin(ExtractInnerURL(url)));
 
-  return AdoptRef(new SecurityOrigin(url));
+  return WTF::AdoptRef(new SecurityOrigin(url));
 }
 
 RefPtr<SecurityOrigin> SecurityOrigin::CreateUnique() {
-  RefPtr<SecurityOrigin> origin = AdoptRef(new SecurityOrigin());
+  RefPtr<SecurityOrigin> origin = WTF::AdoptRef(new SecurityOrigin());
   DCHECK(origin->IsUnique());
   return origin;
 }
 
 RefPtr<SecurityOrigin> SecurityOrigin::IsolatedCopy() const {
-  return AdoptRef(new SecurityOrigin(this));
+  return WTF::AdoptRef(new SecurityOrigin(this));
 }
 
 void SecurityOrigin::SetDomainFromDOM(const String& new_domain) {
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
index d12752ab..2ca1a56d5 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
@@ -259,7 +259,7 @@
   origin = SecurityOrigin::CreateFromString("https-so-so://foobar.test.com");
   EXPECT_FALSE(origin->HasSuborigin());
 
-  origin = AdoptRef<SecurityOrigin>(new SecurityOrigin);
+  origin = WTF::AdoptRef<SecurityOrigin>(new SecurityOrigin);
   EXPECT_FALSE(origin->HasSuborigin());
 
   origin = SecurityOrigin::CreateFromString("https-so://foobar.test.com");
diff --git a/third_party/WebKit/public/platform/modules/payments/payment_request.mojom b/third_party/WebKit/public/platform/modules/payments/payment_request.mojom
index 639e544f..eddb3dc0c3 100644
--- a/third_party/WebKit/public/platform/modules/payments/payment_request.mojom
+++ b/third_party/WebKit/public/platform/modules/payments/payment_request.mojom
@@ -218,8 +218,8 @@
 };
 
 enum PaymentComplete {
-  SUCCESS,
   FAIL,
+  SUCCESS,
   UNKNOWN
 };
 
diff --git a/third_party/blink/tools/move_blink_source.py b/third_party/blink/tools/move_blink_source.py
index 3261f90..26f1eab1 100755
--- a/third_party/blink/tools/move_blink_source.py
+++ b/third_party/blink/tools/move_blink_source.py
@@ -326,7 +326,7 @@
                 original_content = self._fs.read_text_file(file_path)
 
                 content = self._update_cpp_includes(original_content)
-                if file_path.endswith('.h') and '/third_party/WebKit/public/' in file_path:
+                if file_path.endswith('.h') and '/third_party/WebKit/public/' in file_path.replace('\\', '/'):
                     content = self._update_basename_only_includes(content, file_path)
 
                 if original_content == content:
@@ -385,7 +385,7 @@
         return match.group(0)
 
     def _update_basename_only_includes(self, content, source_path):
-        if not source_path.endswith('.h') or '/third_party/WebKit/public/' not in source_path:
+        if not source_path.endswith('.h') or '/third_party/WebKit/public/' not in source_path.replace('\\', '/'):
             return
         # In public/ header files, we should replace |#include "WebFoo.h"|
         # with |#include "third_party/blink/renderer/public/platform-or-web/web_foo.h"|
diff --git a/third_party/blink/tools/plan_blink_move.py b/third_party/blink/tools/plan_blink_move.py
index cc46703..23fe5af 100755
--- a/third_party/blink/tools/plan_blink_move.py
+++ b/third_party/blink/tools/plan_blink_move.py
@@ -40,7 +40,7 @@
             return dest
         # Skip CSSProperty*. Some files are generated, and some files are
         # checked-in. It's hard to handle them automatically.
-        if re.search(r'css[\/]properties$', dirname):
+        if re.search(r'css[\\/]properties$', dirname):
             return dest
         if filename.endswith('.cpp'):
             ext = '.cc'
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index be7559d9..cec11c4 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -26593,6 +26593,15 @@
   </summary>
 </histogram>
 
+<histogram name="History.QueryMostVisitedURLsTime" units="ms">
+  <owner>chengx@chromium.org</owner>
+  <summary>
+    The amount of time for function HistoryBackend::QueryMostVisitedURLs to
+    execute. Excludes the case where local HistoryDatabase db_ is unavailable,
+    i.e. where the query doesn't really happen.
+  </summary>
+</histogram>
+
 <histogram name="History.ResultsRenderedTime" units="ms">
   <owner>tsergeant@chromium.org</owner>
   <summary>
diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc
index 6044aae..b77a6f6 100644
--- a/ui/gfx/color_space.cc
+++ b/ui/gfx/color_space.cc
@@ -167,14 +167,23 @@
   if (primaries_ != other.primaries_ || transfer_ != other.transfer_ ||
       matrix_ != other.matrix_ || range_ != other.range_)
     return false;
-  if (primaries_ == PrimaryID::CUSTOM &&
-      memcmp(custom_primary_matrix_, other.custom_primary_matrix_,
-             sizeof(custom_primary_matrix_)))
-    return false;
-  if (transfer_ == TransferID::CUSTOM &&
-      memcmp(custom_transfer_params_, other.custom_transfer_params_,
-             sizeof(custom_transfer_params_)))
-    return false;
+  if (primaries_ == PrimaryID::CUSTOM) {
+    if (memcmp(custom_primary_matrix_, other.custom_primary_matrix_,
+               sizeof(custom_primary_matrix_))) {
+      return false;
+    }
+  }
+  if (transfer_ == TransferID::CUSTOM) {
+    if (memcmp(custom_transfer_params_, other.custom_transfer_params_,
+               sizeof(custom_transfer_params_))) {
+      return false;
+    }
+  }
+  if (primaries_ == PrimaryID::ICC_BASED ||
+      transfer_ == TransferID::ICC_BASED) {
+    if (icc_profile_id_ != other.icc_profile_id_)
+      return false;
+  }
   return true;
 }
 
@@ -204,8 +213,12 @@
 
   // Query the ICC profile, if available, for the parametric approximation.
   ICCProfile icc_profile;
-  if (GetICCProfile(&icc_profile))
+  if (GetICCProfile(&icc_profile)) {
     return icc_profile.GetParametricColorSpace();
+  } else {
+    DLOG(ERROR)
+        << "Unable to acquire ICC profile for parametric approximation.";
+  }
 
   // Fall back to sRGB if the ICC profile is no longer cached.
   return CreateSRGB();
diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h
index 0fdc44f..ba8d5b5f 100644
--- a/ui/gfx/color_space.h
+++ b/ui/gfx/color_space.h
@@ -22,6 +22,7 @@
 namespace gfx {
 
 class ICCProfile;
+class ICCProfileCache;
 
 // Used to represet a color space for the purpose of color conversion.
 // This is designed to be safe and compact enough to send over IPC
@@ -230,6 +231,7 @@
   sk_sp<SkColorSpace> icc_profile_sk_color_space_;
 
   friend class ICCProfile;
+  friend class ICCProfileCache;
   friend class ColorTransform;
   friend class ColorTransformInternal;
   friend class ColorSpaceWin;
diff --git a/ui/gfx/icc_profile.cc b/ui/gfx/icc_profile.cc
index d69b746a..0a9517ac 100644
--- a/ui/gfx/icc_profile.cc
+++ b/ui/gfx/icc_profile.cc
@@ -23,9 +23,6 @@
 const uint64_t ICCProfile::test_id_color_spin_ = 2;
 const uint64_t ICCProfile::test_id_generic_rgb_ = 3;
 const uint64_t ICCProfile::test_id_srgb_ = 4;
-const uint64_t ICCProfile::test_id_no_analytic_tr_fn_ = 5;
-const uint64_t ICCProfile::test_id_a2b_only_ = 6;
-const uint64_t ICCProfile::test_id_overshoot_ = 7;
 
 // A MRU cache of ICC profiles. The cache key is a uin64_t which a
 // gfx::ColorSpace may use to refer back to an ICC profile in the cache. The
@@ -58,6 +55,17 @@
     if (!icc_profile->id_)
       icc_profile->id_ = next_unused_id_++;
 
+    // Ensure that GetColorSpace() point back to this ICCProfile.
+    gfx::ColorSpace& color_space = icc_profile->color_space_;
+    color_space.icc_profile_id_ = icc_profile->id_;
+
+    // Ensure that the GetParametricColorSpace() point back to this ICCProfile
+    // only if the parametric version is accurate.
+    if (color_space.primaries_ != ColorSpace::PrimaryID::ICC_BASED &&
+        color_space.transfer_ != ColorSpace::TransferID::ICC_BASED) {
+      icc_profile->parametric_color_space_.icc_profile_id_ = icc_profile->id_;
+    }
+
     Entry entry;
     entry.icc_profile = *icc_profile;
     id_to_icc_profile_mru_.Put(icc_profile->id_, entry);
@@ -102,6 +110,13 @@
     if (found != id_to_icc_profile_mru_.end())
       return;
 
+    // Look up the profile by its data. If there is a new entry for the same
+    // data, don't add a duplicate.
+    if (FindByDataUnderLock(icc_profile.data_.data(), icc_profile.data_.size(),
+                            nullptr)) {
+      return;
+    }
+
     // If the entry was not found, insert it.
     Entry entry;
     entry.icc_profile = icc_profile;
@@ -162,8 +177,10 @@
       if (iter_data.size() != size || memcmp(data, iter_data.data(), size))
         continue;
 
-      *icc_profile = cached_profile;
-      id_to_icc_profile_mru_.Get(cached_profile.id_);
+      if (icc_profile) {
+        *icc_profile = cached_profile;
+        id_to_icc_profile_mru_.Get(cached_profile.id_);
+      }
       return true;
     }
     return false;
@@ -377,7 +394,6 @@
     case kICCExtractedMatrixAndAnalyticTrFn:
     case kICCExtractedMatrixAndApproximatedTrFn:
       // Successfully and accurately extracted color space.
-      parametric_color_space_.icc_profile_id_ = id_;
       color_space_ = parametric_color_space_;
       break;
     case kICCFailedToExtractRawTrFn:
@@ -387,7 +403,6 @@
       // Successfully but extracted a color space, but it isn't accurate enough.
       color_space_ = ColorSpace(ColorSpace::PrimaryID::ICC_BASED,
                                 ColorSpace::TransferID::ICC_BASED);
-      color_space_.icc_profile_id_ = id_;
       color_space_.icc_profile_sk_color_space_ = useable_sk_color_space;
       break;
     case kICCFailedToParse:
diff --git a/ui/gfx/icc_profile.h b/ui/gfx/icc_profile.h
index 4049df8..257b536 100644
--- a/ui/gfx/icc_profile.h
+++ b/ui/gfx/icc_profile.h
@@ -51,11 +51,6 @@
   static ICCProfile FromCGColorSpace(CGColorSpaceRef cg_color_space);
 #endif
 
-  // This will recover a ICCProfile from a compact ColorSpace representation.
-  // Internally, this will make an effort to create an identical ICCProfile
-  // to the one that created |color_space|, but this is not guaranteed.
-  static ICCProfile FromColorSpace(const gfx::ColorSpace& color_space);
-
   // Create directly from profile data.
   static ICCProfile FromData(const void* icc_profile, size_t size);
 
@@ -102,25 +97,19 @@
   friend ICCProfile ICCProfileForTestingColorSpin();
   friend ICCProfile ICCProfileForTestingGenericRGB();
   friend ICCProfile ICCProfileForTestingSRGB();
-  friend ICCProfile ICCProfileForTestingNoAnalyticTrFn();
-  friend ICCProfile ICCProfileForTestingA2BOnly();
-  friend ICCProfile ICCProfileForTestingOvershoot();
   friend ICCProfile ICCProfileForLayoutTests();
   static const uint64_t test_id_adobe_rgb_;
   static const uint64_t test_id_color_spin_;
   static const uint64_t test_id_generic_rgb_;
   static const uint64_t test_id_srgb_;
-  static const uint64_t test_id_no_analytic_tr_fn_;
-  static const uint64_t test_id_a2b_only_;
-  static const uint64_t test_id_overshoot_;
 
   // Populate |icc_profile| with the ICCProfile corresponding to id |id|. Return
   // false if |id| is not in the cache.
   static bool FromId(uint64_t id, ICCProfile* icc_profile);
 
   // This method is used to hard-code the |id_| to a specific value, and is
-  // used by test methods to ensure that they don't conflict with the values
-  // generated in the browser.
+  // used by layout test methods to ensure that they don't conflict with the
+  // values generated in the browser.
   static ICCProfile FromDataWithId(const void* icc_profile,
                                    size_t size,
                                    uint64_t id);
diff --git a/ui/gfx/icc_profile_unittest.cc b/ui/gfx/icc_profile_unittest.cc
index e1222d5a..d9a008d 100644
--- a/ui/gfx/icc_profile_unittest.cc
+++ b/ui/gfx/icc_profile_unittest.cc
@@ -122,6 +122,9 @@
   // as invalid.
   ICCProfile a2b = ICCProfileForTestingA2BOnly();
   EXPECT_FALSE(a2b.GetColorSpace().IsValid());
+
+  // Even though it is invalid, it should not be equal to the empty constructor.
+  EXPECT_NE(a2b, gfx::ICCProfile());
 }
 
 TEST(ICCProfile, GarbageData) {
@@ -158,4 +161,97 @@
   EXPECT_TRUE(SkMatrixIsApproximatelyIdentity(eye));
 }
 
+// This tests the ICCProfile MRU cache. This cache is sloppy and should be
+// rewritten, now that some of the original design constraints have been lifted.
+// This test exists only to ensure that we are aware of behavior changes, not to
+// enforce that behavior does not change.
+// https://crbug.com/766736
+TEST(ICCProfile, ExhaustCache) {
+  // Get an ICCProfile that can't be parametrically approximated.
+  ICCProfile original = ICCProfileForTestingNoAnalyticTrFn();
+  ColorSpace original_color_space_0 = original.GetColorSpace();
+
+  // Recover the ICCProfile from its GetColorSpace. Recovery should succeed, and
+  // the ICCProfiles should be equal.
+  ICCProfile recovered_0;
+  EXPECT_TRUE(original_color_space_0.GetICCProfile(&recovered_0));
+  EXPECT_EQ(original, recovered_0);
+
+  // The GetColorSpace of the recovered version should match the original.
+  ColorSpace recovered_0_color_space = recovered_0.GetColorSpace();
+  EXPECT_EQ(recovered_0_color_space, original_color_space_0);
+
+  // Create an identical ICCProfile to the original. It should equal the
+  // original, and its GetColorSpace should equal the original.
+  ICCProfile identical_0 = ICCProfileForTestingNoAnalyticTrFn();
+  EXPECT_EQ(original, identical_0);
+  ColorSpace identical_color_space_0 = identical_0.GetColorSpace();
+  EXPECT_EQ(identical_color_space_0, original_color_space_0);
+
+  // Create 128 distinct ICC profiles. This will destroy the cached
+  // ICCProfile<->ColorSpace mapping.
+  for (size_t i = 0; i < 128; ++i) {
+    SkMatrix44 toXYZD50;
+    ColorSpace::CreateSRGB().GetPrimaryMatrix(&toXYZD50);
+    SkColorSpaceTransferFn fn;
+    fn.fA = 1;
+    fn.fB = 0;
+    fn.fC = 1;
+    fn.fD = 0;
+    fn.fE = 0;
+    fn.fF = 0;
+    fn.fG = 1.5f + i / 128.f;
+    ColorSpace color_space = ColorSpace::CreateCustom(toXYZD50, fn);
+    ICCProfile icc_profile;
+    color_space.GetICCProfile(&icc_profile);
+  }
+
+  // Recover the original ICCProfile from its GetColorSpace. Recovery should
+  // fail, because it has been pushed out of the cache.
+  ICCProfile recovered_1;
+  EXPECT_FALSE(original_color_space_0.GetICCProfile(&recovered_1));
+  EXPECT_NE(original, recovered_1);
+
+  // Create an identical ICCProfile to the original. It should equal the
+  // original, because the comparison is based on data.
+  ICCProfile identical_1 = ICCProfileForTestingNoAnalyticTrFn();
+  EXPECT_EQ(original, identical_1);
+
+  // The identical ICCProfile's GetColorSpace will not match, because the
+  // original points to the now-uncached version.
+  ColorSpace identical_1_color_space = identical_1.GetColorSpace();
+  EXPECT_NE(identical_1_color_space, original_color_space_0);
+
+  // The original ICCProfile is now orphaned because there exists a new entry
+  // with the same data.
+  ColorSpace original_color_space_2 = original.GetColorSpace();
+  ICCProfile recovered_2;
+  EXPECT_FALSE(original_color_space_2.GetICCProfile(&recovered_2));
+  EXPECT_NE(original, recovered_2);
+
+  // Blow away the cache one more time.
+  for (size_t i = 0; i < 128; ++i) {
+    SkMatrix44 toXYZD50;
+    ColorSpace::CreateSRGB().GetPrimaryMatrix(&toXYZD50);
+    SkColorSpaceTransferFn fn;
+    fn.fA = 1;
+    fn.fB = 0;
+    fn.fC = 1;
+    fn.fD = 0;
+    fn.fE = 0;
+    fn.fF = 0;
+    fn.fG = 1.5f + i / 128.f;
+    ColorSpace color_space = ColorSpace::CreateCustom(toXYZD50, fn);
+    ICCProfile icc_profile;
+    color_space.GetICCProfile(&icc_profile);
+  }
+
+  // Now the original ICCProfile can re-insert itself into the cache, with its
+  // original id.
+  ColorSpace original_color_space_3 = original.GetColorSpace();
+  ICCProfile recovered_3;
+  EXPECT_TRUE(original_color_space_3.GetICCProfile(&recovered_3));
+  EXPECT_EQ(original, recovered_3);
+}
+
 }  // namespace gfx
diff --git a/ui/gfx/test/icc_profiles.cc b/ui/gfx/test/icc_profiles.cc
index 3b6ebb0c..cd3c888b 100644
--- a/ui/gfx/test/icc_profiles.cc
+++ b/ui/gfx/test/icc_profiles.cc
@@ -1917,22 +1917,21 @@
 }
 
 ICCProfile ICCProfileForTestingNoAnalyticTrFn() {
-  return ICCProfile::FromDataWithId(
+  return ICCProfile::FromData(
       reinterpret_cast<const char*>(no_analytic_tr_fn_profile_data),
-      arraysize(no_analytic_tr_fn_profile_data),
-      ICCProfile::test_id_no_analytic_tr_fn_);
+      arraysize(no_analytic_tr_fn_profile_data));
 }
 
 ICCProfile ICCProfileForTestingA2BOnly() {
-  return ICCProfile::FromDataWithId(
+  return ICCProfile::FromData(
       reinterpret_cast<const char*>(a2b_only_profile_data),
-      arraysize(a2b_only_profile_data), ICCProfile::test_id_a2b_only_);
+      arraysize(a2b_only_profile_data));
 }
 
 ICCProfile ICCProfileForTestingOvershoot() {
-  return ICCProfile::FromDataWithId(
+  return ICCProfile::FromData(
       reinterpret_cast<const char*>(overshoot_profile_data),
-      arraysize(overshoot_profile_data), ICCProfile::test_id_overshoot_);
+      arraysize(overshoot_profile_data));
 }
 
 }  // namespace gfx
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm
index d02ab10..54f89f3 100644
--- a/ui/views/cocoa/bridged_native_widget.mm
+++ b/ui/views/cocoa/bridged_native_widget.mm
@@ -1141,11 +1141,10 @@
 ui::EventDispatchDetails BridgedNativeWidget::DispatchKeyEventPostIME(
     ui::KeyEvent* key) {
   DCHECK(focus_manager_);
-  native_widget_mac_->GetWidget()->OnKeyEvent(key);
-  if (!key->handled()) {
-    if (!focus_manager_->OnKeyEvent(*key))
-      key->StopPropagation();
-  }
+  if (!focus_manager_->OnKeyEvent(*key))
+    key->StopPropagation();
+  else
+    native_widget_mac_->GetWidget()->OnKeyEvent(key);
   return ui::EventDispatchDetails();
 }
 
diff --git a/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm b/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm
index 9e328b92..224ea14d0 100644
--- a/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm
+++ b/ui/views/cocoa/bridged_native_widget_interactive_uitest.mm
@@ -310,7 +310,8 @@
   DISALLOW_COPY_AND_ASSIGN(HitTestNativeWidgetMac);
 };
 
-TEST_F(BridgedNativeWidgetUITest, HitTest) {
+// Flaky on macOS 10.12. See http://crbug.com/767299.
+TEST_F(BridgedNativeWidgetUITest, DISABLED_HitTest) {
   Widget widget;
   HitTestNonClientFrameView* frame_view =
       new HitTestNonClientFrameView(&widget);
diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm
index 284c7fb..90799a4 100644
--- a/ui/views/widget/native_widget_mac.mm
+++ b/ui/views/widget/native_widget_mac.mm
@@ -278,7 +278,9 @@
 
 void NativeWidgetMac::SetWindowIcons(const gfx::ImageSkia& window_icon,
                                      const gfx::ImageSkia& app_icon) {
-  NOTIMPLEMENTED();
+  // Per-window icons are not really a thing on Mac, so do nothing.
+  // TODO(tapted): Investigate whether to use NSWindowDocumentIconButton to set
+  // an icon next to the window title. See http://crbug.com/766897.
 }
 
 void NativeWidgetMac::InitModalType(ui::ModalType modal_type) {
@@ -326,7 +328,11 @@
 }
 
 void NativeWidgetMac::StackAbove(gfx::NativeView native_view) {
-  NOTIMPLEMENTED();
+  // NativeWidgetMac currently only has machinery for stacking windows, and only
+  // stacks child windows above parents. That's currently all this is used for.
+  // DCHECK if a new use case comes along.
+  DCHECK(bridge_ && bridge_->parent());
+  DCHECK_EQ([native_view window], bridge_->parent()->GetNSWindow());
 }
 
 void NativeWidgetMac::StackAtTop() {