diff --git a/DEPS b/DEPS
index c51c1383..5bcd465 100644
--- a/DEPS
+++ b/DEPS
@@ -79,11 +79,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': 'ad335bbfafbc5326c62a84342f4e3792e79df8f9',
+  'skia_revision': '52247db04476e9c4751e84bad1bedb091785cb86',
   # 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': 'db122bdcd409894d52cccd347d202b97d0bbc9f9',
+  'v8_revision': '0ac874e752e6a4e3e81a62b7534a92077e9f78f1',
   # 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.
@@ -649,7 +649,7 @@
     Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd458ada06171a85af00367251a4ed55db7fe2018',
 
   'src/third_party/webrtc':
-    Var('webrtc_git') + '/src.git' + '@' + 'db9e9d5486c40f4b78513fedc79b9b22ad3e5751', # commit position 20628
+    Var('webrtc_git') + '/src.git' + '@' + '6daa27815625009de99edf4dfd939f4dcc48362f', # commit position 20628
 
   'src/third_party/xdg-utils': {
       'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index d5f392a..cc0c44a2 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -521,6 +521,7 @@
 
 
 _GENERIC_PYDEPS_FILES = [
+    'chrome/test/chromedriver/test/run_py_tests.pydeps',
 ]
 
 
@@ -2081,9 +2082,9 @@
 
 def _CheckPydepsNeedsUpdating(input_api, output_api, checker_for_tests=None):
   """Checks if a .pydeps file needs to be regenerated."""
-  # This check is mainly for Android, and involves paths not only in the
-  # PRESUBMIT.py, but also in the .pydeps files. It doesn't work on Windows and
-  # Mac, so skip it on other platforms.
+  # This check is for Python dependency lists (.pydeps files), and involves
+  # paths not only in the PRESUBMIT.py, but also in the .pydeps files. It
+  # doesn't work on Windows and Mac, so skip it on other platforms.
   if input_api.platform != 'linux2':
     return []
   # TODO(agrieve): Update when there's a better way to detect
diff --git a/android_webview/renderer/aw_render_view_ext.cc b/android_webview/renderer/aw_render_view_ext.cc
index add2084..b0e5fdb 100644
--- a/android_webview/renderer/aw_render_view_ext.cc
+++ b/android_webview/renderer/aw_render_view_ext.cc
@@ -56,7 +56,7 @@
   if (!webview || !main_render_frame)
     return;
 
-  gfx::Size contents_size = main_render_frame->GetWebFrame()->ContentsSize();
+  gfx::Size contents_size = main_render_frame->GetWebFrame()->DocumentSize();
 
   // Fall back to contentsPreferredMinimumSize if the mainFrame is reporting a
   // 0x0 size (this happens during initial load).
diff --git a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
index 42ce99f..e60e636 100644
--- a/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
+++ b/ash/content/display/screen_orientation_controller_chromeos_unittest.cc
@@ -231,7 +231,7 @@
 
   AttachAndActivateWebContents(content.get(), focus_window.get());
   delegate()->Lock(content.get(), blink::kWebScreenOrientationLockPortrait);
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
   EXPECT_TRUE(RotationLocked());
 
   delegate()->Lock(content.get(), blink::kWebScreenOrientationLockLandscape);
@@ -306,7 +306,7 @@
   ::wm::ActivationClient* activation_client = Shell::Get()->activation_client();
   activation_client->ActivateWindow(focus_window2.get());
   EXPECT_TRUE(RotationLocked());
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
 
   activation_client->ActivateWindow(focus_window1.get());
   EXPECT_TRUE(RotationLocked());
@@ -554,18 +554,18 @@
 
   AttachAndActivateWebContents(content.get(), focus_window.get());
   delegate()->Lock(content.get(), blink::kWebScreenOrientationLockPortrait);
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
   EXPECT_TRUE(RotationLocked());
 
   // Inverse of orientation is allowed
-  TriggerLidUpdate(gfx::Vector3dF(kMeanGravity, 0.0f, 0.0f));
-  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
+  TriggerLidUpdate(gfx::Vector3dF(-kMeanGravity, 0.0f, 0.0f));
+  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
 
   // Display rotations between are not allowed
   TriggerLidUpdate(gfx::Vector3dF(0.0f, kMeanGravity, 0.0f));
-  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
   TriggerLidUpdate(gfx::Vector3dF(0.0f, -kMeanGravity, 0.0f));
-  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
 }
 
 // Tests that for an orientation lock which does not allow rotation, that the
@@ -578,16 +578,16 @@
   AttachAndActivateWebContents(content.get(), focus_window.get());
   delegate()->Lock(content.get(),
                    blink::kWebScreenOrientationLockPortraitPrimary);
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
   EXPECT_TRUE(RotationLocked());
 
   // Rotation does not change.
   TriggerLidUpdate(gfx::Vector3dF(kMeanGravity, 0.0f, 0.0f));
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
   TriggerLidUpdate(gfx::Vector3dF(0.0f, kMeanGravity, 0.0f));
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
   TriggerLidUpdate(gfx::Vector3dF(0.0f, -kMeanGravity, 0.0f));
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
 }
 
 // Tests that after a content::WebContents has applied an orientation lock which
@@ -659,7 +659,7 @@
             UserLockedOrientation());
 
   orientation_controller->ToggleUserRotationLock();
-  SetInternalDisplayRotation(display::Display::ROTATE_90);
+  SetInternalDisplayRotation(display::Display::ROTATE_270);
   orientation_controller->ToggleUserRotationLock();
   EXPECT_EQ(blink::kWebScreenOrientationLockPortraitPrimary,
             UserLockedOrientation());
@@ -671,7 +671,7 @@
             UserLockedOrientation());
 
   orientation_controller->ToggleUserRotationLock();
-  SetInternalDisplayRotation(display::Display::ROTATE_270);
+  SetInternalDisplayRotation(display::Display::ROTATE_90);
   orientation_controller->ToggleUserRotationLock();
   EXPECT_EQ(blink::kWebScreenOrientationLockPortraitSecondary,
             UserLockedOrientation());
@@ -727,7 +727,7 @@
 
   delegate()->Lock(content1.get(), blink::kWebScreenOrientationLockPortrait);
 
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
 
   ::wm::ActivationClient* activation_client = Shell::Get()->activation_client();
   // Activating any will switch to the natural orientation.
@@ -736,7 +736,7 @@
 
   // Activating the portrait window will rotate to the portrait.
   activation_client->ActivateWindow(focus_window1.get());
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
 
   // User locked to the 90 dig.
   orientation_controller->ToggleUserRotationLock();
@@ -744,7 +744,7 @@
 
   // Switching to Any orientation will stay to the user locked orientation.
   activation_client->ActivateWindow(focus_window2.get());
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
 
   // Application forced to be landscape.
   delegate()->Lock(content2.get(), blink::kWebScreenOrientationLockLandscape);
@@ -753,7 +753,7 @@
   delegate()->Lock(content1.get(), blink::kWebScreenOrientationLockAny);
   activation_client->ActivateWindow(focus_window1.get());
   // Switching back to any will rotate to user rotation.
-  EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
+  EXPECT_EQ(display::Display::ROTATE_270, GetCurrentInternalDisplayRotation());
 }
 
 }  // namespace ash
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index e111db7f..ea24ec0e 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -3614,10 +3614,10 @@
   void SetUp() override {
     DisplayManagerTest::SetUp();
     const float kMeanGravity = 9.8066f;
-    portrait_primary->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, kMeanGravity,
+    portrait_primary->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, -kMeanGravity,
                           0.f, 0.f);
-    portrait_secondary->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN,
-                            -kMeanGravity, 0.f, 0.f);
+    portrait_secondary->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, kMeanGravity,
+                            0.f, 0.f);
   }
 
  protected:
@@ -3692,9 +3692,9 @@
 
   // Rotate to portrait in clamshell.
   configuration_controller->SetDisplayRotation(
-      screen->GetPrimaryDisplay().id(), display::Display::ROTATE_90,
+      screen->GetPrimaryDisplay().id(), display::Display::ROTATE_270,
       display::Display::ROTATION_SOURCE_USER);
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
   EXPECT_FALSE(display_manager->registered_internal_display_rotation_lock());
 
@@ -3718,7 +3718,7 @@
 
   // Application can overwwrite the locked orientation.
   wm::ActivateWindow(window_p);
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
   EXPECT_EQ(display::Display::ROTATE_0,
             display_manager->registered_internal_display_rotation());
@@ -3744,7 +3744,7 @@
   // Exit tablet mode reset to clamshell's rotation, which is 90.
   Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
   EXPECT_EQ(1, test_observer.countAndReset());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
   // Activate Any.
   wm::ActivateWindow(window_a);
@@ -3754,7 +3754,7 @@
   EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation());
 
   wm::ActivateWindow(window_p);
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
   EXPECT_EQ(0, test_observer.countAndReset());
   orientation_controller->ToggleUserRotationLock();
@@ -3762,17 +3762,17 @@
   EXPECT_EQ(2, test_observer.countAndReset());
 
   EXPECT_TRUE(display_manager->registered_internal_display_rotation_lock());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display_manager->registered_internal_display_rotation());
 
   wm::ActivateWindow(window_l);
   EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display_manager->registered_internal_display_rotation());
 
   // ANY will rotate to locked ortation.
   wm::ActivateWindow(window_a);
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
 
   orientation_controller->RemoveObserver(&test_observer);
@@ -3798,27 +3798,27 @@
   orientation_controller->LockOrientationForWindow(
       window, blink::kWebScreenOrientationLockPortrait,
       ScreenOrientationController::LockCompletionBehavior::None);
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
 
   orientation_controller->OnAccelerometerUpdated(portrait_secondary);
 
-  EXPECT_EQ(display::Display::ROTATE_270,
+  EXPECT_EQ(display::Display::ROTATE_90,
             screen->GetPrimaryDisplay().rotation());
 
   orientation_controller->OnAccelerometerUpdated(portrait_primary);
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
 
-  // Enable lock at 90.
+  // Enable lock at 270.
   orientation_controller->ToggleUserRotationLock();
   EXPECT_TRUE(display_manager->registered_internal_display_rotation_lock());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display_manager->registered_internal_display_rotation());
 
   orientation_controller->OnAccelerometerUpdated(portrait_secondary);
 
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             screen->GetPrimaryDisplay().rotation());
 }
 
diff --git a/ash/display/screen_orientation_controller_chromeos.cc b/ash/display/screen_orientation_controller_chromeos.cc
index 97047ec..9dd8e6c 100644
--- a/ash/display/screen_orientation_controller_chromeos.cc
+++ b/ash/display/screen_orientation_controller_chromeos.cc
@@ -54,15 +54,17 @@
     blink::WebScreenOrientationLockType natural,
     display::Display::Rotation rotation) {
   if (natural == blink::kWebScreenOrientationLockLandscape) {
+    // To be consistent with Android, the rgotation of the primary portrait
+    // on naturally landscape device is 270.
     switch (rotation) {
       case display::Display::ROTATE_0:
         return blink::kWebScreenOrientationLockLandscapePrimary;
       case display::Display::ROTATE_90:
-        return blink::kWebScreenOrientationLockPortraitPrimary;
+        return blink::kWebScreenOrientationLockPortraitSecondary;
       case display::Display::ROTATE_180:
         return blink::kWebScreenOrientationLockLandscapeSecondary;
       case display::Display::ROTATE_270:
-        return blink::kWebScreenOrientationLockPortraitSecondary;
+        return blink::kWebScreenOrientationLockPortraitPrimary;
     }
   } else {  // Natural portrait
     switch (rotation) {
@@ -91,15 +93,17 @@
   }
 
   if (natural == blink::kWebScreenOrientationLockLandscape) {
+    // To be consistent with Android, the rotation of the primary portrait
+    // on naturally landscape device is 270.
     switch (orientation) {
       case blink::kWebScreenOrientationLockLandscapePrimary:
         return display::Display::ROTATE_0;
       case blink::kWebScreenOrientationLockPortraitPrimary:
-        return display::Display::ROTATE_90;
+        return display::Display::ROTATE_270;
       case blink::kWebScreenOrientationLockLandscapeSecondary:
         return display::Display::ROTATE_180;
       case blink::kWebScreenOrientationLockPortraitSecondary:
-        return display::Display::ROTATE_270;
+        return display::Display::ROTATE_90;
       default:
         break;
     }
@@ -398,25 +402,19 @@
     case blink::kWebScreenOrientationLockDefault:
       NOTREACHED();
       break;
-    case blink::kWebScreenOrientationLockPortraitPrimary:
-      LockRotationToPrimaryOrientation(
-          blink::kWebScreenOrientationLockPortrait);
-      break;
     case blink::kWebScreenOrientationLockLandscape:
     case blink::kWebScreenOrientationLockPortrait:
       LockToRotationMatchingOrientation(lock_orientation);
       break;
-    case blink::kWebScreenOrientationLockPortraitSecondary:
-      LockRotationToSecondaryOrientation(
-          blink::kWebScreenOrientationLockPortrait);
-      break;
-    case blink::kWebScreenOrientationLockLandscapeSecondary:
-      LockRotationToSecondaryOrientation(
-          blink::kWebScreenOrientationLockLandscape);
-      break;
+
     case blink::kWebScreenOrientationLockLandscapePrimary:
-      LockRotationToPrimaryOrientation(
-          blink::kWebScreenOrientationLockLandscape);
+    case blink::kWebScreenOrientationLockLandscapeSecondary:
+    case blink::kWebScreenOrientationLockPortraitPrimary:
+    case blink::kWebScreenOrientationLockPortraitSecondary:
+      LockRotation(
+          OrientationToRotation(natural_orientation_, lock_orientation),
+          display::Display::ROTATION_SOURCE_ACTIVE);
+
       break;
     case blink::kWebScreenOrientationLockNatural:
       LockRotation(display::Display::ROTATE_0,
@@ -428,22 +426,6 @@
   }
 }
 
-void ScreenOrientationController::LockRotationToPrimaryOrientation(
-    blink::WebScreenOrientationLockType lock_orientation) {
-  LockRotation(natural_orientation_ == lock_orientation
-                   ? display::Display::ROTATE_0
-                   : display::Display::ROTATE_90,
-               display::Display::ROTATION_SOURCE_ACTIVE);
-}
-
-void ScreenOrientationController::LockRotationToSecondaryOrientation(
-    blink::WebScreenOrientationLockType lock_orientation) {
-  LockRotation(natural_orientation_ == lock_orientation
-                   ? display::Display::ROTATE_180
-                   : display::Display::ROTATE_270,
-               display::Display::ROTATION_SOURCE_ACTIVE);
-}
-
 void ScreenOrientationController::LockToRotationMatchingOrientation(
     blink::WebScreenOrientationLockType lock_orientation) {
   if (!display::Display::HasInternalDisplay())
@@ -467,8 +449,12 @@
         rotation == display::Display::ROTATE_270) {
       SetRotationLockedInternal(true);
     } else {
-      LockRotation(display::Display::ROTATE_90,
-                   display::Display::ROTATION_SOURCE_ACTIVE);
+      // Rotate to the default rotation of the requested orientation.
+      display::Display::Rotation default_rotation =
+          natural_orientation_ == blink::kWebScreenOrientationLockLandscape
+              ? display::Display::ROTATE_270  // portrait in landscape device.
+              : display::Display::ROTATE_90;  // landscape in portrait device.
+      LockRotation(default_rotation, display::Display::ROTATION_SOURCE_ACTIVE);
     }
   }
 }
diff --git a/ash/display/screen_orientation_controller_chromeos.h b/ash/display/screen_orientation_controller_chromeos.h
index 645dfe8..cfe3666 100644
--- a/ash/display/screen_orientation_controller_chromeos.h
+++ b/ash/display/screen_orientation_controller_chromeos.h
@@ -172,16 +172,6 @@
   void LockRotationToOrientation(
       blink::WebScreenOrientationLockType lock_orientation);
 
-  // Locks rotation to the angle matching the primary orientation for
-  // |lock_orientation|.
-  void LockRotationToPrimaryOrientation(
-      blink::WebScreenOrientationLockType lock_orientation);
-
-  // Locks rotation to the angle matching the secondary orientation for
-  // |lock_orientation|.
-  void LockRotationToSecondaryOrientation(
-      blink::WebScreenOrientationLockType lock_orientation);
-
   // For orientations that do not specify primary or secondary, locks to the
   // current rotation if it matches |lock_orientation|. Otherwise locks to a
   // matching rotation.
diff --git a/ash/public/interfaces/wallpaper.mojom b/ash/public/interfaces/wallpaper.mojom
index 1bdcf0e6..d2f2b2e7 100644
--- a/ash/public/interfaces/wallpaper.mojom
+++ b/ash/public/interfaces/wallpaper.mojom
@@ -81,13 +81,12 @@
        mojo.common.mojom.FilePath chromeos_custom_wallpapers_path,
        bool is_device_wallpaper_policy_enforced);
 
-  // Sets wallpaper from policy or from a local file. Saves the custom wallpaper
-  // to file, posts task to generate thumbnail and updates local state.
+  // Sets wallpaper from a local file. Saves the custom wallpaper to file, posts
+  // task to generate thumbnail and updates local state.
   // |user_info|: The user's information related to wallpaper.
   // |wallpaper_files_id|: The file id for user_info.account_id.
   // |file_name|: The name of the wallpaper file.
   // |layout|: The layout of the wallpaper, used for wallpaper resizing.
-  // |type|: The type of the wallpaper, e.g., default, policy etc.
   // |image|: The wallpaper image.
   // |show_wallpaper|: If false, don't show the new wallpaper now but only
   //                   update cache.
@@ -95,7 +94,6 @@
                      string wallpaper_files_id,
                      string file_name,
                      WallpaperLayout layout,
-                     WallpaperType type,
                      skia.mojom.Bitmap image,
                      bool show_wallpaper);
 
@@ -134,6 +132,17 @@
                                 mojo.common.mojom.FilePath file_path,
                                 mojo.common.mojom.FilePath resized_directory);
 
+  // Sets wallpaper from policy. If the user has logged in, show the policy
+  // wallpaper immediately, otherwise, the policy wallpaper will be shown the
+  // next time |ShowUserWallpaper| is called. Note: it is different from device
+  // policy.
+  // |user_info|: The user's information related to wallpaper.
+  // |wallpaper_files_id|: The file id for user_info.account_id.
+  // |data|: The data used to decode the image.
+  SetPolicyWallpaper(WallpaperUserInfo user_info,
+                     string wallpaper_files_id,
+                     string data);
+
   // Sets whether device wallpaper policy is enforced on this device. Updates/
   // clears the device policy controlled wallpaper if applicable.
   SetDeviceWallpaperPolicyEnforced(bool enforced);
@@ -161,6 +170,15 @@
   // |wallpaper_files_id|: The file id for user_info.account_id.
   RemoveUserWallpaper(WallpaperUserInfo user_info, string wallpaper_files_id);
 
+  // Removes all of the user's saved wallpapers and related info if the
+  // wallpaper was set by |SetPolicyWallpaper|. In addition, sets the user's
+  // wallpaper to be the default. If the user has logged in, show the default
+  // wallpaper immediately, otherwise, the default wallpaper will be shown the
+  // next time |ShowUserWallpaper| is called.
+  // |user_info|: The user's information related to wallpaper.
+  // |wallpaper_files_id|: The file id for user_info.account_id.
+  RemovePolicyWallpaper(WallpaperUserInfo user_info, string wallpaper_files_id);
+
   // TODO(crbug.com/776464): This is only used by WallpaperManager. Remove this
   // after WallpaperManager is removed.
   //
diff --git a/ash/wallpaper/wallpaper_controller.cc b/ash/wallpaper/wallpaper_controller.cc
index c3e8c02..5bf2703 100644
--- a/ash/wallpaper/wallpaper_controller.cc
+++ b/ash/wallpaper/wallpaper_controller.cc
@@ -72,6 +72,9 @@
 const char kDeviceWallpaperDir[] = "device_wallpaper";
 const char kDeviceWallpaperFile[] = "device_wallpaper_image.jpg";
 
+// The file name of the policy wallpaper.
+const char kPolicyWallpaperFile[] = "policy-controlled.jpeg";
+
 // How long to wait reloading the wallpaper after the display size has changed.
 constexpr int kWallpaperReloadDelayMs = 100;
 
@@ -179,6 +182,21 @@
   return ColorProfileType::DARK_MUTED;
 }
 
+// If |read_is_successful| is true, start decoding the image, which will run
+// |callback| upon completion; if it's false, run |callback| directly with an
+// empty image.
+void OnWallpaperDataRead(LoadedCallback callback,
+                         std::unique_ptr<std::string> data,
+                         bool read_is_successful) {
+  if (!read_is_successful) {
+    base::ThreadTaskRunnerHandle::Get()->PostTask(
+        FROM_HERE,
+        base::BindOnce(std::move(callback), base::Passed(gfx::ImageSkia())));
+  } else {
+    DecodeWallpaper(*data, std::move(callback));
+  }
+}
+
 // Deletes a list of wallpaper files in |file_list|.
 void DeleteWallpaperInList(const std::vector<base::FilePath>& file_list) {
   for (const base::FilePath& path : file_list) {
@@ -525,21 +543,6 @@
 }
 
 // static
-void WallpaperController::DecodeWallpaperIfApplicable(
-    LoadedCallback callback,
-    std::unique_ptr<std::string> data,
-    bool data_is_ready) {
-  // The connector for the mojo service manager is null in unit tests.
-  if (!data_is_ready || !Shell::Get()->shell_delegate()->GetShellConnector()) {
-    base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE,
-        base::BindOnce(std::move(callback), base::Passed(gfx::ImageSkia())));
-  } else {
-    DecodeWallpaper(std::move(data), std::move(callback));
-  }
-}
-
-// static
 gfx::ImageSkia WallpaperController::CreateSolidColorWallpaper() {
   SkBitmap bitmap;
   bitmap.allocN32Pixels(1, 1);
@@ -722,6 +725,7 @@
 void WallpaperController::SetWallpaperImage(const gfx::ImageSkia& image,
                                             const WallpaperInfo& info) {
   wallpaper::WallpaperLayout layout = info.layout;
+
   VLOG(1) << "SetWallpaper: image_id="
           << wallpaper::WallpaperResizer::GetImageId(image)
           << " layout=" << layout;
@@ -893,11 +897,15 @@
     scoped_refptr<base::SequencedTaskRunner> task_runner,
     const base::FilePath& file_path) {
   decode_requests_for_testing_.push_back(file_path);
+  if (bypass_decode_for_testing_) {
+    std::move(callback).Run(CreateSolidColorWallpaper());
+    return;
+  }
   std::string* data = new std::string;
   base::PostTaskAndReplyWithResult(
       task_runner.get(), FROM_HERE,
       base::Bind(&base::ReadFileToString, file_path, data),
-      base::Bind(&DecodeWallpaperIfApplicable, std::move(callback),
+      base::Bind(&OnWallpaperDataRead, callback,
                  base::Passed(base::WrapUnique(data))));
 }
 
@@ -1031,7 +1039,7 @@
   // |has_gaia_account| is unused.
   user_info->has_gaia_account = true;
   SaveAndSetWallpaper(std::move(user_info), wallpaper_files_id, file_name,
-                      image, wallpaper::CUSTOMIZED, layout, show_wallpaper);
+                      wallpaper::CUSTOMIZED, layout, show_wallpaper, image);
 }
 
 bool WallpaperController::GetWallpaperFromCache(const AccountId& account_id,
@@ -1073,22 +1081,13 @@
     const std::string& wallpaper_files_id,
     const std::string& file_name,
     wallpaper::WallpaperLayout layout,
-    wallpaper::WallpaperType type,
     const SkBitmap& image,
     bool show_wallpaper) {
-  // TODO(crbug.com/776464): Currently |SetCustomWallpaper| is used by both
-  // CUSTOMIZED and POLICY types, but it's better to separate them: a new
-  // |SetPolicyWallpaper| will be created so that the type parameter can be
-  // removed, and only a single |CanSetUserWallpaper| check is needed here.
-  if ((type != wallpaper::POLICY &&
-       IsPolicyControlled(user_info->account_id, !user_info->is_ephemeral)) ||
-      IsInKioskMode()) {
+  if (!CanSetUserWallpaper(user_info->account_id, !user_info->is_ephemeral))
     return;
-  }
-
   SaveAndSetWallpaper(std::move(user_info), wallpaper_files_id, file_name,
-                      gfx::ImageSkia::CreateFrom1xBitmap(image), type, layout,
-                      show_wallpaper);
+                      wallpaper::CUSTOMIZED, layout, show_wallpaper,
+                      gfx::ImageSkia::CreateFrom1xBitmap(image));
 }
 
 void WallpaperController::SetOnlineWallpaper(
@@ -1147,6 +1146,29 @@
   NOTIMPLEMENTED();
 }
 
+void WallpaperController::SetPolicyWallpaper(
+    mojom::WallpaperUserInfoPtr user_info,
+    const std::string& wallpaper_files_id,
+    const std::string& data) {
+  // There is no visible wallpaper in kiosk mode.
+  if (IsInKioskMode())
+    return;
+
+  // Updates the screen only when the user has logged in.
+  const bool show_wallpaper =
+      Shell::Get()->session_controller()->IsActiveUserSessionStarted();
+  LoadedCallback callback =
+      base::Bind(&WallpaperController::SaveAndSetWallpaper,
+                 weak_factory_.GetWeakPtr(), base::Passed(&user_info),
+                 wallpaper_files_id, kPolicyWallpaperFile, wallpaper::POLICY,
+                 wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, show_wallpaper);
+
+  if (bypass_decode_for_testing_)
+    std::move(callback).Run(CreateSolidColorWallpaper());
+  else
+    DecodeWallpaper(data, std::move(callback));
+}
+
 void WallpaperController::SetDeviceWallpaperPolicyEnforced(bool enforced) {
   bool previous_enforced = is_device_wallpaper_policy_enforced_;
   is_device_wallpaper_policy_enforced_ = enforced;
@@ -1285,6 +1307,19 @@
   RemoveUserWallpaperImpl(user_info->account_id, wallpaper_files_id);
 }
 
+void WallpaperController::RemovePolicyWallpaper(
+    mojom::WallpaperUserInfoPtr user_info,
+    const std::string& wallpaper_files_id) {
+  DCHECK(IsPolicyControlled(user_info->account_id, !user_info->is_ephemeral));
+  // Updates the screen only when the user has logged in.
+  const bool show_wallpaper =
+      Shell::Get()->session_controller()->IsActiveUserSessionStarted();
+  // Removes the wallpaper info so that the user is no longer policy controlled,
+  // otherwise setting default wallpaper is not allowed.
+  RemoveUserWallpaperInfo(user_info->account_id, !user_info->is_ephemeral);
+  SetDefaultWallpaper(std::move(user_info), wallpaper_files_id, show_wallpaper);
+}
+
 void WallpaperController::SetWallpaper(const SkBitmap& wallpaper,
                                        const WallpaperInfo& info) {
   if (wallpaper.isNull())
@@ -1563,7 +1598,7 @@
   }
 
   if (show_wallpaper) {
-    // 1x1 wallpaper is actually solid color, so it should be stretched.
+    // 1x1 wallpaper should be stretched.
     if (cached_default_wallpaper_.image.width() == 1 &&
         cached_default_wallpaper_.image.height() == 1) {
       layout = wallpaper::WALLPAPER_LAYOUT_STRETCH;
@@ -1578,14 +1613,15 @@
     mojom::WallpaperUserInfoPtr user_info,
     const std::string& wallpaper_files_id,
     const std::string& file_name,
-    const gfx::ImageSkia& image,
     wallpaper::WallpaperType type,
     wallpaper::WallpaperLayout layout,
-    bool show_wallpaper) {
-  // Empty image indicates decode failure. Use default wallpaper in this case.
+    bool show_wallpaper,
+    const gfx::ImageSkia& image) {
+  // If the image of the new wallpaper is empty, the current wallpaper is still
+  // kept instead of reverting to the default.
   if (image.isNull()) {
-    SetDefaultWallpaperImpl(user_info->account_id, user_info->type,
-                            show_wallpaper);
+    LOG(ERROR) << "The wallpaper image is empty due to a decoding failure, or "
+                  "the client provided an empty image.";
     return;
   }
 
diff --git a/ash/wallpaper/wallpaper_controller.h b/ash/wallpaper/wallpaper_controller.h
index bfef746..38c9c049 100644
--- a/ash/wallpaper/wallpaper_controller.h
+++ b/ash/wallpaper/wallpaper_controller.h
@@ -182,16 +182,6 @@
       const scoped_refptr<base::SingleThreadTaskRunner>& reply_task_runner,
       base::WeakPtr<WallpaperController> weak_ptr);
 
-  // If |data_is_ready| is true, start decoding the image, which will run
-  // |callback| upon completion; if it's false, run |callback| immediately with
-  // an empty image.
-  // TODO(crbug.com/776464): Mash and some unit tests can't use this decoder
-  // because it depends on the Shell instance. Make it work after all the
-  // decoding code is moved to //ash.
-  static void DecodeWallpaperIfApplicable(LoadedCallback callback,
-                                          std::unique_ptr<std::string> data,
-                                          bool data_is_ready);
-
   // Creates a 1x1 solid color image to be used as the backup default wallpaper.
   static gfx::ImageSkia CreateSolidColorWallpaper();
 
@@ -306,8 +296,8 @@
                                 bool compare_layouts,
                                 wallpaper::WallpaperLayout layout) const;
 
-  // Reads image from |file_path| on disk, and calls
-  // |DecodeWallpaperIfApplicable| with the result of |ReadFileToString|.
+  // Reads image from |file_path| on disk, and calls |OnWallpaperDataRead|
+  // with the result of |ReadFileToString|.
   void ReadAndDecodeWallpaper(
       LoadedCallback callback,
       scoped_refptr<base::SequencedTaskRunner> task_runner,
@@ -380,7 +370,6 @@
                           const std::string& wallpaper_files_id,
                           const std::string& file_name,
                           wallpaper::WallpaperLayout layout,
-                          wallpaper::WallpaperType type,
                           const SkBitmap& image,
                           bool show_wallpaper) override;
   void SetOnlineWallpaper(mojom::WallpaperUserInfoPtr user_info,
@@ -395,6 +384,9 @@
       const GURL& wallpaper_url,
       const base::FilePath& file_path,
       const base::FilePath& resized_directory) override;
+  void SetPolicyWallpaper(mojom::WallpaperUserInfoPtr user_info,
+                          const std::string& wallpaper_files_id,
+                          const std::string& data) override;
   void SetDeviceWallpaperPolicyEnforced(bool enforced) override;
   void UpdateCustomWallpaperLayout(mojom::WallpaperUserInfoPtr user_info,
                                    wallpaper::WallpaperLayout layout) override;
@@ -406,6 +398,8 @@
   void ShowSigninWallpaper() override;
   void RemoveUserWallpaper(mojom::WallpaperUserInfoPtr user_info,
                            const std::string& wallpaper_files_id) override;
+  void RemovePolicyWallpaper(mojom::WallpaperUserInfoPtr user_info,
+                             const std::string& wallpaper_files_id) override;
   void SetWallpaper(const SkBitmap& wallpaper,
                     const wallpaper::WallpaperInfo& wallpaper_info) override;
   void AddObserver(mojom::WallpaperObserverAssociatedPtrInfo observer) override;
@@ -486,10 +480,10 @@
   void SaveAndSetWallpaper(mojom::WallpaperUserInfoPtr user_info,
                            const std::string& wallpaper_files_id,
                            const std::string& file_name,
-                           const gfx::ImageSkia& image,
                            wallpaper::WallpaperType type,
                            wallpaper::WallpaperLayout layout,
-                           bool show_wallpaper);
+                           bool show_wallpaper,
+                           const gfx::ImageSkia& image);
 
   // A wrapper of |ReadAndDecodeWallpaper| used in |SetWallpaperFromPath|.
   void StartDecodeFromPath(const AccountId& account_id,
@@ -622,6 +616,9 @@
 
   std::unique_ptr<ui::CompositorLock> compositor_lock_;
 
+  // If true, use a solid color wallpaper as if it is the decoded image.
+  bool bypass_decode_for_testing_ = false;
+
   // Tracks how many wallpapers have been set.
   int wallpaper_count_for_testing_ = 0;
 
diff --git a/ash/wallpaper/wallpaper_controller_unittest.cc b/ash/wallpaper/wallpaper_controller_unittest.cc
index a8b9b10..c479625 100644
--- a/ash/wallpaper/wallpaper_controller_unittest.cc
+++ b/ash/wallpaper/wallpaper_controller_unittest.cc
@@ -465,6 +465,8 @@
 
   int GetWallpaperCount() { return controller_->wallpaper_count_for_testing_; }
 
+  void SetBypassDecode() { controller_->bypass_decode_for_testing_ = true; }
+
   void ClearWallpaperCount() { controller_->wallpaper_count_for_testing_ = 0; }
 
   void ClearDecodeFilePaths() {
@@ -829,14 +831,13 @@
 TEST_F(WallpaperControllerTest, SetCustomWallpaper) {
   gfx::ImageSkia image = CreateImage(640, 480, kWallpaperColor);
   WallpaperLayout layout = WALLPAPER_LAYOUT_CENTER;
-  wallpaper::WallpaperType type = wallpaper::CUSTOMIZED;
 
   SimulateUserLogin(user_1);
 
   // Verify the wallpaper is set successfully and wallpaper info is updated.
-  controller_->SetCustomWallpaper(
-      InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1, layout,
-      type, *image.bitmap(), true /*show_wallpaper=*/);
+  controller_->SetCustomWallpaper(InitializeUser(account_id_1),
+                                  wallpaper_files_id_1, file_name_1, layout,
+                                  *image.bitmap(), true /*show_wallpaper=*/);
   RunAllTasksUntilIdle();
   EXPECT_EQ(1, GetWallpaperCount());
   EXPECT_EQ(controller_->GetWallpaperType(), wallpaper::CUSTOMIZED);
@@ -845,14 +846,14 @@
                                                 true /* is_persistent */));
   wallpaper::WallpaperInfo expected_wallpaper_info(
       base::FilePath(wallpaper_files_id_1).Append(file_name_1).value(), layout,
-      type, base::Time::Now().LocalMidnight());
+      wallpaper::CUSTOMIZED, base::Time::Now().LocalMidnight());
   EXPECT_EQ(wallpaper_info, expected_wallpaper_info);
 
   // Verify that the wallpaper is not set when |show_wallpaper| is false, but
   // wallpaper info is updated properly.
-  controller_->SetCustomWallpaper(
-      InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1, layout,
-      type, *image.bitmap(), true /*show_wallpaper=*/);
+  controller_->SetCustomWallpaper(InitializeUser(account_id_1),
+                                  wallpaper_files_id_1, file_name_1, layout,
+                                  *image.bitmap(), true /*show_wallpaper=*/);
   RunAllTasksUntilIdle();
   EXPECT_EQ(0, GetWallpaperCount());
   EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info,
@@ -891,6 +892,73 @@
   EXPECT_EQ(wallpaper_info, expected_wallpaper_info);
 }
 
+TEST_F(WallpaperControllerTest, SetAndRemovePolicyWallpaper) {
+  SetBypassDecode();
+  // Simulate the login screen.
+  ClearLogin();
+
+  // The user starts with no wallpaper info and is not controlled by policy.
+  wallpaper::WallpaperInfo wallpaper_info;
+  EXPECT_FALSE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info,
+                                                 true /*is_persistent=*/));
+  EXPECT_FALSE(
+      controller_->IsPolicyControlled(account_id_1, true /*is_persistent=*/));
+  // A default wallpaper is shown for the user.
+  controller_->ShowUserWallpaper(InitializeUser(account_id_1));
+  EXPECT_EQ(1, GetWallpaperCount());
+  EXPECT_EQ(controller_->GetWallpaperType(), wallpaper::DEFAULT);
+
+  // Set a policy wallpaper. Verify that the user becomes policy controlled and
+  // the wallpaper info is updated.
+  controller_->SetPolicyWallpaper(InitializeUser(account_id_1),
+                                  wallpaper_files_id_1,
+                                  std::string() /*data=*/);
+  RunAllTasksUntilIdle();
+  EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info,
+                                                true /*is_persistent=*/));
+  wallpaper::WallpaperInfo policy_wallpaper_info(
+      base::FilePath(wallpaper_files_id_1)
+          .Append("policy-controlled.jpeg")
+          .value(),
+      wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, wallpaper::POLICY,
+      base::Time::Now().LocalMidnight());
+  EXPECT_EQ(wallpaper_info, policy_wallpaper_info);
+  EXPECT_TRUE(
+      controller_->IsPolicyControlled(account_id_1, true /*is_persistent=*/));
+  // Verify the wallpaper is not updated since the user hasn't logged in.
+  EXPECT_EQ(0, GetWallpaperCount());
+
+  // Log in the user. Verify the policy wallpaper is now being shown.
+  SimulateUserLogin(user_1);
+  controller_->ShowUserWallpaper(InitializeUser(account_id_1));
+  EXPECT_EQ(1, GetWallpaperCount());
+  EXPECT_EQ(controller_->GetWallpaperType(), wallpaper::POLICY);
+
+  // Log out the user and remove the policy wallpaper. Verify the wallpaper
+  // info is reset to default and the user is no longer policy controlled.
+  ClearLogin();
+  controller_->RemovePolicyWallpaper(InitializeUser(account_id_1),
+                                     wallpaper_files_id_1);
+  WaitUntilCustomWallpapersDeleted(account_id_1);
+  EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info,
+                                                true /*is_persistent=*/));
+  wallpaper::WallpaperInfo default_wallpaper_info(
+      std::string(), wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED,
+      wallpaper::DEFAULT, base::Time::Now().LocalMidnight());
+  EXPECT_EQ(wallpaper_info, default_wallpaper_info);
+  EXPECT_FALSE(
+      controller_->IsPolicyControlled(account_id_1, true /*is_persistent=*/));
+  // Verify the wallpaper is not updated since the user hasn't logged in.
+  EXPECT_EQ(0, GetWallpaperCount());
+  EXPECT_EQ(controller_->GetWallpaperType(), wallpaper::POLICY);
+
+  // Log in the user. Verify the default wallpaper is now being shown.
+  SimulateUserLogin(user_1);
+  controller_->ShowUserWallpaper(InitializeUser(account_id_1));
+  EXPECT_EQ(1, GetWallpaperCount());
+  EXPECT_EQ(controller_->GetWallpaperType(), wallpaper::DEFAULT);
+}
+
 TEST_F(WallpaperControllerTest, SetDefaultWallpaperForRegularAccount) {
   CreateDefaultWallpapers();
   SimulateUserLogin(user_1);
@@ -1064,8 +1132,7 @@
   // |account_id|'s wallpaper info is not updated.
   controller_->SetCustomWallpaper(
       InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1,
-      WALLPAPER_LAYOUT_CENTER, wallpaper::CUSTOMIZED, *image.bitmap(),
-      true /* show_wallpaper */);
+      WALLPAPER_LAYOUT_CENTER, *image.bitmap(), true /*show_wallpaper=*/);
   RunAllTasksUntilIdle();
   EXPECT_EQ(0, GetWallpaperCount());
   wallpaper::WallpaperInfo wallpaper_info;
@@ -1111,8 +1178,7 @@
   // enforced, and |account_id|'s wallpaper info is not updated.
   controller_->SetCustomWallpaper(
       InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1,
-      WALLPAPER_LAYOUT_CENTER, wallpaper::CUSTOMIZED, *image.bitmap(),
-      true /*show_wallpaper=*/);
+      WALLPAPER_LAYOUT_CENTER, *image.bitmap(), true /*show_wallpaper=*/);
   RunAllTasksUntilIdle();
   EXPECT_EQ(0, GetWallpaperCount());
   wallpaper::WallpaperInfo wallpaper_info;
@@ -1182,8 +1248,7 @@
   // Verify |SetCustomWallpaper| updates wallpaper cache for |user1|.
   controller_->SetCustomWallpaper(
       InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1,
-      WALLPAPER_LAYOUT_CENTER, wallpaper::CUSTOMIZED, *image.bitmap(),
-      true /*show_wallpaper=*/);
+      WALLPAPER_LAYOUT_CENTER, *image.bitmap(), true /*show_wallpaper=*/);
   RunAllTasksUntilIdle();
   EXPECT_TRUE(
       controller_->GetWallpaperFromCache(account_id_1, &cached_wallpaper));
@@ -1302,14 +1367,13 @@
 TEST_F(WallpaperControllerTest, UpdateCustomWallpaperLayout) {
   gfx::ImageSkia image = CreateImage(640, 480, kSmallCustomWallpaperColor);
   WallpaperLayout layout = WALLPAPER_LAYOUT_CENTER;
-  wallpaper::WallpaperType type = wallpaper::CUSTOMIZED;
   SimulateUserLogin(user_1);
 
   // Set a custom wallpaper for the user. Verify that it's set successfully
   // and the wallpaper info is updated.
-  controller_->SetCustomWallpaper(
-      InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1, layout,
-      type, *image.bitmap(), true /*show_wallpaper=*/);
+  controller_->SetCustomWallpaper(InitializeUser(account_id_1),
+                                  wallpaper_files_id_1, file_name_1, layout,
+                                  *image.bitmap(), true /*show_wallpaper=*/);
   RunAllTasksUntilIdle();
   EXPECT_EQ(1, GetWallpaperCount());
   EXPECT_EQ(controller_->GetWallpaperLayout(), layout);
@@ -1318,7 +1382,7 @@
                                                 true /* is_persistent */));
   wallpaper::WallpaperInfo expected_wallpaper_info(
       base::FilePath(wallpaper_files_id_1).Append(file_name_1).value(), layout,
-      type, base::Time::Now().LocalMidnight());
+      wallpaper::CUSTOMIZED, base::Time::Now().LocalMidnight());
   EXPECT_EQ(wallpaper_info, expected_wallpaper_info);
 
   // Now change to a different layout. Verify that the layout is updated for
diff --git a/ash/wallpaper/wallpaper_decoder.cc b/ash/wallpaper/wallpaper_decoder.cc
index 8f3f97b..aaeff7a6 100644
--- a/ash/wallpaper/wallpaper_decoder.cc
+++ b/ash/wallpaper/wallpaper_decoder.cc
@@ -6,7 +6,6 @@
 
 #include "ash/shell.h"
 #include "ash/shell_delegate.h"
-#include "base/sequenced_task_runner.h"
 #include "ipc/ipc_channel.h"
 #include "services/data_decoder/public/cpp/decode_image.h"
 
@@ -31,10 +30,14 @@
 
 }  // namespace
 
-void DecodeWallpaper(std::unique_ptr<std::string> image_data,
+void DecodeWallpaper(const std::string& image_data,
                      OnWallpaperDecoded callback) {
-  std::vector<uint8_t> image_bytes(image_data.get()->begin(),
-                                   image_data.get()->end());
+  // The connector for the mojo service manager is null in unit tests.
+  if (!Shell::Get()->shell_delegate()->GetShellConnector()) {
+    std::move(callback).Run(gfx::ImageSkia());
+    return;
+  }
+  std::vector<uint8_t> image_bytes(image_data.begin(), image_data.end());
   data_decoder::DecodeImage(
       Shell::Get()->shell_delegate()->GetShellConnector(),
       std::move(image_bytes), data_decoder::mojom::ImageCodec::ROBUST_JPEG,
diff --git a/ash/wallpaper/wallpaper_decoder.h b/ash/wallpaper/wallpaper_decoder.h
index 8f559aa..3964f10 100644
--- a/ash/wallpaper/wallpaper_decoder.h
+++ b/ash/wallpaper/wallpaper_decoder.h
@@ -20,7 +20,7 @@
 
 // Do an async wallpaper decode; |on_decoded| is run on the calling thread when
 // the decode has finished.
-ASH_EXPORT void DecodeWallpaper(std::unique_ptr<std::string> image_data,
+ASH_EXPORT void DecodeWallpaper(const std::string& image_data,
                                 OnWallpaperDecoded callback);
 
 }  // namespace ash
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index 678baa5..e6443a3e 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -2535,8 +2535,8 @@
   EXPECT_EQ(split_view_controller()->right_window(), window2.get());
   EndSplitView();
 
-  // Rotate the screen by 90 degree.
-  test_api.SetDisplayRotation(display::Display::ROTATE_90,
+  // Rotate the screen by 270 degree.
+  test_api.SetDisplayRotation(display::Display::ROTATE_270,
                               display::Display::ROTATION_SOURCE_ACTIVE);
   EXPECT_EQ(test_api.GetCurrentOrientation(),
             blink::kWebScreenOrientationLockPortraitPrimary);
@@ -2585,8 +2585,8 @@
   EXPECT_EQ(split_view_controller()->left_window(), window2.get());
   EndSplitView();
 
-  // Rotate the screen by 270 degree.
-  test_api.SetDisplayRotation(display::Display::ROTATE_270,
+  // Rotate the screen by 90 degree.
+  test_api.SetDisplayRotation(display::Display::ROTATE_90,
                               display::Display::ROTATION_SOURCE_ACTIVE);
   EXPECT_EQ(test_api.GetCurrentOrientation(),
             blink::kWebScreenOrientationLockPortraitSecondary);
diff --git a/ash/wm/splitview/split_view_controller_unittest.cc b/ash/wm/splitview/split_view_controller_unittest.cc
index db104c6..12e9616 100644
--- a/ash/wm/splitview/split_view_controller_unittest.cc
+++ b/ash/wm/splitview/split_view_controller_unittest.cc
@@ -807,8 +807,8 @@
   EXPECT_EQ(bounds_window1.height(), bounds_divider.height());
   EXPECT_EQ(bounds_window1.height(), bounds_window2.height());
 
-  // Rotate the screen by 90 degree.
-  test_api.SetDisplayRotation(display::Display::ROTATE_90,
+  // Rotate the screen by 270 degree.
+  test_api.SetDisplayRotation(display::Display::ROTATE_270,
                               display::Display::ROTATION_SOURCE_ACTIVE);
   EXPECT_EQ(test_api.GetCurrentOrientation(),
             blink::kWebScreenOrientationLockPortraitPrimary);
@@ -843,8 +843,8 @@
   EXPECT_EQ(bounds_window1.height(), bounds_divider.height());
   EXPECT_EQ(bounds_window1.height(), bounds_window2.height());
 
-  // Rotate the screen by 270 degree.
-  test_api.SetDisplayRotation(display::Display::ROTATE_270,
+  // Rotate the screen by 90 degree.
+  test_api.SetDisplayRotation(display::Display::ROTATE_90,
                               display::Display::ROTATION_SOURCE_ACTIVE);
   EXPECT_EQ(test_api.GetCurrentOrientation(),
             blink::kWebScreenOrientationLockPortraitSecondary);
@@ -953,8 +953,8 @@
             window1->delegate()->GetMinimumSize().width());
   EndSplitView();
 
-  // Rotate the screen by 90 degree.
-  test_api.SetDisplayRotation(display::Display::ROTATE_90,
+  // Rotate the screen by 270 degree.
+  test_api.SetDisplayRotation(display::Display::ROTATE_270,
                               display::Display::ROTATION_SOURCE_ACTIVE);
   EXPECT_EQ(test_api.GetCurrentOrientation(),
             blink::kWebScreenOrientationLockPortraitPrimary);
@@ -1006,8 +1006,8 @@
             window1->delegate()->GetMinimumSize().width());
   EndSplitView();
 
-  // Rotate the screen by 270 degree.
-  test_api.SetDisplayRotation(display::Display::ROTATE_270,
+  // Rotate the screen by 90 degree.
+  test_api.SetDisplayRotation(display::Display::ROTATE_90,
                               display::Display::ROTATION_SOURCE_ACTIVE);
   EXPECT_EQ(test_api.GetCurrentOrientation(),
             blink::kWebScreenOrientationLockPortraitSecondary);
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 379e82bf..36802f1 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1223,6 +1223,7 @@
     sources += [
       "memory/shared_memory_android.cc",
       "memory/shared_memory_handle_android.cc",
+      "time/time_android.cc",
     ]
 
     # Android uses some Linux sources, put those back.
@@ -1277,6 +1278,7 @@
 
     sources += [
       "base_paths_fuchsia.cc",
+      "base_paths_fuchsia.h",
       "debug/stack_trace_fuchsia.cc",
       "files/file_path_watcher_fuchsia.cc",
       "fuchsia/default_job.cc",
diff --git a/base/allocator/partition_allocator/spin_lock.cc b/base/allocator/partition_allocator/spin_lock.cc
index fd062c3..a9a3086 100644
--- a/base/allocator/partition_allocator/spin_lock.cc
+++ b/base/allocator/partition_allocator/spin_lock.cc
@@ -64,6 +64,9 @@
 namespace base {
 namespace subtle {
 
+SpinLock::SpinLock() = default;
+SpinLock::~SpinLock() = default;
+
 void SpinLock::LockSlow() {
   // The value of |kYieldProcessorTries| is cargo culted from TCMalloc, Windows
   // critical section defaults, and various other recommendations.
diff --git a/base/allocator/partition_allocator/spin_lock.h b/base/allocator/partition_allocator/spin_lock.h
index e698b56..d0afc47 100644
--- a/base/allocator/partition_allocator/spin_lock.h
+++ b/base/allocator/partition_allocator/spin_lock.h
@@ -22,8 +22,8 @@
 
 class BASE_EXPORT SpinLock {
  public:
-  constexpr SpinLock() = default;
-  ~SpinLock() = default;
+  SpinLock();
+  ~SpinLock();
   using Guard = std::lock_guard<SpinLock>;
 
   ALWAYS_INLINE void lock() {
diff --git a/base/android/scoped_java_ref.h b/base/android/scoped_java_ref.h
index 8bb18d4..1ff0229 100644
--- a/base/android/scoped_java_ref.h
+++ b/base/android/scoped_java_ref.h
@@ -45,12 +45,12 @@
 class BASE_EXPORT JavaRef<jobject> {
  public:
   // Initializes a null reference. Don't add anything else here; it's inlined.
-  constexpr JavaRef() : obj_(nullptr) {}
+  JavaRef() : obj_(nullptr) {}
 
   // Allow nullptr to be converted to JavaRef. This avoids having to declare an
   // empty JavaRef just to pass null to a function, and makes C++ "nullptr" and
   // Java "null" equivalent.
-  constexpr JavaRef(std::nullptr_t) : JavaRef() {}
+  JavaRef(std::nullptr_t) : JavaRef() {}
 
   // Public to allow destruction of null JavaRef objects.
   // Don't add anything else here; it's inlined.
@@ -146,8 +146,8 @@
 template<typename T>
 class ScopedJavaLocalRef : public JavaRef<T> {
  public:
-  constexpr ScopedJavaLocalRef() : env_(nullptr) {}
-  constexpr ScopedJavaLocalRef(std::nullptr_t) : env_(nullptr) {}
+  ScopedJavaLocalRef() : env_(nullptr) {}
+  ScopedJavaLocalRef(std::nullptr_t) : env_(nullptr) {}
 
   // Non-explicit copy constructor, to allow ScopedJavaLocalRef to be returned
   // by value as this is the normal usage pattern.
@@ -234,8 +234,8 @@
 template<typename T>
 class ScopedJavaGlobalRef : public JavaRef<T> {
  public:
-  constexpr ScopedJavaGlobalRef() {}
-  constexpr ScopedJavaGlobalRef(std::nullptr_t) {}
+  ScopedJavaGlobalRef() {}
+  ScopedJavaGlobalRef(std::nullptr_t) {}
 
   ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) {
     this->Reset(other);
diff --git a/base/base_paths_fuchsia.cc b/base/base_paths_fuchsia.cc
index 41883d9..0317929 100644
--- a/base/base_paths_fuchsia.cc
+++ b/base/base_paths_fuchsia.cc
@@ -6,41 +6,54 @@
 
 #include <stdlib.h>
 
+#include "base/base_paths_fuchsia.h"
 #include "base/command_line.h"
-#include "base/files/file_path.h"
+#include "base/files/file_util.h"
+#include "base/path_service.h"
+#include "base/process/process.h"
 
 namespace base {
+namespace {
+
+constexpr char kPackageRoot[] = "/pkg";
+
+}  // namespace
+
+base::FilePath GetPackageRoot() {
+  base::FilePath path_obj(kPackageRoot);
+  if (PathExists(path_obj)) {
+    return path_obj;
+  } else {
+    return base::FilePath();
+  }
+}
 
 bool PathProviderFuchsia(int key, FilePath* result) {
   switch (key) {
     case FILE_MODULE:
-    // Not supported in debug or component builds. Fall back on using the EXE
-    // path for now.
-    // TODO(fuchsia): Get this value from an API. See crbug.com/726124
+      NOTIMPLEMENTED();
+      return false;
     case FILE_EXE: {
-      // Use the binary name as specified on the command line.
-      // TODO(fuchsia): It would be nice to get the canonical executable path
-      // from a kernel API. See https://crbug.com/726124
-      char bin_dir[PATH_MAX + 1];
-      if (realpath(base::CommandLine::ForCurrentProcess()
-                       ->GetProgram()
-                       .AsUTF8Unsafe()
-                       .c_str(),
-                   bin_dir) == NULL) {
-        return false;
-      }
-      *result = FilePath(bin_dir);
+      *result = base::MakeAbsoluteFilePath(base::FilePath(
+          base::CommandLine::ForCurrentProcess()->GetProgram().AsUTF8Unsafe()));
       return true;
     }
     case DIR_SOURCE_ROOT:
-      // This is only used for tests, so we return the binary location for now.
-      *result = FilePath("/system");
+      *result = GetPackageRoot();
+      if (result->empty()) {
+        *result = FilePath("/system");
+      }
       return true;
     case DIR_CACHE:
       *result = FilePath("/data");
       return true;
+    case DIR_FUCHSIA_RESOURCES:
+      *result = GetPackageRoot();
+      if (result->empty()) {
+        PathService::Get(DIR_EXE, result);
+      }
+      return true;
   }
-
   return false;
 }
 
diff --git a/base/base_paths_fuchsia.h b/base/base_paths_fuchsia.h
new file mode 100644
index 0000000..0720c311
--- /dev/null
+++ b/base/base_paths_fuchsia.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_BASE_PATHS_FUCHSIA_H_
+#define BASE_BASE_PATHS_FUCHSIA_H_
+
+#include "base/base_export.h"
+#include "base/files/file_path.h"
+
+namespace base {
+
+// These can be used with the PathService to access various special
+// directories and files.
+enum {
+  PATH_FUCHSIA_START = 1200,
+
+  // Path to the directory which contains application libraries and resources.
+  DIR_FUCHSIA_RESOURCES,
+
+  PATH_FUCHSIA_END,
+};
+
+// If running inside a package, returns a FilePath of the root path
+// of the currently deployed package.
+// Otherwise returns an empty FilePath.
+BASE_EXPORT base::FilePath GetPackageRoot();
+
+}  // namespace base
+
+#endif  // BASE_BASE_PATHS_FUCHSIA_H_
diff --git a/base/containers/circular_deque.h b/base/containers/circular_deque.h
index bf42a95..688ef89 100644
--- a/base/containers/circular_deque.h
+++ b/base/containers/circular_deque.h
@@ -417,7 +417,7 @@
   // ---------------------------------------------------------------------------
   // Constructor
 
-  constexpr circular_deque() = default;
+  circular_deque() = default;
 
   // Constructs with |count| copies of |value| or default constructed version.
   circular_deque(size_type count) { resize(count); }
diff --git a/base/containers/vector_buffer.h b/base/containers/vector_buffer.h
index a72c1ed..5b305523a 100644
--- a/base/containers/vector_buffer.h
+++ b/base/containers/vector_buffer.h
@@ -37,7 +37,7 @@
 template <typename T>
 class VectorBuffer {
  public:
-  constexpr VectorBuffer() = default;
+  VectorBuffer() = default;
 
 #if defined(__clang__) && !defined(__native_client__)
   // This constructor converts an uninitialized void* to a T* which triggers
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc
index 4a1327b..1d84fd08 100644
--- a/base/i18n/icu_util.cc
+++ b/base/i18n/icu_util.cc
@@ -37,6 +37,10 @@
 #include "base/mac/foundation_util.h"
 #endif
 
+#if defined(OS_FUCHSIA)
+#include "base/base_paths_fuchsia.h"
+#endif
+
 namespace base {
 namespace i18n {
 
@@ -107,6 +111,8 @@
   CHECK(path_ok);  // TODO(scottmg): http://crbug.com/445616
 #elif defined(OS_ANDROID)
   bool path_ok = PathService::Get(DIR_ANDROID_APP_DATA, &data_path);
+#elif defined(OS_FUCHSIA)
+  bool path_ok = PathService::Get(DIR_FUCHSIA_RESOURCES, &data_path);
 #else
   // For now, expect the data file to be alongside the executable.
   // This is sufficient while we work on unit tests, but will eventually
diff --git a/base/lazy_instance_helpers.cc b/base/lazy_instance_helpers.cc
index 38ea6f1..7b9e0de 100644
--- a/base/lazy_instance_helpers.cc
+++ b/base/lazy_instance_helpers.cc
@@ -29,9 +29,9 @@
   // the associated data (buf_). Pairing Release_Store is in
   // CompleteLazyInstance().
   if (subtle::Acquire_Load(state) == kLazyInstanceStateCreating) {
-    const base::Time start = base::Time::Now();
+    const base::TimeTicks start = base::TimeTicks::Now();
     do {
-      const base::TimeDelta elapsed = base::Time::Now() - start;
+      const base::TimeDelta elapsed = base::TimeTicks::Now() - start;
       // Spin with YieldCurrentThread for at most one ms - this ensures maximum
       // responsiveness. After that spin with Sleep(1ms) so that we don't burn
       // excessive CPU time - this also avoids infinite loops due to priority
diff --git a/base/mac/scoped_dispatch_object.h b/base/mac/scoped_dispatch_object.h
index cd2daf2..5f5d517d 100644
--- a/base/mac/scoped_dispatch_object.h
+++ b/base/mac/scoped_dispatch_object.h
@@ -15,7 +15,7 @@
 
 template <typename T>
 struct ScopedDispatchObjectTraits {
-  static constexpr T InvalidValue() { return nullptr; }
+  static T InvalidValue() { return nullptr; }
   static T Retain(T object) {
     dispatch_retain(object);
     return object;
diff --git a/base/mac/scoped_nsobject.h b/base/mac/scoped_nsobject.h
index d970d03..ecd8e78 100644
--- a/base/mac/scoped_nsobject.h
+++ b/base/mac/scoped_nsobject.h
@@ -85,12 +85,12 @@
   using Traits = internal::ScopedNSProtocolTraits<NST>;
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
-  explicit constexpr scoped_nsprotocol(
+  explicit scoped_nsprotocol(
       NST object = Traits::InvalidValue(),
       base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
       : ScopedTypeRef<NST, Traits>(object, policy) {}
 #else
-  explicit constexpr scoped_nsprotocol(NST object = Traits::InvalidValue())
+  explicit scoped_nsprotocol(NST object = Traits::InvalidValue())
       : ScopedTypeRef<NST, Traits>(object, base::scoped_policy::RETAIN) {}
 #endif
 
@@ -149,12 +149,12 @@
   using Traits = typename scoped_nsprotocol<NST*>::Traits;
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
-  explicit constexpr scoped_nsobject(
+  explicit scoped_nsobject(
       NST* object = Traits::InvalidValue(),
       base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
       : scoped_nsprotocol<NST*>(object, policy) {}
 #else
-  explicit constexpr scoped_nsobject(NST* object = Traits::InvalidValue())
+  explicit scoped_nsobject(NST* object = Traits::InvalidValue())
       : scoped_nsprotocol<NST*>(object) {}
 #endif
 
@@ -198,12 +198,12 @@
   using Traits = typename scoped_nsprotocol<id>::Traits;
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
-  explicit constexpr scoped_nsobject(
+  explicit scoped_nsobject(
       id object = Traits::InvalidValue(),
       base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
       : scoped_nsprotocol<id>(object, policy) {}
 #else
-  explicit constexpr scoped_nsobject(id object = Traits::InvalidValue())
+  explicit scoped_nsobject(id object = Traits::InvalidValue())
       : scoped_nsprotocol<id>(object) {}
 #endif
 
diff --git a/base/mac/scoped_typeref.h b/base/mac/scoped_typeref.h
index dd9841d734..b8d8a14 100644
--- a/base/mac/scoped_typeref.h
+++ b/base/mac/scoped_typeref.h
@@ -53,7 +53,7 @@
  public:
   typedef T element_type;
 
-  explicit constexpr ScopedTypeRef(
+  explicit ScopedTypeRef(
       __unsafe_unretained T object = Traits::InvalidValue(),
       base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME)
       : object_(object) {
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index 249f70e0..5e1e8ad 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -148,9 +148,8 @@
   bool HasOneRef() const;
 
  protected:
-  explicit constexpr RefCountedThreadSafeBase(StartRefCountFromZeroTag) {}
-  explicit constexpr RefCountedThreadSafeBase(StartRefCountFromOneTag)
-      : ref_count_(1) {
+  explicit RefCountedThreadSafeBase(StartRefCountFromZeroTag) {}
+  explicit RefCountedThreadSafeBase(StartRefCountFromOneTag) : ref_count_(1) {
 #if DCHECK_IS_ON()
     needs_adopt_ref_ = true;
 #endif
diff --git a/base/strings/pattern.cc b/base/strings/pattern.cc
index c1abf5d..f3de0afd 100644
--- a/base/strings/pattern.cc
+++ b/base/strings/pattern.cc
@@ -10,7 +10,7 @@
 
 namespace {
 
-bool IsWildcard(base_icu::UChar32 character) {
+constexpr bool IsWildcard(base_icu::UChar32 character) {
   return character == '*' || character == '?';
 }
 
@@ -19,12 +19,12 @@
 // the first wildcard character (or the end of the string). If the value of
 // |maximum_distance| is negative, the maximum distance is considered infinite.
 template <typename CHAR, typename NEXT>
-bool SearchForChars(const CHAR** pattern,
-                    const CHAR* pattern_end,
-                    const CHAR** string,
-                    const CHAR* string_end,
-                    int maximum_distance,
-                    NEXT next) {
+constexpr bool SearchForChars(const CHAR** pattern,
+                              const CHAR* pattern_end,
+                              const CHAR** string,
+                              const CHAR* string_end,
+                              int maximum_distance,
+                              NEXT next) {
   const CHAR* pattern_start = *pattern;
   const CHAR* string_start = *string;
   bool escape = false;
@@ -87,7 +87,7 @@
 // match an arbitrary number of characters (which is the case if it contains at
 // least one *).
 template <typename CHAR, typename NEXT>
-int EatWildcards(const CHAR** pattern, const CHAR* end, NEXT next) {
+constexpr int EatWildcards(const CHAR** pattern, const CHAR* end, NEXT next) {
   int num_question_marks = 0;
   bool has_asterisk = false;
   while (*pattern != end) {
@@ -105,11 +105,11 @@
 }
 
 template <typename CHAR, typename NEXT>
-bool MatchPatternT(const CHAR* eval,
-                   const CHAR* eval_end,
-                   const CHAR* pattern,
-                   const CHAR* pattern_end,
-                   NEXT next) {
+constexpr bool MatchPatternT(const CHAR* eval,
+                             const CHAR* eval_end,
+                             const CHAR* pattern,
+                             const CHAR* pattern_end,
+                             NEXT next) {
   do {
     int maximum_wildcard_length = EatWildcards(&pattern, pattern_end, next);
     if (!SearchForChars(&pattern, pattern_end, &eval, eval_end,
diff --git a/base/test/test_discardable_memory_allocator.cc b/base/test/test_discardable_memory_allocator.cc
index a9bd097..37397d8 100644
--- a/base/test/test_discardable_memory_allocator.cc
+++ b/base/test/test_discardable_memory_allocator.cc
@@ -53,6 +53,10 @@
 
 }  // namespace
 
+TestDiscardableMemoryAllocator::TestDiscardableMemoryAllocator() = default;
+
+TestDiscardableMemoryAllocator::~TestDiscardableMemoryAllocator() = default;
+
 std::unique_ptr<DiscardableMemory>
 TestDiscardableMemoryAllocator::AllocateLockedDiscardableMemory(size_t size) {
   return std::make_unique<DiscardableMemoryImpl>(size);
diff --git a/base/test/test_discardable_memory_allocator.h b/base/test/test_discardable_memory_allocator.h
index 87436e3b..a6a4351f 100644
--- a/base/test/test_discardable_memory_allocator.h
+++ b/base/test/test_discardable_memory_allocator.h
@@ -17,7 +17,8 @@
 // DiscardableMemory instances backed by heap memory.
 class TestDiscardableMemoryAllocator : public DiscardableMemoryAllocator {
  public:
-  constexpr TestDiscardableMemoryAllocator() = default;
+  TestDiscardableMemoryAllocator();
+  ~TestDiscardableMemoryAllocator() override;
 
   // Overridden from DiscardableMemoryAllocator:
   std::unique_ptr<DiscardableMemory> AllocateLockedDiscardableMemory(
diff --git a/base/threading/platform_thread.h b/base/threading/platform_thread.h
index 7637e00..da58d0cf 100644
--- a/base/threading/platform_thread.h
+++ b/base/threading/platform_thread.h
@@ -55,9 +55,13 @@
 #elif defined(OS_POSIX)
   typedef pthread_t RefType;
 #endif
-  constexpr PlatformThreadRef() : id_(0) {}
+  PlatformThreadRef()
+      : id_(0) {
+  }
 
-  explicit constexpr PlatformThreadRef(RefType id) : id_(id) {}
+  explicit PlatformThreadRef(RefType id)
+      : id_(id) {
+  }
 
   bool operator==(PlatformThreadRef other) const {
     return id_ == other.id_;
@@ -81,9 +85,9 @@
   typedef pthread_t Handle;
 #endif
 
-  constexpr PlatformThreadHandle() : handle_(0) {}
+  PlatformThreadHandle() : handle_(0) {}
 
-  explicit constexpr PlatformThreadHandle(Handle handle) : handle_(handle) {}
+  explicit PlatformThreadHandle(Handle handle) : handle_(handle) {}
 
   bool is_equal(const PlatformThreadHandle& other) const {
     return handle_ == other.handle_;
diff --git a/base/time/time.h b/base/time/time.h
index fd9afa2..15e20904 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -73,6 +73,10 @@
 #undef TYPE_BOOL
 #endif
 
+#if defined(OS_ANDROID)
+#include <jni.h>
+#endif
+
 #if defined(OS_POSIX)
 #include <unistd.h>
 #include <sys/time.h>
@@ -827,6 +831,14 @@
   static TimeTicks FromMachAbsoluteTime(uint64_t mach_absolute_time);
 #endif  // defined(OS_MACOSX) && !defined(OS_IOS)
 
+#if defined(OS_ANDROID)
+  // Converts to TimeTicks the value obtained from SystemClock.uptimeMillis().
+  // Note: this convertion may be non-monotonic in relation to previously
+  // obtained TimeTicks::Now() values because of the truncation (to
+  // milliseconds) performed by uptimeMillis().
+  static TimeTicks FromUptimeMillis(jlong uptime_millis_value);
+#endif
+
   // Get an estimate of the TimeTick value at the time of the UnixEpoch. Because
   // Time and TimeTicks respond differently to user-set time and NTP
   // adjustments, this number is only an estimate. Nevertheless, this can be
diff --git a/base/time/time_android.cc b/base/time/time_android.cc
new file mode 100644
index 0000000..e0c4914
--- /dev/null
+++ b/base/time/time_android.cc
@@ -0,0 +1,26 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/time/time.h"
+
+namespace base {
+
+// static
+TimeTicks TimeTicks::FromUptimeMillis(jlong uptime_millis_value) {
+  // The implementation of the SystemClock.uptimeMillis() in AOSP uses the same
+  // clock as base::TimeTicks::Now(): clock_gettime(CLOCK_MONOTONIC), see in
+  // platform/system/code:
+  // 1. libutils/SystemClock.cpp
+  // 2. libutils/Timers.cpp
+  //
+  // We are not aware of any motivations for Android OEMs to modify the AOSP
+  // implementation of either uptimeMillis() or clock_gettime(CLOCK_MONOTONIC),
+  // so we assume that there are no such customizations.
+  //
+  // Under these assumptions the conversion is as safe as copying the value of
+  // base::TimeTicks::Now() with a loss of sub-millisecond precision.
+  return TimeTicks(uptime_millis_value * Time::kMicrosecondsPerMillisecond);
+}
+
+}  // namespace base
diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc
index 4f73535..84d2e23 100644
--- a/base/time/time_unittest.cc
+++ b/base/time/time_unittest.cc
@@ -17,7 +17,9 @@
 #include "build/build_config.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#if defined(OS_IOS)
+#if defined(OS_ANDROID)
+#include "base/android/jni_android.h"
+#elif defined(OS_IOS)
 #include "base/ios/ios_util.h"
 #elif defined(OS_WIN)
 #include <windows.h>
@@ -900,6 +902,28 @@
                 .ToInternalValue());
 }
 
+#if defined(OS_ANDROID)
+TEST(TimeTicks, Android_FromUptimeMillis_ClocksMatch) {
+  JNIEnv* const env = android::AttachCurrentThread();
+  android::ScopedJavaLocalRef<jclass> clazz(
+      android::GetClass(env, "android/os/SystemClock"));
+  ASSERT_TRUE(clazz.obj());
+  const jmethodID method_id =
+      android::MethodID::Get<android::MethodID::TYPE_STATIC>(
+          env, clazz.obj(), "uptimeMillis", "()J");
+  ASSERT_FALSE(!method_id);
+  // Subtract 1ms from the expected lower bound to allow millisecon-level
+  // truncation performed in uptimeMillis().
+  const TimeTicks lower_bound_ticks =
+      TimeTicks::Now() - TimeDelta::FromMilliseconds(1);
+  const TimeTicks converted_ticks = TimeTicks::FromUptimeMillis(
+      env->CallStaticLongMethod(clazz.obj(), method_id));
+  const TimeTicks upper_bound_ticks = TimeTicks::Now();
+  EXPECT_LE(lower_bound_ticks, converted_ticks);
+  EXPECT_GE(upper_bound_ticks, converted_ticks);
+}
+#endif  // OS_ANDROID
+
 TEST(TimeDelta, FromAndIn) {
   // static_assert also checks that the contained expression is a constant
   // expression, meaning all its components are suitable for initializing global
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py
index 79e47e1..46e9ec3 100755
--- a/build/android/gyp/javac.py
+++ b/build/android/gyp/javac.py
@@ -27,8 +27,6 @@
   'SynchronizeOnNonFinalField',
   # TODO(crbug.com/801253): Follow steps in bug.
   'JavaLangClash',
-  # TODO(crbug.com/801256): Follow steps in bug.
-  'ParameterName',
   # TODO(crbug.com/801261): Follow steps in bug
   'ArgumentSelectionDefectChecker',
   # TODO(crbug.com/801268): Follow steps in bug.
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 4e464d8..e65241b 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -588,7 +588,7 @@
 
     # Disable optimization for now because they increase binary size by too
     # much.
-    if (use_lld && (is_android || is_linux)) {
+    if (use_lld && (is_android || (is_linux && !is_chromeos))) {
       ldflags += [ "-Wl,--lto-O0" ]
     }
 
diff --git a/build/config/fuchsia/build_manifest.py b/build/config/fuchsia/build_manifest.py
new file mode 100644
index 0000000..ead8e0b0
--- /dev/null
+++ b/build/config/fuchsia/build_manifest.py
@@ -0,0 +1,108 @@
+# Copyright 2018 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.
+
+"""Creates a archive manifest used for Fuchsia package generation.
+
+Arguments:
+  root_dir: The absolute path to the Chromium source tree root.
+
+  out_dir: The absolute path to the Chromium build directory.
+
+  app_name: The filename of the package's executable target.
+
+  runtime_deps: The path to the GN runtime deps file.
+
+  output_path: The path of the manifest file which will be written.
+"""
+
+import json
+import os
+import sys
+import tempfile
+
+
+# Path to file describing the services to be made available to the process.
+SANDBOX_POLICY_PATH = 'build/config/fuchsia/sandbox_policy'
+
+
+def MakePackagePath(file_path, roots):
+  """Computes a path for |file_path| that is relative to one of the directory
+  paths in |roots|.
+
+  file_path: The absolute file path to relativize.
+  roots: A list of absolute directory paths which may serve as a relative root
+         for |file_path|. At least one path must contain |file_path|.
+         Overlapping roots are permitted; the deepest matching root will be
+         chosen.
+
+  Examples:
+
+  >>> MakePackagePath('/foo/bar.txt', ['/foo/'])
+  'bar.txt'
+
+  >>> MakePackagePath('/foo/dir/bar.txt', ['/foo/'])
+  'dir/bar.txt'
+
+  >>> MakePackagePath('/foo/out/Debug/bar.exe', ['/foo/', '/foo/out/Debug/'])
+  'bar.exe'
+  """
+
+  # Prevents greedily matching against a shallow path when a deeper, better
+  # matching path exists.
+  roots.sort(key=len, reverse=True)
+
+  for next_root in roots:
+    if not next_root.endswith(os.sep):
+      next_root += os.sep
+
+    if file_path.startswith(next_root):
+      relative_path = file_path[len(next_root):]
+
+      # TODO(fuchsia): The requirements for finding/loading .so are in flux, so
+      # this ought to be reconsidered at some point.
+      # See https://crbug.com/732897.
+      if file_path.endswith('.so'):
+        relative_path = 'lib/' + os.path.basename(relative_path)
+
+      return relative_path
+
+  sys.stderr.write(
+      'Error: no matching root paths found for \'%s\'.' % file_path)
+  assert False
+
+
+def BuildManifest(root_dir, out_dir, app_name, runtime_deps_file, output_path):
+  with open(output_path, "w") as output:
+    # Process the runtime deps file for file paths, recursively walking
+    # directories as needed.
+    # runtime_deps may contain duplicate paths, so use a set for
+    # de-duplication.
+    expanded_files = set()
+    for next_path in open(runtime_deps_file, 'r'):
+      next_path = next_path.strip()
+      if os.path.isdir(next_path):
+        for root, _, files in os.walk(next_path):
+          for next_file in files:
+            expanded_files.add(os.path.abspath(os.path.join(root, next_file)))
+      else:
+        expanded_files.add(os.path.abspath(next_path))
+
+    # Format and write out the manifest contents.
+    app_found = False
+    for next_file in expanded_files:
+      in_package_path = MakePackagePath(os.path.join(out_dir, next_file),
+                                        [root_dir, out_dir])
+      if in_package_path == app_name:
+        in_package_path = 'bin/app'
+        app_found = True
+      output.write('%s=%s\n' % (in_package_path, next_file))
+    assert app_found
+    output.write('meta/sandbox=%s%s' % (root_dir, SANDBOX_POLICY_PATH))
+
+  return 0
+
+
+if __name__ == '__main__':
+  sys.exit(BuildManifest(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4],
+                         sys.argv[5]))
diff --git a/build/config/fuchsia/package.gni b/build/config/fuchsia/package.gni
new file mode 100644
index 0000000..1e0bbe6
--- /dev/null
+++ b/build/config/fuchsia/package.gni
@@ -0,0 +1,95 @@
+# Copyright 2018 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.
+
+# Creates a Fuchsia .far package file.
+#
+# Parameters are:
+# target_name: The name of the package to build.
+# binary: the executable target which should be launched by the package.
+#         Will be renamed as "bin/app" in the package contents.
+template("package") {
+  pkg = {
+    package_name = target_name
+    forward_variables_from(invoker, "*")
+  }
+  assert(defined(pkg.binary))
+
+  _runtime_deps_file = "$root_out_dir/gen.runtime/${pkg.package_name}/" +
+                       "${pkg.package_name}.runtime_deps"
+  _manifest_file = "$root_out_dir/gen.runtime/${pkg.package_name}/" +
+                   "${pkg.package_name}.archive_manifest"
+  _write_manifest_target = "${pkg.package_name}__write_manifest"
+  _write_archive_target = "${pkg.package_name}__write_archive"
+  _pkg_out_dir = "$root_build_dir/package"
+
+  # Generates a manifest file based on the GN runtime deps
+  # suitable for "far" tool consumption.
+  action(_write_manifest_target) {
+    forward_variables_from(invoker,
+                           [
+                             "data",
+                             "data_deps",
+                             "deps",
+                             "public_deps",
+                             "testonly",
+                           ])
+
+    script = "//build/config/fuchsia/build_manifest.py"
+    inputs = [
+      _runtime_deps_file,
+    ]
+    outputs = [
+      _manifest_file,
+    ]
+
+    args = [
+      rebase_path("//"),
+      rebase_path(root_out_dir),
+      pkg.binary,
+      rebase_path(_runtime_deps_file),
+      rebase_path(_manifest_file),
+    ]
+
+    write_runtime_deps = _runtime_deps_file
+  }
+
+  # Packages an executable target and its dependencies into a Fuchsia archive
+  # file (.far).
+  action(_write_archive_target) {
+    forward_variables_from(invoker,
+                           [
+                             "testonly",
+                             "data_deps",
+                           ])
+
+    far_tool_path = "//third_party/fuchsia-sdk/tools/far"
+    archive_path = "$_pkg_out_dir/${pkg.package_name}.far"
+    script = "//build/gn_run_binary.py"
+    depfile = "$target_gen_dir/$target_name.d"
+
+    deps = [
+      ":$_write_manifest_target",
+    ]
+
+    outputs = [
+      archive_path,
+    ]
+
+    args = [
+      rebase_path(far_tool_path, root_build_dir),
+      "create",
+      "--archive=" + rebase_path(archive_path),
+      "--manifest=" + rebase_path(_manifest_file),
+    ]
+  }
+
+  group(target_name) {
+    deps = []
+    forward_variables_from(invoker, "*")
+    deps += [
+      ":$_write_archive_target",
+      ":$_write_manifest_target",
+    ]
+  }
+}
diff --git a/build/config/fuchsia/rules.gni b/build/config/fuchsia/rules.gni
index 4ecf71a..a93745b7 100644
--- a/build/config/fuchsia/rules.gni
+++ b/build/config/fuchsia/rules.gni
@@ -1,16 +1,20 @@
-# Copyright 2017 The Chromium Authors. All rights reserved.
+# Copyright 2018 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.
 
 assert(is_fuchsia)
 
+import("//build/config/fuchsia/package.gni")
+
 template("generate_runner_script") {
   # This runtime_deps file is used at runtime and thus cannot go in
   # target_gen_dir.
-  _target_dir_name = get_label_info(invoker.exe_target, "dir")
-  _target_shortname = get_label_info(invoker.exe_target, "name")
-  _runtime_deps_file = "$root_out_dir/gen.runtime/$_target_dir_name/$_target_shortname.runtime_deps"
-  _runtime_deps_target = "${target_name}__write_deps"
+  _runtime_deps_target = "${target_name}__deps"
+  _runtime_deps_file =
+      "$root_out_dir/gen.runtime/" +
+      get_label_info(invoker.root_target_name, "dir") + "/" +
+      get_label_info(invoker.root_target_name, "name") + ".runtime_deps"
+
   group(_runtime_deps_target) {
     forward_variables_from(invoker,
                            [
@@ -67,7 +71,7 @@
     ]
 
     deps += [
-      ":$_runtime_deps_target",
+      ":${_runtime_deps_target}",
       "//testing/buildbot/filters:fuchsia_filters",
     ]
     data += [ _runtime_deps_file ]
@@ -85,7 +89,7 @@
       "--script-output-path",
       rebase_path(invoker.generated_script, root_build_dir),
       "--exe-name",
-      _target_shortname,
+      rebase_path(invoker.exe_path, root_build_dir),
     ]
 
     if (defined(invoker.use_test_server) && invoker.use_test_server) {
@@ -102,47 +106,75 @@
   generate_runner_script(target_name) {
     testonly = true
     runner_script = "test_runner.py"
-    exe_target = invoker.test_name
+    exe_path = invoker.exe_path
+    root_target_name = invoker.test_name
     generated_script =
-        "$root_build_dir/bin/run_" + get_label_info(exe_target, "name")
+        "$root_build_dir/bin/run_" + get_label_info(invoker.test_name, "name")
     forward_variables_from(invoker, "*")
   }
 }
 
 # This template is used to generate a runner script for arbitrary executables
 # into the build dir for Fuchsia. The template should reference an "executable"
-# target using the "exe_target" attribute.
+# path using the "exe_path" attribute.
 #
 # Example usage:
 #
+#   _exe_path = "$root_out_dir/foo_fuchsia"
 #   executable("foo") {
 #     sources = [ "foo_main.cc" ]
+#     output_name = _exe_path
 #   }
 #   fuchsia_executable_runner("foo_fuchsia") {
-#     exe_target = ":foo"
+#     exe_path = _exe_path
 #   }
 template("fuchsia_executable_runner") {
-  generate_runner_script(target_name) {
+  forward_variables_from(invoker, [ "exe_target" ])
+
+  _pkg_target = "${target_name}_pkg"
+  _gen_runner_target = "${target_name}_runner"
+  _archive_target = "${target_name}_archive"
+  _exe_name = get_label_info(exe_target, "name")
+  _exe_path = "${root_out_dir}/${_exe_name}"
+
+  package(_pkg_target) {
+    forward_variables_from(invoker, [ "testonly" ])
+    package_name = _exe_name
+    binary = _exe_name
+    data_deps = [
+      exe_target,
+    ]
+  }
+
+  generate_runner_script(_gen_runner_target) {
     forward_variables_from(invoker,
                            [
                              "testonly",
-                             "exe_target",
                              "data_deps",
                            ])
     runner_script = "exe_runner.py"
-    generated_script =
-        "$root_build_dir/bin/run_" + get_label_info(exe_target, "name")
+    generated_script = "$root_build_dir/bin/run_${_exe_name}"
     if (!defined(data_deps)) {
       data_deps = []
     }
     data_deps += [ exe_target ]
+    exe_path = _exe_path
+    root_target_name = invoker.target_name
   }
 
-  generate_runner_script(target_name + "_archive") {
+  group(target_name) {
+    forward_variables_from(invoker, [ "testonly" ])
+    deps = [
+      ":${_archive_target}",
+      ":${_gen_runner_target}",
+      ":${_pkg_target}",
+    ]
+  }
+
+  generate_runner_script(_archive_target) {
     forward_variables_from(invoker,
                            [
                              "testonly",
-                             "exe_target",
                              "data_deps",
                            ])
     runner_script = "archive_builder.py"
@@ -152,5 +184,7 @@
       data_deps = []
     }
     data_deps += [ exe_target ]
+    exe_path = _exe_path
+    root_target_name = invoker.target_name
   }
 }
diff --git a/build/config/fuchsia/sandbox_policy b/build/config/fuchsia/sandbox_policy
new file mode 100644
index 0000000..e3352a0
--- /dev/null
+++ b/build/config/fuchsia/sandbox_policy
@@ -0,0 +1,6 @@
+{
+  "features": [ "persistent-storage",
+                "shell",
+                "system-temp" ]
+}
+
diff --git a/cc/paint/paint_op_buffer.cc b/cc/paint/paint_op_buffer.cc
index 781d00f..5f4cbf9 100644
--- a/cc/paint/paint_op_buffer.cc
+++ b/cc/paint/paint_op_buffer.cc
@@ -15,7 +15,6 @@
 #include "cc/paint/scoped_raster_flags.h"
 #include "third_party/skia/include/core/SkAnnotation.h"
 #include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkFlattenableSerialization.h"
 #include "third_party/skia/include/core/SkRegion.h"
 #include "third_party/skia/include/core/SkSerialProcs.h"
 
diff --git a/cc/raster/raster_buffer_provider_perftest.cc b/cc/raster/raster_buffer_provider_perftest.cc
index b772a16..3eba609 100644
--- a/cc/raster/raster_buffer_provider_perftest.cc
+++ b/cc/raster/raster_buffer_provider_perftest.cc
@@ -221,8 +221,13 @@
 
   // Overridden from TileTask:
   void OnTaskCompleted() override {
-    raster_buffer_ = nullptr;
-    pool_->ReleaseResource(std::move(resource_));
+    // Note: Perf tests will Reset() the PerfTileTask, causing it to be
+    // completed multiple times. We can only do the work of completion once
+    // though.
+    if (raster_buffer_) {
+      raster_buffer_ = nullptr;
+      pool_->ReleaseResource(std::move(resource_));
+    }
   }
 
  protected:
@@ -398,6 +403,7 @@
     tile_task_manager_->CheckForCompletedTasks();
 
     raster_buffer_provider_->Shutdown();
+    resource_pool_.reset();
   }
 
   // Overridden from PerfRasterBufferProviderHelper:
@@ -559,14 +565,7 @@
   RunScheduleTasksTest("32_4", 32, 4);
 }
 
-// Crashes on Android only.  http://crbug.com/803874
-#if defined(OS_ANDROID)
-#define MAYBE_ScheduleAlternateTasks DISABLED_ScheduleAlternateTasks
-#else
-#define MAYBE_ScheduleAlternateTasks ScheduleAlternateTasks
-#endif
-
-TEST_P(RasterBufferProviderPerfTest, MAYBE_ScheduleAlternateTasks) {
+TEST_P(RasterBufferProviderPerfTest, ScheduleAlternateTasks) {
   RunScheduleAlternateTasksTest("1_0", 1, 0);
   RunScheduleAlternateTasksTest("32_0", 32, 0);
   RunScheduleAlternateTasksTest("1_1", 1, 1);
@@ -599,6 +598,10 @@
   void SetUp() override {
     resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider(
         compositor_context_provider_.get(), nullptr);
+    resource_pool_ = std::make_unique<ResourcePool>(
+        resource_provider_.get(), task_runner_,
+        viz::ResourceTextureHint::kFramebuffer,
+        ResourcePool::kDefaultExpirationDelay, false);
   }
 
   void RunBuildTileTaskGraphTest(const std::string& test_name,
@@ -622,19 +625,15 @@
 
     CancelRasterTasks(raster_tasks);
 
+    for (auto& task : raster_tasks)
+      task->OnTaskCompleted();
+
     perf_test::PrintResult("build_raster_task_graph", "", test_name,
                            timer_.LapsPerSecond(), "runs/s", true);
   }
 };
 
-// Crashes on Android only.  http://crbug.com/803874
-#if defined(OS_ANDROID)
-#define MAYBE_BuildTileTaskGraph DISABLED_BuildTileTaskGraph
-#else
-#define MAYBE_BuildTileTaskGraph BuildTileTaskGraph
-#endif
-
-TEST_F(RasterBufferProviderCommonPerfTest, MAYBE_BuildTileTaskGraph) {
+TEST_F(RasterBufferProviderCommonPerfTest, BuildTileTaskGraph) {
   RunBuildTileTaskGraphTest("1_0", 1, 0);
   RunBuildTileTaskGraphTest("32_0", 32, 0);
   RunBuildTileTaskGraphTest("1_1", 1, 1);
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 960921a..148f27da1 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -23,6 +23,7 @@
 import("//third_party/WebKit/public/public_features.gni")
 import("//third_party/widevine/cdm/widevine.gni")
 import("//tools/resources/generate_resource_whitelist.gni")
+import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
 import("//v8/gni/v8.gni")
 
 if (is_android) {
@@ -852,7 +853,6 @@
   bundle_data("chrome_framework_resources") {
     sources = [
       "$root_out_dir/app_mode_loader.app",
-      "$root_out_dir/v8_context_snapshot.bin",
 
       # This image is used to badge the lock icon in the
       # authentication dialogs, such as those used for installation
@@ -872,7 +872,6 @@
     public_deps = [
       ":packed_resources",
       "//chrome/app_shim:app_mode_loader",
-      "//tools/v8_context_snapshot",
     ]
 
     if (is_chrome_branded) {
@@ -888,11 +887,14 @@
     }
 
     if (v8_use_external_startup_data) {
-      sources += [
-        "$root_out_dir/natives_blob.bin",
-        "$root_out_dir/snapshot_blob.bin",
-      ]
+      sources += [ "$root_out_dir/natives_blob.bin" ]
       public_deps += [ "//v8" ]
+      if (use_v8_context_snapshot) {
+        sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
+        public_deps += [ "//tools/v8_context_snapshot" ]
+      } else {
+        sources += [ "$root_out_dir/snapshot_blob.bin" ]
+      }
     }
   }
 
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 8524fb3a..a5fa5a9 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -204,8 +204,8 @@
     "//components/crash/android:java",
     "//components/dom_distiller/content/browser/android:dom_distiller_content_java",
     "//components/dom_distiller/core/android:dom_distiller_core_java",
-    "//components/download/internal:internal_java",
-    "//components/download/public:public_java",
+    "//components/download/internal/background_service:internal_java",
+    "//components/download/public/background_service:public_java",
     "//components/feature_engagement:feature_engagement_java",
     "//components/gcm_driver/android:gcm_driver_java",
     "//components/gcm_driver/instance_id/android:instance_id_driver_java",
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index 8b50ec2..3a53eab 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -170,7 +170,7 @@
             android:relinquishTaskIdentity="true"
             android:taskAffinity=""
             android:excludeFromRecents="true"
-            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
+            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode|density">
         </activity>
         <activity-alias android:name="com.google.android.apps.chrome.IntentDispatcher"
             android:targetActivity="org.chromium.chrome.browser.document.ChromeLauncherActivity"
@@ -358,7 +358,7 @@
             android:taskAffinity=""
             android:relinquishTaskIdentity="true"
             android:excludeFromRecents="true"
-            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize">
+            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize|uiMode|density">
             <!-- TODO(mthiesse, b/72214458): This is a duplication of the icon metadata below.
                  Daydream will actually ignore the metadata here, and use the metadata on the
                  activity-alias. However, play store apk validation fails to find the icons on the
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
index 79cb854..c6fa99a 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPromoHeader.java
@@ -175,7 +175,7 @@
      * Detaches the previously configured {@link PersonalizedSigninPromoView}.
      */
     void detachPersonalizePromoView() {
-        mSigninPromoController.detach();
+        if (mSigninPromoController != null) mSigninPromoController.detach();
     }
 
     /**
@@ -187,7 +187,7 @@
         sharedPreferencesEditor.putBoolean(PREF_PERSONALIZED_SIGNIN_PROMO_DECLINED, true);
         sharedPreferencesEditor.apply();
         mPromoState = calculatePromoState();
-        mPromoHeaderChangeAction.run();
+        triggerPromoUpdate();
     }
 
     /**
@@ -230,31 +230,36 @@
     @Override
     public void androidSyncSettingsChanged() {
         mPromoState = calculatePromoState();
-        mPromoHeaderChangeAction.run();
+        triggerPromoUpdate();
     }
 
     // SignInStateObserver implementation.
     @Override
     public void onSignedIn() {
         mPromoState = calculatePromoState();
-        mPromoHeaderChangeAction.run();
+        triggerPromoUpdate();
     }
 
     @Override
     public void onSignedOut() {
         mPromoState = calculatePromoState();
-        mPromoHeaderChangeAction.run();
+        triggerPromoUpdate();
     }
 
     // ProfileDataCache.Observer implementation.
     @Override
     public void onProfileDataUpdated(String accountId) {
-        mPromoHeaderChangeAction.run();
+        triggerPromoUpdate();
     }
 
     // AccountsChangeObserver implementation.
     @Override
     public void onAccountsChanged() {
+        triggerPromoUpdate();
+    }
+
+    private void triggerPromoUpdate() {
+        detachPersonalizePromoView();
         mPromoHeaderChangeAction.run();
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
index 01644968..de56332 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java
@@ -47,6 +47,8 @@
 
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import javax.annotation.Nullable;
@@ -756,11 +758,14 @@
         assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
         StatusBarNotification[] activeNotifications = mNotificationManager.getActiveNotifications();
         if (activeNotifications == null) return null;
-        String[] result = new String[activeNotifications.length];
-        for (int i = 0; i < activeNotifications.length; i++) {
-            result[i] = activeNotifications[i].getTag();
+        List<String> result = new ArrayList<>();
+        for (StatusBarNotification activeNotification : activeNotifications) {
+            String tag = activeNotification.getTag();
+
+            // Notifications shown by other systems may skip setting a tag.
+            if (tag != null) result.add(tag);
         }
-        return result;
+        return result.toArray(new String[result.size()]);
     }
 
     /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditorPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditorPreference.java
index 8e6db67..67498f5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditorPreference.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillProfileEditorPreference.java
@@ -48,7 +48,7 @@
     }
 
     private void prepareAddressEditor() {
-        AddressEditor addressEditor = new AddressEditor(/*emailIncluded=*/true);
+        AddressEditor addressEditor = new AddressEditor(/*emailFieldIncluded=*/true);
         addressEditor.setEditorDialog(mEditorDialog);
 
         addressEditor.edit(mAutofillAddress, new Callback<AutofillAddress>() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java
index 1dadc7c..25abfad62 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java
@@ -152,6 +152,7 @@
     private UserRecoverableErrorHandler.ModalDialog mGooglePlayServicesUpdateErrorHandler;
     private AlertDialog mGmsIsUpdatingDialog;
     private long mGmsIsUpdatingDialogShowTime;
+    private boolean mShouldShowConfirmationPageWhenAttachedToWindow;
 
     private AccountSigninConfirmationView mSigninConfirmationView;
     private ImageView mSigninAccountImage;
@@ -249,7 +250,7 @@
                 String accountName = arguments.getString(ARGUMENT_ACCOUNT_NAME);
                 assert accountName != null;
                 boolean isDefaultAccount = arguments.getBoolean(ARGUMENT_IS_DEFAULT_ACCOUNT, false);
-                showConfirmSigninPageAccountTrackerServiceCheck(accountName, isDefaultAccount);
+                showConfirmationPageForAccount(accountName, isDefaultAccount);
                 triggerUpdateAccounts();
                 break;
             }
@@ -311,6 +312,10 @@
         triggerUpdateAccounts();
         AccountManagerFacade.get().addObserver(mAccountsChangedObserver);
         mProfileDataCache.addObserver(mProfileDataCacheObserver);
+        if (mShouldShowConfirmationPageWhenAttachedToWindow) {
+            // Can happen if init is invoked before attaching to window (https://crbug.com/800665).
+            seedAccountsAndShowConfirmationPage();
+        }
     }
 
     @Override
@@ -434,7 +439,7 @@
         }
 
         if (shouldJumpToConfirmationScreen) {
-            showConfirmSigninPageAccountTrackerServiceCheck();
+            showConfirmationPageForSelectedAccount();
         }
     }
 
@@ -558,7 +563,7 @@
         triggerUpdateAccounts();
     }
 
-    private void showConfirmSigninPage() {
+    private void showConfirmationPage() {
         updateSignedInAccountInfo();
         mProfileDataCache.update(Collections.singletonList(mSelectedAccountName));
 
@@ -585,26 +590,29 @@
                         new SpanInfo(SETTINGS_LINK_OPEN, SETTINGS_LINK_CLOSE, settingsSpan)));
     }
 
-    private void showConfirmSigninPageAccountTrackerServiceCheck() {
+    private void showConfirmationPageForSelectedAccount() {
         int index = mSigninChooseView.getSelectedAccountPosition();
-        showConfirmSigninPageAccountTrackerServiceCheck(mAccountNames.get(index), index == 0);
+        showConfirmationPageForAccount(mAccountNames.get(index), index == 0);
     }
 
-    private void showConfirmSigninPageAccountTrackerServiceCheck(
-            final String accountName, final boolean isDefaultAccount) {
+    private void showConfirmationPageForAccount(String accountName, boolean isDefaultAccount) {
         assert accountName != null;
+
         // Disable the buttons to prevent them being clicked again while waiting for the callbacks.
         setButtonsEnabled(false);
 
         mSelectedAccountName = accountName;
         mIsDefaultAccountSelected = isDefaultAccount;
+        seedAccountsAndShowConfirmationPage();
+    }
 
+    private void seedAccountsAndShowConfirmationPage() {
         // Ensure that the AccountTrackerService has a fully up to date GAIA id <-> email mapping,
         // as this is needed for the previous account check.
         final long seedingStartTime = SystemClock.elapsedRealtime();
         if (AccountTrackerService.get().checkAndSeedSystemAccounts()) {
             recordAccountTrackerServiceSeedingTime(seedingStartTime);
-            showConfirmSigninPagePreviousAccountCheck();
+            runStateMachineAndShowConfirmationPage();
         } else {
             AccountTrackerService.get().addSystemAccountsSeededListener(
                     new OnSystemAccountsSeededListener() {
@@ -614,7 +622,9 @@
                             recordAccountTrackerServiceSeedingTime(seedingStartTime);
                             // Don't show dialogs and confirmation page if activity was destroyed.
                             if (ViewCompat.isAttachedToWindow(AccountSigninView.this)) {
-                                showConfirmSigninPagePreviousAccountCheck();
+                                runStateMachineAndShowConfirmationPage();
+                            } else {
+                                mShouldShowConfirmationPageWhenAttachedToWindow = true;
                             }
                         }
 
@@ -624,7 +634,7 @@
         }
     }
 
-    private void showConfirmSigninPagePreviousAccountCheck() {
+    private void runStateMachineAndShowConfirmationPage() {
         mConfirmSyncDataStateMachine = new ConfirmSyncDataStateMachine(getContext(),
                 mDelegate.getFragmentManager(), ImportSyncType.PREVIOUS_DATA_FOUND,
                 PrefServiceBridge.getInstance().getSyncLastAccountName(), mSelectedAccountName,
@@ -633,7 +643,7 @@
                     public void onConfirm(boolean wipeData) {
                         mConfirmSyncDataStateMachine = null;
                         SigninManager.wipeSyncUserDataIfRequired(wipeData).then(
-                                (Void v) -> showConfirmSigninPage());
+                                (Void v) -> showConfirmationPage());
                     }
 
                     @Override
@@ -663,8 +673,7 @@
     private void setUpSigninButton(boolean hasAccounts) {
         if (hasAccounts) {
             mPositiveButton.setText(R.string.continue_sign_in);
-            mPositiveButton.setOnClickListener(
-                    view -> showConfirmSigninPageAccountTrackerServiceCheck());
+            mPositiveButton.setOnClickListener(view -> showConfirmationPageForSelectedAccount());
         } else {
             mPositiveButton.setText(R.string.choose_account_sign_in);
             mPositiveButton.setOnClickListener(view -> {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
index 3ff9122..111c0e4 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -934,9 +934,7 @@
      */
     public static void onNewIntentWithNative(ChromeActivity activity, Intent intent) {
         if (!VrIntentUtils.isVrIntent(intent)) return;
-        // If we get an intent while we're already in VR, we just drop it. This is mostly
-        // because crbug.com/780673 since on Android O, every intent gets dispatched twice.
-        if (sInstance != null && sInstance.mInVr) return;
+
         VrShellDelegate instance = getInstance(activity);
         if (instance == null) return;
         // TODO(ymalik): We should cache whether or not VR mode is set so we don't set it
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java
index 3546abd..b686a6d 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java
@@ -257,6 +257,7 @@
     @Test
     @SmallTest
     @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
+    @DisabledTest(message = "crbug.com/804858")
     public void testSuspend_ToggleOverview() throws Exception {
         // Initially there are no dialogs in the pending list. Browser controls are not restricted.
         checkPendingSize(0);
@@ -304,6 +305,7 @@
     @Test
     @SmallTest
     @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE)
+    @DisabledTest(message = "crbug.com/804858")
     public void testSuspend_ShowNext() throws Exception {
         // Initially there are no dialogs in the pending list. Browser controls are not restricted.
         checkPendingSize(0);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
index ec42408..32f9ff1b 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
@@ -13,6 +13,7 @@
 import org.junit.runner.RunWith;
 
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisabledTest;
 import org.chromium.chrome.browser.ChromeActivity;
 import org.chromium.chrome.browser.ChromeSwitches;
 import org.chromium.chrome.test.ChromeActivityTestRule;
@@ -62,6 +63,8 @@
     @Test
     @MediumTest
     @CommandLineFlags.Add({"memlog=all-renderers", "memlog-stack-mode=pseudo"})
+    // Disabled: https://crbug.com/804412
+    @DisabledTest
     public void testModeRendererPseudo() throws Exception {
         TestAndroidShim profilingProcessHost = new TestAndroidShim();
         Assert.assertTrue(profilingProcessHost.runTestForMode("all-renderers", false, true));
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 3314b60..3880cd2 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -4631,8 +4631,8 @@
       <message name="IDS_COMPONENTS_SVC_STATUS_UPTODATE" desc="Service Status">
         Up-to-date
       </message>
-      <message name="IDS_COMPONENTS_SVC_STATUS_NOUPDATE" desc="Service Status">
-        No update
+      <message name="IDS_COMPONENTS_SVC_STATUS_UPDATE_ERROR" desc="Service Status">
+        Update error
       </message>
       <message name="IDS_COMPONENTS_UNKNOWN" desc="Service Status">
         Unknown
@@ -4655,6 +4655,9 @@
       <message name="IDS_COMPONENTS_EVT_STATUS_NOTUPDATED" desc="Service Status">
         Component not updated
       </message>
+      <message name="IDS_COMPONENTS_EVT_STATUS_UPDATE_ERROR" desc="Service Status">
+        Update error
+      </message>
       <message name="IDS_COMPONENTS_EVT_STATUS_DOWNLOADING" desc="Service Status">
         Component downloading
       </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index f24a89d..39a69ca 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1635,7 +1635,7 @@
     "//components/domain_reliability",
     "//components/download/content/factory",
     "//components/download/downloader/in_progress",
-    "//components/download/public",
+    "//components/download/public/background_service:public",
     "//components/error_page/common",
     "//components/favicon/content",
     "//components/favicon/core",
diff --git a/chrome/browser/android/download/service/download_background_task.cc b/chrome/browser/android/download/service/download_background_task.cc
index 7155beb..720f35c 100644
--- a/chrome/browser/android/download/service/download_background_task.cc
+++ b/chrome/browser/android/download/service/download_background_task.cc
@@ -7,7 +7,7 @@
 #include "chrome/browser/download/download_service_factory.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_android.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/download_service.h"
 #include "content/public/browser/browser_context.h"
 #include "jni/DownloadBackgroundTask_jni.h"
 
diff --git a/chrome/browser/android/download/service/download_task_scheduler.h b/chrome/browser/android/download/service/download_task_scheduler.h
index e9d18f1b..1ca0aab 100644
--- a/chrome/browser/android/download/service/download_task_scheduler.h
+++ b/chrome/browser/android/download/service/download_task_scheduler.h
@@ -9,8 +9,8 @@
 #include <memory>
 
 #include "base/macros.h"
-#include "components/download/public/download_task_types.h"
-#include "components/download/public/task_scheduler.h"
+#include "components/download/public/background_service/download_task_types.h"
+#include "components/download/public/background_service/task_scheduler.h"
 
 namespace download {
 namespace android {
diff --git a/chrome/browser/android/metrics/uma_utils.cc b/chrome/browser/android/metrics/uma_utils.cc
index 85effc8..3ea72cc 100644
--- a/chrome/browser/android/metrics/uma_utils.cc
+++ b/chrome/browser/android/metrics/uma_utils.cc
@@ -27,22 +27,8 @@
 
 base::TimeTicks GetMainEntryPointTimeTicks() {
   JNIEnv* env = base::android::AttachCurrentThread();
-  // Generally the use of base::TimeTicks::FromInternalValue() is discouraged.
-  //
-  // The implementation of the SystemClock.uptimeMillis() in AOSP uses the same
-  // clock as base::TimeTicks::Now(): clock_gettime(CLOCK_MONOTONIC), see in
-  // platform/system/code:
-  // 1. libutils/SystemClock.cpp
-  // 2. libutils/Timers.cpp
-  //
-  // We are not aware of any motivations for Android OEMs to modify the AOSP
-  // implementation of either uptimeMillis() or clock_gettime(CLOCK_MONOTONIC),
-  // so we assume that there are no such customizations.
-  //
-  // Under these assumptions the conversion is as safe as copying the value of
-  // base::TimeTicks::Now() with a loss of sub-millisecond precision.
-  return base::TimeTicks::FromInternalValue(
-      Java_UmaUtils_getMainEntryPointTicks(env) * 1000);
+  return base::TimeTicks::FromUptimeMillis(
+      Java_UmaUtils_getMainEntryPointTicks(env));
 }
 
 static jboolean JNI_UmaUtils_IsClientInMetricsReportingSample(
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index 81777ab..ae6ba01 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -487,20 +487,24 @@
   // bad experiences, but we have to be careful to handle things like splash
   // screens correctly. For now just ensure we receive a first frame.
   if (!web_vr_mode_ || webvr_frames_received_ > 0) {
-    webvr_frame_timeout_.Cancel();
-    webvr_spinner_timeout_.Cancel();
+    if (!webvr_frame_timeout_.IsCancelled())
+      webvr_frame_timeout_.Cancel();
+    if (!webvr_spinner_timeout_.IsCancelled())
+      webvr_spinner_timeout_.Cancel();
     return;
   }
-  webvr_spinner_timeout_.Reset(
-      base::Bind(&VrShellGl::OnWebVrTimeoutImminent, base::Unretained(this)));
-  task_runner_->PostDelayedTask(
-      FROM_HERE, webvr_spinner_timeout_.callback(),
-      base::TimeDelta::FromSeconds(kWebVrSpinnerTimeoutSeconds));
-  webvr_frame_timeout_.Reset(
-      base::Bind(&VrShellGl::OnWebVrFrameTimedOut, base::Unretained(this)));
-  task_runner_->PostDelayedTask(
-      FROM_HERE, webvr_frame_timeout_.callback(),
-      base::TimeDelta::FromSeconds(kWebVrInitialFrameTimeoutSeconds));
+  if (ui_->CanSendWebVrVSync() && submit_client_) {
+    webvr_spinner_timeout_.Reset(base::BindRepeating(
+        &VrShellGl::OnWebVrTimeoutImminent, base::Unretained(this)));
+    task_runner_->PostDelayedTask(
+        FROM_HERE, webvr_spinner_timeout_.callback(),
+        base::TimeDelta::FromSeconds(kWebVrSpinnerTimeoutSeconds));
+    webvr_frame_timeout_.Reset(base::BindRepeating(
+        &VrShellGl::OnWebVrFrameTimedOut, base::Unretained(this)));
+    task_runner_->PostDelayedTask(
+        FROM_HERE, webvr_frame_timeout_.callback(),
+        base::TimeDelta::FromSeconds(kWebVrInitialFrameTimeoutSeconds));
+  }
 }
 
 void VrShellGl::OnWebVrFrameTimedOut() {
@@ -1208,7 +1212,7 @@
     return;
   vsync_helper_.CancelVSyncRequest();
   OnVSync(base::TimeTicks::Now());
-  if (web_vr_mode_ && submit_client_)
+  if (web_vr_mode_)
     ScheduleOrCancelWebVrFrameTimeout();
 }
 
@@ -1288,8 +1292,10 @@
   vsync_helper_.RequestVSync(
       base::Bind(&VrShellGl::OnVSync, base::Unretained(this)));
 
+  ScheduleOrCancelWebVrFrameTimeout();
+
   // Process WebVR presenting VSync (VRDisplay rAF).
-  if (!callback_.is_null()) {
+  if (!callback_.is_null() && ui_->CanSendWebVrVSync()) {
     // A callback was stored by GetVSync. Use it now for sending a VSync.
     SendVSync(frame_time, base::ResetAndReturn(&callback_));
   } else {
@@ -1316,7 +1322,8 @@
   // In surfaceless (reprojecting) rendering, stay locked
   // to vsync intervals. Otherwise, for legacy Cardboard mode,
   // run requested animation frames now if it missed a vsync.
-  if ((surfaceless_rendering_ && webvr_vsync_align_) || !pending_vsync_) {
+  if ((surfaceless_rendering_ && webvr_vsync_align_) || !pending_vsync_ ||
+      !ui_->CanSendWebVrVSync()) {
     if (!callback_.is_null()) {
       mojo::ReportBadMessage(
           "Requested VSync before waiting for response to previous request.");
diff --git a/chrome/browser/background_fetch/background_fetch_delegate_impl.cc b/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
index 8c48a5ea..3a92b2d 100644
--- a/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
+++ b/chrome/browser/background_fetch/background_fetch_delegate_impl.cc
@@ -13,8 +13,8 @@
 #include "chrome/browser/download/download_service_factory.h"
 #include "chrome/browser/offline_items_collection/offline_content_aggregator_factory.h"
 #include "chrome/browser/profiles/profile.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/download_service.h"
 #include "components/offline_items_collection/core/offline_content_aggregator.h"
 #include "components/offline_items_collection/core/offline_item.h"
 #include "content/public/browser/background_fetch_response.h"
diff --git a/chrome/browser/background_fetch/background_fetch_delegate_impl.h b/chrome/browser/background_fetch/background_fetch_delegate_impl.h
index 3c90e5e..f77271e 100644
--- a/chrome/browser/background_fetch/background_fetch_delegate_impl.h
+++ b/chrome/browser/background_fetch/background_fetch_delegate_impl.h
@@ -13,7 +13,7 @@
 
 #include "base/containers/flat_set.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/public/download_params.h"
+#include "components/download/public/background_service/download_params.h"
 #include "components/keyed_service/core/keyed_service.h"
 #include "components/offline_items_collection/core/offline_content_provider.h"
 #include "components/offline_items_collection/core/offline_item.h"
diff --git a/chrome/browser/background_fetch/background_fetch_download_client.cc b/chrome/browser/background_fetch/background_fetch_download_client.cc
index 03b1c79..59a10bb 100644
--- a/chrome/browser/background_fetch/background_fetch_download_client.cc
+++ b/chrome/browser/background_fetch/background_fetch_download_client.cc
@@ -9,8 +9,8 @@
 
 #include "chrome/browser/background_fetch/background_fetch_delegate_impl.h"
 #include "chrome/browser/download/download_service_factory.h"
-#include "components/download/public/download_metadata.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/download_metadata.h"
+#include "components/download/public/background_service/download_service.h"
 #include "content/public/browser/background_fetch_response.h"
 #include "content/public/browser/browser_context.h"
 #include "url/origin.h"
diff --git a/chrome/browser/background_fetch/background_fetch_download_client.h b/chrome/browser/background_fetch/background_fetch_download_client.h
index 16c3ab5..e7aaf09 100644
--- a/chrome/browser/background_fetch/background_fetch_download_client.h
+++ b/chrome/browser/background_fetch/background_fetch_download_client.h
@@ -10,7 +10,7 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/public/client.h"
+#include "components/download/public/background_service/client.h"
 
 class BackgroundFetchDelegateImpl;
 
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
index 2da8e1f..b3fc4cb 100644
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -960,12 +960,10 @@
     } else {
       // TODO(msramek): Store filters from the currently executed task on the
       // object to avoid having to copy them to callback methods.
-      flash_lso_helper_->StartFetching(
-          base::AdaptCallbackForRepeating(base::BindOnce(
-              &ChromeBrowsingDataRemoverDelegate::OnSitesWithFlashDataFetched,
-              weak_ptr_factory_.GetWeakPtr(),
-              filter_builder.BuildPluginFilter(),
-              CreatePendingTaskCompletionClosure())));
+      flash_lso_helper_->StartFetching(base::BindOnce(
+          &ChromeBrowsingDataRemoverDelegate::OnSitesWithFlashDataFetched,
+          weak_ptr_factory_.GetWeakPtr(), filter_builder.BuildPluginFilter(),
+          CreatePendingTaskCompletionClosure()));
     }
   }
 #endif
diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.cc b/chrome/browser/chromeos/extensions/wallpaper_api.cc
index 669f875d2..b6f5035 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc
@@ -158,12 +158,12 @@
       extensions::api::wallpaper::ToString(params_->details.layout));
   wallpaper_api_util::RecordCustomWallpaperLayout(layout);
 
-  bool update_wallpaper =
+  bool show_wallpaper =
       account_id_ ==
       user_manager::UserManager::Get()->GetActiveUser()->GetAccountId();
   WallpaperControllerClient::Get()->SetCustomWallpaper(
       account_id_, wallpaper_files_id_, params_->details.filename, layout,
-      wallpaper::CUSTOMIZED, image, update_wallpaper);
+      image, show_wallpaper);
   unsafe_wallpaper_decoder_ = NULL;
 
   // Save current extension name. It will be displayed in the component
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index 5f3d2b1..4adcb13 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -513,12 +513,12 @@
       wallpaper_base::ToString(params->layout));
   wallpaper_api_util::RecordCustomWallpaperLayout(layout);
 
-  bool update_wallpaper =
+  bool show_wallpaper =
       account_id_ ==
       user_manager::UserManager::Get()->GetActiveUser()->GetAccountId();
   WallpaperControllerClient::Get()->SetCustomWallpaper(
-      account_id_, wallpaper_files_id_, params->file_name, layout,
-      wallpaper::CUSTOMIZED, image, update_wallpaper);
+      account_id_, wallpaper_files_id_, params->file_name, layout, image,
+      show_wallpaper);
   unsafe_wallpaper_decoder_ = NULL;
 
   Profile* profile = Profile::FromBrowserContext(browser_context());
diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.cc b/chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.cc
index 6d66f98..f696ea4 100644
--- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.cc
+++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen.cc
@@ -203,11 +203,17 @@
   switch (new_auto_enrollment_state) {
     case policy::AUTO_ENROLLMENT_STATE_IDLE:
     case policy::AUTO_ENROLLMENT_STATE_PENDING:
-    case policy::AUTO_ENROLLMENT_STATE_SERVER_ERROR:
     case policy::AUTO_ENROLLMENT_STATE_TRIGGER_ENROLLMENT:
     case policy::AUTO_ENROLLMENT_STATE_TRIGGER_ZERO_TOUCH:
     case policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT:
       return false;
+    case policy::AUTO_ENROLLMENT_STATE_SERVER_ERROR:
+      if (auto_enrollment_controller_->GetFRERequirement() !=
+          AutoEnrollmentController::EXPLICITLY_REQUIRED) {
+        return false;
+      }
+    // Fall to the same behavior like any connection error if the device is
+    // enrolled.
     case policy::AUTO_ENROLLMENT_STATE_CONNECTION_ERROR:
       ShowErrorScreen(NetworkError::ERROR_STATE_OFFLINE);
       return true;
@@ -255,7 +261,9 @@
     case policy::AUTO_ENROLLMENT_STATE_CONNECTION_ERROR:
       return false;
     case policy::AUTO_ENROLLMENT_STATE_SERVER_ERROR:
-    // Server errors don't block OOBE.
+      // Server errors should block OOBE for enrolled devices.
+      return auto_enrollment_controller_->GetFRERequirement() !=
+             AutoEnrollmentController::EXPLICITLY_REQUIRED;
     case policy::AUTO_ENROLLMENT_STATE_TRIGGER_ENROLLMENT:
     case policy::AUTO_ENROLLMENT_STATE_TRIGGER_ZERO_TOUCH:
     case policy::AUTO_ENROLLMENT_STATE_NO_ENROLLMENT:
diff --git a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
index 06911ec..d04ebd204 100644
--- a/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/users/chrome_user_manager_impl.cc
@@ -581,11 +581,9 @@
       user_id, std::string() /* id */, AccountType::UNKNOWN);
   if (policy == policy::key::kUserAvatarImage)
     GetUserImageManager(account_id)->OnExternalDataSet(policy);
-  else if (policy == policy::key::kWallpaperImage)
-    WallpaperManager::Get()->OnPolicySet(policy, account_id);
   else if (policy == policy::key::kNativePrintersBulkConfiguration)
     GetExternalPrinters(account_id)->ClearData();
-  else
+  else if (policy != policy::key::kWallpaperImage)
     NOTREACHED();
 }
 
@@ -595,10 +593,10 @@
       user_id, std::string() /* id */, AccountType::UNKNOWN);
   if (policy == policy::key::kUserAvatarImage)
     GetUserImageManager(account_id)->OnExternalDataCleared(policy);
-  else if (policy == policy::key::kWallpaperImage)
-    WallpaperManager::Get()->OnPolicyCleared(policy, account_id);
   else if (policy == policy::key::kNativePrintersBulkConfiguration)
     GetExternalPrinters(account_id)->ClearData();
+  else if (policy == policy::key::kWallpaperImage)
+    WallpaperControllerClient::Get()->RemovePolicyWallpaper(account_id);
   else
     NOTREACHED();
 }
@@ -609,16 +607,17 @@
     std::unique_ptr<std::string> data) {
   const AccountId account_id = user_manager::known_user::GetAccountId(
       user_id, std::string() /* id */, AccountType::UNKNOWN);
-  if (policy == policy::key::kUserAvatarImage)
+  if (policy == policy::key::kUserAvatarImage) {
     GetUserImageManager(account_id)
         ->OnExternalDataFetched(policy, std::move(data));
-  else if (policy == policy::key::kWallpaperImage)
-    WallpaperManager::Get()->OnPolicyFetched(policy, account_id,
-                                             std::move(data));
-  else if (policy == policy::key::kNativePrintersBulkConfiguration)
+  } else if (policy == policy::key::kNativePrintersBulkConfiguration) {
     GetExternalPrinters(account_id)->SetData(std::move(data));
-  else
+  } else if (policy == policy::key::kWallpaperImage) {
+    WallpaperControllerClient::Get()->SetPolicyWallpaper(account_id,
+                                                         std::move(data));
+  } else {
     NOTREACHED();
+  }
 }
 
 void ChromeUserManagerImpl::OnPolicyUpdated(const std::string& user_id) {
diff --git a/chrome/browser/chromeos/login/users/user_manager_unittest.cc b/chrome/browser/chromeos/login/users/user_manager_unittest.cc
index 959ba72..c05e31f 100644
--- a/chrome/browser/chromeos/login/users/user_manager_unittest.cc
+++ b/chrome/browser/chromeos/login/users/user_manager_unittest.cc
@@ -24,6 +24,7 @@
 #include "chrome/test/base/testing_browser_process.h"
 #include "chrome/test/base/testing_profile.h"
 #include "chromeos/chromeos_switches.h"
+#include "chromeos/cryptohome/system_salt_getter.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/settings/cros_settings_names.h"
 #include "components/prefs/pref_service.h"
@@ -182,6 +183,11 @@
 }
 
 TEST_F(UserManagerTest, RemoveAllExceptOwnerFromList) {
+  // System salt is needed to remove user wallpaper.
+  SystemSaltGetter::Initialize();
+  SystemSaltGetter::Get()->SetRawSaltForTesting(
+      SystemSaltGetter::RawSalt({1, 2, 3, 4, 5, 6, 7, 8}));
+
   user_manager::UserManager::Get()->UserLoggedIn(
       owner_account_id_at_invalid_domain_,
       owner_account_id_at_invalid_domain_.GetUserEmail(),
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
index 5af3b0e0..7aee440 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -99,11 +99,6 @@
   return false;
 }
 
-// Call |closure| when HashWallpaperFilesIdStr will not assert().
-void CallWhenCanGetFilesId(const base::Closure& closure) {
-  SystemSaltGetter::Get()->AddOnSystemSaltReady(closure);
-}
-
 // A helper to set the wallpaper image for Classic Ash and Mash.
 void SetWallpaper(const gfx::ImageSkia& image, wallpaper::WallpaperInfo info) {
   if (ash_util::IsRunningInMash()) {
@@ -257,19 +252,6 @@
                      weak_factory_.GetWeakPtr()));
 }
 
-void WallpaperManager::OnPolicyFetched(const std::string& policy,
-                                       const AccountId& account_id,
-                                       std::unique_ptr<std::string> data) {
-  if (!data)
-    return;
-
-  user_image_loader::StartWithData(
-      task_runner_, std::move(data), ImageDecoder::ROBUST_JPEG_CODEC,
-      0,  // Do not crop.
-      base::Bind(&WallpaperManager::SetPolicyControlledWallpaper,
-                 weak_factory_.GetWeakPtr(), account_id));
-}
-
 bool WallpaperManager::IsPolicyControlled(const AccountId& account_id) const {
   if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) {
     // Some unit tests come here without a Shell instance.
@@ -284,28 +266,6 @@
       account_id, is_persistent);
 }
 
-void WallpaperManager::OnPolicySet(const std::string& policy,
-                                   const AccountId& account_id) {
-  WallpaperInfo info;
-  GetUserWallpaperInfo(account_id, &info);
-  info.type = wallpaper::POLICY;
-  SetUserWallpaperInfo(account_id, info, true /*is_persistent=*/);
-}
-
-void WallpaperManager::OnPolicyCleared(const std::string& policy,
-                                       const AccountId& account_id) {
-  WallpaperInfo info;
-  GetUserWallpaperInfo(account_id, &info);
-  info.type = wallpaper::DEFAULT;
-  SetUserWallpaperInfo(account_id, info, true /*is_persistent=*/);
-
-  // If we're at the login screen, do not change the wallpaper but defer it
-  // until the user logs in to the system.
-  if (user_manager::UserManager::Get()->IsUserLoggedIn()) {
-    SetDefaultWallpaperImpl(account_id, true /*show_wallpaper=*/);
-  }
-}
-
 void WallpaperManager::OpenWallpaperPicker() {
   if (wallpaper_manager_util::ShouldUseAndroidWallpapersApp(
           ProfileHelper::Get()->GetProfileByUser(
@@ -465,32 +425,4 @@
       account_id, user->GetType(), show_wallpaper);
 }
 
-void WallpaperManager::SetPolicyControlledWallpaper(
-    const AccountId& account_id,
-    std::unique_ptr<user_manager::UserImage> user_image) {
-  if (!WallpaperControllerClient::Get()->CanGetWallpaperFilesId()) {
-    CallWhenCanGetFilesId(
-        base::Bind(&WallpaperManager::SetPolicyControlledWallpaper,
-                   weak_factory_.GetWeakPtr(), account_id,
-                   base::Passed(std::move(user_image))));
-    return;
-  }
-
-  const wallpaper::WallpaperFilesId wallpaper_files_id =
-      WallpaperControllerClient::Get()->GetFilesId(account_id);
-
-  if (!wallpaper_files_id.is_valid())
-    LOG(FATAL) << "Wallpaper flies id if invalid!";
-
-  // If we're at the login screen, do not change the wallpaper to the user
-  // policy controlled wallpaper but only update the cache. It will be later
-  // updated after the user logs in.
-  WallpaperControllerClient::Get()->SetCustomWallpaper(
-      account_id, wallpaper_files_id, "policy-controlled.jpeg",
-      wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, wallpaper::POLICY,
-      user_image->image(),
-      user_manager::UserManager::Get()
-          ->IsUserLoggedIn() /* update wallpaper */);
-}
-
 }  // namespace chromeos
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
index 9897986..a5c06fa 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
@@ -39,10 +39,6 @@
 class SequencedTaskRunner;
 }  // namespace base
 
-namespace user_manager {
-class UserImage;
-}  // namespace user_manager
-
 namespace chromeos {
 
 // Asserts that the current task is sequenced with any other task that calls
@@ -96,22 +92,9 @@
   // Adds |this| as an observer to various settings.
   void AddObservers();
 
-  // Called when the policy-set wallpaper has been fetched.  Initiates decoding
-  // of the JPEG |data| with a callback to SetPolicyControlledWallpaper().
-  void OnPolicyFetched(const std::string& policy,
-                       const AccountId& account_id,
-                       std::unique_ptr<std::string> data);
-
   // A wrapper of |WallpaperController::IsPolicyControlled|.
   bool IsPolicyControlled(const AccountId& account_id) const;
 
-  // Called when a wallpaper policy has been set for |account_id|.  Blocks user
-  // from changing the wallpaper.
-  void OnPolicySet(const std::string& policy, const AccountId& account_id);
-
-  // Called when the wallpaper policy has been cleared for |account_id|.
-  void OnPolicyCleared(const std::string& policy, const AccountId& account_id);
-
   // Opens the wallpaper picker window.
   void OpenWallpaperPicker();
 
@@ -154,12 +137,6 @@
   void SetDefaultWallpaperImpl(const AccountId& account_id,
                                bool show_wallpaper);
 
-  // Set wallpaper to |user_image| controlled by policy.  (Takes a UserImage
-  // because that's the callback interface provided by UserImageLoader.)
-  void SetPolicyControlledWallpaper(
-      const AccountId& account_id,
-      std::unique_ptr<user_manager::UserImage> user_image);
-
   // Returns the cached logged-in user wallpaper info, or a dummy value under
   // mash.
   wallpaper::WallpaperInfo* GetCachedWallpaperInfo();
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc
index 1e3b8ecf..900a761 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win.cc
+++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc
@@ -449,7 +449,8 @@
   if (id != kSwReporterComponentId)
     return;
 
-  if (event == Events::COMPONENT_NOT_UPDATED) {
+  if (event == Events::COMPONENT_NOT_UPDATED ||
+      event == Events::COMPONENT_UPDATE_ERROR) {
     ReportOnDemandUpdateSucceededHistogram(false);
     std::move(on_error_callback_).Run();
     cus_->RemoveObserver(this);
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc b/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
index 7ca7172c..403d269e 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
+++ b/chrome/browser/component_updater/sw_reporter_installer_win_unittest.cc
@@ -687,7 +687,7 @@
     EXPECT_CALL(mock_cus_, RemoveObserver(_)).Times(AtLeast(1));
   }
 
-  void CreateOnDemandFetcherAndVerifyExpecations(bool can_be_updated) {
+  void CreateOnDemandFetcherAndVerifyExpectations(bool can_be_updated) {
     component_can_be_updated_ = can_be_updated;
 
     fetcher_ = base::MakeUnique<SwReporterOnDemandFetcher>(
@@ -735,7 +735,7 @@
   void FireComponentNotUpdatedEvents() {
     fetcher_->OnEvent(Events::COMPONENT_CHECKING_FOR_UPDATES,
                       kSwReporterComponentId);
-    fetcher_->OnEvent(Events::COMPONENT_NOT_UPDATED, kSwReporterComponentId);
+    fetcher_->OnEvent(Events::COMPONENT_UPDATE_ERROR, kSwReporterComponentId);
 
     EXPECT_TRUE(error_callback_called_);
   }
@@ -750,13 +750,13 @@
 };
 
 TEST_F(SwReporterOnDemandFetcherTest, TestUpdateSuccess) {
-  CreateOnDemandFetcherAndVerifyExpecations(true);
+  CreateOnDemandFetcherAndVerifyExpectations(true);
 
   EXPECT_TRUE(on_demand_update_called_);
 }
 
 TEST_F(SwReporterOnDemandFetcherTest, TestUpdateFailure) {
-  CreateOnDemandFetcherAndVerifyExpecations(false);
+  CreateOnDemandFetcherAndVerifyExpectations(false);
 
   EXPECT_TRUE(on_demand_update_called_);
 }
diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc
index fa1ab9f2..a8c68c49 100644
--- a/chrome/browser/download/download_service_factory.cc
+++ b/chrome/browser/download/download_service_factory.cc
@@ -19,9 +19,9 @@
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/chrome_constants.h"
 #include "components/download/content/factory/download_service_factory.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_service.h"
-#include "components/download/public/task_scheduler.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_service.h"
+#include "components/download/public/background_service/task_scheduler.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/offline_pages/features/features.h"
 #include "content/public/browser/browser_context.h"
diff --git a/chrome/browser/download/download_task_scheduler_impl.cc b/chrome/browser/download/download_task_scheduler_impl.cc
index 175d9a3..463e2b0b 100644
--- a/chrome/browser/download/download_task_scheduler_impl.cc
+++ b/chrome/browser/download/download_task_scheduler_impl.cc
@@ -12,7 +12,7 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/time.h"
 #include "chrome/browser/download/download_service_factory.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/download_service.h"
 #include "content/public/browser/browser_context.h"
 
 DownloadTaskSchedulerImpl::DownloadTaskSchedulerImpl(
diff --git a/chrome/browser/download/download_task_scheduler_impl.h b/chrome/browser/download/download_task_scheduler_impl.h
index dfac6bd..dddc77e 100644
--- a/chrome/browser/download/download_task_scheduler_impl.h
+++ b/chrome/browser/download/download_task_scheduler_impl.h
@@ -10,7 +10,7 @@
 #include "base/cancelable_callback.h"
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/public/task_scheduler.h"
+#include "components/download/public/background_service/task_scheduler.h"
 
 namespace content {
 class BrowserContext;
diff --git a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
index 8bfaa06..343c71d 100644
--- a/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
+++ b/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
@@ -187,7 +187,8 @@
 
 // Flaky on Windows: http://crbug.com/301887
 // Fails on Chrome OS: http://crbug.com/718512
-#if defined(OS_WIN) || defined(OS_CHROMEOS)
+// Flaky on macOS: http://crbug.com/804897
+#if defined(OS_WIN) || defined(OS_CHROMEOS) || defined(OS_MACOSX)
 #define MAYBE_ChooseDesktopMedia DISABLED_ChooseDesktopMedia
 #else
 #define MAYBE_ChooseDesktopMedia ChooseDesktopMedia
diff --git a/chrome/browser/media/cast_transport_host_filter.cc b/chrome/browser/media/cast_transport_host_filter.cc
index 855617971..d6b8377 100644
--- a/chrome/browser/media/cast_transport_host_filter.cc
+++ b/chrome/browser/media/cast_transport_host_filter.cc
@@ -13,6 +13,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/common/service_manager_connection.h"
 #include "media/cast/net/cast_transport.h"
+#include "media/cast/net/udp_transport_impl.h"
 #include "mojo/public/cpp/bindings/interface_request.h"
 #include "net/url_request/url_request_context.h"
 #include "services/device/public/interfaces/constants.mojom.h"
@@ -173,13 +174,11 @@
     id_map_.Remove(channel_id);
   }
 
-  std::unique_ptr<media::cast::UdpTransport> udp_transport(
-      new media::cast::UdpTransport(
-          url_request_context_getter_->GetURLRequestContext()->net_log(),
-          base::ThreadTaskRunnerHandle::Get(), local_end_point,
-          remote_end_point,
-          base::Bind(&CastTransportHostFilter::OnStatusChanged,
-                     weak_factory_.GetWeakPtr(), channel_id)));
+  auto udp_transport = std::make_unique<media::cast::UdpTransportImpl>(
+      url_request_context_getter_->GetURLRequestContext()->net_log(),
+      base::ThreadTaskRunnerHandle::Get(), local_end_point, remote_end_point,
+      base::BindRepeating(&CastTransportHostFilter::OnStatusChanged,
+                          weak_factory_.GetWeakPtr(), channel_id));
   udp_transport->SetUdpOptions(options);
   std::unique_ptr<media::cast::CastTransport> transport =
       media::cast::CastTransport::Create(
@@ -228,8 +227,9 @@
       remoting_sender_map_.AddWithID(
           std::make_unique<CastRemotingSender>(
               transport, config, kSendEventsInterval,
-              base::Bind(&CastTransportHostFilter::OnCastRemotingSenderEvents,
-                         weak_factory_.GetWeakPtr(), channel_id)),
+              base::BindRepeating(
+                  &CastTransportHostFilter::OnCastRemotingSenderEvents,
+                  weak_factory_.GetWeakPtr(), channel_id)),
           config.rtp_stream_id);
       DVLOG(3) << "Create CastRemotingSender for stream: "
                << config.rtp_stream_id;
diff --git a/chrome/browser/media/cast_transport_host_filter.h b/chrome/browser/media/cast_transport_host_filter.h
index e6681eb..42f5505 100644
--- a/chrome/browser/media/cast_transport_host_filter.h
+++ b/chrome/browser/media/cast_transport_host_filter.h
@@ -19,7 +19,6 @@
 #include "media/cast/cast_sender.h"
 #include "media/cast/logging/logging_defines.h"
 #include "media/cast/net/cast_transport.h"
-#include "media/cast/net/udp_transport.h"
 #include "net/url_request/url_request_context_getter.h"
 #include "services/device/public/interfaces/wake_lock.mojom.h"
 
diff --git a/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.cc b/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.cc
index b6b28ea4..b40b3d8a 100644
--- a/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.cc
+++ b/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.cc
@@ -11,7 +11,7 @@
 #include "base/logging.h"
 #include "chrome/browser/download/download_service_factory.h"
 #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h"
-#include "components/download/public/download_metadata.h"
+#include "components/download/public/background_service/download_metadata.h"
 #include "components/offline_pages/core/prefetch/prefetch_downloader.h"
 #include "components/offline_pages/core/prefetch/prefetch_service.h"
 
diff --git a/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.h b/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.h
index f25f65c..2ba25d9 100644
--- a/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.h
+++ b/chrome/browser/offline_pages/prefetch/offline_prefetch_download_client.h
@@ -6,7 +6,7 @@
 #define CHROME_BROWSER_OFFLINE_PAGES_PREFETCH_OFFLINE_PREFETCH_DOWNLOAD_CLIENT_H_
 
 #include "base/macros.h"
-#include "components/download/public/client.h"
+#include "components/download/public/background_service/client.h"
 
 namespace content {
 class BrowserContext;
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc
index 528d987..24f40fc 100644
--- a/chrome/browser/plugins/plugin_observer.cc
+++ b/chrome/browser/plugins/plugin_observer.cc
@@ -109,6 +109,7 @@
         plugin_renderer_interface_->UpdateDownloading();
         break;
       case Events::COMPONENT_NOT_UPDATED:
+      case Events::COMPONENT_UPDATE_ERROR:
         plugin_renderer_interface_->UpdateFailure();
         observer_->RemoveComponentObserver(this);
         break;
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc
index 6473503..866f4e59 100644
--- a/chrome/browser/prerender/prerender_browsertest.cc
+++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -156,6 +156,9 @@
 using prerender::test_utils::TestPrerenderContents;
 using task_manager::browsertest_util::WaitForTaskManagerRows;
 
+// crbug.com/708158
+#if !defined(OS_MACOSX) || !defined(ADDRESS_SANITIZER)
+
 // Prerender tests work as follows:
 //
 // A page with a prefetch link to the test page is loaded.  Once prerendered,
@@ -3859,3 +3862,5 @@
 #endif  // BUILDFLAG(ENABLE_NACL)
 
 }  // namespace prerender
+
+#endif  // !defined(OS_MACOSX) || !defined(ADDRESS_SANITIZER)
diff --git a/chrome/browser/prerender/prerender_config.cc b/chrome/browser/prerender/prerender_config.cc
index a41daa6..f0cc0e5 100644
--- a/chrome/browser/prerender/prerender_config.cc
+++ b/chrome/browser/prerender/prerender_config.cc
@@ -4,18 +4,6 @@
 
 #include "chrome/browser/prerender/prerender_config.h"
 
-namespace {
-
-// The test_timeouts.cc defines general timeout multipliers for Asan builds.
-// Increase the timeout similarly here.
-#if defined(ADDRESS_SANITIZER)
-constexpr int kTimeToLiveMinutes = 10;
-#else
-constexpr int kTimeToLiveMinutes = 5;
-#endif
-
-}  // namespace
-
 namespace prerender {
 
 Config::Config()
@@ -24,7 +12,7 @@
       max_link_concurrency_per_launcher(1),
       rate_limit_enabled(true),
       max_wait_to_launch(base::TimeDelta::FromMinutes(4)),
-      time_to_live(base::TimeDelta::FromMinutes(kTimeToLiveMinutes)),
+      time_to_live(base::TimeDelta::FromMinutes(5)),
       abandon_time_to_live(base::TimeDelta::FromSeconds(3)),
       default_tab_bounds(640, 480),
       is_overriding_user_agent(false) {}
diff --git a/chrome/browser/resources/md_downloads/manager.html b/chrome/browser/resources/md_downloads/manager.html
index c8c6836..e106ac3 100644
--- a/chrome/browser/resources/md_downloads/manager.html
+++ b/chrome/browser/resources/md_downloads/manager.html
@@ -23,6 +23,7 @@
         flex: 1 0;
         flex-direction: column;
         height: 100%;
+        overflow: hidden;
         z-index: 0;
       }
 
diff --git a/chrome/browser/resources/print_preview/data/destination_match.js b/chrome/browser/resources/print_preview/data/destination_match.js
index 260a6411..84cb9c01 100644
--- a/chrome/browser/resources/print_preview/data/destination_match.js
+++ b/chrome/browser/resources/print_preview/data/destination_match.js
@@ -106,11 +106,12 @@
     }
 
     /**
-     * @return {?print_preview.PrinterType} The printer type of this
-     *     destination match. Will return null for Cloud destinations.
+     * @return {!Set<?print_preview.PrinterType>} The printer types that
+     *     correspond to this destination match. A null element in the set
+     *     indicates the match may represent a Cloud destination.
      */
-    getType() {
-      return originToType(this.origins_[0]);
+    getTypes() {
+      return new Set(this.origins_.map(origin => originToType(origin)));
     }
   }
 
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js
index 975c687..6bb7629 100644
--- a/chrome/browser/resources/print_preview/data/destination_store.js
+++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -530,16 +530,18 @@
      */
     fetchMatchingDestination_(destinationMatch) {
       this.autoSelectMatchingDestination_ = destinationMatch;
-      const type = destinationMatch.getType();
-      if (type != null) {  // Local, Privet, or Extension.
-        this.startLoadDestinations(type);
-      } else if (
-          destinationMatch.matchOrigin(
-              print_preview.DestinationOrigin.COOKIES) ||
-          destinationMatch.matchOrigin(
-              print_preview.DestinationOrigin.DEVICE)) {
-        this.startLoadCloudDestinations();
-      }
+      const types = destinationMatch.getTypes();
+      types.forEach(type => {
+        if (type != null) {  // Local, extension, or privet printer
+          this.startLoadDestinations(type);
+        } else if (
+            destinationMatch.matchOrigin(
+                print_preview.DestinationOrigin.COOKIES) ||
+            destinationMatch.matchOrigin(
+                print_preview.DestinationOrigin.DEVICE)) {
+          this.startLoadCloudDestinations();
+        }
+      });
     }
 
     /**
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 45c882a..b8ea968 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -30,11 +30,13 @@
 #include "base/values.h"
 #include "build/build_config.h"
 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
+#include "chrome/browser/browser_process.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/history/history_service_factory.h"
 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
 #include "chrome/browser/lifetime/application_lifetime.h"
 #include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/profiles/profiles_state.h"
 #include "chrome/browser/search_engines/template_url_service_factory.h"
 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
 #include "chrome/browser/signin/signin_manager_factory.h"
@@ -216,6 +218,7 @@
 SyncTest::SyncTest(TestType test_type)
     : test_type_(test_type),
       server_type_(SERVER_TYPE_UNDECIDED),
+      previous_profile_(nullptr),
       num_clients_(-1),
       configuration_refresher_(std::make_unique<ConfigurationRefresher>()),
       use_verifier_(true),
@@ -351,6 +354,10 @@
     // For multi profile UI signin, profile paths should be outside user data
     // dir to allow signing-in multiple profiles to same account. Otherwise, we
     // get an error that the profile has already signed in on this device.
+    // Note: Various places in Chrome assume that all profiles are within the
+    // user data dir. We violate that assumption here, which can lead to weird
+    // issues, see https://crbug.com/801569 and the workaround in
+    // TearDownOnMainThread.
     if (!tmp_profile_paths_[index]->CreateUniqueTempDir()) {
       ADD_FAILURE();
       return false;
@@ -519,6 +526,9 @@
 }
 
 bool SyncTest::SetupClients() {
+  previous_profile_ =
+      g_browser_process->profile_manager()->GetLastUsedProfile();
+
   base::ScopedAllowBlockingForTesting allow_blocking;
   if (num_clients_ <= 0)
     LOG(FATAL) << "num_clients_ incorrectly initialized.";
@@ -752,6 +762,17 @@
 }
 
 void SyncTest::TearDownOnMainThread() {
+  // Workaround for https://crbug.com/801569: |prefs::kProfileLastUsed| stores
+  // the profile path relative to the user dir, but our testing profiles are
+  // outside the user dir (see CreateProfile). So code trying to access the last
+  // used profile by path will fail. To work around that, set the last used
+  // profile back to the originally created default profile (which does live in
+  // the user data dir, and which we don't use otherwise).
+  if (previous_profile_) {
+    profiles::SetLastUsedProfile(
+        previous_profile_->GetPath().BaseName().MaybeAsASCII());
+  }
+
   for (size_t i = 0; i < clients_.size(); ++i) {
     clients_[i]->service()->RequestStop(ProfileSyncService::CLEAR_DATA);
   }
diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h
index 40fa6da5..f13cd6d 100644
--- a/chrome/browser/sync/test/integration/sync_test.h
+++ b/chrome/browser/sync/test/integration/sync_test.h
@@ -395,6 +395,11 @@
   // server types).
   ServerType server_type_;
 
+  // The default profile, created before our actual testing |profiles_|. This is
+  // needed in a workaround for https://crbug.com/801569, see comments in the
+  // .cc file.
+  Profile* previous_profile_;
+
   // Number of sync clients that will be created by a test.
   int num_clients_;
 
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
index 1ad1d1bd..fcc50af0 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
@@ -42,11 +42,6 @@
     arc::mojom::OrientationLock orientation_lock) {
   DCHECK_NE(arc::mojom::OrientationLock::CURRENT, orientation_lock);
 
-  // In Android, "portrait" means 90 degrees counterclockwise rotation
-  // on naturally landscape devices.
-  bool reverse_portrait_orientation =
-      natural_orientation == blink::kWebScreenOrientationLockLandscape;
-
   switch (orientation_lock) {
     case arc::mojom::OrientationLock::PORTRAIT:
       return blink::kWebScreenOrientationLockPortrait;
@@ -56,16 +51,10 @@
       return blink::kWebScreenOrientationLockLandscapePrimary;
     case arc::mojom::OrientationLock::LANDSCAPE_SECONDARY:
       return blink::kWebScreenOrientationLockLandscapeSecondary;
-
     case arc::mojom::OrientationLock::PORTRAIT_PRIMARY:
-      return reverse_portrait_orientation
-                 ? blink::kWebScreenOrientationLockPortraitSecondary
-                 : blink::kWebScreenOrientationLockPortraitPrimary;
-
+      return blink::kWebScreenOrientationLockPortraitPrimary;
     case arc::mojom::OrientationLock::PORTRAIT_SECONDARY:
-      return reverse_portrait_orientation
-                 ? blink::kWebScreenOrientationLockPortraitPrimary
-                 : blink::kWebScreenOrientationLockPortraitSecondary;
+      return blink::kWebScreenOrientationLockPortraitSecondary;
     default:
       return blink::kWebScreenOrientationLockAny;
   }
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
index 869d7af9..c30e435 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -3945,11 +3945,11 @@
     EXPECT_EQ(display::Display::ROTATE_0,
               display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
-    // Create a arc window with PORTRAIT orientation locks the screen to 90.
+    // Create a arc window with PORTRAIT orientation locks the screen to 270.
     window_portrait_ = CreateArcWindow(window_app_id_portrait_);
     NotifyOnTaskCreated(appinfo_portrait_, task_id_portrait_);
     EXPECT_TRUE(controller->rotation_locked());
-    EXPECT_EQ(display::Display::ROTATE_90,
+    EXPECT_EQ(display::Display::ROTATE_270,
               display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
     // Create a arc window with LANDSCAPE orientation locks the screen to 0.
@@ -4066,7 +4066,7 @@
 
   EnableTabletMode(true);
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   std::string app_id2("org.chromium.arc.2");
@@ -4078,7 +4078,7 @@
   NotifyOnTaskCreated(appinfo2, task_id2);
   NotifyOnTaskOrientationLockRequested(task_id2, OrientationLock::LANDSCAPE);
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   // The screen will be locked when the window is created.
@@ -4107,10 +4107,10 @@
   EXPECT_EQ(display::Display::ROTATE_0,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
-  // Activating a window with PORTRAIT orientation locks the screen to 90.
+  // Activating a window with PORTRAIT orientation locks the screen to 270.
   window_portrait_->Activate();
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   // Disable Tablet mode, and make sure the screen is unlocked.
@@ -4119,15 +4119,15 @@
   EXPECT_EQ(display::Display::ROTATE_0,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
-  // Re-enable Tablet mode, and make sure the screen is locked to 90.
+  // Re-enable Tablet mode, and make sure the screen is locked to 270.
   EnableTabletMode(true);
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   window_portrait_->Activate();
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   window_landscape_->Activate();
@@ -4145,14 +4145,14 @@
   NotifyOnTaskOrientationLockRequested(task_id_landscape_,
                                        OrientationLock::PORTRAIT);
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   // Non active window won't change the lock.
   NotifyOnTaskOrientationLockRequested(task_id_none_,
                                        OrientationLock::LANDSCAPE);
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   // But activating it will change the locked orinetation.
@@ -4177,7 +4177,7 @@
   // enabled.
   EnableTabletMode(true);
   EXPECT_TRUE(controller->rotation_locked());
-  EXPECT_EQ(display::Display::ROTATE_90,
+  EXPECT_EQ(display::Display::ROTATE_270,
             display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
 
   // Manually unlock first.
diff --git a/chrome/browser/ui/ash/test_wallpaper_controller.cc b/chrome/browser/ui/ash/test_wallpaper_controller.cc
index 406c591..7fd34e0f 100644
--- a/chrome/browser/ui/ash/test_wallpaper_controller.cc
+++ b/chrome/browser/ui/ash/test_wallpaper_controller.cc
@@ -33,7 +33,6 @@
     const std::string& wallpaper_files_id,
     const std::string& file_name,
     wallpaper::WallpaperLayout layout,
-    wallpaper::WallpaperType type,
     const SkBitmap& image,
     bool show_wallpaper) {
   set_custom_wallpaper_count_++;
@@ -62,6 +61,13 @@
   NOTIMPLEMENTED();
 }
 
+void TestWallpaperController::SetPolicyWallpaper(
+    ash::mojom::WallpaperUserInfoPtr user_info,
+    const std::string& wallpaper_files_id,
+    const std::string& data) {
+  NOTIMPLEMENTED();
+}
+
 void TestWallpaperController::SetDeviceWallpaperPolicyEnforced(bool enforced) {
   NOTIMPLEMENTED();
 }
@@ -87,6 +93,12 @@
   remove_user_wallpaper_count_++;
 }
 
+void TestWallpaperController::RemovePolicyWallpaper(
+    ash::mojom::WallpaperUserInfoPtr user_info,
+    const std::string& wallpaper_files_id) {
+  NOTIMPLEMENTED();
+}
+
 void TestWallpaperController::SetWallpaper(
     const SkBitmap& wallpaper,
     const wallpaper::WallpaperInfo& wallpaper_info) {
diff --git a/chrome/browser/ui/ash/test_wallpaper_controller.h b/chrome/browser/ui/ash/test_wallpaper_controller.h
index 5519eb76f..28275a2 100644
--- a/chrome/browser/ui/ash/test_wallpaper_controller.h
+++ b/chrome/browser/ui/ash/test_wallpaper_controller.h
@@ -41,7 +41,6 @@
                           const std::string& wallpaper_files_id,
                           const std::string& file_name,
                           wallpaper::WallpaperLayout layout,
-                          wallpaper::WallpaperType type,
                           const SkBitmap& image,
                           bool show_wallpaper) override;
   void SetOnlineWallpaper(ash::mojom::WallpaperUserInfoPtr user_info,
@@ -56,6 +55,9 @@
       const GURL& wallpaper_url,
       const base::FilePath& file_path,
       const base::FilePath& resized_directory) override;
+  void SetPolicyWallpaper(ash::mojom::WallpaperUserInfoPtr user_info,
+                          const std::string& wallpaper_files_id,
+                          const std::string& data) override;
   void SetDeviceWallpaperPolicyEnforced(bool enforced) override;
   void UpdateCustomWallpaperLayout(ash::mojom::WallpaperUserInfoPtr user_info,
                                    wallpaper::WallpaperLayout layout) override;
@@ -63,6 +65,8 @@
   void ShowSigninWallpaper() override;
   void RemoveUserWallpaper(ash::mojom::WallpaperUserInfoPtr user_info,
                            const std::string& wallpaper_files_id) override;
+  void RemovePolicyWallpaper(ash::mojom::WallpaperUserInfoPtr user_info,
+                             const std::string& wallpaper_files_id) override;
   void SetWallpaper(const SkBitmap& wallpaper,
                     const wallpaper::WallpaperInfo& wallpaper_info) override;
   void AddObserver(
diff --git a/chrome/browser/ui/ash/wallpaper_controller_client.cc b/chrome/browser/ui/ash/wallpaper_controller_client.cc
index c2344602..a0dbf583 100644
--- a/chrome/browser/ui/ash/wallpaper_controller_client.cc
+++ b/chrome/browser/ui/ash/wallpaper_controller_client.cc
@@ -84,15 +84,29 @@
   return wallpaper::WallpaperFilesId::FromString(result);
 }
 
+// Returns true if wallpaper files id can be returned successfully.
+bool CanGetFilesId() {
+  return chromeos::SystemSaltGetter::IsInitialized() &&
+         chromeos::SystemSaltGetter::Get()->GetRawSalt();
+}
+
+// Calls |callback| when system salt is ready. (|CanGetFilesId| returns true.)
+void AddCanGetFilesIdCallback(const base::Closure& callback) {
+  // System salt may not be initialized in tests.
+  if (chromeos::SystemSaltGetter::IsInitialized())
+    chromeos::SystemSaltGetter::Get()->AddOnSystemSaltReady(callback);
+}
+
 }  // namespace
 
 WallpaperControllerClient::WallpaperControllerClient()
-    : policy_handler_(this), binding_(this) {
+    : policy_handler_(this), binding_(this), weak_factory_(this) {
   DCHECK(!g_wallpaper_controller_client_instance);
   g_wallpaper_controller_client_instance = this;
 }
 
 WallpaperControllerClient::~WallpaperControllerClient() {
+  weak_factory_.InvalidateWeakPtrs();
   DCHECK_EQ(this, g_wallpaper_controller_client_instance);
   g_wallpaper_controller_client_instance = nullptr;
 }
@@ -115,28 +129,17 @@
   return g_wallpaper_controller_client_instance;
 }
 
-bool WallpaperControllerClient::CanGetWallpaperFilesId() const {
-  return chromeos::SystemSaltGetter::IsInitialized() &&
-         chromeos::SystemSaltGetter::Get()->GetRawSalt();
-}
-
 wallpaper::WallpaperFilesId WallpaperControllerClient::GetFilesId(
     const AccountId& account_id) const {
-  // System salt might not be ready in tests. Thus we don't have a valid
-  // wallpaper files id here.
-  if (!CanGetWallpaperFilesId())
-    return wallpaper::WallpaperFilesId();
-
+  DCHECK(CanGetFilesId());
   std::string stored_value;
   if (user_manager::known_user::GetStringPref(account_id, kWallpaperFilesId,
                                               &stored_value)) {
     return wallpaper::WallpaperFilesId::FromString(stored_value);
   }
 
-  // Migrated.
-  const std::string& old_id = account_id.GetUserEmail();
   const wallpaper::WallpaperFilesId wallpaper_files_id =
-      HashWallpaperFilesIdStr(old_id);
+      HashWallpaperFilesIdStr(account_id.GetUserEmail());
   user_manager::known_user::SetStringPref(account_id, kWallpaperFilesId,
                                           wallpaper_files_id.id());
   return wallpaper_files_id;
@@ -147,7 +150,6 @@
     const wallpaper::WallpaperFilesId& wallpaper_files_id,
     const std::string& file_name,
     wallpaper::WallpaperLayout layout,
-    wallpaper::WallpaperType type,
     const gfx::ImageSkia& image,
     bool show_wallpaper) {
   ash::mojom::WallpaperUserInfoPtr user_info =
@@ -155,7 +157,7 @@
   if (!user_info)
     return;
   wallpaper_controller_->SetCustomWallpaper(
-      std::move(user_info), wallpaper_files_id.id(), file_name, layout, type,
+      std::move(user_info), wallpaper_files_id.id(), file_name, layout,
       *image.bitmap(), show_wallpaper);
 }
 
@@ -179,6 +181,18 @@
       AccountIdToWallpaperUserInfo(account_id);
   if (!user_info)
     return;
+
+  // Postpone setting the wallpaper until we can get files id.
+  if (!CanGetFilesId()) {
+    LOG(WARNING)
+        << "Cannot get wallpaper files id in SetDefaultWallpaper. This "
+           "should never happen under normal circumstances.";
+    AddCanGetFilesIdCallback(
+        base::Bind(&WallpaperControllerClient::SetDefaultWallpaper,
+                   weak_factory_.GetWeakPtr(), account_id, show_wallpaper));
+    return;
+  }
+
   wallpaper_controller_->SetDefaultWallpaper(
       std::move(user_info), GetFilesId(account_id).id(), show_wallpaper);
 }
@@ -191,6 +205,30 @@
                                                        resized_directory);
 }
 
+void WallpaperControllerClient::SetPolicyWallpaper(
+    const AccountId& account_id,
+    std::unique_ptr<std::string> data) {
+  if (!data)
+    return;
+
+  ash::mojom::WallpaperUserInfoPtr user_info =
+      AccountIdToWallpaperUserInfo(account_id);
+  if (!user_info)
+    return;
+
+  // Postpone setting the wallpaper until we can get files id. See
+  // https://crbug.com/615239.
+  if (!CanGetFilesId()) {
+    AddCanGetFilesIdCallback(base::Bind(
+        &WallpaperControllerClient::SetPolicyWallpaper,
+        weak_factory_.GetWeakPtr(), account_id, base::Passed(std::move(data))));
+    return;
+  }
+
+  wallpaper_controller_->SetPolicyWallpaper(std::move(user_info),
+                                            GetFilesId(account_id).id(), *data);
+}
+
 void WallpaperControllerClient::UpdateCustomWallpaperLayout(
     const AccountId& account_id,
     wallpaper::WallpaperLayout layout) {
@@ -220,10 +258,44 @@
       AccountIdToWallpaperUserInfo(account_id);
   if (!user_info)
     return;
+
+  // Postpone removing the wallpaper until we can get files id.
+  if (!CanGetFilesId()) {
+    LOG(WARNING)
+        << "Cannot get wallpaper files id in RemoveUserWallpaper. This "
+           "should never happen under normal circumstances.";
+    AddCanGetFilesIdCallback(
+        base::Bind(&WallpaperControllerClient::RemoveUserWallpaper,
+                   weak_factory_.GetWeakPtr(), account_id));
+    return;
+  }
+
   wallpaper_controller_->RemoveUserWallpaper(std::move(user_info),
                                              GetFilesId(account_id).id());
 }
 
+void WallpaperControllerClient::RemovePolicyWallpaper(
+    const AccountId& account_id) {
+  ash::mojom::WallpaperUserInfoPtr user_info =
+      AccountIdToWallpaperUserInfo(account_id);
+  if (!user_info)
+    return;
+
+  // Postpone removing the wallpaper until we can get files id.
+  if (!CanGetFilesId()) {
+    LOG(WARNING)
+        << "Cannot get wallpaper files id in RemovePolicyWallpaper. This "
+           "should never happen under normal circumstances.";
+    AddCanGetFilesIdCallback(
+        base::Bind(&WallpaperControllerClient::RemovePolicyWallpaper,
+                   weak_factory_.GetWeakPtr(), account_id));
+    return;
+  }
+
+  wallpaper_controller_->RemovePolicyWallpaper(std::move(user_info),
+                                               GetFilesId(account_id).id());
+}
+
 void WallpaperControllerClient::OpenWallpaperPicker() {
   // TODO(crbug.com/776464): Inline the implementation after WallpaperManager
   // is removed.
diff --git a/chrome/browser/ui/ash/wallpaper_controller_client.h b/chrome/browser/ui/ash/wallpaper_controller_client.h
index 921c1c7..d4e780c 100644
--- a/chrome/browser/ui/ash/wallpaper_controller_client.h
+++ b/chrome/browser/ui/ash/wallpaper_controller_client.h
@@ -32,10 +32,6 @@
 
   static WallpaperControllerClient* Get();
 
-  // TODO(crbug.com/776464): Move this to anonymous namesapce.
-  // Returns true if wallpaper files id can be returned successfully.
-  bool CanGetWallpaperFilesId() const;
-
   // Returns files identifier for the |account_id|.
   wallpaper::WallpaperFilesId GetFilesId(const AccountId& account_id) const;
 
@@ -44,7 +40,6 @@
                           const wallpaper::WallpaperFilesId& wallpaper_files_id,
                           const std::string& file_name,
                           wallpaper::WallpaperLayout layout,
-                          wallpaper::WallpaperType type,
                           const gfx::ImageSkia& image,
                           bool show_wallpaper);
   void SetOnlineWallpaper(const AccountId& account_id,
@@ -56,11 +51,14 @@
   void SetCustomizedDefaultWallpaper(const GURL& wallpaper_url,
                                      const base::FilePath& file_path,
                                      const base::FilePath& resized_directory);
+  void SetPolicyWallpaper(const AccountId& account_id,
+                          std::unique_ptr<std::string> data);
   void UpdateCustomWallpaperLayout(const AccountId& account_id,
                                    wallpaper::WallpaperLayout layout);
   void ShowUserWallpaper(const AccountId& account_id);
   void ShowSigninWallpaper();
   void RemoveUserWallpaper(const AccountId& account_id);
+  void RemovePolicyWallpaper(const AccountId& account_id);
 
   // ash::mojom::WallpaperControllerClient:
   void OpenWallpaperPicker() override;
@@ -84,6 +82,8 @@
   // Binds to the client interface.
   mojo::Binding<ash::mojom::WallpaperControllerClient> binding_;
 
+  base::WeakPtrFactory<WallpaperControllerClient> weak_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(WallpaperControllerClient);
 };
 
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index e9e56a0..ebc0098c 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -110,15 +110,12 @@
 
 // ui::DialogModel -------------------------------------------------------------
 
-int BookmarkBubbleView::GetDialogButtons() const {
-  // TODO(tapted): DialogClientView should manage the ios promo buttons too.
-  return is_showing_ios_promotion_
-             ? ui::DIALOG_BUTTON_NONE
-             : (ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL);
-}
-
 base::string16 BookmarkBubbleView::GetDialogButtonLabel(
     ui::DialogButton button) const {
+#if defined(OS_WIN)
+  if (is_showing_ios_promotion_)
+    return ios_promo_view_->GetDialogButtonLabel(button);
+#endif
   return l10n_util::GetStringUTF16((button == ui::DIALOG_BUTTON_OK)
                                        ? IDS_DONE
                                        : IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK);
@@ -148,11 +145,8 @@
 
 gfx::ImageSkia BookmarkBubbleView::GetWindowIcon() {
 #if defined(OS_WIN)
-  if (is_showing_ios_promotion_) {
-    return desktop_ios_promotion::GetPromoImage(
-        GetNativeTheme()->GetSystemColor(
-            ui::NativeTheme::kColorId_TextfieldDefaultColor));
-  }
+  if (is_showing_ios_promotion_)
+    return ios_promo_view_->GetWindowIcon();
 #endif
   return gfx::ImageSkia();
 }
@@ -221,6 +215,10 @@
 }
 
 bool BookmarkBubbleView::Cancel() {
+#if defined(OS_WIN)
+  if (is_showing_ios_promotion_)
+    return ios_promo_view_->Cancel();
+#endif
   base::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"));
   // Set this so we remove the bookmark after the window closes.
   remove_bookmark_ = true;
@@ -230,6 +228,8 @@
 
 bool BookmarkBubbleView::Accept() {
 #if defined(OS_WIN)
+  if (is_showing_ios_promotion_)
+    return ios_promo_view_->Accept();
   using desktop_ios_promotion::PromotionEntryPoint;
   if (desktop_ios_promotion::IsEligibleForIOSPromotion(
           profile_, PromotionEntryPoint::BOOKMARKS_BUBBLE)) {
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
index d9056003..ece34925 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h
@@ -67,7 +67,6 @@
   ~BookmarkBubbleView() override;
 
   // LocationBarBubbleDelegateView:
-  int GetDialogButtons() const override;
   base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
   View* GetInitiallyFocusedView() override;
   base::string16 GetWindowTitle() const override;
diff --git a/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc b/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc
index 0a50126..5502126 100644
--- a/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc
+++ b/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.cc
@@ -15,9 +15,7 @@
 #include "chrome/grit/locale_settings.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
-#include "ui/views/controls/button/button.h"
-#include "ui/views/controls/button/md_text_button.h"
-#include "ui/views/layout/grid_layout.h"
+#include "ui/views/layout/fill_layout.h"
 
 namespace {
 // Returns the appropriate size for the promotion text label on the bubble.
@@ -42,62 +40,26 @@
           std::make_unique<DesktopIOSPromotionBubbleController>(profile,
                                                                 this,
                                                                 entry_point)) {
-  views::GridLayout* layout =
-      SetLayoutManager(std::make_unique<views::GridLayout>(this));
-  ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
-  SetBorder(views::CreateEmptyBorder(
-      0,
-      provider->GetInsetsMetric(views::INSETS_DIALOG).left() +
-          desktop_ios_promotion::GetPromoImage(
-              GetNativeTheme()->GetSystemColor(
-                  ui::NativeTheme::kColorId_TextfieldDefaultColor))
-              .width(),
-      0, 0));
-  send_sms_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
-      this, l10n_util::GetStringUTF16(IDS_DESKTOP_TO_IOS_PROMO_SEND_TO_PHONE));
-  no_button_ = views::MdTextButton::CreateSecondaryUiButton(
-      this, l10n_util::GetStringUTF16(IDS_DESKTOP_TO_IOS_PROMO_NO_THANKS));
-  constexpr int kLabelColumnSet = 1;
-  views::ColumnSet* column_set = layout->AddColumnSet(kLabelColumnSet);
-  column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 0,
-                        views::GridLayout::USE_PREF, 0, 0);
-  constexpr int kDoubleButtonColumnSet = 2;
-  column_set = layout->AddColumnSet(kDoubleButtonColumnSet);
-  column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER,
-                        1, views::GridLayout::USE_PREF, 0, 0);
-  column_set->AddPaddingColumn(
-      0,
-      provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL));
-  column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER,
-                        0, views::GridLayout::USE_PREF, 0, 0);
+  SetLayoutManager(std::make_unique<views::FillLayout>());
+  SetBorder(
+      views::CreateEmptyBorder(0,
+                               ChromeLayoutProvider::Get()
+                                       ->GetInsetsMetric(views::INSETS_DIALOG)
+                                       .left() +
+                                   GetWindowIcon().width(),
+                               0, 0));
+
   promotion_text_label_->SetEnabledColor(SK_ColorGRAY);
   promotion_text_label_->SetMultiLine(true);
   promotion_text_label_->SizeToFit(GetPromoBubbleTextLabelWidth(entry_point));
   promotion_text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
-  layout->StartRow(0, kLabelColumnSet);
-  layout->AddView(promotion_text_label_);
-  layout->AddPaddingRow(0, provider->GetDistanceMetric(
-                               views::DISTANCE_UNRELATED_CONTROL_VERTICAL));
-  layout->StartRow(0, kDoubleButtonColumnSet);
-  layout->AddView(send_sms_button_);
-  layout->AddView(no_button_);
+  AddChildView(promotion_text_label_);
+
   promotion_controller_->OnPromotionShown();
 }
 
 DesktopIOSPromotionBubbleView::~DesktopIOSPromotionBubbleView() = default;
 
-void DesktopIOSPromotionBubbleView::ButtonPressed(views::Button* sender,
-                                                  const ui::Event& event) {
-  if (sender == send_sms_button_) {
-    promotion_controller_->OnSendSMSClicked();
-  } else if (sender == no_button_) {
-    promotion_controller_->OnNoThanksClicked();
-  } else {
-    NOTREACHED();
-  }
-  GetWidget()->Close();
-}
-
 void DesktopIOSPromotionBubbleView::UpdateRecoveryPhoneLabel() {
   std::string number = promotion_controller_->GetUsersRecoveryPhoneNumber();
   if (!number.empty()) {
@@ -111,3 +73,25 @@
     widget->SetBounds(old_bounds);
   }
 }
+
+bool DesktopIOSPromotionBubbleView::Accept() {
+  promotion_controller_->OnSendSMSClicked();
+  return true;
+}
+
+bool DesktopIOSPromotionBubbleView::Cancel() {
+  promotion_controller_->OnNoThanksClicked();
+  return true;
+}
+
+base::string16 DesktopIOSPromotionBubbleView::GetDialogButtonLabel(
+    ui::DialogButton button) const {
+  return l10n_util::GetStringUTF16(button == ui::DIALOG_BUTTON_OK
+                                       ? IDS_DESKTOP_TO_IOS_PROMO_SEND_TO_PHONE
+                                       : IDS_DESKTOP_TO_IOS_PROMO_NO_THANKS);
+}
+
+gfx::ImageSkia DesktopIOSPromotionBubbleView::GetWindowIcon() {
+  return desktop_ios_promotion::GetPromoImage(GetNativeTheme()->GetSystemColor(
+      ui::NativeTheme::kColorId_TextfieldDefaultColor));
+}
diff --git a/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.h b/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.h
index 7fc48fb..a368cfb 100644
--- a/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.h
+++ b/chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.h
@@ -15,13 +15,11 @@
 class DesktopIOSPromotionBubbleController;
 class Profile;
 
-// The DesktopIOSPromotionBubbleView has the basic layout for the
-// desktop to ios promotion view.
-// This view will always be created as a subview of an existing
-// bubble (ie. Password Bubble, Bookmark Bubble).
+// The DesktopIOSPromotionBubbleView is the main view for the desktop-to-ios
+// promotion view. It proxies DialogClientView functionality to provide
+// replacement button labels, actions and icon when activated.
 class DesktopIOSPromotionBubbleView : public DesktopIOSPromotionView,
-                                      public views::View,
-                                      public views::ButtonListener {
+                                      public views::View {
  public:
   DesktopIOSPromotionBubbleView(
       Profile* profile,
@@ -31,12 +29,12 @@
   // DesktopIOSPromotionView:
   void UpdateRecoveryPhoneLabel() override;
 
- private:
-  // ButtonListener:
-  void ButtonPressed(views::Button* sender, const ui::Event& event) override;
+  bool Accept();
+  bool Cancel();
+  base::string16 GetDialogButtonLabel(ui::DialogButton button) const;
+  gfx::ImageSkia GetWindowIcon();
 
-  views::Button* send_sms_button_ = nullptr;
-  views::Button* no_button_ = nullptr;
+ private:
   // The text that will appear on the promotion body.
   views::Label* promotion_text_label_;
   std::unique_ptr<DesktopIOSPromotionBubbleController> promotion_controller_;
diff --git a/chrome/browser/ui/views/passwords/manage_password_pending_view.cc b/chrome/browser/ui/views/passwords/manage_password_pending_view.cc
index 21f8173..be3a1f8b 100644
--- a/chrome/browser/ui/views/passwords/manage_password_pending_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_password_pending_view.cc
@@ -25,6 +25,7 @@
 #include "ui/views/layout/fill_layout.h"
 #include "ui/views/layout/grid_layout.h"
 #include "ui/views/layout/layout_provider.h"
+#include "ui/views/window/dialog_client_view.h"
 
 #if defined(OS_WIN)
 #include "chrome/browser/ui/views/desktop_ios_promotion/desktop_ios_promotion_bubble_view.h"
@@ -124,21 +125,27 @@
 }  // namespace
 
 ManagePasswordPendingView::ManagePasswordPendingView(
-    ManagePasswordsBubbleView* parent)
-    : parent_(parent),
-      save_button_(nullptr),
-      never_button_(nullptr),
+    content::WebContents* web_contents,
+    views::View* anchor_view,
+    const gfx::Point& anchor_point,
+    DisplayReason reason)
+    : ManagePasswordsBubbleDelegateViewBase(web_contents,
+                                            anchor_view,
+                                            anchor_point,
+                                            reason),
+      sign_in_promo_(nullptr),
+      desktop_ios_promo_(nullptr),
       username_field_(nullptr),
       password_view_button_(nullptr),
+      initially_focused_view_(nullptr),
       password_dropdown_(nullptr),
       password_label_(nullptr),
       are_passwords_revealed_(
-          parent_->model()->are_passwords_revealed_when_bubble_is_opened()) {
+          model()->are_passwords_revealed_when_bubble_is_opened()) {
   // Create credentials row.
-  const autofill::PasswordForm& password_form =
-      parent_->model()->pending_password();
+  const autofill::PasswordForm& password_form = model()->pending_password();
   const bool is_password_credential = password_form.federation_origin.unique();
-  if (parent_->model()->enable_editing()) {
+  if (model()->enable_editing()) {
     username_field_ = CreateUsernameEditable(password_form).release();
   } else {
     username_field_ = CreateUsernameLabel(password_form).release();
@@ -151,43 +158,58 @@
         CreatePasswordViewButton(this, are_passwords_revealed_).release();
   }
 
-  // Create buttons.
-  save_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
-      this, l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SAVE_BUTTON));
-  never_button_ = views::MdTextButton::CreateSecondaryUiButton(
-      this,
-      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_BUBBLE_BLACKLIST_BUTTON));
-
   CreateAndSetLayout(is_password_credential);
-  if (parent_->model()->enable_editing() &&
-      parent_->model()->pending_password().username_value.empty()) {
-    parent_->set_initially_focused_view(username_field_);
-  } else {
-    parent_->set_initially_focused_view(save_button_);
+  if (model()->enable_editing() &&
+      model()->pending_password().username_value.empty()) {
+    initially_focused_view_ = username_field_;
   }
 }
 
 ManagePasswordPendingView::~ManagePasswordPendingView() = default;
 
+bool ManagePasswordPendingView::Accept() {
+  if (sign_in_promo_)
+    return sign_in_promo_->Accept();
+#if defined(OS_WIN)
+  if (desktop_ios_promo_)
+    return desktop_ios_promo_->Accept();
+#endif
+  UpdateUsernameAndPasswordInModel();
+  model()->OnSaveClicked();
+  if (model()->ReplaceToShowPromotionIfNeeded()) {
+    ReplaceWithPromo();
+    return false;  // Keep open.
+  }
+  return true;
+}
+
+bool ManagePasswordPendingView::Cancel() {
+  if (sign_in_promo_)
+    return sign_in_promo_->Cancel();
+#if defined(OS_WIN)
+  if (desktop_ios_promo_)
+    return desktop_ios_promo_->Cancel();
+#endif
+  model()->OnNeverForThisSiteClicked();
+  return true;
+}
+
+bool ManagePasswordPendingView::Close() {
+  return true;
+}
+
 void ManagePasswordPendingView::ButtonPressed(views::Button* sender,
                                               const ui::Event& event) {
-  if (sender == save_button_) {
-    UpdateUsernameAndPasswordInModel();
-    parent_->model()->OnSaveClicked();
-    if (parent_->model()->ReplaceToShowPromotionIfNeeded()) {
-      ReplaceWithPromo();
-      return;
-    }
-  } else if (sender == never_button_) {
-    parent_->model()->OnNeverForThisSiteClicked();
-  } else if (sender == password_view_button_) {
-    TogglePasswordVisibility();
-    return;
-  } else {
-    NOTREACHED();
-  }
+  DCHECK(sender == password_view_button_);
+  TogglePasswordVisibility();
+}
 
-  parent_->CloseBubble();
+void ManagePasswordPendingView::StyledLabelLinkClicked(
+    views::StyledLabel* label,
+    const gfx::Range& range,
+    int event_flags) {
+  DCHECK_EQ(model()->title_brand_link_range(), range);
+  model()->OnBrandLinkClicked();
 }
 
 gfx::Size ManagePasswordPendingView::CalculatePreferredSize() const {
@@ -196,6 +218,51 @@
                        this, ManagePasswordsBubbleView::kDesiredBubbleWidth));
 }
 
+views::View* ManagePasswordPendingView::GetInitiallyFocusedView() {
+  if (initially_focused_view_)
+    return initially_focused_view_;
+  return ManagePasswordsBubbleDelegateViewBase::GetInitiallyFocusedView();
+}
+
+base::string16 ManagePasswordPendingView::GetDialogButtonLabel(
+    ui::DialogButton button) const {
+  if (sign_in_promo_)
+    return sign_in_promo_->GetDialogButtonLabel(button);
+#if defined(OS_WIN)
+  if (desktop_ios_promo_)
+    return desktop_ios_promo_->GetDialogButtonLabel(button);
+#endif
+
+  return l10n_util::GetStringUTF16(
+      button == ui::DIALOG_BUTTON_OK
+          ? IDS_PASSWORD_MANAGER_SAVE_BUTTON
+          : IDS_PASSWORD_MANAGER_BUBBLE_BLACKLIST_BUTTON);
+}
+
+gfx::ImageSkia ManagePasswordPendingView::GetWindowIcon() {
+#if defined(OS_WIN)
+  if (desktop_ios_promo_)
+    return desktop_ios_promo_->GetWindowIcon();
+#endif
+  return gfx::ImageSkia();
+}
+
+void ManagePasswordPendingView::AddedToWidget() {
+  auto title_view =
+      base::MakeUnique<views::StyledLabel>(base::string16(), this);
+  title_view->SetTextContext(views::style::CONTEXT_DIALOG_TITLE);
+  UpdateTitleText(title_view.get());
+  GetBubbleFrameView()->SetTitleView(std::move(title_view));
+}
+
+bool ManagePasswordPendingView::ShouldShowWindowIcon() const {
+  return desktop_ios_promo_ != nullptr;
+}
+
+bool ManagePasswordPendingView::ShouldShowCloseButton() const {
+  return true;
+}
+
 void ManagePasswordPendingView::CreateAndSetLayout(bool show_password_label) {
   views::GridLayout* layout =
       SetLayoutManager(std::make_unique<views::GridLayout>(this));
@@ -208,23 +275,12 @@
   ManagePasswordsBubbleView::BuildCredentialRows(
       layout, username_field_, password_field, password_view_button_,
       show_password_label);
-  layout->AddPaddingRow(
-      0, ChromeLayoutProvider::Get()->GetDistanceMetric(
-             views::DISTANCE_DIALOG_CONTENT_MARGIN_BOTTOM_CONTROL));
-
-  // Button row.
-  ManagePasswordsBubbleView::BuildColumnSet(
-      layout, ManagePasswordsBubbleView::DOUBLE_BUTTON_COLUMN_SET);
-  layout->StartRow(0, ManagePasswordsBubbleView::DOUBLE_BUTTON_COLUMN_SET);
-  layout->AddView(save_button_);
-  layout->AddView(never_button_);
 }
 
 void ManagePasswordPendingView::CreatePasswordField() {
-  const autofill::PasswordForm& password_form =
-      parent_->model()->pending_password();
+  const autofill::PasswordForm& password_form = model()->pending_password();
   if (password_form.all_possible_passwords.size() > 1 &&
-      parent_->model()->enable_editing()) {
+      model()->enable_editing()) {
     password_dropdown_ =
         CreatePasswordDropdownView(password_form, are_passwords_revealed_)
             .release();
@@ -238,7 +294,7 @@
 }
 
 void ManagePasswordPendingView::TogglePasswordVisibility() {
-  if (!are_passwords_revealed_ && !parent_->model()->RevealPasswords())
+  if (!are_passwords_revealed_ && !model()->RevealPasswords())
     return;
 
   UpdateUsernameAndPasswordInModel();
@@ -254,48 +310,57 @@
 }
 
 void ManagePasswordPendingView::UpdateUsernameAndPasswordInModel() {
-  const bool username_editable = parent_->model()->enable_editing();
+  const bool username_editable = model()->enable_editing();
   const bool password_editable =
-      password_dropdown_ && parent_->model()->enable_editing();
+      password_dropdown_ && model()->enable_editing();
   if (!username_editable && !password_editable)
     return;
 
-  base::string16 new_username =
-      parent_->model()->pending_password().username_value;
-  base::string16 new_password =
-      parent_->model()->pending_password().password_value;
+  base::string16 new_username = model()->pending_password().username_value;
+  base::string16 new_password = model()->pending_password().password_value;
   if (username_editable) {
     new_username = static_cast<views::Textfield*>(username_field_)->text();
     base::TrimString(new_username, base::ASCIIToUTF16(" "), &new_username);
   }
   if (password_editable) {
-    new_password =
-        parent_->model()->pending_password().all_possible_passwords.at(
-            password_dropdown_->selected_index());
+    new_password = model()->pending_password().all_possible_passwords.at(
+        password_dropdown_->selected_index());
   }
-  parent_->model()->OnCredentialEdited(new_username, new_password);
+  model()->OnCredentialEdited(new_username, new_password);
 }
 
 void ManagePasswordPendingView::ReplaceWithPromo() {
   RemoveAllChildViews(true);
-  parent_->initially_focused_view_ = NULL;
+  initially_focused_view_ = nullptr;
   SetLayoutManager(std::make_unique<views::FillLayout>());
-  if (parent_->model()->state() ==
-      password_manager::ui::CHROME_SIGN_IN_PROMO_STATE) {
-    AddChildView(new ManagePasswordSignInPromoView(parent_));
+  if (model()->state() == password_manager::ui::CHROME_SIGN_IN_PROMO_STATE) {
+    sign_in_promo_ = new ManagePasswordSignInPromoView(model());
+    AddChildView(sign_in_promo_);
 #if defined(OS_WIN)
-  } else if (parent_->model()->state() ==
+  } else if (model()->state() ==
              password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) {
-    AddChildView(new DesktopIOSPromotionBubbleView(
-        parent_->model()->GetProfile(),
-        desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE));
+    desktop_ios_promo_ = new DesktopIOSPromotionBubbleView(
+        model()->GetProfile(),
+        desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE);
+    AddChildView(desktop_ios_promo_);
 #endif
   } else {
     NOTREACHED();
   }
-  parent_->GetWidget()->UpdateWindowIcon();
-  parent_->UpdateTitleText(
-      static_cast<views::StyledLabel*>(parent_->GetBubbleFrameView()->title()));
-  parent_->DialogModelChanged();
-  parent_->SizeToContents();
+  GetWidget()->UpdateWindowIcon();
+  UpdateTitleText(
+      static_cast<views::StyledLabel*>(GetBubbleFrameView()->title()));
+  DialogModelChanged();
+
+  SizeToContents();
+}
+
+void ManagePasswordPendingView::UpdateTitleText(
+    views::StyledLabel* title_view) {
+  title_view->SetText(GetWindowTitle());
+  if (!model()->title_brand_link_range().is_empty()) {
+    auto link_style = views::StyledLabel::RangeStyleInfo::CreateForLink();
+    link_style.disable_line_wrapping = false;
+    title_view->AddStyleRange(model()->title_brand_link_range(), link_style);
+  }
 }
diff --git a/chrome/browser/ui/views/passwords/manage_password_pending_view.h b/chrome/browser/ui/views/passwords/manage_password_pending_view.h
index cc13a354..33bb2dc 100644
--- a/chrome/browser/ui/views/passwords/manage_password_pending_view.h
+++ b/chrome/browser/ui/views/passwords/manage_password_pending_view.h
@@ -5,45 +5,76 @@
 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_PENDING_VIEW_H_
 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_PENDING_VIEW_H_
 
+#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_delegate_view_base.h"
 #include "ui/views/controls/button/button.h"
+#include "ui/views/controls/styled_label_listener.h"
 #include "ui/views/view.h"
 
 namespace views {
-class ToggleImageButton;
 class Combobox;
 class Label;
+class StyledLabel;
+class ToggleImageButton;
 }  // namespace views
 
-class ManagePasswordsBubbleView;
+class DesktopIOSPromotionBubbleView;
+class ManagePasswordSignInPromoView;
 
 // A view offering the user the ability to save credentials. Contains a
 // username and password field, along with a "Save Passwords" button and a
 // "Never" button.
-class ManagePasswordPendingView : public views::View,
-                                  public views::ButtonListener {
+class ManagePasswordPendingView : public ManagePasswordsBubbleDelegateViewBase,
+                                  public views::ButtonListener,
+                                  public views::StyledLabelListener {
  public:
-  explicit ManagePasswordPendingView(ManagePasswordsBubbleView* parent);
-  ~ManagePasswordPendingView() override;
+  ManagePasswordPendingView(content::WebContents* web_contents,
+                            views::View* anchor_view,
+                            const gfx::Point& anchor_point,
+                            DisplayReason reason);
+
+#if defined(UNIT_TEST)
+  const View* username_field() const { return username_field_; }
+#endif
 
  private:
+  ~ManagePasswordPendingView() override;
+
   // views::ButtonListener:
   void ButtonPressed(views::Button* sender, const ui::Event& event) override;
 
-  // View:
+  // views::StyledLabelListener:
+  void StyledLabelLinkClicked(views::StyledLabel* label,
+                              const gfx::Range& range,
+                              int event_flags) override;
+
+  // ManagePasswordsBubbleDelegateViewBase:
   gfx::Size CalculatePreferredSize() const override;
+  views::View* GetInitiallyFocusedView() override;
+  base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
+  void AddedToWidget() override;
+  gfx::ImageSkia GetWindowIcon() override;
+  bool ShouldShowWindowIcon() const override;
+  bool ShouldShowCloseButton() const override;
+  bool Accept() override;
+  bool Cancel() override;
+  bool Close() override;
 
   void CreateAndSetLayout(bool show_password_label);
   void CreatePasswordField();
   void TogglePasswordVisibility();
   void UpdateUsernameAndPasswordInModel();
   void ReplaceWithPromo();
+  void UpdateTitleText(views::StyledLabel* title_view);
 
-  ManagePasswordsBubbleView* parent_;
+  // Different promo dialogs that helps the user get access to credentials
+  // across devices. One of these are non-null when the promotion dialog is
+  // active.
+  ManagePasswordSignInPromoView* sign_in_promo_;
+  DesktopIOSPromotionBubbleView* desktop_ios_promo_;
 
-  views::Button* save_button_;
-  views::Button* never_button_;
   views::View* username_field_;
   views::ToggleImageButton* password_view_button_;
+  views::View* initially_focused_view_;
 
   // The view for the password value. Only one of |password_dropdown_| and
   // |password_label_| should be available.
diff --git a/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.cc b/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.cc
index cb6d3e0e..17231eb3 100644
--- a/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.cc
@@ -12,40 +12,26 @@
 #include "ui/views/layout/grid_layout.h"
 
 ManagePasswordSignInPromoView::ManagePasswordSignInPromoView(
-    ManagePasswordsBubbleView* parent)
-    : parent_(parent) {
-  views::GridLayout* layout =
-      SetLayoutManager(std::make_unique<views::GridLayout>(this));
-  layout->set_minimum_size(
-      gfx::Size(ManagePasswordsBubbleView::kDesiredBubbleWidth, 0));
-
-  signin_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
-      this,
-      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SIGNIN_PROMO_SIGN_IN));
-  no_button_ = views::MdTextButton::CreateSecondaryUiButton(
-      this,
-      l10n_util::GetStringUTF16(IDS_PASSWORD_MANAGER_SIGNIN_PROMO_NO_THANKS));
-
-  // Button row.
-  ManagePasswordsBubbleView::BuildColumnSet(
-      layout, ManagePasswordsBubbleView::DOUBLE_BUTTON_COLUMN_SET);
-  layout->StartRow(0, ManagePasswordsBubbleView::DOUBLE_BUTTON_COLUMN_SET);
-  layout->AddView(signin_button_);
-  layout->AddView(no_button_);
-
-  parent_->set_initially_focused_view(signin_button_);
+    ManagePasswordsBubbleModel* model)
+    : model_(model) {
   base::RecordAction(
       base::UserMetricsAction("Signin_Impression_FromPasswordBubble"));
 }
 
-void ManagePasswordSignInPromoView::ButtonPressed(views::Button* sender,
-                                                  const ui::Event& event) {
-  if (sender == signin_button_)
-    parent_->model()->OnSignInToChromeClicked();
-  else if (sender == no_button_)
-    parent_->model()->OnSkipSignInClicked();
-  else
-    NOTREACHED();
+bool ManagePasswordSignInPromoView::Accept() {
+  model_->OnSignInToChromeClicked();
+  return true;
+}
 
-  parent_->CloseBubble();
+bool ManagePasswordSignInPromoView::Cancel() {
+  model_->OnSkipSignInClicked();
+  return true;
+}
+
+base::string16 ManagePasswordSignInPromoView::GetDialogButtonLabel(
+    ui::DialogButton button) const {
+  return l10n_util::GetStringUTF16(
+      button == ui::DIALOG_BUTTON_OK
+          ? IDS_PASSWORD_MANAGER_SIGNIN_PROMO_SIGN_IN
+          : IDS_PASSWORD_MANAGER_SIGNIN_PROMO_NO_THANKS);
 }
diff --git a/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.h b/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.h
index 9419026..cffea2f 100644
--- a/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.h
+++ b/chrome/browser/ui/views/passwords/manage_password_sign_in_promo_view.h
@@ -8,22 +8,20 @@
 #include "ui/views/controls/button/button.h"
 #include "ui/views/view.h"
 
-class ManagePasswordsBubbleView;
+class ManagePasswordsBubbleModel;
 
-// A view that offers user to sign in to Chrome.
-class ManagePasswordSignInPromoView : public views::View,
-                                      public views::ButtonListener {
+// A view that can show up after saving a password without being signed in to
+// offer signing users in so they can access their credentials across devices.
+class ManagePasswordSignInPromoView : public views::View {
  public:
-  explicit ManagePasswordSignInPromoView(ManagePasswordsBubbleView* parent);
+  explicit ManagePasswordSignInPromoView(ManagePasswordsBubbleModel* model);
+
+  bool Accept();
+  bool Cancel();
+  base::string16 GetDialogButtonLabel(ui::DialogButton button) const;
 
  private:
-  // views::ButtonListener:
-  void ButtonPressed(views::Button* sender, const ui::Event& event) override;
-
-  ManagePasswordsBubbleView* parent_;
-
-  views::Button* signin_button_;
-  views::Button* no_button_;
+  ManagePasswordsBubbleModel* const model_;
 
   DISALLOW_COPY_AND_ASSIGN(ManagePasswordSignInPromoView);
 };
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_delegate_view_base.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_delegate_view_base.cc
index f9fdfd57..da84c53e 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_delegate_view_base.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_delegate_view_base.cc
@@ -10,6 +10,7 @@
 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
 #include "chrome/browser/ui/views/passwords/manage_password_auto_sign_in_view.h"
 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h"
+#include "chrome/browser/ui/views/passwords/manage_password_pending_view.h"
 #include "chrome/browser/ui/views/passwords/manage_password_save_confirmation_view.h"
 #include "chrome/browser/ui/views/passwords/manage_password_update_pending_view.h"
 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
@@ -83,7 +84,7 @@
     views::View* anchor_view,
     const gfx::Point& anchor_point,
     DisplayReason reason) {
-  ManagePasswordsBubbleDelegateViewBase* view;
+  ManagePasswordsBubbleDelegateViewBase* view = nullptr;
   password_manager::ui::State model_state =
       PasswordsModelDelegateFromWebContents(web_contents)->GetState();
   if (model_state == password_manager::ui::MANAGE_STATE) {
@@ -99,12 +100,11 @@
              password_manager::ui::PENDING_PASSWORD_UPDATE_STATE) {
     view = new ManagePasswordUpdatePendingView(web_contents, anchor_view,
                                                anchor_point, reason);
-
-  } else {
-    // TODO(crbug.com/654115): Get rid of the one-bubble-for-everything
-    // BubbleView.
-    view = new ManagePasswordsBubbleView(web_contents, anchor_view,
+  } else if (model_state == password_manager::ui::PENDING_PASSWORD_STATE) {
+    view = new ManagePasswordPendingView(web_contents, anchor_view,
                                          anchor_point, reason);
+  } else {
+    NOTREACHED();
   }
 
   g_manage_passwords_bubble_ = view;
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index 0056f90..a88e6738 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -298,10 +298,7 @@
 }
 
 void ManagePasswordsBubbleView::CreateChild() {
-  if (model()->state() == password_manager::ui::PENDING_PASSWORD_STATE) {
-    AddChildView(new ManagePasswordPendingView(this));
-  } else {
-    // This model state should be handled by separate dialogs.
-    NOTREACHED();
-  }
+  // TODO(pbos): This file is being removed (and static code moved). It was only
+  // kept to make the diff easier for the last CL. This should now be unused.
+  NOTREACHED();
 }
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
index 2dddaeb..00e018b7 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h
@@ -41,7 +41,6 @@
   // dialogs need to access their parent, as the dialogs become truly separate
   // this should go away on its own.
   friend class ManagePasswordPendingView;
-  friend class ManagePasswordSignInPromoView;
   friend class ManagePasswordUpdatePendingView;
 
   // TODO(pbos): Define column sets within subdialogs or move to a common
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc
index 27ef7ae..94cd67a5 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc
@@ -20,6 +20,7 @@
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/browser/ui/views/frame/browser_view.h"
 #include "chrome/browser/ui/views/passwords/manage_password_auto_sign_in_view.h"
+#include "chrome/browser/ui/views/passwords/manage_password_pending_view.h"
 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h"
 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
 #include "chrome/common/chrome_features.h"
@@ -101,10 +102,9 @@
   EXPECT_FALSE(IsBubbleShowing());
   SetupPendingPassword();
   EXPECT_TRUE(IsBubbleShowing());
-  const ManagePasswordsBubbleView* bubble =
-      static_cast<const ManagePasswordsBubbleView*>(
+  const ManagePasswordPendingView* bubble =
+      static_cast<const ManagePasswordPendingView*>(
           ManagePasswordsBubbleView::manage_password_bubble());
-  EXPECT_TRUE(bubble->initially_focused_view());
   EXPECT_FALSE(bubble->GetFocusManager()->GetFocusedView());
   ManagePasswordsBubbleView::CloseCurrentBubble();
   EXPECT_FALSE(IsBubbleShowing());
@@ -118,10 +118,11 @@
       browser()->tab_strip_model()->GetActiveWebContents())
       ->ShowManagePasswordsBubble(true /* user_action */);
   EXPECT_TRUE(IsBubbleShowing());
-  bubble = static_cast<const ManagePasswordsBubbleView*>(
+  bubble = static_cast<const ManagePasswordPendingView*>(
       ManagePasswordsBubbleView::manage_password_bubble());
-  EXPECT_TRUE(bubble->initially_focused_view());
-  EXPECT_EQ(bubble->initially_focused_view(),
+  // A pending password with empty username should initially focus on the
+  // username field.
+  EXPECT_EQ(bubble->username_field(),
             bubble->GetFocusManager()->GetFocusedView());
   ManagePasswordsBubbleView::CloseCurrentBubble();
   EXPECT_FALSE(IsBubbleShowing());
diff --git a/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc b/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc
index 7f3ee1f..096757b 100644
--- a/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.cc
@@ -7,16 +7,48 @@
 #include <memory>
 
 #include "base/base64.h"
+#include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/views/payments/payment_request_views_util.h"
+#include "chrome/grit/generated_resources.h"
 #include "content/public/browser/navigation_handle.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/web_contents.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/views/controls/label.h"
 #include "ui/views/controls/webview/webview.h"
 #include "ui/views/layout/fill_layout.h"
+#include "ui/views/layout/grid_layout.h"
 
 namespace payments {
 
+class ReadOnlyOriginView : public views::View {
+ public:
+  ReadOnlyOriginView(const base::string16& page_title, const GURL& origin) {
+    views::GridLayout* layout =
+        SetLayoutManager(std::make_unique<views::GridLayout>(this));
+
+    views::ColumnSet* columns = layout->AddColumnSet(0);
+    columns->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1,
+                       views::GridLayout::USE_PREF, 0, 0);
+
+    layout->StartRow(0, 0);
+    std::unique_ptr<views::Label> title_label =
+        std::make_unique<views::Label>(page_title);
+    title_label->set_id(static_cast<int>(DialogViewID::SHEET_TITLE));
+    title_label->SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY);
+    layout->AddView(title_label.release());
+
+    layout->StartRow(0, 0);
+    layout->AddView(new views::Label(base::UTF8ToUTF16(origin.spec())));
+  }
+  ~ReadOnlyOriginView() override {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(ReadOnlyOriginView);
+};
+
 PaymentHandlerWebFlowViewController::PaymentHandlerWebFlowViewController(
     PaymentRequestSpec* spec,
     PaymentRequestState* state,
@@ -33,7 +65,10 @@
 PaymentHandlerWebFlowViewController::~PaymentHandlerWebFlowViewController() {}
 
 base::string16 PaymentHandlerWebFlowViewController::GetSheetTitle() {
-  return base::string16();
+  if (web_contents())
+    return web_contents()->GetTitle();
+
+  return l10n_util::GetStringUTF16(IDS_TAB_LOADING_TITLE);
 }
 
 void PaymentHandlerWebFlowViewController::FillContentView(
@@ -42,14 +77,30 @@
   std::unique_ptr<views::WebView> web_view =
       std::make_unique<views::WebView>(profile_);
 
-  // TODO(anthonyvd): Size to the actual available size in the dialog.
-  web_view->SetPreferredSize(gfx::Size(100, 300));
   Observe(web_view->GetWebContents());
   web_view->LoadInitialURL(target_);
 
+  // The webview must get an explicitly set height otherwise the layout doesn't
+  // make it fill its container. This is likely because it has no content at the
+  // time of first layout (nothing has loaded yet). Because of this, set it to.
+  // total_dialog_height - header_height. On the other hand, the width will be
+  // properly set so it can be 0 here.
+  web_view->SetPreferredSize(gfx::Size(0, kDialogHeight - 64));
   content_view->AddChildView(web_view.release());
 }
 
+bool PaymentHandlerWebFlowViewController::ShouldShowSecondaryButton() {
+  return false;
+}
+
+std::unique_ptr<views::View>
+PaymentHandlerWebFlowViewController::CreateHeaderContentView() {
+  const GURL origin = web_contents()
+                          ? web_contents()->GetLastCommittedURL().GetOrigin()
+                          : GURL();
+  return std::make_unique<ReadOnlyOriginView>(GetSheetTitle(), origin);
+}
+
 void PaymentHandlerWebFlowViewController::DidFinishNavigation(
     content::NavigationHandle* navigation_handle) {
   if (first_navigation_complete_callback_) {
@@ -58,6 +109,12 @@
              web_contents()->GetMainFrame()->GetRoutingID());
     first_navigation_complete_callback_ = PaymentHandlerOpenWindowCallback();
   }
+  UpdateHeaderView();
+}
+
+void PaymentHandlerWebFlowViewController::TitleWasSet(
+    content::NavigationEntry* entry) {
+  UpdateHeaderView();
 }
 
 }  // namespace payments
diff --git a/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.h b/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.h
index f9019ef8..a23cedd 100644
--- a/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.h
+++ b/chrome/browser/ui/views/payments/payment_handler_web_flow_view_controller.h
@@ -38,14 +38,18 @@
       PaymentHandlerOpenWindowCallback first_navigation_complete_callback);
   ~PaymentHandlerWebFlowViewController() override;
 
+ private:
+  // PaymentRequestSheetController:
   base::string16 GetSheetTitle() override;
   void FillContentView(views::View* content_view) override;
+  bool ShouldShowSecondaryButton() override;
+  std::unique_ptr<views::View> CreateHeaderContentView() override;
 
   // content::WebContentsObserver:
   void DidFinishNavigation(
       content::NavigationHandle* navigation_handle) override;
+  void TitleWasSet(content::NavigationEntry* entry) override;
 
- private:
   Profile* profile_;
   GURL target_;
   PaymentHandlerOpenWindowCallback first_navigation_complete_callback_;
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
index a3bf39b6..1743080 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -227,10 +227,11 @@
                      views::GridLayout::USE_PREF, 0, 0);
 
   layout->StartRow(0, 0);
-  // |header_view| will be deleted when |view| is.
-  layout->AddView(
-      CreateSheetHeaderView(ShouldShowHeaderBackArrow(), GetSheetTitle(), this)
-          .release());
+  header_view_ = std::make_unique<views::View>();
+  PopulateSheetHeaderView(ShouldShowHeaderBackArrow(),
+                          CreateHeaderContentView(), this, header_view_.get());
+  header_view_->set_owned_by_client();
+  layout->AddView(header_view_.get());
 
   layout->StartRow(1, 0);
   // |content_view| will go into a views::ScrollView so it needs to be sized now
@@ -260,8 +261,10 @@
   scroll_->SetContents(pane_);
   layout->AddView(scroll_.get());
 
-  layout->StartRow(0, 0);
-  layout->AddView(footer.release());
+  if (footer) {
+    layout->StartRow(0, 0);
+    layout->AddView(footer.release());
+  }
 
   UpdateContentView();
 
@@ -275,6 +278,13 @@
   RelayoutPane();
 }
 
+void PaymentRequestSheetController::UpdateHeaderView() {
+  header_view_->RemoveAllChildViews(true);
+  PopulateSheetHeaderView(ShouldShowHeaderBackArrow(),
+                          CreateHeaderContentView(), this, header_view_.get());
+  header_view_->Layout();
+}
+
 void PaymentRequestSheetController::UpdateFocus(views::View* focused_view) {
   DialogViewID sheet_id;
   if (GetSheetId(&sheet_id)) {
@@ -319,6 +329,17 @@
   return nullptr;
 }
 
+std::unique_ptr<views::View>
+PaymentRequestSheetController::CreateHeaderContentView() {
+  std::unique_ptr<views::Label> title_label = std::make_unique<views::Label>(
+      GetSheetTitle(), views::style::CONTEXT_DIALOG_TITLE);
+  title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+  title_label->set_id(static_cast<int>(DialogViewID::SHEET_TITLE));
+  title_label->SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY);
+
+  return title_label;
+}
+
 void PaymentRequestSheetController::ButtonPressed(views::Button* sender,
                                                   const ui::Event& event) {
   if (!dialog()->IsInteractive())
@@ -381,6 +402,13 @@
   AddSecondaryButton(trailing_buttons_container.get());
 #endif  // defined(OS_MACOSX)
 
+  if (container->child_count() == 0 &&
+      trailing_buttons_container->child_count() == 0) {
+    // If there's no extra view and no button, return null to signal that no
+    // footer should be rendered.
+    return nullptr;
+  }
+
   layout->AddView(trailing_buttons_container.release());
 
   return container;
@@ -390,9 +418,11 @@
   if (primary_button_ && primary_button_->enabled())
     return primary_button_.get();
 
-  DCHECK(secondary_button_);
+  if (secondary_button_)
+    return secondary_button_.get();
 
-  return secondary_button_.get();
+  DCHECK(content_view_);
+  return content_view_;
 }
 
 bool PaymentRequestSheetController::GetSheetId(DialogViewID* sheet_id) {
diff --git a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
index 214863d2..d00dd2b4 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.h
@@ -66,6 +66,9 @@
   // calls FillContentView again to re-populate it with updated views.
   void UpdateContentView();
 
+  // Clears and recreates the header view for this sheet.
+  void UpdateHeaderView();
+
   // Update the focus to |focused_view|.
   void UpdateFocus(views::View* focused_view);
 
@@ -111,6 +114,12 @@
   // +---------------------------+
   virtual std::unique_ptr<views::View> CreateExtraFooterView();
 
+  // Creates and returns the view to be inserted in the header, next to the
+  // close/back button. This is typically the sheet's title but it can be
+  // overriden to return a different kind of view as long as it fits inside the
+  // header.
+  virtual std::unique_ptr<views::View> CreateHeaderContentView();
+
   // views::ButtonListener:
   void ButtonPressed(views::Button* sender, const ui::Event& event) override;
 
@@ -159,6 +168,7 @@
   // targets when subclasses don't want to focus anything else.
   std::unique_ptr<views::Button> primary_button_;
   std::unique_ptr<views::Button> secondary_button_;
+  std::unique_ptr<views::View> header_view_;
 
   DISALLOW_COPY_AND_ASSIGN(PaymentRequestSheetController);
 };
diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.cc b/chrome/browser/ui/views/payments/payment_request_views_util.cc
index ab73898..89244c5 100644
--- a/chrome/browser/ui/views/payments/payment_request_views_util.cc
+++ b/chrome/browser/ui/views/payments/payment_request_views_util.cc
@@ -179,13 +179,12 @@
   return actual_width;
 }
 
-std::unique_ptr<views::View> CreateSheetHeaderView(
-    bool show_back_arrow,
-    const base::string16& title,
-    views::ButtonListener* listener) {
-  std::unique_ptr<views::View> container = std::make_unique<views::View>();
+void PopulateSheetHeaderView(bool show_back_arrow,
+                             std::unique_ptr<views::View> header_content_view,
+                             views::ButtonListener* listener,
+                             views::View* container) {
   views::GridLayout* layout = container->SetLayoutManager(
-      std::make_unique<views::GridLayout>(container.get()));
+      std::make_unique<views::GridLayout>(container));
 
   constexpr int kHeaderTopVerticalInset = 14;
   constexpr int kHeaderBottomVerticalInset = 8;
@@ -223,14 +222,7 @@
     layout->AddView(back_arrow);
   }
 
-  views::Label* title_label =
-      new views::Label(title, views::style::CONTEXT_DIALOG_TITLE);
-  title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
-  title_label->set_id(static_cast<int>(DialogViewID::SHEET_TITLE));
-  title_label->SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY);
-  layout->AddView(title_label);
-
-  return container;
+  layout->AddView(header_content_view.release());
 }
 
 std::unique_ptr<views::ImageView> CreateInstrumentIconView(
diff --git a/chrome/browser/ui/views/payments/payment_request_views_util.h b/chrome/browser/ui/views/payments/payment_request_views_util.h
index 5a15f483..57b57605 100644
--- a/chrome/browser/ui/views/payments/payment_request_views_util.h
+++ b/chrome/browser/ui/views/payments/payment_request_views_util.h
@@ -68,10 +68,10 @@
 // +---------------------------+
 // | <- | Title                |
 // +---------------------------+
-std::unique_ptr<views::View> CreateSheetHeaderView(
-    bool show_back_arrow,
-    const base::string16& title,
-    views::ButtonListener* delegate);
+void PopulateSheetHeaderView(bool show_back_arrow,
+                             std::unique_ptr<views::View> header_content_view,
+                             views::ButtonListener* delegate,
+                             views::View* container);
 
 // Returns an instrument image view for the given |img| or |icon_resource_id|
 // and wanted |opacity|. Includes a rounded rect border. Callers need to set the
diff --git a/chrome/browser/ui/webui/components_ui.cc b/chrome/browser/ui/webui/components_ui.cc
index 1d24e81..f58e250 100644
--- a/chrome/browser/ui/webui/components_ui.cc
+++ b/chrome/browser/ui/webui/components_ui.cc
@@ -214,6 +214,8 @@
       return l10n_util::GetStringUTF16(IDS_COMPONENTS_EVT_STATUS_UPDATED);
     case Events::COMPONENT_NOT_UPDATED:
       return l10n_util::GetStringUTF16(IDS_COMPONENTS_EVT_STATUS_NOTUPDATED);
+    case Events::COMPONENT_UPDATE_ERROR:
+      return l10n_util::GetStringUTF16(IDS_COMPONENTS_EVT_STATUS_UPDATE_ERROR);
     case Events::COMPONENT_UPDATE_DOWNLOADING:
       return l10n_util::GetStringUTF16(IDS_COMPONENTS_EVT_STATUS_DOWNLOADING);
   }
@@ -245,7 +247,7 @@
     case update_client::ComponentState::kUpToDate:
       return l10n_util::GetStringUTF16(IDS_COMPONENTS_SVC_STATUS_UPTODATE);
     case update_client::ComponentState::kUpdateError:
-      return l10n_util::GetStringUTF16(IDS_COMPONENTS_SVC_STATUS_NOUPDATE);
+      return l10n_util::GetStringUTF16(IDS_COMPONENTS_SVC_STATUS_UPDATE_ERROR);
     case update_client::ComponentState::kUninstalled:  // Fall through.
     case update_client::ComponentState::kRun:
     case update_client::ComponentState::kLastStatus:
diff --git a/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.cc b/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.cc
index 4330fe7..6da863d2 100644
--- a/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.cc
+++ b/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.cc
@@ -8,7 +8,7 @@
 #include "base/values.h"
 #include "chrome/browser/download/download_service_factory.h"
 #include "chrome/browser/profiles/profile.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/download_service.h"
 #include "content/public/browser/web_ui.h"
 
 namespace download_internals {
diff --git a/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.h b/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.h
index cd8b9641..7c35c36 100644
--- a/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.h
+++ b/chrome/browser/ui/webui/download_internals/download_internals_ui_message_handler.h
@@ -7,7 +7,7 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/public/logger.h"
+#include "components/download/public/background_service/logger.h"
 #include "content/public/browser/web_ui_message_handler.h"
 
 namespace download {
diff --git a/chrome/browser/vr/elements/transient_element.cc b/chrome/browser/vr/elements/transient_element.cc
index bdc83375..d544f20 100644
--- a/chrome/browser/vr/elements/transient_element.cc
+++ b/chrome/browser/vr/elements/transient_element.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "chrome/browser/vr/elements/transient_element.h"
+#include "base/callback_helpers.h"
 
 namespace vr {
 
@@ -20,7 +21,7 @@
     return;
 
   if (visible)
-    set_visible_time_ = base::TimeTicks();
+    Reset();
 
   super::SetVisible(visible);
 }
@@ -28,7 +29,7 @@
 void TransientElement::SetVisibleImmediately(bool visible) {
   bool will_be_visible = GetTargetOpacity() == opacity_when_visible();
   if (!will_be_visible && visible)
-    set_visible_time_ = base::TimeTicks();
+    Reset();
 
   super::SetVisibleImmediately(visible);
 }
@@ -37,7 +38,10 @@
   // Do nothing if we're not going to be visible.
   if (GetTargetOpacity() != opacity_when_visible())
     return;
+  Reset();
+}
 
+void TransientElement::Reset() {
   set_visible_time_ = base::TimeTicks();
 }
 
@@ -69,8 +73,12 @@
 ShowUntilSignalTransientElement::ShowUntilSignalTransientElement(
     const base::TimeDelta& min_duration,
     const base::TimeDelta& timeout,
-    const base::Callback<void(TransientElementHideReason)>& callback)
-    : super(timeout), min_duration_(min_duration), callback_(callback) {
+    OnMinDurationCallback min_duration_callback,
+    OnHideCallback hide_callback)
+    : super(timeout),
+      min_duration_(min_duration),
+      min_duration_callback_(min_duration_callback),
+      hide_callback_(hide_callback) {
   SetVisibleImmediately(false);
 }
 
@@ -91,13 +99,18 @@
   bool set_invisible = false;
 
   base::TimeDelta duration = time - set_visible_time_;
+  if (!set_visible_time_.is_null() && !min_duration_callback_called_ &&
+      duration >= min_duration_) {
+    min_duration_callback_.Run();
+    min_duration_callback_called_ = true;
+  }
 
   if (!set_visible_time_.is_null() && duration > timeout_) {
-    callback_.Run(TransientElementHideReason::kTimeout);
+    hide_callback_.Run(TransientElementHideReason::kTimeout);
     set_invisible = true;
   } else if (!set_visible_time_.is_null() && duration >= min_duration_ &&
              signaled_) {
-    callback_.Run(TransientElementHideReason::kSignal);
+    hide_callback_.Run(TransientElementHideReason::kSignal);
     set_invisible = true;
   }
   if (set_invisible) {
@@ -111,4 +124,9 @@
   signaled_ = value;
 }
 
+void ShowUntilSignalTransientElement::Reset() {
+  min_duration_callback_called_ = false;
+  super::Reset();
+}
+
 }  // namespace vr
diff --git a/chrome/browser/vr/elements/transient_element.h b/chrome/browser/vr/elements/transient_element.h
index 2ef1f48..932e633 100644
--- a/chrome/browser/vr/elements/transient_element.h
+++ b/chrome/browser/vr/elements/transient_element.h
@@ -27,6 +27,7 @@
 
  protected:
   explicit TransientElement(const base::TimeDelta& timeout);
+  virtual void Reset();
 
   base::TimeDelta timeout_;
   base::TimeTicks set_visible_time_;
@@ -65,15 +66,22 @@
 // is triggered when the element hides itself.
 class ShowUntilSignalTransientElement : public TransientElement {
  public:
-  ShowUntilSignalTransientElement(
-      const base::TimeDelta& min_duration,
-      const base::TimeDelta& timeout,
-      const base::Callback<void(TransientElementHideReason)>& callback);
+  typedef typename base::RepeatingCallback<void()> OnMinDurationCallback;
+  typedef typename base::RepeatingCallback<void(TransientElementHideReason)>
+      OnHideCallback;
+
+  ShowUntilSignalTransientElement(const base::TimeDelta& min_duration,
+                                  const base::TimeDelta& timeout,
+                                  OnMinDurationCallback min_duration_callback,
+                                  OnHideCallback hide_callback);
   ~ShowUntilSignalTransientElement() override;
 
   // This must be called before the set timeout to hide the element.
   void Signal(bool value);
 
+ protected:
+  void Reset() override;
+
  private:
   bool OnBeginFrame(const base::TimeTicks& time,
                     const gfx::Transform& head_pose) override;
@@ -81,8 +89,10 @@
   typedef TransientElement super;
 
   base::TimeDelta min_duration_;
-  base::Callback<void(TransientElementHideReason)> callback_;
+  OnMinDurationCallback min_duration_callback_;
+  OnHideCallback hide_callback_;
   bool signaled_ = false;
+  bool min_duration_callback_called_ = false;
 
   DISALLOW_COPY_AND_ASSIGN(ShowUntilSignalTransientElement);
 };
diff --git a/chrome/browser/vr/elements/transient_element_unittest.cc b/chrome/browser/vr/elements/transient_element_unittest.cc
index 4fb8dd3..fdbca0a 100644
--- a/chrome/browser/vr/elements/transient_element_unittest.cc
+++ b/chrome/browser/vr/elements/transient_element_unittest.cc
@@ -143,47 +143,69 @@
   ShowUntilSignalElementTest() {}
 
   void SetUp() override {
-    callback_triggered_ = false;
+    ResetCallbackTriggered();
     element_ = std::make_unique<ShowUntilSignalTransientElement>(
         base::TimeDelta::FromSeconds(2), base::TimeDelta::FromSeconds(5),
-        base::Bind(&ShowUntilSignalElementTest::OnTimeout,
-                   base::Unretained(this)));
+        base::BindRepeating(&ShowUntilSignalElementTest::OnMinDuration,
+                            base::Unretained(this)),
+        base::BindRepeating(&ShowUntilSignalElementTest::OnTimeout,
+                            base::Unretained(this)));
   }
 
   ShowUntilSignalTransientElement& element() { return *element_; }
   TransientElementHideReason hide_reason() { return hide_reason_; }
-  bool callback_triggered() { return callback_triggered_; }
+  bool min_duration_callback_triggered() {
+    return min_duration_callback_triggered_;
+  }
+  bool hide_callback_triggered() { return hide_callback_triggered_; }
+
+  void OnMinDuration() { min_duration_callback_triggered_ = true; }
 
   void OnTimeout(TransientElementHideReason reason) {
-    callback_triggered_ = true;
+    hide_callback_triggered_ = true;
     hide_reason_ = reason;
   }
 
+  void ResetCallbackTriggered() {
+    min_duration_callback_triggered_ = false;
+    hide_callback_triggered_ = false;
+  }
+
+  void VerifyElementHidesAfterSignal() {
+    EXPECT_FALSE(element().IsVisible());
+
+    // Make element visible.
+    element().SetVisible(true);
+    EXPECT_FALSE(element().DoBeginFrame(MsToTicks(10), kStartHeadPose));
+    EXPECT_EQ(element().opacity_when_visible(), element().opacity());
+
+    // Signal, element should still be visible since time < min duration.
+    element().Signal(true);
+    EXPECT_FALSE(element().DoBeginFrame(MsToTicks(200), kStartHeadPose));
+    EXPECT_EQ(element().opacity_when_visible(), element().opacity());
+
+    // Element hides and callback triggered.
+    EXPECT_TRUE(element().DoBeginFrame(MsToTicks(2010), kStartHeadPose));
+    EXPECT_EQ(0.0f, element().opacity());
+    EXPECT_TRUE(min_duration_callback_triggered());
+    EXPECT_TRUE(hide_callback_triggered());
+    ResetCallbackTriggered();
+    EXPECT_EQ(TransientElementHideReason::kSignal, hide_reason());
+  }
+
  private:
-  bool callback_triggered_ = false;
+  bool min_duration_callback_triggered_ = false;
+  bool hide_callback_triggered_ = false;
   TransientElementHideReason hide_reason_;
   std::unique_ptr<ShowUntilSignalTransientElement> element_;
 };
 
 // Test that the element disappears when signalled.
 TEST_F(ShowUntilSignalElementTest, ElementHidesAfterSignal) {
-  EXPECT_FALSE(element().IsVisible());
-
-  // Make element visible.
-  element().SetVisible(true);
-  EXPECT_FALSE(element().DoBeginFrame(MsToTicks(10), kStartHeadPose));
-  EXPECT_EQ(element().opacity_when_visible(), element().opacity());
-
-  // Signal, element should still be visible since time < min duration.
-  element().Signal(true);
-  EXPECT_FALSE(element().DoBeginFrame(MsToTicks(200), kStartHeadPose));
-  EXPECT_EQ(element().opacity_when_visible(), element().opacity());
-
-  // Element hides and callback triggered.
-  EXPECT_TRUE(element().DoBeginFrame(MsToTicks(2010), kStartHeadPose));
-  EXPECT_EQ(0.0f, element().opacity());
-  EXPECT_TRUE(callback_triggered());
-  EXPECT_EQ(TransientElementHideReason::kSignal, hide_reason());
+  // We run this twice to verify that an element can be shown again after being
+  // hidden.
+  VerifyElementHidesAfterSignal();
+  VerifyElementHidesAfterSignal();
 }
 
 // Test that the transient element times out.
@@ -197,12 +219,16 @@
 
   // Element should be visible since we haven't signalled.
   EXPECT_FALSE(element().DoBeginFrame(MsToTicks(2010), kStartHeadPose));
+  EXPECT_TRUE(min_duration_callback_triggered());
+  EXPECT_FALSE(hide_callback_triggered());
+  ResetCallbackTriggered();
   EXPECT_EQ(element().opacity_when_visible(), element().opacity());
 
   // Element hides and callback triggered.
   EXPECT_TRUE(element().DoBeginFrame(MsToTicks(6010), kStartHeadPose));
   EXPECT_EQ(0.0f, element().opacity());
-  EXPECT_TRUE(callback_triggered());
+  EXPECT_FALSE(min_duration_callback_triggered());
+  EXPECT_TRUE(hide_callback_triggered());
   EXPECT_EQ(TransientElementHideReason::kTimeout, hide_reason());
 }
 
diff --git a/chrome/browser/vr/model/web_vr_model.h b/chrome/browser/vr/model/web_vr_model.h
index 55bf0046..e98fbc9 100644
--- a/chrome/browser/vr/model/web_vr_model.h
+++ b/chrome/browser/vr/model/web_vr_model.h
@@ -11,6 +11,10 @@
 enum WebVrState {
   // We are not awaiting a WebVR frame.
   kWebVrNoTimeoutPending = 0,
+  // We are waiting for the minimum splash screen duration to be over. We're in
+  // this state only during WebVR auto-presentation. During this phase, sending
+  // VSync to the WebVR page is paused.
+  kWebVrAwaitingMinSplashScreenDuration,
   kWebVrAwaitingFirstFrame,
   // We are awaiting a WebVR frame, and we will soon exceed the amount of time
   // that we're willing to wait. In this state, it could be appropriate to show
@@ -32,6 +36,9 @@
   // modes.
   bool show_exit_toast = false;
   bool has_produced_frames() const { return state == kWebVrPresenting; }
+  bool awaiting_min_splash_screen_duration() const {
+    return state == kWebVrAwaitingMinSplashScreenDuration;
+  }
 };
 
 }  // namespace vr
diff --git a/chrome/browser/vr/testapp/vr_test_context.cc b/chrome/browser/vr/testapp/vr_test_context.cc
index 25b87b8..96850c61 100644
--- a/chrome/browser/vr/testapp/vr_test_context.cc
+++ b/chrome/browser/vr/testapp/vr_test_context.cc
@@ -55,7 +55,7 @@
 constexpr float kViewScaleAdjustmentFactor = 0.2f;
 constexpr float kPageLoadTimeMilliseconds = 500;
 
-constexpr gfx::Point3F kDefaultLaserOrigin = {0.1f, -0.5f, 0.f};
+constexpr gfx::Point3F kDefaultLaserOrigin = {0.5f, -0.5f, 0.f};
 constexpr gfx::Vector3dF kLaserLocalOffset = {0.f, -0.0075f, -0.05f};
 constexpr float kControllerScaleFactor = 1.5f;
 
@@ -111,7 +111,6 @@
   ui_->SetLoadProgress(0.4);
   ui_->SetVideoCaptureEnabled(true);
   ui_->SetScreenCaptureEnabled(true);
-  ui_->SetAudioCaptureEnabled(true);
   ui_->SetBluetoothConnected(true);
   ui_->SetLocationAccessEnabled(true);
   ui_->input_manager()->set_hit_test_strategy(
@@ -233,6 +232,12 @@
 
   const ui::MouseEvent* mouse_event = event->AsMouseEvent();
 
+  if (mouse_event->IsMiddleMouseButton()) {
+    if (mouse_event->type() == ui::ET_MOUSE_RELEASED) {
+      ui_->OnAppButtonClicked();
+    }
+  }
+
   // TODO(cjgrant): Figure out why, quite regularly, mouse click events do not
   // make it into this method and are missed.
   if (mouse_event->IsLeftMouseButton()) {
@@ -410,6 +415,8 @@
     case kWebVrNoTimeoutPending:
       ui_->SetWebVrMode(true, false);
       break;
+    case kWebVrAwaitingMinSplashScreenDuration:
+      break;
     case kWebVrAwaitingFirstFrame:
       ui_->OnWebVrTimeoutImminent();
       break;
diff --git a/chrome/browser/vr/ui.cc b/chrome/browser/vr/ui.cc
index e90c3f8..aaa82dd 100644
--- a/chrome/browser/vr/ui.cc
+++ b/chrome/browser/vr/ui.cc
@@ -65,7 +65,11 @@
 void Ui::SetWebVrMode(bool enabled, bool show_toast) {
   model_->web_vr.show_exit_toast = show_toast;
   if (enabled) {
-    model_->web_vr.state = kWebVrAwaitingFirstFrame;
+    if (!model_->web_vr_autopresentation_enabled()) {
+      // When auto-presenting, we transition into this state when the minimum
+      // splash-screen duration has passed.
+      model_->web_vr.state = kWebVrAwaitingFirstFrame;
+    }
     // We have this check here so that we don't set the mode to kModeWebVr when
     // it should be kModeWebVrAutopresented. The latter is set when the UI is
     // initialized.
@@ -197,6 +201,11 @@
   model_->can_apply_new_background = true;
 }
 
+bool Ui::CanSendWebVrVSync() {
+  return model_->web_vr_enabled() &&
+         !model_->web_vr.awaiting_min_splash_screen_duration();
+}
+
 bool Ui::ShouldRenderWebVr() {
   return model_->web_vr.has_produced_frames();
 }
@@ -365,10 +374,13 @@
   model_->ui_modes.clear();
   model_->push_mode(kModeBrowsing);
   if (ui_initial_state.in_web_vr) {
-    model_->web_vr.state = kWebVrAwaitingFirstFrame;
-    auto mode = ui_initial_state.web_vr_autopresentation_expected
-                    ? kModeWebVrAutopresented
-                    : kModeWebVr;
+    auto mode = kModeWebVr;
+    if (ui_initial_state.web_vr_autopresentation_expected) {
+      mode = kModeWebVrAutopresented;
+      model_->web_vr.state = kWebVrAwaitingMinSplashScreenDuration;
+    } else {
+      model_->web_vr.state = kWebVrAwaitingFirstFrame;
+    }
     model_->push_mode(mode);
   }
 
diff --git a/chrome/browser/vr/ui.h b/chrome/browser/vr/ui.h
index f52216cf..832d9b8 100644
--- a/chrome/browser/vr/ui.h
+++ b/chrome/browser/vr/ui.h
@@ -97,13 +97,21 @@
                       const base::Version& component_version);
 
   void OnAssetsLoading();
+  // TODO(ymalik): We expose this to stop sending VSync to the WebVR page until
+  // the splash screen has been visible for its minimum duration. The visibility
+  // logic currently lives in the UI, and it'd be much cleaner if the UI didn't
+  // have to worry about this, and if it were told to hide the splash screen
+  // like other WebVR phases (e.g. OnWebVrFrameAvailable below).
+  bool CanSendWebVrVSync();
   bool ShouldRenderWebVr();
+
   void OnGlInitialized(
       unsigned int content_texture_id,
       UiElementRenderer::TextureLocation content_location,
       unsigned int content_overlay_texture_id,
       UiElementRenderer::TextureLocation content_overlay_location,
       bool use_ganesh);
+
   void OnAppButtonClicked();
   void OnAppButtonGesturePerformed(
       PlatformController::SwipeDirection direction);
diff --git a/chrome/browser/vr/ui_scene_creator.cc b/chrome/browser/vr/ui_scene_creator.cc
index 3d35aea7..08c8b27 100644
--- a/chrome/browser/vr/ui_scene_creator.cc
+++ b/chrome/browser/vr/ui_scene_creator.cc
@@ -794,6 +794,16 @@
       base::TimeDelta::FromSeconds(kSplashScreenMinDurationSeconds),
       base::TimeDelta::Max(),
       base::BindRepeating(
+          [](Model* model) {
+            DCHECK(model->web_vr.awaiting_min_splash_screen_duration());
+            // TODO(ymalik): The assumption here is that the WebVR VSync will be
+            // paused until the min splash screen duration passes. This state
+            // change should be driven by the scheduler in the future and the UI
+            // should act on it.
+            model->web_vr.state = kWebVrAwaitingFirstFrame;
+          },
+          base::Unretained(model_)),
+      base::BindRepeating(
           [](Model* model, UiBrowserInterface* browser,
              TransientElementHideReason reason) {
             if (reason == TransientElementHideReason::kTimeout) {
@@ -1322,7 +1332,8 @@
   auto back_button_label = CreateControllerLabel(
       kControllerBackButtonLabel, kControllerBackButtonOffset,
       l10n_util::GetStringUTF16(IDS_VR_BUTTON_BACK), model_);
-  VR_BIND_VISIBILITY(back_button_label, model->omnibox_editing_enabled());
+  VR_BIND_VISIBILITY(back_button_label, model->omnibox_editing_enabled() ||
+                                            model->voice_search_enabled());
   callout_group->AddChild(std::move(back_button_label));
 
   controller->AddChild(std::move(callout_group));
diff --git a/chrome/browser/vr/ui_unittest.cc b/chrome/browser/vr/ui_unittest.cc
index 12f05a5..1cb9cf6 100644
--- a/chrome/browser/vr/ui_unittest.cc
+++ b/chrome/browser/vr/ui_unittest.cc
@@ -384,11 +384,12 @@
 
   // Enter WebVR with autopresentation.
   ui_->SetWebVrMode(true, false);
-  ui_->OnWebVrFrameAvailable();
 
   // The splash screen should go away.
   RunFor(
       MsToDelta(1000 * (kSplashScreenMinDurationSeconds + kSmallDelaySeconds)));
+  ui_->OnWebVrFrameAvailable();
+  EXPECT_TRUE(RunFor(MsToDelta(10)));
   VerifyOnlyElementsVisible("Autopresented", {kWebVrUrlToast});
 
   // Make sure the transient URL bar times out.
@@ -409,11 +410,12 @@
   VerifyOnlyElementsVisible("Initial", {kSplashScreenText, kWebVrBackground});
 
   ui_->SetWebVrMode(true, false);
-  ui_->OnWebVrTimeoutImminent();
-
   EXPECT_TRUE(RunFor(MsToDelta(
       1000 * (kSplashScreenMinDurationSeconds + kSmallDelaySeconds * 2))));
 
+  ui_->OnWebVrTimeoutImminent();
+  EXPECT_TRUE(RunFor(MsToDelta(10)));
+
   VerifyOnlyElementsVisible("Timeout imminent",
                             {kWebVrTimeoutSpinner, kWebVrBackground});
 }
@@ -1036,7 +1038,10 @@
   VerifyOnlyElementsVisible("Initial", {kSplashScreenText, kWebVrBackground});
   // Enter WebVR with autopresentation.
   ui_->SetWebVrMode(true, false);
-  EXPECT_TRUE(RunFor(MsToDelta(2000)));
+  EXPECT_TRUE(RunFor(MsToDelta(1000 * kSplashScreenMinDurationSeconds)));
+  VerifyOnlyElementsVisible("Initial", {kSplashScreenText, kWebVrBackground});
+
+  EXPECT_FALSE(RunFor(MsToDelta(2000)));
   ui_->OnWebVrTimeoutImminent();
   EXPECT_TRUE(RunFor(MsToDelta(3000)));
   ui_->OnWebVrTimedOut();
@@ -1096,11 +1101,25 @@
   EXPECT_FALSE(IsVisible(kControllerBackButtonLabel));
 
   model_->pop_mode(kModeFullscreen);
+  EXPECT_TRUE(IsVisible(kControllerTrackpadLabel));
+  EXPECT_FALSE(IsVisible(kControllerExitButtonLabel));
+  EXPECT_FALSE(IsVisible(kControllerBackButtonLabel));
+
   model_->push_mode(kModeEditingOmnibox);
   EXPECT_TRUE(IsVisible(kControllerTrackpadLabel));
   EXPECT_FALSE(IsVisible(kControllerExitButtonLabel));
   EXPECT_TRUE(IsVisible(kControllerBackButtonLabel));
 
+  model_->pop_mode(kModeEditingOmnibox);
+  EXPECT_TRUE(IsVisible(kControllerTrackpadLabel));
+  EXPECT_FALSE(IsVisible(kControllerExitButtonLabel));
+  EXPECT_FALSE(IsVisible(kControllerBackButtonLabel));
+
+  model_->push_mode(kModeVoiceSearch);
+  EXPECT_TRUE(IsVisible(kControllerTrackpadLabel));
+  EXPECT_FALSE(IsVisible(kControllerExitButtonLabel));
+  EXPECT_TRUE(IsVisible(kControllerBackButtonLabel));
+
   model_->controller.resting_in_viewport = false;
   EXPECT_FALSE(IsVisible(kControllerTrackpadLabel));
   EXPECT_FALSE(IsVisible(kControllerExitButtonLabel));
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 6773b74..7884a82a 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -16,10 +16,12 @@
 #include "chrome/common/url_constants.h"
 #include "components/crx_file/id_util.h"
 #include "extensions/common/extension.h"
+#include "extensions/common/extension_builder.h"
 #include "extensions/common/extension_resource.h"
 #include "extensions/common/file_util.h"
 #include "extensions/common/manifest.h"
 #include "extensions/common/permissions/permissions_data.h"
+#include "extensions/common/value_builder.h"
 #include "net/base/mime_sniffer.h"
 #include "net/dns/mock_host_resolver.h"
 #include "skia/ext/image_operations.h"
@@ -86,6 +88,68 @@
                 Manifest::EXTERNAL_PREF));
 }
 
+TEST(ExtensionTest, EnsureNewLinesInExtensionNameAreCollapsed) {
+  DictionaryBuilder manifest;
+  std::string unsanitized_name = "Test\n\n\n\n\n\n\n\n\n\n\n\nNew lines\u0085";
+  manifest.Set("name", unsanitized_name)
+      .Set("manifest_version", 2)
+      .Set("description", "some description");
+  scoped_refptr<const Extension> extension =
+      ExtensionBuilder()
+          .SetManifest(manifest.Build())
+          .MergeManifest(DictionaryBuilder().Set("version", "0.1").Build())
+          .Build();
+  ASSERT_TRUE(extension.get());
+  EXPECT_EQ("TestNew lines", extension->name());
+  // Ensure that non-localized name is not sanitized.
+  EXPECT_EQ(unsanitized_name, extension->non_localized_name());
+}
+
+TEST(ExtensionTest, EnsureWhitespacesInExtensionNameAreCollapsed) {
+  DictionaryBuilder manifest;
+  std::string unsanitized_name = "Test                        Whitespace";
+  manifest.Set("name", unsanitized_name)
+      .Set("manifest_version", 2)
+      .Set("description", "some description");
+  scoped_refptr<const Extension> extension =
+      ExtensionBuilder()
+          .SetManifest(manifest.Build())
+          .MergeManifest(DictionaryBuilder().Set("version", "0.1").Build())
+          .Build();
+  ASSERT_TRUE(extension.get());
+  EXPECT_EQ("Test Whitespace", extension->name());
+  // Ensure that non-localized name is not sanitized.
+  EXPECT_EQ(unsanitized_name, extension->non_localized_name());
+}
+
+// TODO(crbug.com/794252): Disallow empty extension names from being locally
+// loaded.
+TEST(ExtensionTest, EmptyName) {
+  DictionaryBuilder manifest1;
+  manifest1.Set("name", "")
+      .Set("manifest_version", 2)
+      .Set("description", "some description");
+  scoped_refptr<const Extension> extension =
+      ExtensionBuilder()
+          .SetManifest(manifest1.Build())
+          .MergeManifest(DictionaryBuilder().Set("version", "0.1").Build())
+          .Build();
+  ASSERT_TRUE(extension.get());
+  EXPECT_EQ("", extension->name());
+
+  DictionaryBuilder manifest2;
+  manifest2.Set("name", " ")
+      .Set("manifest_version", 2)
+      .Set("description", "some description");
+  extension =
+      ExtensionBuilder()
+          .SetManifest(manifest2.Build())
+          .MergeManifest(DictionaryBuilder().Set("version", "0.1").Build())
+          .Build();
+  ASSERT_TRUE(extension.get());
+  EXPECT_EQ("", extension->name());
+}
+
 TEST(ExtensionTest, GetResourceURLAndPath) {
   scoped_refptr<Extension> extension = LoadManifestStrict("empty_manifest",
       "empty.json");
diff --git a/chrome/installer/linux/common/installer.include b/chrome/installer/linux/common/installer.include
index 73d801a..9bce61fe 100644
--- a/chrome/installer/linux/common/installer.include
+++ b/chrome/installer/linux/common/installer.include
@@ -159,12 +159,12 @@
   # V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag
   # is true.
   install -m 644 "${BUILDDIR}/natives_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
-  install -m 644 "${BUILDDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
-
-  # V8 context snapshot file; it will replace V8's snapshot_blob.bin
-  # TODO(peria): Remove snapshot_blob.bin when dependencies are resolved.
+  # Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available.
+  # TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch
   if [ -f "${BUILDDIR}/v8_context_snapshot.bin" ]; then
     install -m 644 "${BUILDDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/"
+  else
+    install -m 644 "${BUILDDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
   fi
 
   # sandbox
diff --git a/chrome/installer/mini_installer/BUILD.gn b/chrome/installer/mini_installer/BUILD.gn
index 7395373..f606dfe 100644
--- a/chrome/installer/mini_installer/BUILD.gn
+++ b/chrome/installer/mini_installer/BUILD.gn
@@ -9,6 +9,7 @@
 import("//chrome/test/mini_installer/mini_installer_test.gni")
 import("//components/nacl/features.gni")
 import("//third_party/icu/config.gni")
+import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
 import("//ui/base/ui_features.gni")
 import("//v8/gni/v8.gni")
 
@@ -180,7 +181,6 @@
       "//chrome/browser/extensions/default_extensions",
       "//chrome/installer/setup",
       "//third_party/icu:icudata",
-      "//tools/v8_context_snapshot",
       chrome_dll_target,
     ]
 
@@ -212,11 +212,14 @@
     }
 
     if (v8_use_external_startup_data) {
-      inputs += [
-        "$root_out_dir/natives_blob.bin",
-        "$root_out_dir/snapshot_blob.bin",
-      ]
+      inputs += [ "$root_out_dir/natives_blob.bin" ]
       deps += [ "//v8" ]
+      if (use_v8_context_snapshot) {
+        inputs += [ "$root_out_dir/v8_context_snapshot.bin" ]
+        deps += [ "//tools/v8_context_snapshot" ]
+      } else {
+        inputs += [ "$root_out_dir/snapshot_blob.bin" ]
+      }
     }
 
     depfile = "$target_gen_dir/archive.d"
diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release
index bb66e6b..99e9577 100644
--- a/chrome/installer/mini_installer/chrome.release
+++ b/chrome/installer/mini_installer/chrome.release
@@ -34,7 +34,6 @@
 nacl_irt_x86_64.nexe: %(VersionDir)s\
 natives_blob.bin: %(VersionDir)s\
 resources.pak: %(VersionDir)s\
-snapshot_blob.bin: %(VersionDir)s\
 syzyasan_rtl.dll: %(VersionDir)s\
 v8_context_snapshot.bin: %(VersionDir)s\
 #
diff --git a/chrome/test/chromedriver/BUILD.gn b/chrome/test/chromedriver/BUILD.gn
index d91cb06b..a7a8ce6a 100644
--- a/chrome/test/chromedriver/BUILD.gn
+++ b/chrome/test/chromedriver/BUILD.gn
@@ -326,6 +326,29 @@
   ]
 }
 
+group("chromedriver_py_tests") {
+  testonly = true
+  deps = [
+    ":chromedriver",
+    "//chrome:chrome",
+  ]
+
+  _py_files = read_file("test/run_py_tests.pydeps", "list lines")
+
+  # Filter out comments.
+  set_sources_assignment_filter([ "#*" ])
+  sources = _py_files
+
+  data = sources + [
+           "//chrome/test/data/chromedriver/",
+           "//testing/xvfb.py",
+         ]
+
+  data_deps = [
+    "//chrome/test/chromedriver",
+  ]
+}
+
 test("chromedriver_unittests") {
   sources = [
     "capabilities_unittest.cc",
diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py
index 768305bc..c103dc03 100755
--- a/chrome/test/chromedriver/test/run_py_tests.py
+++ b/chrome/test/chromedriver/test/run_py_tests.py
@@ -2701,6 +2701,14 @@
       '', '--android-package',
       help=('Android package key. Possible values: ' +
             str(_ANDROID_NEGATIVE_FILTER.keys())))
+
+  parser.add_option(
+      '', '--isolated-script-test-output',
+      help='JSON output file used by swarming')
+  parser.add_option(
+      '', '--isolated-script-test-perf-output',
+      help='JSON perf output file used by swarming, ignored')
+
   options, args = parser.parse_args()
 
   options.chromedriver = util.GetAbsolutePathOfUserPath(options.chromedriver)
@@ -2752,4 +2760,32 @@
   ChromeDriverTest.GlobalTearDown()
   HeadlessInvalidCertificateTest.GlobalTearDown()
   MobileEmulationCapabilityTest.GlobalTearDown()
+
+  if options.isolated_script_test_output:
+    output = {
+        'interrupted': False,
+        'num_failures_by_type': { },
+        'path_delimiter': '.',
+        'seconds_since_epoch': time.time(),
+        'tests': { },
+        'version': 3,
+    }
+
+    for test in tests:
+      output['tests'][test.id()] = {
+          'expected': 'PASS',
+          'actual': 'PASS'
+      }
+
+    for failure in result.failures + result.errors:
+      output['tests'][failure[0].id()]['actual'] = 'FAIL'
+
+    num_fails = len(result.failures) + len(result.errors)
+    output['num_failures_by_type']['FAIL'] = num_fails
+    output['num_failures_by_type']['PASS'] = len(output['tests']) - num_fails
+
+    with open(options.isolated_script_test_output, 'w') as fp:
+      json.dump(output, fp)
+      fp.write('\n')
+
   sys.exit(len(result.failures) + len(result.errors))
diff --git a/chrome/test/chromedriver/test/run_py_tests.pydeps b/chrome/test/chromedriver/test/run_py_tests.pydeps
new file mode 100644
index 0000000..4b709124
--- /dev/null
+++ b/chrome/test/chromedriver/test/run_py_tests.pydeps
@@ -0,0 +1,70 @@
+# Generated by running:
+#   build/print_python_deps.py --root chrome/test/chromedriver --output chrome/test/chromedriver/test/run_py_tests.pydeps chrome/test/chromedriver/test/run_py_tests.py
+../../../build/android/devil_chromium.py
+../../../build/android/pylib/__init__.py
+../../../build/android/pylib/constants/__init__.py
+../../../build/android/pylib/constants/host_paths.py
+../../../third_party/catapult/common/py_utils/py_utils/__init__.py
+../../../third_party/catapult/common/py_utils/py_utils/cloud_storage.py
+../../../third_party/catapult/common/py_utils/py_utils/cloud_storage_global_lock.py
+../../../third_party/catapult/common/py_utils/py_utils/lock.py
+../../../third_party/catapult/common/py_utils/py_utils/tempfile_ext.py
+../../../third_party/catapult/dependency_manager/dependency_manager/__init__.py
+../../../third_party/catapult/dependency_manager/dependency_manager/archive_info.py
+../../../third_party/catapult/dependency_manager/dependency_manager/base_config.py
+../../../third_party/catapult/dependency_manager/dependency_manager/cloud_storage_info.py
+../../../third_party/catapult/dependency_manager/dependency_manager/dependency_info.py
+../../../third_party/catapult/dependency_manager/dependency_manager/dependency_manager_util.py
+../../../third_party/catapult/dependency_manager/dependency_manager/exceptions.py
+../../../third_party/catapult/dependency_manager/dependency_manager/local_path_info.py
+../../../third_party/catapult/dependency_manager/dependency_manager/manager.py
+../../../third_party/catapult/dependency_manager/dependency_manager/uploader.py
+../../../third_party/catapult/devil/devil/__init__.py
+../../../third_party/catapult/devil/devil/android/__init__.py
+../../../third_party/catapult/devil/devil/android/apk_helper.py
+../../../third_party/catapult/devil/devil/android/constants/__init__.py
+../../../third_party/catapult/devil/devil/android/constants/chrome.py
+../../../third_party/catapult/devil/devil/android/constants/file_system.py
+../../../third_party/catapult/devil/devil/android/decorators.py
+../../../third_party/catapult/devil/devil/android/device_errors.py
+../../../third_party/catapult/devil/devil/android/device_signal.py
+../../../third_party/catapult/devil/devil/android/device_temp_file.py
+../../../third_party/catapult/devil/devil/android/device_utils.py
+../../../third_party/catapult/devil/devil/android/forwarder.py
+../../../third_party/catapult/devil/devil/android/install_commands.py
+../../../third_party/catapult/devil/devil/android/logcat_monitor.py
+../../../third_party/catapult/devil/devil/android/md5sum.py
+../../../third_party/catapult/devil/devil/android/sdk/__init__.py
+../../../third_party/catapult/devil/devil/android/sdk/aapt.py
+../../../third_party/catapult/devil/devil/android/sdk/adb_wrapper.py
+../../../third_party/catapult/devil/devil/android/sdk/build_tools.py
+../../../third_party/catapult/devil/devil/android/sdk/intent.py
+../../../third_party/catapult/devil/devil/android/sdk/keyevent.py
+../../../third_party/catapult/devil/devil/android/sdk/split_select.py
+../../../third_party/catapult/devil/devil/android/sdk/version_codes.py
+../../../third_party/catapult/devil/devil/android/valgrind_tools/__init__.py
+../../../third_party/catapult/devil/devil/android/valgrind_tools/base_tool.py
+../../../third_party/catapult/devil/devil/base_error.py
+../../../third_party/catapult/devil/devil/constants/__init__.py
+../../../third_party/catapult/devil/devil/constants/exit_codes.py
+../../../third_party/catapult/devil/devil/devil_env.py
+../../../third_party/catapult/devil/devil/utils/__init__.py
+../../../third_party/catapult/devil/devil/utils/cmd_helper.py
+../../../third_party/catapult/devil/devil/utils/host_utils.py
+../../../third_party/catapult/devil/devil/utils/lazy/__init__.py
+../../../third_party/catapult/devil/devil/utils/lazy/weak_constant.py
+../../../third_party/catapult/devil/devil/utils/parallelizer.py
+../../../third_party/catapult/devil/devil/utils/reraiser_thread.py
+../../../third_party/catapult/devil/devil/utils/timeout_retry.py
+../../../third_party/catapult/devil/devil/utils/watchdog_timer.py
+../../../third_party/catapult/devil/devil/utils/zip_utils.py
+../../../third_party/catapult/third_party/zipfile/zipfile_2_7_13.py
+chrome_paths.py
+client/chromedriver.py
+client/command_executor.py
+client/webelement.py
+server/server.py
+test/run_py_tests.py
+test/unittest_util.py
+test/webserver.py
+util.py
diff --git a/chrome/test/data/webui/print_preview/native_layer_stub.js b/chrome/test/data/webui/print_preview/native_layer_stub.js
index 16451822..ac27754 100644
--- a/chrome/test/data/webui/print_preview/native_layer_stub.js
+++ b/chrome/test/data/webui/print_preview/native_layer_stub.js
@@ -73,8 +73,10 @@
     /** @override */
     getPrinters(type) {
       this.methodCalled('getPrinters', type);
-      cr.webUIListenerCallback(
-          'printers-added', type, this.localDestinationInfos_);
+      if (type == print_preview.PrinterType.LOCAL_PRINTER) {
+        cr.webUIListenerCallback(
+            'printers-added', type, this.localDestinationInfos_);
+      }
       return Promise.resolve();
     }
 
@@ -122,6 +124,8 @@
     /** @override */
     getPrinterCapabilities(printerId, type) {
       this.methodCalled('getPrinterCapabilities', printerId, type);
+      if (type != print_preview.PrinterType.LOCAL_PRINTER)
+        return Promise.reject();
       return this.localDestinationCapabilities_.get(printerId);
     }
 
diff --git a/chrome/test/data/webui/print_preview/print_preview_tests.js b/chrome/test/data/webui/print_preview/print_preview_tests.js
index 390f3c63..d4f8c29 100644
--- a/chrome/test/data/webui/print_preview/print_preview_tests.js
+++ b/chrome/test/data/webui/print_preview/print_preview_tests.js
@@ -820,7 +820,6 @@
           // display. There will be 2 preview requests. Since we only catch
           // the first one, only verify fit to page in print ticket.
           return nativeLayer.whenCalled('getPreview').then(function(args) {
-            console.log('args.printticket ' + args.printTicket);
             const updatedTicket = JSON.parse(args.printTicket);
             expectFalse(updatedTicket.fitToPageEnabled);
             expectFalse(fitToPageContainer.querySelector('.checkbox').checked);
diff --git a/chrome/tools/build/linux/FILES.cfg b/chrome/tools/build/linux/FILES.cfg
index 19182648..3a5d6186 100644
--- a/chrome/tools/build/linux/FILES.cfg
+++ b/chrome/tools/build/linux/FILES.cfg
@@ -80,10 +80,6 @@
     'buildtype': ['dev'],
   },
   {
-    'filename': 'snapshot_blob.bin',
-    'buildtype': ['dev', 'official'],
-  },
-  {
     'filename': 'v8_context_snapshot.bin',
     'buildtype': ['dev', 'official'],
   },
@@ -283,12 +279,6 @@
     'optional': ['dev'],
   },
   {
-    'filename': 'snapshot_blob.bin',
-    'buildtype': ['dev'],
-    'archive': 'content-shell.zip',
-    'optional': ['dev'],
-  },
-  {
     'filename': 'v8_context_snapshot.bin',
     'buildtype': ['dev'],
     'archive': 'content-shell.zip',
diff --git a/chrome/tools/build/mac/FILES.cfg b/chrome/tools/build/mac/FILES.cfg
index a10d0b1..5f925df 100644
--- a/chrome/tools/build/mac/FILES.cfg
+++ b/chrome/tools/build/mac/FILES.cfg
@@ -110,12 +110,6 @@
     'optional': ['dev'],
   },
   {
-    'filename': 'snapshot_blob.bin',
-    'buildtype': ['dev'],
-    'archive': 'content-shell.zip',
-    'optional': ['dev'],
-  },
-  {
     'filename': 'v8_context_snapshot.bin',
     'buildtype': ['dev'],
     'archive': 'content-shell.zip',
diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg
index e82d791..f661f39 100644
--- a/chrome/tools/build/win/FILES.cfg
+++ b/chrome/tools/build/win/FILES.cfg
@@ -113,11 +113,6 @@
     'optional': ['dev', 'official'],
   },
   {
-    'filename': 'snapshot_blob.bin',
-    'buildtype': ['dev', 'official'],
-    'optional': ['dev', 'official'],
-  },
-  {
     'filename': 'v8_context_snapshot.bin',
     'buildtype': ['dev', 'official'],
     'optional': ['dev', 'official'],
@@ -820,12 +815,6 @@
     'optional': ['dev'],
   },
   {
-    'filename': 'snapshot_blob.bin',
-    'buildtype': ['dev'],
-    'archive': 'content-shell.zip',
-    'optional': ['dev'],
-  },
-  {
     'filename': 'v8_context_snapshot.bin',
     'buildtype': ['dev'],
     'archive': 'content-shell.zip',
diff --git a/chromecast/graphics/cast_window_manager_aura.cc b/chromecast/graphics/cast_window_manager_aura.cc
index 34a4112c..785db6b6 100644
--- a/chromecast/graphics/cast_window_manager_aura.cc
+++ b/chromecast/graphics/cast_window_manager_aura.cc
@@ -30,10 +30,7 @@
     case display::Display::ROTATE_0:
       break;
     case display::Display::ROTATE_90:
-      // TODO(dnicoara): Figure out why this is not correct.
-      // rotation.Translate(display.height(), 0);
-      rotation.Translate(
-          (display.bounds().height() + display.bounds().width()) / 2, 0);
+      rotation.Translate(display.bounds().height(), 0);
       rotation.Rotate(90);
       break;
     case display::Display::ROTATE_180:
@@ -41,10 +38,7 @@
       rotation.Rotate(180);
       break;
     case display::Display::ROTATE_270:
-      // TODO(dnicoara): Figure out why this is not correct.
-      // rotation.Translate(0, display.width());
-      rotation.Translate(
-          0, (display.bounds().height() + display.bounds().width()) / 2);
+      rotation.Translate(0, display.bounds().width());
       rotation.Rotate(270);
       break;
   }
@@ -233,7 +227,8 @@
       new CastWindowTreeHost(enable_input_, gfx::Rect(display_size)));
   window_tree_host_->InitHost();
   window_tree_host_->window()->SetLayoutManager(new CastLayoutManager());
-  window_tree_host_->SetRootTransform(GetPrimaryDisplayRotationTransform());
+  window_tree_host_->window()->SetTransform(
+      GetPrimaryDisplayRotationTransform());
 
   // Allow seeing through to the hardware video plane:
   window_tree_host_->compositor()->SetBackgroundColor(SK_ColorTRANSPARENT);
diff --git a/chromeos/dbus/proto/media_perception.proto b/chromeos/dbus/proto/media_perception.proto
index 84ea834..265dd38 100644
--- a/chromeos/dbus/proto/media_perception.proto
+++ b/chromeos/dbus/proto/media_perception.proto
@@ -63,6 +63,10 @@
 
   // A list of video streams processed by the analytics process.
   repeated VideoStreamParam video_stream_param = 3;
+
+  // Media analytics configuration. It can only be used when setting state to
+  // RUNNING.
+  optional string configuration = 4;
 }
 
 // This is the output of the MediaPerceptionSinkCalculator.
diff --git a/components/background_task_scheduler/README.md b/components/background_task_scheduler/README.md
index bc83b48d..db2322d 100644
--- a/components/background_task_scheduler/README.md
+++ b/components/background_task_scheduler/README.md
@@ -30,13 +30,9 @@
 JobScheduler API is used on Android M+; and the GcmNetworkManager is used
 otherwise.
 
-> **WARNING: The GcmNetworkManager fallback is not yet implemented.** Please
-> treat the above as a target state, and do not yet add any dependencies on the
-> BackgroundTaskScheduler API that require pre-M compatibility.
-
-> NOTE: Even with the GcmNetworkManager fallback, there are devices that would
-> remain unsupported, as not all devices have Google Play services
-> available. Ultimately, this component hopes to provide a full compatibility
+> NOTE: Some of the pre-M devices do not include Google Play services and
+> therefore remain unsupported by `background_task_scheduler`.
+> Ultimately, this component hopes to provide a full compatibility
 > layer on top of `JobScheduler`. However, until that is implemented, please be
 > thoughtful about whether this component provides the coverage that your
 > background task needs.
@@ -179,3 +175,27 @@
 **The system will hold a wakelock from the time `onStartTask(...)` is invoked
 until either the task itself invokes the `TaskFinishedCallback`, or
 `onStopTask(...)` is invoked.**
+
+## Loading Native parts
+
+Some of the tasks running in the background require native parts of the browser
+to be initialized. In order to simplify implementation of such tasks, we provide
+an base `NativeBackgroundTask`
+[implementation](https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/background_task_scheduler/NativeBackgroundTask.java)
+in the browser layer. It requires extending classes to implement 4 methods:
+
+ * `onStartTaskBeforeNativeLoaded(...)` where the background task can decide
+   whether conditions are correct to proceed with native initialization;
+ * `onStartTaskWithNative(...)` where the background task can be sure that
+   native initialization was completed, therefore it can depend on that part of
+   the browser;
+ * `onStopTaskBeforeNativeLoaded(...)` which is delivered to the background task
+   just like `onStopTask(...)` and the native parts of the browser are not
+   loaded;
+ * `onStopTaskWithNative(...)` which is delivered to the background task just
+   like `onStopTask(...)` and the native parts of the browser are loaded.
+
+While in a normal execution, both `onStart...` methods are called, only one of
+the stopping methods will be triggered, depending on whether the native parts of
+the browser are loaded at the time the underlying scheduler decides to stop the
+task.
diff --git a/components/component_updater/component_updater_service.cc b/components/component_updater/component_updater_service.cc
index 54d0161..b1304c5d 100644
--- a/components/component_updater/component_updater_service.cc
+++ b/components/component_updater/component_updater_service.cc
@@ -400,7 +400,8 @@
 
   // Unblock all throttles for the component.
   if (event == Observer::Events::COMPONENT_UPDATED ||
-      event == Observer::Events::COMPONENT_NOT_UPDATED) {
+      event == Observer::Events::COMPONENT_NOT_UPDATED ||
+      event == Observer::Events::COMPONENT_UPDATE_ERROR) {
     auto callbacks = ready_callbacks_.equal_range(id);
     for (auto it = callbacks.first; it != callbacks.second; ++it) {
       std::move(it->second).Run();
diff --git a/components/download/BUILD.gn b/components/download/BUILD.gn
index 4750fd24..fec316c9 100644
--- a/components/download/BUILD.gn
+++ b/components/download/BUILD.gn
@@ -10,7 +10,7 @@
       "//components/download/content/internal:unit_tests",
       "//components/download/content/public:unit_tests",
       "//components/download/downloader/in_progress:unit_tests",
-      "//components/download/internal:unit_tests",
+      "//components/download/internal/background_service:unit_tests",
     ]
   }
 
diff --git a/components/download/content/factory/BUILD.gn b/components/download/content/factory/BUILD.gn
index 96ccec7..a57cd73 100644
--- a/components/download/content/factory/BUILD.gn
+++ b/components/download/content/factory/BUILD.gn
@@ -11,14 +11,14 @@
   ]
 
   public_deps = [
-    "//components/download/public",
+    "//components/download/public/background_service:public",
   ]
 
   deps = [
     "//base",
     "//components/download/content/internal",
-    "//components/download/internal",
-    "//components/download/internal/proto",
+    "//components/download/internal/background_service:internal",
+    "//components/download/internal/background_service/proto",
     "//components/keyed_service/content",
     "//components/leveldb_proto",
     "//content/public/browser",
diff --git a/components/download/content/factory/download_service_factory.cc b/components/download/content/factory/download_service_factory.cc
index cfa39be..a31923e 100644
--- a/components/download/content/factory/download_service_factory.cc
+++ b/components/download/content/factory/download_service_factory.cc
@@ -6,20 +6,20 @@
 #include "build/build_config.h"
 #include "components/download/content/factory/navigation_monitor_factory.h"
 #include "components/download/content/internal/download_driver_impl.h"
-#include "components/download/internal/client_set.h"
-#include "components/download/internal/config.h"
-#include "components/download/internal/controller_impl.h"
-#include "components/download/internal/download_service_impl.h"
-#include "components/download/internal/download_store.h"
-#include "components/download/internal/file_monitor_impl.h"
-#include "components/download/internal/logger_impl.h"
-#include "components/download/internal/model_impl.h"
-#include "components/download/internal/proto/entry.pb.h"
-#include "components/download/internal/scheduler/scheduler_impl.h"
+#include "components/download/internal/background_service/client_set.h"
+#include "components/download/internal/background_service/config.h"
+#include "components/download/internal/background_service/controller_impl.h"
+#include "components/download/internal/background_service/download_service_impl.h"
+#include "components/download/internal/background_service/download_store.h"
+#include "components/download/internal/background_service/file_monitor_impl.h"
+#include "components/download/internal/background_service/logger_impl.h"
+#include "components/download/internal/background_service/model_impl.h"
+#include "components/download/internal/background_service/proto/entry.pb.h"
+#include "components/download/internal/background_service/scheduler/scheduler_impl.h"
 #include "components/leveldb_proto/proto_database_impl.h"
 
 #if defined(OS_ANDROID)
-#include "components/download/internal/android/battery_status_listener_android.h"
+#include "components/download/internal/background_service/android/battery_status_listener_android.h"
 #endif
 
 namespace download {
diff --git a/components/download/content/factory/download_service_factory.h b/components/download/content/factory/download_service_factory.h
index 8df6dfe7..ce2fb7e 100644
--- a/components/download/content/factory/download_service_factory.h
+++ b/components/download/content/factory/download_service_factory.h
@@ -10,7 +10,7 @@
 #include "base/files/file_path.h"
 #include "base/memory/ref_counted.h"
 #include "base/sequenced_task_runner.h"
-#include "components/download/public/clients.h"
+#include "components/download/public/background_service/clients.h"
 
 namespace content {
 class DownloadManager;
diff --git a/components/download/content/factory/navigation_monitor_factory.cc b/components/download/content/factory/navigation_monitor_factory.cc
index c4b408a..8459b60b 100644
--- a/components/download/content/factory/navigation_monitor_factory.cc
+++ b/components/download/content/factory/navigation_monitor_factory.cc
@@ -4,7 +4,7 @@
 
 #include "components/download/content/factory/navigation_monitor_factory.h"
 
-#include "components/download/internal/navigation_monitor_impl.h"
+#include "components/download/internal/background_service/navigation_monitor_impl.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 
 namespace download {
diff --git a/components/download/content/internal/BUILD.gn b/components/download/content/internal/BUILD.gn
index 77025b91..196bbb0 100644
--- a/components/download/content/internal/BUILD.gn
+++ b/components/download/content/internal/BUILD.gn
@@ -15,8 +15,8 @@
 
   public_deps = [
     "//components/download/content/public",
-    "//components/download/internal",
-    "//components/download/public",
+    "//components/download/internal/background_service:internal",
+    "//components/download/public/background_service:public",
   ]
 
   deps = [
diff --git a/components/download/content/internal/download_driver_impl.cc b/components/download/content/internal/download_driver_impl.cc
index 5e9037d..5f32c48a 100644
--- a/components/download/content/internal/download_driver_impl.cc
+++ b/components/download/content/internal/download_driver_impl.cc
@@ -10,7 +10,7 @@
 #include "base/metrics/histogram_functions.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/trace_event/memory_usage_estimator.h"
-#include "components/download/internal/driver_entry.h"
+#include "components/download/internal/background_service/driver_entry.h"
 #include "content/public/browser/download_interrupt_reasons.h"
 #include "content/public/browser/download_url_parameters.h"
 #include "content/public/browser/storage_partition.h"
diff --git a/components/download/content/internal/download_driver_impl.h b/components/download/content/internal/download_driver_impl.h
index 6d9d8010..fe7df95b 100644
--- a/components/download/content/internal/download_driver_impl.h
+++ b/components/download/content/internal/download_driver_impl.h
@@ -12,8 +12,8 @@
 #include "base/files/file_path.h"
 #include "base/memory/weak_ptr.h"
 #include "components/download/content/public/all_download_item_notifier.h"
-#include "components/download/internal/download_driver.h"
-#include "components/download/public/download_params.h"
+#include "components/download/internal/background_service/download_driver.h"
+#include "components/download/public/background_service/download_params.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/download_manager.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
diff --git a/components/download/content/public/BUILD.gn b/components/download/content/public/BUILD.gn
index 3bbc9b6..8512700 100644
--- a/components/download/content/public/BUILD.gn
+++ b/components/download/content/public/BUILD.gn
@@ -20,7 +20,7 @@
   ]
 
   deps = [
-    "//components/download/public",
+    "//components/download/public/background_service:public",
     "//content/public/browser",
   ]
 }
diff --git a/components/download/content/public/download_navigation_observer.h b/components/download/content/public/download_navigation_observer.h
index a817953..8f3aea1 100644
--- a/components/download/content/public/download_navigation_observer.h
+++ b/components/download/content/public/download_navigation_observer.h
@@ -6,7 +6,7 @@
 #define COMPONENTS_DOWNLOAD_CONTENT_PUBLIC_DOWNLOAD_NAVIGATION_OBSERVER_H_
 
 #include "base/macros.h"
-#include "components/download/public/navigation_monitor.h"
+#include "components/download/public/background_service/navigation_monitor.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "content/public/browser/web_contents_user_data.h"
 
diff --git a/components/download/internal/BUILD.gn b/components/download/internal/background_service/BUILD.gn
similarity index 88%
rename from components/download/internal/BUILD.gn
rename to components/download/internal/background_service/BUILD.gn
index de298e9..1e999ae 100644
--- a/components/download/internal/BUILD.gn
+++ b/components/download/internal/background_service/BUILD.gn
@@ -12,7 +12,7 @@
     ":*",
     "//components/download/content/factory",
     "//components/download/content/internal",
-    "//components/download/internal/test:test_support",
+    "//components/download/internal/background_service/test:test_support",
   ]
 
   sources = [
@@ -75,8 +75,8 @@
 
   deps = [
     "//base",
-    "//components/download/internal/proto",
-    "//components/download/public",
+    "//components/download/internal/background_service/proto",
+    "//components/download/public/background_service:public",
     "//components/leveldb_proto",
     "//net",
     "//storage/browser",
@@ -113,7 +113,7 @@
       "android/java/src/org/chromium/components/download/internal/BatteryStatusListenerAndroid.java",
       "android/java/src/org/chromium/components/download/internal/NetworkStatusListenerAndroid.java",
     ]
-    jni_package = "components/download/internal"
+    jni_package = "components/download/internal/background_service"
   }
 }
 
@@ -139,9 +139,9 @@
   deps = [
     ":internal",
     "//base/test:test_support",
-    "//components/download/internal/proto",
-    "//components/download/internal/test:test_support",
-    "//components/download/public/test:test_support",
+    "//components/download/internal/background_service/proto",
+    "//components/download/internal/background_service/test:test_support",
+    "//components/download/public/background_service/test:test_support",
     "//components/leveldb_proto:test_support",
     "//net:test_support",
     "//storage/browser",
diff --git a/components/download/internal/DEPS b/components/download/internal/background_service/DEPS
similarity index 100%
rename from components/download/internal/DEPS
rename to components/download/internal/background_service/DEPS
diff --git a/components/download/internal/android/battery_status_listener_android.cc b/components/download/internal/background_service/android/battery_status_listener_android.cc
similarity index 87%
rename from components/download/internal/android/battery_status_listener_android.cc
rename to components/download/internal/background_service/android/battery_status_listener_android.cc
index 454cd08a..070ffe9 100644
--- a/components/download/internal/android/battery_status_listener_android.cc
+++ b/components/download/internal/background_service/android/battery_status_listener_android.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/android/battery_status_listener_android.h"
+#include "components/download/internal/background_service/android/battery_status_listener_android.h"
 
 #include "base/android/jni_android.h"
 #include "jni/BatteryStatusListenerAndroid_jni.h"
diff --git a/components/download/internal/android/battery_status_listener_android.h b/components/download/internal/background_service/android/battery_status_listener_android.h
similarity index 65%
rename from components/download/internal/android/battery_status_listener_android.h
rename to components/download/internal/background_service/android/battery_status_listener_android.h
index cd2420b..ac3bcf3 100644
--- a/components/download/internal/android/battery_status_listener_android.h
+++ b/components/download/internal/background_service/android/battery_status_listener_android.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_ANDROID_BATTERY_STATUS_LISTENER_ANDROID_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_ANDROID_BATTERY_STATUS_LISTENER_ANDROID_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ANDROID_BATTERY_STATUS_LISTENER_ANDROID_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ANDROID_BATTERY_STATUS_LISTENER_ANDROID_H_
 
-#include "components/download/internal/scheduler/device_status_listener.h"
+#include "components/download/internal/background_service/scheduler/device_status_listener.h"
 
 #include "base/android/jni_android.h"
 #include "base/android/scoped_java_ref.h"
@@ -27,4 +27,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_ANDROID_BATTERY_STATUS_LISTENER_ANDROID_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ANDROID_BATTERY_STATUS_LISTENER_ANDROID_H_
diff --git a/components/download/internal/android/java/src/org/chromium/components/download/internal/BatteryStatusListenerAndroid.java b/components/download/internal/background_service/android/java/src/org/chromium/components/download/internal/BatteryStatusListenerAndroid.java
similarity index 100%
rename from components/download/internal/android/java/src/org/chromium/components/download/internal/BatteryStatusListenerAndroid.java
rename to components/download/internal/background_service/android/java/src/org/chromium/components/download/internal/BatteryStatusListenerAndroid.java
diff --git a/components/download/internal/android/java/src/org/chromium/components/download/internal/NetworkStatusListenerAndroid.java b/components/download/internal/background_service/android/java/src/org/chromium/components/download/internal/NetworkStatusListenerAndroid.java
similarity index 100%
rename from components/download/internal/android/java/src/org/chromium/components/download/internal/NetworkStatusListenerAndroid.java
rename to components/download/internal/background_service/android/java/src/org/chromium/components/download/internal/NetworkStatusListenerAndroid.java
diff --git a/components/download/internal/android/network_status_listener_android.cc b/components/download/internal/background_service/android/network_status_listener_android.cc
similarity index 94%
rename from components/download/internal/android/network_status_listener_android.cc
rename to components/download/internal/background_service/android/network_status_listener_android.cc
index 0817e93..0de9b90 100644
--- a/components/download/internal/android/network_status_listener_android.cc
+++ b/components/download/internal/background_service/android/network_status_listener_android.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/android/network_status_listener_android.h"
+#include "components/download/internal/background_service/android/network_status_listener_android.h"
 
 #include "base/android/jni_android.h"
 #include "jni/NetworkStatusListenerAndroid_jni.h"
diff --git a/components/download/internal/android/network_status_listener_android.h b/components/download/internal/background_service/android/network_status_listener_android.h
similarity index 76%
rename from components/download/internal/android/network_status_listener_android.h
rename to components/download/internal/background_service/android/network_status_listener_android.h
index 13bda661..0362231 100644
--- a/components/download/internal/android/network_status_listener_android.h
+++ b/components/download/internal/background_service/android/network_status_listener_android.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_ANDROID_NETWORK_STATUS_LISTENER_ANDROID_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_ANDROID_NETWORK_STATUS_LISTENER_ANDROID_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ANDROID_NETWORK_STATUS_LISTENER_ANDROID_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ANDROID_NETWORK_STATUS_LISTENER_ANDROID_H_
 
-#include "components/download/internal/scheduler/network_status_listener.h"
+#include "components/download/internal/background_service/scheduler/network_status_listener.h"
 
 #include "base/android/jni_android.h"
 #include "base/android/scoped_java_ref.h"
@@ -40,4 +40,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_ANDROID_NETWORK_STATUS_LISTENER_ANDROID_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ANDROID_NETWORK_STATUS_LISTENER_ANDROID_H_
diff --git a/components/download/internal/blob_task_proxy.cc b/components/download/internal/background_service/blob_task_proxy.cc
similarity index 97%
rename from components/download/internal/blob_task_proxy.cc
rename to components/download/internal/background_service/blob_task_proxy.cc
index 2f3400e..9e3d5e2 100644
--- a/components/download/internal/blob_task_proxy.cc
+++ b/components/download/internal/background_service/blob_task_proxy.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/blob_task_proxy.h"
+#include "components/download/internal/background_service/blob_task_proxy.h"
 
 #include "base/guid.h"
 #include "base/task_runner_util.h"
diff --git a/components/download/internal/blob_task_proxy.h b/components/download/internal/background_service/blob_task_proxy.h
similarity index 90%
rename from components/download/internal/blob_task_proxy.h
rename to components/download/internal/background_service/blob_task_proxy.h
index e757554..03f80fa 100644
--- a/components/download/internal/blob_task_proxy.h
+++ b/components/download/internal/background_service/blob_task_proxy.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 COMPONENTS_DOWNLOAD_INTERNAL_BLOB_TASK_PROXY_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_BLOB_TASK_PROXY_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_BLOB_TASK_PROXY_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_BLOB_TASK_PROXY_H_
 
 #include <memory>
 #include <string>
@@ -72,4 +72,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BLOB_TASK_PROXY_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_BLOB_TASK_PROXY_H_
diff --git a/components/download/internal/client_set.cc b/components/download/internal/background_service/client_set.cc
similarity index 87%
rename from components/download/internal/client_set.cc
rename to components/download/internal/background_service/client_set.cc
index c05a1f1d..78399df 100644
--- a/components/download/internal/client_set.cc
+++ b/components/download/internal/background_service/client_set.cc
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/client_set.h"
-#include "components/download/internal/debugging_client.h"
+#include "components/download/internal/background_service/client_set.h"
+#include "components/download/internal/background_service/debugging_client.h"
 
 namespace download {
 
diff --git a/components/download/internal/client_set.h b/components/download/internal/background_service/client_set.h
similarity index 72%
rename from components/download/internal/client_set.h
rename to components/download/internal/background_service/client_set.h
index 2daa5206..4bfd49a 100644
--- a/components/download/internal/client_set.h
+++ b/components/download/internal/background_service/client_set.h
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_CLIENT_SET_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_CLIENT_SET_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CLIENT_SET_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CLIENT_SET_H_
 
 #include <map>
 #include <memory>
 #include <set>
 
 #include "base/macros.h"
-#include "components/download/public/clients.h"
+#include "components/download/public/background_service/clients.h"
 
 namespace download {
 
@@ -32,4 +32,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_CLIENT_SET_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CLIENT_SET_H_
diff --git a/components/download/internal/client_set_unittest.cc b/components/download/internal/background_service/client_set_unittest.cc
similarity index 86%
rename from components/download/internal/client_set_unittest.cc
rename to components/download/internal/background_service/client_set_unittest.cc
index c128ae7..a75c5b49 100644
--- a/components/download/internal/client_set_unittest.cc
+++ b/components/download/internal/background_service/client_set_unittest.cc
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/client_set.h"
+#include "components/download/internal/background_service/client_set.h"
 
 #include <algorithm>
 
-#include "components/download/public/clients.h"
-#include "components/download/public/test/empty_client.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/test/empty_client.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace download {
diff --git a/components/download/internal/config.cc b/components/download/internal/background_service/config.cc
similarity index 97%
rename from components/download/internal/config.cc
rename to components/download/internal/background_service/config.cc
index f42683b..81aaaaa 100644
--- a/components/download/internal/config.cc
+++ b/components/download/internal/background_service/config.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/config.h"
+#include "components/download/internal/background_service/config.h"
 
 #include <string>
 
 #include "base/memory/ptr_util.h"
 #include "base/metrics/field_trial_params.h"
 #include "base/strings/string_number_conversions.h"
-#include "components/download/public/features.h"
+#include "components/download/public/background_service/features.h"
 
 namespace download {
 
diff --git a/components/download/internal/config.h b/components/download/internal/background_service/config.h
similarity index 96%
rename from components/download/internal/config.h
rename to components/download/internal/background_service/config.h
index a66af7f..67276613 100644
--- a/components/download/internal/config.h
+++ b/components/download/internal/background_service/config.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 COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONFIG_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONFIG_H_
 
 #include <memory>
 
@@ -151,4 +151,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_CONFIG_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONFIG_H_
diff --git a/components/download/internal/controller.h b/components/download/internal/background_service/controller.h
similarity index 89%
rename from components/download/internal/controller.h
rename to components/download/internal/background_service/controller.h
index c16c9ff3..6ea581c 100644
--- a/components/download/internal/controller.h
+++ b/components/download/internal/background_service/controller.h
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONTROLLER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONTROLLER_H_
 
 #include <string>
 
 #include "base/macros.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_service.h"
-#include "components/download/public/download_task_types.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_service.h"
+#include "components/download/public/background_service/download_task_types.h"
 
 namespace download {
 
@@ -111,4 +111,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONTROLLER_H_
diff --git a/components/download/internal/controller_impl.cc b/components/download/internal/background_service/controller_impl.cc
similarity index 97%
rename from components/download/internal/controller_impl.cc
rename to components/download/internal/background_service/controller_impl.cc
index 5a29e13..56bab0d 100644
--- a/components/download/internal/controller_impl.cc
+++ b/components/download/internal/background_service/controller_impl.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/controller_impl.h"
+#include "components/download/internal/background_service/controller_impl.h"
 
 #include <string>
 #include <vector>
@@ -16,18 +16,18 @@
 #include "base/trace_event/memory_dump_manager.h"
 #include "base/trace_event/memory_usage_estimator.h"
 #include "base/trace_event/process_memory_dump.h"
-#include "components/download/internal/client_set.h"
-#include "components/download/internal/config.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/entry_utils.h"
-#include "components/download/internal/file_monitor.h"
-#include "components/download/internal/log_sink.h"
-#include "components/download/internal/model.h"
-#include "components/download/internal/scheduler/scheduler.h"
-#include "components/download/internal/stats.h"
-#include "components/download/public/client.h"
-#include "components/download/public/download_metadata.h"
-#include "components/download/public/navigation_monitor.h"
+#include "components/download/internal/background_service/client_set.h"
+#include "components/download/internal/background_service/config.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/entry_utils.h"
+#include "components/download/internal/background_service/file_monitor.h"
+#include "components/download/internal/background_service/log_sink.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/scheduler/scheduler.h"
+#include "components/download/internal/background_service/stats.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/download_metadata.h"
+#include "components/download/public/background_service/navigation_monitor.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 
 namespace download {
diff --git a/components/download/internal/controller_impl.h b/components/download/internal/background_service/controller_impl.h
similarity index 89%
rename from components/download/internal/controller_impl.h
rename to components/download/internal/background_service/controller_impl.h
index 3e83ef6..52365f31 100644
--- a/components/download/internal/controller_impl.h
+++ b/components/download/internal/background_service/controller_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONTROLLER_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONTROLLER_IMPL_H_
 
 #include <map>
 #include <memory>
@@ -14,18 +14,18 @@
 #include "base/memory/weak_ptr.h"
 #include "base/optional.h"
 #include "base/trace_event/memory_dump_provider.h"
-#include "components/download/internal/controller.h"
-#include "components/download/internal/download_driver.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/log_source.h"
-#include "components/download/internal/model.h"
-#include "components/download/internal/scheduler/device_status_listener.h"
-#include "components/download/internal/startup_status.h"
-#include "components/download/internal/stats.h"
-#include "components/download/public/client.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/navigation_monitor.h"
-#include "components/download/public/task_scheduler.h"
+#include "components/download/internal/background_service/controller.h"
+#include "components/download/internal/background_service/download_driver.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/log_source.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/scheduler/device_status_listener.h"
+#include "components/download/internal/background_service/startup_status.h"
+#include "components/download/internal/background_service/stats.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/navigation_monitor.h"
+#include "components/download/public/background_service/task_scheduler.h"
 
 namespace download {
 
@@ -263,4 +263,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_CONTROLLER_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_CONTROLLER_IMPL_H_
diff --git a/components/download/internal/controller_impl_unittest.cc b/components/download/internal/background_service/controller_impl_unittest.cc
similarity index 97%
rename from components/download/internal/controller_impl_unittest.cc
rename to components/download/internal/background_service/controller_impl_unittest.cc
index 8d8e907..d98af57a 100644
--- a/components/download/internal/controller_impl_unittest.cc
+++ b/components/download/internal/background_service/controller_impl_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/controller_impl.h"
+#include "components/download/internal/background_service/controller_impl.h"
 
 #include <algorithm>
 #include <memory>
@@ -14,22 +14,22 @@
 #include "base/test/histogram_tester.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "components/download/internal/client_set.h"
-#include "components/download/internal/config.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/entry_utils.h"
-#include "components/download/internal/file_monitor.h"
-#include "components/download/internal/model_impl.h"
-#include "components/download/internal/navigation_monitor_impl.h"
-#include "components/download/internal/scheduler/scheduler.h"
-#include "components/download/internal/stats.h"
-#include "components/download/internal/test/black_hole_log_sink.h"
-#include "components/download/internal/test/entry_utils.h"
-#include "components/download/internal/test/test_device_status_listener.h"
-#include "components/download/internal/test/test_download_driver.h"
-#include "components/download/internal/test/test_store.h"
-#include "components/download/public/test/empty_client.h"
-#include "components/download/public/test/mock_client.h"
+#include "components/download/internal/background_service/client_set.h"
+#include "components/download/internal/background_service/config.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/entry_utils.h"
+#include "components/download/internal/background_service/file_monitor.h"
+#include "components/download/internal/background_service/model_impl.h"
+#include "components/download/internal/background_service/navigation_monitor_impl.h"
+#include "components/download/internal/background_service/scheduler/scheduler.h"
+#include "components/download/internal/background_service/stats.h"
+#include "components/download/internal/background_service/test/black_hole_log_sink.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
+#include "components/download/internal/background_service/test/test_device_status_listener.h"
+#include "components/download/internal/background_service/test/test_download_driver.h"
+#include "components/download/internal/background_service/test/test_store.h"
+#include "components/download/public/background_service/test/empty_client.h"
+#include "components/download/public/background_service/test/mock_client.h"
 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/download/internal/debugging_client.cc b/components/download/internal/background_service/debugging_client.cc
similarity index 94%
rename from components/download/internal/debugging_client.cc
rename to components/download/internal/background_service/debugging_client.cc
index c4b06ef4..dedf1c1 100644
--- a/components/download/internal/debugging_client.cc
+++ b/components/download/internal/background_service/debugging_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/debugging_client.h"
+#include "components/download/internal/background_service/debugging_client.h"
 
 namespace download {
 
diff --git a/components/download/internal/debugging_client.h b/components/download/internal/background_service/debugging_client.h
similarity index 81%
rename from components/download/internal/debugging_client.h
rename to components/download/internal/background_service/debugging_client.h
index 8e76947..bd249f33 100644
--- a/components/download/internal/debugging_client.h
+++ b/components/download/internal/background_service/debugging_client.h
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_DEBUGGING_CLIENT_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_DEBUGGING_CLIENT_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DEBUGGING_CLIENT_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DEBUGGING_CLIENT_H_
 
 #include "base/macros.h"
-#include "components/download/public/client.h"
+#include "components/download/public/background_service/client.h"
 
 namespace download {
 
@@ -40,4 +40,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_DEBUGGING_CLIENT_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DEBUGGING_CLIENT_H_
diff --git a/components/download/internal/download_driver.h b/components/download/internal/background_service/download_driver.h
similarity index 90%
rename from components/download/internal/download_driver.h
rename to components/download/internal/background_service/download_driver.h
index 50265e2..476fa76 100644
--- a/components/download/internal/download_driver.h
+++ b/components/download/internal/background_service/download_driver.h
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_DRIVER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_DRIVER_H_
 
 #include <set>
 #include <string>
 
 #include "base/optional.h"
-#include "components/download/internal/driver_entry.h"
-#include "components/download/internal/memory_tracker.h"
+#include "components/download/internal/background_service/driver_entry.h"
+#include "components/download/internal/background_service/memory_tracker.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 
 namespace base {
@@ -106,4 +106,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_DRIVER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_DRIVER_H_
diff --git a/components/download/internal/download_service_impl.cc b/components/download/internal/background_service/download_service_impl.cc
similarity index 93%
rename from components/download/internal/download_service_impl.cc
rename to components/download/internal/background_service/download_service_impl.cc
index 3f1d22e..3ed181b 100644
--- a/components/download/internal/download_service_impl.cc
+++ b/components/download/internal/background_service/download_service_impl.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/download_service_impl.h"
+#include "components/download/internal/background_service/download_service_impl.h"
 
 #include "base/bind.h"
 #include "base/strings/string_util.h"
-#include "components/download/internal/controller.h"
-#include "components/download/internal/logger_impl.h"
-#include "components/download/internal/startup_status.h"
-#include "components/download/internal/stats.h"
+#include "components/download/internal/background_service/controller.h"
+#include "components/download/internal/background_service/logger_impl.h"
+#include "components/download/internal/background_service/startup_status.h"
+#include "components/download/internal/background_service/stats.h"
 
 namespace download {
 
diff --git a/components/download/internal/download_service_impl.h b/components/download/internal/background_service/download_service_impl.h
similarity index 80%
rename from components/download/internal/download_service_impl.h
rename to components/download/internal/background_service/download_service_impl.h
index 913788f..888bcd93 100644
--- a/components/download/internal/download_service_impl.h
+++ b/components/download/internal/background_service/download_service_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_SERVICE_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_SERVICE_IMPL_H_
 
 #include <map>
 #include <memory>
@@ -11,9 +11,9 @@
 
 #include "base/containers/circular_deque.h"
 #include "base/macros.h"
-#include "components/download/internal/config.h"
-#include "components/download/internal/service_config_impl.h"
-#include "components/download/public/download_service.h"
+#include "components/download/internal/background_service/config.h"
+#include "components/download/internal/background_service/service_config_impl.h"
+#include "components/download/public/background_service/download_service.h"
 
 namespace download {
 
@@ -65,4 +65,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_SERVICE_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_SERVICE_IMPL_H_
diff --git a/components/download/internal/download_service_impl_unittest.cc b/components/download/internal/background_service/download_service_impl_unittest.cc
similarity index 90%
rename from components/download/internal/download_service_impl_unittest.cc
rename to components/download/internal/background_service/download_service_impl_unittest.cc
index b02db49..796d3dd 100644
--- a/components/download/internal/download_service_impl_unittest.cc
+++ b/components/download/internal/background_service/download_service_impl_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/download_service_impl.h"
+#include "components/download/internal/background_service/download_service_impl.h"
 
 #include <memory>
 
@@ -11,11 +11,11 @@
 #include "base/test/histogram_tester.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "components/download/internal/startup_status.h"
-#include "components/download/internal/stats.h"
-#include "components/download/internal/test/download_params_utils.h"
-#include "components/download/internal/test/mock_controller.h"
-#include "components/download/public/test/empty_logger.h"
+#include "components/download/internal/background_service/startup_status.h"
+#include "components/download/internal/background_service/stats.h"
+#include "components/download/internal/background_service/test/download_params_utils.h"
+#include "components/download/internal/background_service/test/mock_controller.h"
+#include "components/download/public/background_service/test/empty_logger.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/components/download/internal/download_store.cc b/components/download/internal/background_service/download_store.cc
similarity index 92%
rename from components/download/internal/download_store.cc
rename to components/download/internal/background_service/download_store.cc
index b2398ef..ab1ffac3 100644
--- a/components/download/internal/download_store.cc
+++ b/components/download/internal/background_service/download_store.cc
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/download_store.h"
+#include "components/download/internal/background_service/download_store.h"
 
 #include <memory>
 
 #include "base/bind.h"
 #include "base/callback_helpers.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/proto/entry.pb.h"
-#include "components/download/internal/proto_conversions.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/proto/entry.pb.h"
+#include "components/download/internal/background_service/proto_conversions.h"
 #include "components/leveldb_proto/proto_database_impl.h"
 
 namespace download {
diff --git a/components/download/internal/download_store.h b/components/download/internal/background_service/download_store.h
similarity index 86%
rename from components/download/internal/download_store.h
rename to components/download/internal/background_service/download_store.h
index adb397b..953b298 100644
--- a/components/download/internal/download_store.h
+++ b/components/download/internal/background_service/download_store.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 COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_STORE_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_STORE_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_STORE_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_STORE_H_
 
 #include <string>
 #include <vector>
@@ -11,7 +11,7 @@
 #include "base/files/file_path.h"
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/internal/store.h"
+#include "components/download/internal/background_service/store.h"
 #include "components/leveldb_proto/proto_database.h"
 
 namespace protodb {
@@ -57,4 +57,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_DOWNLOAD_STORE_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DOWNLOAD_STORE_H_
diff --git a/components/download/internal/download_store_unittest.cc b/components/download/internal/background_service/download_store_unittest.cc
similarity index 96%
rename from components/download/internal/download_store_unittest.cc
rename to components/download/internal/background_service/download_store_unittest.cc
index 40f61bb..f008e11 100644
--- a/components/download/internal/download_store_unittest.cc
+++ b/components/download/internal/background_service/download_store_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/download_store.h"
+#include "components/download/internal/background_service/download_store.h"
 
 #include <algorithm>
 #include <memory>
@@ -11,10 +11,10 @@
 #include "base/callback.h"
 #include "base/guid.h"
 #include "base/optional.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/proto/entry.pb.h"
-#include "components/download/internal/proto_conversions.h"
-#include "components/download/internal/test/entry_utils.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/proto/entry.pb.h"
+#include "components/download/internal/background_service/proto_conversions.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
 #include "components/leveldb_proto/testing/fake_db.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/download/internal/driver_entry.cc b/components/download/internal/background_service/driver_entry.cc
similarity index 87%
rename from components/download/internal/driver_entry.cc
rename to components/download/internal/background_service/driver_entry.cc
index 04d2c72..68f0be7c 100644
--- a/components/download/internal/driver_entry.cc
+++ b/components/download/internal/background_service/driver_entry.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/driver_entry.h"
+#include "components/download/internal/background_service/driver_entry.h"
 
 #include "net/http/http_response_headers.h"
 
diff --git a/components/download/internal/driver_entry.h b/components/download/internal/background_service/driver_entry.h
similarity index 91%
rename from components/download/internal/driver_entry.h
rename to components/download/internal/background_service/driver_entry.h
index 14e396a..055aec8 100644
--- a/components/download/internal/driver_entry.h
+++ b/components/download/internal/background_service/driver_entry.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 COMPONENTS_DOWNLOAD_INTERNAL_DRIVER_ENTRY_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_DRIVER_ENTRY_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DRIVER_ENTRY_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DRIVER_ENTRY_H_
 
 #include <string>
 #include <vector>
@@ -83,4 +83,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_DRIVER_ENTRY_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_DRIVER_ENTRY_H_
diff --git a/components/download/internal/entry.cc b/components/download/internal/background_service/entry.cc
similarity index 97%
rename from components/download/internal/entry.cc
rename to components/download/internal/background_service/entry.cc
index c04fbd00..137b390 100644
--- a/components/download/internal/entry.cc
+++ b/components/download/internal/background_service/entry.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/entry.h"
+#include "components/download/internal/background_service/entry.h"
 
 #include "base/trace_event/memory_usage_estimator.h"
 
diff --git a/components/download/internal/entry.h b/components/download/internal/background_service/entry.h
similarity index 87%
rename from components/download/internal/entry.h
rename to components/download/internal/background_service/entry.h
index 1cd503cb..f3efe2b 100644
--- a/components/download/internal/entry.h
+++ b/components/download/internal/background_service/entry.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ENTRY_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ENTRY_H_
 
 #include "base/time/time.h"
-#include "components/download/public/client.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_params.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_params.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 
 namespace download {
@@ -102,4 +102,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ENTRY_H_
diff --git a/components/download/internal/entry_utils.cc b/components/download/internal/background_service/entry_utils.cc
similarity index 93%
rename from components/download/internal/entry_utils.cc
rename to components/download/internal/background_service/entry_utils.cc
index 1601e21..8738cb0 100644
--- a/components/download/internal/entry_utils.cc
+++ b/components/download/internal/background_service/entry_utils.cc
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/entry_utils.h"
+#include "components/download/internal/background_service/entry_utils.h"
 
 #include <algorithm>
 
-#include "components/download/internal/entry.h"
-#include "components/download/public/download_metadata.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/public/background_service/download_metadata.h"
 
 namespace download {
 namespace util {
diff --git a/components/download/internal/entry_utils.h b/components/download/internal/background_service/entry_utils.h
similarity index 77%
rename from components/download/internal/entry_utils.h
rename to components/download/internal/background_service/entry_utils.h
index 22a03fd6..410383c 100644
--- a/components/download/internal/entry_utils.h
+++ b/components/download/internal/background_service/entry_utils.h
@@ -2,18 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_UTILS_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_UTILS_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ENTRY_UTILS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ENTRY_UTILS_H_
 
 #include <map>
 #include <set>
 #include <string>
 #include <vector>
 
-#include "components/download/internal/model.h"
-#include "components/download/internal/scheduler/device_status.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_metadata.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/scheduler/device_status.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_metadata.h"
 
 namespace download {
 
@@ -52,4 +52,4 @@
 }  // namespace util
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_ENTRY_UTILS_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_ENTRY_UTILS_H_
diff --git a/components/download/internal/entry_utils_unittest.cc b/components/download/internal/background_service/entry_utils_unittest.cc
similarity index 95%
rename from components/download/internal/entry_utils_unittest.cc
rename to components/download/internal/background_service/entry_utils_unittest.cc
index 0a0e741..3730fb5 100644
--- a/components/download/internal/entry_utils_unittest.cc
+++ b/components/download/internal/background_service/entry_utils_unittest.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/entry_utils.h"
+#include "components/download/internal/background_service/entry_utils.h"
 
 #include <algorithm>
 
 #include "base/memory/ptr_util.h"
-#include "components/download/internal/test/entry_utils.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_metadata.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_metadata.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace download {
diff --git a/components/download/internal/file_monitor.h b/components/download/internal/background_service/file_monitor.h
similarity index 80%
rename from components/download/internal/file_monitor.h
rename to components/download/internal/background_service/file_monitor.h
index 1174b2e..9d5447ad 100644
--- a/components/download/internal/file_monitor.h
+++ b/components/download/internal/background_service/file_monitor.h
@@ -2,16 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_FILE_MONITOR_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_FILE_MONITOR_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_FILE_MONITOR_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_FILE_MONITOR_H_
 
 #include <memory>
 #include <set>
 #include <string>
 #include <vector>
 
-#include "components/download/internal/model.h"
-#include "components/download/internal/stats.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/stats.h"
 
 namespace base {
 class FilePath;
@@ -53,4 +53,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_FILE_MONITOR_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_FILE_MONITOR_H_
diff --git a/components/download/internal/file_monitor_impl.cc b/components/download/internal/background_service/file_monitor_impl.cc
similarity index 98%
rename from components/download/internal/file_monitor_impl.cc
rename to components/download/internal/background_service/file_monitor_impl.cc
index aaeb6ad..9bb4e68 100644
--- a/components/download/internal/file_monitor_impl.cc
+++ b/components/download/internal/background_service/file_monitor_impl.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/file_monitor_impl.h"
+#include "components/download/internal/background_service/file_monitor_impl.h"
 
 #include "base/bind.h"
 #include "base/callback_helpers.h"
diff --git a/components/download/internal/file_monitor_impl.h b/components/download/internal/background_service/file_monitor_impl.h
similarity index 75%
rename from components/download/internal/file_monitor_impl.h
rename to components/download/internal/background_service/file_monitor_impl.h
index 8b86353..723843f 100644
--- a/components/download/internal/file_monitor_impl.h
+++ b/components/download/internal/background_service/file_monitor_impl.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_FILE_MONITOR_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_FILE_MONITOR_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_FILE_MONITOR_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_FILE_MONITOR_IMPL_H_
 
-#include "components/download/internal/file_monitor.h"
+#include "components/download/internal/background_service/file_monitor.h"
 
 #include <memory>
 #include <set>
@@ -17,9 +17,9 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/weak_ptr.h"
 #include "base/sequenced_task_runner.h"
-#include "components/download/internal/driver_entry.h"
-#include "components/download/internal/model.h"
-#include "components/download/internal/stats.h"
+#include "components/download/internal/background_service/driver_entry.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/stats.h"
 
 namespace download {
 
@@ -56,4 +56,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_FILE_MONITOR_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_FILE_MONITOR_IMPL_H_
diff --git a/components/download/internal/file_monitor_unittest.cc b/components/download/internal/background_service/file_monitor_unittest.cc
similarity index 94%
rename from components/download/internal/file_monitor_unittest.cc
rename to components/download/internal/background_service/file_monitor_unittest.cc
index 347d2d5..f2aafe07 100644
--- a/components/download/internal/file_monitor_unittest.cc
+++ b/components/download/internal/background_service/file_monitor_unittest.cc
@@ -12,10 +12,10 @@
 #include "base/optional.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "components/download/internal/driver_entry.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/file_monitor_impl.h"
-#include "components/download/internal/test/entry_utils.h"
+#include "components/download/internal/background_service/driver_entry.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/file_monitor_impl.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/components/download/internal/in_memory_download.cc b/components/download/internal/background_service/in_memory_download.cc
similarity index 96%
rename from components/download/internal/in_memory_download.cc
rename to components/download/internal/background_service/in_memory_download.cc
index b1f5ed4..861cebf7 100644
--- a/components/download/internal/in_memory_download.cc
+++ b/components/download/internal/background_service/in_memory_download.cc
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/in_memory_download.h"
+#include "components/download/internal/background_service/in_memory_download.h"
 
 #include <memory>
 
 #include "base/bind.h"
 #include "base/strings/string_util.h"
-#include "components/download/internal/blob_task_proxy.h"
+#include "components/download/internal/background_service/blob_task_proxy.h"
 #include "net/base/io_buffer.h"
 #include "net/base/net_errors.h"
 #include "net/http/http_status_code.h"
diff --git a/components/download/internal/in_memory_download.h b/components/download/internal/background_service/in_memory_download.h
similarity index 92%
rename from components/download/internal/in_memory_download.h
rename to components/download/internal/background_service/in_memory_download.h
index f499758e..ac87be2 100644
--- a/components/download/internal/in_memory_download.h
+++ b/components/download/internal/background_service/in_memory_download.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 COMPONENTS_DOWNLOAD_INTERNAL_IN_MEMORY_DOWNLOAD_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_IN_MEMORY_DOWNLOAD_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_IN_MEMORY_DOWNLOAD_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_IN_MEMORY_DOWNLOAD_H_
 
 #include <memory>
 #include <string>
@@ -12,8 +12,8 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/single_thread_task_runner.h"
-#include "components/download/internal/blob_task_proxy.h"
-#include "components/download/public/download_params.h"
+#include "components/download/internal/background_service/blob_task_proxy.h"
+#include "components/download/public/background_service/download_params.h"
 #include "net/base/completion_callback.h"
 #include "net/url_request/url_fetcher_delegate.h"
 #include "net/url_request/url_request_context_getter.h"
@@ -160,4 +160,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_IN_MEMORY_DOWNLOAD_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_IN_MEMORY_DOWNLOAD_H_
diff --git a/components/download/internal/in_memory_download_unittest.cc b/components/download/internal/background_service/in_memory_download_unittest.cc
similarity index 97%
rename from components/download/internal/in_memory_download_unittest.cc
rename to components/download/internal/background_service/in_memory_download_unittest.cc
index dce0b15..f10a809 100644
--- a/components/download/internal/in_memory_download_unittest.cc
+++ b/components/download/internal/background_service/in_memory_download_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/in_memory_download.h"
+#include "components/download/internal/background_service/in_memory_download.h"
 
 #include "base/files/file_util.h"
 #include "base/guid.h"
diff --git a/components/download/internal/log_sink.h b/components/download/internal/background_service/log_sink.h
similarity index 73%
rename from components/download/internal/log_sink.h
rename to components/download/internal/background_service/log_sink.h
index b663128..a773e21 100644
--- a/components/download/internal/log_sink.h
+++ b/components/download/internal/background_service/log_sink.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_LOG_SINK_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_LOG_SINK_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOG_SINK_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOG_SINK_H_
 
-#include "components/download/internal/controller.h"
-#include "components/download/internal/startup_status.h"
-#include "components/download/public/download_params.h"
+#include "components/download/internal/background_service/controller.h"
+#include "components/download/internal/background_service/startup_status.h"
+#include "components/download/public/background_service/download_params.h"
 
 namespace download {
 
@@ -41,4 +41,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_LOG_SINK_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOG_SINK_H_
diff --git a/components/download/internal/log_source.h b/components/download/internal/background_service/log_source.h
similarity index 80%
rename from components/download/internal/log_source.h
rename to components/download/internal/background_service/log_source.h
index 546b027a..930cb9f 100644
--- a/components/download/internal/log_source.h
+++ b/components/download/internal/background_service/log_source.h
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_LOG_SOURCE_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_LOG_SOURCE_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOG_SOURCE_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOG_SOURCE_H_
 
 #include <utility>
 #include <vector>
 
 #include "base/optional.h"
-#include "components/download/internal/controller.h"
+#include "components/download/internal/background_service/controller.h"
 
 namespace download {
 
@@ -42,4 +42,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_LOG_SOURCE_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOG_SOURCE_H_
diff --git a/components/download/internal/logger_impl.cc b/components/download/internal/background_service/logger_impl.cc
similarity index 95%
rename from components/download/internal/logger_impl.cc
rename to components/download/internal/background_service/logger_impl.cc
index 83c9d8e5..bd2fe130 100644
--- a/components/download/internal/logger_impl.cc
+++ b/components/download/internal/background_service/logger_impl.cc
@@ -2,17 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/logger_impl.h"
+#include "components/download/internal/background_service/logger_impl.h"
 
 #include <memory>
 
 #include "base/memory/ptr_util.h"
 #include "base/values.h"
-#include "components/download/internal/driver_entry.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/log_source.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_params.h"
+#include "components/download/internal/background_service/driver_entry.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/log_source.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_params.h"
 
 namespace download {
 namespace {
diff --git a/components/download/internal/logger_impl.h b/components/download/internal/background_service/logger_impl.h
similarity index 78%
rename from components/download/internal/logger_impl.h
rename to components/download/internal/background_service/logger_impl.h
index 5f44988..1da4b05 100644
--- a/components/download/internal/logger_impl.h
+++ b/components/download/internal/background_service/logger_impl.h
@@ -2,16 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_LOGGER_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_LOGGER_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOGGER_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOGGER_IMPL_H_
 
 #include <memory>
 
 #include "base/macros.h"
 #include "base/observer_list.h"
-#include "components/download/internal/log_sink.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/logger.h"
+#include "components/download/internal/background_service/log_sink.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/logger.h"
 
 namespace base {
 class Value;
@@ -57,4 +57,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_LOGGER_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_LOGGER_IMPL_H_
diff --git a/components/download/internal/memory_tracker.h b/components/download/internal/background_service/memory_tracker.h
similarity index 69%
rename from components/download/internal/memory_tracker.h
rename to components/download/internal/background_service/memory_tracker.h
index d7023549..2e0d37ad 100644
--- a/components/download/internal/memory_tracker.h
+++ b/components/download/internal/background_service/memory_tracker.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 COMPONENTS_DOWNLOAD_INTERNAL_MEMORY_TRACKER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_MEMORY_TRACKER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MEMORY_TRACKER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MEMORY_TRACKER_H_
 
 #include <stddef.h>
 
@@ -20,4 +20,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_MEMORY_TRACKER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MEMORY_TRACKER_H_
diff --git a/components/download/internal/model.h b/components/download/internal/background_service/model.h
similarity index 90%
rename from components/download/internal/model.h
rename to components/download/internal/background_service/model.h
index e7a88e7..4f48499 100644
--- a/components/download/internal/model.h
+++ b/components/download/internal/background_service/model.h
@@ -2,16 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_MODEL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_MODEL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MODEL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MODEL_H_
 
 #include <memory>
 #include <string>
 #include <vector>
 
-#include "components/download/internal/entry.h"
-#include "components/download/internal/memory_tracker.h"
-#include "components/download/public/clients.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/memory_tracker.h"
+#include "components/download/public/background_service/clients.h"
 
 namespace download {
 
@@ -97,4 +97,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_MODEL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MODEL_H_
diff --git a/components/download/internal/model_impl.cc b/components/download/internal/background_service/model_impl.cc
similarity index 95%
rename from components/download/internal/model_impl.cc
rename to components/download/internal/background_service/model_impl.cc
index 2a36b25..d8f8ce6 100644
--- a/components/download/internal/model_impl.cc
+++ b/components/download/internal/background_service/model_impl.cc
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/model_impl.h"
+#include "components/download/internal/background_service/model_impl.h"
 
 #include <map>
 #include <memory>
 
 #include "base/bind.h"
 #include "base/trace_event/memory_usage_estimator.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/stats.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/stats.h"
 
 namespace download {
 
diff --git a/components/download/internal/model_impl.h b/components/download/internal/background_service/model_impl.h
similarity index 82%
rename from components/download/internal/model_impl.h
rename to components/download/internal/background_service/model_impl.h
index 12a62a43..8ec5f0a 100644
--- a/components/download/internal/model_impl.h
+++ b/components/download/internal/background_service/model_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_MODEL_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_MODEL_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MODEL_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MODEL_IMPL_H_
 
 #include <map>
 #include <string>
@@ -12,9 +12,9 @@
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/internal/model.h"
-#include "components/download/internal/store.h"
-#include "components/download/public/clients.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/store.h"
+#include "components/download/public/background_service/clients.h"
 
 namespace download {
 
@@ -71,4 +71,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_MODEL_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_MODEL_IMPL_H_
diff --git a/components/download/internal/model_impl_unittest.cc b/components/download/internal/background_service/model_impl_unittest.cc
similarity index 95%
rename from components/download/internal/model_impl_unittest.cc
rename to components/download/internal/background_service/model_impl_unittest.cc
index 3415869..63b91e2 100644
--- a/components/download/internal/model_impl_unittest.cc
+++ b/components/download/internal/background_service/model_impl_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/model_impl.h"
+#include "components/download/internal/background_service/model_impl.h"
 
 #include <algorithm>
 #include <memory>
@@ -11,11 +11,11 @@
 #include "base/guid.h"
 #include "base/macros.h"
 #include "base/test/histogram_tester.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/stats.h"
-#include "components/download/internal/test/entry_utils.h"
-#include "components/download/internal/test/mock_model_client.h"
-#include "components/download/internal/test/test_store.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/stats.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
+#include "components/download/internal/background_service/test/mock_model_client.h"
+#include "components/download/internal/background_service/test/test_store.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/components/download/internal/navigation_monitor_impl.cc b/components/download/internal/background_service/navigation_monitor_impl.cc
similarity index 96%
rename from components/download/internal/navigation_monitor_impl.cc
rename to components/download/internal/background_service/navigation_monitor_impl.cc
index ade71664..52cf9c8 100644
--- a/components/download/internal/navigation_monitor_impl.cc
+++ b/components/download/internal/background_service/navigation_monitor_impl.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/navigation_monitor_impl.h"
+#include "components/download/internal/background_service/navigation_monitor_impl.h"
 
 #include "base/bind.h"
 #include "base/callback_helpers.h"
diff --git a/components/download/internal/navigation_monitor_impl.h b/components/download/internal/background_service/navigation_monitor_impl.h
similarity index 79%
rename from components/download/internal/navigation_monitor_impl.h
rename to components/download/internal/background_service/navigation_monitor_impl.h
index a70f1bef..a972de3 100644
--- a/components/download/internal/navigation_monitor_impl.h
+++ b/components/download/internal/background_service/navigation_monitor_impl.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_NAVIGATION_MONITOR_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_NAVIGATION_MONITOR_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_NAVIGATION_MONITOR_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_NAVIGATION_MONITOR_IMPL_H_
 
 #include "base/cancelable_callback.h"
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/public/navigation_monitor.h"
+#include "components/download/public/background_service/navigation_monitor.h"
 
 namespace download {
 
@@ -47,4 +47,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_NAVIGATION_MONITOR_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_NAVIGATION_MONITOR_IMPL_H_
diff --git a/components/download/internal/navigation_monitor_impl_unittests.cc b/components/download/internal/background_service/navigation_monitor_impl_unittests.cc
similarity index 98%
rename from components/download/internal/navigation_monitor_impl_unittests.cc
rename to components/download/internal/background_service/navigation_monitor_impl_unittests.cc
index f007f5c..dbd8ff6 100644
--- a/components/download/internal/navigation_monitor_impl_unittests.cc
+++ b/components/download/internal/background_service/navigation_monitor_impl_unittests.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/navigation_monitor_impl.h"
+#include "components/download/internal/background_service/navigation_monitor_impl.h"
 
 #include "base/bind.h"
 #include "base/callback_helpers.h"
diff --git a/components/download/internal/proto/BUILD.gn b/components/download/internal/background_service/proto/BUILD.gn
similarity index 86%
rename from components/download/internal/proto/BUILD.gn
rename to components/download/internal/background_service/proto/BUILD.gn
index 9d6c33e..1a5ab724 100644
--- a/components/download/internal/proto/BUILD.gn
+++ b/components/download/internal/background_service/proto/BUILD.gn
@@ -7,7 +7,7 @@
 proto_library("proto") {
   visibility = [
     "//components/download/content/factory",
-    "//components/download/internal:*",
+    "//components/download/internal/background_service/:*",
   ]
 
   sources = [
diff --git a/components/download/internal/proto/entry.proto b/components/download/internal/background_service/proto/entry.proto
similarity index 92%
rename from components/download/internal/proto/entry.proto
rename to components/download/internal/background_service/proto/entry.proto
index 528795a..2e7cfbb 100644
--- a/components/download/internal/proto/entry.proto
+++ b/components/download/internal/background_service/proto/entry.proto
@@ -12,7 +12,7 @@
 import "scheduling.proto";
 
 // This should stay in sync with the DownloadClient enum
-// (components/download/public/clients.h).
+// (components/download/public/background_service/clients.h).
 enum DownloadClient {
   INVALID = 0;
   TEST = 1;
@@ -28,7 +28,7 @@
 // with a download request.
 message Entry {
   // This should stay in sync with the State enum
-  // (components/download/internal/entry.h).
+  // (components/download/internal/background_service/entry.h).
   enum State {
     NEW = 0;
     AVAILABLE = 1;
diff --git a/components/download/internal/proto/request.proto b/components/download/internal/background_service/proto/request.proto
similarity index 100%
rename from components/download/internal/proto/request.proto
rename to components/download/internal/background_service/proto/request.proto
diff --git a/components/download/internal/proto/scheduling.proto b/components/download/internal/background_service/proto/scheduling.proto
similarity index 82%
rename from components/download/internal/proto/scheduling.proto
rename to components/download/internal/background_service/proto/scheduling.proto
index ef6a0ca..052a458 100644
--- a/components/download/internal/proto/scheduling.proto
+++ b/components/download/internal/background_service/proto/scheduling.proto
@@ -11,7 +11,7 @@
 // Stores the scheduling params associated with a download request.
 message SchedulingParams {
   // This should stay in sync with the NetworkRequirements enum
-  // (components/download/public/download_params.h).
+  // (components/download/public/background_service/download_params.h).
   enum NetworkRequirements {
     NONE = 0;
     OPTIMISTIC = 1;
@@ -19,7 +19,7 @@
   }
 
   // This should stay in sync with the BatteryRequirements enum
-  // (components/download/public/download_params.h).
+  // (components/download/public/background_service/download_params.h).
   enum BatteryRequirements {
     BATTERY_INSENSITIVE = 0;
     BATTERY_SENSITIVE = 1;
@@ -27,7 +27,7 @@
   }
 
   // This should stay in sync with the Priority enum
-  // (components/download/public/download_params.h).
+  // (components/download/public/background_service/download_params.h).
   enum Priority {
     LOW = 0;
     NORMAL = 1;
diff --git a/components/download/internal/proto_conversions.cc b/components/download/internal/background_service/proto_conversions.cc
similarity index 99%
rename from components/download/internal/proto_conversions.cc
rename to components/download/internal/background_service/proto_conversions.cc
index 3097474..ef1398eb 100644
--- a/components/download/internal/proto_conversions.cc
+++ b/components/download/internal/background_service/proto_conversions.cc
@@ -6,7 +6,7 @@
 #include <utility>
 
 #include "base/time/time.h"
-#include "components/download/internal/proto_conversions.h"
+#include "components/download/internal/background_service/proto_conversions.h"
 #include "net/http/http_request_headers.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 
diff --git a/components/download/internal/proto_conversions.h b/components/download/internal/background_service/proto_conversions.h
similarity index 80%
rename from components/download/internal/proto_conversions.h
rename to components/download/internal/background_service/proto_conversions.h
index 4d2e4e5..6eab96b 100644
--- a/components/download/internal/proto_conversions.h
+++ b/components/download/internal/background_service/proto_conversions.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_PROTO_CONVERSIONS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_PROTO_CONVERSIONS_H_
 
-#include "components/download/internal/entry.h"
-#include "components/download/internal/proto/entry.pb.h"
-#include "components/download/internal/proto/request.pb.h"
-#include "components/download/internal/proto/scheduling.pb.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/proto/entry.pb.h"
+#include "components/download/internal/background_service/proto/request.pb.h"
+#include "components/download/internal/background_service/proto/scheduling.pb.h"
 
 namespace download {
 
@@ -61,4 +61,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_PROTO_CONVERSIONS_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_PROTO_CONVERSIONS_H_
diff --git a/components/download/internal/proto_conversions_unittest.cc b/components/download/internal/background_service/proto_conversions_unittest.cc
similarity index 96%
rename from components/download/internal/proto_conversions_unittest.cc
rename to components/download/internal/background_service/proto_conversions_unittest.cc
index de3c6c31..46e9bdc 100644
--- a/components/download/internal/proto_conversions_unittest.cc
+++ b/components/download/internal/background_service/proto_conversions_unittest.cc
@@ -6,9 +6,9 @@
 #include <utility>
 
 #include "base/guid.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/proto_conversions.h"
-#include "components/download/internal/test/entry_utils.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/proto_conversions.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
diff --git a/components/download/internal/scheduler/device_status.cc b/components/download/internal/background_service/scheduler/device_status.cc
similarity index 97%
rename from components/download/internal/scheduler/device_status.cc
rename to components/download/internal/background_service/scheduler/device_status.cc
index 7f3c69f..75cf5483 100644
--- a/components/download/internal/scheduler/device_status.cc
+++ b/components/download/internal/background_service/scheduler/device_status.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/scheduler/device_status.h"
+#include "components/download/internal/background_service/scheduler/device_status.h"
 
 namespace download {
 
diff --git a/components/download/internal/scheduler/device_status.h b/components/download/internal/background_service/scheduler/device_status.h
similarity index 85%
rename from components/download/internal/scheduler/device_status.h
rename to components/download/internal/background_service/scheduler/device_status.h
index 2397a0ce..8d5b3644 100644
--- a/components/download/internal/scheduler/device_status.h
+++ b/components/download/internal/background_service/scheduler/device_status.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_DEVICE_STATUS_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_DEVICE_STATUS_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_DEVICE_STATUS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_DEVICE_STATUS_H_
 
-#include "components/download/public/download_params.h"
+#include "components/download/public/background_service/download_params.h"
 
 namespace download {
 
@@ -72,4 +72,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_DEVICE_STATUS_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_DEVICE_STATUS_H_
diff --git a/components/download/internal/scheduler/device_status_listener.cc b/components/download/internal/background_service/scheduler/device_status_listener.cc
similarity index 95%
rename from components/download/internal/scheduler/device_status_listener.cc
rename to components/download/internal/background_service/scheduler/device_status_listener.cc
index bc40f1b4..b277fd01 100644
--- a/components/download/internal/scheduler/device_status_listener.cc
+++ b/components/download/internal/background_service/scheduler/device_status_listener.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/scheduler/device_status_listener.h"
+#include "components/download/internal/background_service/scheduler/device_status_listener.h"
 
 #include "base/power_monitor/power_monitor.h"
 #include "build/build_config.h"
-#include "components/download/internal/scheduler/network_status_listener.h"
+#include "components/download/internal/background_service/scheduler/network_status_listener.h"
 
 #if defined(OS_ANDROID)
-#include "components/download/internal/android/network_status_listener_android.h"
+#include "components/download/internal/background_service/android/network_status_listener_android.h"
 #endif
 
 namespace download {
diff --git a/components/download/internal/scheduler/device_status_listener.h b/components/download/internal/background_service/scheduler/device_status_listener.h
similarity index 89%
rename from components/download/internal/scheduler/device_status_listener.h
rename to components/download/internal/background_service/scheduler/device_status_listener.h
index 29ab639..715f2e3 100644
--- a/components/download/internal/scheduler/device_status_listener.h
+++ b/components/download/internal/background_service/scheduler/device_status_listener.h
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_DEVICE_STATUS_LISTENER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_DEVICE_STATUS_LISTENER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_DEVICE_STATUS_LISTENER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_DEVICE_STATUS_LISTENER_H_
 
 #include <memory>
 
 #include "base/power_monitor/power_observer.h"
 #include "base/timer/timer.h"
-#include "components/download/internal/scheduler/device_status.h"
-#include "components/download/internal/scheduler/network_status_listener.h"
+#include "components/download/internal/background_service/scheduler/device_status.h"
+#include "components/download/internal/background_service/scheduler/network_status_listener.h"
 #include "net/base/network_change_notifier.h"
 
 namespace download {
@@ -145,4 +145,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_DEVICE_STATUS_LISTENER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_DEVICE_STATUS_LISTENER_H_
diff --git a/components/download/internal/scheduler/device_status_listener_unittest.cc b/components/download/internal/background_service/scheduler/device_status_listener_unittest.cc
similarity index 98%
rename from components/download/internal/scheduler/device_status_listener_unittest.cc
rename to components/download/internal/background_service/scheduler/device_status_listener_unittest.cc
index e0b6ce87..18ab129 100644
--- a/components/download/internal/scheduler/device_status_listener_unittest.cc
+++ b/components/download/internal/background_service/scheduler/device_status_listener_unittest.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/scheduler/device_status_listener.h"
+#include "components/download/internal/background_service/scheduler/device_status_listener.h"
 
 #include <memory>
 
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/test/power_monitor_test_base.h"
-#include "components/download/internal/scheduler/network_status_listener.h"
+#include "components/download/internal/background_service/scheduler/network_status_listener.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/components/download/internal/scheduler/network_status_listener.cc b/components/download/internal/background_service/scheduler/network_status_listener.cc
similarity index 92%
rename from components/download/internal/scheduler/network_status_listener.cc
rename to components/download/internal/background_service/scheduler/network_status_listener.cc
index c5e406a..fd3389ca 100644
--- a/components/download/internal/scheduler/network_status_listener.cc
+++ b/components/download/internal/background_service/scheduler/network_status_listener.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/scheduler/network_status_listener.h"
+#include "components/download/internal/background_service/scheduler/network_status_listener.h"
 
 namespace download {
 
diff --git a/components/download/internal/scheduler/network_status_listener.h b/components/download/internal/background_service/scheduler/network_status_listener.h
similarity index 88%
rename from components/download/internal/scheduler/network_status_listener.h
rename to components/download/internal/background_service/scheduler/network_status_listener.h
index e769c800..4e68380e 100644
--- a/components/download/internal/scheduler/network_status_listener.h
+++ b/components/download/internal/background_service/scheduler/network_status_listener.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 COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_NETWORK_STATUS_LISTENER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_NETWORK_STATUS_LISTENER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_NETWORK_STATUS_LISTENER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_NETWORK_STATUS_LISTENER_H_
 
 #include "net/base/network_change_notifier.h"
 
@@ -74,4 +74,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_NETWORK_STATUS_LISTENER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_NETWORK_STATUS_LISTENER_H_
diff --git a/components/download/internal/scheduler/scheduler.h b/components/download/internal/background_service/scheduler/scheduler.h
similarity index 67%
rename from components/download/internal/scheduler/scheduler.h
rename to components/download/internal/background_service/scheduler/scheduler.h
index 58d835a..5a0ab27 100644
--- a/components/download/internal/scheduler/scheduler.h
+++ b/components/download/internal/background_service/scheduler/scheduler.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_SCHEDULER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_SCHEDULER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_SCHEDULER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_SCHEDULER_H_
 
-#include "components/download/internal/model.h"
-#include "components/download/internal/scheduler/device_status.h"
-#include "components/download/public/download_params.h"
+#include "components/download/internal/background_service/model.h"
+#include "components/download/internal/background_service/scheduler/device_status.h"
+#include "components/download/public/background_service/download_params.h"
 
 namespace download {
 
@@ -33,4 +33,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_CORE_SCHEDULER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_SCHEDULER_H_
diff --git a/components/download/internal/scheduler/scheduler_impl.cc b/components/download/internal/background_service/scheduler/scheduler_impl.cc
similarity index 87%
rename from components/download/internal/scheduler/scheduler_impl.cc
rename to components/download/internal/background_service/scheduler/scheduler_impl.cc
index 4f82728..a47fe638 100644
--- a/components/download/internal/scheduler/scheduler_impl.cc
+++ b/components/download/internal/background_service/scheduler/scheduler_impl.cc
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/scheduler/scheduler_impl.h"
+#include "components/download/internal/background_service/scheduler/scheduler_impl.h"
 
-#include "components/download/internal/client_set.h"
-#include "components/download/internal/config.h"
-#include "components/download/internal/entry_utils.h"
-#include "components/download/internal/scheduler/device_status.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/task_scheduler.h"
+#include "components/download/internal/background_service/client_set.h"
+#include "components/download/internal/background_service/config.h"
+#include "components/download/internal/background_service/entry_utils.h"
+#include "components/download/internal/background_service/scheduler/device_status.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/task_scheduler.h"
 
 namespace download {
 
diff --git a/components/download/internal/scheduler/scheduler_impl.h b/components/download/internal/background_service/scheduler/scheduler_impl.h
similarity index 83%
rename from components/download/internal/scheduler/scheduler_impl.h
rename to components/download/internal/background_service/scheduler/scheduler_impl.h
index 1284d38..2d53b33ce 100644
--- a/components/download/internal/scheduler/scheduler_impl.h
+++ b/components/download/internal/background_service/scheduler/scheduler_impl.h
@@ -2,16 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_SCHEDULER_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_SCHEDULER_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_SCHEDULER_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_SCHEDULER_IMPL_H_
 
-#include "components/download/internal/scheduler/scheduler.h"
+#include "components/download/internal/background_service/scheduler/scheduler.h"
 
 #include <map>
 #include <vector>
 
 #include "base/macros.h"
-#include "components/download/internal/entry.h"
+#include "components/download/internal/background_service/entry.h"
 
 namespace download {
 
@@ -69,4 +69,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_SCHEDULER_SCHEDULER_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SCHEDULER_SCHEDULER_IMPL_H_
diff --git a/components/download/internal/scheduler/scheduler_impl_unittest.cc b/components/download/internal/background_service/scheduler/scheduler_impl_unittest.cc
similarity index 97%
rename from components/download/internal/scheduler/scheduler_impl_unittest.cc
rename to components/download/internal/background_service/scheduler/scheduler_impl_unittest.cc
index e564412..d39cfc3 100644
--- a/components/download/internal/scheduler/scheduler_impl_unittest.cc
+++ b/components/download/internal/background_service/scheduler/scheduler_impl_unittest.cc
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/scheduler/scheduler_impl.h"
+#include "components/download/internal/background_service/scheduler/scheduler_impl.h"
 
 #include <memory>
 
 #include "base/strings/string_number_conversions.h"
-#include "components/download/internal/config.h"
-#include "components/download/internal/entry.h"
-#include "components/download/internal/scheduler/device_status.h"
-#include "components/download/public/task_scheduler.h"
+#include "components/download/internal/background_service/config.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/internal/background_service/scheduler/device_status.h"
+#include "components/download/public/background_service/task_scheduler.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/components/download/internal/service_config_impl.cc b/components/download/internal/background_service/service_config_impl.cc
similarity index 82%
rename from components/download/internal/service_config_impl.cc
rename to components/download/internal/background_service/service_config_impl.cc
index 36775bee7..8654ba2 100644
--- a/components/download/internal/service_config_impl.cc
+++ b/components/download/internal/background_service/service_config_impl.cc
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/service_config_impl.h"
+#include "components/download/internal/background_service/service_config_impl.h"
 
 #include "base/time/time.h"
-#include "components/download/internal/config.h"
+#include "components/download/internal/background_service/config.h"
 
 namespace download {
 
diff --git a/components/download/internal/service_config_impl.h b/components/download/internal/background_service/service_config_impl.h
similarity index 69%
rename from components/download/internal/service_config_impl.h
rename to components/download/internal/background_service/service_config_impl.h
index a61b3ec..0444791f 100644
--- a/components/download/internal/service_config_impl.h
+++ b/components/download/internal/background_service/service_config_impl.h
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_SERVICE_CONFIG_IMPL_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_SERVICE_CONFIG_IMPL_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SERVICE_CONFIG_IMPL_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SERVICE_CONFIG_IMPL_H_
 
 #include "base/macros.h"
-#include "components/download/public/service_config.h"
+#include "components/download/public/background_service/service_config.h"
 
 namespace download {
 
@@ -30,4 +30,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_SERVICE_CONFIG_IMPL_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_SERVICE_CONFIG_IMPL_H_
diff --git a/components/download/internal/service_config_impl_unittest.cc b/components/download/internal/background_service/service_config_impl_unittest.cc
similarity index 83%
rename from components/download/internal/service_config_impl_unittest.cc
rename to components/download/internal/background_service/service_config_impl_unittest.cc
index 9b14c79..b310666 100644
--- a/components/download/internal/service_config_impl_unittest.cc
+++ b/components/download/internal/background_service/service_config_impl_unittest.cc
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/service_config_impl.h"
-#include "components/download/internal/config.h"
+#include "components/download/internal/background_service/service_config_impl.h"
+#include "components/download/internal/background_service/config.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace download {
diff --git a/components/download/internal/startup_status.cc b/components/download/internal/background_service/startup_status.cc
similarity index 89%
rename from components/download/internal/startup_status.cc
rename to components/download/internal/background_service/startup_status.cc
index 393e289..a82c022 100644
--- a/components/download/internal/startup_status.cc
+++ b/components/download/internal/background_service/startup_status.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/startup_status.h"
+#include "components/download/internal/background_service/startup_status.h"
 
 namespace download {
 
diff --git a/components/download/internal/startup_status.h b/components/download/internal/background_service/startup_status.h
similarity index 80%
rename from components/download/internal/startup_status.h
rename to components/download/internal/background_service/startup_status.h
index 754428a..f981453 100644
--- a/components/download/internal/startup_status.h
+++ b/components/download/internal/background_service/startup_status.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 COMPONENTS_DOWNLOAD_STARTUP_STATUS_H_
-#define COMPONENTS_DOWNLOAD_STARTUP_STATUS_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STARTUP_STATUS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STARTUP_STATUS_H_
 
 #include "base/macros.h"
 #include "base/optional.h"
@@ -37,4 +37,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_STARTUP_STATUS_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STARTUP_STATUS_H_
diff --git a/components/download/internal/stats.cc b/components/download/internal/background_service/stats.cc
similarity index 98%
rename from components/download/internal/stats.cc
rename to components/download/internal/background_service/stats.cc
index c32ad80e..720a87f5 100644
--- a/components/download/internal/stats.cc
+++ b/components/download/internal/background_service/stats.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/stats.h"
+#include "components/download/internal/background_service/stats.h"
 
 #include <map>
 
@@ -10,7 +10,7 @@
 #include "base/files/file_util.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/metrics/histogram_macros.h"
-#include "components/download/internal/startup_status.h"
+#include "components/download/internal/background_service/startup_status.h"
 
 namespace download {
 namespace stats {
@@ -241,8 +241,7 @@
                             Entry::State::COUNT);
 }
 
-void LogDownloadCompletion(CompletionType type,
-                           uint64_t file_size_bytes) {
+void LogDownloadCompletion(CompletionType type, uint64_t file_size_bytes) {
   // Records completion type.
   UMA_HISTOGRAM_ENUMERATION("Download.Service.Finish.Type", type,
                             CompletionType::COUNT);
diff --git a/components/download/internal/stats.h b/components/download/internal/background_service/stats.h
similarity index 90%
rename from components/download/internal/stats.h
rename to components/download/internal/background_service/stats.h
index e68ecdd..ab9d2b5 100644
--- a/components/download/internal/stats.h
+++ b/components/download/internal/background_service/stats.h
@@ -2,17 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_STATS_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_STATS_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STATS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STATS_H_
 
 #include "base/files/file.h"
 #include "base/optional.h"
-#include "components/download/internal/controller.h"
-#include "components/download/internal/driver_entry.h"
-#include "components/download/internal/entry.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/download_task_types.h"
+#include "components/download/internal/background_service/controller.h"
+#include "components/download/internal/background_service/driver_entry.h"
+#include "components/download/internal/background_service/entry.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/download_task_types.h"
 
 namespace download {
 
@@ -170,8 +170,7 @@
 void LogRecoveryOperation(Entry::State to_state);
 
 // Logs download completion event, download time, and the file size.
-void LogDownloadCompletion(CompletionType type,
-                           uint64_t file_size_bytes);
+void LogDownloadCompletion(CompletionType type, uint64_t file_size_bytes);
 
 // Logs various pause reasons for download. The reasons are not mutually
 // exclusive.
@@ -228,4 +227,4 @@
 }  // namespace stats
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_STATS_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STATS_H_
diff --git a/components/download/internal/store.h b/components/download/internal/background_service/store.h
similarity index 88%
rename from components/download/internal/store.h
rename to components/download/internal/background_service/store.h
index 1d1e568..c810af38 100644
--- a/components/download/internal/store.h
+++ b/components/download/internal/background_service/store.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 COMPONENTS_DOWNLOAD_INTERNAL_STORE_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_STORE_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STORE_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STORE_H_
 
 #include <memory>
 #include <string>
@@ -48,4 +48,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_STORE_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_STORE_H_
diff --git a/components/download/internal/test/BUILD.gn b/components/download/internal/background_service/test/BUILD.gn
similarity index 80%
rename from components/download/internal/test/BUILD.gn
rename to components/download/internal/background_service/test/BUILD.gn
index 3d3648a..8106e5b 100644
--- a/components/download/internal/test/BUILD.gn
+++ b/components/download/internal/background_service/test/BUILD.gn
@@ -4,7 +4,8 @@
 
 # Test target for download internal tests to depend on.
 source_set("test_support") {
-  visibility = [ "//components/download/internal:unit_tests" ]
+  visibility =
+      [ "//components/download/internal/background_service:unit_tests" ]
 
   testonly = true
 
@@ -33,12 +34,12 @@
 
   public_deps = [
     "//base",
-    "//components/download/public",
+    "//components/download/public/background_service:public",
     "//net:test_support",
     "//testing/gmock",
   ]
 
   deps = [
-    "//components/download/internal",
+    "//components/download/internal/background_service:internal",
   ]
 }
diff --git a/components/download/internal/test/black_hole_log_sink.cc b/components/download/internal/background_service/test/black_hole_log_sink.cc
similarity index 89%
rename from components/download/internal/test/black_hole_log_sink.cc
rename to components/download/internal/background_service/test/black_hole_log_sink.cc
index ac68d07..e51b6ce 100644
--- a/components/download/internal/test/black_hole_log_sink.cc
+++ b/components/download/internal/background_service/test/black_hole_log_sink.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/black_hole_log_sink.h"
+#include "components/download/internal/background_service/test/black_hole_log_sink.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/internal/test/black_hole_log_sink.h b/components/download/internal/background_service/test/black_hole_log_sink.h
similarity index 75%
rename from components/download/internal/test/black_hole_log_sink.h
rename to components/download/internal/background_service/test/black_hole_log_sink.h
index cf2bbc0e..9bde5fbe 100644
--- a/components/download/internal/test/black_hole_log_sink.h
+++ b/components/download/internal/background_service/test/black_hole_log_sink.h
@@ -2,7 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/log_sink.h"
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_BLACK_HOLE_LOG_SINK_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_BLACK_HOLE_LOG_SINK_H_
+
+#include "components/download/internal/background_service/log_sink.h"
 
 namespace download {
 namespace test {
@@ -29,3 +32,5 @@
 
 }  // namespace test
 }  // namespace download
+
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_BLACK_HOLE_LOG_SINK_H_
diff --git a/components/download/internal/test/download_params_utils.cc b/components/download/internal/background_service/test/download_params_utils.cc
similarity index 87%
rename from components/download/internal/test/download_params_utils.cc
rename to components/download/internal/background_service/test/download_params_utils.cc
index 2d9ce0cb..8eeb338 100644
--- a/components/download/internal/test/download_params_utils.cc
+++ b/components/download/internal/background_service/test/download_params_utils.cc
@@ -5,7 +5,7 @@
 #include <algorithm>
 
 #include "base/guid.h"
-#include "components/download/internal/test/download_params_utils.h"
+#include "components/download/internal/background_service/test/download_params_utils.h"
 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
 namespace download {
 namespace test {
diff --git a/components/download/internal/background_service/test/download_params_utils.h b/components/download/internal/background_service/test/download_params_utils.h
new file mode 100644
index 0000000..38d1d4eb
--- /dev/null
+++ b/components/download/internal/background_service/test/download_params_utils.h
@@ -0,0 +1,21 @@
+// 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 COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_DOWNLOAD_PARAMS_UTILS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_DOWNLOAD_PARAMS_UTILS_H_
+
+#include <string>
+#include <vector>
+
+#include "components/download/internal/background_service/entry.h"
+
+namespace download {
+namespace test {
+
+DownloadParams BuildBasicDownloadParams();
+
+}  // namespace test
+}  // namespace download
+
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_DOWNLOAD_PARAMS_UTILS_H_
diff --git a/components/download/internal/test/entry_utils.cc b/components/download/internal/background_service/test/entry_utils.cc
similarity index 97%
rename from components/download/internal/test/entry_utils.cc
rename to components/download/internal/background_service/test/entry_utils.cc
index ca47dcc..468acf707 100644
--- a/components/download/internal/test/entry_utils.cc
+++ b/components/download/internal/background_service/test/entry_utils.cc
@@ -5,7 +5,7 @@
 #include <algorithm>
 
 #include "base/guid.h"
-#include "components/download/internal/test/entry_utils.h"
+#include "components/download/internal/background_service/test/entry_utils.h"
 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
 
 namespace download {
diff --git a/components/download/internal/test/entry_utils.h b/components/download/internal/background_service/test/entry_utils.h
similarity index 85%
rename from components/download/internal/test/entry_utils.h
rename to components/download/internal/background_service/test/entry_utils.h
index 14e207d..48610ff 100644
--- a/components/download/internal/test/entry_utils.h
+++ b/components/download/internal/background_service/test/entry_utils.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_TEST_ENTRY_UTILS_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_ENTRY_UTILS_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_ENTRY_UTILS_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_ENTRY_UTILS_H_
 
 #include <string>
 #include <vector>
 
-#include "components/download/internal/entry.h"
+#include "components/download/internal/background_service/entry.h"
 
 namespace download {
 namespace test {
@@ -54,4 +54,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_ENTRY_UTILS_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_ENTRY_UTILS_H_
diff --git a/components/download/internal/test/mock_controller.cc b/components/download/internal/background_service/test/mock_controller.cc
similarity index 85%
rename from components/download/internal/test/mock_controller.cc
rename to components/download/internal/background_service/test/mock_controller.cc
index 9b32e04b..e899093 100644
--- a/components/download/internal/test/mock_controller.cc
+++ b/components/download/internal/background_service/test/mock_controller.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/mock_controller.h"
+#include "components/download/internal/background_service/test/mock_controller.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/internal/test/mock_controller.h b/components/download/internal/background_service/test/mock_controller.h
similarity index 73%
rename from components/download/internal/test/mock_controller.h
rename to components/download/internal/background_service/test/mock_controller.h
index e61bec80..33053d9 100644
--- a/components/download/internal/test/mock_controller.h
+++ b/components/download/internal/background_service/test/mock_controller.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_TEST_MOCK_CONTROLLER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_MOCK_CONTROLLER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_CONTROLLER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_CONTROLLER_H_
 
 #include "base/macros.h"
-#include "components/download/internal/controller.h"
-#include "components/download/internal/startup_status.h"
-#include "components/download/public/download_params.h"
+#include "components/download/internal/background_service/controller.h"
+#include "components/download/internal/background_service/startup_status.h"
+#include "components/download/public/background_service/download_params.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
 namespace download {
@@ -43,4 +43,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_MOCK_CONTROLLER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_CONTROLLER_H_
diff --git a/components/download/internal/test/mock_log_sink.cc b/components/download/internal/background_service/test/mock_log_sink.cc
similarity index 80%
rename from components/download/internal/test/mock_log_sink.cc
rename to components/download/internal/background_service/test/mock_log_sink.cc
index da5b77cf..d82875f 100644
--- a/components/download/internal/test/mock_log_sink.cc
+++ b/components/download/internal/background_service/test/mock_log_sink.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/mock_log_sink.h"
+#include "components/download/internal/background_service/test/mock_log_sink.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/internal/test/mock_log_sink.h b/components/download/internal/background_service/test/mock_log_sink.h
similarity index 60%
rename from components/download/internal/test/mock_log_sink.h
rename to components/download/internal/background_service/test/mock_log_sink.h
index 9f3cf098..6513d8f5 100644
--- a/components/download/internal/test/mock_log_sink.h
+++ b/components/download/internal/background_service/test/mock_log_sink.h
@@ -2,7 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/log_sink.h"
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_LOG_SINK_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_LOG_SINK_H_
+
+#include "components/download/internal/background_service/log_sink.h"
 
 #include "testing/gmock/include/gmock/gmock.h"
 
@@ -20,3 +23,5 @@
 
 }  // namespace test
 }  // namespace download
+
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_LOG_SINK_H_
diff --git a/components/download/internal/test/mock_model_client.cc b/components/download/internal/background_service/test/mock_model_client.cc
similarity index 80%
rename from components/download/internal/test/mock_model_client.cc
rename to components/download/internal/background_service/test/mock_model_client.cc
index 9973c5c9..2238476 100644
--- a/components/download/internal/test/mock_model_client.cc
+++ b/components/download/internal/background_service/test/mock_model_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/mock_model_client.h"
+#include "components/download/internal/background_service/test/mock_model_client.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/internal/test/mock_model_client.h b/components/download/internal/background_service/test/mock_model_client.h
similarity index 67%
rename from components/download/internal/test/mock_model_client.h
rename to components/download/internal/background_service/test/mock_model_client.h
index c6cf3cf..6faeb98 100644
--- a/components/download/internal/test/mock_model_client.h
+++ b/components/download/internal/background_service/test/mock_model_client.h
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/model.h"
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_MODEL_CLIENT_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_MODEL_CLIENT_H_
 
-#include "components/download/internal/entry.h"
+#include "components/download/internal/background_service/model.h"
+
+#include "components/download/internal/background_service/entry.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_TEST_MOCK_MODEL_CLIENT_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_MOCK_MODEL_CLIENT_H_
-
 namespace download {
 namespace test {
 
@@ -29,4 +29,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_MOCK_MODEL_CLIENT_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_MOCK_MODEL_CLIENT_H_
diff --git a/components/download/internal/test/noop_store.cc b/components/download/internal/background_service/test/noop_store.cc
similarity index 91%
rename from components/download/internal/test/noop_store.cc
rename to components/download/internal/background_service/test/noop_store.cc
index ff58e8e2..29e3c1c 100644
--- a/components/download/internal/test/noop_store.cc
+++ b/components/download/internal/background_service/test/noop_store.cc
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/noop_store.h"
+#include "components/download/internal/background_service/test/noop_store.h"
 
 #include <memory>
 
 #include "base/bind.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "components/download/internal/entry.h"
+#include "components/download/internal/background_service/entry.h"
 
 namespace download {
 
diff --git a/components/download/internal/test/noop_store.h b/components/download/internal/background_service/test/noop_store.h
similarity index 79%
rename from components/download/internal/test/noop_store.h
rename to components/download/internal/background_service/test/noop_store.h
index 1bbe106..fe3e5e4 100644
--- a/components/download/internal/test/noop_store.h
+++ b/components/download/internal/background_service/test/noop_store.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_TEST_NOOP_STORE_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_NOOP_STORE_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_NOOP_STORE_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_NOOP_STORE_H_
 
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
-#include "components/download/internal/store.h"
+#include "components/download/internal/background_service/store.h"
 
 namespace download {
 
@@ -43,4 +43,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_NOOP_STORE_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_NOOP_STORE_H_
diff --git a/components/download/internal/test/test_device_status_listener.cc b/components/download/internal/background_service/test/test_device_status_listener.cc
similarity index 95%
rename from components/download/internal/test/test_device_status_listener.cc
rename to components/download/internal/background_service/test/test_device_status_listener.cc
index 5a6bc62..6c01d71 100644
--- a/components/download/internal/test/test_device_status_listener.cc
+++ b/components/download/internal/background_service/test/test_device_status_listener.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/test_device_status_listener.h"
+#include "components/download/internal/background_service/test/test_device_status_listener.h"
 
 #include <memory>
 
diff --git a/components/download/internal/test/test_device_status_listener.h b/components/download/internal/background_service/test/test_device_status_listener.h
similarity index 75%
rename from components/download/internal/test/test_device_status_listener.h
rename to components/download/internal/background_service/test/test_device_status_listener.h
index ee9c878..aa717cc 100644
--- a/components/download/internal/test/test_device_status_listener.h
+++ b/components/download/internal/background_service/test/test_device_status_listener.h
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_DEVICE_STATUS_LISTENER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_DEVICE_STATUS_LISTENER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_DEVICE_STATUS_LISTENER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_DEVICE_STATUS_LISTENER_H_
 
 #include "base/memory/weak_ptr.h"
-#include "components/download/internal/scheduler/device_status_listener.h"
+#include "components/download/internal/background_service/scheduler/device_status_listener.h"
 
 namespace download {
 namespace test {
@@ -40,4 +40,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_DEVICE_STATUS_LISTENER_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_DEVICE_STATUS_LISTENER_H_
diff --git a/components/download/internal/test/test_download_driver.cc b/components/download/internal/background_service/test/test_download_driver.cc
similarity index 95%
rename from components/download/internal/test/test_download_driver.cc
rename to components/download/internal/background_service/test/test_download_driver.cc
index da5af58..17a91765 100644
--- a/components/download/internal/test/test_download_driver.cc
+++ b/components/download/internal/background_service/test/test_download_driver.cc
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/test_download_driver.h"
+#include "components/download/internal/background_service/test/test_download_driver.h"
 
 #include "base/files/file_path.h"
-#include "components/download/public/download_params.h"
+#include "components/download/public/background_service/download_params.h"
 #include "net/http/http_response_headers.h"
 
 namespace download {
diff --git a/components/download/internal/test/test_download_driver.h b/components/download/internal/background_service/test/test_download_driver.h
similarity index 85%
rename from components/download/internal/test/test_download_driver.h
rename to components/download/internal/background_service/test/test_download_driver.h
index f01220b..9e89577 100644
--- a/components/download/internal/test/test_download_driver.h
+++ b/components/download/internal/background_service/test/test_download_driver.h
@@ -2,14 +2,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_DOWNLOAD_DRIVER_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_DOWNLOAD_DRIVER_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_DOWNLOAD_DRIVER_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_DOWNLOAD_DRIVER_H_
 
 #include <map>
 #include <memory>
 
 #include "base/macros.h"
-#include "components/download/internal/download_driver.h"
+#include "components/download/internal/background_service/download_driver.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 
 namespace download {
@@ -63,4 +63,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_CONTENT_TEST_TEST_DOWNLOAD_DRIVER_H_
+#endif  // COMPONENTS_DOWNLOAD_CONTENT_BACKGROUND_SERVICE_TEST_TEST_DOWNLOAD_DRIVER_H_
diff --git a/components/download/internal/test/test_store.cc b/components/download/internal/background_service/test/test_store.cc
similarity index 93%
rename from components/download/internal/test/test_store.cc
rename to components/download/internal/background_service/test/test_store.cc
index 8a2c3b8..a9d076b 100644
--- a/components/download/internal/test/test_store.cc
+++ b/components/download/internal/background_service/test/test_store.cc
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/internal/test/test_store.h"
+#include "components/download/internal/background_service/test/test_store.h"
 
 #include <memory>
 
-#include "components/download/internal/entry.h"
+#include "components/download/internal/background_service/entry.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/internal/test/test_store.h b/components/download/internal/background_service/test/test_store.h
similarity index 85%
rename from components/download/internal/test/test_store.h
rename to components/download/internal/background_service/test/test_store.h
index 477e2d4..66399d4 100644
--- a/components/download/internal/test/test_store.h
+++ b/components/download/internal/background_service/test/test_store.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 COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_STORE_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_STORE_H_
+#ifndef COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_STORE_H_
+#define COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_STORE_H_
 
 #include <string>
 #include <vector>
@@ -11,7 +11,7 @@
 #include "base/callback.h"
 #include "base/macros.h"
 #include "base/optional.h"
-#include "components/download/internal/store.h"
+#include "components/download/internal/background_service/store.h"
 
 namespace download {
 
@@ -67,4 +67,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_TEST_STORE_H_
+#endif  // COMPONENTS_DOWNLOAD_INTERNAL_BACKGROUND_SERVICE_TEST_TEST_STORE_H_
diff --git a/components/download/internal/test/download_params_utils.h b/components/download/internal/test/download_params_utils.h
deleted file mode 100644
index 30ec1ff..0000000
--- a/components/download/internal/test/download_params_utils.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// 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 COMPONENTS_DOWNLOAD_INTERNAL_TEST_DOWNLOAD_PARAMS_UTILS_H_
-#define COMPONENTS_DOWNLOAD_INTERNAL_TEST_DOWNLOAD_PARAMS_UTILS_H_
-
-#include <string>
-#include <vector>
-
-#include "components/download/internal/entry.h"
-
-namespace download {
-namespace test {
-
-DownloadParams BuildBasicDownloadParams();
-
-}  // namespace test
-}  // namespace download
-
-#endif  // COMPONENTS_DOWNLOAD_INTERNAL_TEST_DOWNLOAD_PARAMS_UTILS_H_
diff --git a/components/download/public/BUILD.gn b/components/download/public/background_service/BUILD.gn
similarity index 100%
rename from components/download/public/BUILD.gn
rename to components/download/public/background_service/BUILD.gn
diff --git a/components/download/public/DEPS b/components/download/public/background_service/DEPS
similarity index 100%
rename from components/download/public/DEPS
rename to components/download/public/background_service/DEPS
diff --git a/components/download/public/client.h b/components/download/public/background_service/client.h
similarity index 95%
rename from components/download/public/client.h
rename to components/download/public/background_service/client.h
index beb9296..8f0e6bcc 100644
--- a/components/download/public/client.h
+++ b/components/download/public/background_service/client.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 COMPONENTS_DOWNLOAD_PUBLIC_CLIENT_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_CLIENT_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_CLIENT_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_CLIENT_H_
 
 #include <string>
 #include <vector>
@@ -120,4 +120,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_CLIENT_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_CLIENT_H_
diff --git a/components/download/public/clients.h b/components/download/public/background_service/clients.h
similarity index 82%
rename from components/download/public/clients.h
rename to components/download/public/background_service/clients.h
index 62f1123..f678bb9 100644
--- a/components/download/public/clients.h
+++ b/components/download/public/background_service/clients.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_CLIENTS_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_CLIENTS_H_
 
 #include <map>
 #include <memory>
 
-#include "components/download/public/client.h"
+#include "components/download/public/background_service/client.h"
 
 namespace download {
 
@@ -44,4 +44,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_CLIENTS_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_CLIENTS_H_
diff --git a/components/download/public/download_metadata.cc b/components/download/public/background_service/download_metadata.cc
similarity index 92%
rename from components/download/public/download_metadata.cc
rename to components/download/public/background_service/download_metadata.cc
index c5eb929a..6cbe493 100644
--- a/components/download/public/download_metadata.cc
+++ b/components/download/public/background_service/download_metadata.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/download_metadata.h"
+#include "components/download/public/background_service/download_metadata.h"
 
 namespace download {
 
diff --git a/components/download/public/download_metadata.h b/components/download/public/background_service/download_metadata.h
similarity index 83%
rename from components/download/public/download_metadata.h
rename to components/download/public/background_service/download_metadata.h
index bcf01a8..26f8547 100644
--- a/components/download/public/download_metadata.h
+++ b/components/download/public/background_service/download_metadata.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 COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_METADATA_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_METADATA_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_METADATA_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_METADATA_H_
 
 #include "base/files/file_path.h"
 #include "base/optional.h"
@@ -41,4 +41,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_METADATA_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_METADATA_H_
diff --git a/components/download/public/download_params.cc b/components/download/public/background_service/download_params.cc
similarity index 87%
rename from components/download/public/download_params.cc
rename to components/download/public/background_service/download_params.cc
index f5279a37..d5c1238 100644
--- a/components/download/public/download_params.cc
+++ b/components/download/public/background_service/download_params.cc
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/download_params.h"
+#include "components/download/public/background_service/download_params.h"
 
-#include "components/download/public/clients.h"
+#include "components/download/public/background_service/clients.h"
 
 namespace download {
 
diff --git a/components/download/public/download_params.h b/components/download/public/background_service/download_params.h
similarity index 94%
rename from components/download/public/download_params.h
rename to components/download/public/background_service/download_params.h
index 851de6d..aadde2f4 100644
--- a/components/download/public/download_params.h
+++ b/components/download/public/background_service/download_params.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_PARAMS_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_PARAMS_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_PARAMS_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_PARAMS_H_
 
 #include "base/callback.h"
 #include "base/time/time.h"
-#include "components/download/public/clients.h"
+#include "components/download/public/background_service/clients.h"
 #include "net/http/http_request_headers.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 #include "url/gurl.h"
@@ -168,4 +168,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_PARAMS_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_PARAMS_H_
diff --git a/components/download/public/download_service.h b/components/download/public/background_service/download_service.h
similarity index 91%
rename from components/download/public/download_service.h
rename to components/download/public/background_service/download_service.h
index 2de7add..0d240ab2 100644
--- a/components/download/public/download_service.h
+++ b/components/download/public/background_service/download_service.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 COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_SERVICE_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_SERVICE_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_SERVICE_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_SERVICE_H_
 
 #include <memory>
 #include <string>
@@ -13,8 +13,8 @@
 #include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/sequenced_task_runner.h"
-#include "components/download/public/clients.h"
-#include "components/download/public/download_task_types.h"
+#include "components/download/public/background_service/clients.h"
+#include "components/download/public/background_service/download_task_types.h"
 #include "components/keyed_service/core/keyed_service.h"
 
 namespace download {
@@ -109,4 +109,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_SERVICE_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_SERVICE_H_
diff --git a/components/download/public/download_task_types.h b/components/download/public/background_service/download_task_types.h
similarity index 69%
rename from components/download/public/download_task_types.h
rename to components/download/public/background_service/download_task_types.h
index a26bc013..48fcfb35 100644
--- a/components/download/public/download_task_types.h
+++ b/components/download/public/background_service/download_task_types.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 COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_TASK_TYPES_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_TASK_TYPES_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_TASK_TYPES_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_TASK_TYPES_H_
 
 namespace download {
 
@@ -19,4 +19,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_DOWNLOAD_TASK_TYPES_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_DOWNLOAD_TASK_TYPES_H_
diff --git a/components/download/public/features.cc b/components/download/public/background_service/features.cc
similarity index 83%
rename from components/download/public/features.cc
rename to components/download/public/background_service/features.cc
index f254f23..b5387b32 100644
--- a/components/download/public/features.cc
+++ b/components/download/public/background_service/features.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/features.h"
+#include "components/download/public/background_service/features.h"
 
 namespace download {
 
diff --git a/components/download/public/background_service/features.h b/components/download/public/background_service/features.h
new file mode 100644
index 0000000..5296342
--- /dev/null
+++ b/components/download/public/background_service/features.h
@@ -0,0 +1,16 @@
+// 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 COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_FEATURES_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_FEATURES_H_
+
+#include "base/feature_list.h"
+
+namespace download {
+
+extern const base::Feature kDownloadServiceFeature;
+
+}  // namespace download
+
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_FEATURES_H_
diff --git a/components/download/public/logger.h b/components/download/public/background_service/logger.h
similarity index 93%
rename from components/download/public/logger.h
rename to components/download/public/background_service/logger.h
index a3b57de..cc9aa30 100644
--- a/components/download/public/logger.h
+++ b/components/download/public/background_service/logger.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 COMPONENTS_DOWNLOAD_PUBLIC_LOGGER_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_LOGGER_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_LOGGER_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_LOGGER_H_
 
 #include <memory>
 
@@ -99,4 +99,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_LOGGER_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_LOGGER_H_
diff --git a/components/download/public/navigation_monitor.h b/components/download/public/background_service/navigation_monitor.h
similarity index 89%
rename from components/download/public/navigation_monitor.h
rename to components/download/public/background_service/navigation_monitor.h
index 5d8e065b..329c10a2 100644
--- a/components/download/public/navigation_monitor.h
+++ b/components/download/public/background_service/navigation_monitor.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 COMPONENTS_DOWNLOAD_PUBLIC_NAVIGATION_MONITOR_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_NAVIGATION_MONITOR_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_NAVIGATION_MONITOR_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_NAVIGATION_MONITOR_H_
 
 #include "base/time/time.h"
 #include "components/keyed_service/core/keyed_service.h"
@@ -58,4 +58,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_NAVIGATION_MONITOR_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_NAVIGATION_MONITOR_H_
diff --git a/components/download/public/service_config.h b/components/download/public/background_service/service_config.h
similarity index 86%
rename from components/download/public/service_config.h
rename to components/download/public/background_service/service_config.h
index 4b636c47..8a8c85e 100644
--- a/components/download/public/service_config.h
+++ b/components/download/public/background_service/service_config.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 COMPONENTS_DOWNLOAD_PUBLIC_SERVICE_CONFIG_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_SERVICE_CONFIG_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_SERVICE_CONFIG_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_SERVICE_CONFIG_H_
 
 #include <stdint.h>
 
@@ -38,4 +38,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_SERVICE_CONFIG_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_SERVICE_CONFIG_H_
diff --git a/components/download/public/task_scheduler.h b/components/download/public/background_service/task_scheduler.h
similarity index 80%
rename from components/download/public/task_scheduler.h
rename to components/download/public/background_service/task_scheduler.h
index 11fb9173..26afbf49 100644
--- a/components/download/public/task_scheduler.h
+++ b/components/download/public/background_service/task_scheduler.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_TASK_SCHEDULER_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_TASK_SCHEDULER_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TASK_SCHEDULER_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TASK_SCHEDULER_H_
 
-#include "components/download/public/download_task_types.h"
+#include "components/download/public/background_service/download_task_types.h"
 
 namespace download {
 
@@ -34,4 +34,4 @@
 
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_TASK_SCHEDULER_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TASK_SCHEDULER_H_
diff --git a/components/download/public/test/BUILD.gn b/components/download/public/background_service/test/BUILD.gn
similarity index 91%
rename from components/download/public/test/BUILD.gn
rename to components/download/public/background_service/test/BUILD.gn
index 9aa28f4..39bfe9bb 100644
--- a/components/download/public/test/BUILD.gn
+++ b/components/download/public/background_service/test/BUILD.gn
@@ -25,7 +25,7 @@
 
   public_deps = [
     "//base",
-    "//components/download/public",
+    "//components/download/public/background_service:public",
     "//testing/gmock",
   ]
 }
diff --git a/components/download/public/test/empty_client.cc b/components/download/public/background_service/test/empty_client.cc
similarity index 93%
rename from components/download/public/test/empty_client.cc
rename to components/download/public/background_service/test/empty_client.cc
index 3b0d999e..c908732ce 100644
--- a/components/download/public/test/empty_client.cc
+++ b/components/download/public/background_service/test/empty_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/test/empty_client.h"
+#include "components/download/public/background_service/test/empty_client.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/public/test/empty_client.h b/components/download/public/background_service/test/empty_client.h
similarity index 77%
rename from components/download/public/test/empty_client.h
rename to components/download/public/background_service/test/empty_client.h
index 2c630f0..d708d83 100644
--- a/components/download/public/test/empty_client.h
+++ b/components/download/public/background_service/test/empty_client.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_TEST_EMPTY_CLIENT_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_TEST_EMPTY_CLIENT_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_EMPTY_CLIENT_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_EMPTY_CLIENT_H_
 
 #include "base/macros.h"
-#include "components/download/public/client.h"
-#include "components/download/public/download_metadata.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/download_metadata.h"
 
 namespace download {
 namespace test {
@@ -41,4 +41,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_TEST_EMPTY_CLIENT_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_EMPTY_CLIENT_H_
diff --git a/components/download/public/test/empty_logger.cc b/components/download/public/background_service/test/empty_logger.cc
similarity index 87%
rename from components/download/public/test/empty_logger.cc
rename to components/download/public/background_service/test/empty_logger.cc
index fec2c95..a0d829f7 100644
--- a/components/download/public/test/empty_logger.cc
+++ b/components/download/public/background_service/test/empty_logger.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/test/empty_logger.h"
+#include "components/download/public/background_service/test/empty_logger.h"
 
 #include "base/values.h"
 
diff --git a/components/download/public/test/empty_logger.h b/components/download/public/background_service/test/empty_logger.h
similarity index 69%
rename from components/download/public/test/empty_logger.h
rename to components/download/public/background_service/test/empty_logger.h
index d1cd362..e9e41cb2 100644
--- a/components/download/public/test/empty_logger.h
+++ b/components/download/public/background_service/test/empty_logger.h
@@ -2,10 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_TEST_EMPTY_LOGGER_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_TEST_EMPTY_LOGGER_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_EMPTY_LOGGER_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_EMPTY_LOGGER_H_
 
-#include "components/download/public/logger.h"
+#include "components/download/public/background_service/logger.h"
 
 namespace download {
 namespace test {
@@ -29,4 +29,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_TEST_EMPTY_LOGGER_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_EMPTY_LOGGER_H_
diff --git a/components/download/public/test/mock_client.cc b/components/download/public/background_service/test/mock_client.cc
similarity index 80%
rename from components/download/public/test/mock_client.cc
rename to components/download/public/background_service/test/mock_client.cc
index 6ce4745..7ae6151b 100644
--- a/components/download/public/test/mock_client.cc
+++ b/components/download/public/background_service/test/mock_client.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/test/mock_client.h"
+#include "components/download/public/background_service/test/mock_client.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/public/test/mock_client.h b/components/download/public/background_service/test/mock_client.h
similarity index 76%
rename from components/download/public/test/mock_client.h
rename to components/download/public/background_service/test/mock_client.h
index 2539b1048..a96c3885 100644
--- a/components/download/public/test/mock_client.h
+++ b/components/download/public/background_service/test/mock_client.h
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_TEST_MOCK_CLIENT_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_TEST_MOCK_CLIENT_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_MOCK_CLIENT_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_MOCK_CLIENT_H_
 
 #include "base/macros.h"
-#include "components/download/public/client.h"
-#include "components/download/public/download_metadata.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/download_metadata.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
 namespace download {
@@ -40,4 +40,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_TEST_MOCK_CLIENT_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_MOCK_CLIENT_H_
diff --git a/components/download/public/test/mock_download_service.cc b/components/download/public/background_service/test/mock_download_service.cc
similarity index 80%
rename from components/download/public/test/mock_download_service.cc
rename to components/download/public/background_service/test/mock_download_service.cc
index af43b09..04836357 100644
--- a/components/download/public/test/mock_download_service.cc
+++ b/components/download/public/background_service/test/mock_download_service.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/test/mock_download_service.h"
+#include "components/download/public/background_service/test/mock_download_service.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/public/test/mock_download_service.h b/components/download/public/background_service/test/mock_download_service.h
similarity index 72%
rename from components/download/public/test/mock_download_service.h
rename to components/download/public/background_service/test/mock_download_service.h
index ab763ae..7bf3efd 100644
--- a/components/download/public/test/mock_download_service.h
+++ b/components/download/public/background_service/test/mock_download_service.h
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_TEST_MOCK_DOWNLOAD_SERVICE_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_TEST_MOCK_DOWNLOAD_SERVICE_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_MOCK_DOWNLOAD_SERVICE_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_MOCK_DOWNLOAD_SERVICE_H_
 
 #include "base/macros.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/download_service.h"
-#include "components/download/public/service_config.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/download_service.h"
+#include "components/download/public/background_service/service_config.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
 namespace download {
@@ -40,4 +40,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_TEST_MOCK_DOWNLOAD_SERVICE_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_MOCK_DOWNLOAD_SERVICE_H_
diff --git a/components/download/public/test/test_download_service.cc b/components/download/public/background_service/test/test_download_service.cc
similarity index 89%
rename from components/download/public/test/test_download_service.cc
rename to components/download/public/background_service/test/test_download_service.cc
index e143e38..b3ecbb6f 100644
--- a/components/download/public/test/test_download_service.cc
+++ b/components/download/public/background_service/test/test_download_service.cc
@@ -2,18 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "components/download/public/test/test_download_service.h"
+#include "components/download/public/background_service/test/test_download_service.h"
 
 #include <memory>
 
 #include "base/bind.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "components/download/public/client.h"
-#include "components/download/public/download_metadata.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/download_service.h"
-#include "components/download/public/service_config.h"
-#include "components/download/public/test/empty_logger.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/download_metadata.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/download_service.h"
+#include "components/download/public/background_service/service_config.h"
+#include "components/download/public/background_service/test/empty_logger.h"
 
 namespace download {
 namespace test {
diff --git a/components/download/public/test/test_download_service.h b/components/download/public/background_service/test/test_download_service.h
similarity index 82%
rename from components/download/public/test/test_download_service.h
rename to components/download/public/background_service/test/test_download_service.h
index 2143c2d..0c6002c0 100644
--- a/components/download/public/test/test_download_service.h
+++ b/components/download/public/background_service/test/test_download_service.h
@@ -2,15 +2,15 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef COMPONENTS_DOWNLOAD_PUBLIC_TEST_TEST_DOWNLOAD_SERVICE_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_TEST_TEST_DOWNLOAD_SERVICE_H_
+#ifndef COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_TEST_DOWNLOAD_SERVICE_H_
+#define COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_TEST_DOWNLOAD_SERVICE_H_
 
 #include <list>
 
 #include "base/optional.h"
-#include "components/download/public/client.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/client.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/download_service.h"
 
 namespace download {
 
@@ -78,4 +78,4 @@
 }  // namespace test
 }  // namespace download
 
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_TEST_TEST_DOWNLOAD_SERVICE_H_
+#endif  // COMPONENTS_DOWNLOAD_PUBLIC_BACKGROUND_SERVICE_TEST_TEST_DOWNLOAD_SERVICE_H_
diff --git a/components/download/public/features.h b/components/download/public/features.h
deleted file mode 100644
index 1311719..0000000
--- a/components/download/public/features.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// 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 COMPONENTS_DOWNLOAD_PUBLIC_FEATURES_H_
-#define COMPONENTS_DOWNLOAD_PUBLIC_FEATURES_H_
-
-#include "base/feature_list.h"
-
-namespace download {
-
-extern const base::Feature kDownloadServiceFeature;
-
-}  // namespace download
-
-#endif  // COMPONENTS_DOWNLOAD_PUBLIC_FEATURES_H_
diff --git a/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc b/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
index 8f50f18e..62d3fe8 100644
--- a/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
+++ b/components/offline_items_collection/core/android/offline_content_aggregator_bridge.cc
@@ -4,6 +4,8 @@
 
 #include "components/offline_items_collection/core/android/offline_content_aggregator_bridge.h"
 
+#include <memory>
+
 #include "base/android/callback_android.h"
 #include "base/android/jni_string.h"
 #include "base/bind.h"
@@ -81,7 +83,7 @@
 
 OfflineContentAggregatorBridge::OfflineContentAggregatorBridge(
     OfflineContentAggregator* aggregator)
-    : provider_(base::MakeUnique<ThrottledOfflineContentProvider>(aggregator)) {
+    : provider_(std::make_unique<ThrottledOfflineContentProvider>(aggregator)) {
   JNIEnv* env = AttachCurrentThread();
   java_ref_.Reset(Java_OfflineContentAggregatorBridge_create(
       env, reinterpret_cast<intptr_t>(this)));
diff --git a/components/offline_pages/core/model/add_page_to_download_manager_task_unittest.cc b/components/offline_pages/core/model/add_page_to_download_manager_task_unittest.cc
index 5d9ed71..63677b2 100644
--- a/components/offline_pages/core/model/add_page_to_download_manager_task_unittest.cc
+++ b/components/offline_pages/core/model/add_page_to_download_manager_task_unittest.cc
@@ -4,7 +4,8 @@
 
 #include "components/offline_pages/core/model/add_page_to_download_manager_task.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/test/test_mock_time_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "components/offline_pages/core/model/offline_page_item_generator.h"
@@ -102,7 +103,7 @@
   OfflinePageItem page = generator()->CreateItem();
   store_test_util()->InsertItem(page);
 
-  auto task = base::MakeUnique<AddPageToDownloadManagerTask>(
+  auto task = std::make_unique<AddPageToDownloadManagerTask>(
       store(), download_manager(), page.offline_id, kTitle, kDescription, kPath,
       kTestLength, kUri, kReferer);
   SetTaskCompletionCallbackForTesting(task.get());
@@ -133,7 +134,7 @@
   OfflinePageItem page = generator()->CreateItem();
   store_test_util()->InsertItem(page);
 
-  auto task = base::MakeUnique<AddPageToDownloadManagerTask>(
+  auto task = std::make_unique<AddPageToDownloadManagerTask>(
       store(), download_manager(), page.offline_id, kTitle, kDescription, kPath,
       kTestLength, kUri, kReferer);
   SetTaskCompletionCallbackForTesting(task.get());
@@ -157,7 +158,7 @@
   page.system_download_id = kDefaultDownloadId;
   store_test_util()->InsertItem(page);
 
-  auto task = base::MakeUnique<AddPageToDownloadManagerTask>(
+  auto task = std::make_unique<AddPageToDownloadManagerTask>(
       store(), download_manager(), page.offline_id, kTitle, kDescription, kPath,
       kTestLength, kUri, kReferer);
   SetTaskCompletionCallbackForTesting(task.get());
diff --git a/components/offline_pages/core/prefetch/BUILD.gn b/components/offline_pages/core/prefetch/BUILD.gn
index 3fbf1291..3955c5d 100644
--- a/components/offline_pages/core/prefetch/BUILD.gn
+++ b/components/offline_pages/core/prefetch/BUILD.gn
@@ -92,7 +92,7 @@
 
   deps = [
     "//base",
-    "//components/download/public",
+    "//components/download/public/background_service:public",
     "//components/gcm_driver",
     "//components/gcm_driver/common",
     "//components/keyed_service/core",
@@ -139,7 +139,7 @@
   deps = [
     ":prefetch",
     "//base",
-    "//components/download/public",
+    "//components/download/public/background_service:public",
     "//components/gcm_driver/instance_id",
     "//components/keyed_service/core",
     "//components/offline_pages/core",
@@ -203,8 +203,8 @@
     ":prefetch",
     ":test_support",
     "//base",
-    "//components/download/public",
-    "//components/download/public/test:test_support",
+    "//components/download/public/background_service:public",
+    "//components/download/public/background_service/test:test_support",
     "//components/gcm_driver/instance_id",
     "//components/offline_pages/core",
     "//components/offline_pages/core:switches",
diff --git a/components/offline_pages/core/prefetch/prefetch_download_flow_unittest.cc b/components/offline_pages/core/prefetch/prefetch_download_flow_unittest.cc
index fe281d7..f86a9c8 100644
--- a/components/offline_pages/core/prefetch/prefetch_download_flow_unittest.cc
+++ b/components/offline_pages/core/prefetch/prefetch_download_flow_unittest.cc
@@ -8,7 +8,7 @@
 #include <vector>
 
 #include "base/test/scoped_feature_list.h"
-#include "components/download/public/test/test_download_service.h"
+#include "components/download/public/background_service/test/test_download_service.h"
 #include "components/offline_pages/core/offline_page_feature.h"
 #include "components/offline_pages/core/prefetch/prefetch_background_task.h"
 #include "components/offline_pages/core/prefetch/prefetch_dispatcher_impl.h"
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader_impl.cc b/components/offline_pages/core/prefetch/prefetch_downloader_impl.cc
index 06bf356..fe3fada 100644
--- a/components/offline_pages/core/prefetch/prefetch_downloader_impl.cc
+++ b/components/offline_pages/core/prefetch/prefetch_downloader_impl.cc
@@ -9,8 +9,8 @@
 #include "base/strings/string_util.h"
 #include "base/time/default_clock.h"
 #include "base/time/time.h"
-#include "components/download/public/download_params.h"
-#include "components/download/public/download_service.h"
+#include "components/download/public/background_service/download_params.h"
+#include "components/download/public/background_service/download_service.h"
 #include "components/offline_pages/core/offline_event_logger.h"
 #include "components/offline_pages/core/offline_page_feature.h"
 #include "components/offline_pages/core/prefetch/prefetch_dispatcher.h"
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader_impl.h b/components/offline_pages/core/prefetch/prefetch_downloader_impl.h
index 4f920cc..0932c47 100644
--- a/components/offline_pages/core/prefetch/prefetch_downloader_impl.h
+++ b/components/offline_pages/core/prefetch/prefetch_downloader_impl.h
@@ -14,7 +14,7 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/time/clock.h"
-#include "components/download/public/download_params.h"
+#include "components/download/public/background_service/download_params.h"
 #include "components/offline_pages/core/prefetch/prefetch_downloader.h"
 #include "components/offline_pages/core/prefetch/prefetch_types.h"
 #include "components/version_info/channel.h"
diff --git a/components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc b/components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc
index 963464c..f42ec405 100644
--- a/components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc
+++ b/components/offline_pages/core/prefetch/prefetch_downloader_impl_unittest.cc
@@ -10,7 +10,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/test/simple_test_clock.h"
 #include "base/time/time.h"
-#include "components/download/public/test/test_download_service.h"
+#include "components/download/public/background_service/test/test_download_service.h"
 #include "components/offline_pages/core/client_namespace_constants.h"
 #include "components/offline_pages/core/prefetch/prefetch_request_test_base.h"
 #include "components/offline_pages/core/prefetch/prefetch_server_urls.h"
diff --git a/components/offline_pages/core/prefetch/test_download_client.h b/components/offline_pages/core/prefetch/test_download_client.h
index b91c0d7d..749651a 100644
--- a/components/offline_pages/core/prefetch/test_download_client.h
+++ b/components/offline_pages/core/prefetch/test_download_client.h
@@ -6,7 +6,7 @@
 #define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_TEST_DOWNLOAD_CLIENT_H_
 
 #include "base/macros.h"
-#include "components/download/public/test/empty_client.h"
+#include "components/download/public/background_service/test/empty_client.h"
 
 namespace offline_pages {
 
diff --git a/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm b/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm
index 6a68d6e..95a3d1ec 100644
--- a/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm
+++ b/components/open_from_clipboard/clipboard_recent_content_ios_unittest.mm
@@ -9,7 +9,6 @@
 
 #include <memory>
 
-#include "base/memory/ptr_util.h"
 #include "base/strings/sys_string_conversions.h"
 #import "components/open_from_clipboard/clipboard_recent_content_impl_ios.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -119,7 +118,7 @@
                        uptime:time_delta.InSecondsF()];
 
     clipboard_content_ =
-        base::MakeUnique<ClipboardRecentContentIOSWithFakeUptime>(
+        std::make_unique<ClipboardRecentContentIOSWithFakeUptime>(
             clipboard_content_implementation_);
   }
 
diff --git a/components/os_crypt/os_crypt_mocker_linux.cc b/components/os_crypt/os_crypt_mocker_linux.cc
index 7a8fd0e..37d5cf7c 100644
--- a/components/os_crypt/os_crypt_mocker_linux.cc
+++ b/components/os_crypt/os_crypt_mocker_linux.cc
@@ -8,7 +8,6 @@
 
 #include "base/base64.h"
 #include "base/lazy_instance.h"
-#include "base/memory/ptr_util.h"
 #include "base/rand_util.h"
 #include "components/os_crypt/key_storage_config_linux.h"
 #include "components/os_crypt/os_crypt.h"
@@ -16,7 +15,7 @@
 namespace {
 
 std::unique_ptr<KeyStorageLinux> CreateNewMock() {
-  return base::MakeUnique<OSCryptMockerLinux>();
+  return std::make_unique<OSCryptMockerLinux>();
 }
 
 }
@@ -33,7 +32,7 @@
 void OSCryptMockerLinux::SetUp() {
   UseMockKeyStorageForTesting(
       &CreateNewMock, nullptr /* get the key from the provider above */);
-  OSCrypt::SetConfig(base::MakeUnique<os_crypt::Config>());
+  OSCrypt::SetConfig(std::make_unique<os_crypt::Config>());
 }
 
 // static
diff --git a/components/password_manager/core/browser/password_manager_metrics_recorder.cc b/components/password_manager/core/browser/password_manager_metrics_recorder.cc
index 4ba9a27e..db3ba69 100644
--- a/components/password_manager/core/browser/password_manager_metrics_recorder.cc
+++ b/components/password_manager/core/browser/password_manager_metrics_recorder.cc
@@ -4,6 +4,8 @@
 
 #include "components/password_manager/core/browser/password_manager_metrics_recorder.h"
 
+#include <memory>
+
 #include "base/metrics/histogram_macros.h"
 #include "components/autofill/core/common/save_password_progress_logger.h"
 #include "components/password_manager/core/browser/browser_save_password_progress_logger.h"
@@ -21,7 +23,7 @@
     const GURL& main_frame_url)
     : main_frame_url_(main_frame_url),
       ukm_entry_builder_(
-          base::MakeUnique<ukm::builders::PageWithPassword>(source_id)) {}
+          std::make_unique<ukm::builders::PageWithPassword>(source_id)) {}
 
 PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder(
     PasswordManagerMetricsRecorder&& that) noexcept = default;
diff --git a/components/payments/core/payment_request_data_util.cc b/components/payments/core/payment_request_data_util.cc
index 7b502f4..1909291 100644
--- a/components/payments/core/payment_request_data_util.cc
+++ b/components/payments/core/payment_request_data_util.cc
@@ -4,6 +4,8 @@
 
 #include "components/payments/core/payment_request_data_util.h"
 
+#include <memory>
+
 #include "base/stl_util.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
@@ -74,7 +76,7 @@
     const autofill::AutofillProfile& billing_profile,
     const std::string& app_locale) {
   std::unique_ptr<BasicCardResponse> response =
-      base::MakeUnique<BasicCardResponse>();
+      std::make_unique<BasicCardResponse>();
   response->cardholder_name = card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL);
   response->card_number = card.GetRawInfo(autofill::CREDIT_CARD_NUMBER);
   response->expiry_month = card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH);
diff --git a/components/pdf/renderer/pepper_pdf_host.cc b/components/pdf/renderer/pepper_pdf_host.cc
index 4610a20..dae7331 100644
--- a/components/pdf/renderer/pepper_pdf_host.cc
+++ b/components/pdf/renderer/pepper_pdf_host.cc
@@ -4,8 +4,9 @@
 
 #include "components/pdf/renderer/pepper_pdf_host.h"
 
+#include <memory>
+
 #include "base/lazy_instance.h"
-#include "base/memory/ptr_util.h"
 #include "components/pdf/renderer/pdf_accessibility_tree.h"
 #include "content/public/common/referrer.h"
 #include "content/public/renderer/pepper_plugin_instance.h"
@@ -264,7 +265,7 @@
 void PepperPDFHost::CreatePdfAccessibilityTreeIfNeeded() {
   if (!pdf_accessibility_tree_) {
     pdf_accessibility_tree_ =
-        base::MakeUnique<PdfAccessibilityTree>(host_, pp_instance());
+        std::make_unique<PdfAccessibilityTree>(host_, pp_instance());
   }
 }
 
diff --git a/components/physical_web/data_source/fake_physical_web_data_source.cc b/components/physical_web/data_source/fake_physical_web_data_source.cc
index 727339a..2447a4b 100644
--- a/components/physical_web/data_source/fake_physical_web_data_source.cc
+++ b/components/physical_web/data_source/fake_physical_web_data_source.cc
@@ -4,6 +4,8 @@
 
 #include "components/physical_web/data_source/fake_physical_web_data_source.h"
 
+#include <memory>
+
 #include "base/strings/string_number_conversions.h"
 #include "components/physical_web/data_source/physical_web_listener.h"
 #include "url/gurl.h"
@@ -18,7 +20,7 @@
     const std::string& title,
     const std::string& description,
     const std::string& scanned_url) {
-  auto page = base::MakeUnique<Metadata>();
+  auto page = std::make_unique<Metadata>();
   page->resolved_url = GURL(resolved_url);
   page->distance_estimate = distance_estimate;
   page->group_id = group_id;
@@ -43,7 +45,7 @@
     const std::vector<int>& ids) {
   int distance = 1;
   int timestamp = static_cast<int>(ids.size());
-  auto list = base::MakeUnique<MetadataList>();
+  auto list = std::make_unique<MetadataList>();
   for (int id : ids) {
     std::unique_ptr<Metadata> page =
         CreateDummyPhysicalWebPage(id, distance, timestamp);
@@ -67,7 +69,7 @@
 }
 
 std::unique_ptr<MetadataList> FakePhysicalWebDataSource::GetMetadataList() {
-  return base::MakeUnique<MetadataList>(*metadata_list_.get());
+  return std::make_unique<MetadataList>(*metadata_list_.get());
 }
 
 bool FakePhysicalWebDataSource::HasUnresolvedDiscoveries() {
diff --git a/components/physical_web/webui/physical_web_base_message_handler.cc b/components/physical_web/webui/physical_web_base_message_handler.cc
index f68cfb0..17b089b 100644
--- a/components/physical_web/webui/physical_web_base_message_handler.cc
+++ b/components/physical_web/webui/physical_web_base_message_handler.cc
@@ -4,10 +4,10 @@
 
 #include "components/physical_web/webui/physical_web_base_message_handler.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/metrics/user_metrics.h"
 #include "components/physical_web/data_source/physical_web_data_source.h"
@@ -70,11 +70,11 @@
     }
   }
 
-  auto metadata = base::MakeUnique<base::ListValue>();
+  auto metadata = std::make_unique<base::ListValue>();
   int index = 0;
   for (const auto& group_id : ordered_group_ids_) {
     auto metadata_list_item = metadata_map_[group_id];
-    auto metadata_item = base::MakeUnique<base::DictionaryValue>();
+    auto metadata_item = std::make_unique<base::DictionaryValue>();
     metadata_item->SetString(physical_web_ui::kResolvedUrl,
                              metadata_list_item.resolved_url.spec());
     metadata_item->SetString(physical_web_ui::kPageInfoIcon,
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 74dbf87..e05aa79 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -8,6 +8,7 @@
 #include <stdint.h>
 
 #include <algorithm>
+#include <memory>
 #include <string>
 #include <utility>
 
@@ -16,7 +17,6 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/process/process_handle.h"
 #include "base/single_thread_task_runner.h"
@@ -615,7 +615,7 @@
   // Load page with script to avoid async operations.
   ExecuteScript(frame, kPageLoadScriptFormat, html);
 
-  auto options = base::MakeUnique<base::DictionaryValue>();
+  auto options = std::make_unique<base::DictionaryValue>();
   options->SetDouble(kSettingHeaderFooterDate, base::Time::Now().ToJsTime());
   options->SetDouble("width", page_size.width);
   options->SetDouble("height", page_size.height);
@@ -1195,7 +1195,7 @@
   }
 
   const PrintMsg_Print_Params& print_params = print_pages_params_->params;
-  prep_frame_view_ = base::MakeUnique<PrepareFrameAndViewForPrint>(
+  prep_frame_view_ = std::make_unique<PrepareFrameAndViewForPrint>(
       print_params, print_preview_context_.source_frame(),
       print_preview_context_.source_node(), ignore_css_margins_);
   prep_frame_view_->CopySelectionIfNeeded(
@@ -1330,7 +1330,7 @@
   PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
   if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
     draft_metafile =
-        base::MakeUnique<PdfMetafileSkia>(print_params.printed_doc_type);
+        std::make_unique<PdfMetafileSkia>(print_params.printed_doc_type);
     initial_render_metafile = draft_metafile.get();
   }
 
@@ -1841,7 +1841,7 @@
 
   print_pages_params_.reset();
 
-  auto msg = base::MakeUnique<PrintHostMsg_ScriptedPrint>(routing_id(), params,
+  auto msg = std::make_unique<PrintHostMsg_ScriptedPrint>(routing_id(), params,
                                                           print_settings);
   msg->EnableMessagePumping();
   Send(msg.release());
@@ -1856,7 +1856,7 @@
 
   const PrintMsg_PrintPages_Params& params = *print_pages_params_;
   const PrintMsg_Print_Params& print_params = params.params;
-  prep_frame_view_ = base::MakeUnique<PrepareFrameAndViewForPrint>(
+  prep_frame_view_ = std::make_unique<PrepareFrameAndViewForPrint>(
       print_params, frame, node, ignore_css_margins_);
   DCHECK(!print_pages_params_->params.selection_only ||
          print_pages_params_->pages.empty());
@@ -2013,7 +2013,7 @@
             base::Bind(&PrintRenderFrameHelper::ShowScriptedPrintPreview,
                        weak_ptr_factory_.GetWeakPtr()));
       }
-      auto msg = base::MakeUnique<PrintHostMsg_SetupScriptedPrintPreview>(
+      auto msg = std::make_unique<PrintHostMsg_SetupScriptedPrintPreview>(
           routing_id());
       msg->EnableMessagePumping();
       auto self = weak_ptr_factory_.GetWeakPtr();
@@ -2165,7 +2165,7 @@
     return false;
   }
 
-  metafile_ = base::MakeUnique<PdfMetafileSkia>(doc_type);
+  metafile_ = std::make_unique<PdfMetafileSkia>(doc_type);
   CHECK(metafile_->Init());
 
   current_page_index_ = 0;
@@ -2353,7 +2353,7 @@
 
 void PrintRenderFrameHelper::SetPrintPagesParams(
     const PrintMsg_PrintPages_Params& settings) {
-  print_pages_params_ = base::MakeUnique<PrintMsg_PrintPages_Params>(settings);
+  print_pages_params_ = std::make_unique<PrintMsg_PrintPages_Params>(settings);
   Send(new PrintHostMsg_DidGetDocumentCookie(routing_id(),
                                              settings.params.document_cookie));
 }
diff --git a/components/printing/renderer/print_render_frame_helper_mac.mm b/components/printing/renderer/print_render_frame_helper_mac.mm
index 8cc4806..b285f8c 100644
--- a/components/printing/renderer/print_render_frame_helper_mac.mm
+++ b/components/printing/renderer/print_render_frame_helper_mac.mm
@@ -6,6 +6,8 @@
 
 #import <AppKit/AppKit.h>
 
+#include <memory>
+
 #include "base/logging.h"
 #include "base/mac/scoped_nsautorelease_pool.h"
 #include "base/metrics/histogram.h"
@@ -30,7 +32,7 @@
 
   if (render_to_draft) {
     draft_metafile =
-        base::MakeUnique<PdfMetafileSkia>(print_params.printed_doc_type);
+        std::make_unique<PdfMetafileSkia>(print_params.printed_doc_type);
     CHECK(draft_metafile->Init());
     initial_render_metafile = draft_metafile.get();
   }
diff --git a/components/printing/service/pdf_compositor_service.cc b/components/printing/service/pdf_compositor_service.cc
index b9098ce6..aa575e4 100644
--- a/components/printing/service/pdf_compositor_service.cc
+++ b/components/printing/service/pdf_compositor_service.cc
@@ -6,9 +6,10 @@
 
 #include <utility>
 
+#include <memory>
+
 #include "base/lazy_instance.h"
 #include "base/memory/discardable_memory.h"
-#include "base/memory/ptr_util.h"
 #include "build/build_config.h"
 #include "components/printing/service/pdf_compositor_impl.h"
 #include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
@@ -28,7 +29,7 @@
     const std::string& creator,
     service_manager::ServiceContextRefFactory* ref_factory,
     printing::mojom::PdfCompositorRequest request) {
-  mojo::MakeStrongBinding(base::MakeUnique<printing::PdfCompositorImpl>(
+  mojo::MakeStrongBinding(std::make_unique<printing::PdfCompositorImpl>(
                               creator, ref_factory->CreateRef()),
                           std::move(request));
 }
@@ -52,7 +53,7 @@
   // Initialize direct write font proxy so skia can use it.
   content::InitializeDWriteFontProxy();
 #endif
-  return base::MakeUnique<printing::PdfCompositorService>(creator);
+  return std::make_unique<printing::PdfCompositorService>(creator);
 }
 
 void PdfCompositorService::PrepareToStart() {
@@ -60,7 +61,7 @@
   discardable_memory::mojom::DiscardableSharedMemoryManagerPtr manager_ptr;
   context()->connector()->BindInterface(content::mojom::kBrowserServiceName,
                                         &manager_ptr);
-  discardable_shared_memory_manager_ = base::MakeUnique<
+  discardable_shared_memory_manager_ = std::make_unique<
       discardable_memory::ClientDiscardableSharedMemoryManager>(
       std::move(manager_ptr), content::UtilityThread::Get()->GetIOTaskRunner());
   DCHECK(discardable_shared_memory_manager_);
@@ -71,7 +72,7 @@
 void PdfCompositorService::OnStart() {
   PrepareToStart();
 
-  ref_factory_ = base::MakeUnique<service_manager::ServiceContextRefFactory>(
+  ref_factory_ = std::make_unique<service_manager::ServiceContextRefFactory>(
       base::Bind(&service_manager::ServiceContext::RequestQuit,
                  base::Unretained(context())));
   registry_.AddInterface(
diff --git a/components/printing/test/print_test_content_renderer_client.cc b/components/printing/test/print_test_content_renderer_client.cc
index 4a3cef9..e9c1bcb 100644
--- a/components/printing/test/print_test_content_renderer_client.cc
+++ b/components/printing/test/print_test_content_renderer_client.cc
@@ -4,7 +4,8 @@
 
 #include "components/printing/test/print_test_content_renderer_client.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "components/printing/renderer/print_render_frame_helper.h"
 #include "printing/features/features.h"
 #include "third_party/WebKit/public/web/WebElement.h"
@@ -44,7 +45,7 @@
 void PrintTestContentRendererClient::RenderFrameCreated(
     content::RenderFrame* render_frame) {
   new PrintRenderFrameHelper(
-      render_frame, base::MakeUnique<PrintRenderFrameHelperDelegate>());
+      render_frame, std::make_unique<PrintRenderFrameHelperDelegate>());
 }
 
 }  // namespace printing
diff --git a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
index e2142b1..6ed0520 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder.cc
@@ -12,7 +12,6 @@
 #include "base/bind_helpers.h"
 #include "base/location.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "components/cryptauth/background_eid_generator.h"
@@ -43,7 +42,7 @@
     : BluetoothLowEnergyConnectionFinder(
           remote_device,
           kBLEGattServiceUUID,
-          base::MakeUnique<cryptauth::BackgroundEidGenerator>()) {}
+          std::make_unique<cryptauth::BackgroundEidGenerator>()) {}
 
 BluetoothLowEnergyConnectionFinder::BluetoothLowEnergyConnectionFinder(
     const cryptauth::RemoteDevice remote_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 33cef50..8ce591b2f3 100644
--- a/components/proximity_auth/bluetooth_low_energy_connection_finder_unittest.cc
+++ b/components/proximity_auth/bluetooth_low_energy_connection_finder_unittest.cc
@@ -76,7 +76,7 @@
       : BluetoothLowEnergyConnectionFinder(
             cryptauth::CreateLERemoteDeviceForTest(),
             kBLEGattServiceUUID,
-            base::MakeUnique<FakeEidGenerator>(this)) {}
+            std::make_unique<FakeEidGenerator>(this)) {}
 
   ~MockBluetoothLowEnergyConnectionFinder() override {}
 
diff --git a/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc
index 18fce7f1..f9547b4a 100644
--- a/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc
+++ b/components/proximity_auth/bluetooth_low_energy_setup_connection_finder.cc
@@ -6,6 +6,8 @@
 
 #include <string>
 
+#include <memory>
+
 #include "base/memory/ptr_util.h"
 #include "components/cryptauth/ble/bluetooth_low_energy_weave_client_connection.h"
 #include "components/cryptauth/connection.h"
@@ -23,7 +25,7 @@
     : BluetoothLowEnergyConnectionFinder(
           cryptauth::RemoteDevice(),
           remote_service_uuid,
-          base::MakeUnique<cryptauth::BackgroundEidGenerator>()),
+          std::make_unique<cryptauth::BackgroundEidGenerator>()),
       remote_service_uuid_(device::BluetoothUUID(remote_service_uuid)) {}
 
 bool BluetoothLowEnergySetupConnectionFinder::IsRightDevice(
diff --git a/components/proximity_auth/messenger_impl.cc b/components/proximity_auth/messenger_impl.cc
index a4d88a2f..1ec8b1e 100644
--- a/components/proximity_auth/messenger_impl.cc
+++ b/components/proximity_auth/messenger_impl.cc
@@ -6,12 +6,13 @@
 
 #include <utility>
 
+#include <memory>
+
 #include "base/base64url.h"
 #include "base/bind.h"
 #include "base/json/json_reader.h"
 #include "base/json/json_writer.h"
 #include "base/location.h"
-#include "base/memory/ptr_util.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/values.h"
 #include "components/cryptauth/connection.h"
@@ -167,7 +168,7 @@
 }
 
 void MessengerImpl::OnMessageEncoded(const std::string& encoded_message) {
-  connection_->SendMessage(base::MakeUnique<cryptauth::WireMessage>(
+  connection_->SendMessage(std::make_unique<cryptauth::WireMessage>(
       encoded_message, std::string(kEasyUnlockFeatureName)));
 }
 
diff --git a/components/proximity_auth/messenger_impl_unittest.cc b/components/proximity_auth/messenger_impl_unittest.cc
index 4253e1d..3315e47 100644
--- a/components/proximity_auth/messenger_impl_unittest.cc
+++ b/components/proximity_auth/messenger_impl_unittest.cc
@@ -8,7 +8,6 @@
 
 #include "base/callback.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "components/cryptauth/connection.h"
 #include "components/cryptauth/cryptauth_test_util.h"
 #include "components/cryptauth/fake_connection.h"
@@ -64,12 +63,12 @@
 class TestMessenger : public MessengerImpl {
  public:
   TestMessenger()
-      : MessengerImpl(base::MakeUnique<cryptauth::FakeConnection>(
+      : MessengerImpl(std::make_unique<cryptauth::FakeConnection>(
                           cryptauth::CreateClassicRemoteDeviceForTest()),
-                      base::MakeUnique<cryptauth::FakeSecureContext>()) {}
+                      std::make_unique<cryptauth::FakeSecureContext>()) {}
   TestMessenger(std::unique_ptr<cryptauth::Connection> connection)
       : MessengerImpl(std::move(connection),
-                      base::MakeUnique<cryptauth::FakeSecureContext>()) {}
+                      std::make_unique<cryptauth::FakeSecureContext>()) {}
   ~TestMessenger() override {}
 
   // Simple getters for the mock objects owned by |this| messenger.
diff --git a/components/proximity_auth/promotion_manager_unittests.cc b/components/proximity_auth/promotion_manager_unittests.cc
index cd97b66..f47c676 100644
--- a/components/proximity_auth/promotion_manager_unittests.cc
+++ b/components/proximity_auth/promotion_manager_unittests.cc
@@ -6,8 +6,9 @@
 
 #include <string>
 
+#include <memory>
+
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/weak_ptr.h"
 #include "base/test/simple_test_clock.h"
 #include "base/test/test_simple_task_runner.h"
@@ -94,7 +95,7 @@
                                  task_runner_)) {
     client_factory_->AddObserver(this);
     local_device_data_provider_->SetPublicKey(
-        base::MakeUnique<std::string>(kPublicKey));
+        std::make_unique<std::string>(kPublicKey));
 
     unlock_key_.set_public_key(kPublicKey1);
     unlock_key_.set_friendly_device_name(kDeviceName1);
diff --git a/components/proximity_auth/remote_device_life_cycle_impl.cc b/components/proximity_auth/remote_device_life_cycle_impl.cc
index 1904701..c70228ea 100644
--- a/components/proximity_auth/remote_device_life_cycle_impl.cc
+++ b/components/proximity_auth/remote_device_life_cycle_impl.cc
@@ -5,11 +5,11 @@
 #include "components/proximity_auth/remote_device_life_cycle_impl.h"
 
 #include <utility>
+#include <memory>
 
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/location.h"
-#include "base/memory/ptr_util.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/default_tick_clock.h"
 #include "components/cryptauth/connection_finder.h"
@@ -87,9 +87,9 @@
 RemoteDeviceLifeCycleImpl::CreateConnectionFinder() {
   if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
           proximity_auth::switches::kDisableBluetoothLowEnergyDiscovery)) {
-    return base::MakeUnique<BluetoothLowEnergyConnectionFinder>(remote_device_);
+    return std::make_unique<BluetoothLowEnergyConnectionFinder>(remote_device_);
   } else {
-    return base::MakeUnique<BluetoothConnectionFinder>(
+    return std::make_unique<BluetoothConnectionFinder>(
         remote_device_, device::BluetoothUUID(kClassicBluetoothServiceUUID),
         base::TimeDelta::FromSeconds(3));
   }
@@ -97,7 +97,7 @@
 
 std::unique_ptr<cryptauth::Authenticator>
 RemoteDeviceLifeCycleImpl::CreateAuthenticator() {
-  return base::MakeUnique<cryptauth::DeviceToDeviceAuthenticator>(
+  return std::make_unique<cryptauth::DeviceToDeviceAuthenticator>(
       connection_.get(), remote_device_.user_id,
       proximity_auth_client_->CreateSecureMessageDelegate());
 }
diff --git a/components/proximity_auth/screenlock_bridge.cc b/components/proximity_auth/screenlock_bridge.cc
index 4324dd7..ecc1c0b96 100644
--- a/components/proximity_auth/screenlock_bridge.cc
+++ b/components/proximity_auth/screenlock_bridge.cc
@@ -6,7 +6,8 @@
 
 #include <utility>
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/strings/string16.h"
 #include "build/build_config.h"
 #include "components/proximity_auth/logging/logging.h"
@@ -66,11 +67,11 @@
 
 std::unique_ptr<base::DictionaryValue>
 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const {
-  auto result = base::MakeUnique<base::DictionaryValue>();
+  auto result = std::make_unique<base::DictionaryValue>();
   result->SetString("id", GetIDString());
 
   if (!tooltip_.empty()) {
-    auto tooltip_options = base::MakeUnique<base::DictionaryValue>();
+    auto tooltip_options = std::make_unique<base::DictionaryValue>();
     tooltip_options->SetString("text", tooltip_);
     tooltip_options->SetBoolean("autoshow", autoshow_tooltip_);
     result->Set("tooltip", std::move(tooltip_options));
diff --git a/components/proximity_auth/unlock_manager_impl.cc b/components/proximity_auth/unlock_manager_impl.cc
index e0f22376..6cc6db5 100644
--- a/components/proximity_auth/unlock_manager_impl.cc
+++ b/components/proximity_auth/unlock_manager_impl.cc
@@ -4,10 +4,11 @@
 
 #include "components/proximity_auth/unlock_manager_impl.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/location.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/default_tick_clock.h"
 #include "base/time/time.h"
@@ -333,7 +334,7 @@
 std::unique_ptr<ProximityMonitor> UnlockManagerImpl::CreateProximityMonitor(
     cryptauth::Connection* connection,
     ProximityAuthPrefManager* pref_manager) {
-  return base::MakeUnique<ProximityMonitorImpl>(connection, pref_manager);
+  return std::make_unique<ProximityMonitorImpl>(connection, pref_manager);
 }
 
 void UnlockManagerImpl::SendSignInChallenge() {
diff --git a/components/proximity_auth/webui/proximity_auth_ui.cc b/components/proximity_auth/webui/proximity_auth_ui.cc
index 5b7b7b3f..2f2be2e 100644
--- a/components/proximity_auth/webui/proximity_auth_ui.cc
+++ b/components/proximity_auth/webui/proximity_auth_ui.cc
@@ -4,7 +4,8 @@
 
 #include "components/proximity_auth/webui/proximity_auth_ui.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "components/grit/components_resources.h"
 #include "components/proximity_auth/webui/proximity_auth_webui_handler.h"
 #include "components/proximity_auth/webui/url_constants.h"
@@ -38,7 +39,7 @@
       web_ui->GetWebContents()->GetBrowserContext();
   content::WebUIDataSource::Add(browser_context, source);
   web_ui->AddMessageHandler(
-      base::MakeUnique<ProximityAuthWebUIHandler>(delegate));
+      std::make_unique<ProximityAuthWebUIHandler>(delegate));
 }
 
 ProximityAuthUI::~ProximityAuthUI() {
diff --git a/components/proximity_auth/webui/proximity_auth_webui_handler.cc b/components/proximity_auth/webui/proximity_auth_webui_handler.cc
index e492dc8..c46957e 100644
--- a/components/proximity_auth/webui/proximity_auth_webui_handler.cc
+++ b/components/proximity_auth/webui/proximity_auth_webui_handler.cc
@@ -5,12 +5,12 @@
 #include "components/proximity_auth/webui/proximity_auth_webui_handler.h"
 
 #include <algorithm>
+#include <memory>
 #include <utility>
 
 #include "base/base64url.h"
 #include "base/bind.h"
 #include "base/i18n/time_formatting.h"
-#include "base/memory/ptr_util.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/default_clock.h"
 #include "base/time/default_tick_clock.h"
@@ -450,7 +450,7 @@
                         base::Base64UrlEncodePolicy::INCLUDE_PADDING,
                         &device_id);
 
-  return base::MakeUnique<base::Value>(
+  return std::make_unique<base::Value>(
       cryptauth::RemoteDevice::TruncateDeviceIdForLogs(device_id));
 }
 
@@ -459,7 +459,7 @@
   cryptauth::CryptAuthEnrollmentManager* enrollment_manager =
       proximity_auth_client_->GetCryptAuthEnrollmentManager();
   if (!enrollment_manager)
-    return base::MakeUnique<base::DictionaryValue>();
+    return std::make_unique<base::DictionaryValue>();
 
   return CreateSyncStateDictionary(
       enrollment_manager->GetLastEnrollmentTime().ToJsTime(),
@@ -473,7 +473,7 @@
   cryptauth::CryptAuthDeviceManager* device_manager =
       proximity_auth_client_->GetCryptAuthDeviceManager();
   if (!device_manager)
-    return base::MakeUnique<base::DictionaryValue>();
+    return std::make_unique<base::DictionaryValue>();
 
   return CreateSyncStateDictionary(
       device_manager->GetLastSyncTime().ToJsTime(),
diff --git a/components/proxy_config/ios/proxy_service_factory.cc b/components/proxy_config/ios/proxy_service_factory.cc
index 79ababc..ad272d9 100644
--- a/components/proxy_config/ios/proxy_service_factory.cc
+++ b/components/proxy_config/ios/proxy_service_factory.cc
@@ -6,7 +6,8 @@
 
 #include <utility>
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
 #include "ios/web/public/web_thread.h"
 #include "net/proxy_resolution/proxy_config_service.h"
@@ -26,7 +27,7 @@
 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
     PrefService* browser_state_prefs,
     PrefService* local_state_prefs) {
-  return base::MakeUnique<PrefProxyConfigTrackerImpl>(
+  return std::make_unique<PrefProxyConfigTrackerImpl>(
       browser_state_prefs,
       web::WebThread::GetTaskRunnerForThread(web::WebThread::IO));
 }
@@ -35,7 +36,7 @@
 std::unique_ptr<PrefProxyConfigTracker>
 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
     PrefService* local_state_prefs) {
-  return base::MakeUnique<PrefProxyConfigTrackerImpl>(
+  return std::make_unique<PrefProxyConfigTrackerImpl>(
       local_state_prefs,
       web::WebThread::GetTaskRunnerForThread(web::WebThread::IO));
 }
diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/proxy_config/proxy_config_dictionary.cc
index 230039b..1451425 100644
--- a/components/proxy_config/proxy_config_dictionary.cc
+++ b/components/proxy_config/proxy_config_dictionary.cc
@@ -4,10 +4,10 @@
 
 #include "components/proxy_config/proxy_config_dictionary.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "net/proxy_resolution/proxy_config.h"
 
@@ -133,7 +133,7 @@
     bool pac_mandatory,
     const std::string& proxy_server,
     const std::string& bypass_list) {
-  auto dict = base::MakeUnique<base::DictionaryValue>();
+  auto dict = std::make_unique<base::DictionaryValue>();
   dict->SetString(kProxyMode, ProxyModeToString(mode));
   if (!pac_url.empty()) {
     dict->SetString(kProxyPacUrl, pac_url);
diff --git a/components/query_parser/query_parser.cc b/components/query_parser/query_parser.cc
index c65b06e..b7426eaf 100644
--- a/components/query_parser/query_parser.cc
+++ b/components/query_parser/query_parser.cc
@@ -5,13 +5,13 @@
 #include "components/query_parser/query_parser.h"
 
 #include <algorithm>
+#include <memory>
 
 #include "base/compiler_specific.h"
 #include "base/i18n/break_iterator.h"
 #include "base/i18n/case_conversion.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
 
 namespace query_parser {
@@ -424,7 +424,7 @@
     // or whitespace.
     if (iter.IsWord()) {
       std::unique_ptr<QueryNodeWord> word_node =
-          base::MakeUnique<QueryNodeWord>(iter.GetString(), matching_algorithm);
+          std::make_unique<QueryNodeWord>(iter.GetString(), matching_algorithm);
       if (in_quotes)
         word_node->set_literal(true);
       query_stack.back()->AddChild(std::move(word_node));
@@ -432,7 +432,7 @@
       if (IsQueryQuote(query[iter.prev()])) {
         if (!in_quotes) {
           std::unique_ptr<QueryNodeList> quotes_node =
-              base::MakeUnique<QueryNodePhrase>();
+              std::make_unique<QueryNodePhrase>();
           QueryNodeList* quotes_node_ptr = quotes_node.get();
           query_stack.back()->AddChild(std::move(quotes_node));
           query_stack.push_back(quotes_node_ptr);
diff --git a/components/rappor/rappor_recorder_impl.cc b/components/rappor/rappor_recorder_impl.cc
index 52a28113..1b4634c 100644
--- a/components/rappor/rappor_recorder_impl.cc
+++ b/components/rappor/rappor_recorder_impl.cc
@@ -4,7 +4,8 @@
 
 #include "components/rappor/rappor_recorder_impl.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "components/rappor/public/rappor_utils.h"
 #include "components/rappor/rappor_service_impl.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
@@ -20,7 +21,7 @@
 void RapporRecorderImpl::Create(
     RapporServiceImpl* rappor_service,
     mojom::RapporRecorderRequest request) {
-  mojo::MakeStrongBinding(base::MakeUnique<RapporRecorderImpl>(rappor_service),
+  mojo::MakeStrongBinding(std::make_unique<RapporRecorderImpl>(rappor_service),
                           std::move(request));
 }
 
diff --git a/components/rappor/rappor_service_impl.cc b/components/rappor/rappor_service_impl.cc
index 9e8891a..3632283 100644
--- a/components/rappor/rappor_service_impl.cc
+++ b/components/rappor/rappor_service_impl.cc
@@ -4,9 +4,9 @@
 
 #include "components/rappor/rappor_service_impl.h"
 
+#include <memory>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
 #include "base/metrics/metrics_hashes.h"
 #include "base/time/time.h"
 #include "components/rappor/log_uploader.h"
@@ -64,7 +64,7 @@
   }
   DVLOG(1) << "RapporServiceImpl reporting to " << server_url.spec();
   InitializeInternal(
-      base::MakeUnique<LogUploader>(server_url, kMimeType, request_context),
+      std::make_unique<LogUploader>(server_url, kMimeType, request_context),
       internal::LoadCohort(pref_service_), internal::LoadSecret(pref_service_));
 }
 
diff --git a/components/renderer_context_menu/context_menu_delegate.cc b/components/renderer_context_menu/context_menu_delegate.cc
index c995779..fd6e697 100644
--- a/components/renderer_context_menu/context_menu_delegate.cc
+++ b/components/renderer_context_menu/context_menu_delegate.cc
@@ -4,7 +4,8 @@
 
 #include "components/renderer_context_menu/context_menu_delegate.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "content/public/browser/web_contents.h"
 
 namespace {
@@ -27,7 +28,7 @@
 ContextMenuDelegate::ContextMenuDelegate(content::WebContents* web_contents) {
   web_contents->SetUserData(
       &kMenuDelegateUserDataKey,
-      base::MakeUnique<ContextMenuDelegateUserData>(this));
+      std::make_unique<ContextMenuDelegateUserData>(this));
 }
 
 ContextMenuDelegate::~ContextMenuDelegate() {
diff --git a/components/search_provider_logos/fixed_logo_api.cc b/components/search_provider_logos/fixed_logo_api.cc
index f9a5f5e..c41c8a8 100644
--- a/components/search_provider_logos/fixed_logo_api.cc
+++ b/components/search_provider_logos/fixed_logo_api.cc
@@ -4,7 +4,8 @@
 
 #include "components/search_provider_logos/fixed_logo_api.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/memory/ref_counted_memory.h"
 #include "components/search_provider_logos/logo_common.h"
 #include "url/gurl.h"
@@ -15,7 +16,7 @@
     std::unique_ptr<std::string> response,
     base::Time response_time,
     bool* parsing_failed) {
-  auto logo = base::MakeUnique<EncodedLogo>();
+  auto logo = std::make_unique<EncodedLogo>();
   logo->encoded_image = base::RefCountedString::TakeString(response.get());
 
   // If |can_show_after_expiration| is true, the |expiration_time| has little
diff --git a/components/search_provider_logos/google_logo_api.cc b/components/search_provider_logos/google_logo_api.cc
index 2be8262..ab753b9 100644
--- a/components/search_provider_logos/google_logo_api.cc
+++ b/components/search_provider_logos/google_logo_api.cc
@@ -7,6 +7,7 @@
 #include <stdint.h>
 
 #include <algorithm>
+#include <memory>
 
 #include "base/base64.h"
 #include "base/bind.h"
@@ -14,7 +15,6 @@
 #include "base/command_line.h"
 #include "base/feature_list.h"
 #include "base/json/json_reader.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/memory/ref_counted_memory.h"
 #include "base/strings/string_piece.h"
@@ -172,7 +172,7 @@
     return nullptr;
   }
 
-  auto logo = base::MakeUnique<EncodedLogo>();
+  auto logo = std::make_unique<EncodedLogo>();
 
   std::string doodle_type;
   logo->metadata.type = LogoType::SIMPLE;
diff --git a/components/search_provider_logos/logo_cache.cc b/components/search_provider_logos/logo_cache.cc
index e4f0af64..7336f0f4 100644
--- a/components/search_provider_logos/logo_cache.cc
+++ b/components/search_provider_logos/logo_cache.cc
@@ -7,12 +7,12 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <memory>
 #include <utility>
 
 #include "base/files/file_util.h"
 #include "base/json/json_reader.h"
 #include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
 
@@ -105,7 +105,7 @@
   DCHECK(metadata_);
   DCHECK_EQ(metadata_->fingerprint, metadata.fingerprint);
 
-  UpdateMetadata(base::MakeUnique<LogoMetadata>(metadata));
+  UpdateMetadata(std::make_unique<LogoMetadata>(metadata));
   WriteMetadata();
 }
 
@@ -119,7 +119,7 @@
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   std::unique_ptr<LogoMetadata> metadata;
   if (logo) {
-    metadata = base::MakeUnique<LogoMetadata>(logo->metadata);
+    metadata = std::make_unique<LogoMetadata>(logo->metadata);
     logo_num_bytes_ = static_cast<int>(logo->encoded_image->size());
   }
   UpdateMetadata(std::move(metadata));
diff --git a/components/search_provider_logos/logo_cache_unittest.cc b/components/search_provider_logos/logo_cache_unittest.cc
index 188b737..cc1b4575 100644
--- a/components/search_provider_logos/logo_cache_unittest.cc
+++ b/components/search_provider_logos/logo_cache_unittest.cc
@@ -7,13 +7,13 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <memory>
 #include <string>
 
 #include "base/bind.h"
 #include "base/callback.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/memory/ptr_util.h"
 #include "base/run_loop.h"
 #include "base/time/time.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -63,14 +63,14 @@
 }
 
 std::unique_ptr<EncodedLogo> GetExampleLogo() {
-  auto logo = base::MakeUnique<EncodedLogo>();
+  auto logo = std::make_unique<EncodedLogo>();
   logo->encoded_image = CreateExampleImage(837);
   logo->metadata = GetExampleMetadata();
   return logo;
 }
 
 std::unique_ptr<EncodedLogo> GetExampleLogo2() {
-  auto logo = base::MakeUnique<EncodedLogo>();
+  auto logo = std::make_unique<EncodedLogo>();
   logo->encoded_image = CreateExampleImage(345);
   logo->metadata = GetExampleMetadata2();
   return logo;
@@ -117,7 +117,7 @@
   }
 
   void InitCache() {
-    cache_ = base::MakeUnique<LogoCache>(
+    cache_ = std::make_unique<LogoCache>(
         cache_parent_dir_.GetPath().Append(FILE_PATH_LITERAL("cache")));
   }
 
diff --git a/components/security_state/content/content_utils.cc b/components/security_state/content/content_utils.cc
index 7ec6cc6..0d437ff 100644
--- a/components/security_state/content/content_utils.cc
+++ b/components/security_state/content/content_utils.cc
@@ -4,10 +4,10 @@
 
 #include "components/security_state/content/content_utils.h"
 
+#include <memory>
 #include <string>
 #include <vector>
 
-#include "base/memory/ptr_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
@@ -394,7 +394,7 @@
 
 std::unique_ptr<security_state::VisibleSecurityState> GetVisibleSecurityState(
     content::WebContents* web_contents) {
-  auto state = base::MakeUnique<security_state::VisibleSecurityState>();
+  auto state = std::make_unique<security_state::VisibleSecurityState>();
 
   content::NavigationEntry* entry =
       web_contents->GetController().GetVisibleEntry();
diff --git a/components/security_state/content/content_utils_browsertest.cc b/components/security_state/content/content_utils_browsertest.cc
index 9207cc6..7d87162 100644
--- a/components/security_state/content/content_utils_browsertest.cc
+++ b/components/security_state/content/content_utils_browsertest.cc
@@ -83,7 +83,7 @@
   events.password_field_shown = true;
   events.credit_card_field_edited = true;
   ssl_status.user_data =
-      base::MakeUnique<security_state::SSLStatusInputEventData>(events);
+      std::make_unique<security_state::SSLStatusInputEventData>(events);
 
   std::unique_ptr<security_state::VisibleSecurityState>
       visible_security_state_sensitive_inputs =
@@ -120,7 +120,7 @@
   // Simulate a field edit and update the SSLStatus' |user_data|.
   events.insecure_field_edited = true;
   ssl_status.user_data =
-      base::MakeUnique<security_state::SSLStatusInputEventData>(events);
+      std::make_unique<security_state::SSLStatusInputEventData>(events);
 
   // Verify the field edit was recorded properly in the |user_data|.
   ssl_status_input_events =
diff --git a/components/security_state/content/ssl_status_input_event_data.cc b/components/security_state/content/ssl_status_input_event_data.cc
index cfb66ff..2dc69e9 100644
--- a/components/security_state/content/ssl_status_input_event_data.cc
+++ b/components/security_state/content/ssl_status_input_event_data.cc
@@ -7,8 +7,6 @@
 #include <memory>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
-
 namespace security_state {
 
 SSLStatusInputEventData::SSLStatusInputEventData() {}
@@ -23,7 +21,7 @@
 }
 
 std::unique_ptr<SSLStatus::UserData> SSLStatusInputEventData::Clone() {
-  return base::MakeUnique<SSLStatusInputEventData>(data_);
+  return std::make_unique<SSLStatusInputEventData>(data_);
 }
 
 }  // namespace security_state
diff --git a/components/security_state/core/security_state_unittest.cc b/components/security_state/core/security_state_unittest.cc
index 511670e61..da92183c 100644
--- a/components/security_state/core/security_state_unittest.cc
+++ b/components/security_state/core/security_state_unittest.cc
@@ -5,11 +5,11 @@
 #include "components/security_state/core/security_state.h"
 
 #include <stdint.h>
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
 #include "base/command_line.h"
-#include "base/memory/ptr_util.h"
 #include "base/test/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "components/security_state/core/features.h"
@@ -113,7 +113,7 @@
   void SetUrl(const GURL& url) { url_ = url; }
 
   std::unique_ptr<VisibleSecurityState> GetVisibleSecurityState() const {
-    auto state = base::MakeUnique<VisibleSecurityState>();
+    auto state = std::make_unique<VisibleSecurityState>();
     state->connection_info_initialized = true;
     state->url = url_;
     state->certificate = cert_;
diff --git a/components/security_state/ios/ssl_status_input_event_data.mm b/components/security_state/ios/ssl_status_input_event_data.mm
index 3b84a2f..eb728d4 100644
--- a/components/security_state/ios/ssl_status_input_event_data.mm
+++ b/components/security_state/ios/ssl_status_input_event_data.mm
@@ -4,6 +4,8 @@
 
 #include "components/security_state/ios/ssl_status_input_event_data.h"
 
+#include <memory>
+
 namespace security_state {
 
 SSLStatusInputEventData::SSLStatusInputEventData() {}
@@ -20,7 +22,7 @@
 }
 
 std::unique_ptr<web::SSLStatus::UserData> SSLStatusInputEventData::Clone() {
-  return base::MakeUnique<SSLStatusInputEventData>(data_);
+  return std::make_unique<SSLStatusInputEventData>(data_);
 }
 
 }  // namespace security_state
diff --git a/components/spellcheck/browser/spelling_service_client.cc b/components/spellcheck/browser/spelling_service_client.cc
index 5ab8b6b..72748f78 100644
--- a/components/spellcheck/browser/spelling_service_client.cc
+++ b/components/spellcheck/browser/spelling_service_client.cc
@@ -7,6 +7,7 @@
 #include <stddef.h>
 
 #include <algorithm>
+#include <memory>
 
 #include "base/json/json_reader.h"
 #include "base/json/string_escape.h"
@@ -147,7 +148,7 @@
   fetcher->SetUploadData("application/json", request);
   fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
                         net::LOAD_DO_NOT_SAVE_COOKIES);
-  spellcheck_fetchers_[fetcher] = base::MakeUnique<TextCheckCallbackData>(
+  spellcheck_fetchers_[fetcher] = std::make_unique<TextCheckCallbackData>(
       base::WrapUnique(fetcher), std::move(callback), text);
   fetcher->Start();
   return true;
diff --git a/components/spellcheck/renderer/spellcheck.cc b/components/spellcheck/renderer/spellcheck.cc
index e40d886..94fd70fa4 100644
--- a/components/spellcheck/renderer/spellcheck.cc
+++ b/components/spellcheck/renderer/spellcheck.cc
@@ -7,6 +7,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <algorithm>
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
@@ -258,7 +259,7 @@
 void SpellCheck::AddSpellcheckLanguage(base::File file,
                                        const std::string& language) {
   languages_.push_back(
-      base::MakeUnique<SpellcheckLanguage>(embedder_provider_));
+      std::make_unique<SpellcheckLanguage>(embedder_provider_));
   languages_.back()->Init(std::move(file), language);
 }
 
diff --git a/components/spellcheck/renderer/spellcheck_provider_test.cc b/components/spellcheck/renderer/spellcheck_provider_test.cc
index aedc463..2b890170 100644
--- a/components/spellcheck/renderer/spellcheck_provider_test.cc
+++ b/components/spellcheck/renderer/spellcheck_provider_test.cc
@@ -4,6 +4,8 @@
 
 #include "components/spellcheck/renderer/spellcheck_provider_test.h"
 
+#include <memory>
+
 #include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
@@ -48,7 +50,7 @@
     blink::WebTextCheckingCompletion* completion) {
 #if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
   if (!loop_ && !base::MessageLoop::current())
-    loop_ = base::MakeUnique<base::MessageLoop>();
+    loop_ = std::make_unique<base::MessageLoop>();
   if (!binding_.is_bound()) {
     spellcheck::mojom::SpellCheckHostPtr host_proxy;
     binding_.Bind(mojo::MakeRequest(&host_proxy));
diff --git a/components/ssl_config/ssl_config_service_manager_pref_unittest.cc b/components/ssl_config/ssl_config_service_manager_pref_unittest.cc
index a53bd9b3..088eee2 100644
--- a/components/ssl_config/ssl_config_service_manager_pref_unittest.cc
+++ b/components/ssl_config/ssl_config_service_manager_pref_unittest.cc
@@ -6,7 +6,6 @@
 #include <utility>
 
 #include "base/command_line.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
@@ -68,7 +67,7 @@
   config_service->GetSSLConfig(&old_config);
   EXPECT_TRUE(old_config.disabled_cipher_suites.empty());
 
-  auto list_value = base::MakeUnique<base::ListValue>();
+  auto list_value = std::make_unique<base::ListValue>();
   list_value->AppendString("0x0004");
   list_value->AppendString("0x0005");
   local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist,
@@ -105,7 +104,7 @@
   config_service->GetSSLConfig(&old_config);
   EXPECT_TRUE(old_config.disabled_cipher_suites.empty());
 
-  auto list_value = base::MakeUnique<base::ListValue>();
+  auto list_value = std::make_unique<base::ListValue>();
   list_value->AppendString("0x0004");
   list_value->AppendString("TLS_NOT_WITH_A_CIPHER_SUITE");
   list_value->AppendString("0x0005");
@@ -171,7 +170,7 @@
 
   TestingPrefServiceSimple local_state;
   local_state.SetUserPref(ssl_config::prefs::kSSLVersionMin,
-                          base::MakeUnique<base::Value>("ssl3"));
+                          std::make_unique<base::Value>("ssl3"));
   SSLConfigServiceManager::RegisterPrefs(local_state.registry());
 
   std::unique_ptr<SSLConfigServiceManager> config_manager(
@@ -193,7 +192,7 @@
 
   TestingPrefServiceSimple local_state;
   local_state.SetUserPref(ssl_config::prefs::kSSLVersionMax,
-                          base::MakeUnique<base::Value>("tls1.3"));
+                          std::make_unique<base::Value>("tls1.3"));
   SSLConfigServiceManager::RegisterPrefs(local_state.registry());
 
   std::unique_ptr<SSLConfigServiceManager> config_manager(
@@ -214,7 +213,7 @@
 
   TestingPrefServiceSimple local_state;
   local_state.SetUserPref(ssl_config::prefs::kSSLVersionMax,
-                          base::MakeUnique<base::Value>("tls1.1"));
+                          std::make_unique<base::Value>("tls1.1"));
   SSLConfigServiceManager::RegisterPrefs(local_state.registry());
 
   std::unique_ptr<SSLConfigServiceManager> config_manager(
@@ -324,7 +323,7 @@
 
   TestingPrefServiceSimple local_state;
   local_state.SetUserPref(ssl_config::prefs::kSSLVersionMax,
-                          base::MakeUnique<base::Value>("tls1.2"));
+                          std::make_unique<base::Value>("tls1.2"));
   SSLConfigServiceManager::RegisterPrefs(local_state.registry());
 
   std::unique_ptr<SSLConfigServiceManager> config_manager(
@@ -350,7 +349,7 @@
 
   TestingPrefServiceSimple local_state;
   local_state.SetUserPref(ssl_config::prefs::kTLS13Variant,
-                          base::MakeUnique<base::Value>("disabled"));
+                          std::make_unique<base::Value>("disabled"));
   SSLConfigServiceManager::RegisterPrefs(local_state.registry());
 
   std::unique_ptr<SSLConfigServiceManager> config_manager(
@@ -375,9 +374,9 @@
 
   TestingPrefServiceSimple local_state;
   local_state.SetUserPref(ssl_config::prefs::kSSLVersionMax,
-                          base::MakeUnique<base::Value>("tls1.3"));
+                          std::make_unique<base::Value>("tls1.3"));
   local_state.SetUserPref(ssl_config::prefs::kTLS13Variant,
-                          base::MakeUnique<base::Value>("experiment2"));
+                          std::make_unique<base::Value>("experiment2"));
   SSLConfigServiceManager::RegisterPrefs(local_state.registry());
 
   std::unique_ptr<SSLConfigServiceManager> config_manager(
@@ -421,7 +420,7 @@
   // Enabling the local preference should result in SHA-1 local trust anchors
   // being enabled.
   local_state.SetUserPref(ssl_config::prefs::kCertEnableSha1LocalAnchors,
-                          base::MakeUnique<base::Value>(true));
+                          std::make_unique<base::Value>(true));
   // Pump the message loop to notify the SSLConfigServiceManagerPref that the
   // preferences changed.
   base::RunLoop().RunUntilIdle();
@@ -433,7 +432,7 @@
   // Disabling the local preference should result in SHA-1 local trust
   // anchors being disabled.
   local_state.SetUserPref(ssl_config::prefs::kCertEnableSha1LocalAnchors,
-                          base::MakeUnique<base::Value>(false));
+                          std::make_unique<base::Value>(false));
   // Pump the message loop to notify the SSLConfigServiceManagerPref that the
   // preferences changed.
   base::RunLoop().RunUntilIdle();
diff --git a/components/ssl_errors/error_classification_unittest.cc b/components/ssl_errors/error_classification_unittest.cc
index c4c2c45..9f96ea3 100644
--- a/components/ssl_errors/error_classification_unittest.cc
+++ b/components/ssl_errors/error_classification_unittest.cc
@@ -4,8 +4,9 @@
 
 #include "components/ssl_errors/error_classification.h"
 
+#include <memory>
+
 #include "base/files/file_path.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/strings/string_split.h"
 #include "base/test/histogram_tester.h"
@@ -249,8 +250,8 @@
   network_time::NetworkTimeTracker::RegisterPrefs(pref_service.registry());
   base::MessageLoop loop;
   network_time::NetworkTimeTracker network_time_tracker(
-      base::MakeUnique<base::DefaultClock>(),
-      base::MakeUnique<base::DefaultTickClock>(), &pref_service,
+      std::make_unique<base::DefaultClock>(),
+      std::make_unique<base::DefaultTickClock>(), &pref_service,
       new net::TestURLRequestContextGetter(
           base::ThreadTaskRunnerHandle::Get()));
 
diff --git a/components/startup_metric_utils/browser/startup_metric_host_impl.cc b/components/startup_metric_utils/browser/startup_metric_host_impl.cc
index 2364423..b7f0cf9 100644
--- a/components/startup_metric_utils/browser/startup_metric_host_impl.cc
+++ b/components/startup_metric_utils/browser/startup_metric_host_impl.cc
@@ -4,7 +4,8 @@
 
 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "components/startup_metric_utils/browser/startup_metric_utils.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 
@@ -17,7 +18,7 @@
 // static
 void StartupMetricHostImpl::Create(
     mojom::StartupMetricHostRequest request) {
-  mojo::MakeStrongBinding(base::MakeUnique<StartupMetricHostImpl>(),
+  mojo::MakeStrongBinding(std::make_unique<StartupMetricHostImpl>(),
                           std::move(request));
 }
 
diff --git a/components/storage_monitor/storage_monitor_linux.cc b/components/storage_monitor/storage_monitor_linux.cc
index 8f67412..923600f 100644
--- a/components/storage_monitor/storage_monitor_linux.cc
+++ b/components/storage_monitor/storage_monitor_linux.cc
@@ -13,12 +13,12 @@
 
 #include <limits>
 #include <list>
+#include <memory>
 #include <utility>
 #include <vector>
 
 #include "base/bind.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/process/kill.h"
 #include "base/process/launch.h"
@@ -176,7 +176,7 @@
 
   results_recorder.set_result(true);
 
-  storage_info = base::MakeUnique<StorageInfo>(
+  storage_info = std::make_unique<StorageInfo>(
       StorageInfo::MakeDeviceId(type, unique_id), mount_point.value(),
       volume_label, vendor_name, model_name,
       GetDeviceStorageSize(device_path, device.get()));
diff --git a/components/suggestions/image_encoder_ios.mm b/components/suggestions/image_encoder_ios.mm
index d182926..716c1c3c 100644
--- a/components/suggestions/image_encoder_ios.mm
+++ b/components/suggestions/image_encoder_ios.mm
@@ -7,8 +7,9 @@
 #include <stddef.h>
 #import <UIKit/UIKit.h>
 
+#include <memory>
+
 #include "base/mac/scoped_cftyperef.h"
-#include "base/memory/ptr_util.h"
 #include "skia/ext/skia_utils_ios.h"
 
 namespace suggestions {
@@ -17,7 +18,7 @@
                                                size_t size) {
   NSData* data = [NSData dataWithBytes:encoded_data length:size];
   UIImage* image = [UIImage imageWithData:data scale:1.0];
-  return base::MakeUnique<SkBitmap>(
+  return std::make_unique<SkBitmap>(
       skia::CGImageToSkBitmap(image.CGImage, [image size], YES));
 }
 
diff --git a/components/sync_preferences/pref_model_associator.cc b/components/sync_preferences/pref_model_associator.cc
index 89420a9..401d614 100644
--- a/components/sync_preferences/pref_model_associator.cc
+++ b/components/sync_preferences/pref_model_associator.cc
@@ -6,6 +6,7 @@
 
 #include <algorithm>
 #include <iterator>
+#include <memory>
 #include <utility>
 
 #include "base/auto_reset.h"
@@ -242,7 +243,7 @@
     if (client_->IsMergeableListPreference(name))
       return MergeListValues(local_value, server_value);
     if (client_->IsMergeableDictionaryPreference(name)) {
-      return base::MakeUnique<base::Value>(
+      return std::make_unique<base::Value>(
           MergeDictionaryValues(local_value, server_value));
     }
   }
@@ -427,7 +428,7 @@
   std::unique_ptr<SyncedPrefObserverList>& observers =
       synced_pref_observers_[name];
   if (!observers)
-    observers = base::MakeUnique<SyncedPrefObserverList>();
+    observers = std::make_unique<SyncedPrefObserverList>();
 
   observers->AddObserver(observer);
 }
diff --git a/components/sync_preferences/pref_model_associator_unittest.cc b/components/sync_preferences/pref_model_associator_unittest.cc
index ceaf48f..55682ad 100644
--- a/components/sync_preferences/pref_model_associator_unittest.cc
+++ b/components/sync_preferences/pref_model_associator_unittest.cc
@@ -7,7 +7,6 @@
 #include <memory>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/values.h"
 #include "components/prefs/scoped_user_pref_update.h"
@@ -132,7 +131,7 @@
 }
 
 TEST_F(ListPreferenceMergeTest, ServerNull) {
-  auto null_value = base::MakeUnique<base::Value>();
+  auto null_value = std::make_unique<base::Value>();
   {
     ListPrefUpdate update(pref_service_.get(), kListPrefName);
     base::ListValue* local_list_value = update.Get();
@@ -254,7 +253,7 @@
 }
 
 TEST_F(DictionaryPreferenceMergeTest, ServerNull) {
-  auto null_value = base::MakeUnique<base::Value>();
+  auto null_value = std::make_unique<base::Value>();
   {
     DictionaryPrefUpdate update(pref_service_.get(), kDictionaryPrefName);
     base::DictionaryValue* local_dict_value = update.Get();
diff --git a/components/sync_preferences/pref_service_syncable_unittest.cc b/components/sync_preferences/pref_service_syncable_unittest.cc
index e607be0b..2da726b 100644
--- a/components/sync_preferences/pref_service_syncable_unittest.cc
+++ b/components/sync_preferences/pref_service_syncable_unittest.cc
@@ -12,7 +12,6 @@
 #include "base/json/json_string_value_serializer.h"
 #include "base/json/json_writer.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/strings/utf_string_conversions.h"
 #include "components/pref_registry/pref_registry_syncable.h"
@@ -164,7 +163,7 @@
     test_processor_ = new TestSyncProcessorStub(output);
     syncer::SyncMergeResult r = pref_sync_service_->MergeDataAndStartSyncing(
         syncer::PREFERENCES, initial_data, base::WrapUnique(test_processor_),
-        base::MakeUnique<syncer::SyncErrorFactoryMock>());
+        std::make_unique<syncer::SyncErrorFactoryMock>());
     EXPECT_FALSE(r.error().IsSet());
   }
 
@@ -304,7 +303,7 @@
   stub->FailNextProcessSyncChanges();
   syncer::SyncMergeResult r = pref_sync_service_->MergeDataAndStartSyncing(
       syncer::PREFERENCES, syncer::SyncDataList(), base::WrapUnique(stub),
-      base::MakeUnique<syncer::SyncErrorFactoryMock>());
+      std::make_unique<syncer::SyncErrorFactoryMock>());
   EXPECT_TRUE(r.error().IsSet());
 }
 
@@ -539,7 +538,7 @@
 
   InitWithNoSyncData();
 
-  auto null_value = base::MakeUnique<base::Value>();
+  auto null_value = std::make_unique<base::Value>();
   syncer::SyncChangeList list;
   list.push_back(MakeRemoteChange(1, kStringPrefName, *null_value,
                                   SyncChange::ACTION_DELETE));
diff --git a/components/sync_wifi/wifi_config_delegate_chromeos_unittest.cc b/components/sync_wifi/wifi_config_delegate_chromeos_unittest.cc
index 882a839..8930aab 100644
--- a/components/sync_wifi/wifi_config_delegate_chromeos_unittest.cc
+++ b/components/sync_wifi/wifi_config_delegate_chromeos_unittest.cc
@@ -10,7 +10,6 @@
 
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "chromeos/network/managed_network_configuration_handler.h"
 #include "chromeos/network/network_handler_callbacks.h"
@@ -223,7 +222,7 @@
   if (!create_configuration_error_callback().is_null()) {
     create_configuration_error_callback().Run(
         "Config.CreateConfiguration Failed",
-        base::MakeUnique<base::DictionaryValue>());
+        std::make_unique<base::DictionaryValue>());
   }
 }
 
diff --git a/components/sync_wifi/wifi_credential.cc b/components/sync_wifi/wifi_credential.cc
index bf6294a3f..38da1cf 100644
--- a/components/sync_wifi/wifi_credential.cc
+++ b/components/sync_wifi/wifi_credential.cc
@@ -4,6 +4,8 @@
 
 #include "components/sync_wifi/wifi_credential.h"
 
+#include <memory>
+
 #include "base/i18n/streaming_utf8_validator.h"
 #include "base/logging.h"
 #include "base/memory/ptr_util.h"
@@ -49,10 +51,10 @@
   if (!WifiSecurityClassToOncSecurityString(security_class(), &onc_security)) {
     NOTREACHED() << "Failed to convert SecurityClass with value "
                  << security_class();
-    return base::MakeUnique<base::DictionaryValue>();
+    return std::make_unique<base::DictionaryValue>();
   }
 
-  auto onc_properties = base::MakeUnique<base::DictionaryValue>();
+  auto onc_properties = std::make_unique<base::DictionaryValue>();
   onc_properties->SetString(onc::toplevel_config::kType,
                             onc::network_type::kWiFi);
   // TODO(quiche): Switch to the HexSSID property, once ONC fully supports it.
diff --git a/components/sync_wifi/wifi_credential_syncable_service_factory.cc b/components/sync_wifi/wifi_credential_syncable_service_factory.cc
index 607e4b8..27417393 100644
--- a/components/sync_wifi/wifi_credential_syncable_service_factory.cc
+++ b/components/sync_wifi/wifi_credential_syncable_service_factory.cc
@@ -4,10 +4,10 @@
 
 #include "components/sync_wifi/wifi_credential_syncable_service_factory.h"
 
+#include <memory>
 #include <string>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "build/build_config.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/sync_wifi/wifi_config_delegate.h"
@@ -94,7 +94,7 @@
   // ChromeBrowserMainPartsChromeos, and destroyed after all
   // KeyedService instances are destroyed.
   chromeos::NetworkHandler* network_handler = chromeos::NetworkHandler::Get();
-  return base::MakeUnique<WifiConfigDelegateChromeOs>(
+  return std::make_unique<WifiConfigDelegateChromeOs>(
       GetUserHash(context, !ignore_login_state_for_test_),
       network_handler->managed_network_configuration_handler());
 }
diff --git a/components/sync_wifi/wifi_credential_syncable_service_unittest.cc b/components/sync_wifi/wifi_credential_syncable_service_unittest.cc
index 31a4f347..197d517 100644
--- a/components/sync_wifi/wifi_credential_syncable_service_unittest.cc
+++ b/components/sync_wifi/wifi_credential_syncable_service_unittest.cc
@@ -145,7 +145,7 @@
     change_processor_ = change_processor.get();
     syncable_service_->MergeDataAndStartSyncing(
         syncer::WIFI_CREDENTIALS, syncer::SyncDataList(),
-        std::move(change_processor), base::MakeUnique<SyncErrorFactoryMock>());
+        std::move(change_processor), std::make_unique<SyncErrorFactoryMock>());
   }
 
  private:
diff --git a/components/task_scheduler_util/common/variations_util.cc b/components/task_scheduler_util/common/variations_util.cc
index eaef402..2a2527e 100644
--- a/components/task_scheduler_util/common/variations_util.cc
+++ b/components/task_scheduler_util/common/variations_util.cc
@@ -4,9 +4,10 @@
 
 #include "components/task_scheduler_util/common/variations_util.h"
 
+#include <memory>
+
 #include "base/command_line.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/strcat.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_split.h"
@@ -76,7 +77,7 @@
     return nullptr;
   }
 
-  auto params = base::MakeUnique<base::SchedulerWorkerPoolParams>(
+  auto params = std::make_unique<base::SchedulerWorkerPoolParams>(
       base::RecommendedMaxNumberOfThreadsInPool(min, max, cores_multiplier,
                                                 offset),
       base::TimeDelta::FromMilliseconds(detach_milliseconds),
@@ -122,7 +123,7 @@
     return nullptr;
   }
 
-  return base::MakeUnique<base::TaskScheduler::InitParams>(
+  return std::make_unique<base::TaskScheduler::InitParams>(
       *background_worker_pool_params, *background_blocking_worker_pool_params,
       *foreground_worker_pool_params, *foreground_blocking_worker_pool_params);
 }
diff --git a/components/test/components_test_suite.cc b/components/test/components_test_suite.cc
index 78f7e37d..f2d4b0e 100644
--- a/components/test/components_test_suite.cc
+++ b/components/test/components_test_suite.cc
@@ -10,7 +10,6 @@
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/path_service.h"
 #include "base/test/launcher/unit_test_launcher.h"
 #include "base/test/test_suite.h"
@@ -124,10 +123,10 @@
 
 base::RunTestSuiteCallback GetLaunchCallback(int argc, char** argv) {
 #if !defined(OS_IOS)
-  auto test_suite = base::MakeUnique<content::UnitTestTestSuite>(
+  auto test_suite = std::make_unique<content::UnitTestTestSuite>(
       new ComponentsTestSuite(argc, argv));
 #else
-  auto test_suite = base::MakeUnique<ComponentsTestSuite>(argc, argv);
+  auto test_suite = std::make_unique<ComponentsTestSuite>(argc, argv);
 #endif
 
   // The listener will set up common test environment for all components unit
diff --git a/components/timers/alarm_timer_chromeos.cc b/components/timers/alarm_timer_chromeos.cc
index da011e3..1718038 100644
--- a/components/timers/alarm_timer_chromeos.cc
+++ b/components/timers/alarm_timer_chromeos.cc
@@ -8,13 +8,13 @@
 #include <sys/timerfd.h>
 
 #include <algorithm>
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
 #include "base/debug/task_annotator.h"
 #include "base/files/file_util.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/pending_task.h"
 #include "base/trace_event/trace_event.h"
 
@@ -72,7 +72,7 @@
   // Set up the pending task.
   base::Timer::set_desired_run_time(
       delay.is_zero() ? base::TimeTicks() : base::TimeTicks::Now() + delay);
-  pending_task_ = base::MakeUnique<base::PendingTask>(
+  pending_task_ = std::make_unique<base::PendingTask>(
       base::Timer::posted_from(), base::Timer::user_task(),
       base::Timer::desired_run_time());
 
diff --git a/components/timers/alarm_timer_unittest.cc b/components/timers/alarm_timer_unittest.cc
index 78494ad..ecbeb215 100644
--- a/components/timers/alarm_timer_unittest.cc
+++ b/components/timers/alarm_timer_unittest.cc
@@ -11,7 +11,6 @@
 #include "base/files/file_descriptor_watcher_posix.h"
 #include "base/location.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
@@ -253,9 +252,9 @@
   // if debug heap checking is enabled.
   bool did_run = false;
   {
-    auto loop = base::MakeUnique<base::MessageLoopForIO>();
+    auto loop = std::make_unique<base::MessageLoopForIO>();
     auto file_descriptor_watcher =
-        base::MakeUnique<base::FileDescriptorWatcher>(loop.get());
+        std::make_unique<base::FileDescriptorWatcher>(loop.get());
     OneShotAlarmTimerTester a(&did_run, kTenMilliseconds);
     OneShotAlarmTimerTester b(&did_run, kTenMilliseconds);
     OneShotAlarmTimerTester c(&did_run, kTenMilliseconds);
diff --git a/components/tracing/test/trace_event_perftest.cc b/components/tracing/test/trace_event_perftest.cc
index 6dfedab..97cb099 100644
--- a/components/tracing/test/trace_event_perftest.cc
+++ b/components/tracing/test/trace_event_perftest.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted_memory.h"
@@ -57,7 +59,7 @@
   }
 
   std::unique_ptr<TracedValue> MakeTracedValue(int counter) {
-    auto value = base::MakeUnique<TracedValue>();
+    auto value = std::make_unique<TracedValue>();
     value->SetInteger("counter", counter);
     value->BeginDictionary("test_dict");
     value->BeginArray("nodes");
diff --git a/components/translate/core/browser/mock_translate_client.cc b/components/translate/core/browser/mock_translate_client.cc
index f517155..031ba04 100644
--- a/components/translate/core/browser/mock_translate_client.cc
+++ b/components/translate/core/browser/mock_translate_client.cc
@@ -33,7 +33,7 @@
 }
 
 std::unique_ptr<TranslatePrefs> MockTranslateClient::GetTranslatePrefs() {
-  return base::MakeUnique<TranslatePrefs>(prefs_, accept_languages_prefs,
+  return std::make_unique<TranslatePrefs>(prefs_, accept_languages_prefs,
                                           preferred_languages_prefs);
 }
 
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
index b3316dc..179e4ca 100644
--- a/components/translate/core/browser/translate_manager.cc
+++ b/components/translate/core/browser/translate_manager.cc
@@ -5,10 +5,10 @@
 #include "components/translate/core/browser/translate_manager.h"
 
 #include <map>
+#include <memory>
 
 #include "base/bind.h"
 #include "base/command_line.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/field_trial.h"
 #include "base/metrics/histogram.h"
 #include "base/strings/string_number_conversions.h"
@@ -80,7 +80,7 @@
       translate_ranker_(translate_ranker),
       language_model_(language_model),
       language_state_(translate_driver_),
-      translate_event_(base::MakeUnique<metrics::TranslateEventProto>()),
+      translate_event_(std::make_unique<metrics::TranslateEventProto>()),
       weak_method_factory_(this) {}
 
 base::WeakPtr<TranslateManager> TranslateManager::GetWeakPtr() {
diff --git a/components/translate/core/browser/translate_prefs.cc b/components/translate/core/browser/translate_prefs.cc
index 5bc6428..7e4373cd 100644
--- a/components/translate/core/browser/translate_prefs.cc
+++ b/components/translate/core/browser/translate_prefs.cc
@@ -4,12 +4,12 @@
 
 #include "components/translate/core/browser/translate_prefs.h"
 
+#include <memory>
 #include <set>
 #include <utility>
 
 #include "base/feature_list.h"
 #include "base/i18n/rtl.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_piece.h"
 #include "base/strings/string_split.h"
@@ -130,7 +130,7 @@
   bool has_list = has_value && denial_value->GetAsList(&time_list_);
 
   if (!has_list) {
-    auto time_list = base::MakeUnique<base::ListValue>();
+    auto time_list = std::make_unique<base::ListValue>();
     double oldest_denial_time = 0;
     bool has_old_style =
         has_value && denial_value->GetAsDouble(&oldest_denial_time);
diff --git a/components/translate/core/browser/translate_ranker_impl.cc b/components/translate/core/browser/translate_ranker_impl.cc
index 0ec2dc6..7066053 100644
--- a/components/translate/core/browser/translate_ranker_impl.cc
+++ b/components/translate/core/browser/translate_ranker_impl.cc
@@ -5,13 +5,13 @@
 #include "components/translate/core/browser/translate_ranker_impl.h"
 
 #include <cmath>
+#include <memory>
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/metrics/metrics_hashes.h"
 #include "base/strings/string_util.h"
@@ -160,7 +160,7 @@
               translate::kTranslateRankerPreviousLanguageMatchesOverride)),
       weak_ptr_factory_(this) {
   if (is_query_enabled_ || is_enforcement_enabled_) {
-    model_loader_ = base::MakeUnique<assist_ranker::RankerModelLoaderImpl>(
+    model_loader_ = std::make_unique<assist_ranker::RankerModelLoaderImpl>(
         base::Bind(&ValidateModel),
         base::Bind(&TranslateRankerImpl::OnModelAvailable,
                    weak_ptr_factory_.GetWeakPtr()),
diff --git a/components/translate/core/browser/translate_ranker_impl_unittest.cc b/components/translate/core/browser/translate_ranker_impl_unittest.cc
index 41b87a4f..a5af17e 100644
--- a/components/translate/core/browser/translate_ranker_impl_unittest.cc
+++ b/components/translate/core/browser/translate_ranker_impl_unittest.cc
@@ -8,7 +8,6 @@
 #include <memory>
 
 #include "base/feature_list.h"
-#include "base/memory/ptr_util.h"
 #include "base/run_loop.h"
 #include "base/strings/stringprintf.h"
 #include "base/task_scheduler/post_task.h"
@@ -96,7 +95,7 @@
 
 std::unique_ptr<TranslateRankerImpl> TranslateRankerImplTest::GetRankerForTest(
     float threshold) {
-  auto model = base::MakeUnique<assist_ranker::RankerModel>();
+  auto model = std::make_unique<assist_ranker::RankerModel>();
   model->mutable_proto()->mutable_translate()->set_version(kModelVersion);
   auto* details = model->mutable_proto()
                       ->mutable_translate()
@@ -123,7 +122,7 @@
   country_weight["ca"] = 0.08f;
   country_weight["cn"] = 0.09f;
 
-  auto impl = base::MakeUnique<TranslateRankerImpl>(base::FilePath(), GURL(),
+  auto impl = std::make_unique<TranslateRankerImpl>(base::FilePath(), GURL(),
                                                     GetTestUkmRecorder());
   impl->OnModelAvailable(std::move(model));
   base::RunLoop().RunUntilIdle();
@@ -322,7 +321,7 @@
 
 TEST_F(TranslateRankerImplTest, ShouldOfferTranslation_NoModel) {
   auto ranker =
-      base::MakeUnique<TranslateRankerImpl>(base::FilePath(), GURL(), nullptr);
+      std::make_unique<TranslateRankerImpl>(base::FilePath(), GURL(), nullptr);
   InitFeatures({kTranslateRankerAutoBlacklistOverride,
                 kTranslateRankerPreviousLanguageMatchesOverride,
                 kTranslateRankerQuery, kTranslateRankerEnforcement},
diff --git a/components/translate/core/common/language_detection_logging_helper.cc b/components/translate/core/common/language_detection_logging_helper.cc
index 98046c6..e580a1d 100644
--- a/components/translate/core/common/language_detection_logging_helper.cc
+++ b/components/translate/core/common/language_detection_logging_helper.cc
@@ -7,7 +7,6 @@
 #include <memory>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "components/sync/protocol/user_event_specifics.pb.h"
 #include "components/translate/core/common/language_detection_details.h"
 
@@ -16,7 +15,7 @@
 std::unique_ptr<sync_pb::UserEventSpecifics> ConstructLanguageDetectionEvent(
     const int64_t navigation_id,
     const LanguageDetectionDetails& details) {
-  auto specifics = base::MakeUnique<sync_pb::UserEventSpecifics>();
+  auto specifics = std::make_unique<sync_pb::UserEventSpecifics>();
   specifics->set_event_time_usec(base::Time::Now().ToInternalValue());
 
   specifics->set_navigation_id(navigation_id);
diff --git a/components/translate/ios/browser/language_detection_controller_unittest.mm b/components/translate/ios/browser/language_detection_controller_unittest.mm
index c61adad8..a357b13 100644
--- a/components/translate/ios/browser/language_detection_controller_unittest.mm
+++ b/components/translate/ios/browser/language_detection_controller_unittest.mm
@@ -4,9 +4,10 @@
 
 #import "components/translate/ios/browser/language_detection_controller.h"
 
+#include <memory>
+
 #include "base/callback.h"
 #include "base/mac/bind_objc_block.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "components/language/ios/browser/ios_language_detection_tab_helper.h"
 #include "components/prefs/pref_registry_simple.h"
@@ -51,7 +52,7 @@
 
     MockJsLanguageDetectionManager* js_manager =
         [[MockJsLanguageDetectionManager alloc] init];
-    controller_ = base::MakeUnique<LanguageDetectionController>(
+    controller_ = std::make_unique<LanguageDetectionController>(
         &web_state_, js_manager, &prefs_);
   }
 
@@ -66,7 +67,7 @@
   std::unique_ptr<LanguageDetectionDetails> details_;
 
   void OnLanguageDetermined(const LanguageDetectionDetails& details) {
-    details_ = base::MakeUnique<LanguageDetectionDetails>(details);
+    details_ = std::make_unique<LanguageDetectionDetails>(details);
   }
 };
 
diff --git a/components/translate/ios/browser/translate_controller_unittest.mm b/components/translate/ios/browser/translate_controller_unittest.mm
index 99d5e36..53dc050 100644
--- a/components/translate/ios/browser/translate_controller_unittest.mm
+++ b/components/translate/ios/browser/translate_controller_unittest.mm
@@ -6,7 +6,6 @@
 
 #include <memory>
 
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #import "components/translate/ios/browser/js_translate_manager.h"
 #import "ios/web/public/test/fakes/test_web_state.h"
@@ -33,7 +32,7 @@
         on_translate_complete_called_(false) {
     mock_js_translate_manager_ =
         [OCMockObject niceMockForClass:[JsTranslateManager class]];
-    translate_controller_ = base::MakeUnique<TranslateController>(
+    translate_controller_ = std::make_unique<TranslateController>(
         test_web_state_.get(), mock_js_translate_manager_);
     translate_controller_->set_observer(this);
   }
diff --git a/components/ui_devtools/devtools_server.cc b/components/ui_devtools/devtools_server.cc
index a901f93..7ecdbbf 100644
--- a/components/ui_devtools/devtools_server.cc
+++ b/components/ui_devtools/devtools_server.cc
@@ -4,11 +4,12 @@
 
 #include "components/ui_devtools/devtools_server.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/command_line.h"
 #include "base/format_macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
@@ -128,7 +129,7 @@
   if (socket->ListenWithAddressAndPort(address_string, port, kBacklog) !=
       net::OK)
     return;
-  server_ = base::MakeUnique<net::HttpServer>(std::move(socket), this);
+  server_ = std::make_unique<net::HttpServer>(std::move(socket), this);
 }
 
 // HttpServer::Delegate Implementation
diff --git a/components/ui_devtools/views/dom_agent.cc b/components/ui_devtools/views/dom_agent.cc
index 3b353a5..f18589a 100644
--- a/components/ui_devtools/views/dom_agent.cc
+++ b/components/ui_devtools/views/dom_agent.cc
@@ -4,7 +4,8 @@
 
 #include "components/ui_devtools/views/dom_agent.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/strings/utf_string_conversions.h"
 #include "components/ui_devtools/devtools_server.h"
 #include "components/ui_devtools/views/overlay_agent.h"
@@ -800,7 +801,7 @@
   // TODO(thanhph): Root of UIElement tree shoudn't be WindowElement
   // but maybe a new different element type.
   window_element_root_ =
-      base::MakeUnique<WindowElement>(nullptr, this, nullptr);
+      std::make_unique<WindowElement>(nullptr, this, nullptr);
 
   for (aura::Window* window : root_windows()) {
     UIElement* window_element =
diff --git a/components/ui_devtools/views/ui_devtools_unittest.cc b/components/ui_devtools/views/ui_devtools_unittest.cc
index a942b35..d6693e9 100644
--- a/components/ui_devtools/views/ui_devtools_unittest.cc
+++ b/components/ui_devtools/views/ui_devtools_unittest.cc
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
 #include "components/ui_devtools/views/css_agent.h"
@@ -212,7 +213,7 @@
       aura::Window* parent,
       aura::client::WindowType type = aura::client::WINDOW_TYPE_NORMAL) {
     std::unique_ptr<aura::Window> window =
-        base::MakeUnique<aura::Window>(nullptr, type);
+        std::make_unique<aura::Window>(nullptr, type);
     window->Init(ui::LAYER_NOT_DRAWN);
     window->SetBounds(gfx::Rect());
     parent->AddChild(window.get());
@@ -221,15 +222,15 @@
   }
 
   void SetUp() override {
-    fake_frontend_channel_ = base::MakeUnique<FakeFrontendChannel>();
+    fake_frontend_channel_ = std::make_unique<FakeFrontendChannel>();
     uber_dispatcher_ =
-        base::MakeUnique<UberDispatcher>(fake_frontend_channel_.get());
-    dom_agent_ = base::MakeUnique<DOMAgent>();
+        std::make_unique<UberDispatcher>(fake_frontend_channel_.get());
+    dom_agent_ = std::make_unique<DOMAgent>();
     dom_agent_->Init(uber_dispatcher_.get());
-    css_agent_ = base::MakeUnique<CSSAgent>(dom_agent_.get());
+    css_agent_ = std::make_unique<CSSAgent>(dom_agent_.get());
     css_agent_->Init(uber_dispatcher_.get());
     css_agent_->enable();
-    overlay_agent_ = base::MakeUnique<OverlayAgent>(dom_agent_.get());
+    overlay_agent_ = std::make_unique<OverlayAgent>(dom_agent_.get());
     overlay_agent_->Init(uber_dispatcher_.get());
     overlay_agent_->enable();
 
@@ -965,7 +966,7 @@
       CreateTestWidget(gfx::Rect(1, 1, 1, 1)));
   // Need to store |view| in unique_ptr because it is removed from the widget
   // and needs to be destroyed independently
-  std::unique_ptr<views::View> child_view = base::MakeUnique<views::View>();
+  std::unique_ptr<views::View> child_view = std::make_unique<views::View>();
   aura::Window* window = widget->GetNativeWindow();
   widget->Show();
   views::View* root_view = widget->GetRootView();
diff --git a/components/ukm/content/source_url_recorder_browsertest.cc b/components/ukm/content/source_url_recorder_browsertest.cc
index 82d3425..bb37e781e 100644
--- a/components/ukm/content/source_url_recorder_browsertest.cc
+++ b/components/ukm/content/source_url_recorder_browsertest.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <memory>
+
 #include "base/files/scoped_temp_dir.h"
 #include "base/test/scoped_feature_list.h"
 #include "components/ukm/content/source_url_recorder.h"
@@ -29,7 +31,7 @@
 
     ASSERT_TRUE(embedded_test_server()->Start());
 
-    test_ukm_recorder_ = base::MakeUnique<ukm::TestAutoSetUkmRecorder>();
+    test_ukm_recorder_ = std::make_unique<ukm::TestAutoSetUkmRecorder>();
     ukm::InitializeSourceUrlRecorderForWebContents(shell()->web_contents());
   }
 
diff --git a/components/ukm/ukm_recorder_impl.cc b/components/ukm/ukm_recorder_impl.cc
index 7f431a8..2f4e167 100644
--- a/components/ukm/ukm_recorder_impl.cc
+++ b/components/ukm/ukm_recorder_impl.cc
@@ -238,7 +238,7 @@
     RecordDroppedSource(DroppedDataReason::MAX_HIT);
     return;
   }
-  sources_.emplace(source_id, base::MakeUnique<UkmSource>(source_id, url));
+  sources_.emplace(source_id, std::make_unique<UkmSource>(source_id, url));
 }
 
 void UkmRecorderImpl::AddEntry(mojom::UkmEntryPtr entry) {
diff --git a/components/ukm/ukm_reporting_service.cc b/components/ukm/ukm_reporting_service.cc
index 2ff266d6..70bb4fc 100644
--- a/components/ukm/ukm_reporting_service.cc
+++ b/components/ukm/ukm_reporting_service.cc
@@ -6,6 +6,8 @@
 
 #include "components/ukm/ukm_reporting_service.h"
 
+#include <memory>
+
 #include "base/memory/ptr_util.h"
 #include "base/metrics/field_trial_params.h"
 #include "base/metrics/histogram_functions.h"
@@ -59,7 +61,7 @@
 UkmReportingService::UkmReportingService(metrics::MetricsServiceClient* client,
                                          PrefService* local_state)
     : ReportingService(client, local_state, kMaxLogRetransmitSize),
-      persisted_logs_(base::MakeUnique<ukm::PersistedLogsMetricsImpl>(),
+      persisted_logs_(std::make_unique<ukm::PersistedLogsMetricsImpl>(),
                       local_state,
                       prefs::kUkmPersistedLogs,
                       kMinPersistedLogs,
diff --git a/components/ukm/ukm_service_unittest.cc b/components/ukm/ukm_service_unittest.cc
index 2e507b8..4a54135 100644
--- a/components/ukm/ukm_service_unittest.cc
+++ b/components/ukm/ukm_service_unittest.cc
@@ -5,6 +5,7 @@
 #include "components/ukm/ukm_service.h"
 
 #include <map>
+#include <memory>
 #include <string>
 #include <utility>
 
@@ -124,7 +125,7 @@
   Report GetPersistedReport() {
     EXPECT_GE(GetPersistedLogCount(), 1);
     metrics::PersistedLogs result_persisted_logs(
-        base::MakeUnique<ukm::PersistedLogsMetricsImpl>(), &prefs_,
+        std::make_unique<ukm::PersistedLogsMetricsImpl>(), &prefs_,
         prefs::kUkmPersistedLogs,
         3,     // log count limit
         1000,  // byte limit
diff --git a/components/undo/undo_manager_test.cc b/components/undo/undo_manager_test.cc
index 70e50f08..deaf463 100644
--- a/components/undo/undo_manager_test.cc
+++ b/components/undo/undo_manager_test.cc
@@ -4,9 +4,10 @@
 
 #include "components/undo/undo_manager.h"
 
+#include <memory>
+
 #include "base/auto_reset.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "components/undo/undo_manager_observer.h"
 #include "components/undo/undo_operation.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -138,7 +139,7 @@
 }
 
 void TestUndoService::TriggerOperation() {
-  undo_manager_.AddUndoOperation(base::MakeUnique<TestUndoOperation>(this));
+  undo_manager_.AddUndoOperation(std::make_unique<TestUndoOperation>(this));
 }
 
 void TestUndoService::RecordUndoCall() {
diff --git a/components/update_client/component.cc b/components/update_client/component.cc
index e6fb571..daf40fe 100644
--- a/components/update_client/component.cc
+++ b/components/update_client/component.cc
@@ -393,7 +393,7 @@
     component.AppendEvent(BuildUpdateCompleteEventElement(component));
 
   TransitionState(nullptr);
-  component.NotifyObservers(Events::COMPONENT_NOT_UPDATED);
+  component.NotifyObservers(Events::COMPONENT_UPDATE_ERROR);
 }
 
 Component::StateCanUpdate::StateCanUpdate(Component* component)
diff --git a/components/update_client/update_client.h b/components/update_client/update_client.h
index a806057..f0796503 100644
--- a/components/update_client/update_client.h
+++ b/components/update_client/update_client.h
@@ -299,10 +299,15 @@
       // Sent when a CRX has been successfully updated.
       COMPONENT_UPDATED,
 
-      // Sent when a CRX has not been updated following an update check:
-      // either there was no update available, or the update failed.
+      // Sent when a CRX has not been updated because there was no update
+      // available for this component.
       COMPONENT_NOT_UPDATED,
 
+      // Sent when an error ocurred during an update for any reason, including
+      // the update check itself failed, or the download of the update payload
+      // failed, or applying the update failed.
+      COMPONENT_UPDATE_ERROR,
+
       // Sent when CRX bytes are being downloaded.
       COMPONENT_UPDATE_DOWNLOADING,
     };
diff --git a/components/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc
index e3e8846..57fefe0 100644
--- a/components/update_client/update_client_unittest.cc
+++ b/components/update_client/update_client_unittest.cc
@@ -1014,8 +1014,9 @@
     EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_DOWNLOADING,
                                   "jebgalgnebhfojomionfpkfelancnnkf"))
         .Times(AtLeast(1));
-    EXPECT_CALL(observer, OnEvent(Events::COMPONENT_NOT_UPDATED,
-                                  "jebgalgnebhfojomionfpkfelancnnkf")).Times(1);
+    EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_ERROR,
+                                  "jebgalgnebhfojomionfpkfelancnnkf"))
+        .Times(1);
   }
   {
     InSequence seq;
@@ -1544,8 +1545,9 @@
         .Times(AtLeast(1));
     EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_READY,
                                   "jebgalgnebhfojomionfpkfelancnnkf")).Times(1);
-    EXPECT_CALL(observer, OnEvent(Events::COMPONENT_NOT_UPDATED,
-                                  "jebgalgnebhfojomionfpkfelancnnkf")).Times(1);
+    EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_ERROR,
+                                  "jebgalgnebhfojomionfpkfelancnnkf"))
+        .Times(1);
   }
 
   update_client->AddObserver(&observer);
@@ -2812,7 +2814,7 @@
     EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_FOUND,
                                   "jebgalgnebhfojomionfpkfelancnnkf"))
         .Times(1);
-    EXPECT_CALL(observer, OnEvent(Events::COMPONENT_NOT_UPDATED,
+    EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_ERROR,
                                   "jebgalgnebhfojomionfpkfelancnnkf"))
         .Times(1);
   }
@@ -2926,7 +2928,7 @@
   EXPECT_CALL(observer, OnEvent(Events::COMPONENT_CHECKING_FOR_UPDATES,
                                 "jebgalgnebhfojomionfpkfelancnnkf"))
       .Times(1);
-  EXPECT_CALL(observer, OnEvent(Events::COMPONENT_NOT_UPDATED,
+  EXPECT_CALL(observer, OnEvent(Events::COMPONENT_UPDATE_ERROR,
                                 "jebgalgnebhfojomionfpkfelancnnkf"))
       .Times(1)
       .WillOnce(Invoke([&update_client](Events event, const std::string& id) {
diff --git a/components/url_matcher/regex_set_matcher.cc b/components/url_matcher/regex_set_matcher.cc
index ae0eb59..ce110293 100644
--- a/components/url_matcher/regex_set_matcher.cc
+++ b/components/url_matcher/regex_set_matcher.cc
@@ -6,8 +6,9 @@
 
 #include <stddef.h>
 
+#include <memory>
+
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_util.h"
 #include "components/url_matcher/substring_set_matcher.h"
 #include "third_party/re2/src/re2/filtered_re2.h"
@@ -102,7 +103,7 @@
   // SubstringSetMatcher doesn't own its strings.
   for (size_t i = 0; i < strings_to_match.size(); ++i) {
     substring_patterns_.push_back(
-        base::MakeUnique<StringPattern>(strings_to_match[i], i));
+        std::make_unique<StringPattern>(strings_to_match[i], i));
   }
   std::vector<const StringPattern*> patterns;
   for (const auto& pattern : substring_patterns_)
diff --git a/components/url_matcher/url_matcher_factory.cc b/components/url_matcher/url_matcher_factory.cc
index 87cbfec..50c85e71 100644
--- a/components/url_matcher/url_matcher_factory.cc
+++ b/components/url_matcher/url_matcher_factory.cc
@@ -6,12 +6,12 @@
 
 #include <algorithm>
 #include <cctype>
+#include <memory>
 #include <utility>
 
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
 #include "components/url_matcher/url_matcher_constants.h"
@@ -234,7 +234,7 @@
       return nullptr;
     }
   }
-  return base::MakeUnique<URLMatcherSchemeFilter>(schemas);
+  return std::make_unique<URLMatcherSchemeFilter>(schemas);
 }
 
 // static
@@ -268,7 +268,7 @@
     }
   }
 
-  return base::MakeUnique<URLMatcherPortFilter>(ranges);
+  return std::make_unique<URLMatcherPortFilter>(ranges);
 }
 
 }  // namespace url_matcher
diff --git a/components/url_matcher/url_matcher_factory_unittest.cc b/components/url_matcher/url_matcher_factory_unittest.cc
index 347bea4..65db5ae 100644
--- a/components/url_matcher/url_matcher_factory_unittest.cc
+++ b/components/url_matcher/url_matcher_factory_unittest.cc
@@ -11,7 +11,6 @@
 
 #include "base/format_macros.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
 #include "components/url_matcher/url_matcher_constants.h"
@@ -35,7 +34,7 @@
   // Invalid value type: {"hostSuffix": []}
   base::DictionaryValue invalid_condition2;
   invalid_condition2.Set(keys::kHostSuffixKey,
-                         base::MakeUnique<base::ListValue>());
+                         std::make_unique<base::ListValue>());
 
   // Invalid regex value: {"urlMatches": "*"}
   base::DictionaryValue invalid_condition3;
@@ -54,14 +53,14 @@
   // }
 
   // Port range: Allow 80;1000-1010.
-  auto port_range = base::MakeUnique<base::ListValue>();
+  auto port_range = std::make_unique<base::ListValue>();
   port_range->AppendInteger(1000);
   port_range->AppendInteger(1010);
-  auto port_ranges = base::MakeUnique<base::ListValue>();
+  auto port_ranges = std::make_unique<base::ListValue>();
   port_ranges->AppendInteger(80);
   port_ranges->Append(std::move(port_range));
 
-  auto scheme_list = base::MakeUnique<base::ListValue>();
+  auto scheme_list = std::make_unique<base::ListValue>();
   scheme_list->AppendString("http");
 
   base::DictionaryValue valid_condition;
@@ -143,7 +142,7 @@
   invalid_condition4.SetString(keys::kHostEqualsKey, "WWW.example.Com");
 
   // {"scheme": ["HTTP"]}
-  auto scheme_list = base::MakeUnique<base::ListValue>();
+  auto scheme_list = std::make_unique<base::ListValue>();
   scheme_list->AppendString("HTTP");
   base::DictionaryValue invalid_condition5;
   invalid_condition5.Set(keys::kSchemesKey, std::move(scheme_list));
@@ -236,7 +235,7 @@
     UrlConditionCaseTest::ResultType expected_result) const {
   base::DictionaryValue condition;
   if (use_list_of_strings_) {
-    auto list = base::MakeUnique<base::ListValue>();
+    auto list = std::make_unique<base::ListValue>();
     list->AppendString(value);
     condition.SetWithoutPathExpansion(condition_key_, std::move(list));
   } else {
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc
index dd80c6a..e015c3a 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -4,6 +4,7 @@
 
 #include "components/user_manager/user_manager_base.h"
 
+#include <memory>
 #include <stddef.h>
 #include <set>
 #include <utility>
@@ -16,7 +17,6 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
@@ -907,7 +907,7 @@
   // Add the user to the front of the user list.
   ListPrefUpdate prefs_users_update(GetLocalState(), kRegularUsers);
   prefs_users_update->Insert(
-      0, base::MakeUnique<base::Value>(user->GetAccountId().GetUserEmail()));
+      0, std::make_unique<base::Value>(user->GetAccountId().GetUserEmail()));
   users_.insert(users_.begin(), user);
 }
 
diff --git a/components/visitedlink/browser/visitedlink_master.cc b/components/visitedlink/browser/visitedlink_master.cc
index 1ce0342..7415812 100644
--- a/components/visitedlink/browser/visitedlink_master.cc
+++ b/components/visitedlink/browser/visitedlink_master.cc
@@ -9,6 +9,8 @@
 #include <algorithm>
 #include <utility>
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/containers/stack_container.h"
@@ -16,7 +18,6 @@
 #include "base/files/scoped_file.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/rand_util.h"
 #include "base/strings/string_util.h"
@@ -226,10 +227,9 @@
                                      bool persist_to_disk)
     : browser_context_(browser_context),
       delegate_(delegate),
-      listener_(base::MakeUnique<VisitedLinkEventListener>(browser_context)),
+      listener_(std::make_unique<VisitedLinkEventListener>(browser_context)),
       persist_to_disk_(persist_to_disk),
-      weak_ptr_factory_(this) {
-}
+      weak_ptr_factory_(this) {}
 
 VisitedLinkMaster::VisitedLinkMaster(Listener* listener,
                                      VisitedLinkDelegate* delegate,
diff --git a/components/viz/service/display_embedder/software_output_device_mac.cc b/components/viz/service/display_embedder/software_output_device_mac.cc
index ed3b770..b256bf2 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.cc
+++ b/components/viz/service/display_embedder/software_output_device_mac.cc
@@ -222,7 +222,11 @@
   return false;
 }
 
-bool SoftwareOutputDeviceMac::SupportGetVSyncParametersIfAvailable() {
+bool SoftwareOutputDeviceMac::SupportGetVSyncParametersIfAvailable() const {
+  return false;
+}
+
+bool SoftwareOutputDeviceMac::IsHWClock() const {
   return false;
 }
 
diff --git a/components/viz/service/display_embedder/software_output_device_mac.h b/components/viz/service/display_embedder/software_output_device_mac.h
index 0a4ebe52..4066ac5 100644
--- a/components/viz/service/display_embedder/software_output_device_mac.h
+++ b/components/viz/service/display_embedder/software_output_device_mac.h
@@ -40,7 +40,8 @@
       const gfx::VSyncProvider::UpdateVSyncCallback& callback) override;
   bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
                                      base::TimeDelta* interval) override;
-  bool SupportGetVSyncParametersIfAvailable() override;
+  bool SupportGetVSyncParametersIfAvailable() const override;
+  bool IsHWClock() const override;
 
   // Testing methods.
   SkRegion LastCopyRegionForTesting() const {
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
index 5c67eb7..e57a2c1 100644
--- a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
+++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
@@ -24,15 +24,28 @@
 
 namespace viz {
 
-FrameSinkManagerImpl::FrameSinkData::FrameSinkData() = default;
-
-FrameSinkManagerImpl::FrameSinkData::FrameSinkData(FrameSinkData&& other) =
+FrameSinkManagerImpl::FrameSinkSourceMapping::FrameSinkSourceMapping() =
     default;
 
-FrameSinkManagerImpl::FrameSinkData::~FrameSinkData() = default;
+FrameSinkManagerImpl::FrameSinkSourceMapping::FrameSinkSourceMapping(
+    FrameSinkSourceMapping&& other) = default;
 
-FrameSinkManagerImpl::FrameSinkData& FrameSinkManagerImpl::FrameSinkData::
-operator=(FrameSinkData&& other) = default;
+FrameSinkManagerImpl::FrameSinkSourceMapping::~FrameSinkSourceMapping() =
+    default;
+
+FrameSinkManagerImpl::FrameSinkSourceMapping&
+FrameSinkManagerImpl::FrameSinkSourceMapping::operator=(
+    FrameSinkSourceMapping&& other) = default;
+
+FrameSinkManagerImpl::SinkAndSupport::SinkAndSupport() = default;
+
+FrameSinkManagerImpl::SinkAndSupport::SinkAndSupport(SinkAndSupport&& other) =
+    default;
+
+FrameSinkManagerImpl::SinkAndSupport::~SinkAndSupport() = default;
+
+FrameSinkManagerImpl::SinkAndSupport& FrameSinkManagerImpl::SinkAndSupport::
+operator=(SinkAndSupport&& other) = default;
 
 FrameSinkManagerImpl::FrameSinkManagerImpl(
     uint32_t number_of_frames_to_activation_deadline,
@@ -47,13 +60,11 @@
 
 FrameSinkManagerImpl::~FrameSinkManagerImpl() {
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-
-  // All CompositorFrameSinkSupports and BeginFrameSources should be deleted
-  // before FrameSinkManagerImpl destruction.
-  DCHECK(support_map_.empty());
-  DCHECK(registered_sources_.empty());
-
   video_capturers_.clear();
+  // All FrameSinks should be unregistered prior to FrameSinkManager
+  // destruction.
+  compositor_frame_sinks_.clear();
+  DCHECK_EQ(registered_sources_.size(), 0u);
   surface_manager_.RemoveObserver(this);
   surface_manager_.RemoveObserver(&hit_test_manager_);
 }
@@ -93,13 +104,11 @@
     video_detector_->OnFrameSinkIdInvalidated(frame_sink_id);
 
   // Destroy the [Root]CompositorFrameSinkImpl if there is one. This will result
-  // in UnregisterCompositorFrameSinkSupport() being called.
-  auto iter = frame_sink_data_map_.find(frame_sink_id);
-  if (iter != frame_sink_data_map_.end()) {
+  // in UnregisterCompositorFrameSinkSupport() being called and |iter| will be
+  // invalidated afterwards
+  auto iter = compositor_frame_sinks_.find(frame_sink_id);
+  if (iter != compositor_frame_sinks_.end())
     iter->second.sink.reset();
-    if (iter->second.empty())
-      frame_sink_data_map_.erase(iter);
-  }
 }
 
 void FrameSinkManagerImpl::SetFrameSinkDebugLabel(
@@ -111,7 +120,7 @@
 void FrameSinkManagerImpl::CreateRootCompositorFrameSink(
     mojom::RootCompositorFrameSinkParamsPtr params) {
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-  DCHECK(!frame_sink_data_map_[params->frame_sink_id].sink);
+  DCHECK_EQ(0u, compositor_frame_sinks_.count(params->frame_sink_id));
   DCHECK(display_provider_);
 
   std::unique_ptr<ExternalBeginFrameControllerImpl>
@@ -131,16 +140,17 @@
       external_begin_frame_controller.get(), params->renderer_settings,
       &begin_frame_source);
 
-  frame_sink_data_map_[params->frame_sink_id].sink =
-      std::make_unique<RootCompositorFrameSinkImpl>(
-          this, params->frame_sink_id, std::move(display),
-          std::move(begin_frame_source),
-          std::move(external_begin_frame_controller),
-          std::move(params->compositor_frame_sink),
-          mojom::CompositorFrameSinkClientPtr(
-              std::move(params->compositor_frame_sink_client)),
-          std::move(params->display_private),
-          mojom::DisplayClientPtr(std::move(params->display_client)));
+  auto frame_sink = std::make_unique<RootCompositorFrameSinkImpl>(
+      this, params->frame_sink_id, std::move(display),
+      std::move(begin_frame_source), std::move(external_begin_frame_controller),
+      std::move(params->compositor_frame_sink),
+      mojom::CompositorFrameSinkClientPtr(
+          std::move(params->compositor_frame_sink_client)),
+      std::move(params->display_private),
+      mojom::DisplayClientPtr(std::move(params->display_client)));
+  SinkAndSupport& entry = compositor_frame_sinks_[params->frame_sink_id];
+  DCHECK(entry.support);  // |entry| was created by RootCompositorFrameSinkImpl.
+  entry.sink = std::move(frame_sink);
 }
 
 void FrameSinkManagerImpl::CreateCompositorFrameSink(
@@ -148,11 +158,13 @@
     mojom::CompositorFrameSinkRequest request,
     mojom::CompositorFrameSinkClientPtr client) {
   DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
-  DCHECK(!frame_sink_data_map_[frame_sink_id].sink);
+  DCHECK_EQ(0u, compositor_frame_sinks_.count(frame_sink_id));
 
-  frame_sink_data_map_[frame_sink_id].sink =
-      std::make_unique<CompositorFrameSinkImpl>(
-          this, frame_sink_id, std::move(request), std::move(client));
+  auto frame_sink = std::make_unique<CompositorFrameSinkImpl>(
+      this, frame_sink_id, std::move(request), std::move(client));
+  SinkAndSupport& entry = compositor_frame_sinks_[frame_sink_id];
+  DCHECK(entry.support);  // |entry| was created by CompositorFrameSinkImpl.
+  entry.sink = std::move(frame_sink);
 }
 
 void FrameSinkManagerImpl::RegisterFrameSinkHierarchy(
@@ -162,14 +174,14 @@
   // then this will create an infinite loop.  Might as well just crash here.
   CHECK(!ChildContains(child_frame_sink_id, parent_frame_sink_id));
 
-  auto& children = frame_sink_data_map_[parent_frame_sink_id].children;
+  auto& children = frame_sink_source_map_[parent_frame_sink_id].children;
   DCHECK(!base::ContainsKey(children, child_frame_sink_id));
   children.insert(child_frame_sink_id);
 
   // If the parent has no source, then attaching it to this child will
   // not change any downstream sources.
   BeginFrameSource* parent_source =
-      frame_sink_data_map_[parent_frame_sink_id].source;
+      frame_sink_source_map_[parent_frame_sink_id].source;
   if (!parent_source)
     return;
 
@@ -185,26 +197,30 @@
   // in time. This makes it possible to invalidate parent and child FrameSinkIds
   // independently of each other and not have an ordering dependency of
   // unregistering the hierarchy first before either of them.
-  auto iter = frame_sink_data_map_.find(parent_frame_sink_id);
-  DCHECK(iter != frame_sink_data_map_.end());
+  auto iter = frame_sink_source_map_.find(parent_frame_sink_id);
+  DCHECK(iter != frame_sink_source_map_.end());
 
   // Remove |child_frame_sink_id| from parents list of children.
-  auto& data = iter->second;
-  DCHECK(base::ContainsKey(data.children, child_frame_sink_id));
-  data.children.erase(child_frame_sink_id);
+  auto& mapping = iter->second;
+  DCHECK(base::ContainsKey(mapping.children, child_frame_sink_id));
+  mapping.children.erase(child_frame_sink_id);
 
-  // If the parent does not have a begin frame source, then disconnecting it
-  // will not change any of its children.
-  if (!data.source) {
-    if (data.empty())
-      frame_sink_data_map_.erase(iter);
+  // Delete the FrameSinkSourceMapping for |parent_frame_sink_id| if empty.
+  if (!mapping.has_children() && !mapping.source) {
+    frame_sink_source_map_.erase(iter);
     return;
   }
 
+  // If the parent does not have a begin frame source, then disconnecting it
+  // will not change any of its children.
+  BeginFrameSource* parent_source = iter->second.source;
+  if (!parent_source)
+    return;
+
   // TODO(enne): these walks could be done in one step.
-  RecursivelyDetachBeginFrameSource(child_frame_sink_id, data.source);
-  for (auto& map_entry : registered_sources_)
-    RecursivelyAttachBeginFrameSource(map_entry.second, map_entry.first);
+  RecursivelyDetachBeginFrameSource(child_frame_sink_id, parent_source);
+  for (auto& source_iter : registered_sources_)
+    RecursivelyAttachBeginFrameSource(source_iter.second, source_iter.first);
 }
 
 void FrameSinkManagerImpl::AssignTemporaryReference(const SurfaceId& surface_id,
@@ -233,30 +249,31 @@
     const FrameSinkId& frame_sink_id,
     CompositorFrameSinkSupport* support) {
   DCHECK(support);
-  DCHECK(!base::ContainsKey(support_map_, frame_sink_id));
 
-  support_map_[frame_sink_id] = support;
+  SinkAndSupport& entry = compositor_frame_sinks_[frame_sink_id];
+  DCHECK(!entry.support);
+  entry.support = support;
 
   for (auto& capturer : video_capturers_) {
     if (capturer->requested_target() == frame_sink_id)
-      capturer->SetResolvedTarget(support);
+      capturer->SetResolvedTarget(entry.support);
   }
 
-  auto it = frame_sink_data_map_.find(frame_sink_id);
-  if (it != frame_sink_data_map_.end() && it->second.source)
+  auto it = frame_sink_source_map_.find(frame_sink_id);
+  if (it != frame_sink_source_map_.end() && it->second.source)
     support->SetBeginFrameSource(it->second.source);
 }
 
 void FrameSinkManagerImpl::UnregisterCompositorFrameSinkSupport(
     const FrameSinkId& frame_sink_id) {
-  DCHECK(base::ContainsKey(support_map_, frame_sink_id));
+  DCHECK_EQ(compositor_frame_sinks_.count(frame_sink_id), 1u);
 
   for (auto& capturer : video_capturers_) {
     if (capturer->requested_target() == frame_sink_id)
       capturer->OnTargetWillGoAway();
   }
 
-  support_map_.erase(frame_sink_id);
+  compositor_frame_sinks_.erase(frame_sink_id);
 }
 
 void FrameSinkManagerImpl::RegisterBeginFrameSource(
@@ -281,7 +298,7 @@
 
   primary_source_.OnBeginFrameSourceRemoved(source);
 
-  if (frame_sink_data_map_.count(frame_sink_id) == 0u)
+  if (frame_sink_source_map_.count(frame_sink_id) == 0u)
     return;
 
   // TODO(enne): these walks could be done in one step.
@@ -300,17 +317,17 @@
 void FrameSinkManagerImpl::RecursivelyAttachBeginFrameSource(
     const FrameSinkId& frame_sink_id,
     BeginFrameSource* source) {
-  FrameSinkData& data = frame_sink_data_map_[frame_sink_id];
-  if (!data.source) {
-    data.source = source;
-    auto iter = support_map_.find(frame_sink_id);
-    if (iter != support_map_.end())
-      iter->second->SetBeginFrameSource(source);
+  FrameSinkSourceMapping& mapping = frame_sink_source_map_[frame_sink_id];
+  if (!mapping.source) {
+    mapping.source = source;
+    auto iter = compositor_frame_sinks_.find(frame_sink_id);
+    if (iter != compositor_frame_sinks_.end())
+      iter->second.support->SetBeginFrameSource(source);
   }
 
   // Copy the list of children because RecursivelyAttachBeginFrameSource() can
-  // modify |frame_sink_data_map_| and invalidate iterators.
-  base::flat_set<FrameSinkId> children = data.children;
+  // modify |frame_sink_source_map_| and invalidate iterators.
+  base::flat_set<FrameSinkId> children = mapping.children;
   for (const FrameSinkId& child : children)
     RecursivelyAttachBeginFrameSource(child, source);
 }
@@ -318,37 +335,37 @@
 void FrameSinkManagerImpl::RecursivelyDetachBeginFrameSource(
     const FrameSinkId& frame_sink_id,
     BeginFrameSource* source) {
-  auto iter = frame_sink_data_map_.find(frame_sink_id);
-  if (iter == frame_sink_data_map_.end())
+  auto iter = frame_sink_source_map_.find(frame_sink_id);
+  if (iter == frame_sink_source_map_.end())
     return;
 
-  auto& data = iter->second;
-  if (data.source == source) {
-    data.source = nullptr;
-    auto client_iter = support_map_.find(frame_sink_id);
-    if (client_iter != support_map_.end())
-      client_iter->second->SetBeginFrameSource(nullptr);
+  auto& mapping = iter->second;
+  if (mapping.source == source) {
+    mapping.source = nullptr;
+    auto client_iter = compositor_frame_sinks_.find(frame_sink_id);
+    if (client_iter != compositor_frame_sinks_.end())
+      client_iter->second.support->SetBeginFrameSource(nullptr);
   }
 
-  // Delete the FrameSinkData for |frame_sink_id| if empty.
-  if (data.empty()) {
-    frame_sink_data_map_.erase(iter);
+  // Delete the FrameSinkSourceMapping for |frame_sink_id| if empty.
+  if (!mapping.has_children()) {
+    frame_sink_source_map_.erase(iter);
     return;
   }
 
   // Copy the list of children because RecursivelyDetachBeginFrameSource() can
-  // modify |frame_sink_data_map_| and invalidate iterators.
-  base::flat_set<FrameSinkId> children = data.children;
+  // modify |frame_sink_source_map_| and invalidate iterators.
+  base::flat_set<FrameSinkId> children = mapping.children;
   for (const FrameSinkId& child : children)
     RecursivelyDetachBeginFrameSource(child, source);
 }
 
 CapturableFrameSink* FrameSinkManagerImpl::FindCapturableFrameSink(
     const FrameSinkId& frame_sink_id) {
-  const auto it = support_map_.find(frame_sink_id);
-  if (it == support_map_.end())
+  const auto it = compositor_frame_sinks_.find(frame_sink_id);
+  if (it == compositor_frame_sinks_.end())
     return nullptr;
-  return it->second;
+  return it->second.support;
 }
 
 void FrameSinkManagerImpl::OnCapturerConnectionLost(
@@ -359,8 +376,8 @@
 bool FrameSinkManagerImpl::ChildContains(
     const FrameSinkId& child_frame_sink_id,
     const FrameSinkId& search_frame_sink_id) const {
-  auto iter = frame_sink_data_map_.find(child_frame_sink_id);
-  if (iter == frame_sink_data_map_.end())
+  auto iter = frame_sink_source_map_.find(child_frame_sink_id);
+  if (iter == frame_sink_source_map_.end())
     return false;
 
   for (const FrameSinkId& child : iter->second.children) {
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.h b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
index d919f550..ef8e95a 100644
--- a/components/viz/service/frame_sinks/frame_sink_manager_impl.h
+++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
@@ -162,25 +162,37 @@
   friend class FrameSinkManagerTest;
 
   // BeginFrameSource routing information for a FrameSinkId.
-  struct FrameSinkData {
-    FrameSinkData();
-    FrameSinkData(FrameSinkData&& other);
-    ~FrameSinkData();
-    FrameSinkData& operator=(FrameSinkData&& other);
+  struct FrameSinkSourceMapping {
+    FrameSinkSourceMapping();
+    FrameSinkSourceMapping(FrameSinkSourceMapping&& other);
+    ~FrameSinkSourceMapping();
+    FrameSinkSourceMapping& operator=(FrameSinkSourceMapping&& other);
 
-    bool empty() const { return !source && children.empty() && !sink; }
-
+    bool has_children() const { return !children.empty(); }
     // The currently assigned begin frame source for this client.
     BeginFrameSource* source = nullptr;
     // This represents a dag of parent -> children mapping.
     base::flat_set<FrameSinkId> children;
 
+   private:
+    DISALLOW_COPY_AND_ASSIGN(FrameSinkSourceMapping);
+  };
+
+  struct SinkAndSupport {
+    SinkAndSupport();
+    SinkAndSupport(SinkAndSupport&& other);
+    ~SinkAndSupport();
+    SinkAndSupport& operator=(SinkAndSupport&& other);
+
     // CompositorFrameSinks owned here. This will be null if a
     // CompositorFrameSinkSupport is owned externally.
     std::unique_ptr<mojom::CompositorFrameSink> sink;
 
+    // This can be owned by |sink| or owned externally.
+    CompositorFrameSinkSupport* support = nullptr;
+
    private:
-    DISALLOW_COPY_AND_ASSIGN(FrameSinkData);
+    DISALLOW_COPY_AND_ASSIGN(SinkAndSupport);
   };
 
   void RecursivelyAttachBeginFrameSource(const FrameSinkId& frame_sink_id,
@@ -206,13 +218,11 @@
   // parent in the dag.
   base::flat_map<BeginFrameSource*, FrameSinkId> registered_sources_;
 
-  // Contains FrameSinkId hierarchy, BeginFrameSource mapping and maybe a
-  // [Root]CompositorFrameSinkImpl.
-  base::flat_map<FrameSinkId, FrameSinkData> frame_sink_data_map_;
+  // Contains FrameSinkId hierarchy and BeginFrameSource mapping.
+  base::flat_map<FrameSinkId, FrameSinkSourceMapping> frame_sink_source_map_;
 
-  // CompositorFrameSinkSupports get added to this map on creation and removed
-  // on destruction.
-  base::flat_map<FrameSinkId, CompositorFrameSinkSupport*> support_map_;
+  // Contains (and maybe owns) the CompositorFrameSinkSupport.
+  base::flat_map<FrameSinkId, SinkAndSupport> compositor_frame_sinks_;
 
   PrimaryBeginFrameSource primary_source_;
 
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc b/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
index 4491baf..9b5a2a6d 100644
--- a/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
+++ b/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
@@ -36,8 +36,8 @@
 
   // testing::Test implementation.
   void TearDown() override {
-    // Make sure that all FrameSinkData has been deleted.
-    EXPECT_TRUE(manager_.frame_sink_data_map_.empty());
+    // Make sure that all FrameSinkSourceMappings have been deleted.
+    EXPECT_TRUE(manager_.frame_sink_source_map_.empty());
   }
 
  protected:
diff --git a/components/wallpaper/wallpaper_color_calculator_unittest.cc b/components/wallpaper/wallpaper_color_calculator_unittest.cc
index fa7007d9..0245d09 100644
--- a/components/wallpaper/wallpaper_color_calculator_unittest.cc
+++ b/components/wallpaper/wallpaper_color_calculator_unittest.cc
@@ -7,7 +7,6 @@
 #include <memory>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/test/histogram_tester.h"
 #include "base/test/null_task_runner.h"
@@ -126,7 +125,7 @@
     scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
   task_runner_handle_.reset();
   task_runner_handle_ =
-      base::MakeUnique<base::ThreadTaskRunnerHandle>(task_runner);
+      std::make_unique<base::ThreadTaskRunnerHandle>(task_runner);
   if (calculator_)
     calculator_->SetTaskRunnerForTest(task_runner);
 }
@@ -136,7 +135,7 @@
   std::vector<color_utils::ColorProfile> color_profiles;
   color_profiles.emplace_back(color_utils::LumaRange::NORMAL,
                               color_utils::SaturationRange::VIBRANT);
-  calculator_ = base::MakeUnique<WallpaperColorCalculator>(
+  calculator_ = std::make_unique<WallpaperColorCalculator>(
       image, color_profiles, task_runner_);
   calculator_->AddObserver(&observer_);
 }
diff --git a/components/wallpaper/wallpaper_resizer_unittest.cc b/components/wallpaper/wallpaper_resizer_unittest.cc
index 8e81455..295c656fc 100644
--- a/components/wallpaper/wallpaper_resizer_unittest.cc
+++ b/components/wallpaper/wallpaper_resizer_unittest.cc
@@ -9,7 +9,6 @@
 #include <memory>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/threading/thread.h"
@@ -89,7 +88,7 @@
   }
 
   void WaitForResize() {
-    active_runloop_ = base::MakeUnique<base::RunLoop>();
+    active_runloop_ = std::make_unique<base::RunLoop>();
     active_runloop_->Run();
   }
 
diff --git a/components/web_cache/renderer/web_cache_impl.cc b/components/web_cache/renderer/web_cache_impl.cc
index 23a8154..332ec6aa 100644
--- a/components/web_cache/renderer/web_cache_impl.cc
+++ b/components/web_cache/renderer/web_cache_impl.cc
@@ -5,6 +5,7 @@
 #include "components/web_cache/renderer/web_cache_impl.h"
 
 #include <limits>
+#include <memory>
 
 #include "base/bind.h"
 #include "base/numerics/safe_conversions.h"
@@ -18,14 +19,14 @@
 namespace web_cache {
 
 WebCacheImpl::WebCacheImpl() : clear_cache_state_(kInit) {
-  auto registry = base::MakeUnique<service_manager::BinderRegistry>();
+  auto registry = std::make_unique<service_manager::BinderRegistry>();
   registry->AddInterface(
       base::Bind(&WebCacheImpl::BindRequest, base::Unretained(this)),
       base::ThreadTaskRunnerHandle::Get());
   if (content::ChildThread::Get()) {
     content::ChildThread::Get()
         ->GetServiceManagerConnection()
-        ->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
+        ->AddConnectionFilter(std::make_unique<content::SimpleConnectionFilter>(
             std::move(registry)));
   }
 }
diff --git a/components/web_resource/web_resource_service.cc b/components/web_resource/web_resource_service.cc
index 0e94cabe21..148ba72 100644
--- a/components/web_resource/web_resource_service.cc
+++ b/components/web_resource/web_resource_service.cc
@@ -4,6 +4,8 @@
 
 #include "components/web_resource/web_resource_service.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/location.h"
 #include "base/memory/ptr_util.h"
@@ -84,7 +86,7 @@
     // (on Android in particular) we short-cut the full parsing in the case of
     // trivially "empty" JSONs.
     if (data.empty() || data == "{}") {
-      OnUnpackFinished(base::MakeUnique<base::DictionaryValue>());
+      OnUnpackFinished(std::make_unique<base::DictionaryValue>());
     } else {
       parse_json_callback_.Run(data,
                                base::Bind(&WebResourceService::OnUnpackFinished,
diff --git a/components/web_restrictions/browser/web_restrictions_mojo_implementation.cc b/components/web_restrictions/browser/web_restrictions_mojo_implementation.cc
index a30f4273..05e2c15 100644
--- a/components/web_restrictions/browser/web_restrictions_mojo_implementation.cc
+++ b/components/web_restrictions/browser/web_restrictions_mojo_implementation.cc
@@ -4,10 +4,10 @@
 
 #include "components/web_restrictions/browser/web_restrictions_mojo_implementation.h"
 
+#include <memory>
 #include <utility>
 
 #include "base/bind.h"
-#include "base/memory/ptr_util.h"
 #include "components/web_restrictions/browser/web_restrictions_client.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
 
@@ -33,7 +33,7 @@
     WebRestrictionsClient* client,
     mojom::WebRestrictionsRequest request) {
   mojo::MakeStrongBinding(
-      base::MakeUnique<WebRestrictionsMojoImplementation>(client),
+      std::make_unique<WebRestrictionsMojoImplementation>(client),
       std::move(request));
 }
 
diff --git a/components/webcrypto/algorithms/aes_cbc_unittest.cc b/components/webcrypto/algorithms/aes_cbc_unittest.cc
index 8820498..9f7257e 100644
--- a/components/webcrypto/algorithms/aes_cbc_unittest.cc
+++ b/components/webcrypto/algorithms/aes_cbc_unittest.cc
@@ -6,10 +6,10 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <memory>
 #include <utility>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/webcrypto/algorithm_dispatch.h"
 #include "components/webcrypto/algorithms/test_helpers.h"
@@ -222,7 +222,7 @@
   dict.SetString("kty", "oct");
   dict.SetBoolean("ext", false);
   dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
-  dict.Set("key_ops", base::MakeUnique<base::ListValue>());
+  dict.Set("key_ops", std::make_unique<base::ListValue>());
 
   // The JWK does not contain encrypt usages.
   EXPECT_EQ(Status::ErrorJwkKeyopsInconsistent(),
@@ -264,7 +264,7 @@
   dict.SetString("kty", "oct");
   dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
   base::ListValue* key_ops =
-      dict.SetList("key_ops", base::MakeUnique<base::ListValue>());
+      dict.SetList("key_ops", std::make_unique<base::ListValue>());
 
   key_ops->AppendString("encrypt");
 
@@ -301,7 +301,7 @@
   base::DictionaryValue dict;
   dict.SetString("kty", "oct");
   dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
-  auto key_ops = base::MakeUnique<base::ListValue>();
+  auto key_ops = std::make_unique<base::ListValue>();
   key_ops->AppendString("encrypt");
   dict.Set("key_ops", std::move(key_ops));
 
@@ -366,7 +366,7 @@
   dict.SetString("kty", "oct");
   dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
 
-  auto key_ops = base::MakeUnique<base::ListValue>();
+  auto key_ops = std::make_unique<base::ListValue>();
   key_ops->AppendString("foo");
   dict.Set("key_ops", std::move(key_ops));
   EXPECT_EQ(Status::ErrorJwkKeyopsInconsistent(),
diff --git a/components/webcrypto/algorithms/aes_kw_unittest.cc b/components/webcrypto/algorithms/aes_kw_unittest.cc
index 12dea240..e8a9607 100644
--- a/components/webcrypto/algorithms/aes_kw_unittest.cc
+++ b/components/webcrypto/algorithms/aes_kw_unittest.cc
@@ -5,8 +5,9 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <memory>
+
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/stl_util.h"
 #include "base/values.h"
 #include "components/webcrypto/algorithm_dispatch.h"
@@ -60,7 +61,7 @@
   dict.SetString("kty", "oct");
   dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
   base::ListValue* key_ops =
-      dict.SetList("key_ops", base::MakeUnique<base::ListValue>());
+      dict.SetList("key_ops", std::make_unique<base::ListValue>());
 
   key_ops->AppendString("wrapKey");
 
diff --git a/components/webcrypto/algorithms/hmac_unittest.cc b/components/webcrypto/algorithms/hmac_unittest.cc
index 6765714..774db86 100644
--- a/components/webcrypto/algorithms/hmac_unittest.cc
+++ b/components/webcrypto/algorithms/hmac_unittest.cc
@@ -6,10 +6,10 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <memory>
 #include <utility>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/webcrypto/algorithm_dispatch.h"
 #include "components/webcrypto/algorithms/test_helpers.h"
@@ -232,7 +232,7 @@
   dict.SetString("kty", "oct");
   dict.SetString("k", "GADWrMRHwQfoNaXU5fZvTg");
   base::ListValue* key_ops =
-      dict.SetList("key_ops", base::MakeUnique<base::ListValue>());
+      dict.SetList("key_ops", std::make_unique<base::ListValue>());
 
   key_ops->AppendString("sign");
 
@@ -264,7 +264,7 @@
   dict.SetString("alg", "HS256");
   dict.SetString("use", "sig");
 
-  auto key_ops = base::MakeUnique<base::ListValue>();
+  auto key_ops = std::make_unique<base::ListValue>();
   key_ops->AppendString("sign");
   key_ops->AppendString("verify");
   key_ops->AppendString("encrypt");
diff --git a/components/webcrypto/algorithms/sha.cc b/components/webcrypto/algorithms/sha.cc
index a81130f..e1ed20a 100644
--- a/components/webcrypto/algorithms/sha.cc
+++ b/components/webcrypto/algorithms/sha.cc
@@ -119,7 +119,7 @@
 }  // namespace
 
 std::unique_ptr<AlgorithmImplementation> CreateShaImplementation() {
-  return base::MakeUnique<ShaImplementation>();
+  return std::make_unique<ShaImplementation>();
 }
 
 std::unique_ptr<blink::WebCryptoDigestor> CreateDigestorImplementation(
diff --git a/components/webdata_services/web_data_service_wrapper.cc b/components/webdata_services/web_data_service_wrapper.cc
index 86939a9..b3d23b5 100644
--- a/components/webdata_services/web_data_service_wrapper.cc
+++ b/components/webdata_services/web_data_service_wrapper.cc
@@ -4,11 +4,12 @@
 
 #include "components/webdata_services/web_data_service_wrapper.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/callback.h"
 #include "base/feature_list.h"
 #include "base/files/file_path.h"
-#include "base/memory/ptr_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/task_scheduler/post_task.h"
 #include "build/build_config.h"
@@ -99,18 +100,18 @@
 
   // All tables objects that participate in managing the database must
   // be added here.
-  web_database_->AddTable(base::MakeUnique<autofill::AutofillTable>());
-  web_database_->AddTable(base::MakeUnique<KeywordTable>());
+  web_database_->AddTable(std::make_unique<autofill::AutofillTable>());
+  web_database_->AddTable(std::make_unique<KeywordTable>());
   // TODO(mdm): We only really need the LoginsTable on Windows for IE7 password
   // access, but for now, we still create it on all platforms since it deletes
   // the old logins table. We can remove this after a while, e.g. in M22 or so.
-  web_database_->AddTable(base::MakeUnique<LoginsTable>());
-  web_database_->AddTable(base::MakeUnique<TokenServiceTable>());
+  web_database_->AddTable(std::make_unique<LoginsTable>());
+  web_database_->AddTable(std::make_unique<TokenServiceTable>());
 #if !defined(OS_IOS)
   web_database_->AddTable(
-      base::MakeUnique<payments::PaymentMethodManifestTable>());
+      std::make_unique<payments::PaymentMethodManifestTable>());
   web_database_->AddTable(
-      base::MakeUnique<payments::WebAppManifestSectionTable>());
+      std::make_unique<payments::WebAppManifestSectionTable>());
 #endif
   web_database_->LoadDatabase();
 
diff --git a/components/zoom/zoom_event_manager.cc b/components/zoom/zoom_event_manager.cc
index cdb88db..a4b0860 100644
--- a/components/zoom/zoom_event_manager.cc
+++ b/components/zoom/zoom_event_manager.cc
@@ -4,7 +4,8 @@
 
 #include "components/zoom/zoom_event_manager.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "components/zoom/zoom_event_manager_observer.h"
 #include "content/public/browser/browser_context.h"
 
@@ -18,7 +19,7 @@
     content::BrowserContext* context) {
   if (!context->GetUserData(kBrowserZoomEventManager)) {
     context->SetUserData(kBrowserZoomEventManager,
-                         base::MakeUnique<ZoomEventManager>());
+                         std::make_unique<ZoomEventManager>());
   }
   return static_cast<ZoomEventManager*>(
       context->GetUserData(kBrowserZoomEventManager));
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index a36be8d5..6e5eaf9 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -169,7 +169,6 @@
 }
 
 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
-
 void LoadV8SnapshotFile() {
 #if defined(USE_V8_CONTEXT_SNAPSHOT)
   static constexpr gin::V8Initializer::V8SnapshotFileType kSnapshotType =
@@ -196,6 +195,7 @@
     return;
   }
 #endif  // OS_POSIX && !OS_MACOSX
+
 #if !defined(CHROME_MULTIPLE_DLL_BROWSER)
   gin::V8Initializer::LoadV8Snapshot(kSnapshotType);
 #endif  // !CHROME_MULTIPLE_DLL_BROWSER
diff --git a/content/browser/browser_side_navigation_browsertest.cc b/content/browser/browser_side_navigation_browsertest.cc
index 8dc7b80..fdb17c8 100644
--- a/content/browser/browser_side_navigation_browsertest.cc
+++ b/content/browser/browser_side_navigation_browsertest.cc
@@ -461,7 +461,7 @@
       base::TimeTicks::Now() /* navigation_start */, "GET",
       nullptr /* post_data */, base::Optional<SourceLocation>(),
       CSPDisposition::CHECK, false /* started_from_context_menu */,
-      false /* has_user_gesture */);
+      false /* has_user_gesture */, base::nullopt /* suggested_filename */);
   mojom::BeginNavigationParamsPtr begin_params =
       mojom::BeginNavigationParams::New(
           std::string() /* headers */, net::LOAD_NORMAL,
@@ -469,8 +469,7 @@
           blink::WebMixedContentContextType::kBlockable,
           false /* is_form_submission */, GURL() /* searchable_form_url */,
           std::string() /* searchable_form_encoding */,
-          url::Origin::Create(data_url), GURL() /* client_side_redirect_url */,
-          base::nullopt /* suggested_filename */);
+          url::Origin::Create(data_url), GURL() /* client_side_redirect_url */);
 
   // Receiving the invalid IPC message should lead to renderer process
   // termination.
diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
index 084675a..008c7ea 100644
--- a/content/browser/child_process_security_policy_impl.cc
+++ b/content/browser/child_process_security_policy_impl.cc
@@ -807,20 +807,7 @@
           return false;
         break;
 
-      case network::DataElement::TYPE_FILE_FILESYSTEM:
-        if (!CanReadFileSystemFile(child_id, file_system_context->CrackURL(
-                                                 element.filesystem_url())))
-          return false;
-        break;
-
-      case network::DataElement::TYPE_DISK_CACHE_ENTRY:
-        // TYPE_DISK_CACHE_ENTRY can't be sent via IPC according to
-        // content/common/resource_messages.cc
-        NOTREACHED();
-        return false;
-
       case network::DataElement::TYPE_BYTES:
-      case network::DataElement::TYPE_BYTES_DESCRIPTION:
         // Data is self-contained within |body| - no need to check access.
         break;
 
diff --git a/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc b/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc
index 7927f3b..f9d7405 100644
--- a/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc
+++ b/content/browser/compositor/software_browser_compositor_output_surface_unittest.cc
@@ -36,7 +36,8 @@
     return false;
   }
 
-  bool SupportGetVSyncParametersIfAvailable() override { return false; }
+  bool SupportGetVSyncParametersIfAvailable() const override { return false; }
+  bool IsHWClock() const override { return false; }
 
   int call_count() const { return call_count_; }
 
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
index a925693a..a261fcf7 100644
--- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -27,6 +27,7 @@
 #include "content/browser/frame_host/render_frame_host_impl.h"
 #include "content/browser/loader/resource_dispatcher_host_impl.h"
 #include "content/browser/web_contents/web_contents_impl.h"
+#include "content/browser/web_contents/web_contents_view.h"
 #include "content/common/frame_messages.h"
 #include "content/common/page_state_serialization.h"
 #include "content/public/browser/navigation_controller.h"
@@ -40,7 +41,9 @@
 #include "content/public/common/bindings_policy.h"
 #include "content/public/common/browser_side_navigation_policy.h"
 #include "content/public/common/renderer_preferences.h"
+#include "content/public/common/screen_info.h"
 #include "content/public/common/url_constants.h"
+#include "content/public/common/use_zoom_for_dsf_policy.h"
 #include "content/public/test/browser_test_utils.h"
 #include "content/public/test/content_browser_test.h"
 #include "content/public/test/content_browser_test_utils.h"
@@ -1424,15 +1427,25 @@
 
   std::string script =
       "domAutomationController.send(document.getElementById('div').scrollTop)";
-  int value = 0;
-  EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), script, &value));
-  EXPECT_EQ(100, value);
+  double value = 0;
+  EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), script, &value));
+
+  double expected = 100;
+  if (UseZoomForDSFEnabled()) {
+    WebContentsView* view =
+        static_cast<WebContentsImpl*>(shell()->web_contents())->GetView();
+    ScreenInfo screen_info;
+    view->GetScreenInfo(&screen_info);
+    expected = floor(screen_info.device_scale_factor * expected) /
+               screen_info.device_scale_factor;
+  }
+  EXPECT_FLOAT_EQ(expected, value);
 
   // Reload.
   ReloadBlockUntilNavigationsComplete(shell(), 1);
 
-  EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), script, &value));
-  EXPECT_EQ(100, value);
+  EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), script, &value));
+  EXPECT_FLOAT_EQ(expected, value);
 }
 
 // Verify that reloading a page with url anchor and scroll scrolls to correct
@@ -1450,24 +1463,39 @@
       "domAutomationController.send(document.getElementById('div').scrollTop)";
   std::string get_window_scroll_y =
       "domAutomationController.send(window.scrollY)";
-  int div_scroll_top = 0;
-  int window_scroll_y = 0;
-  EXPECT_TRUE(
-      ExecuteScriptAndExtractInt(shell(), get_div_scroll_top, &div_scroll_top));
-  EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), get_window_scroll_y,
-                                         &window_scroll_y));
-  EXPECT_EQ(100, div_scroll_top);
-  EXPECT_EQ(10, window_scroll_y);
+  double div_scroll_top = 0;
+  double window_scroll_y = 0;
+  EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), get_div_scroll_top,
+                                            &div_scroll_top));
+  EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), get_window_scroll_y,
+                                            &window_scroll_y));
+
+  double expected_div_scroll_top = 100;
+  double expected_window_scroll_y = 10;
+  if (UseZoomForDSFEnabled()) {
+    WebContentsView* view =
+        static_cast<WebContentsImpl*>(shell()->web_contents())->GetView();
+    ScreenInfo screen_info;
+    view->GetScreenInfo(&screen_info);
+    expected_div_scroll_top =
+        floor(screen_info.device_scale_factor * expected_div_scroll_top) /
+        screen_info.device_scale_factor;
+    expected_window_scroll_y =
+        floor(screen_info.device_scale_factor * expected_window_scroll_y) /
+        screen_info.device_scale_factor;
+  }
+  EXPECT_FLOAT_EQ(expected_div_scroll_top, div_scroll_top);
+  EXPECT_FLOAT_EQ(expected_window_scroll_y, window_scroll_y);
 
   // Reload.
   ReloadBlockUntilNavigationsComplete(shell(), 1);
 
-  EXPECT_TRUE(
-      ExecuteScriptAndExtractInt(shell(), get_div_scroll_top, &div_scroll_top));
-  EXPECT_TRUE(ExecuteScriptAndExtractInt(shell(), get_window_scroll_y,
-                                         &window_scroll_y));
-  EXPECT_EQ(100, div_scroll_top);
-  EXPECT_EQ(10, window_scroll_y);
+  EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), get_div_scroll_top,
+                                            &div_scroll_top));
+  EXPECT_TRUE(ExecuteScriptAndExtractDouble(shell(), get_window_scroll_y,
+                                            &window_scroll_y));
+  EXPECT_FLOAT_EQ(expected_div_scroll_top, div_scroll_top);
+  EXPECT_FLOAT_EQ(expected_window_scroll_y, window_scroll_y);
 }
 
 // Verify that empty GURL navigations are not classified as SAME_PAGE.
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc
index c95328e..9067e8b 100644
--- a/content/browser/frame_host/navigation_entry_impl.cc
+++ b/content/browser/frame_host/navigation_entry_impl.cc
@@ -700,7 +700,7 @@
       navigation_start, method, post_body ? post_body : post_data_,
       base::Optional<SourceLocation>(),
       CSPDisposition::CHECK /* should_check_main_world_csp */,
-      has_started_from_context_menu(), user_gesture);
+      has_started_from_context_menu(), user_gesture, suggested_filename_);
 }
 
 RequestNavigationParams NavigationEntryImpl::ConstructRequestNavigationParams(
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index f5e34d5b..511ee204 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -261,9 +261,6 @@
           controller->GetEntryCount());
   request_params.post_content_type = post_content_type;
 
-  // TODO(jochen): Move suggested_filename from BeginNavigationParams to
-  // CommonNavigationParams, now that it's also used here for browser initiated
-  // requests.
   std::unique_ptr<NavigationRequest> navigation_request(new NavigationRequest(
       frame_tree_node, common_params,
       mojom::BeginNavigationParams::New(
@@ -272,7 +269,7 @@
           blink::WebMixedContentContextType::kBlockable, is_form_submission,
           GURL() /* searchable_form_url */,
           std::string() /* searchable_form_encoding */, initiator,
-          GURL() /* client_side_redirect_url */, entry.suggested_filename()),
+          GURL() /* client_side_redirect_url */),
       request_params, browser_initiated, false /* from_begin_navigation */,
       &frame_entry, &entry));
   return navigation_request;
@@ -549,7 +546,7 @@
           common_params_.navigation_start, nav_entry_id_,
           common_params_.started_from_context_menu,
           common_params_.should_check_main_world_csp,
-          begin_params_->is_form_submission, begin_params_->suggested_filename,
+          begin_params_->is_form_submission, common_params_.suggested_filename,
           common_params_.method, common_params_.post_data,
           Referrer::SanitizeForRequest(common_params_.url,
                                        common_params_.referrer),
@@ -1175,7 +1172,7 @@
           BrowserContext::GetDownloadManager(browser_context));
       download_manager->InterceptNavigation(
           std::move(resource_request), navigation_handle_->GetRedirectChain(),
-          begin_params_->suggested_filename, response_,
+          common_params_.suggested_filename, response_,
           std::move(url_loader_client_endpoints_), ssl_info_.cert_status,
           frame_tree_node_->frame_tree_node_id());
 
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index c6ef1f6b..45e30e6 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -3310,7 +3310,8 @@
       GURL(), GURL(), PREVIEWS_OFF, base::TimeTicks::Now(), "GET", nullptr,
       base::Optional<SourceLocation>(),
       CSPDisposition::CHECK /* should_check_main_world_csp */,
-      false /* started_from_context_menu */, false /* has_user_gesture */);
+      false /* started_from_context_menu */, false /* has_user_gesture */,
+      base::nullopt /* suggested_filename */);
   CommitNavigation(nullptr, network::mojom::URLLoaderClientEndpointsPtr(),
                    std::unique_ptr<StreamHandle>(), common_params,
                    RequestNavigationParams(), false, base::nullopt,
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
index 9518ccc..b05d2a4 100644
--- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -1582,7 +1582,7 @@
 // a regression test for crbug.com/796135.
 IN_PROC_BROWSER_TEST_F(
     RenderFrameHostManagerTest,
-    DeleteSpeculativeRFHPedningCommitOfPendingEntryOnInterrupted) {
+    DeleteSpeculativeRFHPendingCommitOfPendingEntryOnInterrupted1) {
   const std::string kOriginalPath = "/original.html";
   const std::string kFirstRedirectPath = "/redirect1.html";
   const std::string kSecondRedirectPath = "/reidrect2.html";
@@ -1693,6 +1693,117 @@
   EXPECT_FALSE(speculative_rfh);
 }
 
+// Ensures that deleting a speculative RenderFrameHost trying to commit a
+// navigation to the pending NavigationEntry will not crash if it happens
+// because a new navigation to the same pending NavigationEntry started.  This
+// is a variant of the previous test, where we destroy the speculative
+// RenderFrameHost to create another speculative RenderFrameHost.This is a
+// regression test for crbug.com/796135.
+IN_PROC_BROWSER_TEST_F(
+    RenderFrameHostManagerTest,
+    DeleteSpeculativeRFHPendingCommitOfPendingEntryOnInterrupted2) {
+  const std::string kOriginalPath = "/original.html";
+  const std::string kRedirectPath = "/redirect.html";
+  ControllableHttpResponse original_response1(embedded_test_server(),
+                                              kOriginalPath);
+  ControllableHttpResponse original_response2(embedded_test_server(),
+                                              kOriginalPath);
+  ControllableHttpResponse redirect_response(embedded_test_server(),
+                                             kRedirectPath);
+  EXPECT_TRUE(embedded_test_server()->Start());
+
+  const GURL kOriginalURL =
+      embedded_test_server()->GetURL("a.com", kOriginalPath);
+  const GURL kRedirectURL =
+      embedded_test_server()->GetURL("b.com", kRedirectPath);
+  const GURL kCrossSiteURL =
+      embedded_test_server()->GetURL("c.com", "/title1.html");
+
+  // First navigate to the initial URL.
+  shell()->LoadURL(kOriginalURL);
+  original_response1.WaitForRequest();
+  original_response1.Send(
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Type: text/html; charset=utf-8\r\n"
+      "Cache-Control: no-cache, no-store, must-revalidate\r\n"
+      "Pragma: no-cache\r\n"
+      "\r\n");
+  original_response1.Send(
+      "<html>"
+      "<body></body>"
+      "</html>");
+  original_response1.Done();
+  EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
+  EXPECT_EQ(kOriginalURL, shell()->web_contents()->GetVisibleURL());
+
+  // Navigate cross-site.
+  NavigateToURL(shell(), kCrossSiteURL);
+
+  // Now go back to the original request, which will do a cross-site redirect.
+  TestNavigationManager first_back(shell()->web_contents(), kOriginalURL);
+  shell()->GoBackOrForward(-1);
+  EXPECT_TRUE(first_back.WaitForRequestStart());
+  first_back.ResumeNavigation();
+
+  original_response2.WaitForRequest();
+  original_response2.Send(
+      "HTTP/1.1 302 FOUND\r\n"
+      "Location: " +
+      kRedirectURL.spec() +
+      "\r\n"
+      "\r\n");
+  original_response2.Done();
+  redirect_response.WaitForRequest();
+  redirect_response.Send(
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Type: text/html; charset=utf-8\r\n"
+      "\r\n");
+  EXPECT_TRUE(first_back.WaitForResponse());
+  first_back.ResumeNavigation();
+
+  // The navigation is ready to commit: it has been handed to the speculative
+  // RenderFrameHost for commit.
+  RenderFrameHostImpl* speculative_rfh =
+      static_cast<WebContentsImpl*>(shell()->web_contents())
+          ->GetFrameTree()
+          ->root()
+          ->render_manager()
+          ->speculative_frame_host();
+  CHECK(speculative_rfh);
+  EXPECT_TRUE(speculative_rfh->is_loading());
+  int site_instance_id = speculative_rfh->GetSiteInstance()->GetId();
+
+  // The user starts a navigation towards the redirected URL, for which we have
+  // a speculative RenderFrameHost. This shouldn't delete the speculative
+  // RenderFrameHost.
+  TestNavigationManager navigation_to_redirect(shell()->web_contents(),
+                                               kRedirectURL);
+  shell()->LoadURL(kRedirectURL);
+  EXPECT_TRUE(navigation_to_redirect.WaitForRequestStart());
+  speculative_rfh = static_cast<WebContentsImpl*>(shell()->web_contents())
+                        ->GetFrameTree()
+                        ->root()
+                        ->render_manager()
+                        ->speculative_frame_host();
+  CHECK(speculative_rfh);
+  EXPECT_EQ(site_instance_id, speculative_rfh->GetSiteInstance()->GetId());
+
+  // The user requests to go back again while the previous back hasn't committed
+  // yet. This should delete the speculative RenderFrameHost trying to commit
+  // the back, and re-create a new speculative RenderFrameHost. This shouldn't
+  // crash.
+  TestNavigationManager second_back(shell()->web_contents(), kOriginalURL);
+  shell()->GoBackOrForward(-1);
+  EXPECT_TRUE(second_back.WaitForRequestStart());
+  speculative_rfh = static_cast<WebContentsImpl*>(shell()->web_contents())
+                        ->GetFrameTree()
+                        ->root()
+                        ->render_manager()
+                        ->speculative_frame_host();
+  CHECK(speculative_rfh);
+  EXPECT_NE(site_instance_id, speculative_rfh->GetSiteInstance()->GetId());
+}
+
 // Test for crbug.com/9682.  We should not show the URL for a pending renderer-
 // initiated navigation in a new tab if it is not the initial navigation.  In
 // this case, the renderer will not notify us of a modification, so we cannot
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc
index d9297fa..59e8b62 100644
--- a/content/browser/loader/navigation_url_loader_network_service.cc
+++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -790,7 +790,7 @@
         /* default_url_factory_getter = */ nullptr,
         request_info->common_params.url,
         request_info->begin_params->initiator_origin,
-        request_info->begin_params->suggested_filename,
+        request_info->common_params.suggested_filename,
         weak_factory_.GetWeakPtr());
 
     BrowserThread::PostTask(
@@ -874,7 +874,7 @@
       std::move(initial_handlers), std::move(new_request), resource_context,
       partition->url_loader_factory_getter(), request_info->common_params.url,
       request_info->begin_params->initiator_origin,
-      request_info->begin_params->suggested_filename,
+      request_info->common_params.suggested_filename,
       weak_factory_.GetWeakPtr());
   BrowserThread::PostTask(
       BrowserThread::IO, FROM_HERE,
diff --git a/content/browser/loader/navigation_url_loader_network_service_unittest.cc b/content/browser/loader/navigation_url_loader_network_service_unittest.cc
index fab2e5c..a8d8491 100644
--- a/content/browser/loader/navigation_url_loader_network_service_unittest.cc
+++ b/content/browser/loader/navigation_url_loader_network_service_unittest.cc
@@ -113,8 +113,7 @@
             blink::WebMixedContentContextType::kBlockable,
             false /* is_form_submission */, GURL() /* searchable_form_url */,
             std::string() /* searchable_form_encoding */,
-            url::Origin::Create(url), GURL() /* client_side_redirect_url */,
-            base::nullopt /* suggested_filename */);
+            url::Origin::Create(url), GURL() /* client_side_redirect_url */);
 
     CommonNavigationParams common_params;
     common_params.url = url;
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc
index 4d3c191..d1bc87a 100644
--- a/content/browser/loader/navigation_url_loader_unittest.cc
+++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -152,8 +152,7 @@
             blink::WebMixedContentContextType::kBlockable,
             false /* is_form_submission */, GURL() /* searchable_form_url */,
             std::string() /* searchable_form_encoding */,
-            url::Origin::Create(url), GURL() /* client_side_redirect_url */,
-            base::nullopt /* suggested_filename */);
+            url::Origin::Create(url), GURL() /* client_side_redirect_url */);
     CommonNavigationParams common_params;
     common_params.url = url;
     common_params.allow_download = allow_download;
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index a3b18e99e..1b6059a3 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1951,7 +1951,7 @@
       // If in the future this changes this should be updated to somehow get a
       // meaningful value.
       false,                                   // initiated_in_secure_context
-      info.begin_params->suggested_filename);  // suggested_filename
+      info.common_params.suggested_filename);  // suggested_filename
   extra_info->SetBlobHandles(std::move(blob_handles));
   extra_info->set_navigation_ui_data(std::move(navigation_ui_data));
 
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index f03fd144..0621c87 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -815,8 +815,7 @@
               blink::WebMixedContentContextType::kBlockable,
               false /* is_form_submission */, GURL() /* searchable_form_url */,
               std::string() /* searchable_form_encoding */,
-              url::Origin::Create(url), GURL() /* client_side_redirect_url */,
-              base::nullopt /* suggested_filename */);
+              url::Origin::Create(url), GURL() /* client_side_redirect_url */);
       CommonNavigationParams common_params;
       common_params.url = url;
       std::unique_ptr<NavigationRequestInfo> request_info(
diff --git a/content/browser/loader/upload_data_stream_builder.cc b/content/browser/loader/upload_data_stream_builder.cc
index 4b942c0..802a4ae 100644
--- a/content/browser/loader/upload_data_stream_builder.cc
+++ b/content/browser/loader/upload_data_stream_builder.cc
@@ -108,12 +108,7 @@
                 std::move(handle)));
         break;
       }
-      case network::DataElement::TYPE_FILE_FILESYSTEM:
-        CHECK(false) << "Should never be reached";
-        break;
       case network::DataElement::TYPE_RAW_FILE:
-      case network::DataElement::TYPE_DISK_CACHE_ENTRY:
-      case network::DataElement::TYPE_BYTES_DESCRIPTION:
       case network::DataElement::TYPE_DATA_PIPE:
       case network::DataElement::TYPE_UNKNOWN:
         NOTREACHED();
diff --git a/content/browser/service_worker/service_worker_context_request_handler.cc b/content/browser/service_worker/service_worker_context_request_handler.cc
index 54681eac..8c21ad6e5 100644
--- a/content/browser/service_worker/service_worker_context_request_handler.cc
+++ b/content/browser/service_worker/service_worker_context_request_handler.cc
@@ -4,6 +4,7 @@
 
 #include "content/browser/service_worker/service_worker_context_request_handler.h"
 
+#include "base/command_line.h"
 #include "base/time/time.h"
 #include "content/browser/service_worker/service_worker_context_core.h"
 #include "content/browser/service_worker/service_worker_provider_host.h"
@@ -11,6 +12,7 @@
 #include "content/browser/service_worker/service_worker_storage.h"
 #include "content/browser/service_worker/service_worker_version.h"
 #include "content/browser/service_worker/service_worker_write_to_cache_job.h"
+#include "content/public/common/content_switches.h"
 #include "net/base/load_flags.h"
 #include "net/log/net_log.h"
 #include "net/log/net_log_event_type.h"
@@ -21,6 +23,31 @@
 
 namespace content {
 
+namespace {
+
+bool ShouldBypassCacheDueToUpdateViaCache(
+    bool is_main_script,
+    blink::mojom::ServiceWorkerUpdateViaCache cache_mode) {
+  // TODO(https://crbug.com/675540): Remove the command line check and always
+  // respect cache_mode when shipping updateViaCache flag to stable.
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kEnableExperimentalWebPlatformFeatures)) {
+    return false;
+  }
+  switch (cache_mode) {
+    case blink::mojom::ServiceWorkerUpdateViaCache::kImports:
+      return is_main_script;
+    case blink::mojom::ServiceWorkerUpdateViaCache::kNone:
+      return true;
+    case blink::mojom::ServiceWorkerUpdateViaCache::kAll:
+      return false;
+  }
+  NOTREACHED() << static_cast<int>(cache_mode);
+  return false;
+}
+
+}  // namespace
+
 ServiceWorkerContextRequestHandler::ServiceWorkerContextRequestHandler(
     base::WeakPtr<ServiceWorkerContextCore> context,
     base::WeakPtr<ServiceWorkerProviderHost> provider_host,
@@ -191,7 +218,10 @@
   int extra_load_flags = 0;
   base::TimeDelta time_since_last_check =
       base::Time::Now() - registration->last_update_check();
-  if (time_since_last_check > kServiceWorkerScriptMaxCacheAge ||
+
+  if (ShouldBypassCacheDueToUpdateViaCache(is_main_script,
+                                           registration->update_via_cache()) ||
+      time_since_last_check > kServiceWorkerScriptMaxCacheAge ||
       version_->force_bypass_cache_for_scripts()) {
     extra_load_flags = net::LOAD_BYPASS_CACHE;
   }
diff --git a/content/browser/service_worker/service_worker_context_request_handler_unittest.cc b/content/browser/service_worker/service_worker_context_request_handler_unittest.cc
index efefecec..147ff44 100644
--- a/content/browser/service_worker/service_worker_context_request_handler_unittest.cc
+++ b/content/browser/service_worker/service_worker_context_request_handler_unittest.cc
@@ -10,6 +10,7 @@
 #include "base/logging.h"
 #include "base/run_loop.h"
 #include "base/test/histogram_tester.h"
+#include "base/test/scoped_feature_list.h"
 #include "content/browser/browser_thread_impl.h"
 #include "content/browser/service_worker/embedded_worker_test_helper.h"
 #include "content/browser/service_worker/service_worker_context_core.h"
@@ -20,6 +21,7 @@
 #include "content/browser/service_worker/service_worker_write_to_cache_job.h"
 #include "content/common/service_worker/service_worker_utils.h"
 #include "content/public/browser/resource_request_info.h"
+#include "content/public/common/content_features.h"
 #include "content/public/test/test_browser_context.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "net/base/load_flags.h"
@@ -133,6 +135,37 @@
         network::mojom::RequestContextFrameType::kNone, nullptr);
   }
 
+  // Tests if net::LOAD_BYPASS_CACHE is set for a resource fetch.
+  void TestBypassCache(const GURL& url,
+                       ResourceType resource_type,
+                       bool expect_bypass) {
+    // TODO(https://crbug.com/675540): Remove the following command line switch
+    // when updateViaCache is shipped to stable.
+    base::CommandLine::ForCurrentProcess()->AppendSwitch(
+        switches::kEnableExperimentalWebPlatformFeatures);
+
+    std::unique_ptr<net::URLRequest> request(CreateRequest(url));
+    std::unique_ptr<ServiceWorkerContextRequestHandler> handler(
+        CreateHandler(resource_type));
+    std::unique_ptr<net::URLRequestJob> job(
+        handler->MaybeCreateJob(request.get(), nullptr, nullptr));
+    ASSERT_TRUE(job.get());
+    ServiceWorkerWriteToCacheJob* sw_job =
+        static_cast<ServiceWorkerWriteToCacheJob*>(job.get());
+    if (expect_bypass)
+      EXPECT_TRUE(sw_job->net_request_->load_flags() & net::LOAD_BYPASS_CACHE);
+    else
+      EXPECT_FALSE(sw_job->net_request_->load_flags() & net::LOAD_BYPASS_CACHE);
+  }
+
+  void TestBypassCacheForMainScript(bool expect_bypass) {
+    TestBypassCache(script_url_, RESOURCE_TYPE_SERVICE_WORKER, expect_bypass);
+  }
+
+  void TestBypassCacheForImportedScript(bool expect_bypass) {
+    TestBypassCache(import_script_url_, RESOURCE_TYPE_SCRIPT, expect_bypass);
+  }
+
  protected:
   TestBrowserThreadBundle browser_thread_bundle_;
   std::unique_ptr<EmbeddedWorkerTestHelper> helper_;
@@ -155,6 +188,18 @@
   registration_->set_last_update_check(base::Time::Now());
   version_->SetStatus(ServiceWorkerVersion::NEW);
 
+  TestBypassCacheForMainScript(true);
+  TestBypassCacheForImportedScript(false);
+}
+
+// TODO(https://crbug.com/675540): Remove the
+// UpdateBefore24HoursWithoutUpdateViaCache test when the update_via_cache flag
+// is shipped to stable as this is to test the legacy behavior.
+TEST_F(ServiceWorkerContextRequestHandlerTest,
+       UpdateBefore24HoursWithoutUpdateViaCache) {
+  registration_->set_last_update_check(base::Time::Now());
+  version_->SetStatus(ServiceWorkerVersion::NEW);
+
   // Conduct a resource fetch for the main script.
   base::HistogramTester histograms;
   std::unique_ptr<net::URLRequest> request(CreateRequest(script_url_));
@@ -175,52 +220,82 @@
   EXPECT_FALSE(sw_job->net_request_->load_flags() & net::LOAD_BYPASS_CACHE);
 }
 
+TEST_F(ServiceWorkerContextRequestHandlerTest,
+       UpdateBefore24HoursWithUpdateViaCacheAll) {
+  registration_->set_update_via_cache(
+      blink::mojom::ServiceWorkerUpdateViaCache::kAll);
+  // Give the registration a very recent last update time and pretend
+  // we're installing a new version.
+  registration_->set_last_update_check(base::Time::Now());
+  version_->SetStatus(ServiceWorkerVersion::NEW);
+
+  TestBypassCacheForMainScript(false);
+  TestBypassCacheForImportedScript(false);
+}
+
+TEST_F(ServiceWorkerContextRequestHandlerTest,
+       UpdateBefore24HoursWithUpdateViaCacheNone) {
+  registration_->set_update_via_cache(
+      blink::mojom::ServiceWorkerUpdateViaCache::kNone);
+  // Give the registration a very recent last update time and pretend
+  // we're installing a new version.
+  registration_->set_last_update_check(base::Time::Now());
+  version_->SetStatus(ServiceWorkerVersion::NEW);
+
+  TestBypassCacheForMainScript(true);
+  TestBypassCacheForImportedScript(true);
+}
+
 TEST_F(ServiceWorkerContextRequestHandlerTest, UpdateAfter24Hours) {
   // Give the registration a old update time and pretend
   // we're installing a new version.
+  registration_->set_last_update_check(base::Time::Now() -
+                                       base::TimeDelta::FromDays(7));
+  version_->SetStatus(ServiceWorkerVersion::NEW);
+
+  TestBypassCacheForMainScript(true);
+  TestBypassCacheForImportedScript(true);
+}
+
+TEST_F(ServiceWorkerContextRequestHandlerTest,
+       UpdateAfter24HoursWithUpdateViaCacheAll) {
+  registration_->set_update_via_cache(
+      blink::mojom::ServiceWorkerUpdateViaCache::kAll);
+  // Give the registration a old update time and pretend
+  // we're installing a new version.
+  registration_->set_last_update_check(base::Time::Now() -
+                                       base::TimeDelta::FromDays(7));
+  version_->SetStatus(ServiceWorkerVersion::NEW);
+
+  TestBypassCacheForMainScript(true);
+  TestBypassCacheForImportedScript(true);
+}
+
+TEST_F(ServiceWorkerContextRequestHandlerTest,
+       UpdateAfter24HoursWithUpdateViaCacheNone) {
+  registration_->set_update_via_cache(
+      blink::mojom::ServiceWorkerUpdateViaCache::kNone);
+  // Give the registration a old update time and pretend
+  // we're installing a new version.
   registration_->set_last_update_check(
       base::Time::Now() - base::TimeDelta::FromDays(7));
   version_->SetStatus(ServiceWorkerVersion::NEW);
 
-  // Conduct a resource fetch for the main script.
-  base::HistogramTester histograms;
-  std::unique_ptr<net::URLRequest> request(CreateRequest(script_url_));
-  std::unique_ptr<ServiceWorkerContextRequestHandler> handler(
-      CreateHandler(RESOURCE_TYPE_SERVICE_WORKER));
-  std::unique_ptr<net::URLRequestJob> job(
-      handler->MaybeCreateJob(request.get(), nullptr, nullptr));
-  ASSERT_TRUE(job.get());
-  ServiceWorkerWriteToCacheJob* sw_job =
-      static_cast<ServiceWorkerWriteToCacheJob*>(job.get());
-  histograms.ExpectUniqueSample(
-      "ServiceWorker.ContextRequestHandlerStatus.NewWorker.MainScript",
-      static_cast<int>(
-          ServiceWorkerContextRequestHandler::CreateJobStatus::WRITE_JOB),
-      1);
-
-  // Verify the net request is initialized to bypass the browser cache.
-  EXPECT_TRUE(sw_job->net_request_->load_flags() & net::LOAD_BYPASS_CACHE);
+  TestBypassCacheForMainScript(true);
+  TestBypassCacheForImportedScript(true);
 }
 
 TEST_F(ServiceWorkerContextRequestHandlerTest, UpdateForceBypassCache) {
+  registration_->set_update_via_cache(
+      blink::mojom::ServiceWorkerUpdateViaCache::kAll);
   // Give the registration a very recent last update time and pretend
   // we're installing a new version.
   registration_->set_last_update_check(base::Time::Now());
   version_->SetStatus(ServiceWorkerVersion::NEW);
   version_->set_force_bypass_cache_for_scripts(true);
 
-  // Conduct a resource fetch for the main script.
-  std::unique_ptr<net::URLRequest> request(CreateRequest(script_url_));
-  std::unique_ptr<ServiceWorkerContextRequestHandler> handler(
-      CreateHandler(RESOURCE_TYPE_SERVICE_WORKER));
-  std::unique_ptr<net::URLRequestJob> job(
-      handler->MaybeCreateJob(request.get(), nullptr, nullptr));
-  ASSERT_TRUE(job.get());
-  ServiceWorkerWriteToCacheJob* sw_job =
-      static_cast<ServiceWorkerWriteToCacheJob*>(job.get());
-
-  // Verify the net request is initialized to bypass the browser cache.
-  EXPECT_TRUE(sw_job->net_request_->load_flags() & net::LOAD_BYPASS_CACHE);
+  TestBypassCacheForMainScript(true);
+  TestBypassCacheForImportedScript(true);
 }
 
 TEST_F(ServiceWorkerContextRequestHandlerTest,
diff --git a/content/browser/service_worker/service_worker_context_unittest.cc b/content/browser/service_worker/service_worker_context_unittest.cc
index a9193337..dec383e7 100644
--- a/content/browser/service_worker/service_worker_context_unittest.cc
+++ b/content/browser/service_worker/service_worker_context_unittest.cc
@@ -83,6 +83,9 @@
   } else {
     EXPECT_FALSE(registration->active_version());
   }
+
+  EXPECT_EQ(blink::mojom::ServiceWorkerUpdateViaCache::kImports,
+            registration->update_via_cache());
 }
 
 class RejectInstallTestHelper : public EmbeddedWorkerTestHelper {
diff --git a/content/browser/service_worker/service_worker_database.cc b/content/browser/service_worker/service_worker_database.cc
index a4cfe0bb..a4efae3f 100644
--- a/content/browser/service_worker/service_worker_database.cc
+++ b/content/browser/service_worker/service_worker_database.cc
@@ -4,6 +4,7 @@
 
 #include "content/browser/service_worker/service_worker_database.h"
 
+#include "base/command_line.h"
 #include "base/files/file_util.h"
 #include "base/lazy_instance.h"
 #include "base/location.h"
@@ -17,6 +18,7 @@
 #include "content/browser/service_worker/service_worker_database.pb.h"
 #include "content/browser/service_worker/service_worker_metrics.h"
 #include "content/common/service_worker/service_worker_utils.h"
+#include "content/public/common/content_switches.h"
 #include "third_party/WebKit/common/service_worker/service_worker_object.mojom.h"
 #include "third_party/WebKit/common/service_worker/service_worker_registration.mojom.h"
 #include "third_party/leveldatabase/env_chromium.h"
@@ -273,6 +275,7 @@
 
 ServiceWorkerDatabase::RegistrationData::RegistrationData()
     : registration_id(blink::mojom::kInvalidServiceWorkerRegistrationId),
+      update_via_cache(blink::mojom::ServiceWorkerUpdateViaCache::kImports),
       version_id(blink::mojom::kInvalidServiceWorkerVersionId),
       is_active(false),
       has_fetch_handler(false),
@@ -1409,6 +1412,17 @@
   for (uint32_t feature : data.used_features())
     out->used_features.insert(feature);
 
+  if (data.has_update_via_cache()) {
+    auto value = data.update_via_cache();
+    if (!ServiceWorkerRegistrationData_ServiceWorkerUpdateViaCacheType_IsValid(
+            value)) {
+      DLOG(ERROR) << "Update via cache mode '" << value << "' is not valid.";
+      return ServiceWorkerDatabase::STATUS_ERROR_CORRUPTED;
+    }
+    out->update_via_cache =
+        static_cast<blink::mojom::ServiceWorkerUpdateViaCache>(value);
+  }
+
   return ServiceWorkerDatabase::STATUS_OK;
 }
 
@@ -1449,6 +1463,16 @@
   for (uint32_t feature : registration.used_features)
     data.add_used_features(feature);
 
+  // TODO(https://crbug.com/675540): Remove the the command line check and
+  // always set to data when shipping the updateViaCache flag to stable.
+  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kEnableExperimentalWebPlatformFeatures)) {
+    data.set_update_via_cache(
+        static_cast<
+            ServiceWorkerRegistrationData_ServiceWorkerUpdateViaCacheType>(
+            registration.update_via_cache));
+  }
+
   std::string value;
   bool success = data.SerializeToString(&value);
   DCHECK(success);
diff --git a/content/browser/service_worker/service_worker_database.h b/content/browser/service_worker/service_worker_database.h
index d20005c..faccaeb 100644
--- a/content/browser/service_worker/service_worker_database.h
+++ b/content/browser/service_worker/service_worker_database.h
@@ -36,7 +36,7 @@
 class Env;
 class Status;
 class WriteBatch;
-}
+}  // namespace leveldb
 
 namespace content {
 
@@ -72,6 +72,7 @@
     // the waiting version. Then transition to the active version. The stored
     // version may be in the ACTIVATED state or in the INSTALLED state.
     GURL script;
+    blink::mojom::ServiceWorkerUpdateViaCache update_via_cache;
     int64_t version_id;
     bool is_active;
     bool has_fetch_handler;
diff --git a/content/browser/service_worker/service_worker_database.proto b/content/browser/service_worker/service_worker_database.proto
index 32c628c..9502e2ae 100644
--- a/content/browser/service_worker/service_worker_database.proto
+++ b/content/browser/service_worker/service_worker_database.proto
@@ -23,6 +23,12 @@
 }
 
 message ServiceWorkerRegistrationData {
+  enum ServiceWorkerUpdateViaCacheType {
+    IMPORTS = 0;
+    ALL = 1;
+    NONE = 2;
+  }
+
   required int64 registration_id = 1;
   required string scope_url = 2;
   required string script_url = 3;
@@ -54,6 +60,9 @@
   // The set of features that the worker used up until the time installation
   // completed. The values must be from blink::UseCounter::Feature enum.
   repeated uint32 used_features = 13;
+
+  optional ServiceWorkerUpdateViaCacheType update_via_cache = 14
+      [default = IMPORTS];
 }
 
 message ServiceWorkerResourceRecord {
diff --git a/content/browser/service_worker/service_worker_database_unittest.cc b/content/browser/service_worker/service_worker_database_unittest.cc
index 41cb775..f55e3cda 100644
--- a/content/browser/service_worker/service_worker_database_unittest.cc
+++ b/content/browser/service_worker/service_worker_database_unittest.cc
@@ -9,6 +9,7 @@
 
 #include <string>
 
+#include "base/command_line.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/macros.h"
@@ -16,6 +17,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "content/browser/service_worker/service_worker_database.pb.h"
 #include "content/common/service_worker/service_worker_types.h"
+#include "content/public/common/content_switches.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/WebKit/common/service_worker/service_worker_object.mojom.h"
@@ -77,6 +79,7 @@
   EXPECT_EQ(expected.resources_total_size_bytes,
             actual.resources_total_size_bytes);
   EXPECT_EQ(expected.used_features, actual.used_features);
+  EXPECT_EQ(expected.update_via_cache, actual.update_via_cache);
 }
 
 void VerifyResourceRecords(const std::vector<Resource>& expected,
@@ -545,6 +548,11 @@
 }
 
 TEST(ServiceWorkerDatabaseTest, GetAllRegistrations) {
+  // TODO(https://crbug.com/618076): Remove the following command line switch
+  // when update_via_cache is shipped to stable.
+  base::CommandLine::ForCurrentProcess()->AppendSwitch(
+      switches::kEnableExperimentalWebPlatformFeatures);
+
   std::unique_ptr<ServiceWorkerDatabase> database(CreateDatabaseInMemory());
 
   std::vector<RegistrationData> registrations;
@@ -575,6 +583,7 @@
   data2.script = URL(origin2, "/script2.js");
   data2.version_id = 2000;
   data2.resources_total_size_bytes = 200;
+  data2.update_via_cache = blink::mojom::ServiceWorkerUpdateViaCache::kNone;
   std::vector<Resource> resources2;
   resources2.push_back(CreateResource(2, data2.script, 200));
   ASSERT_EQ(ServiceWorkerDatabase::STATUS_OK,
@@ -759,6 +768,11 @@
 }
 
 TEST(ServiceWorkerDatabaseTest, Registration_Overwrite) {
+  // TODO(https://crbug.com/618076): Remove the following command line switch
+  // when update_via_cache is shipped to stable.
+  base::CommandLine::ForCurrentProcess()->AppendSwitch(
+      switches::kEnableExperimentalWebPlatformFeatures);
+
   std::unique_ptr<ServiceWorkerDatabase> database(CreateDatabaseInMemory());
 
   GURL origin("http://example.com");
@@ -800,6 +814,8 @@
   updated_data.version_id = data.version_id + 1;
   updated_data.resources_total_size_bytes = 12 + 13;
   updated_data.used_features = {109, 421, 9101};
+  updated_data.update_via_cache =
+      blink::mojom::ServiceWorkerUpdateViaCache::kAll;
   std::vector<Resource> resources2;
   resources2.push_back(CreateResource(3, URL(origin, "/resource3"), 12));
   resources2.push_back(CreateResource(4, URL(origin, "/resource4"), 13));
@@ -1395,6 +1411,7 @@
   data2.script = URL(kOrigin, "/script2.js");
   data2.version_id = 201;
   data2.resources_total_size_bytes = 200;
+  data2.update_via_cache = blink::mojom::ServiceWorkerUpdateViaCache::kImports;
   std::vector<Resource> resources2;
   resources2.push_back(CreateResource(2, data2.script, 200));
 
diff --git a/content/browser/service_worker/service_worker_info.cc b/content/browser/service_worker/service_worker_info.cc
index 6c0990c1..87a6d32 100644
--- a/content/browser/service_worker/service_worker_info.cc
+++ b/content/browser/service_worker/service_worker_info.cc
@@ -92,6 +92,7 @@
 
 ServiceWorkerRegistrationInfo::ServiceWorkerRegistrationInfo(
     const GURL& pattern,
+    blink::mojom::ServiceWorkerUpdateViaCache update_via_cache,
     int64_t registration_id,
     DeleteFlag delete_flag,
     const ServiceWorkerVersionInfo& active_version,
@@ -101,6 +102,7 @@
     bool navigation_preload_enabled,
     size_t navigation_preload_header_length)
     : pattern(pattern),
+      update_via_cache(update_via_cache),
       registration_id(registration_id),
       delete_flag(delete_flag),
       active_version(active_version),
diff --git a/content/browser/service_worker/service_worker_info.h b/content/browser/service_worker/service_worker_info.h
index 7496c31..25037111 100644
--- a/content/browser/service_worker/service_worker_info.h
+++ b/content/browser/service_worker/service_worker_info.h
@@ -77,6 +77,7 @@
                                 DeleteFlag delete_flag);
   ServiceWorkerRegistrationInfo(
       const GURL& pattern,
+      blink::mojom::ServiceWorkerUpdateViaCache update_via_cache,
       int64_t registration_id,
       DeleteFlag delete_flag,
       const ServiceWorkerVersionInfo& active_version,
@@ -89,6 +90,7 @@
   ~ServiceWorkerRegistrationInfo();
 
   GURL pattern;
+  blink::mojom::ServiceWorkerUpdateViaCache update_via_cache;
   int64_t registration_id;
   DeleteFlag delete_flag;
   ServiceWorkerVersionInfo active_version;
diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc
index f2f57f4..bfd30eb 100644
--- a/content/browser/service_worker/service_worker_job_unittest.cc
+++ b/content/browser/service_worker/service_worker_job_unittest.cc
@@ -464,7 +464,67 @@
   scoped_refptr<ServiceWorkerRegistration> new_registration_by_pattern =
       FindRegistrationForPattern(options.scope);
 
-  ASSERT_EQ(new_registration, old_registration);
+  EXPECT_EQ(new_registration_by_pattern, old_registration);
+}
+
+// Make sure that the same registration is used and the update_via_cache value
+// is updated when registering a duplicate pattern+script_url with a different
+// update_via_cache value.
+TEST_F(ServiceWorkerJobTest, RegisterWithDifferentUpdateViaCache) {
+  // During registration, handles will be created for hosting the worker's
+  // context. KeepHandlesDispatcherHost will store the handles.
+  auto dispatcher_host = base::MakeRefCounted<KeepHandlesDispatcherHost>(
+      helper_->mock_render_process_id(),
+      helper_->browser_context()->GetResourceContext());
+  helper_->RegisterDispatcherHost(helper_->mock_render_process_id(),
+                                  dispatcher_host);
+  dispatcher_host->Init(helper_->context_wrapper());
+
+  GURL script_url("https://www.example.com/service_worker.js");
+  blink::mojom::ServiceWorkerRegistrationOptions options;
+  options.scope = GURL("https://www.example.com/");
+
+  scoped_refptr<ServiceWorkerRegistration> old_registration =
+      RunRegisterJob(script_url, options);
+
+  EXPECT_EQ(blink::mojom::ServiceWorkerUpdateViaCache::kImports,
+            old_registration->update_via_cache());
+
+  // During the above registration, a service worker registration object host
+  // for ServiceWorkerGlobalScope#registration has been created/added into
+  // |provider_host|.
+  ServiceWorkerProviderHost* provider_host =
+      old_registration->active_version()->provider_host();
+  ASSERT_NE(nullptr, provider_host);
+
+  // Clear all service worker handles.
+  dispatcher_host->Clear();
+  // Ensure that the registration's object host doesn't have the reference.
+  EXPECT_EQ(1UL, provider_host->registration_object_hosts_.size());
+  provider_host->registration_object_hosts_.clear();
+  EXPECT_EQ(0UL, provider_host->registration_object_hosts_.size());
+  ASSERT_TRUE(old_registration->HasOneRef());
+
+  scoped_refptr<ServiceWorkerRegistration> old_registration_by_pattern =
+      FindRegistrationForPattern(options.scope);
+
+  ASSERT_TRUE(old_registration_by_pattern.get());
+
+  options.update_via_cache = blink::mojom::ServiceWorkerUpdateViaCache::kNone;
+  scoped_refptr<ServiceWorkerRegistration> new_registration =
+      RunRegisterJob(script_url, options);
+
+  // Ensure that the registration object is not copied.
+  ASSERT_EQ(old_registration, new_registration);
+  EXPECT_EQ(blink::mojom::ServiceWorkerUpdateViaCache::kNone,
+            new_registration->update_via_cache());
+
+  ASSERT_FALSE(old_registration->HasOneRef());
+
+  scoped_refptr<ServiceWorkerRegistration> new_registration_by_pattern =
+      FindRegistrationForPattern(options.scope);
+
+  EXPECT_EQ(new_registration_by_pattern, old_registration);
 }
 
 class FailToStartWorkerTestHelper : public EmbeddedWorkerTestHelper {
diff --git a/content/browser/service_worker/service_worker_provider_host.h b/content/browser/service_worker/service_worker_provider_host.h
index 227f55b3..2b4c6ef 100644
--- a/content/browser/service_worker/service_worker_provider_host.h
+++ b/content/browser/service_worker/service_worker_provider_host.h
@@ -379,6 +379,8 @@
   FRIEND_TEST_ALL_PREFIXES(ServiceWorkerProviderHostTest, ContextSecurity);
   FRIEND_TEST_ALL_PREFIXES(ServiceWorkerJobTest, Unregister);
   FRIEND_TEST_ALL_PREFIXES(ServiceWorkerJobTest, RegisterDuplicateScript);
+  FRIEND_TEST_ALL_PREFIXES(ServiceWorkerJobTest,
+                           RegisterWithDifferentUpdateViaCache);
   FRIEND_TEST_ALL_PREFIXES(BackgroundSyncManagerTest,
                            RegisterWithoutLiveSWRegistration);
 
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
index 8db60f1..fb74649 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -39,6 +39,7 @@
       job_type_(REGISTRATION_JOB),
       pattern_(options.scope),
       script_url_(script_url),
+      update_via_cache_(options.update_via_cache),
       phase_(INITIAL),
       doom_installing_worker_(false),
       is_promise_resolved_(false),
@@ -56,6 +57,7 @@
     : context_(context),
       job_type_(UPDATE_JOB),
       pattern_(registration->pattern()),
+      update_via_cache_(registration->update_via_cache()),
       phase_(INITIAL),
       doom_installing_worker_(false),
       is_promise_resolved_(false),
@@ -220,8 +222,10 @@
   }
 
   DCHECK(existing_registration->GetNewestVersion());
-  // "If scriptURL is equal to registration.[[ScriptURL]], then:"
-  if (existing_registration->GetNewestVersion()->script_url() == script_url_) {
+  // "If scriptURL is equal to registration.[[ScriptURL]] and
+  // "update_via_cache is equal to registration.[[update_via_cache]], then:"
+  if (existing_registration->GetNewestVersion()->script_url() == script_url_ &&
+      existing_registration->update_via_cache() == update_via_cache_) {
     // "Set registration.[[Uninstalling]] to false."
     existing_registration->AbortPendingClear(base::Bind(
         &ServiceWorkerRegisterJob::ContinueWithRegistrationForSameScriptUrl,
@@ -238,9 +242,12 @@
     return;
   }
 
+  // "Invoke Set Registration algorithm with job’s scope url and
+  // job’s update via cache mode."
+  existing_registration->set_update_via_cache(update_via_cache_);
+  set_registration(existing_registration);
   // "Return the result of running the [[Update]] algorithm, or its equivalent,
   // passing registration as the argument."
-  set_registration(existing_registration);
   UpdateAndContinue();
 }
 
@@ -285,8 +292,8 @@
     return;
   }
 
-  blink::mojom::ServiceWorkerRegistrationOptions options;
-  options.scope = pattern_;
+  blink::mojom::ServiceWorkerRegistrationOptions options(pattern_,
+                                                         update_via_cache_);
   set_registration(
       new ServiceWorkerRegistration(options, registration_id, context_));
   AddRegistrationToMatchingProviderHosts(registration());
@@ -314,8 +321,9 @@
   }
   set_registration(existing_registration);
 
-  // "If newestWorker is not null, and scriptURL is equal to
-  // newestWorker.scriptURL, then:
+  // "If newestWorker is not null, scriptURL is equal to newestWorker.scriptURL,
+  // and job’s update via cache mode's value equals registration’s
+  // update via cache mode then:
   // Return a promise resolved with registration."
   // We resolve only if there's an active version. If there's not,
   // then there is either no version or only a waiting version from
diff --git a/content/browser/service_worker/service_worker_register_job.h b/content/browser/service_worker/service_worker_register_job.h
index 740e349..0b0db39 100644
--- a/content/browser/service_worker/service_worker_register_job.h
+++ b/content/browser/service_worker/service_worker_register_job.h
@@ -148,6 +148,7 @@
   RegistrationJobType job_type_;
   const GURL pattern_;
   GURL script_url_;
+  const blink::mojom::ServiceWorkerUpdateViaCache update_via_cache_;
   std::vector<RegistrationCallback> callbacks_;
   Phase phase_;
   Internal internal_;
diff --git a/content/browser/service_worker/service_worker_registration.cc b/content/browser/service_worker/service_worker_registration.cc
index 4e070a26..e786cb9f 100644
--- a/content/browser/service_worker/service_worker_registration.cc
+++ b/content/browser/service_worker/service_worker_registration.cc
@@ -43,6 +43,7 @@
     int64_t registration_id,
     base::WeakPtr<ServiceWorkerContextCore> context)
     : pattern_(options.scope),
+      update_via_cache_(options.update_via_cache),
       registration_id_(registration_id),
       is_deleted_(false),
       is_uninstalling_(false),
@@ -104,7 +105,7 @@
 ServiceWorkerRegistrationInfo ServiceWorkerRegistration::GetInfo() {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   return ServiceWorkerRegistrationInfo(
-      pattern(), registration_id_,
+      pattern(), update_via_cache(), registration_id_,
       is_deleted_ ? ServiceWorkerRegistrationInfo::IS_DELETED
                   : ServiceWorkerRegistrationInfo::IS_NOT_DELETED,
       GetVersionInfo(active_version_.get()),
diff --git a/content/browser/service_worker/service_worker_registration.h b/content/browser/service_worker/service_worker_registration.h
index 7a71d55..982c5d1f 100644
--- a/content/browser/service_worker/service_worker_registration.h
+++ b/content/browser/service_worker/service_worker_registration.h
@@ -65,6 +65,13 @@
 
   int64_t id() const { return registration_id_; }
   const GURL& pattern() const { return pattern_; }
+  blink::mojom::ServiceWorkerUpdateViaCache update_via_cache() const {
+    return update_via_cache_;
+  }
+  void set_update_via_cache(
+      blink::mojom::ServiceWorkerUpdateViaCache update_via_cache) {
+    update_via_cache_ = update_via_cache;
+  }
 
   bool is_deleted() const { return is_deleted_; }
   void set_is_deleted(bool deleted) { is_deleted_ = deleted; }
@@ -209,6 +216,7 @@
                          ServiceWorkerStatusCode status);
 
   const GURL pattern_;
+  blink::mojom::ServiceWorkerUpdateViaCache update_via_cache_;
   const int64_t registration_id_;
   bool is_deleted_;
   bool is_uninstalling_;
diff --git a/content/browser/service_worker/service_worker_registration_object_host.cc b/content/browser/service_worker/service_worker_registration_object_host.cc
index 1470a1b..e26b5c9f 100644
--- a/content/browser/service_worker/service_worker_registration_object_host.cc
+++ b/content/browser/service_worker/service_worker_registration_object_host.cc
@@ -40,10 +40,8 @@
 blink::mojom::ServiceWorkerRegistrationObjectInfoPtr
 ServiceWorkerRegistrationObjectHost::CreateObjectInfo() {
   auto info = blink::mojom::ServiceWorkerRegistrationObjectInfo::New();
-  info->options = blink::mojom::ServiceWorkerRegistrationOptions::New();
-  info->options->scope = registration_->pattern();
-  // TODO(crbug.com/675540): Set update_via_cache when it is included in
-  // registration_.
+  info->options = blink::mojom::ServiceWorkerRegistrationOptions::New(
+      registration_->pattern(), registration_->update_via_cache());
   info->registration_id = registration_->id();
   bindings_.AddBinding(this, mojo::MakeRequest(&info->host_ptr_info));
   if (!remote_registration_)
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc
index ea619054..00e3aa75 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -420,6 +420,7 @@
   ServiceWorkerDatabase::RegistrationData data;
   data.registration_id = registration->id();
   data.scope = registration->pattern();
+  data.update_via_cache = registration->update_via_cache();
   data.script = version->script_url();
   data.has_fetch_handler = version->fetch_handler_existence() ==
                            ServiceWorkerVersion::FetchHandlerExistence::EXISTS;
@@ -1312,6 +1313,7 @@
 
     ServiceWorkerRegistrationInfo info;
     info.pattern = registration_data.scope;
+    info.update_via_cache = registration_data.update_via_cache;
     info.registration_id = registration_data.registration_id;
     info.stored_version_size_bytes =
         registration_data.resources_total_size_bytes;
@@ -1505,8 +1507,8 @@
   if (registration)
     return registration;
 
-  blink::mojom::ServiceWorkerRegistrationOptions options;
-  options.scope = data.scope;
+  blink::mojom::ServiceWorkerRegistrationOptions options(data.scope,
+                                                         data.update_via_cache);
   registration =
       new ServiceWorkerRegistration(options, data.registration_id, context_);
   registration->set_resources_total_size_bytes(data.resources_total_size_bytes);
diff --git a/content/browser/service_worker/service_worker_write_to_cache_job.h b/content/browser/service_worker/service_worker_write_to_cache_job.h
index 6033b20..53b4536 100644
--- a/content/browser/service_worker/service_worker_write_to_cache_job.h
+++ b/content/browser/service_worker/service_worker_write_to_cache_job.h
@@ -26,6 +26,7 @@
 
 class ServiceWorkerCacheWriter;
 class ServiceWorkerContextCore;
+class ServiceWorkerContextRequestHandlerTest;
 
 // A URLRequestJob derivative used to cache the main script
 // and its imports during the initial install of a new version.
@@ -60,12 +61,12 @@
   const static net::Error kIdenticalScriptError;
 
  private:
+  friend class ServiceWorkerContextRequestHandlerTest;
+  // TODO(https://crbug.com/675540): Remove the following
+  // FRIEND_TEST_ALL_PREFIXES directive when the update_via_cache flag is
+  // shipped to stable.
   FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest,
-                           UpdateBefore24Hours);
-  FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest,
-                           UpdateAfter24Hours);
-  FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest,
-                           UpdateForceBypassCache);
+                           UpdateBefore24HoursWithoutUpdateViaCache);
   FRIEND_TEST_ALL_PREFIXES(ServiceWorkerContextRequestHandlerTest,
                            ServiceWorkerDataRequestAnnotation);
 
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index 565e406..4bcff55 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -453,6 +453,7 @@
   IPC_STRUCT_TRAITS_MEMBER(should_check_main_world_csp)
   IPC_STRUCT_TRAITS_MEMBER(has_user_gesture)
   IPC_STRUCT_TRAITS_MEMBER(started_from_context_menu)
+  IPC_STRUCT_TRAITS_MEMBER(suggested_filename)
 IPC_STRUCT_TRAITS_END()
 
 IPC_STRUCT_TRAITS_BEGIN(content::NavigationTiming)
diff --git a/content/common/navigation_params.cc b/content/common/navigation_params.cc
index 66ff83a..16469b3 100644
--- a/content/common/navigation_params.cc
+++ b/content/common/navigation_params.cc
@@ -57,7 +57,8 @@
     base::Optional<SourceLocation> source_location,
     CSPDisposition should_check_main_world_csp,
     bool started_from_context_menu,
-    bool has_user_gesture)
+    bool has_user_gesture,
+    const base::Optional<std::string>& suggested_filename)
     : url(url),
       referrer(referrer),
       transition(transition),
@@ -75,7 +76,8 @@
       source_location(source_location),
       should_check_main_world_csp(should_check_main_world_csp),
       started_from_context_menu(started_from_context_menu),
-      has_user_gesture(has_user_gesture) {
+      has_user_gesture(has_user_gesture),
+      suggested_filename(suggested_filename) {
   // |method != "POST"| should imply absence of |post_data|.
   if (method != "POST" && post_data) {
     NOTREACHED();
diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h
index cb5c45f..1301400 100644
--- a/content/common/navigation_params.h
+++ b/content/common/navigation_params.h
@@ -73,7 +73,8 @@
       base::Optional<SourceLocation> source_location,
       CSPDisposition should_check_main_world_csp,
       bool started_from_context_menu,
-      bool has_user_gesture);
+      bool has_user_gesture,
+      const base::Optional<std::string>& suggested_filename);
   CommonNavigationParams(const CommonNavigationParams& other);
   ~CommonNavigationParams();
 
@@ -155,6 +156,11 @@
 
   // True if the request was user initiated.
   bool has_user_gesture;
+
+  // If the navigation started in response to a HTML anchor element with a
+  // download attribute, this is the (possible empty) value of the download
+  // attribute.
+  base::Optional<std::string> suggested_filename;
 };
 
 // Provided by the browser -----------------------------------------------------
diff --git a/content/common/navigation_params.mojom b/content/common/navigation_params.mojom
index 6f053d2..d98fcd6 100644
--- a/content/common/navigation_params.mojom
+++ b/content/common/navigation_params.mojom
@@ -55,10 +55,5 @@
   // If the transition type is a client side redirect, then this holds the URL
   // of the page that had the client side redirect.
   url.mojom.Url client_side_redirect_url;
-
-  // If the anchor element that triggered this navigation had a download
-  // attribute, this field will be set to the attribute's (possibly empty)
-  // value.
-  string? suggested_filename;
 };
 
diff --git a/content/common/page_state.mojom b/content/common/page_state.mojom
index f30a38c..4d6ea26 100644
--- a/content/common/page_state.mojom
+++ b/content/common/page_state.mojom
@@ -32,7 +32,8 @@
 // Next MinVersion: 2
 
 // Next Ordinal: 4
-struct FileSystemFile {
+// FileSystemFile is no longer supported.
+struct DEPRECATED_FileSystemFile {
   url.mojom.Url filesystem_url@0;
   uint64 offset@1;
   uint64 length@2;
@@ -52,7 +53,8 @@
   string blob_uuid@0;
   array<uint8> bytes@1;
   File file@2;
-  FileSystemFile file_system_file@3;
+  // FileSystemFile is no longer supported.
+  DEPRECATED_FileSystemFile DEPRECATED_file_system_file@3;
 };
 
 // Next Ordinal: 3
diff --git a/content/common/page_state_serialization.cc b/content/common/page_state_serialization.cc
index 25538ac..d65006eb 100644
--- a/content/common/page_state_serialization.cc
+++ b/content/common/page_state_serialization.cc
@@ -66,17 +66,6 @@
       file_modification_time);
 }
 
-void AppendURLRangeToRequestBody(
-    const scoped_refptr<network::ResourceRequestBody>& request_body,
-    const GURL& url,
-    int file_start,
-    int file_length,
-    base::Time file_modification_time) {
-  request_body->AppendFileSystemFileRange(
-      url, static_cast<uint64_t>(file_start),
-      static_cast<uint64_t>(file_length), file_modification_time);
-}
-
 void AppendBlobToRequestBody(
     const scoped_refptr<network::ResourceRequestBody>& request_body,
     const std::string& uuid) {
@@ -304,10 +293,6 @@
   return false;
 }
 
-void WriteGURL(const GURL& url, SerializeObject* obj) {
-  obj->pickle.WriteString(url.possibly_invalid_spec());
-}
-
 GURL ReadGURL(SerializeObject* obj) {
   std::string spec;
   if (obj->iter.ReadString(&spec))
@@ -442,20 +427,11 @@
         WriteInteger64(static_cast<int64_t>(element.length()), obj);
         WriteReal(element.expected_modification_time().ToDoubleT(), obj);
         break;
-      case network::DataElement::TYPE_FILE_FILESYSTEM:
-        WriteInteger(blink::WebHTTPBody::Element::kTypeFileSystemURL, obj);
-        WriteGURL(element.filesystem_url(), obj);
-        WriteInteger64(static_cast<int64_t>(element.offset()), obj);
-        WriteInteger64(static_cast<int64_t>(element.length()), obj);
-        WriteReal(element.expected_modification_time().ToDoubleT(), obj);
-        break;
       case network::DataElement::TYPE_BLOB:
         WriteInteger(blink::WebHTTPBody::Element::kTypeBlob, obj);
         WriteStdString(element.blob_uuid(), obj);
         break;
       case network::DataElement::TYPE_RAW_FILE:
-      case network::DataElement::TYPE_BYTES_DESCRIPTION:
-      case network::DataElement::TYPE_DISK_CACHE_ENTRY:
       default:
         NOTREACHED();
         continue;
@@ -486,14 +462,6 @@
       AppendFileRangeToRequestBody(
           request_body, file_path, file_start, file_length,
           base::Time::FromDoubleT(file_modification_time));
-    } else if (type == blink::WebHTTPBody::Element::kTypeFileSystemURL) {
-      GURL url = ReadGURL(obj);
-      int64_t file_start = ReadInteger64(obj);
-      int64_t file_length = ReadInteger64(obj);
-      double file_modification_time = ReadReal(obj);
-      AppendURLRangeToRequestBody(
-          request_body, url, file_start, file_length,
-          base::Time::FromDoubleT(file_modification_time));
     } else if (type == blink::WebHTTPBody::Element::kTypeBlob) {
       if (obj->version >= 16) {
         std::string blob_uuid = ReadStdString(obj);
@@ -735,19 +703,10 @@
         data_element->set_file(std::move(file));
         break;
       }
-      case network::DataElement::TYPE_FILE_FILESYSTEM: {
-        mojom::FileSystemFilePtr file_system = mojom::FileSystemFile::New(
-            element.filesystem_url(), element.offset(), element.length(),
-            element.expected_modification_time());
-        data_element->set_file_system_file(std::move(file_system));
-        break;
-      }
       case network::DataElement::TYPE_BLOB:
         data_element->set_blob_uuid(element.blob_uuid());
         break;
       case network::DataElement::TYPE_RAW_FILE:
-      case network::DataElement::TYPE_BYTES_DESCRIPTION:
-      case network::DataElement::TYPE_DISK_CACHE_ENTRY:
       case network::DataElement::TYPE_DATA_PIPE:
       case network::DataElement::TYPE_UNKNOWN:
         NOTREACHED();
@@ -776,17 +735,12 @@
                                      file->length, file->modification_time);
         break;
       }
-      case mojom::Element::Tag::FILE_SYSTEM_FILE: {
-        mojom::FileSystemFile* file_system =
-            element->get_file_system_file().get();
-        AppendURLRangeToRequestBody(request_body, file_system->filesystem_url,
-                                    file_system->offset, file_system->length,
-                                    file_system->modification_time);
-        break;
-      }
       case mojom::Element::Tag::BLOB_UUID:
         AppendBlobToRequestBody(request_body, element->get_blob_uuid());
         break;
+      case mojom::Element::Tag::DEPRECATED_FILE_SYSTEM_FILE:
+        // No longer supported.
+        break;
     }
   }
   request_body->set_identifier(mojo_body->identifier);
diff --git a/content/common/page_state_serialization_unittest.cc b/content/common/page_state_serialization_unittest.cc
index b82d6be3..ffd1a65d 100644
--- a/content/common/page_state_serialization_unittest.cc
+++ b/content/common/page_state_serialization_unittest.cc
@@ -46,7 +46,6 @@
               std::string(actual.bytes(), actual.length()));
   }
   EXPECT_EQ(expected.path(), actual.path());
-  EXPECT_EQ(expected.filesystem_url(), actual.filesystem_url());
   EXPECT_EQ(expected.offset(), actual.offset());
   EXPECT_EQ(expected.length(), actual.length());
   EXPECT_EQ(expected.expected_modification_time(),
@@ -662,9 +661,6 @@
   http_body.request_body->AppendFileRange(base::FilePath(path), 100, 1024,
                                           base::Time::FromDoubleT(9999.0));
 
-  http_body.request_body->AppendFileSystemFileRange(
-      GURL("file://some_file.txt"), 100, 1024, base::Time::FromDoubleT(9999.0));
-
   ExplodedPageState saved_state;
   ReadBackwardsCompatPageState("http_body", 26, &saved_state);
   ExpectEquality(state, saved_state);
diff --git a/content/network/url_loader.cc b/content/network/url_loader.cc
index cbffe0d..cdc0da2b 100644
--- a/content/network/url_loader.cc
+++ b/content/network/url_loader.cc
@@ -162,9 +162,6 @@
         element_readers.push_back(std::make_unique<RawFileElementReader>(
             body, file_task_runner, element));
         break;
-      case network::DataElement::TYPE_FILE_FILESYSTEM:
-        CHECK(false) << "Should never be reached";
-        break;
       case network::DataElement::TYPE_BLOB: {
         CHECK(false) << "Network service always uses DATA_PIPE for blobs.";
         break;
@@ -175,8 +172,6 @@
                       ->ReleaseDataPipeGetter()));
         break;
       }
-      case network::DataElement::TYPE_DISK_CACHE_ENTRY:
-      case network::DataElement::TYPE_BYTES_DESCRIPTION:
       case network::DataElement::TYPE_UNKNOWN:
         NOTREACHED();
         break;
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationListenerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationListenerTest.java
index 49c90b3..295b2f5 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationListenerTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ScreenOrientationListenerTest.java
@@ -18,6 +18,7 @@
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.BaseJUnit4ClassRunner;
 import org.chromium.base.test.util.CallbackHelper;
+import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.content_public.common.ScreenOrientationValues;
 import org.chromium.content_shell_apk.ContentShellActivityTestRule;
@@ -175,6 +176,7 @@
     @Test
     @MediumTest
     @Feature({"ScreenOrientation"})
+    @DisabledTest
     public void testOrientationChanges() throws Exception {
         int rotation = lockOrientationAndWait(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
         Assert.assertEquals(
diff --git a/content/public/app/mojo/content_renderer_manifest.json b/content/public/app/mojo/content_renderer_manifest.json
index 5efdd84..3ad5875 100644
--- a/content/public/app/mojo/content_renderer_manifest.json
+++ b/content/public/app/mojo/content_renderer_manifest.json
@@ -92,10 +92,6 @@
         "platform": "android"
       }
     ],
-    "v8_snapshot_data" : [{
-      "path": "snapshot_blob.bin",
-      "platform": "linux"
-    }],
     "v8_snapshot_32_data" : [{
       "path": "assets/snapshot_blob_32.bin",
       "platform": "android"
diff --git a/content/public/app/mojo/content_utility_manifest.json b/content/public/app/mojo/content_utility_manifest.json
index 4d07ae8e..acf8f28f6 100644
--- a/content/public/app/mojo/content_utility_manifest.json
+++ b/content/public/app/mojo/content_utility_manifest.json
@@ -43,10 +43,6 @@
         "platform": "android"
       }
     ],
-    "v8_snapshot_data" : [{
-      "path": "snapshot_blob.bin",
-      "platform": "linux"
-    }],
     "v8_snapshot_32_data" : [{
       "path": "assets/snapshot_blob_32.bin",
       "platform": "android"
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
index cd03275..b87caa7 100644
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -378,7 +378,7 @@
 // Use MojoAudioInputIPC and RenderFrameAudioInputStreamFactory rather than
 // AudioInputMessageFilter and AudioInputRendererHost.
 const base::Feature kUseMojoAudioInputStreamFactory{
-    "UseMojoAudioInputStreamFactory", base::FEATURE_DISABLED_BY_DEFAULT};
+    "UseMojoAudioInputStreamFactory", base::FEATURE_ENABLED_BY_DEFAULT};
 
 // Use MojoAudioOutputIPC and RenderFrameAudioOutputStreamFactory rather than
 // AudioMessageFilter and AudioRendererHost.
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc
index b5924b35..2cff1fe 100644
--- a/content/public/test/navigation_simulator.cc
+++ b/content/public/test/navigation_simulator.cc
@@ -825,8 +825,7 @@
           blink::WebMixedContentContextType::kBlockable,
           false /* is_form_submission */, GURL() /* searchable_form_url */,
           std::string() /* searchable_form_encoding */, url::Origin(),
-          GURL() /* client_side_redirect_url */,
-          base::nullopt /* suggested_filename */);
+          GURL() /* client_side_redirect_url */);
   CommonNavigationParams common_params;
   common_params.url = navigation_url_;
   common_params.method = initial_method_;
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc
index 019dcba..f479496 100644
--- a/content/public/test/render_view_test.cc
+++ b/content/public/test/render_view_test.cc
@@ -550,7 +550,8 @@
       PREVIEWS_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr,
       base::Optional<SourceLocation>(),
       CSPDisposition::CHECK /* should_check_main_world_csp */,
-      false /* started_from_context_menu */, false /* has_user_gesture */);
+      false /* started_from_context_menu */, false /* has_user_gesture */,
+      base::nullopt /* suggested_filename */);
   RenderViewImpl* impl = static_cast<RenderViewImpl*>(view_);
   TestRenderFrame* frame =
       static_cast<TestRenderFrame*>(impl->GetMainRenderFrame());
@@ -690,7 +691,8 @@
       GURL(), PREVIEWS_UNSPECIFIED, base::TimeTicks::Now(), "GET", nullptr,
       base::Optional<SourceLocation>(),
       CSPDisposition::CHECK /* should_check_main_world_csp */,
-      false /* started_from_context_menu */, false /* has_user_gesture */);
+      false /* started_from_context_menu */, false /* has_user_gesture */,
+      base::nullopt /* suggested_filename */);
   RequestNavigationParams request_params;
   request_params.page_state = state;
   request_params.nav_entry_id = pending_offset + 1;
diff --git a/content/renderer/loader/web_url_request_util.cc b/content/renderer/loader/web_url_request_util.cc
index 2245bdb2..5b7720a 100644
--- a/content/renderer/loader/web_url_request_util.cc
+++ b/content/renderer/loader/web_url_request_util.cc
@@ -420,9 +420,6 @@
         break;
       }
       case network::DataElement::TYPE_UNKNOWN:
-      case network::DataElement::TYPE_BYTES_DESCRIPTION:
-      case network::DataElement::TYPE_DISK_CACHE_ENTRY:
-      case network::DataElement::TYPE_FILE_FILESYSTEM:
       case network::DataElement::TYPE_RAW_FILE:
         NOTREACHED();
         break;
@@ -482,15 +479,6 @@
               base::Time::FromDoubleT(element.modification_time));
         }
         break;
-      case WebHTTPBody::Element::kTypeFileSystemURL: {
-        GURL file_system_url = element.file_system_url;
-        DCHECK(file_system_url.SchemeIsFileSystem());
-        request_body->AppendFileSystemFileRange(
-            file_system_url, static_cast<uint64_t>(element.file_start),
-            static_cast<uint64_t>(element.file_length),
-            base::Time::FromDoubleT(element.modification_time));
-        break;
-      }
       case WebHTTPBody::Element::kTypeBlob: {
         if (base::FeatureList::IsEnabled(features::kNetworkService)) {
           if (!blob_registry.is_bound()) {
diff --git a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc
index 8d42929..99503456 100644
--- a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc
+++ b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc
@@ -11,6 +11,7 @@
 #include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/unguessable_token.h"
+#include "build/build_config.h"
 #include "components/viz/common/gpu/context_provider.h"
 #include "content/child/child_thread_impl.h"
 #include "content/public/common/content_features.h"
@@ -296,14 +297,25 @@
   viz::ContextProvider::ScopedContextLock lock(context_provider_);
   auto capabilities = context_provider_->ContextCapabilities();
   if (bit_depth > 8) {
-    // If high bit depth rendering is not enabled and we support RG textures,
-    // use those, albeit at a reduced bit depth of 8 bits per component.
+    // If high bit depth rendering is enabled, bail here, otherwise try and use
+    // XR30 storage, and if not and we support RG textures, use those, albeit at
+    // a reduced bit depth of 8 bits per component.
     // TODO(mcasas): continue working on this, avoiding dropping information as
     // long as the hardware may support it https://crbug.com/798485.
-    if (!rendering_color_space_.IsHDR() && capabilities.texture_rg)
-      return media::GpuVideoAcceleratorFactories::OutputFormat::I420;
-    else
+    if (rendering_color_space_.IsHDR())
       return media::GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED;
+
+#if defined(OS_MACOSX)
+    // TODO(mcasas): enable other platforms https://crbug.com/776093
+    // https://crbug.com/803451, https://crbug.com/803975.
+    // TODO(mcasas): remove the |bit_depth| check when libyuv supports more than
+    // just x010ToAR30 conversions, https://crbug.com/libyuv/751.
+    if (capabilities.image_xr30 && bit_depth == 10)
+      return media::GpuVideoAcceleratorFactories::OutputFormat::XR30;
+#endif
+    if (capabilities.texture_rg)
+      return media::GpuVideoAcceleratorFactories::OutputFormat::I420;
+    return media::GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED;
   }
   if (capabilities.image_ycbcr_420v &&
       !capabilities.image_ycbcr_420v_disabled_for_video_frames) {
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 011ee69..4bbed39f 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -532,7 +532,11 @@
       base::TimeTicks::Now(), info.url_request.HttpMethod().Latin1(),
       GetRequestBodyForWebURLRequest(info.url_request), source_location,
       should_check_main_world_csp, false /* started_from_context_menu */,
-      info.url_request.HasUserGesture());
+      info.url_request.HasUserGesture(),
+      info.url_request.GetSuggestedFilename().has_value()
+          ? base::Optional<std::string>(
+                info.url_request.GetSuggestedFilename()->Utf8())
+          : base::nullopt);
 }
 
 WebFrameLoadType ReloadFrameLoadTypeFor(
@@ -6737,11 +6741,7 @@
           GetRequestContextTypeForWebURLRequest(info.url_request),
           GetMixedContentContextTypeForWebURLRequest(info.url_request),
           is_form_submission, searchable_form_url, searchable_form_encoding,
-          initiator_origin, client_side_redirect_url,
-          info.url_request.GetSuggestedFilename().has_value()
-              ? base::Optional<std::string>(
-                    info.url_request.GetSuggestedFilename()->Utf8())
-              : base::nullopt);
+          initiator_origin, client_side_redirect_url);
 
   GetFrameHost()->BeginNavigation(MakeCommonNavigationParams(info, load_flags),
                                   std::move(begin_navigation_params));
diff --git a/content/renderer/service_worker/web_service_worker_registration_impl.cc b/content/renderer/service_worker/web_service_worker_registration_impl.cc
index 9cca686..2e75e0b1 100644
--- a/content/renderer/service_worker/web_service_worker_registration_impl.cc
+++ b/content/renderer/service_worker/web_service_worker_registration_impl.cc
@@ -169,8 +169,16 @@
 
 void WebServiceWorkerRegistrationImpl::AttachForServiceWorkerClient(
     blink::mojom::ServiceWorkerRegistrationObjectInfoPtr info) {
-  if (state_ == LifecycleState::kAttachedAndBound)
+  if (state_ == LifecycleState::kAttachedAndBound) {
+    // |update_via_cache| is handled specifically here as it is the only mutable
+    // property when the browser process sends |info| for an existing
+    // registration. The installing/waiting/active properties are changed by the
+    // SetVersionAttributes method instead.
+    if (info_->options && info->options) {
+      info_->options->update_via_cache = info->options->update_via_cache;
+    }
     return;
+  }
   DCHECK_EQ(LifecycleState::kDetached, state_);
   DCHECK(!info->request.is_pending());
   Attach(std::move(info));
@@ -292,6 +300,11 @@
   return info_->options->scope;
 }
 
+blink::mojom::ServiceWorkerUpdateViaCache
+WebServiceWorkerRegistrationImpl::UpdateViaCache() const {
+  return info_->options->update_via_cache;
+}
+
 void WebServiceWorkerRegistrationImpl::Update(
     std::unique_ptr<WebServiceWorkerUpdateCallbacks> callbacks) {
   DCHECK(state_ == LifecycleState::kAttachedAndBound ||
diff --git a/content/renderer/service_worker/web_service_worker_registration_impl.h b/content/renderer/service_worker/web_service_worker_registration_impl.h
index fedd0097..c39eda1 100644
--- a/content/renderer/service_worker/web_service_worker_registration_impl.h
+++ b/content/renderer/service_worker/web_service_worker_registration_impl.h
@@ -99,6 +99,7 @@
   void SetProxy(blink::WebServiceWorkerRegistrationProxy* proxy) override;
   blink::WebServiceWorkerRegistrationProxy* Proxy() override;
   blink::WebURL Scope() const override;
+  blink::mojom::ServiceWorkerUpdateViaCache UpdateViaCache() const override;
   void Update(
       std::unique_ptr<WebServiceWorkerUpdateCallbacks> callbacks) override;
   void Unregister(std::unique_ptr<WebServiceWorkerUnregistrationCallbacks>
diff --git a/content/renderer/v8_value_converter_impl_unittest.cc b/content/renderer/v8_value_converter_impl_unittest.cc
index 699b7aa..6596709 100644
--- a/content/renderer/v8_value_converter_impl_unittest.cc
+++ b/content/renderer/v8_value_converter_impl_unittest.cc
@@ -415,14 +415,14 @@
   TestWeirdType(converter, v8::Undefined(isolate_),
                 base::Value::Type::NONE,  // Arbitrary type, result is NULL.
                 std::unique_ptr<base::Value>());
-  TestWeirdType(converter, v8::Date::New(isolate_, 1000),
+  TestWeirdType(converter, v8::Date::New(context, 1000).ToLocalChecked(),
                 base::Value::Type::DICTIONARY,
                 std::unique_ptr<base::Value>(new base::DictionaryValue()));
   TestWeirdType(converter, regex, base::Value::Type::DICTIONARY,
                 std::unique_ptr<base::Value>(new base::DictionaryValue()));
 
   converter.SetDateAllowed(true);
-  TestWeirdType(converter, v8::Date::New(isolate_, 1000),
+  TestWeirdType(converter, v8::Date::New(context, 1000).ToLocalChecked(),
                 base::Value::Type::DOUBLE,
                 std::unique_ptr<base::Value>(new base::Value(1.0)));
 
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index 4e0f218025..76dd3cd 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -11,8 +11,9 @@
 import("//mojo/public/tools/bindings/mojom.gni")
 import("//ppapi/features/features.gni")
 import("//services/service_manager/public/service_manifest.gni")
-import("//tools/grit/repack.gni")
 import("//tools/grit/grit_rule.gni")
+import("//tools/grit/repack.gni")
+import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
 if (is_android) {
   import("//build/config/android/config.gni")
 } else if (is_mac) {
@@ -645,13 +646,11 @@
   bundle_data("content_shell_framework_resources") {
     sources = [
       "$root_out_dir/content_shell.pak",
-      "$root_out_dir/v8_context_snapshot.bin",
       "resources/missingImage.png",
     ]
 
     public_deps = [
       ":pak",
-      "//tools/v8_context_snapshot:v8_context_snapshot",
     ]
 
     if (icu_use_data_file) {
@@ -662,11 +661,14 @@
     }
 
     if (v8_use_external_startup_data) {
-      sources += [
-        "$root_out_dir/natives_blob.bin",
-        "$root_out_dir/snapshot_blob.bin",
-      ]
+      sources += [ "$root_out_dir/natives_blob.bin" ]
       public_deps += [ "//v8" ]
+      if (use_v8_context_snapshot) {
+        sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
+        public_deps += [ "//tools/v8_context_snapshot" ]
+      } else {
+        sources += [ "$root_out_dir/snapshot_blob.bin" ]
+      }
     }
 
     outputs = [
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
index 29e75fd57..bfb51d89 100644
--- a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
+++ b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
@@ -104,7 +104,7 @@
 
     # Need to add detection of feedback loops with multiple render targets.
     self.Fail('conformance/extensions/webgl-draw-buffers-feedback-loop.html',
-        bug=1619) # angle bug ID
+        ['no_passthrough'], bug=1619) # angle bug ID
 
     # Failing on Windows and Linux with NVIDIA GPUs and OpenGL driver.
     self.Fail('conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html',
@@ -131,10 +131,6 @@
     self.Skip('conformance/rendering/texture-switch-performance.html',
         bug=735483)
 
-    # Passthrough command decoder
-    self.Fail('conformance/extensions/webgl-draw-buffers.html',
-        ['passthrough'], bug=1523) # angle bug ID
-
     # Passthrough command decoder / OpenGL
     self.Fail('conformance/buffers/buffer-uninitialized.html',
         ['passthrough', 'opengl'], bug=665521)
@@ -202,10 +198,6 @@
     self.Fail('conformance/textures/misc/texture-attachment-formats.html',
         ['passthrough', 'opengl', 'amd'], bug=665521)
 
-    # Passthrough command decoder / D3D11
-    self.Fail('conformance/textures/misc/copy-tex-image-and-sub-image-2d.html',
-        ['passthrough', 'd3d11'], bug=1639) # angle bug ID
-
     # Win / AMD / Passthrough command decoder / D3D11
     self.Flaky('conformance/textures/misc/copytexsubimage2d-subrects.html',
         ['win', 'amd', 'passthrough', 'd3d11'], bug=685232)
@@ -410,16 +402,6 @@
     self.Flaky('conformance/renderbuffers/framebuffer-state-restoration.html',
         ['win', 'intel', 'passthrough', 'd3d11'], bug=602688)
 
-    # Win 10 / Intel / Passthrough command decoder
-    self.Fail('conformance/extensions/oes-texture-float-with-video.html',
-        ['win10', 'intel', 'passthrough', 'd3d11'], bug=750813)
-    self.Fail('conformance/extensions/oes-texture-half-float-with-video.html',
-        ['win10', 'intel', 'passthrough', 'd3d11'], bug=750813)
-    self.Fail('conformance/textures/image_bitmap_from_video/*',
-        ['win10', 'intel', 'passthrough', 'd3d11'], bug=750813)
-    self.Fail('conformance/textures/video/*',
-        ['win10', 'intel', 'passthrough', 'd3d11'], bug=750813)
-
     # D3D9 / Passthrough command decoder
     self.Fail('conformance/textures/canvas/' +
         'tex-2d-luminance-luminance-unsigned_byte.html',
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index e418e79..5d7ce5e2 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -501,8 +501,7 @@
             blink::WebMixedContentContextType::kBlockable,
             false /* is_form_submission */, GURL() /* searchable_form_url */,
             std::string() /* searchable_form_encoding */, url::Origin(),
-            GURL() /* client_side_redirect_url */,
-            base::nullopt /* suggested_filename */);
+            GURL() /* client_side_redirect_url */);
     CommonNavigationParams common_params;
     common_params.url = url;
     common_params.referrer = Referrer(GURL(), blink::kWebReferrerPolicyDefault);
diff --git a/docs/security/faq.md b/docs/security/faq.md
index 3d4ab3f..11178201 100644
--- a/docs/security/faq.md
+++ b/docs/security/faq.md
@@ -434,10 +434,10 @@
 Features](https://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features).
 In short, many web platform features give web origins access to sensitive new
 sources of information, or significant power over a user's experience with their
-computer/phone/watch/et c., or over their experience with it. We would therefore
+computer/phone/watch/etc., or over their experience with it. We would therefore
 like to have some basis to believe the origin meets a minimum bar for security,
 that the sensitive information is transported over the Internet in an
-authetnicated and confidential way, and that users can make meaningful choices
+authenticated and confidential way, and that users can make meaningful choices
 to trust or not trust a web origin.
 
 Note that the reason we require secure origins for WebCrypto is slightly
diff --git a/extensions/browser/api/media_perception_private/conversion_utils.cc b/extensions/browser/api/media_perception_private/conversion_utils.cc
index ad41f53..0b9606a 100644
--- a/extensions/browser/api/media_perception_private/conversion_utils.cc
+++ b/extensions/browser/api/media_perception_private/conversion_utils.cc
@@ -286,6 +286,10 @@
     state_result.device_context =
         std::make_unique<std::string>(state.device_context());
   }
+  if (state.has_configuration()) {
+    state_result.configuration =
+        std::make_unique<std::string>(state.configuration());
+  }
   return state_result;
 }
 
@@ -295,6 +299,9 @@
   if (state.device_context)
     state_result.set_device_context(*state.device_context);
 
+  if (state.configuration)
+    state_result.set_configuration(*state.configuration);
+
   if (state.video_stream_param && state.video_stream_param.get() != nullptr) {
     for (size_t i = 0; i < state.video_stream_param.get()->size(); ++i) {
       mri::VideoStreamParam* video_stream_param_result =
diff --git a/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc b/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
index 21de6c9..a19f6358c 100644
--- a/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
+++ b/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
@@ -15,6 +15,7 @@
 namespace {
 
 const char kTestDeviceContext[] = "Video camera";
+const char kTestConfiguration[] = "dummy_config";
 const char kFakePacketLabel1[] = "Packet1";
 const char kFakePacketLabel3[] = "Packet3";
 const char kFakeEntityLabel3[] = "Region3";
@@ -258,9 +259,12 @@
 TEST(MediaPerceptionConversionUtilsTest, StateProtoToIdl) {
   mri::State state;
   state.set_status(mri::State::RUNNING);
+  state.set_configuration(kTestConfiguration);
   media_perception::State state_result =
       media_perception::StateProtoToIdl(state);
   EXPECT_EQ(state_result.status, media_perception::STATUS_RUNNING);
+  ASSERT_TRUE(state_result.configuration);
+  EXPECT_EQ(*state_result.configuration, kTestConfiguration);
 
   state.set_status(mri::State::STARTED);
   state.set_device_context(kTestDeviceContext);
@@ -285,6 +289,13 @@
   EXPECT_EQ(state_proto.status(), mri::State::UNINITIALIZED);
   EXPECT_FALSE(state_proto.has_device_context());
 
+  state.status = media_perception::STATUS_RUNNING;
+  state.configuration = std::make_unique<std::string>(kTestConfiguration);
+  state_proto = StateIdlToProto(state);
+  EXPECT_EQ(state_proto.status(), mri::State::RUNNING);
+  ASSERT_TRUE(state_proto.has_configuration());
+  EXPECT_EQ(state_proto.configuration(), kTestConfiguration);
+
   state.status = media_perception::STATUS_SUSPENDED;
   state.device_context = std::make_unique<std::string>(kTestDeviceContext);
   state_proto = StateIdlToProto(state);
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_api.cc b/extensions/browser/api/media_perception_private/media_perception_private_api.cc
index f0b6fc2..b529525 100644
--- a/extensions/browser/api/media_perception_private/media_perception_private_api.cc
+++ b/extensions/browser/api/media_perception_private/media_perception_private_api.cc
@@ -62,6 +62,12 @@
         Error("SetState: status must be RUNNING to set videoStreamParam."));
   }
 
+  // Check that configuration is only provided with SetState RUNNING.
+  if (params->state.configuration &&
+      params->state.status != media_perception::STATUS_RUNNING) {
+    return RespondNow(Error("Status must be RUNNING to set configuration."));
+  }
+
   MediaPerceptionAPIManager* manager =
       MediaPerceptionAPIManager::Get(browser_context());
   manager->SetState(
diff --git a/extensions/common/api/media_perception_private.idl b/extensions/common/api/media_perception_private.idl
index 2f79834..5925c021 100644
--- a/extensions/common/api/media_perception_private.idl
+++ b/extensions/common/api/media_perception_private.idl
@@ -118,6 +118,10 @@
     // A list of video streams processed by the analytics process. To set this
     // parameter, status has to be <code>RUNNING</code>.
     VideoStreamParam[]? videoStreamParam;
+
+    // Media analytics configuration. It can only be used when setting state to
+    // RUNNING.
+    DOMString? configuration;
   };
 
   dictionary Point {
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index c50ecb3..832bbe5 100644
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -571,7 +571,8 @@
   }
   non_localized_name_ = base::UTF16ToUTF8(localized_name);
   base::i18n::AdjustStringForLocaleDirection(&localized_name);
-  name_ = base::UTF16ToUTF8(localized_name);
+  display_name_ =
+      base::UTF16ToUTF8(base::CollapseWhitespace(localized_name, true));
   return true;
 }
 
@@ -744,7 +745,7 @@
     base::i18n::AdjustStringForLocaleDirection(&localized_short_name);
     short_name_ = base::UTF16ToUTF8(localized_short_name);
   } else {
-    short_name_ = name_;
+    short_name_ = display_name_;
   }
   return true;
 }
diff --git a/extensions/common/extension.h b/extensions/common/extension.h
index 3909f65a..f964681 100644
--- a/extensions/common/extension.h
+++ b/extensions/common/extension.h
@@ -251,7 +251,7 @@
   const std::string& version_name() const { return version_name_; }
   const std::string VersionString() const;
   const std::string GetVersionForDisplay() const;
-  const std::string& name() const { return name_; }
+  const std::string& name() const { return display_name_; }
   const std::string& short_name() const { return short_name_; }
   const std::string& non_localized_name() const { return non_localized_name_; }
   // Base64-encoded version of the key used to sign this extension.
@@ -366,7 +366,7 @@
   // might be wrapped with unicode bidi control characters so that it is
   // displayed correctly in RTL context.
   // NOTE: Name is UTF-8 and may contain non-ascii characters.
-  std::string name_;
+  std::string display_name_;
 
   // A non-localized version of the extension's name. This is useful for
   // debug output.
diff --git a/extensions/shell/BUILD.gn b/extensions/shell/BUILD.gn
index d74f2d1..622d8f3 100644
--- a/extensions/shell/BUILD.gn
+++ b/extensions/shell/BUILD.gn
@@ -9,6 +9,7 @@
 import("//extensions/features/features.gni")
 import("//testing/test.gni")
 import("//tools/grit/grit_rule.gni")
+import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
 if (is_mac) {
   import("//build/config/mac/rules.gni")
   import("//third_party/icu/config.gni")
@@ -298,7 +299,6 @@
     "$root_out_dir/extensions_shell_and_test.pak",
 
     #"$root_out_dir/natives_blob.bin", # move to gin
-    #"$root_out_dir/snapshot_blob.bin",
   ]
 
   deps = [
@@ -363,23 +363,24 @@
     sources = [
       "$root_gen_dir/extensions/shell/app_shell_resources.pak",
       "$root_out_dir/extensions_shell_and_test.pak",
-      "$root_out_dir/v8_context_snapshot.bin",
     ]
     public_deps = [
       ":resources_grit",
       "//extensions:shell_and_test_pak",
-      "//tools/v8_context_snapshot:v8_context_snapshot",
     ]
     if (icu_use_data_file) {
       sources += [ "$root_out_dir/icudtl.dat" ]
       public_deps += [ "//third_party/icu:icudata" ]
     }
     if (v8_use_external_startup_data) {
-      sources += [
-        "$root_out_dir/natives_blob.bin",
-        "$root_out_dir/snapshot_blob.bin",
-      ]
+      sources += [ "$root_out_dir/natives_blob.bin" ]
       public_deps += [ "//v8" ]
+      if (use_v8_context_snapshot) {
+        sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
+        public_deps += [ "//tools/v8_context_snapshot" ]
+      } else {
+        sources += [ "$root_out_dir/snapshot_blob.bin" ]
+      }
     }
     outputs = [
       "{{bundle_resources_dir}}/{{source_file_part}}",
diff --git a/extensions/shell/installer/linux/common/installer.include b/extensions/shell/installer/linux/common/installer.include
index 6c6e14d..d00349c 100644
--- a/extensions/shell/installer/linux/common/installer.include
+++ b/extensions/shell/installer/linux/common/installer.include
@@ -122,11 +122,17 @@
   # ICU data file; Necessary when the GN icu_use_data_file flag is true.
   install -m 644 "${BUILDDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/"
 
-  # V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag
+  # V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag 
   # is true.
   if [ -f "${BUILDDIR}/natives_blob.bin" ]; then
     install -m 644 "${BUILDDIR}/natives_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
-    install -m 644 "${BUILDDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
+    # Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available.
+    # TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch
+    if [ -f "${BUILDDIR}/v8_context_snapshot.bin" ]; then
+      install -m 644 "${BUILDDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/"
+    else
+      install -m 644 "${BUILDDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
+    fi
   fi
 
   # ANGLE
diff --git a/extensions/test/data/media_perception_private/state/runtest.js b/extensions/test/data/media_perception_private/state/runtest.js
index a61590c9..0b66e6a9 100644
--- a/extensions/test/data/media_perception_private/state/runtest.js
+++ b/extensions/test/data/media_perception_private/state/runtest.js
@@ -13,6 +13,7 @@
   chrome.mediaPerceptionPrivate.setState({
     status: 'RUNNING',
     deviceContext: 'device_context',
+    configuration: 'dummy_config',
     videoStreamParam: [
       {
         id: 'FaceDetection',
@@ -23,6 +24,7 @@
     ],
   }, chrome.test.callbackPass(function(state) {
     chrome.test.assertEq('RUNNING', state.status);
+    chrome.test.assertEq('dummy_config', state.configuration);
   }));
 }
 
@@ -30,6 +32,7 @@
   chrome.mediaPerceptionPrivate.getState(
       chrome.test.callbackPass(function(state) {
         chrome.test.assertEq('RUNNING', state.status);
+        chrome.test.assertEq('dummy_config', state.configuration);
       }));
 }
 
@@ -52,6 +55,14 @@
   }, chrome.test.callbackFail(error));
 }
 
+function setStateSuspendedButWithConfigurationFail() {
+  const error = 'Status must be RUNNING to set configuration.';
+  chrome.mediaPerceptionPrivate.setState({
+    status: 'SUSPENDED',
+    configuration: 'dummy_config'
+  }, chrome.test.callbackFail(error));
+}
+
 function setStateSuspendedButWithVideoStreamParamFail() {
   const error = 'SetState: status must be RUNNING to set videoStreamParam.';
   chrome.mediaPerceptionPrivate.setState({
@@ -77,6 +88,14 @@
   }));
 }
 
+function setStateRunningWithoutOptionalParameters() {
+  chrome.mediaPerceptionPrivate.setState({
+    status: 'RUNNING',
+  }, chrome.test.callbackPass(function(state) {
+    chrome.test.assertEq('RUNNING', state.status);
+  }));
+}
+
 function setStateStopped() {
   chrome.mediaPerceptionPrivate.setState({
     status: 'STOPPED',
@@ -91,7 +110,9 @@
     getStateRunning,
     setStateUnsettable,
     setStateSuspendedButWithDeviceContextFail,
+    setStateSuspendedButWithConfigurationFail,
     setStateSuspendedButWithVideoStreamParamFail,
     setStateRestarted,
+    setStateRunningWithoutOptionalParameters,
     setStateStopped]);
 
diff --git a/google_apis/drive/base_requests.cc b/google_apis/drive/base_requests.cc
index fb5594c..43f123c3 100644
--- a/google_apis/drive/base_requests.cc
+++ b/google_apis/drive/base_requests.cc
@@ -6,6 +6,7 @@
 
 #include <stddef.h>
 
+#include <memory>
 #include <utility>
 
 #include "base/files/file_util.h"
@@ -13,7 +14,6 @@
 #include "base/json/json_writer.h"
 #include "base/location.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
@@ -290,7 +290,7 @@
                           const net::CompletionCallback& callback) {
   if (!get_content_callback_.is_null()) {
     get_content_callback_.Run(
-        HTTP_SUCCESS, base::MakeUnique<std::string>(buffer->data(), num_bytes));
+        HTTP_SUCCESS, std::make_unique<std::string>(buffer->data(), num_bytes));
   }
 
   if (file_writer_) {
diff --git a/google_apis/drive/base_requests_server_unittest.cc b/google_apis/drive/base_requests_server_unittest.cc
index c1ce4326..2d3aa4da 100644
--- a/google_apis/drive/base_requests_server_unittest.cc
+++ b/google_apis/drive/base_requests_server_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/bind.h"
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "google_apis/drive/dummy_auth_service.h"
@@ -78,7 +77,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<DownloadFileRequestBase> request =
-        base::MakeUnique<DownloadFileRequestBase>(
+        std::make_unique<DownloadFileRequestBase>(
             request_sender_.get(),
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -112,7 +111,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<DownloadFileRequestBase> request =
-        base::MakeUnique<DownloadFileRequestBase>(
+        std::make_unique<DownloadFileRequestBase>(
             request_sender_.get(),
             test_util::CreateQuitCallback(
                 &run_loop,
diff --git a/google_apis/drive/base_requests_unittest.cc b/google_apis/drive/base_requests_unittest.cc
index 19449aa..1a456578 100644
--- a/google_apis/drive/base_requests_unittest.cc
+++ b/google_apis/drive/base_requests_unittest.cc
@@ -10,7 +10,6 @@
 #include <utility>
 
 #include "base/bind.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/values.h"
@@ -181,7 +180,7 @@
 
   DriveApiErrorCode error = DRIVE_OTHER_ERROR;
   base::RunLoop run_loop;
-  sender_->StartRequestWithAuthRetry(base::MakeUnique<FakeUrlFetchRequest>(
+  sender_->StartRequestWithAuthRetry(std::make_unique<FakeUrlFetchRequest>(
       sender_.get(),
       test_util::CreateQuitCallback(
           &run_loop, test_util::CreateCopyResultCallback(&error)),
@@ -203,7 +202,7 @@
   std::string upload_content_type;
   std::string upload_content_data;
   std::unique_ptr<FakeMultipartUploadRequest> multipart_request =
-      base::MakeUnique<FakeMultipartUploadRequest>(
+      std::make_unique<FakeMultipartUploadRequest>(
           sender_->blocking_task_runner(), "{json:\"test\"}", "text/plain", 10,
           source_path,
           test_util::CreateQuitCallback(
@@ -212,7 +211,7 @@
           &upload_content_data);
   multipart_request->SetBoundaryForTesting("TESTBOUNDARY");
   sender_->StartRequestWithAuthRetry(
-      base::MakeUnique<drive::SingleBatchableDelegateRequest>(
+      std::make_unique<drive::SingleBatchableDelegateRequest>(
           sender_.get(), std::move(multipart_request)));
   run_loop.Run();
   EXPECT_EQ("multipart/related; boundary=TESTBOUNDARY", upload_content_type);
diff --git a/google_apis/drive/drive_api_requests.cc b/google_apis/drive/drive_api_requests.cc
index 27afcecc..f690b0b 100644
--- a/google_apis/drive/drive_api_requests.cc
+++ b/google_apis/drive/drive_api_requests.cc
@@ -12,7 +12,6 @@
 #include "base/callback.h"
 #include "base/json/json_writer.h"
 #include "base/location.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/sequenced_task_runner.h"
@@ -93,9 +92,9 @@
   if (properties.empty())
     return;
 
-  auto properties_value = base::MakeUnique<base::ListValue>();
+  auto properties_value = std::make_unique<base::ListValue>();
   for (const auto& property : properties) {
-    auto property_value = base::MakeUnique<base::DictionaryValue>();
+    auto property_value = std::make_unique<base::DictionaryValue>();
     std::string visibility_as_string;
     switch (property.visibility()) {
       case Property::VISIBILITY_PRIVATE:
@@ -128,7 +127,7 @@
 
   // Fill parent link.
   if (!parent_resource_id.empty()) {
-    auto parents = base::MakeUnique<base::ListValue>();
+    auto parents = std::make_unique<base::ListValue>();
     parents->Append(google_apis::util::CreateParentValue(parent_resource_id));
     root.Set("parents", std::move(parents));
   }
@@ -388,9 +387,9 @@
     root.SetString("modifiedDate", util::FormatTimeAsString(modified_date_));
 
   if (!parents_.empty()) {
-    auto parents_value = base::MakeUnique<base::ListValue>();
+    auto parents_value = std::make_unique<base::ListValue>();
     for (size_t i = 0; i < parents_.size(); ++i) {
-      auto parent = base::MakeUnique<base::DictionaryValue>();
+      auto parent = std::make_unique<base::DictionaryValue>();
       parent->SetString("id", parents_[i]);
       parents_value->Append(std::move(parent));
     }
@@ -466,9 +465,9 @@
   }
 
   if (!parents_.empty()) {
-    auto parents_value = base::MakeUnique<base::ListValue>();
+    auto parents_value = std::make_unique<base::ListValue>();
     for (size_t i = 0; i < parents_.size(); ++i) {
-      auto parent = base::MakeUnique<base::DictionaryValue>();
+      auto parent = std::make_unique<base::DictionaryValue>();
       parent->SetString("id", parents_[i]);
       parents_value->Append(std::move(parent));
     }
@@ -520,9 +519,9 @@
     root.SetString("modifiedDate", util::FormatTimeAsString(modified_date_));
 
   if (!parents_.empty()) {
-    auto parents_value = base::MakeUnique<base::ListValue>();
+    auto parents_value = std::make_unique<base::ListValue>();
     for (size_t i = 0; i < parents_.size(); ++i) {
-      auto parent = base::MakeUnique<base::DictionaryValue>();
+      auto parent = std::make_unique<base::DictionaryValue>();
       parent->SetString("id", parents_[i]);
       parents_value->Append(std::move(parent));
     }
@@ -824,7 +823,7 @@
   root.SetString("title", title_);
 
   // Fill parent link.
-  auto parents = base::MakeUnique<base::ListValue>();
+  auto parents = std::make_unique<base::ListValue>();
   parents->Append(util::CreateParentValue(parent_resource_id_));
   root.Set("parents", std::move(parents));
 
@@ -884,7 +883,7 @@
     std::string* upload_content) {
   base::DictionaryValue root;
   if (!parent_resource_id_.empty()) {
-    auto parents = base::MakeUnique<base::ListValue>();
+    auto parents = std::make_unique<base::ListValue>();
     parents->Append(util::CreateParentValue(parent_resource_id_));
     root.Set("parents", std::move(parents));
   }
@@ -1148,7 +1147,7 @@
     case PERMISSION_ROLE_COMMENTER:
       root.SetString("role", "reader");
       {
-        auto list = base::MakeUnique<base::ListValue>();
+        auto list = std::make_unique<base::ListValue>();
         list->AppendString("commenter");
         root.Set("additionalRoles", std::move(list));
       }
@@ -1248,7 +1247,7 @@
   DCHECK(request);
   DCHECK(GetChildEntry(request) == child_requests_.end());
   DCHECK(!committed_);
-  child_requests_.push_back(base::MakeUnique<BatchUploadChildEntry>(request));
+  child_requests_.push_back(std::make_unique<BatchUploadChildEntry>(request));
   request->Prepare(base::Bind(&BatchUploadRequest::OnChildRequestPrepared,
                               weak_ptr_factory_.GetWeakPtr(), request));
 }
diff --git a/google_apis/drive/drive_api_requests_unittest.cc b/google_apis/drive/drive_api_requests_unittest.cc
index 9706966..68b5cf9 100644
--- a/google_apis/drive/drive_api_requests_unittest.cc
+++ b/google_apis/drive/drive_api_requests_unittest.cc
@@ -13,7 +13,6 @@
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/json/json_reader.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/strings/string_number_conversions.h"
@@ -525,7 +524,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::AboutGetRequest> request =
-        base::MakeUnique<drive::AboutGetRequest>(
+        std::make_unique<drive::AboutGetRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -569,7 +568,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesInsertRequest> request =
-        base::MakeUnique<drive::FilesInsertRequest>(
+        std::make_unique<drive::FilesInsertRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -637,7 +636,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesPatchRequest> request =
-        base::MakeUnique<drive::FilesPatchRequest>(
+        std::make_unique<drive::FilesPatchRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -692,7 +691,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::AboutGetRequest> request =
-        base::MakeUnique<drive::AboutGetRequest>(
+        std::make_unique<drive::AboutGetRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -726,7 +725,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::AboutGetRequest> request =
-        base::MakeUnique<drive::AboutGetRequest>(
+        std::make_unique<drive::AboutGetRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -753,7 +752,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::AppsListRequest> request =
-        base::MakeUnique<drive::AppsListRequest>(
+        std::make_unique<drive::AppsListRequest>(
             request_sender_.get(), *url_generator_,
             false,  // use_internal_endpoint
             test_util::CreateQuitCallback(
@@ -781,7 +780,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ChangesListRequest> request =
-        base::MakeUnique<drive::ChangesListRequest>(
+        std::make_unique<drive::ChangesListRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -815,7 +814,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ChangesListNextPageRequest> request =
-        base::MakeUnique<drive::ChangesListNextPageRequest>(
+        std::make_unique<drive::ChangesListNextPageRequest>(
             request_sender_.get(),
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -846,7 +845,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesCopyRequest> request =
-        base::MakeUnique<drive::FilesCopyRequest>(
+        std::make_unique<drive::FilesCopyRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -891,7 +890,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesCopyRequest> request =
-        base::MakeUnique<drive::FilesCopyRequest>(
+        std::make_unique<drive::FilesCopyRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -923,7 +922,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::TeamDriveListRequest> request =
-        base::MakeUnique<drive::TeamDriveListRequest>(
+        std::make_unique<drive::TeamDriveListRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -952,7 +951,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesListRequest> request =
-        base::MakeUnique<drive::FilesListRequest>(
+        std::make_unique<drive::FilesListRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -981,7 +980,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesListNextPageRequest> request =
-        base::MakeUnique<drive::FilesListNextPageRequest>(
+        std::make_unique<drive::FilesListNextPageRequest>(
             request_sender_.get(),
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -1004,7 +1003,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesDeleteRequest> request =
-        base::MakeUnique<drive::FilesDeleteRequest>(
+        std::make_unique<drive::FilesDeleteRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop, test_util::CreateCopyResultCallback(&error)));
@@ -1034,7 +1033,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::FilesTrashRequest> request =
-        base::MakeUnique<drive::FilesTrashRequest>(
+        std::make_unique<drive::FilesTrashRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop,
@@ -1063,7 +1062,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ChildrenInsertRequest> request =
-        base::MakeUnique<drive::ChildrenInsertRequest>(
+        std::make_unique<drive::ChildrenInsertRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop, test_util::CreateCopyResultCallback(&error)));
@@ -1091,7 +1090,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ChildrenDeleteRequest> request =
-        base::MakeUnique<drive::ChildrenDeleteRequest>(
+        std::make_unique<drive::ChildrenDeleteRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop, test_util::CreateCopyResultCallback(&error)));
@@ -1126,7 +1125,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadNewFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadNewFileRequest>(
+        std::make_unique<drive::InitiateUploadNewFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "parent_resource_id",  // The resource id of the parent directory.
@@ -1168,7 +1167,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ResumeUploadRequest> request =
-        base::MakeUnique<drive::ResumeUploadRequest>(
+        std::make_unique<drive::ResumeUploadRequest>(
             request_sender_.get(), upload_url,
             0,                    // start_position
             kTestContent.size(),  // end_position (exclusive)
@@ -1218,7 +1217,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadNewFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadNewFileRequest>(
+        std::make_unique<drive::InitiateUploadNewFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType, 0,
             "parent_resource_id",  // The resource id of the parent directory.
             "new file title",      // The title of the file being uploaded.
@@ -1253,7 +1252,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ResumeUploadRequest> request =
-        base::MakeUnique<drive::ResumeUploadRequest>(
+        std::make_unique<drive::ResumeUploadRequest>(
             request_sender_.get(), upload_url,
             0,  // start_position
             0,  // end_position (exclusive)
@@ -1302,7 +1301,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadNewFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadNewFileRequest>(
+        std::make_unique<drive::InitiateUploadNewFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "parent_resource_id",  // The resource id of the parent directory.
@@ -1342,7 +1341,7 @@
     {
       base::RunLoop run_loop;
       std::unique_ptr<drive::GetUploadStatusRequest> request =
-          base::MakeUnique<drive::GetUploadStatusRequest>(
+          std::make_unique<drive::GetUploadStatusRequest>(
               request_sender_.get(), upload_url, kTestContent.size(),
               test_util::CreateQuitCallback(
                   &run_loop,
@@ -1381,7 +1380,7 @@
     {
       base::RunLoop run_loop;
       std::unique_ptr<drive::ResumeUploadRequest> request =
-          base::MakeUnique<drive::ResumeUploadRequest>(
+          std::make_unique<drive::ResumeUploadRequest>(
               request_sender_.get(), upload_url, start_position, end_position,
               kTestContent.size(),  // content_length,
               kTestContentType, kTestFilePath,
@@ -1426,7 +1425,7 @@
     {
       base::RunLoop run_loop;
       std::unique_ptr<drive::GetUploadStatusRequest> request =
-          base::MakeUnique<drive::GetUploadStatusRequest>(
+          std::make_unique<drive::GetUploadStatusRequest>(
               request_sender_.get(), upload_url, kTestContent.size(),
               test_util::CreateQuitCallback(
                   &run_loop,
@@ -1471,7 +1470,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadNewFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadNewFileRequest>(
+        std::make_unique<drive::InitiateUploadNewFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "parent_resource_id",  // The resource id of the parent directory.
@@ -1528,7 +1527,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadExistingFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadExistingFileRequest>(
+        std::make_unique<drive::InitiateUploadExistingFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "resource_id",  // The resource id of the file to be overwritten.
@@ -1565,7 +1564,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ResumeUploadRequest> request =
-        base::MakeUnique<drive::ResumeUploadRequest>(
+        std::make_unique<drive::ResumeUploadRequest>(
             request_sender_.get(), upload_url,
             0,                    // start_position
             kTestContent.size(),  // end_position (exclusive)
@@ -1615,13 +1614,14 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadExistingFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadExistingFileRequest>(
+        std::make_unique<drive::InitiateUploadExistingFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "resource_id",  // The resource id of the file to be overwritten.
-            kTestETag, test_util::CreateQuitCallback(
-                           &run_loop, test_util::CreateCopyResultCallback(
-                                          &error, &upload_url)));
+            kTestETag,
+            test_util::CreateQuitCallback(
+                &run_loop,
+                test_util::CreateCopyResultCallback(&error, &upload_url)));
     request_sender_->StartRequestWithAuthRetry(std::move(request));
     run_loop.Run();
   }
@@ -1646,7 +1646,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ResumeUploadRequest> request =
-        base::MakeUnique<drive::ResumeUploadRequest>(
+        std::make_unique<drive::ResumeUploadRequest>(
             request_sender_.get(), upload_url,
             0,                    // start_position
             kTestContent.size(),  // end_position (exclusive)
@@ -1698,7 +1698,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadExistingFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadExistingFileRequest>(
+        std::make_unique<drive::InitiateUploadExistingFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "resource_id",  // The resource id of the file to be overwritten.
@@ -1741,13 +1741,14 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadExistingFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadExistingFileRequest>(
+        std::make_unique<drive::InitiateUploadExistingFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "resource_id",  // The resource id of the file to be overwritten.
-            kTestETag, test_util::CreateQuitCallback(
-                           &run_loop, test_util::CreateCopyResultCallback(
-                                          &error, &upload_url)));
+            kTestETag,
+            test_util::CreateQuitCallback(
+                &run_loop,
+                test_util::CreateCopyResultCallback(&error, &upload_url)));
     request_sender_->StartRequestWithAuthRetry(std::move(request));
     run_loop.Run();
   }
@@ -1777,7 +1778,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::ResumeUploadRequest> resume_request =
-        base::MakeUnique<drive::ResumeUploadRequest>(
+        std::make_unique<drive::ResumeUploadRequest>(
             request_sender_.get(), upload_url,
             0,                    // start_position
             kTestContent.size(),  // end_position (exclusive)
@@ -1831,13 +1832,14 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::InitiateUploadExistingFileRequest> request =
-        base::MakeUnique<drive::InitiateUploadExistingFileRequest>(
+        std::make_unique<drive::InitiateUploadExistingFileRequest>(
             request_sender_.get(), *url_generator_, kTestContentType,
             kTestContent.size(),
             "resource_id",  // The resource id of the file to be overwritten.
-            kTestETag, test_util::CreateQuitCallback(
-                           &run_loop, test_util::CreateCopyResultCallback(
-                                          &error, &upload_url)));
+            kTestETag,
+            test_util::CreateQuitCallback(
+                &run_loop,
+                test_util::CreateCopyResultCallback(&error, &upload_url)));
     request->set_parent_resource_id("new_parent_resource_id");
     request->set_title("new file title");
     base::Time modified_date_utc;
@@ -1884,7 +1886,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::DownloadFileRequest> request =
-        base::MakeUnique<drive::DownloadFileRequest>(
+        std::make_unique<drive::DownloadFileRequest>(
             request_sender_.get(), *url_generator_, kTestId,
             kDownloadedFilePath,
             test_util::CreateQuitCallback(
@@ -1920,7 +1922,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::DownloadFileRequest> request =
-        base::MakeUnique<drive::DownloadFileRequest>(
+        std::make_unique<drive::DownloadFileRequest>(
             request_sender_.get(), *url_generator_, kTestId,
             kDownloadedFilePath,
             test_util::CreateQuitCallback(
@@ -1953,7 +1955,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::PermissionsInsertRequest> request =
-        base::MakeUnique<drive::PermissionsInsertRequest>(
+        std::make_unique<drive::PermissionsInsertRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop, test_util::CreateCopyResultCallback(&error)));
@@ -1986,7 +1988,7 @@
   {
     base::RunLoop run_loop;
     std::unique_ptr<drive::PermissionsInsertRequest> request =
-        base::MakeUnique<drive::PermissionsInsertRequest>(
+        std::make_unique<drive::PermissionsInsertRequest>(
             request_sender_.get(), *url_generator_,
             test_util::CreateQuitCallback(
                 &run_loop, test_util::CreateCopyResultCallback(&error)));
@@ -2023,7 +2025,7 @@
 
   // Create batch request.
   std::unique_ptr<drive::BatchUploadRequest> request =
-      base::MakeUnique<drive::BatchUploadRequest>(request_sender_.get(),
+      std::make_unique<drive::BatchUploadRequest>(request_sender_.get(),
                                                   *url_generator_);
   drive::BatchUploadRequest* request_ptr = request.get();
   request_ptr->SetBoundaryForTesting("OUTERBOUNDARY");
@@ -2104,7 +2106,7 @@
 TEST_F(DriveApiRequestsTest, BatchUploadRequestWithBodyIncludingZero) {
   // Create batch request.
   std::unique_ptr<drive::BatchUploadRequest> request =
-      base::MakeUnique<drive::BatchUploadRequest>(request_sender_.get(),
+      std::make_unique<drive::BatchUploadRequest>(request_sender_.get(),
                                                   *url_generator_);
   drive::BatchUploadRequest* request_ptr = request.get();
   request_ptr->SetBoundaryForTesting("OUTERBOUNDARY");
@@ -2143,7 +2145,7 @@
 TEST_F(DriveApiRequestsTest, BatchUploadRequestProgress) {
   // Create batch request.
   std::unique_ptr<drive::BatchUploadRequest> request =
-      base::MakeUnique<drive::BatchUploadRequest>(request_sender_.get(),
+      std::make_unique<drive::BatchUploadRequest>(request_sender_.get(),
                                                   *url_generator_);
   TestBatchableDelegate* requests[] = {
       new TestBatchableDelegate(GURL("http://example.com/test"),
diff --git a/google_apis/drive/files_list_request_runner.cc b/google_apis/drive/files_list_request_runner.cc
index 2eb7fe0..3b7d9f2 100644
--- a/google_apis/drive/files_list_request_runner.cc
+++ b/google_apis/drive/files_list_request_runner.cc
@@ -7,7 +7,6 @@
 #include <utility>
 
 #include "base/bind.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_functions.h"
 #include "base/metrics/histogram_macros.h"
 #include "google_apis/drive/drive_api_error_codes.h"
@@ -38,7 +37,7 @@
                             max_results);
   base::Closure* const cancel_callback = new base::Closure;
   std::unique_ptr<drive::FilesListRequest> request =
-      base::MakeUnique<drive::FilesListRequest>(
+      std::make_unique<drive::FilesListRequest>(
           request_sender_, url_generator_,
           base::Bind(&FilesListRequestRunner::OnCompleted,
                      weak_ptr_factory_.GetWeakPtr(), max_results, corpora,
diff --git a/google_apis/drive/request_sender_unittest.cc b/google_apis/drive/request_sender_unittest.cc
index 6e32eb0..93c532f 100644
--- a/google_apis/drive/request_sender_unittest.cc
+++ b/google_apis/drive/request_sender_unittest.cc
@@ -4,7 +4,6 @@
 
 #include "google_apis/drive/request_sender.h"
 
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "google_apis/drive/base_requests.h"
@@ -140,7 +139,7 @@
 TEST_F(RequestSenderTest, StartAndFinishRequest) {
   bool start_called  = false;
   FinishReason finish_reason = NONE;
-  std::unique_ptr<TestRequest> request = base::MakeUnique<TestRequest>(
+  std::unique_ptr<TestRequest> request = std::make_unique<TestRequest>(
       &request_sender_, &start_called, &finish_reason);
   TestRequest* request_ptr = request.get();
   base::WeakPtr<AuthenticatedRequestInterface> weak_ptr =
@@ -165,7 +164,7 @@
 TEST_F(RequestSenderTest, StartAndCancelRequest) {
   bool start_called  = false;
   FinishReason finish_reason = NONE;
-  std::unique_ptr<TestRequest> request = base::MakeUnique<TestRequest>(
+  std::unique_ptr<TestRequest> request = std::make_unique<TestRequest>(
       &request_sender_, &start_called, &finish_reason);
   base::WeakPtr<AuthenticatedRequestInterface> weak_ptr = request->GetWeakPtr();
 
@@ -185,7 +184,7 @@
 
   bool start_called  = false;
   FinishReason finish_reason = NONE;
-  std::unique_ptr<TestRequest> request = base::MakeUnique<TestRequest>(
+  std::unique_ptr<TestRequest> request = std::make_unique<TestRequest>(
       &request_sender_, &start_called, &finish_reason);
   base::WeakPtr<AuthenticatedRequestInterface> weak_ptr = request->GetWeakPtr();
 
@@ -204,7 +203,7 @@
 
   bool start_called  = false;
   FinishReason finish_reason = NONE;
-  std::unique_ptr<TestRequest> request = base::MakeUnique<TestRequest>(
+  std::unique_ptr<TestRequest> request = std::make_unique<TestRequest>(
       &request_sender_, &start_called, &finish_reason);
   TestRequest* request_ptr = request.get();
   base::WeakPtr<AuthenticatedRequestInterface> weak_ptr =
@@ -226,7 +225,7 @@
 TEST_F(RequestSenderTest, AccessTokenRejectedSeveralTimes) {
   bool start_called  = false;
   FinishReason finish_reason = NONE;
-  std::unique_ptr<TestRequest> request = base::MakeUnique<TestRequest>(
+  std::unique_ptr<TestRequest> request = std::make_unique<TestRequest>(
       &request_sender_, &start_called, &finish_reason);
   TestRequest* request_ptr = request.get();
   base::WeakPtr<AuthenticatedRequestInterface> weak_ptr =
diff --git a/google_apis/gaia/fake_oauth2_token_service.cc b/google_apis/gaia/fake_oauth2_token_service.cc
index 06b3b0f..3ed5a89e 100644
--- a/google_apis/gaia/fake_oauth2_token_service.cc
+++ b/google_apis/gaia/fake_oauth2_token_service.cc
@@ -4,7 +4,7 @@
 
 #include "google_apis/gaia/fake_oauth2_token_service.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
 
 FakeOAuth2TokenService::PendingRequest::PendingRequest() {
 }
@@ -17,7 +17,7 @@
 
 FakeOAuth2TokenService::FakeOAuth2TokenService()
     : OAuth2TokenService(
-          base::MakeUnique<FakeOAuth2TokenServiceDelegate>(nullptr)) {}
+          std::make_unique<FakeOAuth2TokenServiceDelegate>(nullptr)) {}
 
 FakeOAuth2TokenService::~FakeOAuth2TokenService() {
 }
diff --git a/google_apis/gaia/gaia_auth_util.cc b/google_apis/gaia/gaia_auth_util.cc
index 38aefdc..7acc27650 100644
--- a/google_apis/gaia/gaia_auth_util.cc
+++ b/google_apis/gaia/gaia_auth_util.cc
@@ -11,7 +11,6 @@
 #include "base/bind.h"
 #include "base/json/json_reader.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_split.h"
 #include "base/strings/string_util.h"
 #include "base/values.h"
@@ -53,7 +52,7 @@
 class GaiaURLRequestUserData : public base::SupportsUserData::Data {
  public:
   static std::unique_ptr<base::SupportsUserData::Data> Create() {
-    return base::MakeUnique<GaiaURLRequestUserData>();
+    return std::make_unique<GaiaURLRequestUserData>();
   }
 };
 
diff --git a/google_apis/gaia/google_service_auth_error.cc b/google_apis/gaia/google_service_auth_error.cc
index 8c657f0..79f445c 100644
--- a/google_apis/gaia/google_service_auth_error.cc
+++ b/google_apis/gaia/google_service_auth_error.cc
@@ -4,12 +4,12 @@
 
 #include "google_apis/gaia/google_service_auth_error.h"
 
+#include <memory>
 #include <string>
 #include <utility>
 
 #include "base/json/json_reader.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
@@ -199,7 +199,7 @@
     value->SetString("errorMessage", error_message_);
   }
   if (state_ == CAPTCHA_REQUIRED) {
-    auto captcha_value = base::MakeUnique<base::DictionaryValue>();
+    auto captcha_value = std::make_unique<base::DictionaryValue>();
     captcha_value->SetString("token", captcha_.token);
     captcha_value->SetString("audioUrl", captcha_.audio_url.spec());
     captcha_value->SetString("imageUrl", captcha_.image_url.spec());
@@ -210,7 +210,7 @@
   } else if (state_ == CONNECTION_FAILED) {
     value->SetString("networkError", net::ErrorToString(network_error_));
   } else if (state_ == TWO_FACTOR) {
-    auto two_factor_value = base::MakeUnique<base::DictionaryValue>();
+    auto two_factor_value = std::make_unique<base::DictionaryValue>();
     two_factor_value->SetString("token", second_factor_.token);
     two_factor_value->SetString("promptText", second_factor_.prompt_text);
     two_factor_value->SetString("alternateText", second_factor_.alternate_text);
diff --git a/google_apis/gaia/oauth2_token_service_unittest.cc b/google_apis/gaia/oauth2_token_service_unittest.cc
index b233d89..324a5a33 100644
--- a/google_apis/gaia/oauth2_token_service_unittest.cc
+++ b/google_apis/gaia/oauth2_token_service_unittest.cc
@@ -66,7 +66,7 @@
  public:
   void SetUp() override {
     oauth2_service_.reset(new TestOAuth2TokenService(
-        base::MakeUnique<FakeOAuth2TokenServiceDelegate>(
+        std::make_unique<FakeOAuth2TokenServiceDelegate>(
             new net::TestURLRequestContextGetter(
                 message_loop_.task_runner()))));
     account_id_ = "test_user@gmail.com";
diff --git a/google_apis/gaia/ubertoken_fetcher.cc b/google_apis/gaia/ubertoken_fetcher.cc
index 62dc3317..f9351ae 100644
--- a/google_apis/gaia/ubertoken_fetcher.cc
+++ b/google_apis/gaia/ubertoken_fetcher.cc
@@ -7,7 +7,6 @@
 #include <vector>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/rand_util.h"
 #include "base/time/time.h"
@@ -21,7 +20,7 @@
     GaiaAuthConsumer* consumer,
     const std::string& source,
     net::URLRequestContextGetter* request_context) {
-  return base::MakeUnique<GaiaAuthFetcher>(consumer, source, request_context);
+  return std::make_unique<GaiaAuthFetcher>(consumer, source, request_context);
 }
 }
 
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 58e1c8a..4068a7f2 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -6304,6 +6304,8 @@
       return capabilities.texture_format_etc1;
     case GL_R16_EXT:
       return capabilities.texture_norm16;
+    case GL_RGB10_A2_EXT:
+      return capabilities.image_xr30;
     case GL_RED:
     case GL_RG_EXT:
     case GL_RGB:
diff --git a/gpu/ipc/common/gpu_memory_buffer_support.cc b/gpu/ipc/common/gpu_memory_buffer_support.cc
index 6d4a1ec..1a8313b 100644
--- a/gpu/ipc/common/gpu_memory_buffer_support.cc
+++ b/gpu/ipc/common/gpu_memory_buffer_support.cc
@@ -56,6 +56,7 @@
       return format == gfx::BufferFormat::R_8 ||
              format == gfx::BufferFormat::BGRA_8888 ||
              format == gfx::BufferFormat::RGBA_F16 ||
+             format == gfx::BufferFormat::BGRX_1010102 ||
              format == gfx::BufferFormat::UYVY_422 ||
              format == gfx::BufferFormat::YUV_420_BIPLANAR;
     case gfx::BufferUsage::SCANOUT_VDA_WRITE:
diff --git a/gpu/ipc/service/gpu_vsync_provider_win.cc b/gpu/ipc/service/gpu_vsync_provider_win.cc
index 7c387fe..4b1daf1 100644
--- a/gpu/ipc/service/gpu_vsync_provider_win.cc
+++ b/gpu/ipc/service/gpu_vsync_provider_win.cc
@@ -669,7 +669,11 @@
   return false;
 }
 
-bool GpuVSyncProviderWin::SupportGetVSyncParametersIfAvailable() {
+bool GpuVSyncProviderWin::SupportGetVSyncParametersIfAvailable() const {
+  return false;
+}
+
+bool GpuVSyncProviderWin::IsHWClock() const {
   return false;
 }
 
diff --git a/gpu/ipc/service/gpu_vsync_provider_win.h b/gpu/ipc/service/gpu_vsync_provider_win.h
index d9ab1d3..a18fb2f 100644
--- a/gpu/ipc/service/gpu_vsync_provider_win.h
+++ b/gpu/ipc/service/gpu_vsync_provider_win.h
@@ -33,7 +33,8 @@
   void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
   bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
                                      base::TimeDelta* interval) override;
-  bool SupportGetVSyncParametersIfAvailable() override;
+  bool SupportGetVSyncParametersIfAvailable() const override;
+  bool IsHWClock() const override;
 
  private:
   void OnVSync(base::TimeTicks timestamp, base::TimeDelta interval);
diff --git a/ios/chrome/browser/ui/toolbar/adaptive/BUILD.gn b/ios/chrome/browser/ui/toolbar/adaptive/BUILD.gn
index 0a578fcf..b8127ec 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive/BUILD.gn
+++ b/ios/chrome/browser/ui/toolbar/adaptive/BUILD.gn
@@ -57,6 +57,7 @@
   ]
   deps = [
     "//base",
+    "//ios/chrome/browser/ui/activity_services/requirements",
     "//ios/chrome/browser/ui/toolbar/clean:toolbar_components_ui",
     "//ios/chrome/browser/ui/toolbar/clean:toolbar_ui",
     "//ios/chrome/browser/ui/toolbar/public",
diff --git a/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_coordinator.mm
index 2849d8b3..ee3fea7 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_coordinator.mm
@@ -79,8 +79,7 @@
 }
 
 - (id<ActivityServicePositioner>)activityServicePositioner {
-  // TODO(crbug.com/803376): Implement that.
-  return nil;
+  return self.viewController;
 }
 
 - (void)showPrerenderingAnimation {
diff --git a/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.h b/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.h
index 37b5565..3fe1a92 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.h
+++ b/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.h
@@ -5,11 +5,13 @@
 #ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_ADAPTIVE_PRIMARY_TOOLBAR_VIEW_CONTROLLER_H_
 #define IOS_CHROME_BROWSER_UI_TOOLBAR_ADAPTIVE_PRIMARY_TOOLBAR_VIEW_CONTROLLER_H_
 
+#import "ios/chrome/browser/ui/activity_services/requirements/activity_service_positioner.h"
 #import "ios/chrome/browser/ui/toolbar/adaptive/adaptive_toolbar_view_controller.h"
 
 // ViewController for the primary toobar part of the adaptive toolbar. It is the
 // part always displayed and containing the location bar.
-@interface PrimaryToolbarViewController : AdaptiveToolbarViewController
+@interface PrimaryToolbarViewController
+    : AdaptiveToolbarViewController<ActivityServicePositioner>
 
 // Sets the location bar view, containing the omnibox.
 - (void)setLocationBarView:(UIView*)locationBarView;
diff --git a/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.mm
index ce2495a..cc80ca2 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive/primary_toolbar_view_controller.mm
@@ -62,4 +62,10 @@
   self.view.locationBarView = locationBarView;
 }
 
+#pragma mark - ActivityServicePositioner
+
+- (UIView*)shareButtonView {
+  return self.view.shareButton;
+}
+
 @end
diff --git a/ios/chrome/browser/ui/util/transparent_link_button.mm b/ios/chrome/browser/ui/util/transparent_link_button.mm
index a713371..1896473 100644
--- a/ios/chrome/browser/ui/util/transparent_link_button.mm
+++ b/ios/chrome/browser/ui/util/transparent_link_button.mm
@@ -92,6 +92,7 @@
         UIEdgeInsetsMake(linkHeightExpansion, linkWidthExpansion,
                          linkHeightExpansion, linkWidthExpansion);
     self.backgroundColor = [UIColor clearColor];
+    self.exclusiveTouch = YES;
     _linkFrame = linkFrame;
     _URL = URL;
     // These buttons are positioned absolutely based on the the position of
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 80076e1..7e42fa2 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -563,6 +563,16 @@
 // section of go/bling-navigation-experiment for details.
 - (web::NavigationContextImpl*)loadPlaceholderInWebViewForURL:
     (const GURL&)originalURL;
+// Transitions |item| to web::ErrorRetryState::kNavigatingToFailedNavigationItem
+// state. This is part of auto reloading an item that previously triggered a
+// native error view.
+// TODO(crbug.com/738020): Move navigation logic to NavigationManager.
+- (void)handleNavigationToFailedNavigationItem:(web::NavigationItemImpl*)item;
+// Transitions |item| to web::ErrorRetryState::kRetryFailedNavigationItem state.
+// This is part of auto reloading an item that previously triggered a native
+// error view.
+// TODO(crbug.com/738020): Move navigation logic to NavigationManager.
+- (void)handleRetryFailedNavigationItem:(web::NavigationItemImpl*)item;
 // Loads the current nativeController in a native view. If a web view is
 // present, removes it and swaps in the native view in its place. |context| can
 // not be null.
@@ -1808,6 +1818,18 @@
   return [_navigationStates contextForNavigation:navigation];
 }
 
+- (void)handleNavigationToFailedNavigationItem:(web::NavigationItemImpl*)item {
+  item->SetErrorRetryState(
+      web::ErrorRetryState::kNavigatingToFailedNavigationItem);
+  [_webView loadHTMLString:@"" baseURL:net::NSURLWithGURL(item->GetURL())];
+}
+
+- (void)handleRetryFailedNavigationItem:(web::NavigationItemImpl*)item {
+  DCHECK_EQ(item->GetURL(), net::GURLWithNSURL(_webView.URL));
+  item->SetErrorRetryState(web::ErrorRetryState::kRetryFailedNavigationItem);
+  [_webView reload];
+}
+
 - (void)loadCurrentURL {
   // If the content view doesn't exist, the tab has either been evicted, or
   // never displayed. Bail, and let the URL be loaded when the tab is shown.
@@ -4161,6 +4183,10 @@
 
   GURL requestURL = net::GURLWithNSURL(action.request.URL);
 
+  // The page will not be changed until this navigation is committed, so the
+  // retrieved state will be pending until |didCommitNavigation| callback.
+  [self updatePendingNavigationInfoFromNavigationAction:action];
+
   // If this is a placeholder navigation, pass through.
   if (web::GetWebClient()->IsSlimNavigationManagerEnabled() &&
       IsPlaceholderUrl(requestURL)) {
@@ -4168,10 +4194,6 @@
     return;
   }
 
-  // The page will not be changed until this navigation is committed, so the
-  // retrieved state will be pending until |didCommitNavigation| callback.
-  [self updatePendingNavigationInfoFromNavigationAction:action];
-
   // Invalid URLs should not be loaded.
   if (!requestURL.is_valid()) {
     decisionHandler(WKNavigationActionPolicyCancel);
@@ -4618,8 +4640,12 @@
       return;
     }
 
+    web::NavigationContextImpl* context =
+        [_navigationStates contextForNavigation:navigation];
+    web::NavigationItemImpl* item = self.currentNavItem;
+    web::ErrorRetryState errorRetryState = item->GetErrorRetryState();
+
     if (IsPlaceholderUrl(webViewURL)) {
-      web::NavigationItemImpl* item = self.currentNavItem;
       // The |didFinishNavigation| callback can arrive after another
       // navigation has started. Abort in this case.
       if (CreatePlaceholderUrlForUrl(item->GetVirtualURL()) != webViewURL)
@@ -4636,9 +4662,6 @@
         [self createWebUIForURL:item->GetURL()];
       }
 
-      web::NavigationContextImpl* context =
-          [_navigationStates contextForNavigation:navigation];
-
       if ([self shouldLoadURLInNativeView:item->GetURL()]) {
         [self loadNativeContentForNavigationItem:item];
       } else if (isWebUIURL) {
@@ -4650,9 +4673,36 @@
         [self loadErrorInNativeViewForNavigationItem:item
                                    navigationContext:context];
       } else {
-        NOTREACHED();
+        // This is a back/forward navigation to a native error page.
+        DCHECK_EQ(web::ErrorRetryState::kDisplayingErrorForFailedNavigation,
+                  errorRetryState);
       }
     }
+
+    // Handle state transitions for retrying a previously failed navigation.
+    switch (errorRetryState) {
+      case web::ErrorRetryState::kDisplayingErrorForFailedNavigation:
+        DCHECK(context->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK);
+        if (item->GetURL() == webViewURL) {
+          // Shortcut: if WebView already has the original URL (can happen when
+          // WebKit renders page from cache after after repeated back/forward
+          // navigations), skip kNavigatingToFailedNavigationItem state and just
+          // reload the page.
+          [self handleRetryFailedNavigationItem:item];
+        } else {
+          [self handleNavigationToFailedNavigationItem:item];
+        }
+        break;
+      case web::ErrorRetryState::kNavigatingToFailedNavigationItem:
+        [self handleRetryFailedNavigationItem:item];
+        break;
+      case web::ErrorRetryState::kRetryFailedNavigationItem:
+        item->SetErrorRetryState(web::ErrorRetryState::kNoNavigationError);
+        break;
+      case web::ErrorRetryState::kNoNavigationError:
+      case web::ErrorRetryState::kReadyToDisplayErrorForFailedNavigation:
+        break;
+    }
   }
 
   bool navigationCommitted =
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java b/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java
index f6d69d7..5ec5b1f 100644
--- a/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java
+++ b/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java
@@ -74,7 +74,7 @@
                         spsData.append(Integer.toHexString(mConfigData.get(i) & 0xff)).append(" ");
                     }
                     Log.i(TAG, "spsData: %s", spsData.toString());
-                    mConfigData.rewind();
+
                     // Release buffer back.
                     mMediaCodec.releaseOutputBuffer(indexOrStatus, false);
                     // Query next output.
@@ -98,6 +98,7 @@
                             mConfigData.capacity(), info.size);
                     // For encoded key frame append SPS and PPS NALs at the start.
                     frameBuffer = ByteBuffer.allocateDirect(mConfigData.capacity() + info.size);
+                    mConfigData.rewind();
                     frameBuffer.put(mConfigData);
                     frameBuffer.put(codecOutputBuffer);
                     frameBuffer.rewind();
diff --git a/media/base/android/media_codec_bridge_impl_unittest.cc b/media/base/android/media_codec_bridge_impl_unittest.cc
index afc3397..33b8097 100644
--- a/media/base/android/media_codec_bridge_impl_unittest.cc
+++ b/media/base/android/media_codec_bridge_impl_unittest.cc
@@ -170,14 +170,14 @@
 }
 
 // Performs basic, codec-specific sanity checks on the encoded H264 frame:
-// whether we've seen keyframes before non-keyframes, correct sequences of H.264
-// NALUs (SPS before PPS and before slices), etc.
+// - as to key frames, correct sequences of H.264 NALUs (SPS before PPS and
+//   before slices).
+// - as to non key frames, contain no SPS/PPS infront.
 void H264Validate(const uint8_t* frame, size_t size) {
   H264Parser h264_parser;
   h264_parser.SetStream(frame, static_cast<off_t>(size));
-  bool seen_sps;
-  bool seen_pps;
-  bool seen_idr;
+  bool seen_sps = false;
+  bool seen_pps = false;
 
   while (1) {
     H264NALU nalu;
@@ -186,21 +186,18 @@
     result = h264_parser.AdvanceToNextNALU(&nalu);
     if (result == H264Parser::kEOStream)
       break;
-
     ASSERT_THAT(result, H264Parser::kOk);
 
-    bool keyframe = false;
-
     switch (nalu.nal_unit_type) {
-      case H264NALU::kIDRSlice:
+      case H264NALU::kIDRSlice: {
         ASSERT_TRUE(seen_sps);
         ASSERT_TRUE(seen_pps);
-        seen_idr = true;
-        keyframe = true;
-      // fallthrough
+        break;
+      }
+
       case H264NALU::kNonIDRSlice: {
-        ASSERT_TRUE(seen_idr);
-        seen_sps = seen_pps = false;
+        ASSERT_FALSE(seen_sps);
+        ASSERT_FALSE(seen_pps);
         break;
       }
 
@@ -484,6 +481,20 @@
     EncodeMediaFrame(media_codec.get(), frame_data.get(), frame_size, width,
                      height, input_timestamp);
   }
+
+  // Reuest key frame and encode 3 more frames. The second key frame should
+  // also contain SPS/PPS NALUs.
+  media_codec->RequestKeyFrameSoon();
+  for (int frame = 0; frame < num_frames && frame < 3; frame++) {
+    ASSERT_THAT(src.Read(src_offset, (char*)frame_data.get(), frame_size),
+                frame_size);
+    src_offset += static_cast<off_t>(frame_size);
+
+    input_timestamp += base::TimeDelta::FromMicroseconds(
+        base::Time::kMicrosecondsPerSecond / frame_rate);
+    EncodeMediaFrame(media_codec.get(), frame_data.get(), frame_size, width,
+                     height, input_timestamp);
+  }
 }
 
 }  // namespace media
diff --git a/media/cast/BUILD.gn b/media/cast/BUILD.gn
index d693f14..e4af00f 100644
--- a/media/cast/BUILD.gn
+++ b/media/cast/BUILD.gn
@@ -104,14 +104,16 @@
     "net/rtp/rtp_sender.h",
     "net/udp_packet_pipe.cc",
     "net/udp_packet_pipe.h",
-    "net/udp_transport.cc",
-    "net/udp_transport.h",
+    "net/udp_transport_impl.cc",
+    "net/udp_transport_impl.h",
+    "net/udp_transport_interface.h",
   ]
 
   deps = [
     ":common",
     "//base",
     "//media/mojo/common",
+    "//mojo/public/cpp/system",
     "//net",
   ]
 
diff --git a/media/cast/net/DEPS b/media/cast/net/DEPS
index 4da296c0..a8017ed5 100644
--- a/media/cast/net/DEPS
+++ b/media/cast/net/DEPS
@@ -7,6 +7,7 @@
   "+media/cast/logging",
   "+media/cast/net",
   "+media/mojo/common",
+  "+mojo/public/cpp/system",
   "+net",
 ]
 
diff --git a/media/cast/net/cast_transport_impl.h b/media/cast/net/cast_transport_impl.h
index 98462fa..28f1a47 100644
--- a/media/cast/net/cast_transport_impl.h
+++ b/media/cast/net/cast_transport_impl.h
@@ -51,8 +51,6 @@
 namespace media {
 namespace cast {
 
-class UdpTransport;
-
 class CastTransportImpl final : public CastTransport {
  public:
   CastTransportImpl(
diff --git a/media/cast/net/udp_transport.cc b/media/cast/net/udp_transport_impl.cc
similarity index 76%
rename from media/cast/net/udp_transport.cc
rename to media/cast/net/udp_transport_impl.cc
index db98cbd..4d2587a 100644
--- a/media/cast/net/udp_transport.cc
+++ b/media/cast/net/udp_transport_impl.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/cast/net/udp_transport.h"
+#include "media/cast/net/udp_transport_impl.h"
 
 #include <algorithm>
 #include <string>
@@ -13,6 +13,7 @@
 #include "base/message_loop/message_loop.h"
 #include "base/rand_util.h"
 #include "build/build_config.h"
+#include "media/cast/net/udp_packet_pipe.h"
 #include "net/base/io_buffer.h"
 #include "net/base/net_errors.h"
 #include "net/base/rand_callback.h"
@@ -60,7 +61,7 @@
 
 }  // namespace
 
-UdpTransport::UdpTransport(
+UdpTransportImpl::UdpTransportImpl(
     net::NetLog* net_log,
     const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_proxy,
     const net::IPEndPoint& local_end_point,
@@ -85,9 +86,9 @@
   DCHECK(!IsEmpty(local_end_point) || !IsEmpty(remote_end_point));
 }
 
-UdpTransport::~UdpTransport() = default;
+UdpTransportImpl::~UdpTransportImpl() = default;
 
-void UdpTransport::StartReceiving(
+void UdpTransportImpl::StartReceiving(
     const PacketReceiverCallbackWithStatus& packet_receiver) {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
 
@@ -129,19 +130,33 @@
   ScheduleReceiveNextPacket();
 }
 
-void UdpTransport::StopReceiving() {
-  DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
-  packet_receiver_ = PacketReceiverCallbackWithStatus();
+void UdpTransportImpl::StartReceiving(UdpTransportReceiver* receiver) {
+  DCHECK(packet_receiver_.is_null());
+
+  mojo_packet_receiver_ = receiver;
+  StartReceiving(base::BindRepeating(&UdpTransportImpl::OnPacketReceived,
+                                     base::Unretained(this)));
 }
 
+bool UdpTransportImpl::OnPacketReceived(std::unique_ptr<Packet> packet) {
+  if (mojo_packet_receiver_)
+    mojo_packet_receiver_->OnPacketReceived(*packet);
+  return true;
+}
 
-void UdpTransport::SetDscp(net::DiffServCodePoint dscp) {
+void UdpTransportImpl::StopReceiving() {
+  DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
+  packet_receiver_ = PacketReceiverCallbackWithStatus();
+  mojo_packet_receiver_ = nullptr;
+}
+
+void UdpTransportImpl::SetDscp(net::DiffServCodePoint dscp) {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
   next_dscp_value_ = dscp;
 }
 
 #if defined(OS_WIN)
-void UdpTransport::UseNonBlockingIO() {
+void UdpTransportImpl::UseNonBlockingIO() {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
   if (!udp_socket_)
     return;
@@ -149,18 +164,18 @@
 }
 #endif
 
-void UdpTransport::ScheduleReceiveNextPacket() {
+void UdpTransportImpl::ScheduleReceiveNextPacket() {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
   if (!packet_receiver_.is_null() && !receive_pending_) {
     receive_pending_ = true;
-    io_thread_proxy_->PostTask(FROM_HERE,
-                               base::Bind(&UdpTransport::ReceiveNextPacket,
-                                          weak_factory_.GetWeakPtr(),
-                                          net::ERR_IO_PENDING));
+    io_thread_proxy_->PostTask(
+        FROM_HERE,
+        base::BindOnce(&UdpTransportImpl::ReceiveNextPacket,
+                       weak_factory_.GetWeakPtr(), net::ERR_IO_PENDING));
   }
 }
 
-void UdpTransport::ReceiveNextPacket(int length_or_status) {
+void UdpTransportImpl::ReceiveNextPacket(int length_or_status) {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
 
   if (packet_receiver_.is_null())
@@ -178,8 +193,8 @@
           reinterpret_cast<char*>(&next_packet_->front()));
       length_or_status = udp_socket_->RecvFrom(
           recv_buf_.get(), media::cast::kMaxIpPacketSize, &recv_addr_,
-          base::Bind(&UdpTransport::ReceiveNextPacket,
-                     weak_factory_.GetWeakPtr()));
+          base::BindRepeating(&UdpTransportImpl::ReceiveNextPacket,
+                              weak_factory_.GetWeakPtr()));
       if (length_or_status == net::ERR_IO_PENDING) {
         receive_pending_ = true;
         return;
@@ -219,7 +234,8 @@
   }
 }
 
-bool UdpTransport::SendPacket(PacketRef packet, const base::Closure& cb) {
+bool UdpTransportImpl::SendPacket(PacketRef packet,
+                                  const base::RepeatingClosure& cb) {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
   if (!udp_socket_)
     return true;
@@ -250,11 +266,8 @@
       new net::WrappedIOBuffer(reinterpret_cast<char*>(&packet->data.front()));
 
   int result;
-  base::Callback<void(int)> callback = base::Bind(&UdpTransport::OnSent,
-                                                  weak_factory_.GetWeakPtr(),
-                                                  buf,
-                                                  packet,
-                                                  cb);
+  base::RepeatingCallback<void(int)> callback = base::BindRepeating(
+      &UdpTransportImpl::OnSent, weak_factory_.GetWeakPtr(), buf, packet, cb);
   if (client_connected_) {
     // If we called Connect() before we must call Write() instead of
     // SendTo(). Otherwise on some platforms we might get
@@ -304,18 +317,18 @@
     send_pending_ = true;
     return false;
   }
-  OnSent(buf, packet, base::Closure(), result);
+  OnSent(buf, packet, base::RepeatingClosure(), result);
   return true;
 }
 
-int64_t UdpTransport::GetBytesSent() {
+int64_t UdpTransportImpl::GetBytesSent() {
   return bytes_sent_;
 }
 
-void UdpTransport::OnSent(const scoped_refptr<net::IOBuffer>& buf,
-                          PacketRef packet,
-                          const base::Closure& cb,
-                          int result) {
+void UdpTransportImpl::OnSent(const scoped_refptr<net::IOBuffer>& buf,
+                              PacketRef packet,
+                              const base::RepeatingClosure& cb,
+                              int result) {
   DCHECK(io_thread_proxy_->RunsTasksInCurrentSequence());
 
   send_pending_ = false;
@@ -329,7 +342,7 @@
   }
 }
 
-void UdpTransport::SetUdpOptions(const base::DictionaryValue& options) {
+void UdpTransportImpl::SetUdpOptions(const base::DictionaryValue& options) {
   SetSendBufferSize(GetTransportSendBufferSize(options));
   if (options.HasKey(kOptionDscp)) {
     // The default DSCP value for cast is AF41. Which gives it a higher
@@ -343,9 +356,38 @@
 #endif
 }
 
-void UdpTransport::SetSendBufferSize(int32_t send_buffer_size) {
+void UdpTransportImpl::SetSendBufferSize(int32_t send_buffer_size) {
   send_buffer_size_ = send_buffer_size;
 }
 
+void UdpTransportImpl::StartSending(
+    mojo::ScopedDataPipeConsumerHandle packet_pipe) {
+  DCHECK(packet_pipe.is_valid());
+
+  reader_.reset(new UdpPacketPipeReader(std::move(packet_pipe)));
+  ReadNextPacketToSend();
+}
+
+void UdpTransportImpl::ReadNextPacketToSend() {
+  reader_->Read(base::BindOnce(&UdpTransportImpl::OnPacketReadFromDataPipe,
+                               base::Unretained(this)));
+}
+
+void UdpTransportImpl::OnPacketReadFromDataPipe(
+    std::unique_ptr<Packet> packet) {
+  DVLOG(3) << __func__;
+  // TODO(https://crbug.com/530834): Avoid making copy of the |packet|.
+  if (!SendPacket(
+          base::WrapRefCounted(new base::RefCountedData<Packet>(*packet)),
+          base::BindRepeating(&UdpTransportImpl::ReadNextPacketToSend,
+                              base::Unretained(this)))) {
+    return;  // Waiting for the packet to be sent out.
+  }
+  // Force a post task to prevent the stack from growing too deep.
+  base::SequencedTaskRunnerHandle::Get()->PostTask(
+      FROM_HERE, base::BindOnce(&UdpTransportImpl::ReadNextPacketToSend,
+                                base::Unretained(this)));
+}
+
 }  // namespace cast
 }  // namespace media
diff --git a/media/cast/net/udp_transport.h b/media/cast/net/udp_transport_impl.h
similarity index 73%
rename from media/cast/net/udp_transport.h
rename to media/cast/net/udp_transport_impl.h
index eceb349..e5d3374f 100644
--- a/media/cast/net/udp_transport.h
+++ b/media/cast/net/udp_transport_impl.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef MEDIA_CAST_NET_UDP_TRANSPORT_H_
-#define MEDIA_CAST_NET_UDP_TRANSPORT_H_
+#ifndef MEDIA_CAST_NET_UDP_TRANSPORT_IMPL_H_
+#define MEDIA_CAST_NET_UDP_TRANSPORT_IMPL_H_
 
 #include <stdint.h>
 
@@ -18,6 +18,7 @@
 #include "media/cast/net/cast_transport.h"
 #include "media/cast/net/cast_transport_config.h"
 #include "media/cast/net/pacing/paced_sender.h"
+#include "media/cast/net/udp_transport_interface.h"
 #include "net/base/io_buffer.h"
 #include "net/base/ip_endpoint.h"
 #include "net/socket/diff_serv_code_point.h"
@@ -30,8 +31,10 @@
 namespace media {
 namespace cast {
 
+class UdpPacketPipeReader;
+
 // This class implements UDP transport mechanism for Cast.
-class UdpTransport : public PacketTransport {
+class UdpTransportImpl final : public PacketTransport, public UdpTransport {
  public:
   // Construct a UDP transport.
   // All methods must be called on |io_thread_proxy|.
@@ -42,19 +45,26 @@
   // to. If the value is 0.0.0.0:0 the the end point is set to the source
   // address of the first packet received.
   // |send_buffer_size| specifies the size of the socket send buffer.
-  UdpTransport(
+  UdpTransportImpl(
       net::NetLog* net_log,
       const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_proxy,
       const net::IPEndPoint& local_end_point,
       const net::IPEndPoint& remote_end_point,
       const CastTransportStatusCallback& status_callback);
-  ~UdpTransport() final;
+  ~UdpTransportImpl() final;
 
+  // PacketTransport implementations.
+  bool SendPacket(PacketRef packet, const base::RepeatingClosure& cb) final;
+  int64_t GetBytesSent() final;
   // Start receiving packets. Packets are submitted to |packet_receiver|.
   void StartReceiving(
       const PacketReceiverCallbackWithStatus& packet_receiver) final;
   void StopReceiving() final;
 
+  // UdpTransport implementations.
+  void StartReceiving(UdpTransportReceiver* receiver) final;
+  void StartSending(mojo::ScopedDataPipeConsumerHandle packet_pipe) final;
+
   // Set a new DSCP value to the socket. The value will be set right before
   // the next send.
   void SetDscp(net::DiffServCodePoint dscp);
@@ -81,10 +91,6 @@
   void UseNonBlockingIO();
 #endif
 
-  // PacketTransport implementations.
-  bool SendPacket(PacketRef packet, const base::Closure& cb) final;
-  int64_t GetBytesSent() final;
-
  private:
   // Requests and processes packets from |udp_socket_|.  This method is called
   // once with |length_or_status| set to net::ERR_IO_PENDING to start receiving
@@ -97,9 +103,20 @@
 
   void OnSent(const scoped_refptr<net::IOBuffer>& buf,
               PacketRef packet,
-              const base::Closure& cb,
+              const base::RepeatingClosure& cb,
               int result);
 
+  // Called by |reader_| when it completes reading a packet from the data pipe.
+  void OnPacketReadFromDataPipe(std::unique_ptr<Packet> packet);
+
+  // Called when receiving packets from |udp_socket_|. Will pass the packet to
+  // |mojo_packet_receiver_| if provided.
+  bool OnPacketReceived(std::unique_ptr<Packet> packet);
+
+  // Reads the next packet from the data pipe. The reading is sync if the packet
+  // is already avilable in the pipe, and async otherwise.
+  void ReadNextPacketToSend();
+
   const scoped_refptr<base::SingleThreadTaskRunner> io_thread_proxy_;
   const net::IPEndPoint local_addr_;
   net::IPEndPoint remote_addr_;
@@ -116,13 +133,20 @@
   const CastTransportStatusCallback status_callback_;
   int bytes_sent_;
 
-  // NOTE: Weak pointers must be invalidated before all other member variables.
-  base::WeakPtrFactory<UdpTransport> weak_factory_;
+  // TODO(xjz): Replace this with a mojo ptr.
+  UdpTransportReceiver* mojo_packet_receiver_ = nullptr;
 
-  DISALLOW_COPY_AND_ASSIGN(UdpTransport);
+  // Used to read packets from the data pipe. Created when StartSending() is
+  // called.
+  std::unique_ptr<UdpPacketPipeReader> reader_;
+
+  // NOTE: Weak pointers must be invalidated before all other member variables.
+  base::WeakPtrFactory<UdpTransportImpl> weak_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(UdpTransportImpl);
 };
 
 }  // namespace cast
 }  // namespace media
 
-#endif  // MEDIA_CAST_NET_UDP_TRANSPORT_H_
+#endif  // MEDIA_CAST_NET_UDP_TRANSPORT_IMPL_H_
diff --git a/media/cast/net/udp_transport_interface.h b/media/cast/net/udp_transport_interface.h
new file mode 100644
index 0000000..308be48
--- /dev/null
+++ b/media/cast/net/udp_transport_interface.h
@@ -0,0 +1,45 @@
+// 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 MEDIA_CAST_NET_UDP_TRANSPORT_INTERFACE_H_
+#define MEDIA_CAST_NET_UDP_TRANSPORT_INTERFACE_H_
+
+#include "mojo/public/cpp/system/data_pipe.h"
+
+namespace media {
+namespace cast {
+
+// TODO(xjz): Define these interfaces in the mojom file.
+
+// This class receives packets from the UdpTransportHost.
+class UdpTransportReceiver {
+ public:
+  virtual ~UdpTransportReceiver() {}
+  // Called when a UDP packet is received.
+  virtual void OnPacketReceived(const std::vector<uint8_t>& packet) = 0;
+};
+
+// When requested to start receiving packets, this class receives UDP packets
+// and passes them to the UdpTransportReceiver.
+// When requested to start sending packets, this class reads UDP packets from
+// the mojo data pipe and sends them over network.
+class UdpTransport {
+ public:
+  virtual ~UdpTransport() {}
+  // Called to start/stop receiving UDP packets. The received UDP packets will
+  // be passed to the |receiver|.
+  // TODO(xjz): Use a data pipe for received packets if this interface starts
+  // being used by cast receiver in future. For now, this is only used by cast
+  // sender, which only receives small-sized RTCP packets.
+  virtual void StartReceiving(UdpTransportReceiver* receiver) = 0;
+  virtual void StopReceiving() = 0;
+  // Called to start sending the UDP packets that received through the mojo data
+  // pipe.
+  virtual void StartSending(mojo::ScopedDataPipeConsumerHandle packet_pipe) = 0;
+};
+
+}  // namespace cast
+}  // namespace media
+
+#endif  // MEDIA_CAST_NET_UDP_TRANSPORT_INTERFACE_H_
diff --git a/media/cast/net/udp_transport_unittest.cc b/media/cast/net/udp_transport_unittest.cc
index 0d895d34..618a1d9a 100644
--- a/media/cast/net/udp_transport_unittest.cc
+++ b/media/cast/net/udp_transport_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "media/cast/net/udp_transport.h"
+#include "media/cast/net/udp_transport_impl.h"
 
 #include <algorithm>
 #include <string>
@@ -11,9 +11,11 @@
 #include "base/bind.h"
 #include "base/callback.h"
 #include "base/macros.h"
-#include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
+#include "base/test/mock_callback.h"
+#include "base/test/scoped_task_environment.h"
 #include "media/cast/net/cast_transport_config.h"
+#include "media/cast/net/udp_packet_pipe.h"
 #include "media/cast/test/utility/net_utility.h"
 #include "net/base/ip_address.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -21,32 +23,41 @@
 namespace media {
 namespace cast {
 
-class MockPacketReceiver {
+namespace {
+
+class MockPacketReceiver final : public UdpTransportReceiver {
  public:
-  MockPacketReceiver(const base::Closure& callback)
+  MockPacketReceiver(const base::RepeatingClosure& callback)
       : packet_callback_(callback) {}
 
   bool ReceivedPacket(std::unique_ptr<Packet> packet) {
-    packet_ = std::string(packet->size(), '\0');
-    std::copy(packet->begin(), packet->end(), packet_.begin());
+    packet_ = std::move(packet);
     packet_callback_.Run();
     return true;
   }
 
-  std::string packet() const { return packet_; }
-  PacketReceiverCallbackWithStatus packet_receiver() {
-    return base::Bind(&MockPacketReceiver::ReceivedPacket,
-                      base::Unretained(this));
+  // UdpTransportReceiver implementation.
+  void OnPacketReceived(const std::vector<uint8_t>& packet) override {
+    EXPECT_GT(packet.size(), 0u);
+    packet_.reset(new Packet(packet));
+    packet_callback_.Run();
   }
 
+  PacketReceiverCallbackWithStatus packet_receiver() {
+    return base::BindRepeating(&MockPacketReceiver::ReceivedPacket,
+                               base::Unretained(this));
+  }
+
+  std::unique_ptr<Packet> TakePacket() { return std::move(packet_); }
+
  private:
-  std::string packet_;
-  base::Closure packet_callback_;
+  base::RepeatingClosure packet_callback_;
+  std::unique_ptr<Packet> packet_;
 
   DISALLOW_COPY_AND_ASSIGN(MockPacketReceiver);
 };
 
-void SendPacket(UdpTransport* transport, Packet packet) {
+void SendPacket(UdpTransportImpl* transport, Packet packet) {
   base::Closure cb;
   transport->SendPacket(new base::RefCountedData<Packet>(packet), cb);
 }
@@ -55,44 +66,99 @@
   NOTREACHED();
 }
 
-TEST(UdpTransport, SendAndReceive) {
-  base::MessageLoopForIO message_loop;
+}  // namespace
 
-  net::IPEndPoint free_local_port1 = test::GetFreeLocalPort();
-  net::IPEndPoint free_local_port2 = test::GetFreeLocalPort();
+class UdpTransportImplTest : public ::testing::Test {
+ public:
+  UdpTransportImplTest()
+      : scoped_task_environment_(
+            base::test::ScopedTaskEnvironment::MainThreadType::IO) {
+    net::IPEndPoint free_local_port1 = test::GetFreeLocalPort();
+    net::IPEndPoint free_local_port2 = test::GetFreeLocalPort();
 
-  UdpTransport send_transport(NULL,
-                              message_loop.task_runner(),
-                              free_local_port1,
-                              free_local_port2,
-                              base::Bind(&UpdateCastTransportStatus));
-  send_transport.SetSendBufferSize(65536);
-  UdpTransport recv_transport(
-      NULL, message_loop.task_runner(), free_local_port2,
-      net::IPEndPoint(net::IPAddress::IPv4AllZeros(), 0),
-      base::Bind(&UpdateCastTransportStatus));
-  recv_transport.SetSendBufferSize(65536);
+    send_transport_ = std::make_unique<UdpTransportImpl>(
+        nullptr, scoped_task_environment_.GetMainThreadTaskRunner(),
+        free_local_port1, free_local_port2,
+        base::BindRepeating(&UpdateCastTransportStatus));
+    send_transport_->SetSendBufferSize(65536);
 
-  Packet packet;
-  packet.push_back('t');
-  packet.push_back('e');
-  packet.push_back('s');
-  packet.push_back('t');
+    recv_transport_ = std::make_unique<UdpTransportImpl>(
+        nullptr, scoped_task_environment_.GetMainThreadTaskRunner(),
+        free_local_port2, free_local_port1,
+        base::BindRepeating(&UpdateCastTransportStatus));
+    recv_transport_->SetSendBufferSize(65536);
+  }
+
+  ~UdpTransportImplTest() override = default;
+
+ protected:
+  base::test::ScopedTaskEnvironment scoped_task_environment_;
+
+  std::unique_ptr<UdpTransportImpl> send_transport_;
+
+  // A receiver side transport to receiver/send packets from/to sender.
+  std::unique_ptr<UdpTransportImpl> recv_transport_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(UdpTransportImplTest);
+};
+
+// Test the sending/receiving functions as a PacketSender.
+TEST_F(UdpTransportImplTest, PacketSenderSendAndReceive) {
+  std::string data = "Test";
+  Packet packet(data.begin(), data.end());
 
   base::RunLoop run_loop;
-  MockPacketReceiver receiver1(run_loop.QuitClosure());
-  MockPacketReceiver receiver2(
-      base::Bind(&SendPacket, &recv_transport, packet));
-  send_transport.StartReceiving(receiver1.packet_receiver());
-  recv_transport.StartReceiving(receiver2.packet_receiver());
+  MockPacketReceiver packet_receiver_on_sender(run_loop.QuitClosure());
+  MockPacketReceiver packet_receiver_on_receiver(
+      base::BindRepeating(&SendPacket, recv_transport_.get(), packet));
+  send_transport_->StartReceiving(packet_receiver_on_sender.packet_receiver());
+  recv_transport_->StartReceiving(
+      packet_receiver_on_receiver.packet_receiver());
 
   base::Closure cb;
-  send_transport.SendPacket(new base::RefCountedData<Packet>(packet), cb);
+  SendPacket(send_transport_.get(), packet);
   run_loop.Run();
+  std::unique_ptr<Packet> received_packet =
+      packet_receiver_on_sender.TakePacket();
+  EXPECT_TRUE(received_packet);
   EXPECT_TRUE(
-      std::equal(packet.begin(), packet.end(), receiver1.packet().begin()));
+      std::equal(packet.begin(), packet.end(), received_packet->begin()));
+  received_packet = packet_receiver_on_receiver.TakePacket();
+  EXPECT_TRUE(received_packet);
   EXPECT_TRUE(
-      std::equal(packet.begin(), packet.end(), receiver2.packet().begin()));
+      std::equal(packet.begin(), packet.end(), (*received_packet).begin()));
+}
+
+// Test the sending/receiving functions as a UdpTransport.
+TEST_F(UdpTransportImplTest, UdpTransportSendAndReceive) {
+  std::string data = "Hello!";
+  Packet packet(data.begin(), data.end());
+
+  base::RunLoop run_loop;
+  MockPacketReceiver packet_receiver_on_sender(run_loop.QuitClosure());
+  MockPacketReceiver packet_receiver_on_receiver(
+      base::BindRepeating(&SendPacket, recv_transport_.get(), packet));
+  send_transport_->StartReceiving(&packet_receiver_on_sender);
+  recv_transport_->StartReceiving(
+      packet_receiver_on_receiver.packet_receiver());
+
+  mojo::DataPipe data_pipe(5);
+  send_transport_->StartSending(std::move(data_pipe.consumer_handle));
+  UdpPacketPipeWriter writer(std::move(data_pipe.producer_handle));
+  base::MockCallback<base::OnceClosure> done_callback;
+  EXPECT_CALL(done_callback, Run()).Times(1);
+  writer.Write(new base::RefCountedData<Packet>(packet), done_callback.Get());
+  run_loop.Run();
+  std::unique_ptr<Packet> received_packet =
+      packet_receiver_on_sender.TakePacket();
+  EXPECT_TRUE(received_packet);
+  EXPECT_TRUE(
+      std::equal(packet.begin(), packet.end(), received_packet->begin()));
+  received_packet = packet_receiver_on_receiver.TakePacket();
+  EXPECT_TRUE(received_packet);
+  EXPECT_TRUE(
+      std::equal(packet.begin(), packet.end(), (*received_packet).begin()));
 }
 
 }  // namespace cast
diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc
index 50305f2..f6f8c04 100644
--- a/media/cast/test/receiver.cc
+++ b/media/cast/test/receiver.cc
@@ -41,7 +41,6 @@
 #include "media/cast/cast_environment.h"
 #include "media/cast/cast_receiver.h"
 #include "media/cast/logging/logging_defines.h"
-#include "media/cast/net/udp_transport.h"
 #include "media/cast/test/utility/audio_utility.h"
 #include "media/cast/test/utility/barcode.h"
 #include "media/cast/test/utility/default_config.h"
diff --git a/media/cast/test/sender.cc b/media/cast/test/sender.cc
index 5e30057..1c6b064 100644
--- a/media/cast/test/sender.cc
+++ b/media/cast/test/sender.cc
@@ -37,7 +37,7 @@
 #include "media/cast/logging/stats_event_subscriber.h"
 #include "media/cast/net/cast_transport.h"
 #include "media/cast/net/cast_transport_defines.h"
-#include "media/cast/net/udp_transport.h"
+#include "media/cast/net/udp_transport_impl.h"
 #include "media/cast/test/fake_media_source.h"
 #include "media/cast/test/utility/default_config.h"
 #include "media/cast/test/utility/input_builder.h"
@@ -265,7 +265,7 @@
       media::cast::CastTransport::Create(
           cast_environment->Clock(), base::TimeDelta::FromSeconds(1),
           std::make_unique<TransportClient>(cast_environment->logger()),
-          std::make_unique<media::cast::UdpTransport>(
+          std::make_unique<media::cast::UdpTransportImpl>(
               nullptr, io_message_loop.task_runner(), net::IPEndPoint(),
               remote_endpoint, base::Bind(&UpdateCastTransportStatus)),
           io_message_loop.task_runner());
diff --git a/media/cast/test/utility/in_process_receiver.cc b/media/cast/test/utility/in_process_receiver.cc
index a78282f..1038b41 100644
--- a/media/cast/test/utility/in_process_receiver.cc
+++ b/media/cast/test/utility/in_process_receiver.cc
@@ -17,10 +17,10 @@
 #include "media/cast/cast_environment.h"
 #include "media/cast/cast_receiver.h"
 #include "media/cast/net/cast_transport_config.h"
-#include "media/cast/net/udp_transport.h"
+#include "media/cast/net/udp_transport_impl.h"
 
 using media::cast::CastTransportStatus;
-using media::cast::UdpTransport;
+using media::cast::UdpTransportImpl;
 
 namespace media {
 namespace cast {
@@ -99,7 +99,7 @@
   transport_ = CastTransport::Create(
       cast_environment_->Clock(), base::TimeDelta(),
       base::WrapUnique(new InProcessReceiver::TransportClient(this)),
-      std::make_unique<UdpTransport>(
+      std::make_unique<UdpTransportImpl>(
           nullptr, cast_environment_->GetTaskRunner(CastEnvironment::MAIN),
           local_end_point_, remote_end_point_,
           base::Bind(&InProcessReceiver::UpdateCastTransportStatus,
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.cc b/media/video/gpu_memory_buffer_video_frame_pool.cc
index 2955641d..b93154b5 100644
--- a/media/video/gpu_memory_buffer_video_frame_pool.cc
+++ b/media/video/gpu_memory_buffer_video_frame_pool.cc
@@ -208,6 +208,9 @@
     case GpuVideoAcceleratorFactories::OutputFormat::UYVY:
       DCHECK_EQ(0u, plane);
       return gfx::BufferFormat::UYVY_422;
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+      DCHECK_EQ(0u, plane);
+      return gfx::BufferFormat::BGRX_1010102;
     case GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED:
       NOTREACHED();
       break;
@@ -230,6 +233,11 @@
     case GpuVideoAcceleratorFactories::OutputFormat::UYVY:
       DCHECK_EQ(0u, plane);
       return GL_RGB_YCBCR_422_CHROMIUM;
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+      DCHECK_EQ(0u, plane);
+      // Technically speaking we should say GL_RGB10_EXT, but that format is not
+      // supported in OpenGLES.
+      return GL_RGB10_A2_EXT;
     case GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED:
       NOTREACHED();
       break;
@@ -246,6 +254,8 @@
     case GpuVideoAcceleratorFactories::OutputFormat::NV12_DUAL_GMB:
     case GpuVideoAcceleratorFactories::OutputFormat::NV12_SINGLE_GMB:
       return 2;
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+      return 3;
     case GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED:
       NOTREACHED();
       break;
@@ -263,6 +273,8 @@
       return PIXEL_FORMAT_NV12;
     case GpuVideoAcceleratorFactories::OutputFormat::UYVY:
       return PIXEL_FORMAT_UYVY;
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+      return PIXEL_FORMAT_ARGB;
     case GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED:
       NOTREACHED();
       break;
@@ -281,6 +293,8 @@
       return 2;
     case GpuVideoAcceleratorFactories::OutputFormat::UYVY:
       return 1;
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+      return 1;
     case GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED:
       NOTREACHED();
       break;
@@ -395,6 +409,66 @@
   done.Run();
 }
 
+void CopyRowsToXR30Buffer(int first_row,
+                          int rows,
+                          int width,
+                          const scoped_refptr<VideoFrame>& source_frame,
+                          uint8_t* output,
+                          int dest_stride,
+                          const base::Closure& done) {
+  TRACE_EVENT2("media", "CopyRowsToXR30Buffer", "bytes_per_row", width * 2,
+               "rows", rows);
+  if (output) {
+    DCHECK_NE(dest_stride, 0);
+    DCHECK_LE(width, std::abs(dest_stride / 2));
+    DCHECK_EQ(0, first_row % 2);
+
+    int color_space;
+    if (source_frame->metadata()->GetInteger(VideoFrameMetadata::COLOR_SPACE,
+                                             &color_space)) {
+      color_space = COLOR_SPACE_UNSPECIFIED;
+    }
+    const uint16_t* y_plane = reinterpret_cast<const uint16_t*>(
+        source_frame->visible_data(VideoFrame::kYPlane) +
+        first_row * source_frame->stride(VideoFrame::kYPlane));
+    const size_t y_plane_stride = source_frame->stride(VideoFrame::kYPlane) / 2;
+    const uint16_t* v_plane = reinterpret_cast<const uint16_t*>(
+        source_frame->visible_data(VideoFrame::kVPlane) +
+        first_row / 2 * source_frame->stride(VideoFrame::kVPlane));
+    const size_t v_plane_stride = source_frame->stride(VideoFrame::kVPlane) / 2;
+    const uint16_t* u_plane = reinterpret_cast<const uint16_t*>(
+        source_frame->visible_data(VideoFrame::kUPlane) +
+        first_row / 2 * source_frame->stride(VideoFrame::kUPlane));
+    const size_t u_plane_stride = source_frame->stride(VideoFrame::kUPlane) / 2;
+    uint8_t* dest_ar30 = output + first_row * dest_stride;
+
+    // RGB textures need RGB as MatrixID.
+    switch (color_space) {
+      case COLOR_SPACE_HD_REC709:
+        libyuv::H010ToAR30(y_plane, y_plane_stride, v_plane, v_plane_stride,
+                           u_plane, u_plane_stride, dest_ar30, dest_stride,
+                           width, rows);
+        source_frame->set_color_space(gfx::ColorSpace(
+            gfx::ColorSpace::PrimaryID::BT709,
+            gfx::ColorSpace::TransferID::BT709, gfx::ColorSpace::MatrixID::RGB,
+            gfx::ColorSpace::RangeID::LIMITED));
+        break;
+      case COLOR_SPACE_UNSPECIFIED:
+      case COLOR_SPACE_JPEG:
+      case COLOR_SPACE_SD_REC601:
+        libyuv::I010ToAR30(y_plane, y_plane_stride, v_plane, v_plane_stride,
+                           u_plane, u_plane_stride, dest_ar30, dest_stride,
+                           width, rows);
+        source_frame->set_color_space(gfx::ColorSpace(
+            gfx::ColorSpace::PrimaryID::SMPTE170M,
+            gfx::ColorSpace::TransferID::SMPTE170M,
+            gfx::ColorSpace::MatrixID::RGB, gfx::ColorSpace::RangeID::LIMITED));
+        break;
+    }
+  }
+  done.Run();
+}
+
 gfx::Size CodedSize(const scoped_refptr<VideoFrame>& video_frame,
                     GpuVideoAcceleratorFactories::OutputFormat output_format) {
   DCHECK(gfx::Rect(video_frame->coded_size())
@@ -410,6 +484,7 @@
                          (video_frame->visible_rect().height() + 1) & ~1);
       break;
     case GpuVideoAcceleratorFactories::OutputFormat::UYVY:
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
       output = gfx::Size((video_frame->visible_rect().width() + 1) & ~1,
                          video_frame->visible_rect().height());
       break;
@@ -642,6 +717,15 @@
                                     static_cast<uint8_t*>(buffer->memory(0)),
                                     buffer->stride(0), barrier));
           break;
+
+        case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+          worker_task_runner_->PostTask(
+              FROM_HERE, base::Bind(&CopyRowsToXR30Buffer, row, rows_to_copy,
+                                    coded_size.width(), video_frame,
+                                    static_cast<uint8_t*>(buffer->memory(0)),
+                                    buffer->stride(0), barrier));
+          break;
+
         case GpuVideoAcceleratorFactories::OutputFormat::UNDEFINED:
           NOTREACHED();
       }
@@ -734,6 +818,9 @@
       allow_overlay = true;
 #endif
       break;
+    case GpuVideoAcceleratorFactories::OutputFormat::XR30:
+      allow_overlay = true;
+      break;
     default:
       break;
   }
diff --git a/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc b/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc
index b62af9a..a973f823 100644
--- a/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc
+++ b/media/video/gpu_memory_buffer_video_frame_pool_unittest.cc
@@ -289,6 +289,24 @@
       media::VideoFrameMetadata::READ_LOCK_FENCES_ENABLED));
 }
 
+TEST_F(GpuMemoryBufferVideoFramePoolTest, CreateOneHardwareXR30Frame) {
+  scoped_refptr<VideoFrame> software_frame = CreateTestYUVVideoFrame(10, 10);
+  scoped_refptr<VideoFrame> frame;
+  mock_gpu_factories_->SetVideoFrameOutputFormat(
+      media::GpuVideoAcceleratorFactories::OutputFormat::XR30);
+  gpu_memory_buffer_pool_->MaybeCreateHardwareFrame(
+      software_frame, base::Bind(MaybeCreateHardwareFrameCallback, &frame));
+
+  RunUntilIdle();
+
+  EXPECT_NE(software_frame.get(), frame.get());
+  EXPECT_EQ(PIXEL_FORMAT_ARGB, frame->format());
+  EXPECT_EQ(1u, frame->NumTextures());
+  EXPECT_EQ(1u, gles2_->gen_textures_count());
+  EXPECT_TRUE(frame->metadata()->IsTrue(
+      media::VideoFrameMetadata::READ_LOCK_FENCES_ENABLED));
+}
+
 // CreateGpuMemoryBuffer can return null (e.g: when the GPU process is down).
 // This test checks that in that case we don't crash and still create the
 // textures.
diff --git a/media/video/gpu_video_accelerator_factories.h b/media/video/gpu_video_accelerator_factories.h
index 2f1678c..e1de25b 100644
--- a/media/video/gpu_video_accelerator_factories.h
+++ b/media/video/gpu_video_accelerator_factories.h
@@ -69,6 +69,7 @@
     UYVY,             // One 422 GMB
     NV12_SINGLE_GMB,  // One NV12 GMB
     NV12_DUAL_GMB,    // One R8, one RG88 GMB
+    XR30,             // 10:10:10:2 BGRX in one GMB
   };
 
   // Return whether GPU encoding/decoding is enabled.
diff --git a/media/video/mock_gpu_video_accelerator_factories.cc b/media/video/mock_gpu_video_accelerator_factories.cc
index 65ce444..51306fd 100644
--- a/media/video/mock_gpu_video_accelerator_factories.cc
+++ b/media/video/mock_gpu_video_accelerator_factories.cc
@@ -27,7 +27,8 @@
     DCHECK(gfx::BufferFormat::R_8 == format_ ||
            gfx::BufferFormat::RG_88 == format_ ||
            gfx::BufferFormat::YUV_420_BIPLANAR == format_ ||
-           gfx::BufferFormat::UYVY_422 == format_);
+           gfx::BufferFormat::UYVY_422 == format_ ||
+           gfx::BufferFormat::BGRX_1010102 == format_);
     DCHECK(num_planes_ <= kMaxPlanes);
     for (int i = 0; i < static_cast<int>(num_planes_); ++i) {
       bytes_[i].resize(gfx::RowSizeForBufferFormat(size_.width(), format_, i) *
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index f2b1e89b..5805797b 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -853,15 +853,6 @@
         Doom();
     }
     file_tracker_->Close(this, SubFileForFileIndex(i));
-    const int64_t file_size = entry_stat.GetFileSize(key_.size(), i);
-    SIMPLE_CACHE_UMA(CUSTOM_COUNTS,
-                     "LastClusterSize", cache_type_,
-                     file_size % 4096, 0, 4097, 50);
-    const int64_t cluster_loss = file_size % 4096 ? 4096 - file_size % 4096 : 0;
-    SIMPLE_CACHE_UMA(PERCENTAGE,
-                     "LastClusterLossPercent", cache_type_,
-                     static_cast<base::HistogramBase::Sample>(
-                         cluster_loss * 100 / (cluster_loss + file_size)));
   }
 
   if (sparse_file_open()) {
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index c547c56..f014daf 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -310,7 +310,8 @@
     // also don't worry about this for an HTTPS Proxy, because the
     // communication with the proxy is secure.
     // See http://crbug.com/8473.
-    DCHECK(proxy_info_.is_http() || proxy_info_.is_https());
+    DCHECK(proxy_info_.is_http() || proxy_info_.is_https() ||
+           proxy_info_.is_quic());
     DCHECK_EQ(headers->response_code(), HTTP_PROXY_AUTHENTICATION_REQUIRED);
     LOG(WARNING) << "Blocked proxy response with status "
                  << headers->response_code() << " to CONNECT request for "
diff --git a/net/http/http_proxy_client_socket_wrapper.cc b/net/http/http_proxy_client_socket_wrapper.cc
index e61f2ad5..f34f0f97 100644
--- a/net/http/http_proxy_client_socket_wrapper.cc
+++ b/net/http/http_proxy_client_socket_wrapper.cc
@@ -658,6 +658,7 @@
   next_state_ = STATE_HTTP_PROXY_CONNECT_COMPLETE;
   std::unique_ptr<QuicChromiumClientStream::Handle> quic_stream =
       quic_session_->ReleaseStream();
+
   transport_socket_.reset(new QuicProxyClientSocket(
       std::move(quic_stream), std::move(quic_session_), user_agent_, endpoint_,
       net_log_, http_auth_controller_.get()));
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 661fabc..3a12936 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -190,7 +190,8 @@
                  origin_url_.SchemeIs(url::kWssScheme)),
       using_quic_(
           alternative_protocol == kProtoQUIC ||
-          ShouldForceQuic(session, destination, origin_url, proxy_info)),
+          (ShouldForceQuic(session, destination, origin_url, proxy_info) &&
+           !(proxy_info.is_quic() && using_ssl_))),
       quic_version_(quic_version),
       expect_spdy_(alternative_protocol == kProtoHTTP2 && !using_quic_),
       using_spdy_(false),
@@ -868,12 +869,6 @@
   }
 
   if (using_quic_) {
-    if (proxy_info_.is_quic() &&
-        !request_info_.url.SchemeIs(url::kHttpScheme)) {
-      NOTREACHED();
-      // TODO(rch): support QUIC proxies for HTTPS urls.
-      return ERR_NOT_IMPLEMENTED;
-    }
     HostPortPair destination;
     SSLConfig* ssl_config;
     GURL url(request_info_.url);
@@ -941,7 +936,7 @@
     }
   }
 
-  if (proxy_info_.is_http() || proxy_info_.is_https())
+  if (proxy_info_.is_http() || proxy_info_.is_https() || proxy_info_.is_quic())
     establishing_tunnel_ = using_ssl_;
 
   HttpServerProperties* http_server_properties =
@@ -1170,7 +1165,7 @@
 }
 
 int HttpStreamFactoryImpl::Job::DoCreateStream() {
-  DCHECK(connection_->socket() || existing_spdy_session_.get() || using_quic_);
+  DCHECK(connection_->socket() || existing_spdy_session_.get());
   DCHECK(!using_quic_);
 
   next_state_ = STATE_CREATE_STREAM_COMPLETE;
@@ -1185,7 +1180,8 @@
   if (!using_spdy_) {
     DCHECK(!expect_spdy_);
     // We may get ftp scheme when fetching ftp resources through proxy.
-    bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) &&
+    bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https() ||
+                        proxy_info_.is_quic()) &&
                        (request_info_.url.SchemeIs(url::kHttpScheme) ||
                         request_info_.url.SchemeIs(url::kFtpScheme));
     if (is_websocket_) {
diff --git a/net/quic/chromium/quic_network_transaction_unittest.cc b/net/quic/chromium/quic_network_transaction_unittest.cc
index 789bef15..cf42d5c 100644
--- a/net/quic/chromium/quic_network_transaction_unittest.cc
+++ b/net/quic/chromium/quic_network_transaction_unittest.cc
@@ -63,6 +63,7 @@
 #include "net/socket/socket_performance_watcher.h"
 #include "net/socket/socket_performance_watcher_factory.h"
 #include "net/socket/socket_test_util.h"
+#include "net/spdy/chromium/spdy_test_util_common.h"
 #include "net/spdy/core/spdy_frame_builder.h"
 #include "net/spdy/core/spdy_framer.h"
 #include "net/ssl/ssl_config_service_defaults.h"
@@ -350,6 +351,15 @@
         least_unacked, true);
   }
 
+  std::unique_ptr<QuicEncryptedPacket> ConstructClientRstPacket(
+      QuicPacketNumber num,
+      QuicStreamId stream_id,
+      QuicRstStreamErrorCode error_code,
+      size_t bytes_written) {
+    return client_maker_.MakeRstPacket(num, false, stream_id, error_code,
+                                       bytes_written);
+  }
+
   std::unique_ptr<QuicEncryptedPacket>
   ConstructClientAckAndConnectionClosePacket(QuicPacketNumber packet_number,
                                              QuicPacketNumber largest_received,
@@ -412,6 +422,10 @@
     return maker->GetRequestHeaders(method, scheme, path);
   }
 
+  SpdyHeaderBlock ConnectRequestHeaders(const std::string& host_port) {
+    return client_maker_.ConnectRequestHeaders(host_port);
+  }
+
   SpdyHeaderBlock GetResponseHeaders(const std::string& status) {
     return server_maker_.GetResponseHeaders(status);
   }
@@ -444,6 +458,21 @@
         packet_number, stream_id, should_include_version, fin, offset, data);
   }
 
+  std::unique_ptr<QuicEncryptedPacket> ConstructClientAckAndDataPacket(
+      QuicPacketNumber packet_number,
+      bool include_version,
+      QuicStreamId stream_id,
+      QuicPacketNumber largest_received,
+      QuicPacketNumber smallest_received,
+      QuicPacketNumber least_unacked,
+      bool fin,
+      QuicStreamOffset offset,
+      QuicStringPiece data) {
+    return client_maker_.MakeAckAndDataPacket(
+        packet_number, include_version, stream_id, largest_received,
+        smallest_received, least_unacked, fin, offset, data);
+  }
+
   std::unique_ptr<QuicEncryptedPacket> ConstructClientForceHolDataPacket(
       QuicPacketNumber packet_number,
       QuicStreamId stream_id,
@@ -460,6 +489,17 @@
       QuicStreamId stream_id,
       bool should_include_version,
       bool fin,
+      SpdyHeaderBlock headers) {
+    return ConstructClientRequestHeadersPacket(packet_number, stream_id,
+                                               should_include_version, fin,
+                                               std::move(headers), nullptr);
+  }
+
+  std::unique_ptr<QuicEncryptedPacket> ConstructClientRequestHeadersPacket(
+      QuicPacketNumber packet_number,
+      QuicStreamId stream_id,
+      bool should_include_version,
+      bool fin,
       SpdyHeaderBlock headers,
       QuicStreamOffset* offset) {
     return ConstructClientRequestHeadersPacket(packet_number, stream_id,
@@ -475,10 +515,8 @@
       SpdyHeaderBlock headers,
       QuicStreamId parent_stream_id,
       QuicStreamOffset* offset) {
-    SpdyPriority priority =
-        ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
-    return client_maker_.MakeRequestHeadersPacketWithOffsetTracking(
-        packet_number, stream_id, should_include_version, fin, priority,
+    return ConstructClientRequestHeadersPacket(
+        packet_number, stream_id, should_include_version, fin, DEFAULT_PRIORITY,
         std::move(headers), parent_stream_id, offset);
   }
 
@@ -487,10 +525,15 @@
       QuicStreamId stream_id,
       bool should_include_version,
       bool fin,
-      SpdyHeaderBlock headers) {
-    return ConstructClientRequestHeadersPacket(packet_number, stream_id,
-                                               should_include_version, fin,
-                                               std::move(headers), nullptr);
+      RequestPriority request_priority,
+      SpdyHeaderBlock headers,
+      QuicStreamId parent_stream_id,
+      QuicStreamOffset* offset) {
+    SpdyPriority priority =
+        ConvertRequestPriorityToQuicPriority(request_priority);
+    return client_maker_.MakeRequestHeadersPacketWithOffsetTracking(
+        packet_number, stream_id, should_include_version, fin, priority,
+        std::move(headers), parent_stream_id, offset);
   }
 
   std::unique_ptr<QuicEncryptedPacket> ConstructClientMultipleDataFramesPacket(
@@ -567,6 +610,8 @@
 
     session_.reset(new HttpNetworkSession(session_params_, session_context_));
     session_->quic_stream_factory()->set_require_confirmation(false);
+    SpdySessionPoolPeer spdy_pool_peer(session_->spdy_session_pool());
+    spdy_pool_peer.SetEnableSendingInitialData(false);
   }
 
   void CreateSession() { return CreateSession(supported_versions_); }
@@ -599,6 +644,17 @@
               response->connection_info);
   }
 
+  void CheckWasSpdyResponse(HttpNetworkTransaction* trans) {
+    const HttpResponseInfo* response = trans->GetResponseInfo();
+    ASSERT_TRUE(response != nullptr);
+    ASSERT_TRUE(response->headers.get() != nullptr);
+    EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine());
+    EXPECT_TRUE(response->was_fetched_via_spdy);
+    EXPECT_TRUE(response->was_alpn_negotiated);
+    EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP2,
+              response->connection_info);
+  }
+
   void CheckResponseData(HttpNetworkTransaction* trans,
                          const std::string& expected) {
     std::string response_data;
@@ -5979,5 +6035,755 @@
   SendRequestAndExpectQuicResponse("and hello!");
 }
 
+// Performs an HTTPS/1.1 request over QUIC proxy tunnel.
+TEST_P(QuicNetworkTransactionTest, QuicProxyConnectHttpsServer) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"), &header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      1, GetNthClientInitiatedStreamId(0), false, false,
+      GetResponseHeaders("200 OK")));
+
+  const char get_request[] =
+      "GET / HTTP/1.1\r\n"
+      "Host: mail.example.org\r\n"
+      "Connection: keep-alive\r\n\r\n";
+  mock_quic_data.AddWrite(ConstructClientAckAndDataPacket(
+      3, false, GetNthClientInitiatedStreamId(0), 1, 1, 1, false, 0,
+      QuicStringPiece(get_request)));
+  const char get_response[] =
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Length: 10\r\n\r\n";
+  mock_quic_data.AddRead(
+      ConstructServerDataPacket(2, GetNthClientInitiatedStreamId(0), false,
+                                false, 0, QuicStringPiece(get_response)));
+
+  mock_quic_data.AddSynchronousRead(ConstructServerDataPacket(
+      3, GetNthClientInitiatedStreamId(0), false, false, strlen(get_response),
+      QuicStringPiece("0123456789")));
+  mock_quic_data.AddWrite(ConstructClientAckPacket(4, 3, 2, 1));
+  mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);  // No more data to read
+
+  mock_quic_data.AddWrite(
+      ConstructClientRstPacket(5, GetNthClientInitiatedStreamId(0),
+                               QUIC_STREAM_CANCELLED, strlen(get_request)));
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data_);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler;
+  trans.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler)));
+  RunTransaction(&trans);
+  CheckWasHttpResponse(&trans);
+  CheckResponsePort(&trans, 70);
+  CheckResponseData(&trans, "0123456789");
+  EXPECT_TRUE(headers_handler.was_proxied());
+  EXPECT_TRUE(trans.GetResponseInfo()->proxy_server.is_quic());
+
+  // Causes MockSSLClientSocket to disconnect, which causes the underlying QUIC
+  // proxy socket to disconnect.
+  NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
+
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Performs an HTTP/2 request over QUIC proxy tunnel.
+TEST_P(QuicNetworkTransactionTest, QuicProxyConnectSpdyServer) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"), &header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      1, GetNthClientInitiatedStreamId(0), false, false,
+      GetResponseHeaders("200 OK")));
+
+  SpdyTestUtil spdy_util;
+
+  SpdySerializedFrame get_frame =
+      spdy_util.ConstructSpdyGet("https://mail.example.org/", 1, LOWEST);
+  mock_quic_data.AddWrite(ConstructClientAckAndDataPacket(
+      3, false, GetNthClientInitiatedStreamId(0), 1, 1, 1, false, 0,
+      QuicStringPiece(get_frame.data(), get_frame.size())));
+  SpdySerializedFrame resp_frame =
+      spdy_util.ConstructSpdyGetReply(nullptr, 0, 1);
+  mock_quic_data.AddRead(ConstructServerDataPacket(
+      2, GetNthClientInitiatedStreamId(0), false, false, 0,
+      QuicStringPiece(resp_frame.data(), resp_frame.size())));
+
+  SpdySerializedFrame data_frame =
+      spdy_util.ConstructSpdyDataFrame(1, "0123456789", 10, true);
+  mock_quic_data.AddSynchronousRead(ConstructServerDataPacket(
+      3, GetNthClientInitiatedStreamId(0), false, false, resp_frame.size(),
+      QuicStringPiece(data_frame.data(), data_frame.size())));
+  mock_quic_data.AddWrite(ConstructClientAckPacket(4, 3, 2, 1));
+  mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);  // No more data to read
+
+  mock_quic_data.AddWrite(
+      ConstructClientRstPacket(5, GetNthClientInitiatedStreamId(0),
+                               QUIC_STREAM_CANCELLED, get_frame.size()));
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  SSLSocketDataProvider ssl_data(ASYNC, OK);
+  ssl_data.next_proto = kProtoHTTP2;
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler;
+  trans.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler)));
+  RunTransaction(&trans);
+  CheckWasSpdyResponse(&trans);
+  CheckResponsePort(&trans, 70);
+  CheckResponseData(&trans, "0123456789");
+  EXPECT_TRUE(headers_handler.was_proxied());
+  EXPECT_TRUE(trans.GetResponseInfo()->proxy_server.is_quic());
+
+  // Causes MockSSLClientSocket to disconnect, which causes the underlying QUIC
+  // proxy socket to disconnect.
+  NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
+
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Make two HTTP/1.1 requests to the same host over a QUIC proxy tunnel and
+// check that the proxy socket is reused for the second request.
+TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseTransportSocket) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"), &header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      1, GetNthClientInitiatedStreamId(0), false, false,
+      GetResponseHeaders("200 OK")));
+
+  QuicStreamOffset client_data_offset = 0;
+  QuicStreamOffset server_data_offset = 0;
+  const char get_request_1[] =
+      "GET / HTTP/1.1\r\n"
+      "Host: mail.example.org\r\n"
+      "Connection: keep-alive\r\n\r\n";
+  mock_quic_data.AddWrite(ConstructClientAckAndDataPacket(
+      3, false, GetNthClientInitiatedStreamId(0), 1, 1, 1, false,
+      client_data_offset, QuicStringPiece(get_request_1)));
+  client_data_offset += strlen(get_request_1);
+
+  const char get_response_1[] =
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Length: 10\r\n\r\n";
+  mock_quic_data.AddRead(ConstructServerDataPacket(
+      2, GetNthClientInitiatedStreamId(0), false, false, server_data_offset,
+      QuicStringPiece(get_response_1)));
+  server_data_offset += strlen(get_response_1);
+
+  mock_quic_data.AddSynchronousRead(ConstructServerDataPacket(
+      3, GetNthClientInitiatedStreamId(0), false, false, server_data_offset,
+      QuicStringPiece("0123456789")));
+  server_data_offset += 10;
+
+  mock_quic_data.AddWrite(ConstructClientAckPacket(4, 3, 2, 1));
+
+  const char get_request_2[] =
+      "GET /2 HTTP/1.1\r\n"
+      "Host: mail.example.org\r\n"
+      "Connection: keep-alive\r\n\r\n";
+  mock_quic_data.AddWrite(ConstructClientDataPacket(
+      5, GetNthClientInitiatedStreamId(0), false, false, client_data_offset,
+      QuicStringPiece(get_request_2)));
+  client_data_offset += strlen(get_request_2);
+
+  const char get_response_2[] =
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Length: 7\r\n\r\n";
+  mock_quic_data.AddRead(ConstructServerDataPacket(
+      4, GetNthClientInitiatedStreamId(0), false, false, server_data_offset,
+      QuicStringPiece(get_response_2)));
+  server_data_offset += strlen(get_response_2);
+
+  mock_quic_data.AddSynchronousRead(ConstructServerDataPacket(
+      5, GetNthClientInitiatedStreamId(0), false, false, server_data_offset,
+      QuicStringPiece("0123456")));
+  server_data_offset += 7;
+
+  mock_quic_data.AddWrite(ConstructClientAckPacket(6, 5, 4, 1));
+  mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);  // No more data to read
+
+  mock_quic_data.AddWrite(
+      ConstructClientRstPacket(7, GetNthClientInitiatedStreamId(0),
+                               QUIC_STREAM_CANCELLED, client_data_offset));
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data_);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans_1(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler_1;
+  trans_1.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler_1)));
+  RunTransaction(&trans_1);
+  CheckWasHttpResponse(&trans_1);
+  CheckResponsePort(&trans_1, 70);
+  CheckResponseData(&trans_1, "0123456789");
+  EXPECT_TRUE(headers_handler_1.was_proxied());
+  EXPECT_TRUE(trans_1.GetResponseInfo()->proxy_server.is_quic());
+
+  request_.url = GURL("https://mail.example.org/2");
+  HttpNetworkTransaction trans_2(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler_2;
+  trans_2.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler_2)));
+  RunTransaction(&trans_2);
+  CheckWasHttpResponse(&trans_2);
+  CheckResponsePort(&trans_2, 70);
+  CheckResponseData(&trans_2, "0123456");
+  EXPECT_TRUE(headers_handler_2.was_proxied());
+  EXPECT_TRUE(trans_2.GetResponseInfo()->proxy_server.is_quic());
+
+  // Causes MockSSLClientSocket to disconnect, which causes the underlying QUIC
+  // proxy socket to disconnect.
+  NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
+
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Make an HTTP/1.1 request to one host and an HTTP/2 request to a different
+// host over a QUIC proxy tunnel. Check that the QUIC session to the proxy
+// server is reused for the second request.
+TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseQuicSession) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset client_header_stream_offset = 0;
+  QuicStreamOffset server_header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &client_header_stream_offset));
+
+  // CONNECT request and response for first request
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"),
+      &client_header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      1, GetNthClientInitiatedStreamId(0), false, false,
+      GetResponseHeaders("200 OK"), &server_header_stream_offset));
+
+  // GET request, response, and data over QUIC tunnel for first request
+  const char get_request[] =
+      "GET / HTTP/1.1\r\n"
+      "Host: mail.example.org\r\n"
+      "Connection: keep-alive\r\n\r\n";
+  mock_quic_data.AddWrite(ConstructClientAckAndDataPacket(
+      3, false, GetNthClientInitiatedStreamId(0), 1, 1, 1, false, 0,
+      QuicStringPiece(get_request)));
+  const char get_response[] =
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Length: 10\r\n\r\n";
+  mock_quic_data.AddRead(
+      ConstructServerDataPacket(2, GetNthClientInitiatedStreamId(0), false,
+                                false, 0, QuicStringPiece(get_response)));
+  mock_quic_data.AddSynchronousRead(ConstructServerDataPacket(
+      3, GetNthClientInitiatedStreamId(0), false, false, strlen(get_response),
+      QuicStringPiece("0123456789")));
+  mock_quic_data.AddWrite(ConstructClientAckPacket(4, 3, 2, 1));
+
+  // CONNECT request and response for second request
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      5, GetNthClientInitiatedStreamId(1), false, false,
+      ConnectRequestHeaders("different.example.org:443"),
+      GetNthClientInitiatedStreamId(0), &client_header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      4, GetNthClientInitiatedStreamId(1), false, false,
+      GetResponseHeaders("200 OK"), &server_header_stream_offset));
+
+  // GET request, response, and data over QUIC tunnel for second request
+  SpdyTestUtil spdy_util;
+  SpdySerializedFrame get_frame =
+      spdy_util.ConstructSpdyGet("https://different.example.org/", 1, LOWEST);
+  mock_quic_data.AddWrite(ConstructClientAckAndDataPacket(
+      6, false, GetNthClientInitiatedStreamId(1), 4, 4, 1, false, 0,
+      QuicStringPiece(get_frame.data(), get_frame.size())));
+
+  SpdySerializedFrame resp_frame =
+      spdy_util.ConstructSpdyGetReply(nullptr, 0, 1);
+  mock_quic_data.AddRead(ConstructServerDataPacket(
+      5, GetNthClientInitiatedStreamId(1), false, false, 0,
+      QuicStringPiece(resp_frame.data(), resp_frame.size())));
+
+  SpdySerializedFrame data_frame =
+      spdy_util.ConstructSpdyDataFrame(1, "0123456", 7, true);
+  mock_quic_data.AddRead(ConstructServerDataPacket(
+      6, GetNthClientInitiatedStreamId(1), false, false, resp_frame.size(),
+      QuicStringPiece(data_frame.data(), data_frame.size())));
+
+  mock_quic_data.AddWrite(ConstructClientAckPacket(7, 6, 5, 1));
+  mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);  // No more data to read
+
+  mock_quic_data.AddWrite(
+      ConstructClientRstPacket(8, GetNthClientInitiatedStreamId(0),
+                               QUIC_STREAM_CANCELLED, strlen(get_request)));
+  mock_quic_data.AddWrite(
+      ConstructClientRstPacket(9, GetNthClientInitiatedStreamId(1),
+                               QUIC_STREAM_CANCELLED, get_frame.size()));
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data_);
+
+  SSLSocketDataProvider ssl_data(ASYNC, OK);
+  ssl_data.next_proto = kProtoHTTP2;
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans_1(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler_1;
+  trans_1.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler_1)));
+  RunTransaction(&trans_1);
+  CheckWasHttpResponse(&trans_1);
+  CheckResponsePort(&trans_1, 70);
+  CheckResponseData(&trans_1, "0123456789");
+  EXPECT_TRUE(headers_handler_1.was_proxied());
+  EXPECT_TRUE(trans_1.GetResponseInfo()->proxy_server.is_quic());
+
+  request_.url = GURL("https://different.example.org/");
+  HttpNetworkTransaction trans_2(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler_2;
+  trans_2.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler_2)));
+  RunTransaction(&trans_2);
+  CheckWasSpdyResponse(&trans_2);
+  CheckResponsePort(&trans_2, 70);
+  CheckResponseData(&trans_2, "0123456");
+  EXPECT_TRUE(headers_handler_2.was_proxied());
+  EXPECT_TRUE(trans_2.GetResponseInfo()->proxy_server.is_quic());
+
+  // Causes MockSSLClientSocket to disconnect, which causes the underlying QUIC
+  // proxy socket to disconnect.
+  NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
+
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Sends a CONNECT request to a QUIC proxy and receive a 500 response.
+TEST_P(QuicNetworkTransactionTest, QuicProxyConnectFailure) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"), &header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      1, GetNthClientInitiatedStreamId(0), false, true,
+      GetResponseHeaders("500")));
+  mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);  // No more data to read
+  mock_quic_data.AddWrite(ConstructClientAckAndRstPacket(
+      3, GetNthClientInitiatedStreamId(0), QUIC_STREAM_CANCELLED, 1, 1, 1));
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data_);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler;
+  trans.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler)));
+  TestCompletionCallback callback;
+  int rv = trans.Start(&request_, callback.callback(), net_log_.bound());
+  EXPECT_EQ(ERR_IO_PENDING, rv);
+  EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, callback.WaitForResult());
+  EXPECT_EQ(false, headers_handler.was_proxied());
+
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Sends a CONNECT request to a QUIC proxy and get a UDP socket read error.
+TEST_P(QuicNetworkTransactionTest, QuicProxyQuicConnectionError) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"), &header_stream_offset));
+  mock_quic_data.AddRead(ASYNC, ERR_CONNECTION_FAILED);
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler;
+  trans.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler)));
+  TestCompletionCallback callback;
+  int rv = trans.Start(&request_, callback.callback(), net_log_.bound());
+  EXPECT_EQ(ERR_IO_PENDING, rv);
+  EXPECT_EQ(ERR_QUIC_PROTOCOL_ERROR, callback.WaitForResult());
+
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Sends an HTTP/1.1 request over QUIC proxy tunnel and gets a bad cert from the
+// host. Retries request and succeeds.
+TEST_P(QuicNetworkTransactionTest, QuicProxyConnectBadCertificate) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset client_header_stream_offset = 0;
+  QuicStreamOffset server_header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &client_header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false,
+      ConnectRequestHeaders("mail.example.org:443"),
+      &client_header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      1, GetNthClientInitiatedStreamId(0), false, false,
+      GetResponseHeaders("200 OK"), &server_header_stream_offset));
+  mock_quic_data.AddWrite(ConstructClientAckAndRstPacket(
+      3, GetNthClientInitiatedStreamId(0), QUIC_STREAM_CANCELLED, 1, 1, 1));
+
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      4, GetNthClientInitiatedStreamId(1), false, false,
+      ConnectRequestHeaders("mail.example.org:443"),
+      GetNthClientInitiatedStreamId(0), &client_header_stream_offset));
+  mock_quic_data.AddRead(ConstructServerResponseHeadersPacket(
+      2, GetNthClientInitiatedStreamId(1), false, false,
+      GetResponseHeaders("200 OK"), &server_header_stream_offset));
+
+  const char get_request[] =
+      "GET / HTTP/1.1\r\n"
+      "Host: mail.example.org\r\n"
+      "Connection: keep-alive\r\n\r\n";
+  mock_quic_data.AddWrite(ConstructClientAckAndDataPacket(
+      5, false, GetNthClientInitiatedStreamId(1), 2, 2, 1, false, 0,
+      QuicStringPiece(get_request)));
+  const char get_response[] =
+      "HTTP/1.1 200 OK\r\n"
+      "Content-Length: 10\r\n\r\n";
+  mock_quic_data.AddRead(
+      ConstructServerDataPacket(3, GetNthClientInitiatedStreamId(1), false,
+                                false, 0, QuicStringPiece(get_response)));
+
+  mock_quic_data.AddSynchronousRead(ConstructServerDataPacket(
+      4, GetNthClientInitiatedStreamId(1), false, false, strlen(get_response),
+      QuicStringPiece("0123456789")));
+  mock_quic_data.AddWrite(ConstructClientAckPacket(6, 4, 3, 1));
+  mock_quic_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);  // No more data to read
+
+  mock_quic_data.AddWrite(
+      ConstructClientRstPacket(7, GetNthClientInitiatedStreamId(1),
+                               QUIC_STREAM_CANCELLED, strlen(get_request)));
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  SSLSocketDataProvider ssl_data_bad_cert(ASYNC, ERR_CERT_AUTHORITY_INVALID);
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data_bad_cert);
+
+  SSLSocketDataProvider ssl_data(ASYNC, OK);
+  socket_factory_.AddSSLSocketDataProvider(&ssl_data);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler;
+  trans.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler)));
+  TestCompletionCallback callback;
+  int rv = trans.Start(&request_, callback.callback(), net_log_.bound());
+  EXPECT_EQ(ERR_IO_PENDING, rv);
+  EXPECT_EQ(ERR_CERT_AUTHORITY_INVALID, callback.WaitForResult());
+
+  rv = trans.RestartIgnoringLastError(callback.callback());
+  EXPECT_EQ(ERR_IO_PENDING, rv);
+  EXPECT_EQ(OK, callback.WaitForResult());
+
+  CheckWasHttpResponse(&trans);
+  CheckResponsePort(&trans, 70);
+  CheckResponseData(&trans, "0123456789");
+  EXPECT_EQ(true, headers_handler.was_proxied());
+  EXPECT_TRUE(trans.GetResponseInfo()->proxy_server.is_quic());
+
+  // Causes MockSSLClientSocket to disconnect, which causes the underlying QUIC
+  // proxy socket to disconnect.
+  NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
+
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Checks if a request's specified "user-agent" header shows up correctly in the
+// CONNECT request to a QUIC proxy.
+TEST_P(QuicNetworkTransactionTest, QuicProxyUserAgent) {
+  session_params_.enable_quic = true;
+  proxy_resolution_service_ = ProxyResolutionService::CreateFixedFromPacResult(
+      "QUIC proxy.example.org:70");
+
+  MockQuicData mock_quic_data;
+  QuicStreamOffset header_stream_offset = 0;
+  mock_quic_data.AddWrite(
+      ConstructInitialSettingsPacket(1, &header_stream_offset));
+
+  SpdyHeaderBlock headers = ConnectRequestHeaders("mail.example.org:443");
+  headers["user-agent"] = "Chromium Ultra Awesome X Edition";
+  mock_quic_data.AddWrite(ConstructClientRequestHeadersPacket(
+      2, GetNthClientInitiatedStreamId(0), true, false, std::move(headers),
+      &header_stream_offset));
+  // Return an error, so the transaction stops here (this test isn't interested
+  // in the rest).
+  mock_quic_data.AddRead(ASYNC, ERR_CONNECTION_FAILED);
+
+  mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+
+  CreateSession();
+
+  request_.url = GURL("https://mail.example.org/");
+  request_.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent,
+                                   "Chromium Ultra Awesome X Edition");
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+  HeadersHandler headers_handler;
+  trans.SetBeforeHeadersSentCallback(
+      base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                          base::Unretained(&headers_handler)));
+  TestCompletionCallback callback;
+  int rv = trans.Start(&request_, callback.callback(), net_log_.bound());
+  EXPECT_EQ(ERR_IO_PENDING, rv);
+  EXPECT_EQ(ERR_QUIC_PROTOCOL_ERROR, callback.WaitForResult());
+
+  EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+  EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+}
+
+// Test the request-challenge-retry sequence for basic auth, over a QUIC
+// connection when setting up a QUIC proxy tunnel.
+TEST_P(QuicNetworkTransactionTest, QuicProxyAuth) {
+  const base::string16 kBaz(base::ASCIIToUTF16("baz"));
+  const base::string16 kFoo(base::ASCIIToUTF16("foo"));
+  const SpdyPriority default_priority =
+      ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
+
+  std::unique_ptr<QuicTestPacketMaker> client_maker;
+  std::unique_ptr<QuicTestPacketMaker> server_maker;
+
+  // On the second pass, the body read of the auth challenge is synchronous, so
+  // IsConnectedAndIdle returns false.  The socket should still be drained and
+  // reused. See http://crbug.com/544255.
+  for (int i = 0; i < 2; ++i) {
+    client_maker.reset(new QuicTestPacketMaker(
+        version_, 0, &clock_, kDefaultServerHostName, Perspective::IS_CLIENT,
+        client_headers_include_h2_stream_dependency_));
+    server_maker.reset(new QuicTestPacketMaker(version_, 0, &clock_,
+                                               kDefaultServerHostName,
+                                               Perspective::IS_SERVER, false));
+
+    session_params_.enable_quic = true;
+    proxy_resolution_service_ =
+        ProxyResolutionService::CreateFixedFromPacResult(
+            "QUIC proxy.example.org:70");
+
+    MockQuicData mock_quic_data;
+    QuicStreamOffset client_header_stream_offset = 0;
+    QuicStreamOffset server_header_stream_offset = 0;
+    QuicStreamOffset client_data_offset = 0;
+    QuicStreamOffset server_data_offset = 0;
+
+    mock_quic_data.AddWrite(client_maker->MakeInitialSettingsPacket(
+        1, &client_header_stream_offset));
+
+    mock_quic_data.AddWrite(
+        client_maker->MakeRequestHeadersPacketWithOffsetTracking(
+            2, GetNthClientInitiatedStreamId(0), true, false, default_priority,
+            client_maker->ConnectRequestHeaders("mail.example.org:443"), 0,
+            &client_header_stream_offset));
+
+    SpdyHeaderBlock headers =
+        server_maker->GetResponseHeaders("407 Proxy Authentication Required");
+    headers["proxy-authenticate"] = "Basic realm=\"MyRealm1\"";
+    headers["content-length"] = "10";
+    mock_quic_data.AddRead(
+        server_maker->MakeResponseHeadersPacketWithOffsetTracking(
+            1, GetNthClientInitiatedStreamId(0), false, false,
+            std::move(headers), &server_header_stream_offset));
+
+    if (i == 0) {
+      mock_quic_data.AddRead(server_maker->MakeDataPacket(
+          2, GetNthClientInitiatedStreamId(0), false, false, server_data_offset,
+          "0123456789"));
+    } else {
+      mock_quic_data.AddSynchronousRead(server_maker->MakeDataPacket(
+          2, GetNthClientInitiatedStreamId(0), false, false, server_data_offset,
+          "0123456789"));
+    }
+    server_data_offset += 10;
+
+    mock_quic_data.AddWrite(client_maker->MakeAckPacket(3, 2, 1, 1, true));
+
+    mock_quic_data.AddWrite(
+        client_maker->MakeRstPacket(4, false, GetNthClientInitiatedStreamId(0),
+                                    QUIC_STREAM_CANCELLED, client_data_offset));
+
+    headers = client_maker->ConnectRequestHeaders("mail.example.org:443");
+    headers["proxy-authorization"] = "Basic Zm9vOmJheg==";
+    mock_quic_data.AddWrite(
+        client_maker->MakeRequestHeadersPacketWithOffsetTracking(
+            5, GetNthClientInitiatedStreamId(1), false, false, default_priority,
+            std::move(headers), GetNthClientInitiatedStreamId(0),
+            &client_header_stream_offset));
+
+    // Response to wrong password
+    headers =
+        server_maker->GetResponseHeaders("407 Proxy Authentication Required");
+    headers["proxy-authenticate"] = "Basic realm=\"MyRealm1\"";
+    headers["content-length"] = "10";
+    mock_quic_data.AddRead(
+        server_maker->MakeResponseHeadersPacketWithOffsetTracking(
+            3, GetNthClientInitiatedStreamId(1), false, false,
+            std::move(headers), &server_header_stream_offset));
+    mock_quic_data.AddRead(SYNCHRONOUS,
+                           ERR_IO_PENDING);  // No more data to read
+
+    mock_quic_data.AddWrite(client_maker->MakeAckAndRstPacket(
+        6, false, GetNthClientInitiatedStreamId(1), QUIC_STREAM_CANCELLED, 3, 3,
+        1, true));
+
+    mock_quic_data.AddSocketDataToFactory(&socket_factory_);
+    mock_quic_data.GetSequencedSocketData()->set_busy_before_sync_reads(true);
+
+    CreateSession();
+
+    request_.url = GURL("https://mail.example.org/");
+    // Ensure that proxy authentication is attempted even
+    // when the no authentication data flag is set.
+    request_.load_flags = LOAD_DO_NOT_SEND_AUTH_DATA;
+    {
+      HttpNetworkTransaction trans(DEFAULT_PRIORITY, session_.get());
+      HeadersHandler headers_handler;
+      trans.SetBeforeHeadersSentCallback(
+          base::BindRepeating(&HeadersHandler::OnBeforeHeadersSent,
+                              base::Unretained(&headers_handler)));
+      RunTransaction(&trans);
+
+      const HttpResponseInfo* response = trans.GetResponseInfo();
+      ASSERT_TRUE(response != nullptr);
+      ASSERT_TRUE(response->headers.get() != nullptr);
+      EXPECT_EQ("HTTP/1.1 407 Proxy Authentication Required",
+                response->headers->GetStatusLine());
+      EXPECT_TRUE(response->headers->IsKeepAlive());
+      EXPECT_EQ(407, response->headers->response_code());
+      EXPECT_EQ(10, response->headers->GetContentLength());
+      EXPECT_EQ(HttpVersion(1, 1), response->headers->GetHttpVersion());
+      const AuthChallengeInfo* auth_challenge = response->auth_challenge.get();
+      ASSERT_TRUE(auth_challenge != nullptr);
+      EXPECT_TRUE(auth_challenge->is_proxy);
+      EXPECT_EQ("https://proxy.example.org:70",
+                auth_challenge->challenger.Serialize());
+      EXPECT_EQ("MyRealm1", auth_challenge->realm);
+      EXPECT_EQ("basic", auth_challenge->scheme);
+
+      TestCompletionCallback callback;
+      int rv = trans.RestartWithAuth(AuthCredentials(kFoo, kBaz),
+                                     callback.callback());
+      EXPECT_EQ(ERR_IO_PENDING, rv);
+      EXPECT_EQ(OK, callback.WaitForResult());
+
+      response = trans.GetResponseInfo();
+      ASSERT_TRUE(response != nullptr);
+      ASSERT_TRUE(response->headers.get() != nullptr);
+      EXPECT_EQ("HTTP/1.1 407 Proxy Authentication Required",
+                response->headers->GetStatusLine());
+      EXPECT_TRUE(response->headers->IsKeepAlive());
+      EXPECT_EQ(407, response->headers->response_code());
+      EXPECT_EQ(10, response->headers->GetContentLength());
+      EXPECT_EQ(HttpVersion(1, 1), response->headers->GetHttpVersion());
+      auth_challenge = response->auth_challenge.get();
+      ASSERT_TRUE(auth_challenge != nullptr);
+      EXPECT_TRUE(auth_challenge->is_proxy);
+      EXPECT_EQ("https://proxy.example.org:70",
+                auth_challenge->challenger.Serialize());
+      EXPECT_EQ("MyRealm1", auth_challenge->realm);
+      EXPECT_EQ("basic", auth_challenge->scheme);
+    }
+    // HttpNetworkTransaction is torn down now that it's out of scope, causing
+    // the QUIC stream to be cleaned up (since the proxy socket cannot be
+    // reused because it's not connected).
+    EXPECT_TRUE(mock_quic_data.AllReadDataConsumed());
+    EXPECT_TRUE(mock_quic_data.AllWriteDataConsumed());
+  }
+}
+
 }  // namespace test
 }  // namespace net
diff --git a/net/quic/chromium/quic_test_packet_maker.cc b/net/quic/chromium/quic_test_packet_maker.cc
index 3cccfc7..b1d3c03 100644
--- a/net/quic/chromium/quic_test_packet_maker.cc
+++ b/net/quic/chromium/quic_test_packet_maker.cc
@@ -707,6 +707,14 @@
   return headers;
 }
 
+SpdyHeaderBlock QuicTestPacketMaker::ConnectRequestHeaders(
+    const std::string& host_port) {
+  SpdyHeaderBlock headers;
+  headers[":method"] = "CONNECT";
+  headers[":authority"] = host_port;
+  return headers;
+}
+
 SpdyHeaderBlock QuicTestPacketMaker::GetResponseHeaders(
     const std::string& status) {
   SpdyHeaderBlock headers;
diff --git a/net/quic/chromium/quic_test_packet_maker.h b/net/quic/chromium/quic_test_packet_maker.h
index c4dda8d..a6d6fcd 100644
--- a/net/quic/chromium/quic_test_packet_maker.h
+++ b/net/quic/chromium/quic_test_packet_maker.h
@@ -263,6 +263,9 @@
   SpdyHeaderBlock GetRequestHeaders(const std::string& method,
                                     const std::string& scheme,
                                     const std::string& path);
+
+  SpdyHeaderBlock ConnectRequestHeaders(const std::string& host_port);
+
   SpdyHeaderBlock GetResponseHeaders(const std::string& status);
 
   SpdyHeaderBlock GetResponseHeaders(const std::string& status,
diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket_pool_manager.cc
index 6adedd4..2c245bc5 100644
--- a/net/socket/client_socket_pool_manager.cc
+++ b/net/socket/client_socket_pool_manager.cc
@@ -153,7 +153,7 @@
                                   resolution_callback,
                                   non_ssl_combine_connect_and_write_policy));
 
-    if (proxy_info.is_http() || proxy_info.is_https()) {
+    if (proxy_info.is_http() || proxy_info.is_https() || proxy_info.is_quic()) {
       // TODO(mmenke):  Would it be better to split these into two different
       //     socket pools?  And maybe socks4/socks5 as well?
       if (proxy_info.is_http()) {
@@ -166,7 +166,7 @@
       request_extra_headers.GetHeader(HttpRequestHeaders::kUserAgent,
                                       &user_agent);
       scoped_refptr<SSLSocketParams> ssl_params;
-      if (proxy_info.is_https()) {
+      if (!proxy_info.is_http()) {
         proxy_tcp_params = new TransportSocketParams(
             *proxy_host_port, disable_resolver_cache, resolution_callback,
             ssl_combine_connect_and_write_policy);
@@ -178,12 +178,12 @@
         proxy_tcp_params = NULL;
       }
 
-      // TODO (wangyix): QUIC_VERSION_UNSUPPORTED will be passed in
-      // |http_proxy_params| for now to avoid creating a QUIC proxy, which is
-      // not ready yet. Eventually, |quic_version| should be passed in if doing
-      // a QUIC proxy.
+      if (!proxy_info.is_quic()) {
+        quic_version = QUIC_VERSION_UNSUPPORTED;
+      }
+
       http_proxy_params = new HttpProxySocketParams(
-          proxy_tcp_params, ssl_params, QUIC_VERSION_UNSUPPORTED, user_agent,
+          proxy_tcp_params, ssl_params, quic_version, user_agent,
           origin_host_port, session->http_auth_cache(),
           session->http_auth_handler_factory(), session->spdy_session_pool(),
           session->quic_stream_factory(), force_tunnel || using_ssl);
diff --git a/services/network/public/cpp/data_element.cc b/services/network/public/cpp/data_element.cc
index f8dd18fe..a9e8ba2 100644
--- a/services/network/public/cpp/data_element.cc
+++ b/services/network/public/cpp/data_element.cc
@@ -60,24 +60,6 @@
   length_ = length;
 }
 
-void DataElement::SetToFileSystemUrlRange(
-    const GURL& filesystem_url,
-    uint64_t offset,
-    uint64_t length,
-    const base::Time& expected_modification_time) {
-  type_ = TYPE_FILE_FILESYSTEM;
-  filesystem_url_ = filesystem_url;
-  offset_ = offset;
-  length_ = length;
-  expected_modification_time_ = expected_modification_time;
-}
-
-void DataElement::SetToDiskCacheEntryRange(uint64_t offset, uint64_t length) {
-  type_ = TYPE_DISK_CACHE_ENTRY;
-  offset_ = offset;
-  length_ = length;
-}
-
 void DataElement::SetToDataPipe(mojom::DataPipeGetterPtr data_pipe_getter) {
   type_ = TYPE_DATA_PIPE;
   data_pipe_getter_ = std::move(data_pipe_getter);
@@ -116,15 +98,6 @@
     case DataElement::TYPE_BLOB:
       *os << "TYPE_BLOB, uuid: " << x.blob_uuid();
       break;
-    case DataElement::TYPE_FILE_FILESYSTEM:
-      *os << "TYPE_FILE_FILESYSTEM, filesystem_url: " << x.filesystem_url();
-      break;
-    case DataElement::TYPE_DISK_CACHE_ENTRY:
-      *os << "TYPE_DISK_CACHE_ENTRY";
-      break;
-    case DataElement::TYPE_BYTES_DESCRIPTION:
-      *os << "TYPE_BYTES_DESCRIPTION";
-      break;
     case DataElement::TYPE_DATA_PIPE:
       *os << "TYPE_DATA_PIPE";
       break;
@@ -150,14 +123,6 @@
              a.expected_modification_time() == b.expected_modification_time();
     case DataElement::TYPE_BLOB:
       return a.blob_uuid() == b.blob_uuid();
-    case DataElement::TYPE_FILE_FILESYSTEM:
-      return a.filesystem_url() == b.filesystem_url();
-    case DataElement::TYPE_DISK_CACHE_ENTRY:
-      // We compare only length and offset; we trust the entry itself was
-      // compared at some higher level such as in BlobDataItem.
-      return true;
-    case DataElement::TYPE_BYTES_DESCRIPTION:
-      return true;
     case DataElement::TYPE_DATA_PIPE:
       return false;
     case DataElement::TYPE_UNKNOWN:
diff --git a/services/network/public/cpp/data_element.h b/services/network/public/cpp/data_element.h
index 4dbfa5e..6f534ae 100644
--- a/services/network/public/cpp/data_element.h
+++ b/services/network/public/cpp/data_element.h
@@ -38,14 +38,8 @@
     TYPE_DATA_PIPE,
     TYPE_RAW_FILE,
 
-    // Only used for Blob:
-    TYPE_BYTES_DESCRIPTION,
-    TYPE_DISK_CACHE_ENTRY,  // Only used by CacheStorage
-    TYPE_FILE_FILESYSTEM,
-
-    // Commonly used for Blob, and also for Upload when Network Service is
-    // disabled:
-    TYPE_BLOB,  // Used old IPC codepath only.
+    // Used for Upload when Network Service is disabled:
+    TYPE_BLOB,
     TYPE_FILE,
 
     // Commonly used in every case:
@@ -64,7 +58,6 @@
   const char* bytes() const { return bytes_ ? bytes_ : buf_.data(); }
   const base::FilePath& path() const { return path_; }
   const base::File& file() const { return file_; }
-  const GURL& filesystem_url() const { return filesystem_url_; }
   const std::string& blob_uuid() const { return blob_uuid_; }
   const mojom::DataPipeGetterPtr& data_pipe() const {
     return data_pipe_getter_;
@@ -106,12 +99,6 @@
     length_ = buf_.size();
   }
 
-  void SetToBytesDescription(size_t bytes_len) {
-    type_ = TYPE_BYTES_DESCRIPTION;
-    bytes_ = nullptr;
-    length_ = bytes_len;
-  }
-
   // Sets TYPE_BYTES data. This does NOT copy the given data and the caller
   // should make sure the data is alive when this element is accessed.
   // You cannot use AppendBytes with this method.
@@ -163,15 +150,6 @@
                       uint64_t offset,
                       uint64_t length);
 
-  // Sets TYPE_FILE_FILESYSTEM with range.
-  void SetToFileSystemUrlRange(const GURL& filesystem_url,
-                               uint64_t offset,
-                               uint64_t length,
-                               const base::Time& expected_modification_time);
-
-  // Sets to TYPE_DISK_CACHE_ENTRY with range.
-  void SetToDiskCacheEntryRange(uint64_t offset, uint64_t length);
-
   // Sets TYPE_DATA_PIPE data.
   void SetToDataPipe(mojom::DataPipeGetterPtr data_pipe_getter);
 
@@ -190,7 +168,6 @@
   const char* bytes_;      // For TYPE_BYTES.
   base::FilePath path_;    // For TYPE_FILE and TYPE_RAW_FILE.
   base::File file_;        // For TYPE_RAW_FILE.
-  GURL filesystem_url_;    // For TYPE_FILE_FILESYSTEM.
   std::string blob_uuid_;  // For TYPE_BLOB.
   mojom::DataPipeGetterPtr data_pipe_getter_;  // For TYPE_DATA_PIPE.
   uint64_t offset_;
diff --git a/services/network/public/cpp/network_param_ipc_traits.cc b/services/network/public/cpp/network_param_ipc_traits.cc
index 12058b0..b6c4f52 100644
--- a/services/network/public/cpp/network_param_ipc_traits.cc
+++ b/services/network/public/cpp/network_param_ipc_traits.cc
@@ -423,10 +423,6 @@
       m->WriteData(p.bytes(), static_cast<int>(p.length()));
       break;
     }
-    case network::DataElement::TYPE_BYTES_DESCRIPTION: {
-      WriteParam(m, p.length());
-      break;
-    }
     case network::DataElement::TYPE_FILE: {
       WriteParam(m, p.path());
       WriteParam(m, p.offset());
@@ -444,23 +440,12 @@
       WriteParam(m, p.expected_modification_time());
       break;
     }
-    case network::DataElement::TYPE_FILE_FILESYSTEM: {
-      WriteParam(m, p.filesystem_url());
-      WriteParam(m, p.offset());
-      WriteParam(m, p.length());
-      WriteParam(m, p.expected_modification_time());
-      break;
-    }
     case network::DataElement::TYPE_BLOB: {
       WriteParam(m, p.blob_uuid());
       WriteParam(m, p.offset());
       WriteParam(m, p.length());
       break;
     }
-    case network::DataElement::TYPE_DISK_CACHE_ENTRY: {
-      NOTREACHED() << "Can't be sent by IPC.";
-      break;
-    }
     case network::DataElement::TYPE_DATA_PIPE: {
       WriteParam(m,
                  const_cast<network::mojom::DataPipeGetterPtr&>(p.data_pipe())
@@ -491,13 +476,6 @@
       r->SetToBytes(data, len);
       return true;
     }
-    case network::DataElement::TYPE_BYTES_DESCRIPTION: {
-      uint64_t length;
-      if (!ReadParam(m, iter, &length))
-        return false;
-      r->SetToBytesDescription(length);
-      return true;
-    }
     case network::DataElement::TYPE_FILE: {
       base::FilePath file_path;
       uint64_t offset, length;
@@ -535,22 +513,6 @@
                         expected_modification_time);
       return true;
     }
-    case network::DataElement::TYPE_FILE_FILESYSTEM: {
-      GURL file_system_url;
-      uint64_t offset, length;
-      base::Time expected_modification_time;
-      if (!ReadParam(m, iter, &file_system_url))
-        return false;
-      if (!ReadParam(m, iter, &offset))
-        return false;
-      if (!ReadParam(m, iter, &length))
-        return false;
-      if (!ReadParam(m, iter, &expected_modification_time))
-        return false;
-      r->SetToFileSystemUrlRange(file_system_url, offset, length,
-                                 expected_modification_time);
-      return true;
-    }
     case network::DataElement::TYPE_BLOB: {
       std::string blob_uuid;
       uint64_t offset, length;
@@ -563,10 +525,6 @@
       r->SetToBlobRange(blob_uuid, offset, length);
       return true;
     }
-    case network::DataElement::TYPE_DISK_CACHE_ENTRY: {
-      NOTREACHED() << "Can't be sent by IPC.";
-      return false;
-    }
     case network::DataElement::TYPE_DATA_PIPE: {
       network::mojom::DataPipeGetterPtr data_pipe_getter;
       mojo::MessagePipeHandle message_pipe;
diff --git a/services/network/public/cpp/resource_request_body.cc b/services/network/public/cpp/resource_request_body.cc
index 379c34b..37fb2274 100644
--- a/services/network/public/cpp/resource_request_body.cc
+++ b/services/network/public/cpp/resource_request_body.cc
@@ -51,16 +51,6 @@
   elements_.back().SetToBlob(uuid);
 }
 
-void ResourceRequestBody::AppendFileSystemFileRange(
-    const GURL& url,
-    uint64_t offset,
-    uint64_t length,
-    const base::Time& expected_modification_time) {
-  elements_.push_back(DataElement());
-  elements_.back().SetToFileSystemUrlRange(url, offset, length,
-                                           expected_modification_time);
-}
-
 void ResourceRequestBody::AppendDataPipe(
     mojom::DataPipeGetterPtr data_pipe_getter) {
   elements_.push_back(DataElement());
diff --git a/services/network/public/cpp/resource_request_body.h b/services/network/public/cpp/resource_request_body.h
index 7846d15..04b90d7 100644
--- a/services/network/public/cpp/resource_request_body.h
+++ b/services/network/public/cpp/resource_request_body.h
@@ -44,10 +44,6 @@
                           const base::Time& expected_modification_time);
 
   void AppendBlob(const std::string& uuid);
-  void AppendFileSystemFileRange(const GURL& url,
-                                 uint64_t offset,
-                                 uint64_t length,
-                                 const base::Time& expected_modification_time);
   void AppendDataPipe(mojom::DataPipeGetterPtr data_pipe_getter);
 
   const std::vector<DataElement>* elements() const { return &elements_; }
diff --git a/skia/public/interfaces/image_filter_struct_traits.h b/skia/public/interfaces/image_filter_struct_traits.h
index 734c311..0405184 100644
--- a/skia/public/interfaces/image_filter_struct_traits.h
+++ b/skia/public/interfaces/image_filter_struct_traits.h
@@ -8,7 +8,6 @@
 #include "skia/ext/skia_utils_base.h"
 #include "skia/public/interfaces/image_filter.mojom-shared.h"
 #include "third_party/skia/include/core/SkData.h"
-#include "third_party/skia/include/core/SkFlattenableSerialization.h"
 #include "third_party/skia/include/core/SkImageFilter.h"
 
 namespace mojo {
diff --git a/skia/tools/filter_fuzz_stub/filter_fuzz_stub.cc b/skia/tools/filter_fuzz_stub/filter_fuzz_stub.cc
index 14654af..ec213ddbb 100644
--- a/skia/tools/filter_fuzz_stub/filter_fuzz_stub.cc
+++ b/skia/tools/filter_fuzz_stub/filter_fuzz_stub.cc
@@ -8,7 +8,6 @@
 #include "base/test/test_discardable_memory_allocator.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkFlattenableSerialization.h"
 #include "third_party/skia/include/core/SkImageFilter.h"
 
 namespace {
@@ -30,7 +29,7 @@
                  SkCanvas* canvas) {
   // This call shouldn't crash or cause ASAN to flag any memory issues
   // If nothing bad happens within this call, everything is fine
-  sk_sp<SkImageFilter> flattenable = SkValidatingDeserializeImageFilter(
+  sk_sp<SkImageFilter> flattenable = SkImageFilter::Deserialize(
       ipc_filter_message.c_str(), ipc_filter_message.size());
 
   // Adding some info, but the test passed if we got here without any trouble
diff --git a/storage/browser/blob/blob_data_builder.cc b/storage/browser/blob/blob_data_builder.cc
index fdd0b6eed..2f7d34e 100644
--- a/storage/browser/blob/blob_data_builder.cc
+++ b/storage/browser/blob/blob_data_builder.cc
@@ -115,11 +115,6 @@
       AppendFile(ipc_data.path(), ipc_data.offset(), length,
                  ipc_data.expected_modification_time());
       break;
-    case network::DataElement::TYPE_FILE_FILESYSTEM:
-      AppendFileSystemFile(ipc_data.filesystem_url(), ipc_data.offset(), length,
-                           ipc_data.expected_modification_time(),
-                           file_system_context);
-      break;
     case network::DataElement::TYPE_BLOB:
       // This will be deconstructed immediately into the items the blob is made
       // up of.
@@ -127,10 +122,8 @@
                  blob_registry);
       break;
     case network::DataElement::TYPE_RAW_FILE:
-    case network::DataElement::TYPE_BYTES_DESCRIPTION:
     case network::DataElement::TYPE_UNKNOWN:
     // This type can't be sent by IPC.
-    case network::DataElement::TYPE_DISK_CACHE_ENTRY:
     case network::DataElement::TYPE_DATA_PIPE:
       NOTREACHED();
       break;
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json
index ec2bc22..82ff753 100644
--- a/testing/buildbot/chromium.android.fyi.json
+++ b/testing/buildbot/chromium.android.fyi.json
@@ -1,285 +1,6 @@
 {
   "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
   "AAAAA2 See generate_buildbot_json.py to make changes": {},
-  "Android Cronet ARMv6 Builder": {
-    "gtest_tests": [
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "merge": {
-          "args": [
-            "--bucket",
-            "chromium-result-details",
-            "--test-name",
-            "cronet_sample_test_apk"
-          ],
-          "script": "//build/android/pylib/results/presentation/test_results_presentation.py"
-        },
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_sample_test_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "merge": {
-          "args": [
-            "--bucket",
-            "chromium-result-details",
-            "--test-name",
-            "cronet_smoketests_missing_native_library_instrumentation_apk"
-          ],
-          "script": "//build/android/pylib/results/presentation/test_results_presentation.py"
-        },
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_smoketests_missing_native_library_instrumentation_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "merge": {
-          "args": [
-            "--bucket",
-            "chromium-result-details",
-            "--test-name",
-            "cronet_smoketests_platform_only_instrumentation_apk"
-          ],
-          "script": "//build/android/pylib/results/presentation/test_results_presentation.py"
-        },
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_smoketests_platform_only_instrumentation_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "merge": {
-          "args": [
-            "--bucket",
-            "chromium-result-details",
-            "--test-name",
-            "cronet_test_instrumentation_apk"
-          ],
-          "script": "//build/android/pylib/results/presentation/test_results_presentation.py"
-        },
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 1200,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ],
-          "shards": 2
-        },
-        "test": "cronet_test_instrumentation_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "merge": {
-          "args": [
-            "--bucket",
-            "chromium-result-details",
-            "--test-name",
-            "cronet_unittests"
-          ],
-          "script": "//build/android/pylib/results/presentation/test_results_presentation.py"
-        },
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_unittests"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "merge": {
-          "args": [
-            "--bucket",
-            "chromium-result-details",
-            "--test-name",
-            "net_unittests"
-          ],
-          "script": "//build/android/pylib/results/presentation/test_results_presentation.py"
-        },
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ],
-          "shards": 4
-        },
-        "test": "net_unittests"
-      }
-    ],
-    "scripts": [
-      {
-        "args": [
-          "--platform",
-          "android-cronet",
-          "--perf-id",
-          "android_cronet_armv6_builder",
-          "cronet-armv6/sizes"
-        ],
-        "name": "sizes",
-        "override_compile_targets": [
-          "cronet"
-        ],
-        "script": "sizes.py"
-      }
-    ]
-  },
   "Android Cronet Builder (dbg)": {
     "gtest_tests": [
       {
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json
index e87a82a8..bf31a7d 100644
--- a/testing/buildbot/chromium.android.json
+++ b/testing/buildbot/chromium.android.json
@@ -6,214 +6,6 @@
       "all"
     ]
   },
-  "Android Cronet ARMv6 Builder": {
-    "gtest_tests": [
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_sample_test_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_smoketests_missing_native_library_instrumentation_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_smoketests_platform_only_instrumentation_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 600,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_test_instrumentation_apk"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "hard_timeout": 300,
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ]
-        },
-        "test": "cronet_unittests"
-      },
-      {
-        "args": [
-          "--gs-results-bucket=chromium-result-details",
-          "--recover-devices"
-        ],
-        "swarming": {
-          "can_use_on_swarming_builders": true,
-          "cipd_packages": [
-            {
-              "cipd_package": "infra/tools/luci/logdog/butler/${platform}",
-              "location": "bin",
-              "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c"
-            }
-          ],
-          "dimension_sets": [
-            {
-              "device_os": "KTU84P",
-              "device_type": "hammerhead"
-            }
-          ],
-          "output_links": [
-            {
-              "link": [
-                "https://luci-logdog.appspot.com/v/?s",
-                "=android%2Fswarming%2Flogcats%2F",
-                "${TASK_ID}%2F%2B%2Funified_logcats"
-              ],
-              "name": "shard #${SHARD_INDEX} logcats"
-            }
-          ],
-          "shards": 4
-        },
-        "test": "net_unittests"
-      }
-    ]
-  },
   "Android Cronet Builder": {
     "additional_compile_targets": [
       "cronet_package"
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json
index b2a1d8d..e1032f4 100644
--- a/testing/buildbot/chromium.linux.json
+++ b/testing/buildbot/chromium.linux.json
@@ -1190,6 +1190,16 @@
     ],
     "isolated_scripts": [
       {
+        "args": [
+          "--filter=__main__.ChromeDriverTest.testLoadUrl"
+        ],
+        "isolate_name": "chromedriver_py_tests",
+        "name": "chromedriver_py_tests",
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        }
+      },
+      {
         "isolate_name": "content_shell_crash_test",
         "name": "content_shell_crash_test",
         "swarming": {
@@ -1940,6 +1950,16 @@
     ],
     "isolated_scripts": [
       {
+        "args": [
+          "--filter=__main__.ChromeDriverTest.testLoadUrl"
+        ],
+        "isolate_name": "chromedriver_py_tests",
+        "name": "chromedriver_py_tests",
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        }
+      },
+      {
         "isolate_name": "metrics_python_tests",
         "name": "metrics_python_tests",
         "swarming": {
@@ -2432,6 +2452,16 @@
     ],
     "isolated_scripts": [
       {
+        "args": [
+          "--filter=__main__.ChromeDriverTest.testLoadUrl"
+        ],
+        "isolate_name": "chromedriver_py_tests",
+        "name": "chromedriver_py_tests",
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        }
+      },
+      {
         "isolate_name": "metrics_python_tests",
         "name": "metrics_python_tests",
         "swarming": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json
index ef6d569..d299362 100644
--- a/testing/buildbot/chromium.memory.json
+++ b/testing/buildbot/chromium.memory.json
@@ -4,12 +4,20 @@
   "Linux ASan LSan Tests (1)": {
     "gtest_tests": [
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "accessibility_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 10
@@ -17,24 +25,40 @@
         "test": "angle_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "base_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "blink_heap_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "blink_platform_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 30
@@ -42,30 +66,50 @@
         "test": "browser_tests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "cacheinvalidation_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "capture_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "cast_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "cc_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 5
@@ -73,6 +117,10 @@
         "test": "components_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 4
@@ -80,6 +128,10 @@
         "test": "content_browsertests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 2
@@ -87,66 +139,110 @@
         "test": "content_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "crypto_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "device_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "display_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "extensions_browsertests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "extensions_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "gcm_unit_tests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "gfx_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "google_apis_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "gpu_ipc_service_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "gpu_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 6
@@ -154,36 +250,60 @@
         "test": "interactive_ui_tests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "ipc_tests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "jingle_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "media_blink_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "media_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "midi_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 16
@@ -191,66 +311,110 @@
         "test": "net_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "pdf_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "ppapi_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "printing_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "remoting_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "sandbox_linux_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "services_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "skia_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "sql_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "storage_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "ui_base_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 4
@@ -258,18 +422,30 @@
         "test": "unit_tests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "url_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
         "test": "viz_unittests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 5
@@ -277,6 +453,10 @@
         "test": "webkit_unit_tests"
       },
       {
+        "args": [
+          "--test-launcher-batch-limit=1",
+          "--test-launcher-print-test-stdio=always"
+        ],
         "swarming": {
           "can_use_on_swarming_builders": true
         },
diff --git a/testing/buildbot/chromium.sandbox.json b/testing/buildbot/chromium.sandbox.json
index 91a5863..2699882 100644
--- a/testing/buildbot/chromium.sandbox.json
+++ b/testing/buildbot/chromium.sandbox.json
@@ -576,6 +576,16 @@
     ],
     "isolated_scripts": [
       {
+        "args": [
+          "--filter=__main__.ChromeDriverTest.testLoadUrl"
+        ],
+        "isolate_name": "chromedriver_py_tests",
+        "name": "chromedriver_py_tests",
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        }
+      },
+      {
         "isolate_name": "content_shell_crash_test",
         "name": "content_shell_crash_test",
         "swarming": {
diff --git a/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter b/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter
index d161f43..6b57151 100644
--- a/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter
+++ b/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter
@@ -37,6 +37,7 @@
 -SitePerProcessBrowserTest.HiddenOOPIFWillNotGenerateCompositorFramesAfterNavigation
 
 # Further WaitForChildFrameSurfaceReady doesn't work http://crbug.com/787945
+-SitePerProcessBrowserTest.AsynchronousHitTestChildTimeout
 -SitePerProcessBrowserTest.CancelWheelScrollBubblingOnWheelTargetDeletion
 -SitePerProcessBrowserTest.CreateContextMenuTest
 -SitePerProcessBrowserTest.CrossProcessMouseCapture
@@ -46,6 +47,7 @@
 -SitePerProcessBrowserTest.InputEventRouterGesturePreventDefaultTargetMapTest
 -SitePerProcessBrowserTest.InputEventRouterGestureTargetMapTest
 -SitePerProcessBrowserTest.InputEventRouterTouchpadGestureTargetTest
+-SitePerProcessBrowserTest.InputEventRouterWheelCoalesceTest
 -SitePerProcessBrowserTest.HitTestLayerSquashing
 -SitePerProcessBrowserTest.HitTestNestedFrames
 -SitePerProcessBrowserTest.HitTestWatermark
diff --git a/testing/buildbot/filters/viz.browser_tests.filter b/testing/buildbot/filters/viz.browser_tests.filter
index a9e12db..b924816 100644
--- a/testing/buildbot/filters/viz.browser_tests.filter
+++ b/testing/buildbot/filters/viz.browser_tests.filter
@@ -5,6 +5,8 @@
 -AppWindowApiTest.OnBoundsChangedEvent
 -ForceMaximizeOnFirstRunTest.*TwoRuns
 -ForceMaximizePolicyFalseTest.GeneralFirstRun
+-SafeBrowsingTriggeredPopupBlockerBrowserTest.NoFeature_AllowCreatingNewWindows
+-SafeBrowsingTriggeredPopupBlockerBrowserTest.NoFeature_NoMessages
 -ShelfAppBrowserTest.LaunchAppFromDisplayWithoutFocus0
 -ShelfAppBrowserTest.LaunchAppFromDisplayWithoutFocus1
 
@@ -18,12 +20,18 @@
 # Tab Capture is still in development: crbug.com/754864
 -CastStreamingApiTestWithPixelOutput.EndToEnd
 -ChromeScreenshotGrabberBrowserTest.TakeScreenshot
+-PluginPowerSaverBrowserTest.PosterTests
+-PluginPowerSaverBrowserTest.SmallCrossOrigin
+-PluginPowerSaverBrowserTest.SmallerThanPlayIcon
 -TabCaptureApiPixelTest.EndToEndThroughWebRTC
 -TabCaptureApiPixelTest.EndToEndWithoutRemoting
 -TabCaptureApiPixelTest.OffscreenTabEndToEnd
 -TabCaptureApiPixelTest.OffscreenTabEvilTests
+-ThumbnailTest.ShouldCaptureOnNavigatingAwayExplicitWait
+-ThumbnailTest.ShouldCaptureOnNavigatingAwaySlowPageLoad
 
 # WaitForChildFrameSurfaceReady crashes crbug.com/787945
+-PDFExtensionTest.ContextMenuCoordinates
 -WebViewTests/WebViewTest.InterstitialPageFocusedWidget/1
 -WebViewTests/WebViewTest.ReloadAfterCrash/1
 
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py
index 5b85c47d..75b26db 100755
--- a/testing/buildbot/generate_buildbot_json.py
+++ b/testing/buildbot/generate_buildbot_json.py
@@ -317,6 +317,12 @@
         a[key] = b[key]
     return a
 
+  def initialize_args_for_test(self, generated_test, tester_config):
+    if 'args' in tester_config:
+      if 'args' not in generated_test:
+        generated_test['args'] = []
+      generated_test['args'].extend(tester_config['args'])
+
   def initialize_swarming_dictionary_for_test(self, generated_test,
                                               tester_config):
     if 'swarming' not in generated_test:
@@ -381,6 +387,7 @@
     else:
       result['test'] = test_name
     self.initialize_swarming_dictionary_for_test(result, tester_config)
+    self.initialize_args_for_test(result, tester_config)
     if self.is_android(tester_config) and tester_config.get('use_swarming',
                                                             True):
       if 'args' not in result:
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py
index 4e84db6..5caec02 100755
--- a/testing/buildbot/generate_buildbot_json_unittest.py
+++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -63,6 +63,24 @@
 ]
 """
 
+COMPOSITION_GTEST_SUITE_WITH_ARGS_WATERFALL = """\
+[
+  {
+    'name': 'chromium.test',
+    'machines': {
+      'Fake Tester': {
+        'test_suites': {
+          'gtest_tests': 'composition_tests',
+        },
+        'args': [
+          '--this-is-an-argument',
+        ],
+      },
+    },
+  },
+]
+"""
+
 FOO_ISOLATED_SCRIPTS_WATERFALL = """\
 [
   {
@@ -477,6 +495,35 @@
 }
 """
 
+COMPOSITION_WATERFALL_WITH_ARGS_OUTPUT = """\
+{
+  "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
+  "AAAAA2 See generate_buildbot_json.py to make changes": {},
+  "Fake Tester": {
+    "gtest_tests": [
+      {
+        "args": [
+          "--this-is-an-argument"
+        ],
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        },
+        "test": "bar_test"
+      },
+      {
+        "args": [
+          "--this-is-an-argument"
+        ],
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        },
+        "test": "foo_test"
+      }
+    ]
+  }
+}
+"""
+
 VARIATION_GTEST_OUTPUT = """\
 {
   "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
@@ -979,6 +1026,13 @@
     with self.assertRaises(generate_buildbot_json.BBGenErr):
       fbb.check_output_file_consistency(verbose=True)
 
+  def test_waterfall_args(self):
+    fbb = FakeBBGen(COMPOSITION_GTEST_SUITE_WITH_ARGS_WATERFALL,
+                    GOOD_COMPOSITION_TEST_SUITES,
+                    EMPTY_EXCEPTIONS)
+    fbb.files['chromium.test.json'] = COMPOSITION_WATERFALL_WITH_ARGS_OUTPUT
+    fbb.check_output_file_consistency(verbose=True)
+
 
 if __name__ == '__main__':
   unittest.main()
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl
index 7509ea5..0d8c1ed 100644
--- a/testing/buildbot/gn_isolate_map.pyl
+++ b/testing/buildbot/gn_isolate_map.pyl
@@ -311,6 +311,16 @@
     "label": "//chrome/test/chromedriver:chromedriver",
     "type": "additional_compile_target",
   },
+  "chromedriver_py_tests": {
+    "label": "//chrome/test/chromedriver:chromedriver_py_tests",
+    "type": "script",
+    "script": "//testing/xvfb.py",
+    "args": [
+      "../../chrome/test/chromedriver/test/run_py_tests.py",
+      "--chromedriver=chromedriver",
+      "--log-path=${ISOLATED_OUTDIR}/chromedriver.log",
+    ],
+  },
   "chromedriver_unittests": {
     "label": "//chrome/test/chromedriver:chromedriver_unittests",
     "type": "windowed_test_launcher",
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl
index 4ed806b..963af63 100644
--- a/testing/buildbot/test_suite_exceptions.pyl
+++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -1376,12 +1376,6 @@
   },
   'cronet_test_instrumentation_apk': {
     'modifications': {
-      'Android Cronet ARMv6 Builder chromium.android.fyi': {
-        'swarming': {
-          'hard_timeout': 1200,
-          'shards': 2,
-        },
-      },
       'Android Cronet Builder (dbg) chromium.android.fyi': {
         'swarming': {
           'hard_timeout': 1200,
@@ -3154,18 +3148,6 @@
         ],
       },
       # chromium.android.fyi
-      'Android Cronet ARMv6 Builder': {
-        'args': [
-          '--platform',
-          'android-cronet',
-          '--perf-id',
-          'android_cronet_armv6_builder',
-          'cronet-armv6/sizes',
-        ],
-        'override_compile_targets': [
-          'cronet',
-        ],
-      },
       'Android Cronet KitKat Builder': {
         'args': [
           '--platform',
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl
index 702bdd8d..3a460f8b 100644
--- a/testing/buildbot/test_suites.pyl
+++ b/testing/buildbot/test_suites.pyl
@@ -327,6 +327,18 @@
     },
   },
 
+  'chromedriver_py_tests_isolated_scripts': {
+    'chromedriver_py_tests': {
+      "args": [
+        # TODO(johnchen@chromium.org): As the initial step of adding
+        # ChromeDriver tests to commit queue, the following filter is used to
+        # enable a single test case as a smoke test. Many more test cases will
+        # be enabled in the future.
+        "--filter=__main__.ChromeDriverTest.testLoadUrl",
+      ],
+    },
+  },
+
   'chromium_android_asan_gtests': {
     # TODO(kbr): reduce duplication among these tests, and with other
     # test suites.
@@ -1940,6 +1952,7 @@
   ],
 
   'chromium_linux_isolated_scripts': [
+    'chromedriver_py_tests_isolated_scripts',
     'desktop_chromium_isolated_scripts',
     'linux_specific_chromium_isolated_scripts',
     'telemetry_perf_unittests_isolated_scripts',
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl
index f42e689..28e8f02 100644
--- a/testing/buildbot/waterfalls.pyl
+++ b/testing/buildbot/waterfalls.pyl
@@ -91,21 +91,6 @@
           'cast_shell_apk',
         ],
       },
-      'Android Cronet ARMv6 Builder': {
-        'test_suites': {
-          'gtest_tests': 'cronet_gtests',
-        },
-        'swarming': {
-          'dimension_sets': [
-            {
-              'device_os': 'KTU84P',
-              'device_type': 'hammerhead',
-            },
-          ],
-        },
-        'os_type': 'android',
-        'skip_merge_script': True,
-      },
       'Android Cronet Builder (dbg)': {
         'test_suites': {
           'gtest_tests': 'cronet_gtests',
@@ -327,21 +312,6 @@
   {
     'name': 'chromium.android.fyi',
     'machines': {
-      'Android Cronet ARMv6 Builder': {
-        'test_suites': {
-          'gtest_tests': 'cronet_gtests',
-          'scripts': 'cronet_scripts',
-        },
-        'swarming': {
-          'dimension_sets': [
-            {
-              'device_os': 'KTU84P',
-              'device_type': 'hammerhead',
-            },
-          ],
-        },
-        'os_type': 'android',
-      },
       'Android Cronet Builder (dbg)': {
         'test_suites': {
           'gtest_tests': 'cronet_gtests',
@@ -1598,6 +1568,10 @@
         'test_suites': {
           'gtest_tests': 'chromium_memory_linux_asan_gtests',
         },
+        'args': [
+          '--test-launcher-batch-limit=1',
+          '--test-launcher-print-test-stdio=always',
+        ],
       },
       'Linux ASan Tests (sandboxed)': {
         'test_suites': {
diff --git a/testing/test.gni b/testing/test.gni
index bfcc437..51ca300f 100644
--- a/testing/test.gni
+++ b/testing/test.gni
@@ -14,6 +14,7 @@
 
 if (is_fuchsia) {
   import("//build/config/fuchsia/rules.gni")
+  import("//build/config/fuchsia/package.gni")
 }
 
 # Define a test as an executable (or apk on Android) with the "testonly" flag
@@ -226,29 +227,43 @@
     }
   } else if (is_fuchsia) {
     _output_name = invoker.target_name
-    _test_runner_target = "${_output_name}__test_runner_script"
+    _pkg_target = "${_output_name}_pkg"
+    _gen_runner_target = "${_output_name}_runner"
+    _exec_target = "${_output_name}__exec"
 
-    test_runner_script(_test_runner_target) {
-      forward_variables_from(invoker,
-                             [
-                               "data",
-                               "data_deps",
-                               "deps",
-                               "public_deps",
-                               "use_test_server",
-                             ])
-      test_name = _output_name
+    group(target_name) {
+      testonly = true
+      data_deps = [
+        ":$_gen_runner_target",
+      ]
     }
 
-    executable(target_name) {
+    # Makes the script which invokes the executable.
+    test_runner_script(_gen_runner_target) {
+      forward_variables_from(invoker, [ "use_test_server" ])
+      data_deps = [
+        ":$_exec_target",
+        ":$_pkg_target",
+      ]
+      test_name = _output_name
+      exe_path = "$root_out_dir/" + get_label_info(_exec_target, "name")
+    }
+
+    executable(_exec_target) {
       testonly = true
       forward_variables_from(invoker, "*")
-      if (!defined(data_deps)) {
-        data_deps = []
-      }
-      data_deps += [ ":$_test_runner_target" ]
+      output_name = _exec_target
       deps += [ "//build/config:exe_and_shlib_deps" ]
     }
+
+    package(_pkg_target) {
+      testonly = true
+      package_name = _output_name
+      binary = get_label_info(_exec_target, "name")
+      data_deps = [
+        ":$_exec_target",
+      ]
+    }
   } else if (is_ios) {
     import("//build/config/ios/ios_sdk.gni")
     import("//build/config/ios/rules.gni")
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
index adbc2a5..88ea2566 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -58,13 +58,14 @@
 # New failures are appended below by the script.
 crbug.com/714962 accessibility/adjacent-continuations-cause-assertion-failure.html [ Failure ]
 crbug.com/591099 accessibility/anchor-linked-anonymous-block-crash.html [ Crash ]
-crbug.com/591099 accessibility/aom-decrement-action.html [ Crash ]
-crbug.com/591099 accessibility/aom-increment-action.html [ Crash ]
+crbug.com/591099 accessibility/aom-decrement-action.html [ Crash Pass ]
+crbug.com/591099 accessibility/aom-increment-action.html [ Crash Pass ]
 crbug.com/591099 accessibility/aom-relation-list-properties.html [ Failure ]
+crbug.com/591099 accessibility/appearance-affects-role.html [ Crash Pass ]
 crbug.com/591099 accessibility/aria-activedescendant.html [ Failure ]
 crbug.com/591099 accessibility/aria-describedby-on-input.html [ Failure ]
 crbug.com/591099 accessibility/aria-disabled.html [ Failure ]
-crbug.com/591099 accessibility/aria-hidden-hides-all-elements.html [ Crash ]
+crbug.com/591099 accessibility/aria-hidden-hides-all-elements.html [ Crash Pass ]
 crbug.com/591099 accessibility/aria-labelledby-on-input.html [ Failure ]
 crbug.com/591099 accessibility/aria-labelledby-stay-within.html [ Failure ]
 crbug.com/591099 accessibility/aria-modal.html [ Crash ]
@@ -76,19 +77,18 @@
 crbug.com/714962 accessibility/bounds-calc.html [ Failure ]
 crbug.com/591099 accessibility/canvas-accessibilitynodeobject.html [ Failure ]
 crbug.com/591099 accessibility/canvas-fallback-content-2.html [ Crash Timeout ]
-crbug.com/591099 accessibility/canvas-fallback-content-labels.html [ Crash ]
+crbug.com/591099 accessibility/canvas-fallback-content-labels.html [ Crash Pass ]
 crbug.com/591099 accessibility/canvas-fallback-content.html [ Failure ]
 crbug.com/591099 accessibility/clickable.html [ Crash ]
 crbug.com/591099 accessibility/color-well.html [ Failure ]
 crbug.com/591099 accessibility/computed-name.html [ Crash ]
 crbug.com/591099 accessibility/computed-role.html [ Crash ]
-crbug.com/591099 accessibility/corresponding-control-deleted-crash.html [ Crash ]
+crbug.com/591099 accessibility/corresponding-control-deleted-crash.html [ Crash Pass ]
 crbug.com/714962 accessibility/css-first-letter-children.html [ Failure ]
 crbug.com/591099 accessibility/css-generated-content.html [ Failure ]
 crbug.com/591099 accessibility/css-styles.html [ Failure ]
 crbug.com/591099 accessibility/description-calc-summary.html [ Crash ]
-crbug.com/714962 accessibility/dimensions-include-descendants.html [ Failure Pass ]
-crbug.com/591099 accessibility/disabled-controls-not-focusable.html [ Crash ]
+crbug.com/591099 accessibility/disabled-controls-not-focusable.html [ Crash Pass ]
 crbug.com/591099 accessibility/disabled-controls.html [ Crash Failure ]
 crbug.com/714962 accessibility/div-within-anchors-causes-crash.html [ Failure ]
 crbug.com/714962 accessibility/dl-role.html [ Failure ]
@@ -109,8 +109,8 @@
 crbug.com/591099 accessibility/inline-text-input.html [ Failure ]
 crbug.com/591099 accessibility/inline-text-word-boundaries.html [ Failure ]
 crbug.com/591099 accessibility/input-type-range-aria-value.html [ Crash Failure ]
-crbug.com/591099 accessibility/input-type-range-value-change-event.html [ Crash ]
-crbug.com/591099 accessibility/input-type-range-value-change.html [ Crash ]
+crbug.com/591099 accessibility/input-type-range-value-change-event.html [ Crash Pass ]
+crbug.com/591099 accessibility/input-type-range-value-change.html [ Crash Pass ]
 crbug.com/714962 accessibility/label-for-control-hittest.html [ Failure ]
 crbug.com/714962 accessibility/legend.html [ Failure ]
 crbug.com/591099 accessibility/listitem-presentation-inherited.html [ Failure ]
@@ -126,7 +126,7 @@
 crbug.com/591099 accessibility/scroll-div-horiz-sends-notification.html [ Failure ]
 crbug.com/714962 accessibility/selection-events.html [ Failure ]
 crbug.com/714962 accessibility/set-selection-link.html [ Failure ]
-crbug.com/591099 accessibility/slider-thumb-bounds.html [ Crash ]
+crbug.com/591099 accessibility/slider-thumb-bounds.html [ Crash Pass ]
 crbug.com/591099 accessibility/table-cells.html [ Failure ]
 crbug.com/714962 accessibility/table-detection.html [ Failure ]
 crbug.com/591099 accessibility/table-header-column-row.html [ Failure ]
@@ -204,17 +204,11 @@
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-inner.html [ Failure ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-outer.html [ Failure ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-2-overflow-div.html [ Failure ]
-crbug.com/591099 compositing/gestures/gesture-tapHighlight-img-and-text-2.html [ Failure Pass ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-img-and-text.html [ Failure ]
-crbug.com/714962 compositing/gestures/gesture-tapHighlight-img.html [ Failure Pass ]
-crbug.com/714962 compositing/gestures/gesture-tapHighlight-invisible-inline-squashing.html [ Failure Pass ]
-crbug.com/714962 compositing/gestures/gesture-tapHighlight-invisible-inline.html [ Failure Pass ]
-crbug.com/714962 compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled.html [ Crash Failure ]
+crbug.com/714962 compositing/gestures/gesture-tapHighlight-on-promoted-overflow-div-scrolled.html [ Failure ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-pixel-rotated-link.html [ Failure ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-pixel-transparent.html [ Failure ]
-crbug.com/714962 compositing/gestures/gesture-tapHighlight-shadow-tree.html [ Failure Pass ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-simple-multi-line.html [ Pass ]
-crbug.com/714962 compositing/gestures/gesture-tapHighlight-simple-scaled-document.html [ Failure Pass ]
 crbug.com/591099 compositing/gestures/gesture-tapHighlight-simple-scaledX.html [ Failure ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-simple-scaledY.html [ Failure ]
 crbug.com/714962 compositing/gestures/gesture-tapHighlight-simple-window-scroll.html [ Failure ]
@@ -268,7 +262,7 @@
 crbug.com/591099 compositing/overflow/siblings-with-border-radius-ancestor.html [ Failure ]
 crbug.com/591099 compositing/overflow/textarea-scroll-touch.html [ Failure ]
 crbug.com/591099 compositing/overflow/universal-accelerated-overflow-scroll.html [ Pass Timeout ]
-crbug.com/591099 compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers.html [ Crash Failure ]
+crbug.com/591099 compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers.html [ Failure ]
 crbug.com/591099 compositing/reflections/compositing-change-inside-reflection.html [ Failure ]
 crbug.com/591099 compositing/reflections/nested-reflection-mask-change.html [ Failure ]
 crbug.com/591099 compositing/reflections/nested-reflection-transformed.html [ Failure ]
@@ -298,7 +292,7 @@
 crbug.com/591099 compositing/squashing/vertical-writing-mode-squashed.html [ Failure ]
 crbug.com/591099 compositing/text-on-large-layer.html [ Failure ]
 crbug.com/714962 compositing/transitions/transform-on-large-layer.html [ Failure ]
-crbug.com/591099 compositing/video/video-controls-layer-creation.html [ Failure ]
+crbug.com/591099 compositing/video/video-controls-layer-creation.html [ Failure Pass ]
 crbug.com/591099 compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list.html [ Crash ]
 crbug.com/591099 crypto/subtle/hkdf/cloneKey.html [ Timeout ]
 crbug.com/591099 crypto/subtle/hmac/cloneKey.html [ Timeout ]
@@ -724,7 +718,6 @@
 crbug.com/714962 css3/filters/effect-reference-image-lazy-attach.html [ Failure Pass ]
 crbug.com/714962 css3/filters/effect-reference-image.html [ Failure Pass ]
 crbug.com/714962 css3/filters/effect-reference-on-transparent-element.html [ Failure Pass ]
-crbug.com/714962 css3/filters/effect-reference-tile.html [ Crash ]
 crbug.com/714962 css3/filters/effect-reference-zoom-hw.html [ Failure ]
 crbug.com/591099 css3/filters/effect-saturate-hw.html [ Failure ]
 crbug.com/591099 css3/filters/effect-saturate.html [ Failure ]
@@ -746,7 +739,7 @@
 crbug.com/591099 css3/flexbox/flex-item-contains-strict.html [ Failure ]
 crbug.com/591099 css3/flexbox/flexbox-baseline-margins.html [ Failure ]
 crbug.com/591099 css3/flexbox/flexbox-baseline.html [ Failure ]
-crbug.com/591099 css3/flexbox/flexitem-stretch-range.html [ Crash ]
+crbug.com/591099 css3/flexbox/flexitem-stretch-range.html [ Crash Pass ]
 crbug.com/591099 css3/flexbox/floated-flexbox.html [ Failure ]
 crbug.com/591099 css3/flexbox/intrinsic-width-orthogonal-writing-mode.html [ Failure ]
 crbug.com/591099 css3/flexbox/line-wrapping.html [ Failure ]
@@ -988,8 +981,6 @@
 crbug.com/591099 css3/selectors3/xml/css3-modsel-80.xml [ Failure ]
 crbug.com/591099 css3/selectors3/xml/css3-modsel-9.xml [ Failure ]
 crbug.com/591099 css3/selectors3/xml/css3-modsel-95.xml [ Failure ]
-crbug.com/714962 css3/tab-size-complex-path.html [ Failure Pass ]
-crbug.com/714962 css3/tab-size.html [ Failure Pass ]
 crbug.com/591099 editing/assert_selection.html [ Failure ]
 crbug.com/591099 editing/caret/caret-color-003.html [ Failure ]
 crbug.com/591099 editing/caret/caret-color-004.html [ Failure ]
@@ -997,7 +988,7 @@
 crbug.com/591099 editing/caret/caret-color-014.html [ Failure ]
 crbug.com/591099 editing/caret/caret-color-015.html [ Failure ]
 crbug.com/591099 editing/caret/caret-color.html [ Failure ]
-crbug.com/591099 editing/caret/caret-in-empty-cell.html [ Failure ]
+crbug.com/591099 editing/caret/caret-in-empty-cell.html [ Failure Pass ]
 crbug.com/591099 editing/caret/caret-position.html [ Failure ]
 crbug.com/714962 editing/caret/in-multicol-child.html [ Failure ]
 crbug.com/714962 editing/deleting/4916235-1.html [ Failure ]
@@ -1005,13 +996,13 @@
 crbug.com/591099 editing/deleting/5099303.html [ Failure ]
 crbug.com/591099 editing/deleting/5126166.html [ Failure ]
 crbug.com/591099 editing/deleting/5206311-1.html [ Failure ]
-crbug.com/591099 editing/deleting/5206311-2.html [ Failure ]
+crbug.com/591099 editing/deleting/5206311-2.html [ Failure Pass ]
 crbug.com/591099 editing/deleting/5272440.html [ Failure ]
 crbug.com/591099 editing/deleting/5369009.html [ Failure ]
-crbug.com/591099 editing/deleting/5433862-1.html [ Failure ]
+crbug.com/591099 editing/deleting/5433862-1.html [ Failure Pass ]
 crbug.com/591099 editing/deleting/5433862-2.html [ Failure ]
 crbug.com/591099 editing/deleting/5483370.html [ Failure ]
-crbug.com/714962 editing/deleting/delete-across-editable-content-boundaries-2.html [ Crash ]
+crbug.com/714962 editing/deleting/delete-across-editable-content-boundaries-2.html [ Crash Pass ]
 crbug.com/591099 editing/deleting/delete-at-paragraph-boundaries-011.html [ Failure ]
 crbug.com/591099 editing/deleting/delete-br-013.html [ Failure ]
 crbug.com/591099 editing/deleting/delete-empty-table.html [ Failure ]
@@ -1033,7 +1024,7 @@
 crbug.com/591099 editing/execCommand/5142012-1.html [ Failure ]
 crbug.com/591099 editing/execCommand/5190926.html [ Failure ]
 crbug.com/591099 editing/execCommand/5569741.html [ Failure ]
-crbug.com/714962 editing/execCommand/button.html [ Failure ]
+crbug.com/714962 editing/execCommand/button.html [ Failure Pass ]
 crbug.com/591099 editing/execCommand/findString-2.html [ Failure ]
 crbug.com/591099 editing/execCommand/findString.html [ Failure ]
 crbug.com/591099 editing/execCommand/format-block-from-range-selection.html [ Failure ]
@@ -1129,7 +1120,7 @@
 crbug.com/591099 editing/pasteboard/paste-line-endings-005.html [ Failure ]
 crbug.com/591099 editing/pasteboard/paste-noscript.html [ Failure ]
 crbug.com/591099 editing/pasteboard/paste-pre-001.html [ Failure ]
-crbug.com/714962 editing/pasteboard/paste-table-001.html [ Failure ]
+crbug.com/714962 editing/pasteboard/paste-table-001.html [ Failure Pass ]
 crbug.com/591099 editing/pasteboard/paste-text-016.html [ Failure ]
 crbug.com/591099 editing/pasteboard/paste-text-at-tabspan-003.html [ Failure ]
 crbug.com/591099 editing/pasteboard/pasting-tabs.html [ Failure ]
@@ -1148,7 +1139,7 @@
 crbug.com/591099 editing/selection/5232159.html [ Failure ]
 crbug.com/591099 editing/selection/5354455-2.html [ Failure ]
 crbug.com/591099 editing/selection/6476.html [ Failure ]
-crbug.com/714962 editing/selection/anchor-focus1.html [ Failure ]
+crbug.com/714962 editing/selection/anchor-focus1.html [ Failure Pass ]
 crbug.com/714962 editing/selection/anchor-focus2.html [ Failure ]
 crbug.com/714962 editing/selection/anchor-focus3.html [ Failure ]
 crbug.com/714962 editing/selection/android-longtap-not-select-empty.html [ Failure ]
@@ -1198,8 +1189,7 @@
 crbug.com/591099 editing/selection/extend-selection-character.html [ Timeout ]
 crbug.com/591099 editing/selection/extend-selection-home-end.html [ Timeout ]
 crbug.com/591099 editing/selection/extend-selection-word.html [ Pass Timeout ]
-crbug.com/714962 editing/selection/extend-to-line-boundary.html [ Failure Pass ]
-crbug.com/714962 editing/selection/focus-and-display-none.html [ Failure ]
+crbug.com/714962 editing/selection/focus-and-display-none.html [ Failure Pass ]
 crbug.com/591099 editing/selection/focus-body.html [ Failure ]
 crbug.com/591099 editing/selection/home-end.html [ Timeout ]
 crbug.com/591099 editing/selection/inactive-selection.html [ Failure ]
@@ -1218,22 +1208,22 @@
 crbug.com/591099 editing/selection/mixed-editability-7.html [ Failure ]
 crbug.com/591099 editing/selection/mixed-editability-8.html [ Failure ]
 crbug.com/591099 editing/selection/mixed-editability-9.html [ Failure ]
-crbug.com/714962 editing/selection/modify_extend/extend_backward_line_table_button.html [ Failure ]
+crbug.com/714962 editing/selection/modify_extend/extend_backward_line_table_button.html [ Failure Pass ]
 crbug.com/591099 editing/selection/modify_extend/extend_by_character.html [ Failure ]
 crbug.com/714962 editing/selection/modify_extend/extend_forward_line_crash.html [ Failure ]
 crbug.com/714962 editing/selection/modify_move/move-by-paragraph.html [ Failure ]
 crbug.com/714962 editing/selection/modify_move/move-forward-after-line-break.html [ Failure ]
 crbug.com/591099 editing/selection/modify_move/move_by_sentence_boundary.html [ Failure ]
 crbug.com/714962 editing/selection/modify_move/move_by_word_with_underscore.html [ Failure ]
-crbug.com/714962 editing/selection/modify_move/move_forward_line_mixed_editability.html [ Failure ]
+crbug.com/714962 editing/selection/modify_move/move_forward_line_mixed_editability.html [ Failure Pass ]
 crbug.com/591099 editing/selection/mouse/click-left-of-rtl-wrapping-text.html [ Failure ]
 crbug.com/591099 editing/selection/mouse/click-user-select-all-textarea.html [ Failure ]
-crbug.com/591099 editing/selection/mouse/double_click_after_last_cell.html [ Failure ]
-crbug.com/591099 editing/selection/mouse/drag_focus_node.html [ Failure ]
-crbug.com/591099 editing/selection/mouse/drags_within_user-select_combos.html [ Failure ]
+crbug.com/591099 editing/selection/mouse/double_click_after_last_cell.html [ Failure Pass ]
+crbug.com/591099 editing/selection/mouse/drag_focus_node.html [ Failure Pass ]
+crbug.com/591099 editing/selection/mouse/drags_within_user-select_combos.html [ Failure Pass ]
 crbug.com/591099 editing/selection/mouse/extend_by_word_with_base_is_end.html [ Failure ]
-crbug.com/714962 editing/selection/mouse/mouse_up_focus.html [ Timeout ]
-crbug.com/714962 editing/selection/mouse/overidden_user_select_in_dom_tree.html [ Failure ]
+crbug.com/714962 editing/selection/mouse/mouse_up_focus.html [ Pass Timeout ]
+crbug.com/714962 editing/selection/mouse/overidden_user_select_in_dom_tree.html [ Failure Pass ]
 crbug.com/591099 editing/selection/mouse/overriden_user_select_in_shadow_tree.html [ Failure ]
 crbug.com/714962 editing/selection/mouse/user-drag-element-and-user-select-none.html [ Failure ]
 crbug.com/591099 editing/selection/move-3875618-fix.html [ Failure ]
@@ -1285,7 +1275,7 @@
 crbug.com/591099 editing/selection/shift-click.html [ Failure ]
 crbug.com/714962 editing/selection/skip-over-contenteditable.html [ Failure ]
 crbug.com/591099 editing/selection/subpixel-positioned-selection.html [ Failure ]
-crbug.com/714962 editing/selection/table-lineboundary.html [ Failure ]
+crbug.com/714962 editing/selection/table-lineboundary.html [ Failure Pass ]
 crbug.com/591099 editing/selection/transformed-selection-rects.html [ Failure ]
 crbug.com/591099 editing/selection/triple-click-in-pre.html [ Failure ]
 crbug.com/591099 editing/selection/user-select/user-select-all.html [ Failure ]
@@ -1302,7 +1292,7 @@
 crbug.com/591099 editing/style/highlight.html [ Failure ]
 crbug.com/591099 editing/style/remove-underline-across-paragraph-in-bold.html [ Failure ]
 crbug.com/591099 editing/style/remove-underline-across-paragraph.html [ Failure ]
-crbug.com/591099 editing/style/table-selection.html [ Failure ]
+crbug.com/591099 editing/style/table-selection.html [ Failure Pass ]
 crbug.com/591099 editing/text-iterator/findString-start-search-after-selection.html [ Failure ]
 crbug.com/591099 editing/text-iterator/findString.html [ Timeout ]
 crbug.com/591099 editing/undo/crash-redo-with-iframes.html [ Failure ]
@@ -1331,7 +1321,7 @@
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_ECDH.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_ECDSA.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_HMAC.worker.html [ Timeout ]
-crbug.com/714962 external/wpt/WebCryptoAPI/generateKey/failures_RSA-OAEP.https.worker.html [ Pass Timeout ]
+crbug.com/714962 external/wpt/WebCryptoAPI/generateKey/failures_RSA-OAEP.https.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSA-OAEP.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.html [ Timeout ]
@@ -1363,7 +1353,7 @@
 crbug.com/714962 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-image-5.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-image-003.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-image-004.html [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-backgrounds/background-image-005.html [ Failure ]
+crbug.com/714962 external/wpt/css/css-backgrounds/background-image-005.html [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-image-006.html [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-display/display-contents-dynamic-before-after-001.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-display/display-contents-dynamic-before-after-first-letter-001.html [ Failure ]
@@ -1650,11 +1640,11 @@
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-017.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-018.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-019.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-style-attr/style-attr-urls-001.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-style-attr/style-attr-urls-001.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-style-attr/style-attr-urls-002.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-tables/height-distribution/percentage-sizing-of-table-cell-children.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-tables/html5-table-formatting-fixed-layout-1.html [ Crash ]
-crbug.com/591099 external/wpt/css/css-tables/table-model-fixup-2.html [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-tables/table-model-fixup-2.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-tables/visibility-collapse-rowcol-001.html [ Crash ]
 crbug.com/591099 external/wpt/css/css-tables/visibility-collapse-rowspan-crash.html [ Crash ]
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-color-001.xht [ Failure ]
@@ -1693,7 +1683,7 @@
 crbug.com/714962 external/wpt/css/css-transforms/transform-abspos-006.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-transforms/transform-abspos-007.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-transforms/transform-generated-001.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-transforms/transform-input-015.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-transforms/transform-input-015.html [ Crash Pass ]
 crbug.com/714962 external/wpt/css/css-transforms/transform-origin-006.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-transforms/transform3d-perspective-008.html [ Pass ]
 crbug.com/591099 external/wpt/css/css-ui/box-sizing-007.html [ Failure ]
@@ -1720,78 +1710,78 @@
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-018.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-020.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-030.xht [ Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-003.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-003.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-005.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-007.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-009.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-011.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-013.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-015.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-015.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-017.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-019.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-021.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-021.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-023.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-025.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-027.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-029.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-025.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-027.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-029.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-031.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-033.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-033.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-035.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-037.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-037.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-039.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-041.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-043.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-045.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-045.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-047.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-049.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-051.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-053.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-055.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-057.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-057.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-059.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-061.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-061.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-063.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-069.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-071.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-073.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-075.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-073.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-075.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-077.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-079.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-081.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-083.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-081.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-083.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-085.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-087.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-089.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-091.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-093.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-097.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-103.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-103.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-105.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-107.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-109.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-111.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-113.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-115.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-117.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-117.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-119.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-121.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-123.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-125.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-123.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-125.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-127.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-129.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-129.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-131.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-133.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-135.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-135.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-137.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-139.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-141.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-143.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-145.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-147.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-149.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-147.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-149.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-151.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-153.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-155.xht [ Failure Pass ]
@@ -1799,38 +1789,38 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-159.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-161.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-163.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-165.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-165.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-169.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-171.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-171.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-173.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-175.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-177.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-179.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-181.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-181.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-183.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-185.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-187.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-189.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-191.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-193.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-195.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-197.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-193.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-195.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-197.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-199.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-201.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-203.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-205.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-205.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-207.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-211.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-213.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-215.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-215.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-217.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-219.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-221.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-223.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-227.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-227.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-002.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-004.xht [ Failure Pass ]
@@ -1839,7 +1829,7 @@
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-010.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-012.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-014.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-016.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-016.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-018.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-020.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-022.xht [ Failure ]
@@ -1848,25 +1838,25 @@
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-028.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-030.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-032.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-034.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-034.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-036.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-038.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-040.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-042.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-044.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-046.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-046.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-048.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-050.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-052.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-052.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-054.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-056.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-058.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-058.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-060.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-062.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-062.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-064.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-066.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-068.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-070.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-070.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-072.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-074.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-076.xht [ Failure Pass ]
@@ -1875,13 +1865,13 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-082.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-084.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-086.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-090.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-092.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-094.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-096.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-102.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-104.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-104.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-106.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-108.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-110.xht [ Failure ]
@@ -1893,19 +1883,19 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-122.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-124.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-126.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-128.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-128.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-130.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-132.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-134.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-136.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-138.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-140.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-140.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-142.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-144.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-146.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-148.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-150.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-152.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-152.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-154.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-156.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-158.xht [ Failure ]
@@ -1916,7 +1906,7 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-168.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-170.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-172.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-174.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-174.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-176.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-178.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-180.xht [ Failure Pass ]
@@ -1927,13 +1917,13 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-190.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-192.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-194.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-196.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-196.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-198.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-200.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-202.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-204.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-206.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-208.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-208.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-210.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-212.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-214.xht [ Failure ]
@@ -1992,21 +1982,13 @@
 crbug.com/591099 external/wpt/css/css-writing-modes/ortho-htb-alongside-vrl-floats-002.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/ortho-htb-alongside-vrl-floats-010.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001a.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001b.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001c.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001d.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001e.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001f.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001g.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001h.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001i.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001j.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001k.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001l.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001m.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001n.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001o.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001p.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001q.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001r.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/orthogonal-parent-shrink-to-fit-001s.html [ Failure ]
@@ -2048,7 +2030,7 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-005.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-007.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-009.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/text-align-vlr-011.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/text-align-vlr-011.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-013.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-015.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-017.xht [ Failure Pass ]
@@ -2056,17 +2038,17 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-002.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-004.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-006.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-008.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-008.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-010.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-012.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-014.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-016.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-014.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-016.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-018.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-baseline-vlr-007.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-baseline-vrl-006.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-decorations-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-layout-rules-001.html [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-003.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-003.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-005.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-011.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-013.xht [ Failure Pass ]
@@ -2115,7 +2097,7 @@
 crbug.com/714962 external/wpt/css/cssom/medialist-dynamic-001.html [ Failure ]
 crbug.com/626703 external/wpt/css/cssom/stylesheet-replacedata-dynamic.html [ Failure ]
 crbug.com/591099 external/wpt/css/geometry/interfaces.html [ Pass Timeout ]
-crbug.com/591099 external/wpt/css/geometry/interfaces.worker.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/css/geometry/interfaces.worker.html [ Timeout ]
 crbug.com/714962 external/wpt/css/selectors/focus-within-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/selectors/focus-within-004.html [ Failure ]
 crbug.com/714962 external/wpt/css/selectors/focus-within-007.html [ Failure ]
@@ -2130,15 +2112,6 @@
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-01.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-02.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-break-inside-001.html [ Failure ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-001.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-002.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-003.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-004.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-005.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-005a.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-006.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-006a.html [ Crash ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-007.html [ Crash ]
 crbug.com/591099 external/wpt/dom/interfaces.html [ Timeout ]
 crbug.com/591099 external/wpt/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html [ Pass ]
 crbug.com/591099 external/wpt/dom/nodes/Element-classlist.html [ Timeout ]
@@ -2183,7 +2156,7 @@
 crbug.com/591099 external/wpt/editing/run/removeformat.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/strikethrough.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/subscript.html [ Timeout ]
-crbug.com/591099 external/wpt/editing/run/superscript.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/editing/run/superscript.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/underline.html [ Timeout ]
 crbug.com/591099 external/wpt/encoding/api-invalid-label.html [ Timeout ]
 crbug.com/591099 external/wpt/encoding/legacy-mb-japanese/euc-jp/eucjp-decode-cseucpkdfmtjapanese.html [ Timeout ]
@@ -2307,8 +2280,8 @@
 crbug.com/714962 external/wpt/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-non-snap-to-lines.html [ Failure ]
-crbug.com/591099 external/wpt/html/semantics/forms/the-form-element/form-elements-filter.html [ Crash ]
-crbug.com/591099 external/wpt/html/semantics/forms/the-form-element/form-nameditem.html [ Crash ]
+crbug.com/591099 external/wpt/html/semantics/forms/the-form-element/form-elements-filter.html [ Crash Pass ]
+crbug.com/591099 external/wpt/html/semantics/forms/the-form-element/form-nameditem.html [ Crash Pass ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-menu.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-skip-no-boxes.html [ Failure ]
@@ -2337,8 +2310,8 @@
 crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-classic.html [ Pass ]
 crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/propagate-nonce-inline-module.html [ Pass ]
 crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/module/error-type-3.html [ Pass ]
-crbug.com/591099 external/wpt/html/semantics/selectors/pseudo-classes/inrange-outofrange.html [ Crash ]
-crbug.com/591099 external/wpt/html/semantics/selectors/pseudo-classes/readwrite-readonly.html [ Crash ]
+crbug.com/591099 external/wpt/html/semantics/selectors/pseudo-classes/inrange-outofrange.html [ Crash Pass ]
+crbug.com/591099 external/wpt/html/semantics/selectors/pseudo-classes/readwrite-readonly.html [ Crash Pass ]
 crbug.com/591099 external/wpt/html/syntax/parsing/html5lib_isindex.html?run_type=uri [ Pass ]
 crbug.com/591099 external/wpt/html/syntax/parsing/html5lib_isindex.html?run_type=write [ Pass ]
 crbug.com/591099 external/wpt/html/syntax/parsing/html5lib_isindex.html?run_type=write_single [ Pass ]
@@ -2382,8 +2355,8 @@
 crbug.com/714962 external/wpt/pointerevents/pointerevent_setpointercapture_relatedtarget-manual.html [ Timeout ]
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-auto-css_touch-manual.html [ Timeout ]
 crbug.com/591099 external/wpt/pointerevents/pointerevent_touch-action-button-test_touch-manual.html [ Timeout ]
-crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-keyboard-manual.html [ Pass Timeout ]
-crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-mouse-manual.html [ Pass Timeout ]
+crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-keyboard-manual.html [ Timeout ]
+crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-mouse-manual.html [ Timeout ]
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-left-css_touch-manual.html [ Pass ]
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-right-css_touch-manual.html [ Failure ]
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-manual.html [ Timeout ]
@@ -2408,7 +2381,7 @@
 crbug.com/591099 external/wpt/selection/selectAllChildren.html [ Timeout ]
 crbug.com/591099 external/wpt/service-workers/service-worker/navigation-preload/resource-timing.https.html [ Pass ]
 crbug.com/591099 external/wpt/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html [ Failure ]
-crbug.com/714962 external/wpt/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html [ Failure ]
+crbug.com/714962 external/wpt/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html [ Failure Pass ]
 crbug.com/591099 external/wpt/svg/interfaces.html [ Timeout ]
 crbug.com/591099 external/wpt/svg/linking/reftests/href-filter-element.html [ Failure ]
 crbug.com/591099 external/wpt/uievents/order-of-events/focus-events/focus-manual.html [ Timeout ]
@@ -2443,7 +2416,6 @@
 crbug.com/591099 external/wpt/websockets/cookies/004.html?wss [ Pass ]
 crbug.com/591099 external/wpt/websockets/cookies/005.html [ Pass ]
 crbug.com/591099 external/wpt/websockets/cookies/005.html?wss [ Pass ]
-crbug.com/591099 external/wpt/websockets/cookies/007.html [ Failure Pass ]
 crbug.com/591099 external/wpt/websockets/extended-payload-length.html?wss [ Pass ]
 crbug.com/591099 external/wpt/websockets/interfaces/CloseEvent/clean-close.html?wss [ Pass ]
 crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer.html?wss [ Pass ]
@@ -2582,24 +2554,23 @@
 crbug.com/591099 fast/block/float/overhanging-float-remove-from-fixed-position-block2.html [ Failure ]
 crbug.com/591099 fast/block/float/overlapping-floats-paint-hittest-order-1.html [ Failure ]
 crbug.com/591099 fast/block/float/overlapping-floats-paint-hittest-order-2.html [ Failure ]
-crbug.com/714962 fast/block/float/relayout-nested-float-after-line.html [ Failure ]
+crbug.com/714962 fast/block/float/relayout-nested-float-after-line.html [ Failure Pass ]
 crbug.com/591099 fast/block/float/selection-gap-clip-out-tiger-crash.html [ Failure ]
 crbug.com/591099 fast/block/geometry-map-assertion-with-tall-content.html [ Failure ]
 crbug.com/714962 fast/block/layer-not-removed-from-parent-crash.html [ Failure ]
 crbug.com/591099 fast/block/line-layout/floats-do-not-fit-on-line.html [ Failure ]
 crbug.com/591099 fast/block/line-layout/line-break-removal-near-textarea-crash.html [ Failure ]
 crbug.com/591099 fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Failure ]
-crbug.com/714962 fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Failure ]
+crbug.com/714962 fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Failure Pass ]
 crbug.com/591099 fast/block/margin-collapse/webkit-margin-collapse-container.html [ Failure ]
 crbug.com/591099 fast/block/margin-collapse/webkit-margin-collapse-separate-position.html [ Failure ]
 crbug.com/591099 fast/block/margin-collapse/webkit-margin-collapse-siblings.html [ Failure ]
 crbug.com/591099 fast/block/margin-left-margin-right-auto.html [ Failure ]
 crbug.com/591099 fast/block/over-constrained-auto-margin.html [ Failure ]
-crbug.com/591099 fast/block/percent-height-descendant-not-removed-crash2.html [ Crash ]
+crbug.com/591099 fast/block/percent-height-descendant-not-removed-crash2.html [ Crash Pass ]
 crbug.com/591099 fast/block/positioning/056.html [ Failure ]
 crbug.com/591099 fast/block/positioning/058.html [ Failure ]
 crbug.com/591099 fast/block/positioning/059.html [ Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-dynamic.html [ Failure Pass ]
 crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-2.html [ Failure ]
 crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-3.html [ Failure ]
 crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr.html [ Failure ]
@@ -2698,8 +2669,8 @@
 crbug.com/591099 fast/box-shadow/scaled-box-shadow.html [ Failure ]
 crbug.com/591099 fast/box-shadow/spread.html [ Failure ]
 crbug.com/591099 fast/box-shadow/transform-fringing.html [ Failure ]
-crbug.com/591099 fast/box-sizing/replaced.html [ Failure Pass ]
-crbug.com/591099 fast/canvas-api/fallback-content.html [ Crash ]
+crbug.com/591099 fast/box-sizing/replaced.html [ Failure ]
+crbug.com/591099 fast/canvas-api/fallback-content.html [ Crash Pass ]
 crbug.com/591099 fast/canvas-api/toDataURL-supportedTypes.html [ Failure ]
 crbug.com/591099 fast/canvas/canvas-createImageBitmap-drawImage.html [ Timeout ]
 crbug.com/714962 fast/canvas/canvas-css-clip-path.html [ Failure ]
@@ -2797,7 +2768,7 @@
 crbug.com/591099 fast/css-grid-layout/grid-item-bad-resolution-double-span.html [ Failure ]
 crbug.com/591099 fast/css-grid-layout/grid-item-border-overflow-paint.html [ Failure ]
 crbug.com/591099 fast/css-grid-layout/grid-item-change-order-auto-flow.html [ Failure ]
-crbug.com/591099 fast/css-grid-layout/grid-item-column-row-get-set.html [ Timeout ]
+crbug.com/591099 fast/css-grid-layout/grid-item-column-row-get-set.html [ Pass Timeout ]
 crbug.com/714962 fast/css-grid-layout/grid-item-margins-and-writing-modes.html [ Failure ]
 crbug.com/591099 fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html [ Failure ]
 crbug.com/591099 fast/css-grid-layout/grid-item-named-grid-area-resolution.html [ Failure ]
@@ -2915,7 +2886,7 @@
 crbug.com/591099 fast/css/border-radius-outline-offset.html [ Failure ]
 crbug.com/591099 fast/css/box-shadow-and-border-radius.html [ Failure ]
 crbug.com/591099 fast/css/bug4860-absolute-block-child-does-not-inherit-alignment.html [ Failure ]
-crbug.com/714962 fast/css/button-first-line-change-color.html [ Failure ]
+crbug.com/714962 fast/css/button-first-line-change-color.html [ Failure Pass ]
 crbug.com/591099 fast/css/caption-width-absolute-position-offset-top.htm [ Failure ]
 crbug.com/591099 fast/css/caption-width-absolute-position.htm [ Failure ]
 crbug.com/591099 fast/css/caption-width-fixed-position-offset-top.htm [ Failure ]
@@ -2939,7 +2910,7 @@
 crbug.com/591099 fast/css/color-leakage.html [ Failure ]
 crbug.com/591099 fast/css/color-quirk.html [ Failure ]
 crbug.com/591099 fast/css/compare-content-style.html [ Failure ]
-crbug.com/714962 fast/css/containment/contain-paint-composited-scroll.html [ Crash Failure ]
+crbug.com/714962 fast/css/containment/contain-paint-composited-scroll.html [ Failure ]
 crbug.com/591099 fast/css/containment/size-and-layout-containment.html [ Failure ]
 crbug.com/591099 fast/css/containment/style-contain-dialogue-element.html [ Crash ]
 crbug.com/591099 fast/css/content-counter-010.htm [ Failure ]
@@ -3021,14 +2992,14 @@
 crbug.com/591099 fast/css/image-orientation/image-orientation-from-image-composited-dynamic.html [ Failure ]
 crbug.com/591099 fast/css/image-orientation/image-orientation-from-image-composited.html [ Failure ]
 crbug.com/591099 fast/css/image-orientation/image-orientation-from-image.html [ Failure ]
-crbug.com/591099 fast/css/image-set-value-not-removed-crash.html [ Failure ]
+crbug.com/591099 fast/css/image-set-value-not-removed-crash.html [ Failure Pass ]
 crbug.com/591099 fast/css/import-rule-regression-11590.html [ Failure ]
 crbug.com/591099 fast/css/import_with_baseurl.html [ Failure ]
 crbug.com/591099 fast/css/inline-element-line-break.html [ Failure ]
 crbug.com/591099 fast/css/inline-properties-important.html [ Failure ]
 crbug.com/591099 fast/css/inline-table-empty-non-auto.html [ Failure ]
-crbug.com/714962 fast/css/inline-table-first-row-empty-cell-non-auto.html [ Failure ]
-crbug.com/714962 fast/css/inline-table-first-row-non-empty-cell-non-auto-content.html [ Failure ]
+crbug.com/714962 fast/css/inline-table-first-row-empty-cell-non-auto.html [ Failure Pass ]
+crbug.com/714962 fast/css/inline-table-first-row-non-empty-cell-non-auto-content.html [ Failure Pass ]
 crbug.com/591099 fast/css/input-search-padding.html [ Failure ]
 crbug.com/591099 fast/css/intruding-floats-crash.html [ Failure ]
 crbug.com/591099 fast/css/invalid-percentage-property.html [ Failure ]
@@ -3084,16 +3055,16 @@
 crbug.com/591099 fast/css/percent-width-img-src-change.html [ Failure ]
 crbug.com/591099 fast/css/percentage-height-auto-sized-body-quirks.html [ Failure ]
 crbug.com/591099 fast/css/percentage-non-integer.html [ Failure ]
-crbug.com/591099 fast/css/placeholder-shown-basics.html [ Crash ]
+crbug.com/591099 fast/css/placeholder-shown-basics.html [ Crash Pass ]
 crbug.com/591099 fast/css/position-negative-top-margin.html [ Failure ]
 crbug.com/591099 fast/css/positioned-overflow-scroll.html [ Failure ]
-crbug.com/591099 fast/css/pseudo-default-checkbox-radio.html [ Crash ]
+crbug.com/591099 fast/css/pseudo-default-checkbox-radio.html [ Crash Pass ]
 crbug.com/591099 fast/css/pseudo-element-backdrop-hit-test.html [ Crash ]
 crbug.com/591099 fast/css/pseudo-element-line-break.html [ Failure ]
 crbug.com/591099 fast/css/pseudo-first-line-border-width.html [ Failure ]
 crbug.com/591099 fast/css/pseudo-in-range-invalid-value.html [ Crash Failure ]
 crbug.com/591099 fast/css/pseudo-in-range.html [ Crash Failure ]
-crbug.com/591099 fast/css/pseudo-required-optional-005.html [ Crash ]
+crbug.com/591099 fast/css/pseudo-required-optional-005.html [ Crash Pass ]
 crbug.com/591099 fast/css/pseudostyle-anonymous-text.html [ Failure ]
 crbug.com/591099 fast/css/recursive-delay-update-scroll.html [ Failure ]
 crbug.com/591099 fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed.html [ Failure ]
@@ -3118,7 +3089,7 @@
 crbug.com/591099 fast/css/rtl-ordering.html [ Failure ]
 crbug.com/591099 fast/css/rtl-to-viewport.html [ Failure ]
 crbug.com/591099 fast/css/selector-set-attribute.html [ Failure ]
-crbug.com/591099 fast/css/shadow-dom-scope.html [ Crash ]
+crbug.com/591099 fast/css/shadow-dom-scope.html [ Crash Pass ]
 crbug.com/591099 fast/css/shadow-multiple.html [ Failure ]
 crbug.com/591099 fast/css/sticky/inline-sticky-abspos-child.html [ Failure ]
 crbug.com/714962 fast/css/sticky/replaced-sticky.html [ Failure ]
@@ -3127,10 +3098,10 @@
 crbug.com/591099 fast/css/style-parsed-outside-head.html [ Failure ]
 crbug.com/591099 fast/css/table-text-align-quirk.html [ Failure ]
 crbug.com/591099 fast/css/table-text-align-strict.html [ Failure ]
-crbug.com/714962 fast/css/text-align-webkit-match-parent.html [ Failure ]
+crbug.com/714962 fast/css/text-align-webkit-match-parent.html [ Failure Pass ]
 crbug.com/591099 fast/css/text-overflow-ellipsis-bidi.html [ Failure ]
 crbug.com/591099 fast/css/text-overflow-ellipsis-block-with-border-and-padding.html [ Failure ]
-crbug.com/591099 fast/css/text-overflow-ellipsis-button.html [ Failure ]
+crbug.com/591099 fast/css/text-overflow-ellipsis-button.html [ Failure Pass ]
 crbug.com/591099 fast/css/text-overflow-ellipsis-multiple-shadows.html [ Failure ]
 crbug.com/591099 fast/css/text-overflow-ellipsis-shadow-alpha.html [ Failure ]
 crbug.com/591099 fast/css/text-overflow-ellipsis-strict.html [ Failure ]
@@ -3236,7 +3207,7 @@
 crbug.com/591099 fast/dom/HTMLProgressElement/progress-element.html [ Failure ]
 crbug.com/591099 fast/dom/HTMLStyleElement/insert-parser-generated.html [ Failure ]
 crbug.com/714962 fast/dom/MutationObserver/observe-element-resize.html [ Failure ]
-crbug.com/591099 fast/dom/MutationObserver/shadow-dom.html [ Crash ]
+crbug.com/591099 fast/dom/MutationObserver/shadow-dom.html [ Crash Pass ]
 crbug.com/714962 fast/dom/Range/collapsed-range-bounding-client-rect.html [ Failure ]
 crbug.com/591099 fast/dom/Range/create-contextual-fragment.html [ Failure ]
 crbug.com/714962 fast/dom/Range/get-bounding-client-rect-empty-and-non-empty.html [ Timeout ]
@@ -3246,7 +3217,6 @@
 crbug.com/714962 fast/dom/Range/getClientRects-character.html [ Failure ]
 crbug.com/591099 fast/dom/Range/getClientRects-leading-trailing-whitespaces.html [ Failure ]
 crbug.com/591099 fast/dom/Range/range-expand.html [ Failure ]
-crbug.com/714962 fast/dom/Range/range-spanning-elements-bounding-client-rect.html [ Failure Pass ]
 crbug.com/591099 fast/dom/Window/btoa-pnglet.html [ Failure ]
 crbug.com/591099 fast/dom/Window/open-existing-pop-up-blocking.html [ Failure ]
 crbug.com/591099 fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html [ Timeout ]
@@ -3278,7 +3248,7 @@
 crbug.com/591099 fast/dom/domstring-attribute-reflection.html [ Timeout ]
 crbug.com/591099 fast/dom/element-attribute-js-null.html [ Timeout ]
 crbug.com/714962 fast/dom/elementFromPoint-relative-to-viewport.html [ Failure ]
-crbug.com/714962 fast/dom/elementFromPoint-scaled-scrolled.html [ Failure ]
+crbug.com/714962 fast/dom/elementFromPoint-scaled-scrolled.html [ Failure Pass ]
 crbug.com/591099 fast/dom/elementsFromPoint/elementsFromPoint-iframes.html [ Failure ]
 crbug.com/714962 fast/dom/elementsFromPoint/elementsFromPoint-inline.html [ Failure ]
 crbug.com/591099 fast/dom/elementsFromPoint/elementsFromPoint-svg.html [ Failure ]
@@ -3297,7 +3267,7 @@
 crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-basic.html [ Failure ]
 crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html [ Failure ]
 crbug.com/714962 fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak.html [ Failure ]
-crbug.com/714962 fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-bidi.html [ Failure ]
+crbug.com/714962 fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-bidi.html [ Failure Pass ]
 crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings.html [ Failure ]
 crbug.com/714962 fast/dom/nodesFromRect/nodesFromRect-culled-inlines.html [ Failure ]
 crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-inline-image.html [ Failure ]
@@ -3317,14 +3287,13 @@
 crbug.com/714962 fast/dom/shadow/drop-event-for-input-in-shadow.html [ Failure ]
 crbug.com/591099 fast/dom/shadow/event-path-for-user-agent-shadow-tree.html [ Crash ]
 crbug.com/591099 fast/dom/shadow/focus-navigation-with-distributed-nodes.html [ Crash ]
-crbug.com/591099 fast/dom/shadow/form-in-shadow.html [ Crash ]
-crbug.com/714962 fast/dom/shadow/hover-active-drag-distributed-nodes.html [ Failure Pass ]
+crbug.com/591099 fast/dom/shadow/form-in-shadow.html [ Crash Pass ]
 crbug.com/714962 fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc.html [ Failure ]
 crbug.com/714962 fast/dom/shadow/input-color-in-content.html [ Timeout ]
 crbug.com/591099 fast/dom/shadow/normalize-progress-element-crash.html [ Crash ]
 crbug.com/591099 fast/dom/shadow/querySelector-for-useragent-shadowroot.html [ Crash ]
 crbug.com/714962 fast/dom/shadow/scrollbar.html [ Crash ]
-crbug.com/714962 fast/dom/shadow/select-in-shadowdom.html [ Failure ]
+crbug.com/714962 fast/dom/shadow/select-in-shadowdom.html [ Failure Pass ]
 crbug.com/591099 fast/dom/shadow/selections-in-shadow.html [ Timeout ]
 crbug.com/714962 fast/dom/shadow/shadow-boundary-crossing.html [ Failure ]
 crbug.com/591099 fast/dom/shadow/shadow-contents-event.html [ Crash ]
@@ -3420,7 +3389,8 @@
 crbug.com/714962 fast/events/drag-and-drop-subframe-dataTransfer.html [ Timeout ]
 crbug.com/714962 fast/events/drag-dataTransferItemList-file-handling.html [ Failure ]
 crbug.com/714962 fast/events/drag-in-frames.html [ Failure ]
-crbug.com/591099 fast/events/drag-selects-culled-inlines.html [ Failure ]
+crbug.com/591099 fast/events/drag-on-removed-slider-does-not-crash.html [ Crash Pass Timeout ]
+crbug.com/591099 fast/events/drag-selects-culled-inlines.html [ Failure Pass ]
 crbug.com/591099 fast/events/drag-selects-image.html [ Failure ]
 crbug.com/591099 fast/events/drag_and_drop_into_removed_on_focus.html [ Failure ]
 crbug.com/591099 fast/events/event-listener-on-link.html [ Failure ]
@@ -3441,7 +3411,6 @@
 crbug.com/591099 fast/events/keydown-keypress-preventDefault.html [ Failure ]
 crbug.com/591099 fast/events/keypress-focus-change.html [ Failure ]
 crbug.com/591099 fast/events/media-element-focus-tab.html [ Failure ]
-crbug.com/714962 fast/events/middleClickAutoscroll-click-hyperlink.html [ Pass Timeout ]
 crbug.com/714962 fast/events/middleClickAutoscroll-latching.html [ Pass Timeout ]
 crbug.com/714962 fast/events/mouse-down-on-pseudo-element-remove-crash.html [ Failure ]
 crbug.com/591099 fast/events/mouse-drag-from-frame-to-other-frame.html [ Failure ]
@@ -3482,7 +3451,7 @@
 crbug.com/591099 fast/events/popup-allowed-from-gesture-initiated-event.html [ Failure ]
 crbug.com/591099 fast/events/popup-allowed-from-gesture-only-once-iframes.html [ Timeout ]
 crbug.com/591099 fast/events/popup-blocked-from-different-frames.html [ Failure ]
-crbug.com/714962 fast/events/popup-blocked-from-wrong-event.html [ Timeout ]
+crbug.com/714962 fast/events/popup-blocked-from-wrong-event.html [ Pass Timeout ]
 crbug.com/591099 fast/events/reveal-link-when-focused.html [ Failure ]
 crbug.com/591099 fast/events/right-click-focus.html [ Failure ]
 crbug.com/591099 fast/events/scroll-after-click-on-tab-index.html [ Failure ]
@@ -3494,10 +3463,9 @@
 crbug.com/591099 fast/events/selectstart-by-single-click-with-shift.html [ Failure ]
 crbug.com/591099 fast/events/sequential-focus-navigation-starting-point.html [ Failure ]
 crbug.com/591099 fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html [ Failure ]
-crbug.com/714962 fast/events/simulated-click-coords.html [ Failure Pass ]
 crbug.com/591099 fast/events/submit-reset-nested-bubble.html [ Failure ]
 crbug.com/591099 fast/events/tab-imagemap.html [ Failure ]
-crbug.com/591099 fast/events/tabindex-focus-blur-all.html [ Crash ]
+crbug.com/591099 fast/events/tabindex-focus-blur-all.html [ Crash Pass ]
 crbug.com/591099 fast/events/touch/compositor-touch-hit-rects-scroll.html [ Failure ]
 crbug.com/591099 fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
 crbug.com/591099 fast/events/touch/gesture/gesture-click-on-inline-continations.html [ Failure ]
@@ -3505,13 +3473,13 @@
 crbug.com/714962 fast/events/touch/gesture/gesture-tap-input-after-composition.html [ Failure ]
 crbug.com/714962 fast/events/touch/gesture/gesture-tap-mouse-events.html [ Failure ]
 crbug.com/714962 fast/events/touch/gesture/gesture-tap-result.html [ Failure ]
-crbug.com/591099 fast/events/touch/touch-action-range-input-crash.html [ Crash ]
+crbug.com/591099 fast/events/touch/touch-action-range-input-crash.html [ Crash Pass ]
 crbug.com/591099 fast/events/touch/touch-action-range-input-csp.html [ Crash Timeout ]
 crbug.com/591099 fast/events/touch/touch-action-range-input.html [ Crash Timeout ]
 crbug.com/714962 fast/events/touch/touch-before-pressing-spin-button.html [ Failure ]
 crbug.com/591099 fast/events/touch/touch-fractional-coordinates.html [ Failure ]
-crbug.com/591099 fast/events/touch/touch-handler-assert-input-range.html [ Crash ]
-crbug.com/591099 fast/events/touch/touch-slider-no-js-touch-listener.html [ Crash Failure Timeout ]
+crbug.com/591099 fast/events/touch/touch-handler-assert-input-range.html [ Crash Pass ]
+crbug.com/591099 fast/events/touch/touch-slider-no-js-touch-listener.html [ Crash Failure ]
 crbug.com/591099 fast/events/touch/touch-slider.html [ Crash Failure ]
 crbug.com/591099 fast/events/wheel/latched-scroll-node-removed.html [ Pass ]
 crbug.com/591099 fast/events/wheel/mainthread-touchpad-fling-latching.html [ Pass ]
@@ -3557,7 +3525,7 @@
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-type-change-onclick.html [ Timeout ]
 crbug.com/591099 fast/forms/calendar-picker/month-picker-key-operations.html [ Timeout ]
 crbug.com/714962 fast/forms/calendar-picker/month-picker-mouse-operations.html [ Failure ]
-crbug.com/591099 fast/forms/calendar-picker/week-picker-key-operations.html [ Pass Timeout ]
+crbug.com/591099 fast/forms/calendar-picker/week-picker-key-operations.html [ Timeout ]
 crbug.com/714962 fast/forms/calendar-picker/week-picker-mouse-operations.html [ Failure ]
 crbug.com/591099 fast/forms/caret-rtl.html [ Failure ]
 crbug.com/591099 fast/forms/checkbox/checkbox-appearance-basic.html [ Failure ]
@@ -3641,6 +3609,7 @@
 crbug.com/591099 fast/forms/input-value.html [ Failure ]
 crbug.com/714962 fast/forms/label/continous-click-on-label.html [ Failure ]
 crbug.com/714962 fast/forms/label/hover-on-moving-mouse-checkbox-to-parent-label.html [ Failure ]
+crbug.com/591099 fast/forms/label/label-click.html [ Pass ]
 crbug.com/591099 fast/forms/label/label-contains-other-interactive-content.html [ Crash ]
 crbug.com/591099 fast/forms/label/label-selection-by-textSelection-and-click.html [ Failure ]
 crbug.com/591099 fast/forms/label/selection-disabled-label.html [ Failure Crash ]
@@ -3906,6 +3875,7 @@
 crbug.com/591099 fast/forms/textarea/textarea-setinnerhtml.html [ Failure ]
 crbug.com/591099 fast/forms/textarea/textarea-width.html [ Failure ]
 crbug.com/714962 fast/forms/time-multiple-fields/time-multiple-fields-clearbutton-change-and-input-events.html [ Failure ]
+crbug.com/591099 fast/forms/time-multiple-fields/time-multiple-fields-focus.html [ Failure Pass ]
 crbug.com/714962 fast/forms/time-multiple-fields/time-multiple-fields-mouse-events.html [ Failure ]
 crbug.com/714962 fast/forms/time-multiple-fields/time-multiple-fields-spinbutton-change-and-input-events.html [ Failure ]
 crbug.com/591099 fast/forms/time-multiple-fields/time-multiple-fields-spinbutton-click-in-iframe.html [ Failure ]
@@ -3999,7 +3969,6 @@
 crbug.com/591099 fast/gradients/unprefixed-repeating-linear-gradient.html [ Failure ]
 crbug.com/591099 fast/gradients/unprefixed-repeating-radial-gradients.html [ Failure ]
 crbug.com/591099 fast/harness/hello_again.html [ Failure ]
-crbug.com/714962 fast/harness/legacy-results.html [ Failure Pass ]
 crbug.com/591099 fast/hidpi/broken-image-icon-hidpi.html [ Failure ]
 crbug.com/714962 fast/hidpi/clip-text-in-hidpi.html [ Failure ]
 crbug.com/591099 fast/hidpi/image-set-list-style-image.html [ Failure ]
@@ -4013,7 +3982,7 @@
 crbug.com/714962 fast/history/visited-link-hover-text-fill-color.html [ Failure ]
 crbug.com/714962 fast/history/visited-link-hover-text-stroke-color.html [ Failure ]
 crbug.com/714962 fast/history/visited-link-hover.html [ Failure ]
-crbug.com/591099 fast/html/clone-range.html [ Crash ]
+crbug.com/591099 fast/html/clone-range.html [ Crash Pass ]
 crbug.com/591099 fast/html/draggable-controls.html [ Failure ]
 crbug.com/714962 fast/html/layout-runs-and-floats-crash.html [ Failure ]
 crbug.com/714962 fast/html/meter-user-modify.html [ Failure Pass ]
@@ -4035,7 +4004,7 @@
 crbug.com/591099 fast/inline/inline-box-background.html [ Failure ]
 crbug.com/591099 fast/inline/inline-continuation-borders.html [ Failure ]
 crbug.com/591099 fast/inline/inline-focus-ring-under-absolute-enclosing-relative-div.html [ Failure ]
-crbug.com/714962 fast/inline/inline-offsetLeft-continuation.html [ Failure ]
+crbug.com/714962 fast/inline/inline-offsetLeft-continuation.html [ Failure Pass ]
 crbug.com/591099 fast/inline/inline-offsetLeft-relpos.html [ Failure ]
 crbug.com/591099 fast/inline/inline-with-empty-inline-children.html [ Failure ]
 crbug.com/591099 fast/inline/inline-wrap-with-parent-padding.html [ Failure ]
@@ -4136,7 +4105,7 @@
 crbug.com/591099 fast/lists/marker-before-empty-inline.html [ Failure ]
 crbug.com/591099 fast/lists/markers-in-selection.html [ Failure ]
 crbug.com/591099 fast/lists/ordered-list-with-no-ol-tag.html [ Failure ]
-crbug.com/591099 fast/lists/remove-listmarker-and-make-anonblock-empty-2.html [ Failure ]
+crbug.com/591099 fast/lists/remove-listmarker-and-make-anonblock-empty-2.html [ Failure Pass ]
 crbug.com/591099 fast/lists/remove-listmarker-from-anonblock-with-continuation-crash.html [ Crash ]
 crbug.com/591099 fast/loader/child-frame-add-after-back-forward.html [ Timeout Failure ]
 crbug.com/591099 fast/loader/document-with-fragment-url-1.html [ Timeout ]
@@ -4574,7 +4543,7 @@
 crbug.com/714962 fast/overflow/line-clamp-hides-trailing-anchor.html [ Failure ]
 crbug.com/591099 fast/overflow/line-clamp.html [ Failure ]
 crbug.com/591099 fast/overflow/onscroll-layer-self-destruct.html [ Timeout ]
-crbug.com/591099 fast/overflow/overflow-of-video-outline.html [ Failure ]
+crbug.com/591099 fast/overflow/overflow-of-video-outline.html [ Failure Pass ]
 crbug.com/591099 fast/overflow/overflow-rtl-vertical.html [ Failure ]
 crbug.com/591099 fast/overflow/overflow-rtl.html [ Failure ]
 crbug.com/714962 fast/overflow/overflow-text-hit-testing.html [ Failure ]
@@ -4676,7 +4645,6 @@
 crbug.com/714962 fast/replaced/vertical-rl/absolute-position-with-auto-height-and-top-and-bottom.html [ Failure ]
 crbug.com/714962 fast/replaced/vertical-rl/absolute-position-with-auto-width-and-left-and-right.html [ Failure ]
 crbug.com/591099 fast/replaced/width100percent-image.html [ Failure ]
-crbug.com/714962 fast/replaced/width100percent-textarea.html [ Failure Pass ]
 crbug.com/591099 fast/ruby/add-text-to-block-ruby-with-after-pseudo-crash.html [ Crash ]
 crbug.com/591099 fast/ruby/base-shorter-than-text.html [ Failure ]
 crbug.com/591099 fast/ruby/float-object-doesnt-crash.html [ Crash ]
@@ -4765,7 +4733,7 @@
 crbug.com/591099 fast/selectors/nondeterministic-combinators.html [ Failure ]
 crbug.com/591099 fast/selectors/placeholder-shown-sibling-style-update.html [ Failure ]
 crbug.com/591099 fast/selectors/placeholder-shown-style-update.html [ Failure ]
-crbug.com/591099 fast/selectors/querySelector-in-range-crash.html [ Crash ]
+crbug.com/591099 fast/selectors/querySelector-in-range-crash.html [ Crash Pass ]
 crbug.com/591099 fast/selectors/unqualified-hover-quirks.html [ Failure ]
 crbug.com/591099 fast/selectors/unqualified-hover-strict.html [ Failure ]
 crbug.com/591099 fast/selectors/visited-descendant.html [ Failure ]
@@ -4849,7 +4817,7 @@
 crbug.com/591099 fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html [ Failure ]
 crbug.com/591099 fast/spatial-navigation/snav-iframe-with-outside-focusable-element.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-input.html [ Failure ]
-crbug.com/591099 fast/spatial-navigation/snav-multiple-select-focusring.html [ Failure ]
+crbug.com/591099 fast/spatial-navigation/snav-multiple-select-focusring.html [ Failure Pass ]
 crbug.com/714962 fast/spatial-navigation/snav-multiple-select.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-radio-group.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-radio.html [ Failure ]
@@ -4869,7 +4837,6 @@
 crbug.com/591099 fast/sub-pixel/sub-pixel-border-2.html [ Failure ]
 crbug.com/591099 fast/sub-pixel/table-cells-with-padding-do-not-wrap.html [ Failure ]
 crbug.com/591099 fast/sub-pixel/table-rtl-padding.html [ Failure ]
-crbug.com/714962 fast/sub-pixel/width-of-inline-in-float.html [ Failure Pass ]
 crbug.com/591099 fast/table/018.html [ Failure ]
 crbug.com/591099 fast/table/032.html [ Failure ]
 crbug.com/714962 fast/table/035-vertical.html [ Failure ]
@@ -4962,7 +4929,7 @@
 crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border-on-table.html [ Failure ]
 crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border.html [ Failure ]
 crbug.com/591099 fast/table/percent-height-content-in-fixed-height-content-box-sized-cell.html [ Failure ]
-crbug.com/591099 fast/table/percent-height-overflow-auto-content-in-cell.html [ Failure Pass ]
+crbug.com/591099 fast/table/percent-height-overflow-auto-content-in-cell.html [ Failure ]
 crbug.com/591099 fast/table/percent-height-overflow-scroll-content-in-cell.html [ Failure Pass ]
 crbug.com/591099 fast/table/percent-widths-stretch-vertical.html [ Failure ]
 crbug.com/591099 fast/table/recalc-section-first-body-crash-main.html [ Failure ]
@@ -5099,14 +5066,10 @@
 crbug.com/591099 fast/text/emphasis-ellipsis-complextext.html [ Failure ]
 crbug.com/591099 fast/text/emphasis-overlap.html [ Failure ]
 crbug.com/591099 fast/text/find-kana.html [ Timeout ]
-crbug.com/714962 fast/text/font-fallback-synthetic-italics.html [ Failure Pass ]
-crbug.com/714962 fast/text/font-ligature-letter-spacing.html [ Failure Pass ]
-crbug.com/714962 fast/text/font-variant-width.html [ Failure Pass ]
 crbug.com/714962 fast/text/fractional-word-and-letter-spacing-with-kerning.html [ Failure ]
 crbug.com/714962 fast/text/get-client-rects-grapheme.html [ Failure ]
 crbug.com/714962 fast/text/glyph-reordering.html [ Failure ]
 crbug.com/591099 fast/text/hide-atomic-inlines-after-ellipsis.html [ Failure ]
-crbug.com/714962 fast/text/hyphen-min-preferred-width.html [ Failure Pass ]
 crbug.com/591099 fast/text/international/bidi-L2-run-reordering.html [ Failure ]
 crbug.com/714962 fast/text/international/bidi-layout-across-linebreak.html [ Failure ]
 crbug.com/591099 fast/text/international/bidi-linebreak-002.html [ Failure ]
@@ -5116,7 +5079,6 @@
 crbug.com/591099 fast/text/international/combining-marks-position.html [ Failure ]
 crbug.com/714962 fast/text/international/hindi-whitespace.html [ Failure ]
 crbug.com/714962 fast/text/international/iso-8859-8.html [ Failure ]
-crbug.com/714962 fast/text/international/listbox-width-rtl.html [ Failure Pass ]
 crbug.com/714962 fast/text/international/rtl-selection-rect-with-fallback.html [ Failure ]
 crbug.com/796943 fast/text/international/shape-across-elements-simple.html [ Pass ]
 crbug.com/591099 fast/text/international/shape-across-elements.html [ Failure ]
@@ -5170,7 +5132,6 @@
 crbug.com/714962 fast/text/selection/thai-offsetForPosition-inside-character.html [ Failure ]
 crbug.com/714962 fast/text/stroking-decorations.html [ Failure ]
 crbug.com/591099 fast/text/sub-pixel/text-scaling-pixel.html [ Failure ]
-crbug.com/714962 fast/text/tab-min-size.html [ Failure Pass ]
 crbug.com/714962 fast/text/text-range-bounds.html [ Failure ]
 crbug.com/591099 fast/text/trailing-white-space-2.html [ Failure ]
 crbug.com/714962 fast/text/transform-text-first-line-capitalize.html [ Failure ]
@@ -5351,8 +5312,7 @@
 crbug.com/591099 fullscreen/full-screen-css.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-element-stack.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-iframe-not-allowed.html [ Failure ]
-crbug.com/714962 fullscreen/full-screen-remove-ancestor-after.html [ Crash Pass ]
-crbug.com/591099 fullscreen/full-screen-ruleset-crash.html [ Crash Pass ]
+crbug.com/591099 fullscreen/full-screen-ruleset-crash.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-twice-newapi.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-with-css-reference-filter.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-with-flex-item.html [ Crash ]
@@ -5481,7 +5441,7 @@
 crbug.com/591099 html/grouping_content/listing.html [ Failure ]
 crbug.com/591099 html/marquee/marquee-scroll.html [ Failure ]
 crbug.com/591099 html/marquee/marquee-scrollamount.html [ Failure ]
-crbug.com/714962 html/sections/body-legacy-colors.html [ Timeout ]
+crbug.com/714962 html/sections/body-legacy-colors.html [ Pass Timeout ]
 crbug.com/591099 html/tabular_data/col_width_resizing_table.html [ Failure ]
 crbug.com/591099 html/tabular_data/table_border_invalid.html [ Failure ]
 crbug.com/591099 html/tabular_data/table_createcaption.html [ Failure ]
@@ -5498,7 +5458,7 @@
 crbug.com/591099 http/tests/csspaint/invalidation-border-image.html [ Timeout ]
 crbug.com/591099 http/tests/csspaint/invalidation-content-image.html [ Timeout ]
 crbug.com/591099 http/tests/devtools/animation/animation-KeyframeEffectReadOnly-crash.js [ Crash Pass ]
-crbug.com/714962 http/tests/devtools/animation/animation-group-matching-animations.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/animation/animation-group-matching-animations.js [ Crash ]
 crbug.com/714962 http/tests/devtools/animation/animation-group-matching-transitions.js [ Crash ]
 crbug.com/591099 http/tests/devtools/animation/animation-timeline.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/animation/animation-transition-setTiming-crash.js [ Crash Pass ]
@@ -5520,7 +5480,7 @@
 crbug.com/714962 http/tests/devtools/elements/css-rule-hover-highlights-selectors.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/edit/edit-dom-actions-1.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/edit/edit-dom-actions-2.js [ Crash ]
-crbug.com/714962 http/tests/devtools/elements/edit/edit-dom-actions-3.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/edit/edit-dom-actions-3.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/edit/edit-dom-actions-4.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/edit/edit-dom-actions-shadow-2.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/edit/edit-trimmed-attribute-value.js [ Crash Pass ]
@@ -5559,66 +5519,68 @@
 crbug.com/591099 http/tests/devtools/elements/navigate-styles-sidebar-with-arrow-keys.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/shadow/breadcrumb-shadow-roots.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/shadow/create-shadow-root.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-1.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-1.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/shadow/inspect-deep-shadow-element.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/shadow/shadow-distribution.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/shadow/shadow-host-display-modes.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-1/add-new-rule-inline-style-csp.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-1/add-new-rule-inline-style-csp.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-1/add-new-rule-keyboard.js [ Crash Pass ]
-crbug.com/714962 http/tests/devtools/elements/styles-1/add-new-rule-with-style-after-body.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-1/commit-selector-mark-matching.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-1/commit-selector.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-1/edit-inspector-stylesheet.js [ Crash ]
+crbug.com/714962 http/tests/devtools/elements/styles-1/add-new-rule-with-style-after-body.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-1/commit-selector-mark-matching.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-1/commit-selector.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-1/edit-inspector-stylesheet.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-1/edit-media-text.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/elements/styles-1/edit-name-with-trimmed-value.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-1/edit-name-with-trimmed-value.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-1/edit-value-inside-property.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles-1/edit-value-url-with-color.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-2/force-pseudo-state.js [ Crash ]
 crbug.com/591099 http/tests/devtools/elements/styles-2/inject-stylesheet.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/elements/styles-2/page-reload-update-sidebar.js [ Crash ]
-crbug.com/714962 http/tests/devtools/elements/styles-2/paste-property.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-2/perform-undo-perform-of-mergable-action.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-2/page-reload-update-sidebar.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/styles-2/paste-property.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-2/perform-undo-perform-of-mergable-action.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles-2/pseudo-elements.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/shadow-dom-rules.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/style-rule-from-imported-stylesheet.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-blank-property.js [ Crash ]
-crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-invalid-property.js [ Crash ]
+crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-invalid-property.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-new-rule-colon.js [ Crash ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule-tab.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule-to-stylesheet.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule-to-stylesheet.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-cancel-editing.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-cancel-editing.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-change-node-while-editing.js [ Crash Pass ]
-crbug.com/714962 http/tests/devtools/elements/styles-3/styles-commit-editing.js [ Crash ]
+crbug.com/714962 http/tests/devtools/elements/styles-3/styles-commit-editing.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-inherited.js [ Failure ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-property-after-selector-edit.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-then-change.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-then-delete.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-property-after-selector-edit.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-then-change.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-then-delete.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-then-enable-overriden-ua.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-then-enable.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/elements/styles-4/disable-last-property-without-semicolon.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-4/styles-do-not-detach-sourcemap-on-edits.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-4/styles-formatting.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-4/disable-last-property-without-semicolon.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-4/styles-do-not-detach-sourcemap-on-edits.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-4/styles-formatting.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles-4/styles-iframe.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/styles-live-locations-leak.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/styles-update-from-js.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/undo-add-new-rule.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/undo-add-property.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-4/undo-add-rule-crash.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles/cancel-upon-invalid-property.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles/edit-css-with-source-url.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-4/undo-add-rule-crash.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles/cancel-upon-invalid-property.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles/edit-css-with-source-url.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles/selector-line-deprecated.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles/selector-line-sourcemap-header-deprecated.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/styles/styles-mouse-test.js [ Failure ]
-crbug.com/714962 http/tests/devtools/elements/styles/stylesheet-tracking.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles/undo-after-cancelled-editing.js [ Crash ]
-crbug.com/714962 http/tests/devtools/elements/styles/undo-change-property.js [ Crash ]
-crbug.com/714962 http/tests/devtools/elements/styles/undo-property-toggle.js [ Crash ]
+crbug.com/714962 http/tests/devtools/elements/styles/stylesheet-tracking.js [ Crash Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles/undo-after-cancelled-editing.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/styles/undo-change-property.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/styles/undo-property-toggle.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles/undo-set-selector-text.js [ Crash ]
 crbug.com/591099 http/tests/devtools/extensions/extensions-sidebar.js [ Crash ]
 crbug.com/591099 http/tests/devtools/indexeddb/resources-panel.js [ Failure ]
 crbug.com/591099 http/tests/devtools/inspect-element.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/jump-to-previous-editing-location.js [ Failure ]
 crbug.com/714962 http/tests/devtools/layers/layer-canvas-log.js [ Failure ]
-crbug.com/591099 http/tests/devtools/modify-cross-domain-rule.js [ Crash ]
+crbug.com/591099 http/tests/devtools/modify-cross-domain-rule.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/network/network-datareceived.js [ Failure ]
 crbug.com/714962 http/tests/devtools/service-workers/service-workers-view.js [ Failure ]
 crbug.com/591099 http/tests/devtools/sources/debugger-async/async-await/async-pause-on-exception.js [ Crash ]
@@ -5627,24 +5589,20 @@
 crbug.com/591099 http/tests/devtools/sources/debugger-breakpoints/dom-breakpoints.js [ Crash ]
 crbug.com/591099 http/tests/devtools/sources/debugger-frameworks/frameworks-dom-xhr-event-breakpoints.js [ Crash ]
 crbug.com/591099 http/tests/devtools/sources/debugger-frameworks/frameworks-jquery.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/sources/debugger-frameworks/frameworks-steppings.js [ Crash ]
+crbug.com/591099 http/tests/devtools/sources/debugger-frameworks/frameworks-steppings.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal.js [ Failure Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-pause/debugger-pause-on-promise-rejection.js [ Crash ]
 crbug.com/591099 http/tests/devtools/sources/debugger-step/debugger-step-into-custom-element-callbacks.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-step/debugger-step-out-custom-element-callbacks.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-step/debugger-step-out-event-listener.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-ui/debugger-inline-values.js [ Crash ]
-crbug.com/591099 http/tests/devtools/sources/debugger-ui/function-generator-details.js [ Failure Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger-ui/watch-expressions-panel-switch.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/sources/debugger/debugger-proto-property.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ Failure ]
-crbug.com/591099 http/tests/devtools/sources/debugger/properties-special.js [ Failure Pass ]
 crbug.com/591099 http/tests/devtools/text-autosizing-override.js [ Failure ]
 crbug.com/591099 http/tests/devtools/tracing/timeline-misc/timeline-bound-function.js [ Failure ]
-crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.js [ Failure Timeout ]
-crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations.js [ Failure Timeout ]
+crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.js [ Failure ]
+crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations.js [ Failure ]
 crbug.com/591099 http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-no-reload.html [ Timeout ]
 crbug.com/591099 http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-reload.html [ Timeout ]
 crbug.com/591099 http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html [ Timeout ]
@@ -5683,7 +5641,7 @@
 crbug.com/714962 http/tests/local/formdata/upload-events.html [ Failure ]
 crbug.com/714962 http/tests/local/serviceworker/fetch-request-body-file.html [ Timeout ]
 crbug.com/591099 http/tests/media/progress-events-generated-correctly.html [ Failure ]
-crbug.com/591099 http/tests/media/video-buffered-range-contains-currentTime.html [ Failure ]
+crbug.com/591099 http/tests/media/video-buffered-range-contains-currentTime.html [ Failure Pass ]
 crbug.com/591099 http/tests/misc/acid2-pixel.html [ Failure ]
 crbug.com/591099 http/tests/misc/acid2.html [ Failure ]
 crbug.com/591099 http/tests/misc/acid3.html [ Crash ]
@@ -5718,10 +5676,10 @@
 crbug.com/714962 http/tests/navigation/no-referrer-subframe.html [ Timeout ]
 crbug.com/591099 http/tests/navigation/no-referrer-target-blank.html [ Timeout ]
 crbug.com/591099 http/tests/navigation/onload-navigation-iframe-2.html [ Failure ]
-crbug.com/714962 http/tests/navigation/ping-cookie.html [ Timeout ]
-crbug.com/714962 http/tests/navigation/ping-cross-origin-from-https.html [ Timeout ]
-crbug.com/714962 http/tests/navigation/ping-cross-origin.html [ Timeout ]
-crbug.com/714962 http/tests/navigation/ping-same-origin.html [ Timeout ]
+crbug.com/714962 http/tests/navigation/ping-cookie.html [ Pass Timeout ]
+crbug.com/714962 http/tests/navigation/ping-cross-origin-from-https.html [ Pass Timeout ]
+crbug.com/714962 http/tests/navigation/ping-cross-origin.html [ Pass Timeout ]
+crbug.com/714962 http/tests/navigation/ping-same-origin.html [ Pass Timeout ]
 crbug.com/591099 http/tests/navigation/post-goback-same-url.html [ Failure ]
 crbug.com/591099 http/tests/navigation/post-goback2.html [ Failure ]
 crbug.com/714962 http/tests/navigation/post-with-modifier.html [ Timeout ]
@@ -5746,10 +5704,10 @@
 crbug.com/591099 http/tests/origin_trials/sample-api-workers.html [ Pass ]
 crbug.com/591099 http/tests/permissions/test-api-surface.html [ Pass ]
 crbug.com/591099 http/tests/security/XFrameOptions/x-frame-options-cached.html [ Failure ]
-crbug.com/714962 http/tests/security/anchor-download-allow-blob.html [ Timeout ]
-crbug.com/714962 http/tests/security/anchor-download-allow-data.html [ Timeout ]
-crbug.com/714962 http/tests/security/anchor-download-allow-sameorigin.html [ Timeout ]
-crbug.com/714962 http/tests/security/anchor-download-block-crossorigin.html [ Timeout ]
+crbug.com/714962 http/tests/security/anchor-download-allow-blob.html [ Pass Timeout ]
+crbug.com/714962 http/tests/security/anchor-download-allow-data.html [ Pass Timeout ]
+crbug.com/714962 http/tests/security/anchor-download-allow-sameorigin.html [ Pass Timeout ]
+crbug.com/714962 http/tests/security/anchor-download-block-crossorigin.html [ Pass Timeout ]
 crbug.com/591099 http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-blank.html [ Failure ]
 crbug.com/591099 http/tests/security/contentSecurityPolicy/1.1/form-action-blocked-when-target-cross-site-window.html [ Failure ]
 crbug.com/591099 http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html [ Failure ]
@@ -5891,7 +5849,7 @@
 crbug.com/591099 images/cross-fade-simple.html [ Failure ]
 crbug.com/591099 images/cross-fade-sizing.html [ Failure ]
 crbug.com/591099 images/cross-fade-tiled.html [ Failure ]
-crbug.com/714962 images/drag-image-transformed-parent.html [ Failure ]
+crbug.com/714962 images/drag-image-transformed-parent.html [ Failure Pass ]
 crbug.com/591099 images/embed-does-not-propagate-dimensions-to-object-ancestor.html [ Failure ]
 crbug.com/591099 images/favicon-as-image.html [ Failure ]
 crbug.com/591099 images/gif-loop-count.html [ Failure ]
@@ -5931,7 +5889,7 @@
 crbug.com/591099 inspector-protocol/accessibility/accessibility-ignoredNodes.js [ Timeout ]
 crbug.com/714962 inspector-protocol/accessibility/accessibility-ignoredNodesModal.js [ Failure ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-modal.js [ Crash ]
-crbug.com/714962 inspector-protocol/accessibility/accessibility-nameSources-buttons.js [ Failure ]
+crbug.com/714962 inspector-protocol/accessibility/accessibility-nameSources-buttons.js [ Failure Pass ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-img-figure.js [ Timeout ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input-buttons.js [ Timeout ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input.js [ Timeout ]
@@ -5971,15 +5929,15 @@
 crbug.com/714962 intersection-observer/text-target.html [ Failure ]
 crbug.com/591099 media/autoplay/document-user-activation.html [ Failure ]
 crbug.com/591099 media/controls-drag-timebar-rendering.html [ Failure Pass ]
-crbug.com/591099 media/controls-timeline.html [ Failure ]
-crbug.com/591099 media/controls-volume-slider.html [ Failure ]
-crbug.com/591099 media/controls/controls-page-zoom-in.html [ Failure ]
-crbug.com/591099 media/controls/controls-page-zoom-out.html [ Failure ]
+crbug.com/591099 media/controls-timeline.html [ Failure Pass ]
+crbug.com/591099 media/controls-volume-slider.html [ Failure Pass ]
+crbug.com/591099 media/controls/controls-page-zoom-in.html [ Failure Pass ]
+crbug.com/591099 media/controls/controls-page-zoom-out.html [ Failure Pass ]
 crbug.com/591099 media/controls/lazy-loaded-style.html [ Failure ]
-crbug.com/591099 media/controls/paint-controls-webkit-appearance-none-custom-bg.html [ Failure ]
-crbug.com/591099 media/controls/paint-controls-webkit-appearance-none.html [ Failure ]
-crbug.com/591099 media/controls/video-controls-with-cast-rendering.html [ Failure ]
-crbug.com/591099 media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html [ Timeout ]
+crbug.com/591099 media/controls/paint-controls-webkit-appearance-none-custom-bg.html [ Failure Pass ]
+crbug.com/591099 media/controls/paint-controls-webkit-appearance-none.html [ Failure Pass ]
+crbug.com/591099 media/controls/video-controls-with-cast-rendering.html [ Failure Pass ]
+crbug.com/591099 media/controls/video-enter-exit-fullscreen-while-hovering-shows-controls.html [ Pass Timeout ]
 crbug.com/591099 media/controls/volumechange-muted-attribute.html [ Failure Pass ]
 crbug.com/714962 media/controls/volumechange-stopimmediatepropagation.html [ Failure Pass ]
 crbug.com/591099 media/media-document-audio-repaint.html [ Failure ]
@@ -5987,7 +5945,7 @@
 crbug.com/591099 media/video-canvas-alpha.html [ Failure ]
 crbug.com/591099 media/video-colorspace-yuv420.html [ Failure ]
 crbug.com/591099 media/video-colorspace-yuv422.html [ Failure ]
-crbug.com/591099 media/video-controls-fullscreen.html [ Timeout ]
+crbug.com/591099 media/video-controls-fullscreen.html [ Pass Timeout ]
 crbug.com/591099 media/video-controls-visible-audio-only.html [ Failure ]
 crbug.com/591099 media/video-layer-crash.html [ Failure ]
 crbug.com/591099 media/video-persistence.html [ Crash ]
@@ -6701,7 +6659,7 @@
 crbug.com/591099 plugins/plugin-initiate-popup-window.html [ Timeout ]
 crbug.com/591099 plugins/refcount-leaks.html [ Failure ]
 crbug.com/591099 plugins/tabindex.html [ Failure ]
-crbug.com/591099 plugins/webview-plugin-lifecycle.html [ Failure ]
+crbug.com/591099 plugins/webview-plugin-lifecycle.html [ Failure Pass ]
 crbug.com/591099 plugins/webview-plugin-nested-iframe-scroll.html [ Failure ]
 crbug.com/591099 pointer-lock/pointerlockchange-pointerlockerror-events.html [ Failure ]
 crbug.com/591099 printing/absolute-position-headers-and-footers.html [ Failure ]
@@ -6712,7 +6670,7 @@
 crbug.com/591099 printing/css2.1/page-break-after-003.html [ Failure ]
 crbug.com/591099 printing/css2.1/page-break-after-004.html [ Failure ]
 crbug.com/591099 printing/css2.1/page-break-before-000.html [ Failure ]
-crbug.com/714962 printing/css2.1/page-break-inside-000.html [ Failure ]
+crbug.com/714962 printing/css2.1/page-break-inside-000.html [ Failure Pass ]
 crbug.com/591099 printing/ellipsis-printing-style.html [ Failure ]
 crbug.com/591099 printing/fixed-positioned-but-static-headers-and-footers.html [ Failure ]
 crbug.com/591099 printing/fixed-positioned-child-repeats-even-when-html-and-body-are-zero-height.html [ Crash ]
@@ -6755,7 +6713,6 @@
 crbug.com/591099 printing/thead-repeats-at-top-of-each-page.html [ Failure ]
 crbug.com/591099 printing/thead-under-multicol.html [ Failure ]
 crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
-crbug.com/714962 scrollbars/border-box-rect-clips-scrollbars.html [ Failure Pass ]
 crbug.com/591099 scrollbars/custom-scrollbar-enable-changes-thickness-with-iframe.html [ Failure ]
 crbug.com/591099 scrollbars/custom-scrollbar-with-incomplete-style.html [ Failure ]
 crbug.com/714962 scrollbars/custom-scrollbars-paint-outside-iframe.html [ Failure ]
@@ -6778,7 +6735,7 @@
 crbug.com/591099 storage/indexeddb/cursor-advance.html [ Pass Timeout ]
 crbug.com/591099 storage/indexeddb/cursor-continue-validity.html [ Timeout ]
 crbug.com/591099 storage/indexeddb/cursor-key-order.html [ Timeout ]
-crbug.com/591099 storage/indexeddb/cursor-update.html [ Pass Timeout ]
+crbug.com/591099 storage/indexeddb/cursor-update.html [ Timeout ]
 crbug.com/591099 storage/indexeddb/deleted-objects.html [ Timeout ]
 crbug.com/714962 storage/indexeddb/empty-blob-file.html [ Failure ]
 crbug.com/591099 storage/indexeddb/exceptions.html [ Timeout ]
@@ -6965,8 +6922,6 @@
 crbug.com/591099 svg/custom/foreign-object-skew.svg [ Failure ]
 crbug.com/591099 svg/custom/getscreenctm-in-mixed-content.xhtml [ Failure ]
 crbug.com/591099 svg/custom/getscreenctm-in-mixed-content2.xhtml [ Failure ]
-crbug.com/591099 svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml [ Failure Pass ]
-crbug.com/591099 svg/custom/getscreenctm-in-scrollable-div-area.xhtml [ Failure Pass ]
 crbug.com/591099 svg/custom/getsvgdocument.html [ Failure ]
 crbug.com/714962 svg/custom/group-opacity.svg [ Failure ]
 crbug.com/591099 svg/custom/hit-test-path-stroke.svg [ Failure ]
@@ -7074,7 +7029,7 @@
 crbug.com/591099 svg/parser/whitespace-length-invalid-1.html [ Pass Timeout ]
 crbug.com/591099 svg/parser/whitespace-length-invalid-2.html [ Pass Timeout ]
 crbug.com/591099 svg/parser/whitespace-length-invalid-3.html [ Pass Timeout ]
-crbug.com/591099 svg/parser/whitespace-length-invalid-4.html [ Pass Timeout ]
+crbug.com/591099 svg/parser/whitespace-length-invalid-4.html [ Timeout ]
 crbug.com/591099 svg/parser/whitespace-number.html [ Timeout ]
 crbug.com/591099 svg/text/bbox-with-glyph-overflow-on-path.html [ Failure ]
 crbug.com/591099 svg/text/bbox-with-glyph-overflow-zoomed.html [ Failure ]
@@ -7111,8 +7066,8 @@
 crbug.com/591099 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
 crbug.com/714962 svg/zoom/page/zoom-mask-with-percentages.svg [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm [ Failure ]
-crbug.com/591099 svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html [ Crash Failure ]
-crbug.com/591099 svg/zoom/page/zoom-svg-as-background-with-relative-size.html [ Crash Failure ]
+crbug.com/591099 svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html [ Crash ]
+crbug.com/591099 svg/zoom/page/zoom-svg-as-background-with-relative-size.html [ Crash ]
 crbug.com/591099 svg/zoom/page/zoom-svg-as-image.html [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-svg-as-object.html [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-svg-as-relative-image.html [ Failure ]
@@ -7330,10 +7285,8 @@
 crbug.com/714962 touchadjustment/context-menu-text-subtargets.html [ Failure ]
 crbug.com/714962 touchadjustment/context-menu.html [ Failure ]
 crbug.com/714962 touchadjustment/disabled-formelements.html [ Failure ]
-crbug.com/714962 touchadjustment/event-triggered-widgets.html [ Failure Pass ]
-crbug.com/714962 touchadjustment/html-label.html [ Failure Pass ]
 crbug.com/591099 touchadjustment/small-target-test.html [ Failure ]
-crbug.com/714962 touchadjustment/stylus-generated-gesture-tap.html [ Failure ]
+crbug.com/714962 touchadjustment/stylus-generated-gesture-tap.html [ Failure Pass ]
 crbug.com/714962 touchadjustment/touch-inlines.html [ Failure ]
 crbug.com/714962 touchadjustment/touch-links-active.html [ Failure ]
 crbug.com/714962 touchadjustment/touch-links-longpress.html [ Failure ]
@@ -7430,7 +7383,7 @@
 crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-simple.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-sizing.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-tiled.html [ Failure ]
-crbug.com/714962 virtual/gpu-rasterization/images/drag-image-transformed-parent.html [ Failure ]
+crbug.com/714962 virtual/gpu-rasterization/images/drag-image-transformed-parent.html [ Failure Pass ]
 crbug.com/591099 virtual/gpu-rasterization/images/embed-does-not-propagate-dimensions-to-object-ancestor.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/favicon-as-image.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/gif-loop-count.html [ Failure ]
@@ -7482,7 +7435,7 @@
 crbug.com/714962 virtual/gpu/fast/canvas/setWidthResetAfterForcedRender.html [ Failure ]
 crbug.com/591099 virtual/high-contrast-mode/paint/high-contrast-mode/image-filter-all/text-on-backgrounds.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html [ Failure ]
-crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html [ Failure ]
+crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html [ Failure Pass ]
 crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-002.html [ Pass ]
 crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/shadow-trees/reprojection/reprojection-001.html [ Pass ]
 crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/shadow-trees/shadow-root-002.html [ Pass ]
@@ -7493,8 +7446,7 @@
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/drop-event-for-input-in-shadow.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/event-path-for-user-agent-shadow-tree.html [ Crash ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/focus-navigation-with-distributed-nodes.html [ Crash ]
-crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/form-in-shadow.html [ Crash ]
-crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/hover-active-drag-distributed-nodes.html [ Failure Pass ]
+crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/form-in-shadow.html [ Crash Pass ]
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc.html [ Failure ]
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/input-color-in-content.html [ Timeout ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/make-marquee-bold-by-exec-command-crash.html [ Pass ]
@@ -7502,7 +7454,7 @@
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/normalize-progress-element-crash.html [ Crash ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/querySelector-for-useragent-shadowroot.html [ Crash ]
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/scrollbar.html [ Crash ]
-crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/select-in-shadowdom.html [ Failure ]
+crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/select-in-shadowdom.html [ Failure Pass ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/selections-in-shadow.html [ Timeout ]
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/shadow-boundary-crossing.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/shadow-contents-event.html [ Crash ]
@@ -7542,19 +7494,19 @@
 crbug.com/591099 virtual/layout_ng/fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html [ Pass ]
 crbug.com/591099 virtual/layout_ng/overflow/overflow-basic-003.html [ Pass ]
 crbug.com/591099 virtual/layout_ng/overflow/overflow-bug-chrome-ng-001.html [ Pass ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-on-play-button.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-backwards-at-start.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-backwards.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-forwards-too-short.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-forwards.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-toggle-fullscreen.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/scrubbing-touch.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/scrubbing.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/singletap-on-outside.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/singletap-on-overlay-closes-overflow-menu.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/singletap-on-play-button.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/slow-doubletap.html [ Crash ]
-crbug.com/591099 virtual/modern-media-controls/media/controls/modern/tap-to-hide-controls.html [ Crash ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-on-play-button.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-backwards-at-start.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-backwards.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-forwards-too-short.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-forwards.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/doubletap-to-toggle-fullscreen.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/scrubbing-touch.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/scrubbing.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/singletap-on-outside.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/singletap-on-overlay-closes-overflow-menu.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/singletap-on-play-button.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/slow-doubletap.html [ Crash Pass ]
+crbug.com/591099 virtual/modern-media-controls/media/controls/modern/tap-to-hide-controls.html [ Crash Pass ]
 crbug.com/591099 virtual/mojo-localstorage/ [ Skip ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/anchor-empty-focus.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/autoscroll-disabled-in-fix.html [ Timeout ]
@@ -7581,7 +7533,8 @@
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/drag-and-drop-subframe-dataTransfer.html [ Timeout ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/drag-dataTransferItemList-file-handling.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/drag-in-frames.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/drag-selects-culled-inlines.html [ Failure ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/drag-on-removed-slider-does-not-crash.html [ Crash Pass ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/drag-selects-culled-inlines.html [ Failure Pass ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/drag-selects-image.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/drag_and_drop_into_removed_on_focus.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/event-listener-on-link.html [ Failure ]
@@ -7602,7 +7555,6 @@
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/keydown-keypress-preventDefault.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/keypress-focus-change.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/media-element-focus-tab.html [ Failure ]
-crbug.com/714962 virtual/mouseevent_fractional/fast/events/middleClickAutoscroll-click-hyperlink.html [ Pass Timeout ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/middleClickAutoscroll-latching.html [ Pass Timeout ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/mouse-down-on-pseudo-element-remove-crash.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/mouse-drag-from-frame-to-other-frame.html [ Failure ]
@@ -7642,7 +7594,7 @@
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-allowed-from-gesture-initiated-event.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-allowed-from-gesture-only-once-iframes.html [ Timeout ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-blocked-from-different-frames.html [ Failure ]
-crbug.com/714962 virtual/mouseevent_fractional/fast/events/popup-blocked-from-wrong-event.html [ Timeout ]
+crbug.com/714962 virtual/mouseevent_fractional/fast/events/popup-blocked-from-wrong-event.html [ Pass Timeout ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/reveal-link-when-focused.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/right-click-focus.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/scroll-after-click-on-tab-index.html [ Failure ]
@@ -7654,10 +7606,9 @@
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/selectstart-by-single-click-with-shift.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/sequential-focus-navigation-starting-point.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html [ Failure ]
-crbug.com/714962 virtual/mouseevent_fractional/fast/events/simulated-click-coords.html [ Failure Pass ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/submit-reset-nested-bubble.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/tab-imagemap.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/tabindex-focus-blur-all.html [ Crash ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/tabindex-focus-blur-all.html [ Crash Pass ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects-scroll.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-click-on-inline-continations.html [ Failure ]
@@ -7665,12 +7616,12 @@
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-input-after-composition.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-mouse-events.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-result.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input-crash.html [ Crash ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input-crash.html [ Crash Pass ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input-csp.html [ Crash Timeout ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input.html [ Crash Timeout ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/touch-before-pressing-spin-button.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-fractional-coordinates.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-handler-assert-input-range.html [ Crash ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-handler-assert-input-range.html [ Crash Pass ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-slider-no-js-touch-listener.html [ Crash Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-slider.html [ Crash Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/wheel/latched-scroll-node-removed.html [ Pass ]
@@ -7689,15 +7640,15 @@
 crbug.com/591099 virtual/prefer_compositing_to_lcd_text/ [ Skip ]
 crbug.com/714962 virtual/pwa-full-code-cache/http/tests/devtools/service-workers/service-workers-view.js [ Failure ]
 crbug.com/591099 virtual/rootlayerscrolls/ [ Skip ]
-crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance.html [ Failure ]
+crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance.html [ Failure Pass ]
 crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure ]
 crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/popup-menu-with-scrollbar-appearance.html [ Failure ]
-crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance.html [ Failure ]
-crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure ]
+crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance.html [ Failure Pass ]
+crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure Pass ]
 crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/popup-menu-appearance.html [ Failure ]
 crbug.com/591099 virtual/scalefactor200/fast/hidpi/static/popup-menu-with-scrollbar-appearance.html [ Failure ]
-crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance.html [ Failure ]
-crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure ]
+crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance.html [ Failure Pass ]
+crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure Pass ]
 crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/popup-menu-appearance.html [ Failure ]
 crbug.com/591099 virtual/scalefactor200withzoom/fast/hidpi/static/popup-menu-with-scrollbar-appearance.html [ Failure ]
 crbug.com/591099 virtual/scroll_customization/ [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 5c85ab1..1ce9100 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -3265,6 +3265,9 @@
 # Timeout due to events not firing
 crbug.com/781935 fast/mediastream/MediaStreamTrack-observer-iterate-no-crash.html [ Timeout ]
 crbug.com/781935 fast/mediastream/MediaStreamTrack.html [ Timeout ]
+# Temporary suspension for landing a WebRTC change
+crbug.com/801642 external/wpt/webrtc/RTCPeerConnection-getStats.https.html [ Pass Failure ]
+crbug.com/801642 external/wpt/webrtc/RTCPeerConnection-track-stats.https.html [ Pass Failure ]
 
 # Sheriff failures 2017-10-04
 crbug.com/770691 [ Win7 Linux Mac10.11 ] media/controls/lazy-loaded-style.html [ Failure Pass ]
@@ -3462,3 +3465,7 @@
 # This test is failing regularly on Win 7 (dgb), WebKit Mac10.11 (dgb),
 # WebKit Linux Trusty (dbg).
 crbug.com/803449 http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-restored-breakpoint.js [ Pass Failure ]
+
+# Sheriff failures 2018-01-23
+# Flaking on linux_chromium_rel_ng
+crbug.com/804709 [ Linux ] virtual/gpu/fast/canvas/canvas-fillPath-shadow.html [ Pass Failure ]
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/resources/common.js b/third_party/WebKit/LayoutTests/crypto/subtle/resources/common.js
index afdfa9b..39640d7 100644
--- a/third_party/WebKit/LayoutTests/crypto/subtle/resources/common.js
+++ b/third_party/WebKit/LayoutTests/crypto/subtle/resources/common.js
@@ -25,10 +25,6 @@
 {
     if (!bytes)
         return null;
-    // "bytes" could be a typed array with a detached buffer, in which case the
-    // constructor below would throw.
-    if (bytes.length === 0)
-        return "";
 
     bytes = new Uint8Array(bytes);
     var hexBytes = [];
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
index 1e543481..26c1931 100644
--- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
+++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -66989,6 +66989,30 @@
      {}
     ]
    ],
+   "css/css-ui/text-overflow-024.html": [
+    [
+     "/css/css-ui/text-overflow-024.html",
+     [
+      [
+       "/css/css-ui/text-overflow-024-ref.html",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
+   "css/css-ui/text-overflow-025.html": [
+    [
+     "/css/css-ui/text-overflow-025.html",
+     [
+      [
+       "/css/css-ui/text-overflow-025-ref.html",
+       "=="
+      ]
+     ],
+     {}
+    ]
+   ],
    "css/css-values/attr-color-invalid-cast.html": [
     [
      "/css/css-values/attr-color-invalid-cast.html",
@@ -117778,6 +117802,16 @@
      {}
     ]
    ],
+   "css/css-ui/text-overflow-024-ref.html": [
+    [
+     {}
+    ]
+   ],
+   "css/css-ui/text-overflow-025-ref.html": [
+    [
+     {}
+    ]
+   ],
    "css/css-ui/text-overflow-ref.html": [
     [
      {}
@@ -164527,6 +164561,158 @@
      }
     ]
    ],
+   "bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/empty-filter.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/empty-filter.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/empty-filters-member.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/empty-filters-member.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/empty-namePrefix.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/empty-namePrefix.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/empty-services-member.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/empty-services-member.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/filters-xor-acceptAllDevices.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/filters-xor-acceptAllDevices.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-name-unicode.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-name-unicode.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-name.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-name.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-namePrefix-unicode.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-namePrefix-unicode.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-namePrefix.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-namePrefix.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-name-unicode.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-name-unicode.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-name.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-name.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-namePrefix-unicode.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-namePrefix-unicode.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/max-length-namePrefix.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/max-length-namePrefix.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/no-arguments.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/no-arguments.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-namePrefix.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-namePrefix.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
+   "bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.https.html": [
+    [
+     "/bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.https.html",
+     {
+      "testdriver": true
+     }
+    ]
+   ],
    "bluetooth/server/connect/connection-succeeds.https.html": [
     [
      "/bluetooth/server/connect/connection-succeeds.https.html",
@@ -172291,9 +172477,15 @@
      {}
     ]
    ],
-   "css/css-typed-om/the-stylepropertymap/computed/get.tentative.html": [
+   "css/css-typed-om/the-stylepropertymap/computed/get-invalid.html": [
     [
-     "/css/css-typed-om/the-stylepropertymap/computed/get.tentative.html",
+     "/css/css-typed-om/the-stylepropertymap/computed/get-invalid.html",
+     {}
+    ]
+   ],
+   "css/css-typed-om/the-stylepropertymap/computed/get.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/computed/get.html",
      {}
     ]
    ],
@@ -172345,9 +172537,15 @@
      {}
     ]
    ],
-   "css/css-typed-om/the-stylepropertymap/declared/get.tentative.html": [
+   "css/css-typed-om/the-stylepropertymap/declared/get-invalid.html": [
     [
-     "/css/css-typed-om/the-stylepropertymap/declared/get.tentative.html",
+     "/css/css-typed-om/the-stylepropertymap/declared/get-invalid.html",
+     {}
+    ]
+   ],
+   "css/css-typed-om/the-stylepropertymap/declared/get.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/declared/get.html",
      {}
     ]
    ],
@@ -172411,9 +172609,15 @@
      {}
     ]
    ],
-   "css/css-typed-om/the-stylepropertymap/inline/get.tentative.html": [
+   "css/css-typed-om/the-stylepropertymap/inline/get-invalid.html": [
     [
-     "/css/css-typed-om/the-stylepropertymap/inline/get.tentative.html",
+     "/css/css-typed-om/the-stylepropertymap/inline/get-invalid.html",
+     {}
+    ]
+   ],
+   "css/css-typed-om/the-stylepropertymap/inline/get.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/inline/get.html",
      {}
     ]
    ],
@@ -237216,8 +237420,84 @@
    "50eaac3e0c94933fa995c102d53b6b00b3087ea6",
    "testharness"
   ],
+  "bluetooth/requestDevice/canonicalizeFilter/device-name-longer-than-29-bytes.https.html": [
+   "238bfa4cae4a577d6725071585d3f4fb17211926",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/empty-filter.https.html": [
+   "dae6caddeebd483e59878e86ca0452dc90bf15ef",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/empty-filters-member.https.html": [
+   "1d3eddd98c230893f6a5f01c4af71145e89d3f9a",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/empty-namePrefix.https.html": [
+   "c12927b93a1e99ff1f64730f355f832136182d53",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/empty-services-member.https.html": [
+   "9830afe0985081f12c74bdd3f6bb4ab3dacf64d6",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/filters-xor-acceptAllDevices.https.html": [
+   "a640294f0ef02f113a2d6923c357d173dde13c8d",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-name-unicode.https.html": [
+   "9c48f80d91ebcd2fb30656d2db2d134ea52b1b84",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-name.https.html": [
+   "aff336b8d2e7f37a86afbf8dddc226a05b89c7ac",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-namePrefix-unicode.https.html": [
+   "cdd53f12480cdc6d04e6d6a60b9a638d28331757",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-exceeded-namePrefix.https.html": [
+   "e891ad094e4ce751bfdbb594432f1e050b8bb678",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-name-unicode.https.html": [
+   "e6235150373eda2b417fb5e44a9fb0250f79e10b",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-name.https.html": [
+   "f665d5b53ac10adf947b0fa776fb4acf88ec157c",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-namePrefix-unicode.https.html": [
+   "577824e52873a8b056438563c993a157febc27d7",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/max-length-namePrefix.https.html": [
+   "ecd4a495dd13d01cc59119493022aecedb5e04f6",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/no-arguments.https.html": [
+   "b070a7357a626cee31f66938561a1a62576be086",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-name.https.html": [
+   "9d5c26e54b12ed4600690c78c17e2d92b33f99b9",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/unicode-valid-length-name-namePrefix.https.html": [
+   "8370c2c6f65767144257fcba7032eef4410ef994",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-optionalServices-member.https.html": [
+   "4e8728f88844525f7fb95680499fc2024f74482c",
+   "testharness"
+  ],
+  "bluetooth/requestDevice/canonicalizeFilter/wrong-service-in-services-member.https.html": [
+   "084ec334261ed7c584a0888ff3dfdec0f3538bad",
+   "testharness"
+  ],
   "bluetooth/resources/bluetooth-helpers.js": [
-   "bb8e5f352bdaff51bf56c366f30f99c9f1672925",
+   "1944dc57df774ad737179dd22fb3cc9de842bc21",
    "support"
   ],
   "bluetooth/resources/health-thermometer-iframe.html": [
@@ -254321,7 +254601,7 @@
    "testharness"
   ],
   "css/css-align/content-distribution/parse-align-content-002.html": [
-   "e4346623eb98505e10e638fba735648eb95a4a3b",
+   "1b57303c27c9ca6a195f380db7c65c6953235189",
    "testharness"
   ],
   "css/css-align/content-distribution/parse-align-content-003.html": [
@@ -254329,23 +254609,23 @@
    "testharness"
   ],
   "css/css-align/content-distribution/parse-align-content-004.html": [
-   "25b97afad60913e08fcad5bef4217cad1d88ebfd",
+   "38d4d969e140dad7914c7c36ff25fd7d8b8e47ed",
    "testharness"
   ],
   "css/css-align/content-distribution/parse-align-content-005.html": [
-   "9e324ebeacdc89d2257069b21fb017767513a27e",
+   "473d879d7a0a7ccfc58f8ad319af98859acaaace",
    "testharness"
   ],
   "css/css-align/content-distribution/parse-justify-content-001.html": [
-   "25b5da714c58f79b2a42b8ee8a435291e6be46c9",
+   "6583e380dc9c8e9d2523980e4042a803b7407d51",
    "testharness"
   ],
   "css/css-align/content-distribution/parse-justify-content-002.html": [
-   "52ed60528d9672ce65f0cfa06969ca3a9b826c31",
+   "eb16c39bcdbb30282778410636f7f8966bf1b3df",
    "testharness"
   ],
   "css/css-align/content-distribution/parse-justify-content-003.html": [
-   "37ddda34449409c9565d19f05f6c0c81989412e0",
+   "1b0dbd21eb728870b7f433a585745611549adaf5",
    "testharness"
   ],
   "css/css-align/content-distribution/parse-justify-content-004.html": [
@@ -254357,11 +254637,11 @@
    "testharness"
   ],
   "css/css-align/content-distribution/place-content-shorthand-001.html": [
-   "c0d87c542bd637ff3ac5bd5c6dc33a4d5bef49ed",
+   "7327baf678379d0bc6c61b4bcff37edbf7b168aa",
    "testharness"
   ],
   "css/css-align/content-distribution/place-content-shorthand-002.html": [
-   "bb7956c56dafba251bcba74abf922d983b8bcffd",
+   "0caac72bd49faec444977b96b101922d848ca9a3",
    "testharness"
   ],
   "css/css-align/content-distribution/place-content-shorthand-003.html": [
@@ -254369,7 +254649,7 @@
    "testharness"
   ],
   "css/css-align/content-distribution/place-content-shorthand-004.html": [
-   "f6927e1d464df4fe22cd01bb4779eb64cf790ab4",
+   "8595a09b388f83a8a9df6d3175f2e3f8d1ffd1ab",
    "testharness"
   ],
   "css/css-align/content-distribution/place-content-shorthand-005.html": [
@@ -254377,7 +254657,7 @@
    "testharness"
   ],
   "css/css-align/content-distribution/place-content-shorthand-006.html": [
-   "016c2ff7902fc01d8368645b7177e3932aa64d42",
+   "5eaf145e4c91b972937ee364ba07be05cb44d1fd",
    "testharness"
   ],
   "css/css-align/default-alignment/justify-items-legacy-001.html": [
@@ -254389,7 +254669,7 @@
    "testharness"
   ],
   "css/css-align/default-alignment/parse-align-items-002.html": [
-   "2fc31763bfb3f524ce97f819132ff838152bddd7",
+   "eb9d656eb94d7bb2ef11286b28ceb90a71ef9774",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-align-items-003.html": [
@@ -254397,27 +254677,27 @@
    "testharness"
   ],
   "css/css-align/default-alignment/parse-align-items-004.html": [
-   "470d3ef1b1d4c6eeb4c2067d79f966c742ec3ca9",
+   "e2c96ca7f861965ffe525fa8de7132c041230dac",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-align-items-005.html": [
-   "98718dab73f6ee062968fd1671bb785fb8e8998f",
+   "e5b9aed617b086152a25ffb4b3a39a8898a3622e",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-justify-items-001.html": [
-   "a8b4aa683e015a1e06157c1fffb533c4ff28a0ea",
+   "22ad0125b0fe5750d4408a119bf97eca354d5de2",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-justify-items-002.html": [
-   "c9686f7a9c05c601440cfeb7c6ee83a884d310c7",
+   "b74652a3770f5bf8b7184748d62a21625f9121b3",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-justify-items-003.html": [
-   "ca1db7d5575a9c5c5a1ccb14b38a250c515b1ab0",
+   "e96703a6bdcf99f64ee89a8fd7f3baf918d772af",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-justify-items-004.html": [
-   "a654d1aa62c6f04df1fd3e9e81272600eb9c6752",
+   "e2e61304ecccb8f0892eebb0eda6b510287174a6",
    "testharness"
   ],
   "css/css-align/default-alignment/parse-justify-items-005.html": [
@@ -254429,11 +254709,11 @@
    "testharness"
   ],
   "css/css-align/default-alignment/place-items-shorthand-001.html": [
-   "cc69bbbee852e6cd203d3f39dac2a1e05a428361",
+   "c0ad68a99b701a8cebdc8ca15c607255934aec9e",
    "testharness"
   ],
   "css/css-align/default-alignment/place-items-shorthand-002.html": [
-   "77bb21f97a9448b03da8b97adc3accf1308eb647",
+   "417940192184c7b8b3a5b2f0968f3fb1bf61c75e",
    "testharness"
   ],
   "css/css-align/default-alignment/place-items-shorthand-003.html": [
@@ -254441,7 +254721,7 @@
    "testharness"
   ],
   "css/css-align/default-alignment/place-items-shorthand-004.html": [
-   "17f58a8c43e114540e5fe5a63ec4502a50231e10",
+   "aaef935a9d7c68e7ea2ed4d078960fc7928743bc",
    "testharness"
   ],
   "css/css-align/default-alignment/place-items-shorthand-005.html": [
@@ -254449,7 +254729,7 @@
    "testharness"
   ],
   "css/css-align/default-alignment/place-items-shorthand-006.html": [
-   "3de2cbe0f38c6efd2cf830fadc858988600b7900",
+   "a9c24a8ffd4c5b7972c788bd1ec28dae85441054",
    "testharness"
   ],
   "css/css-align/distribution-values/space-evenly-001.html": [
@@ -254461,7 +254741,7 @@
    "support"
   ],
   "css/css-align/resources/alignment-parsing-utils.js": [
-   "ee99e164cf95fb2a39ef999c5700bf5750b49345",
+   "fc226596e223768205da5aedae6febd014eff18a",
    "support"
   ],
   "css/css-align/self-alignment/parse-align-self-001.html": [
@@ -254469,7 +254749,7 @@
    "testharness"
   ],
   "css/css-align/self-alignment/parse-align-self-002.html": [
-   "1c5027f3f20691d6a73712d671ff824d618da69d",
+   "25d0f676cb296c9fa7de67cee5ac988733ccbd13",
    "testharness"
   ],
   "css/css-align/self-alignment/parse-align-self-003.html": [
@@ -254477,23 +254757,23 @@
    "testharness"
   ],
   "css/css-align/self-alignment/parse-align-self-004.html": [
-   "e0262f878d4f26e44894813033015daf9c4c7d9c",
+   "48d48c3e5c3eff5143644cc7550c6c6b7b92bea7",
    "testharness"
   ],
   "css/css-align/self-alignment/parse-align-self-005.html": [
-   "22e055e8837ddf2e4de5e4fd9f3abce3168956e2",
+   "190a7d276072604ce21a7dc00676ff32d2dba57d",
    "testharness"
   ],
   "css/css-align/self-alignment/parse-justify-self-001.html": [
-   "3cb9322f0d9fbd06c98ccf6f820a3bfbb677b103",
+   "89941847e431d0b8a59358f3437b3bd0db861227",
    "testharness"
   ],
   "css/css-align/self-alignment/parse-justify-self-002.html": [
-   "6ea4d8b71197a19a0e0ab7be959802130194c2e7",
+   "ef524eeed0dd9b2c41eab613aa08b3fd512c2903",
    "testharness"
   ],
   "css/css-align/self-alignment/parse-justify-self-003.html": [
-   "30a034f5ddd539cef713d3ba5c5644b592b85e8d",
+   "6674e5ccb4a514f5e2de40d0243756e7a6697f75",
    "testharness"
   ],
   "css/css-align/self-alignment/parse-justify-self-004.html": [
@@ -254505,11 +254785,11 @@
    "testharness"
   ],
   "css/css-align/self-alignment/place-self-shorthand-001.html": [
-   "62d9c6a64f6f97ed2ecef74d885397c648de3c14",
+   "ee69670069c503e5489bbccc42f19e732a4c740a",
    "testharness"
   ],
   "css/css-align/self-alignment/place-self-shorthand-002.html": [
-   "8e39715c6208aeaf483e2d7e9abb50870beffbc4",
+   "f93a263e135b7b5dabf85f0ce5278915164c02b6",
    "testharness"
   ],
   "css/css-align/self-alignment/place-self-shorthand-003.html": [
@@ -254517,7 +254797,7 @@
    "testharness"
   ],
   "css/css-align/self-alignment/place-self-shorthand-004.html": [
-   "006d63717f5d18bc09428a56b3a4d811ba11af9a",
+   "736c478d4806af3be3b4aa56d60b090e8a76f78f",
    "testharness"
   ],
   "css/css-align/self-alignment/place-self-shorthand-005.html": [
@@ -254525,7 +254805,7 @@
    "testharness"
   ],
   "css/css-align/self-alignment/place-self-shorthand-006.html": [
-   "5b394c37527b7a9fdc0d32ea14caddf36a72fe30",
+   "26d18cf2dfe1525a95efc1e92d981fa4292ecb3f",
    "testharness"
   ],
   "css/css-align/ttwf-reftest-alignContent.html": [
@@ -285529,7 +285809,7 @@
    "support"
   ],
   "css/css-typed-om/resources/testhelper.js": [
-   "73fd40cdcca16318de32c214b00e24c6f30d98ee",
+   "f06d685311e05da81ae332326863211c0230c519",
    "support"
   ],
   "css/css-typed-om/styleMap-update-function.html": [
@@ -285732,8 +286012,12 @@
    "f217ed58d7f56ea588aa942fddfec0322d557283",
    "testharness"
   ],
-  "css/css-typed-om/the-stylepropertymap/computed/get.tentative.html": [
-   "caf3a345b03a2b929af25a8b360d5da9bb59fb5a",
+  "css/css-typed-om/the-stylepropertymap/computed/get-invalid.html": [
+   "429ff102428a84ca0a1903de1752a56c3ff5bd29",
+   "testharness"
+  ],
+  "css/css-typed-om/the-stylepropertymap/computed/get.html": [
+   "39d85ac0274ffcbc060654df3e53ae0984dce9d3",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/computed/getAll.tentative.html": [
@@ -285768,8 +286052,12 @@
    "5e2a8ca9f0246aaba3e7d7d038cad125194c5f14",
    "testharness"
   ],
-  "css/css-typed-om/the-stylepropertymap/declared/get.tentative.html": [
-   "944052a99d1b5cc1a574c07339c33fdb6b1423d4",
+  "css/css-typed-om/the-stylepropertymap/declared/get-invalid.html": [
+   "649ab2a64f0b0959e06bdc7968fc28247841bb25",
+   "testharness"
+  ],
+  "css/css-typed-om/the-stylepropertymap/declared/get.html": [
+   "45032bb362cf1c6faed623e0538779db6a6dea3a",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/declared/getAll.tentative.html": [
@@ -285812,8 +286100,12 @@
    "922297b80497c164d4217559658a9043a99ebbf8",
    "testharness"
   ],
-  "css/css-typed-om/the-stylepropertymap/inline/get.tentative.html": [
-   "28c506dae933e33e536f02e17b110cced9ea0278",
+  "css/css-typed-om/the-stylepropertymap/inline/get-invalid.html": [
+   "1494cfe202fb93881fc60a3ed2a372a7a8b25b37",
+   "testharness"
+  ],
+  "css/css-typed-om/the-stylepropertymap/inline/get.html": [
+   "ffed62a6ddbeb7bfe7cb71e76f4d4c5d7e9039e7",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/inline/getAll.tentative.html": [
@@ -288120,6 +288412,22 @@
    "4fd38a517e41851216d12db8c6b732d96f76e325",
    "testharness"
   ],
+  "css/css-ui/text-overflow-024-ref.html": [
+   "c43715bf1ea3dd118f7b71479bd5239e01bbb314",
+   "support"
+  ],
+  "css/css-ui/text-overflow-024.html": [
+   "7c18a786a3bfc9d1a8e9cc108ae228b979cacb6e",
+   "reftest"
+  ],
+  "css/css-ui/text-overflow-025-ref.html": [
+   "13056acc82d5e59310d10af30da8e46f73929e5f",
+   "support"
+  ],
+  "css/css-ui/text-overflow-025.html": [
+   "b4a2e0d1b86fd8893421de4335c9b6f36df1fc4d",
+   "reftest"
+  ],
   "css/css-ui/text-overflow-ref.html": [
    "db55b0b95a7406e9c4f00081b3e2cbe6b07363f7",
    "support"
@@ -307125,7 +307433,7 @@
    "support"
   ],
   "generic-sensor/generic-sensor-tests.js": [
-   "f83c6da49787e87d6fefbe6d5d9c87fad6c34d37",
+   "0f1cea2c0d3f38220cbfdbe4f47d713214987cbd",
    "support"
   ],
   "generic-sensor/idlharness.https.html": [
@@ -315813,7 +316121,7 @@
    "testharness"
   ],
   "html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt": [
-   "2942c5fe972b98941aa27505b8b6ac5534799634",
+   "34452eb94a2b4b64b98a00502995dd05943c0a33",
    "support"
   ],
   "html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html": [
@@ -323817,7 +324125,7 @@
    "testharness"
   ],
   "html/semantics/scripting-1/the-script-element/module/load-error-events-inline.html": [
-   "9b35d8d7ba6bb4826274c9570056cc962660d715",
+   "bbdfd11cfc7e52748f07d09ebe7cf6782ad5e782",
    "testharness"
   ],
   "html/semantics/scripting-1/the-script-element/module/load-error-events.html": [
@@ -323833,7 +324141,7 @@
    "support"
   ],
   "html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml": [
-   "32a4a4db2a5325b909078c73f76ab51085e66c5a",
+   "4b41e3e07ff72b0f181b0dd3a6c1aab40a01da0c",
    "testharness"
   ],
   "html/semantics/scripting-1/the-script-element/module/module-vs-script-1.html": [
@@ -327521,7 +327829,7 @@
    "testharness"
   ],
   "media-source/mediasource-addsourcebuffer-expected.txt": [
-   "774e5c27436d2813181b20498f7c12a91663c8b9",
+   "bea6f8e57d87d1bc1bd4e7612f9603d867218866",
    "support"
   ],
   "media-source/mediasource-addsourcebuffer-mode-expected.txt": [
@@ -327533,7 +327841,7 @@
    "testharness"
   ],
   "media-source/mediasource-addsourcebuffer.html": [
-   "c65d474f5279b3238dccf50415b5995b9d6b80ca",
+   "34ba3bf54e410c5e5396ef69f256c1e3853dfe17",
    "testharness"
   ],
   "media-source/mediasource-append-buffer-expected.txt": [
@@ -327673,11 +327981,11 @@
    "testharness"
   ],
   "media-source/mediasource-is-type-supported-expected.txt": [
-   "5c5b1e9fb5ca5867571faf808388bf88e47d36fc",
+   "7761cd942a1d5b2a8b43dc2bdc0a0bcf59911f25",
    "support"
   ],
   "media-source/mediasource-is-type-supported.html": [
-   "3c22e7a06768ab1a942349f24b2e2f3240ce560b",
+   "84265f4f1db7429bf7ff0807c5ebddddc25d370c",
    "testharness"
   ],
   "media-source/mediasource-liveseekable.html": [
@@ -353285,7 +353593,7 @@
    "testharness"
   ],
   "webmessaging/MessageEvent.html": [
-   "7debf220e539b7bdef752e98b280398f17e8603b",
+   "5146873a9545548655893eda08bbf66ec3287218",
    "testharness"
   ],
   "webmessaging/MessageEvent_onmessage_postMessage_infinite_loop.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error-ref.html
index b6a6dec6..5e4c566 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error-ref.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error-ref.html
@@ -1,6 +1,10 @@
 <!DOCTYPE html>
 <html>
-<body>
-<div style="background: green; width: 100px; height: 100px"></div>
-</body>
+<canvas id="canvas" width="100" height="100"></canvas>
+<script>
+  var canvas = document.getElementById("canvas");
+  var ctx = canvas.getContext('2d');
+  ctx.fillStyle = 'green';
+  ctx.fillRect(50, 50, 50, 50);
+</script>
 </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error.https.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error.https.html
index 30a06eb..022b915 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-constructor-error.https.html
@@ -5,8 +5,7 @@
     #output {
         width: 100px;
         height: 100px;
-        background-image: paint(error);
-        background-color: green;
+        background-image: paint(errorIndicator), paint(successIndicator);
     }
 </style>
 <script src="/common/reftest-wait.js"></script>
@@ -15,11 +14,20 @@
 <div id="output"></div>
 
 <script id="code" type="text/worklet">
-registerPaint('error', class {
+registerPaint('errorIndicator', class {
     constructor() { throw Error('failed!'); }
+    // The paint function should not be executed because an error has been
+    // thrown.
     paint(ctx, geom) {
         ctx.fillStyle = 'red';
-        ctx.fillRect(0, 0, geom.width, geom.height);
+        ctx.fillRect(0, 0, 50, 50);
+    }
+});
+
+registerPaint('successIndicator', class {
+    paint(ctx, geom) {
+        ctx.fillStyle = 'green';
+        ctx.fillRect(50, 50, 50, 50);
     }
 });
 </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html
index 6e117f8..c185d890 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-paint-error.https.html
@@ -5,8 +5,7 @@
     #output {
         width: 100px;
         height: 100px;
-        background-image: paint(error);
-        background-color: green;
+        background-image: paint(errorIndicator), paint(successIndicator);
     }
 </style>
 <script src="/common/reftest-wait.js"></script>
@@ -15,13 +14,19 @@
 <div id="output"></div>
 
 <script id="code" type="text/worklet">
-registerPaint('error', class {
+registerPaint('errorIndicator', class {
     paint(ctx, geom) {
         ctx.fillStyle = 'red';
         ctx.fillRect(0, 0, geom.width, geom.height);
         throw Error('failed!');
     }
 });
+registerPaint('successIndicator', class {
+    paint(ctx, geom) {
+        ctx.fillStyle = 'green';
+        ctx.fillRect(0, 0, geom.width, geom.height);
+    }
+});
 </script>
 
 <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-pending-script.https.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-pending-script.https.html
index c4cf755..e19fa41 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-pending-script.https.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-paint-api/invalid-image-pending-script.https.html
@@ -5,16 +5,28 @@
     #output {
         width: 100px;
         height: 100px;
-        background-image: paint(invalid);
-        background-color: green;
+        background-image: paint(invalid), paint(successIndicator);
     }
 </style>
 <script src="/common/reftest-wait.js"></script>
 <script src="/common/css-paint-tests.js"></script>
 <body>
 <div id="output"></div>
+
+<script id="code" type="text/worklet">
+// This is testing that even though there is no paint function registered for
+// 'invalid', it won't cause any error, and the other painter (successIndicator)
+// will paint as usual.
+registerPaint('successIndicator', class {
+    paint(ctx, geom) {
+        ctx.fillStyle = 'green';
+        ctx.fillRect(0, 0, geom.width, geom.height);
+    }
+});
+</script>
+
 <script>
-    importPaintWorkletAndTerminateTestAfterAsyncPaint("");
+    importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent);
 </script>
 </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-024-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-024-ref.html
new file mode 100644
index 0000000..2e9b830
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-024-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Reference: text-overflow on tr::before with overflow:hidden</title>
+  <style type="text/css">
+
+    td {
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+
+  </style>
+</head>
+<body>
+PASS if there is an ellipsis at the end of the text below.
+  <table style="table-layout: fixed; width: 130px" cellpadding="0" cellspacing="0">
+    <tr><td>Some long text here that overflows and whatnot.</td></tr>
+  </table>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-024.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-024.html
new file mode 100644
index 0000000..0ca5b42
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-024.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Test: text-overflow on tr::before with overflow:hidden</title>
+  <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
+  <link rel="help" href="https://www.w3.org/TR/css3-ui/#text-overflow" title="5.2. the 'text-overflow' property">
+  <link rel="match" href="text-overflow-024-ref.html">
+  <style type="text/css">
+
+    tr::before {
+      content: "Some long text here that overflows and whatnot.";
+      display: table-cell;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+
+  </style>
+</head>
+<body>
+PASS if there is an ellipsis at the end of the text below.
+  <table style="table-layout: fixed; width: 130px" cellpadding="0" cellspacing="0">
+    <tr></tr>
+  </table>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-025-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-025-ref.html
new file mode 100644
index 0000000..c8acd47
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-025-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Reference: text-overflow on tr::before without overflow:hidden</title>
+  <style type="text/css">
+
+    td {
+      white-space: nowrap;
+    }
+
+  </style>
+</head>
+<body>
+PASS if there is no ellipsis below.
+  <table style="table-layout: fixed; width: 130px" cellpadding="0" cellspacing="0">
+    <tr><td>Some long text here that overflows and whatnot.</td></tr>
+  </table>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-025.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-025.html
new file mode 100644
index 0000000..3e0fce0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui/text-overflow-025.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<!--
+     Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+  <meta charset="utf-8">
+  <title>Test: text-overflow on tr::before without overflow:hidden</title>
+  <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu">
+  <link rel="help" href="https://www.w3.org/TR/css3-ui/#text-overflow" title="5.2. the 'text-overflow' property">
+  <link rel="match" href="text-overflow-025-ref.html">
+  <style type="text/css">
+
+    tr::before {
+      content: "Some long text here that overflows and whatnot.";
+      display: table-cell;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+    tr {
+      overflow: hidden;
+    }
+
+  </style>
+</head>
+<body>
+PASS if there is no ellipsis below.
+  <table style="table-layout: fixed; width: 130px" cellpadding="0" cellspacing="0">
+    <tr></tr>
+  </table>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js b/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js
index 1bc27b7d..4be4841 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/generic-sensor/generic-sensor-tests.js
@@ -10,7 +10,8 @@
   'AbsoluteOrientationSensor' : ['timestamp', 'quaternion'],
   'RelativeOrientationSensor' : ['timestamp', 'quaternion'],
   'GeolocationSensor' : ['timestamp', 'latitude', 'longitude', 'altitude',
-                         'accuracy', 'altitudeAccuracy', 'heading', 'speed']
+                         'accuracy', 'altitudeAccuracy', 'heading', 'speed'],
+  'ProximitySensor' : ['timestamp', 'max']
 };
 
 function assert_reading_not_null(sensor) {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/load-error-events-inline.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/load-error-events-inline.html
index c4dd0807..58397dd07 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/load-error-events-inline.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/load-error-events-inline.html
@@ -59,4 +59,3 @@
 <script onload="onLoad(test4_load);" onerror="onError(test4_load);" type="module" async>"use strict";onExecute(test4_load);</script>
 <script onload="onLoad(test1_error);" onerror="onError(test1_error);" type="module">"use strict";import "./not_found.js";</script>
 <script onload="onLoad(test4_error);" onerror="onError(test4_error);" type="module" async>"use strict";import "./not_found.js";</script>
-</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml
index 724c9e75..1655e61 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml
@@ -10,7 +10,11 @@
 window.evaluated_module_script = true;
 </script>
 <script>
-test(() => assert_true(window.evaluated_module_script), "module script in XHTML documents should be evaluated.");
+  var test = async_test("module script in XHTML documents should be evaluated.");
+  window.addEventListener("load", () => {
+    test.step(() => { assert_true(window.evaluated_module_script); });
+    test.done();
+  });
 </script>
 </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-updateviacache.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-updateviacache.https-expected.txt
deleted file mode 100644
index fdd3a3d..0000000
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-updateviacache.https-expected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-This is a testharness.js-based test.
-FAIL register-with-updateViaCache-undefined assert_true: New worker installing expected true got false
-FAIL register-with-updateViaCache-imports assert_true: New worker installing expected true got false
-FAIL register-with-updateViaCache-all assert_equals: reg.updateViaCache expected "all" but got "imports"
-FAIL register-with-updateViaCache-none assert_equals: reg.updateViaCache expected "none" but got "imports"
-PASS register-with-updateViaCache-undefined-then-undefined
-PASS register-with-updateViaCache-undefined-then-imports
-FAIL register-with-updateViaCache-undefined-then-all assert_equals: reg.updateViaCache updated expected "all" but got "imports"
-FAIL register-with-updateViaCache-undefined-then-none assert_equals: reg.updateViaCache updated expected "none" but got "imports"
-PASS register-with-updateViaCache-imports-then-undefined
-PASS register-with-updateViaCache-imports-then-imports
-FAIL register-with-updateViaCache-imports-then-all assert_equals: reg.updateViaCache updated expected "all" but got "imports"
-FAIL register-with-updateViaCache-imports-then-none assert_equals: reg.updateViaCache updated expected "none" but got "imports"
-FAIL register-with-updateViaCache-all-then-undefined assert_true: New worker installing expected true got false
-FAIL register-with-updateViaCache-all-then-imports assert_true: New worker installing expected true got false
-FAIL register-with-updateViaCache-all-then-all assert_equals: reg.updateViaCache updated expected "all" but got "imports"
-FAIL register-with-updateViaCache-all-then-none assert_equals: reg.updateViaCache updated expected "none" but got "imports"
-FAIL register-with-updateViaCache-none-then-undefined assert_true: New worker installing expected true got false
-FAIL register-with-updateViaCache-none-then-imports assert_true: New worker installing expected true got false
-FAIL register-with-updateViaCache-none-then-all assert_equals: reg.updateViaCache updated expected "all" but got "imports"
-FAIL register-with-updateViaCache-none-then-none assert_equals: reg.updateViaCache updated expected "none" but got "imports"
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webmessaging/MessageEvent.html b/third_party/WebKit/LayoutTests/external/wpt/webmessaging/MessageEvent.html
index e95b3ef..4fb68b59 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webmessaging/MessageEvent.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/webmessaging/MessageEvent.html
@@ -18,4 +18,11 @@
     assert_false(name in event);
   }, name + " on the instance");
 });
+
+test(function() {
+  var event = new MessageEvent("message");
+  assert_throws(new TypeError(), function() {
+    event.initMessageEvent();
+  }, "Not enough arguments to initMessageEvent");
+}, "initMessageEvent with no arguments");
 </script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas-api/canvas-createimagebitmap-resize-to-zero.html b/third_party/WebKit/LayoutTests/fast/canvas-api/canvas-createimagebitmap-resize-to-zero.html
new file mode 100644
index 0000000..e338f2c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas-api/canvas-createimagebitmap-resize-to-zero.html
@@ -0,0 +1,13 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+var t = async_test("Verify no crash when resizing an image bitmap to zero");
+var image = new Image();
+image.onload = t.step_func(function() {
+    var options = { resizeHeight: 0 };
+    var p1 = createImageBitmap(image, options);
+    p1.catch(function(error){});
+    t.done();
+});
+image.src = '../webgl/resources/red-green-semi-transparent-2x2.png';
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/layers/scrollable-area-removed-on-scroll-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/layers/scrollable-area-removed-on-scroll-crash-expected.txt
deleted file mode 100644
index 1c9bdd5..0000000
--- a/third_party/WebKit/LayoutTests/fast/layers/scrollable-area-removed-on-scroll-crash-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Scrollable area removed on scroll
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS removedContainer is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-This tests that an accessibility controller scroll update notification which removes the scroller from the DOM does not crash the browser.
diff --git a/third_party/WebKit/LayoutTests/fast/layers/scrollable-area-removed-on-scroll-crash.html b/third_party/WebKit/LayoutTests/fast/layers/scrollable-area-removed-on-scroll-crash.html
deleted file mode 100644
index 86c895c..0000000
--- a/third_party/WebKit/LayoutTests/fast/layers/scrollable-area-removed-on-scroll-crash.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<script src=../../resources/js-test.js></script>
-<style>
-#container {
-  overflow: scroll
-}
-.inner {
-  width: 2000px
-}
-</style>
-<p>This tests that an accessibility controller scroll update notification which
-removes the scroller from the DOM does not crash the browser.</p>
-<div id="container">
-  <div class="inner"></div>
-</div>
-<script>
-description("Scrollable area removed on scroll");
-
-window.jsTestIsAsync = true;
-var removedContainer = false;
-
-accessibilityController.addNotificationListener(function () {
-  if (!window.container)
-    return;
-  removedContainer = true;
-  container.parentNode.removeChild(container);
-});
-
-setTimeout(function() {
-  container.scrollLeft = 500;
-  setTimeout(function(){
-    shouldBeTrue("removedContainer");
-    finishJSTest();
-  }, 0);
-}, 0);
-</script>
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/empty-anchor.html b/third_party/WebKit/LayoutTests/fast/scrolling/empty-anchor.html
new file mode 100644
index 0000000..6aac8a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/empty-anchor.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+  body {
+    margin: 0;
+  }
+  div {
+    height: 2000px;
+  }
+</style>
+<div></div>
+<a id="anchor"></a>
+<script>
+  addEventListener('load', () => {
+    document.getElementById("anchor").scrollIntoView();
+    const max_scroll_offset =
+        document.scrollingElement.scrollHeight -
+        document.scrollingElement.clientHeight;
+    test(() => {
+      assert_equals(document.scrollingElement.scrollTop, max_scroll_offset);
+    },
+    "ScrollIntoView on empty anchor at end of document should scroll to end.");
+  });
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-ignore-offscreen-focused-imagemap.html b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-ignore-offscreen-focused-imagemap.html
new file mode 100644
index 0000000..b516aa8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/spatial-navigation/snav-ignore-offscreen-focused-imagemap.html
@@ -0,0 +1,44 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+  a {display: block;}
+  img {margin-top: 120%; margin-bottom: 120%; width: 200px; height: 200px;}
+</style>
+
+<a id="top" href="">top</a>
+<map name="map" title="map">
+  <area shape="rect" coords="20,20,70,70" href="#" id="1">
+  <area shape="rect" coords="130,20,180,70" href="#" id="2">
+  <area shape="rect" coords="20,130,70,180" href="#" id="3">
+  <area shape="rect" coords="130,130,180,180" href="#" id="4">
+</map>
+<img src="resources/green.png" usemap="#map">
+<a id="bottom" href="">bottom</a>
+
+<script>
+  if (window.testRunner) {
+    testRunner.overridePreference('WebKitTabToLinksPreferenceKey', 1);
+    testRunner.overridePreference('WebKitSpatialNavigationEnabled', 1);
+    testRunner.waitUntilDone();
+  }
+
+  document.getElementById("3").focus({preventScroll: true});
+
+  test(() => {
+    eventSender.keyDown('ArrowDown');
+    console.log(document.activeElement)
+    assert_equals(document.activeElement, document.getElementById("top"));
+  }, "Spatnav picks the visual viewport's topmost element when focus is off screen.");
+
+  document.getElementById("3").focus({preventScroll: true});
+  window.scrollTo(0, document.body.scrollHeight);
+
+  test(() => {
+    assert_equals(document.activeElement, document.getElementById("3"));
+    eventSender.keyDown('ArrowUp');
+    console.log(document.activeElement)
+    assert_equals(document.activeElement, document.getElementById("bottom"));
+  }, "Spatnav picks the visual viewport's bottommost element when focus is off screen.");
+</script>
+
diff --git a/third_party/WebKit/LayoutTests/fast/sub-pixel/save-layer-bounds-should-snap-expected.html b/third_party/WebKit/LayoutTests/fast/sub-pixel/save-layer-bounds-should-snap-expected.html
new file mode 100644
index 0000000..9e29dc74
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/sub-pixel/save-layer-bounds-should-snap-expected.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="width:100px; height:100px; background:green; opacity:0.5;"></div>
diff --git a/third_party/WebKit/LayoutTests/fast/sub-pixel/save-layer-bounds-should-snap.html b/third_party/WebKit/LayoutTests/fast/sub-pixel/save-layer-bounds-should-snap.html
new file mode 100644
index 0000000..8f7db59
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/sub-pixel/save-layer-bounds-should-snap.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<div style="transform:scale(2); transform-origin:0 0; width:99px; height:99px;">
+  <div style="width:50%; height:50%; background:green; opacity:0.5;"></div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.update-served-from-cache.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.update-served-from-cache.html
index 3efd693..500bd250 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.update-served-from-cache.html
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/chromium.update-served-from-cache.html
@@ -7,30 +7,66 @@
 <script src="../resources/testharnessreport.js"></script>
 <script src="resources/test-helpers.js"></script>
 <script>
-promise_test(function(t) {
-    var scope = 'resources/scope/update-served-from-cache';
-    var worker_url = 'resources/update-served-from-cache-worker.php';
-    var registration;
+const scope = 'resources/scope/update-served-from-cache';
+const worker_url = 'resources/update-served-from-cache-worker.php';
 
-    return service_worker_unregister_and_register(t, worker_url, scope)
-      .then(function(r) {
-          // The script resource for this register() having a non-zero max-age
-          // value was cached.
-          registration = r;
-          return wait_for_state(t, registration.installing, 'activated');
-        })
-      .then(function() {
-          // update() should consult the cache. The returned promise should
-          // resolve when the script is retrieved from the cache.
-          return registration.update();
-        })
-      .then(function() {
-          // installing should be null as update() does not trigger install.
-          assert_equals(
-              registration.installing, 
-              null,
-              'installing should be null as the script was served from cache.');
-          return service_worker_unregister_and_done(t, scope);
-        });
-  }, 'Update a registration served from cache.');
+for (let update_via_cache of ['none', 'imports']) {
+    promise_test(function(t) {
+        let registration;
+
+        return service_worker_unregister_and_register(t, worker_url, scope,
+                                                      update_via_cache)
+          .then(function(r) {
+              // The script resource for this register() having a non-zero
+              // max-age value was cached.
+              registration = r;
+              return wait_for_state(t, registration.installing, 'activated');
+            })
+          .then(function() {
+              // update() should consult the cache. The returned promise should
+              // resolve when the script is retrieved from the cache.
+              return registration.update();
+            })
+          .then(function() {
+              // installing should not be null as update() triggers install.
+              assert_not_equals(
+                  registration.installing,
+                  null,
+                  'installing should not be null as the script should bypass ' +
+                  'cache.');
+              return service_worker_unregister_and_done(t, scope);
+            });
+      }, 'Update a registration bypassing cache with update_via_cache: ' +
+         update_via_cache + '.');
+}
+
+for (let update_via_cache of ['all']) {
+    promise_test(function(t) {
+        let registration;
+
+        return service_worker_unregister_and_register(t, worker_url, scope,
+                                                      update_via_cache)
+          .then(function(r) {
+              // The script resource for this register() having a non-zero
+              // max-age value was cached.
+              registration = r;
+              return wait_for_state(t, registration.installing, 'activated');
+            })
+          .then(function() {
+              // update() should consult the cache. The returned promise should
+              // resolve when the script is retrieved from the cache.
+              return registration.update();
+            })
+          .then(function() {
+              // installing should be null as update() does not trigger install.
+              assert_equals(
+                  registration.installing,
+                  null,
+                  'installing should be null as the script was served from ' +
+                  'cache.');
+              return service_worker_unregister_and_done(t, scope);
+            });
+      }, 'Update a registration served from cache with update_via_cache: ' +
+         update_via_cache + '.');
+}
 </script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/test-helpers.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
index 595ddb0..ecc94b7 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/test-helpers.js
@@ -1,10 +1,11 @@
 // Adapter for testharness.js-style tests with Service Workers
 
-function service_worker_unregister_and_register(test, url, scope) {
+function service_worker_unregister_and_register(
+    test, url, scope, updateViaCache = 'imports') {
   if (!scope || scope.length == 0)
     return Promise.reject(new Error('tests must define a scope'));
 
-  var options = { scope: scope };
+  var options = { scope: scope, updateViaCache: updateViaCache };
   return service_worker_unregister(test, scope)
     .then(function() {
         return navigator.serviceWorker.register(url, options);
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-webgl-breakpoint-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-webgl-breakpoint-expected.txt
new file mode 100644
index 0000000..97dc5955
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-webgl-breakpoint-expected.txt
@@ -0,0 +1,8 @@
+Tests instrumentation breakpoint on webgl error
+(anonymous) at test.js:3:7
+{
+    eventName : instrumentation:webglErrorFired
+    webglErrorName : INVALID_OPERATION
+}
+EventListener
+
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-webgl-breakpoint.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-webgl-breakpoint.js
new file mode 100644
index 0000000..f5e0f65
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/domdebugger-webgl-breakpoint.js
@@ -0,0 +1,17 @@
+(async function(testRunner) {
+  var {page, session, dp} = await testRunner.startHTML('<canvas id="cvn"></div>', 'Tests instrumentation breakpoint on webgl error');
+
+  dp.Debugger.enable();
+  dp.DOMDebugger.enable();
+  dp.DOMDebugger.setInstrumentationBreakpoint({eventName: 'webglErrorFired'});
+  dp.Runtime.evaluate({expression: `
+    var canvas = document.getElementById("cvn");
+    var gl = canvas.getContext("experimental-webgl");
+    gl.drawArrays(gl.TRIANGLES, 0, 6);
+    //# sourceURL=test.js`});
+  const {params:{callFrames, data, reason}} = await dp.Debugger.oncePaused();
+  testRunner.logCallFrames(callFrames);
+  testRunner.log(data);
+  testRunner.log(reason);
+  testRunner.completeTest();
+})
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/opacity-reflection-transform-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/opacity-reflection-transform-expected.png
index 80125af..022b7752 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/opacity-reflection-transform-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/reflections/opacity-reflection-transform-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/opacity-reflection-transform-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/opacity-reflection-transform-expected.png
index 977b328..1498516 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/opacity-reflection-transform-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/reflections/opacity-reflection-transform-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/reflections/opacity-reflection-transform-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/reflections/opacity-reflection-transform-expected.png
index f76e53c..298a6a55 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/reflections/opacity-reflection-transform-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/reflections/opacity-reflection-transform-expected.png
Binary files differ
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
index 59cf532..e542d6af 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
@@ -101,6 +101,12 @@
   ExceptionState exception_state(info.GetIsolate(),
                                  ExceptionState::kExecutionContext,
                                  "MessageEvent", "initMessageEvent");
+  if (UNLIKELY(info.Length() < 1)) {
+    exception_state.ThrowTypeError(
+        ExceptionMessages::NotEnoughArguments(1, info.Length()));
+    return;
+  }
+
   MessageEvent* event = V8MessageEvent::ToImpl(info.Holder());
   TOSTRING_VOID(V8StringResource<>, type_arg, info[0]);
   bool can_bubble_arg = false;
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
index 129d514..d1b38bc8 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -170,7 +170,7 @@
 }
 
 bool CompareDoubleValue(double a, double b, MediaFeaturePrefix op) {
-  const double precision = std::numeric_limits<double>::epsilon();
+  const double precision = LayoutUnit::Epsilon();
   switch (op) {
     case kMinPrefix:
       return a >= (b - precision);
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
index 2ce15e86..3f7ce65 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
@@ -87,13 +87,15 @@
     {"(width: 501px)", 0},
     {"(min-height: 500px)", 1},
     {"(min-height: 501px)", 0},
-    {"(min-height: 500.001px)", 0},
+    {"(min-height: 500.02px)", 0},
     {"(max-height: 500px)", 1},
-    {"(max-height: 499.999px)", 0},
+    {"(max-height: 499.98px)", 0},
     {"(max-height: 499px)", 0},
     {"(height: 500px)", 1},
-    {"(height: 500.001px)", 0},
-    {"(height: 499.999px)", 0},
+    {"(height: 500.001px)", 1},
+    {"(height: 499.999px)", 1},
+    {"(height: 500.02px)", 0},
+    {"(height: 499.98px)", 0},
     {"(height: 501px)", 0},
     {"(height)", 1},
     {"(width)", 1},
@@ -117,13 +119,13 @@
     {"(min-height: 700px)", 1},
     {"(min-height: 700.125px)", 1},
     {"(min-height: 701px)", 0},
-    {"(min-height: 700.126px)", 0},
+    {"(min-height: 700.141px)", 0},
     {"(max-height: 701px)", 1},
     {"(max-height: 700.125px)", 1},
     {"(max-height: 700px)", 0},
     {"(height: 700.125px)", 1},
-    {"(height: 700.126px)", 0},
-    {"(height: 700.124px)", 0},
+    {"(height: 700.141px)", 0},
+    {"(height: 700.109px)", 0},
     {"(height: 701px)", 0},
     {nullptr, 0}  // Do not remove the terminator line.
 };
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index 374a0de..2a21883f 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -1049,8 +1049,13 @@
   // calculate the scroll position, we must be at the end of the
   // document. Scroll to the bottom.
   // FIXME: who said anything about scrolling?
-  if (!runner && GetDocument().View()) {
-    point = FloatPoint(0, GetDocument().View()->ContentsHeight());
+  if (!runner && GetDocument().View() &&
+      GetDocument().View()->LayoutViewportScrollableArea()) {
+    point = FloatPoint(0, GetDocument()
+                              .View()
+                              ->LayoutViewportScrollableArea()
+                              ->ContentsSize()
+                              .Height());
     return true;
   }
   return false;
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
index ac6c55ca..620398d3 100644
--- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
@@ -222,11 +222,6 @@
   double allotted_time_millis =
       std::max((deadline_seconds - CurrentTimeTicksInSeconds()) * 1000, 0.0);
 
-  DEFINE_STATIC_LOCAL(
-      CustomCountHistogram, idle_callback_deadline_histogram,
-      ("WebCore.ScriptedIdleTaskController.IdleCallbackDeadline", 0, 50, 50));
-  idle_callback_deadline_histogram.Count(allotted_time_millis);
-
   probe::AsyncTask async_task(GetExecutionContext(), idle_task);
   probe::UserCallback probe(GetExecutionContext(), "requestIdleCallback",
                             AtomicString(), true);
diff --git a/third_party/WebKit/Source/core/editing/finder/TextFinder.cpp b/third_party/WebKit/Source/core/editing/finder/TextFinder.cpp
index c049770a..6193a23 100644
--- a/third_party/WebKit/Source/core/editing/finder/TextFinder.cpp
+++ b/third_party/WebKit/Source/core/editing/finder/TextFinder.cpp
@@ -615,9 +615,9 @@
 }
 
 void TextFinder::UpdateFindMatchRects() {
-  IntSize current_contents_size = OwnerFrame().ContentsSize();
-  if (contents_size_for_current_find_match_rects_ != current_contents_size) {
-    contents_size_for_current_find_match_rects_ = current_contents_size;
+  IntSize current_document_size = OwnerFrame().DocumentSize();
+  if (document_size_for_current_find_match_rects_ != current_document_size) {
+    document_size_for_current_find_match_rects_ = current_document_size;
     find_match_rects_are_valid_ = false;
   }
 
diff --git a/third_party/WebKit/Source/core/editing/finder/TextFinder.h b/third_party/WebKit/Source/core/editing/finder/TextFinder.h
index eb34c797..fbf652e8 100644
--- a/third_party/WebKit/Source/core/editing/finder/TextFinder.h
+++ b/third_party/WebKit/Source/core/editing/finder/TextFinder.h
@@ -270,7 +270,7 @@
 
   // Contents size when find-in-page match rects were last computed for this
   // frame's cache.
-  IntSize contents_size_for_current_find_match_rects_;
+  IntSize document_size_for_current_find_match_rects_;
 
   // This flag is used by the scoping effort to determine if we need to figure
   // out which rectangle is the active match. Once we find the active
diff --git a/third_party/WebKit/Source/core/editing/finder/TextFinderTest.cpp b/third_party/WebKit/Source/core/editing/finder/TextFinderTest.cpp
index 8b1e640..3253919 100644
--- a/third_party/WebKit/Source/core/editing/finder/TextFinderTest.cpp
+++ b/third_party/WebKit/Source/core/editing/finder/TextFinderTest.cpp
@@ -322,6 +322,16 @@
   ASSERT_EQ(2u, match_rects.size());
   EXPECT_EQ(FindInPageRect(text_node, 4, text_node, 10), match_rects[0]);
   EXPECT_EQ(FindInPageRect(text_node, 14, text_node, 20), match_rects[1]);
+
+  // Modify the document size and ensure the cached match rects are recomputed
+  // to reflect the updated layout.
+  GetDocument().body()->setAttribute(HTMLNames::styleAttr, "margin: 2000px");
+  GetDocument().UpdateStyleAndLayout();
+
+  GetTextFinder().FindMatchRects(match_rects);
+  ASSERT_EQ(2u, match_rects.size());
+  EXPECT_EQ(FindInPageRect(text_node, 4, text_node, 10), match_rects[0]);
+  EXPECT_EQ(FindInPageRect(text_node, 14, text_node, 20), match_rects[1]);
 }
 
 TEST_F(TextFinderTest, ScopeTextMatchesRepeated) {
diff --git a/third_party/WebKit/Source/core/events/MessageEvent.idl b/third_party/WebKit/Source/core/events/MessageEvent.idl
index 2226c4a..0c5c3f5 100644
--- a/third_party/WebKit/Source/core/events/MessageEvent.idl
+++ b/third_party/WebKit/Source/core/events/MessageEvent.idl
@@ -42,7 +42,7 @@
 
     // TODO(foolip): none of the arguments should have [Default=Undefined] (they
     // have other default values in the spec) and |sourceArg|'s type is wrong.
-    [Custom, MeasureAs=InitMessageEvent] void initMessageEvent([Default=Undefined] DOMString typeArg,
+    [Custom, MeasureAs=InitMessageEvent] void initMessageEvent(DOMString typeArg,
                                    [Default=Undefined] optional boolean canBubbleArg,
                                    [Default=Undefined] optional boolean cancelableArg,
                                    [Default=Undefined] optional any dataArg,
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
index d0c5134a..d8c5d2a 100644
--- a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -1147,7 +1147,7 @@
     // only because all of the callers don't support OOPIFs and exit early if
     // the main frame is not local.
     DCHECK(MainFrame()->IsWebLocalFrame());
-    max_size = MainFrame()->ToWebLocalFrame()->ContentsSize();
+    max_size = MainFrame()->ToWebLocalFrame()->DocumentSize();
     scroll_offset = MainFrame()->ToWebLocalFrame()->GetScrollOffset();
   }
   int left_margin = target_margin;
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
index 95b880f..82ca2cc8 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -3176,9 +3176,8 @@
       if (target_state >= DocumentLifecycle::kCompositingClean) {
         ScrollContentsIfNeededRecursive();
 
-        frame_->GetPage()
-            ->GlobalRootScrollerController()
-            .DidUpdateCompositing();
+        frame_->GetPage()->GlobalRootScrollerController().DidUpdateCompositing(
+            *this);
       }
 
       if (target_state >= DocumentLifecycle::kPrePaintClean) {
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.h b/third_party/WebKit/Source/core/frame/LocalFrameView.h
index 5a88677..e7ee33c 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrameView.h
+++ b/third_party/WebKit/Source/core/frame/LocalFrameView.h
@@ -1252,6 +1252,9 @@
 
   ScrollOffset pending_scroll_delta_;
   ScrollOffset scroll_offset_;
+
+  // TODO(bokan): This is unneeded when root-layer-scrolls is turned on.
+  // crbug.com/417782.
   IntSize layout_overflow_size_;
 
   bool scrollbars_suppressed_;
diff --git a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
index 638ac79..1a1d448 100644
--- a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
@@ -594,10 +594,11 @@
   }
 }
 
-WebSize WebLocalFrameImpl::ContentsSize() const {
-  if (LocalFrameView* view = GetFrameView())
-    return view->ContentsSize();
-  return WebSize();
+WebSize WebLocalFrameImpl::DocumentSize() const {
+  if (!GetFrameView() || !GetFrameView()->GetLayoutView())
+    return WebSize();
+
+  return GetFrameView()->GetLayoutView()->DocumentRect().Size();
 }
 
 bool WebLocalFrameImpl::HasVisibleContent() const {
diff --git a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h
index 000c821..850fc0d 100644
--- a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h
+++ b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h
@@ -92,7 +92,7 @@
       WebSharedWorkerRepositoryClient*) override;
   WebSize GetScrollOffset() const override;
   void SetScrollOffset(const WebSize&) override;
-  WebSize ContentsSize() const override;
+  WebSize DocumentSize() const override;
   bool HasVisibleContent() const override;
   WebRect VisibleContentRect() const override;
   WebView* View() const override;
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
index 31e4c41..1889b42e 100644
--- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
+++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmap.cpp
@@ -335,6 +335,8 @@
   }
   sk_sp<SkImage> resized_sk_image =
       SkImage::MakeFromRaster(resized_pixmap, freePixels, pixels);
+  if (!resized_sk_image)
+    return nullptr;
   return StaticBitmapImage::Create(resized_sk_image,
                                    image->ContextProviderWrapper());
 }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index 380a702..56bd5340 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -678,13 +678,13 @@
     return;
   if (!error_name.IsEmpty())
     event_data->setString(kWebglErrorNameProperty, error_name);
-  PauseOnNativeEventIfNeeded(std::move(event_data), false);
+  PauseOnNativeEventIfNeeded(std::move(event_data), true);
 }
 
 void InspectorDOMDebuggerAgent::DidFireWebGLWarning() {
   PauseOnNativeEventIfNeeded(
       PreparePauseOnNativeEventData(kWebglWarningFiredEventName, nullptr),
-      false);
+      true);
 }
 
 void InspectorDOMDebuggerAgent::DidFireWebGLErrorOrWarning(
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
index e9243c8..49284b29 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -211,31 +211,7 @@
   if (!object->GetNode() || !object->GetNode()->IsSVGElement())
     return;
 
-  SVGElementSet* dependencies =
-      ToSVGElement(object->GetNode())->SetOfIncomingReferences();
-  if (!dependencies)
-    return;
-
-  // We allow cycles in SVGDocumentExtensions reference sets in order to avoid
-  // expensive reference graph adjustments on changes, so we need to break
-  // possible cycles here.
-  // This strong reference is safe, as it is guaranteed that this set will be
-  // emptied at the end of recursion.
-  DEFINE_STATIC_LOCAL(SVGElementSet, invalidating_dependencies,
-                      (new SVGElementSet));
-
-  for (SVGElement* element : *dependencies) {
-    if (LayoutObject* layout_object = element->GetLayoutObject()) {
-      if (UNLIKELY(!invalidating_dependencies.insert(element).is_new_entry)) {
-        // Reference cycle: we are in process of invalidating this dependant.
-        continue;
-      }
-
-      LayoutSVGResourceContainer::MarkForLayoutAndParentResourceInvalidation(
-          layout_object, needs_layout);
-      invalidating_dependencies.erase(element);
-    }
-  }
+  ToSVGElement(object->GetNode())->NotifyIncomingReferences(needs_layout);
 }
 
 void LayoutSVGResourceContainer::MarkForLayoutAndParentResourceInvalidation(
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
index 0fc19698..0aa9390 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -44,8 +44,6 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/RemoteFrame.h"
 #include "core/frame/Settings.h"
-#include "core/html/HTMLAreaElement.h"
-#include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLPlugInElement.h"
 #include "core/html/HTMLShadowElement.h"
 #include "core/html/HTMLSlotElement.h"
@@ -1403,14 +1401,8 @@
   while (!stack.IsEmpty()) {
     Node* container = stack.back();
 
-    LayoutRect heuristic_rect =
-        starting_rect.IsEmpty()
-            ? VirtualRectForDirection(type,
-                                      NodeRectInAbsoluteCoordinates(container))
-            : starting_rect;
-
     FocusCandidate candidate;
-    FindFocusCandidateInContainer(*container, heuristic_rect, type, candidate,
+    FindFocusCandidateInContainer(*container, starting_rect, type, candidate,
                                   already_checked);
 
     if (candidate.IsNull()) {
@@ -1462,42 +1454,31 @@
   // FIXME: Directional focus changes don't yet work with RemoteFrames.
   if (!FocusedOrMainFrame()->IsLocalFrame())
     return false;
-  LocalFrame* cur_frame = ToLocalFrame(FocusedOrMainFrame());
-  DCHECK(cur_frame);
+  const LocalFrame* current_frame = ToLocalFrame(FocusedOrMainFrame());
+  DCHECK(current_frame);
 
-  Document* focused_document = cur_frame->GetDocument();
+  Document* focused_document = current_frame->GetDocument();
   if (!focused_document)
     return false;
 
   Element* focused_element = focused_document->FocusedElement();
   Node* container = focused_document;
-
   if (container->IsDocumentNode())
     ToDocument(container)->UpdateStyleAndLayoutIgnorePendingStylesheets();
-
-  // Figure out the starting rect.
-  LayoutRect starting_rect;
-  if (focused_element) {
-    if (!HasOffscreenRect(focused_element)) {
-      starting_rect = NodeRectInAbsoluteCoordinates(focused_element,
-                                                    true /* ignore border */);
-    } else if (auto* area = ToHTMLAreaElementOrNull(*focused_element)) {
-      if (area->ImageElement()) {
-        focused_element = area->ImageElement();
-        starting_rect = VirtualRectForAreaElementAndDirection(*area, type);
-      }
-    }
+  if (focused_element)
     container = ScrollableAreaOrDocumentOf(focused_element);
-  }
 
+  const LayoutRect starting_rect = FindSearchStartPoint(current_frame, type);
   Node* pruned_sub_tree_root = nullptr;
   bool consumed = false;
+
   while (!consumed && container) {
     consumed = AdvanceFocusDirectionallyInContainer(container, starting_rect,
                                                     type, pruned_sub_tree_root);
     if (consumed)
       break;
 
+    // Nothing found in |container| so search the parent container.
     pruned_sub_tree_root = container;
     container = ScrollableAreaOrDocumentOf(container);
     if (container && container->IsDocumentNode())
diff --git a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
index e9fd8466..1e0fdea 100644
--- a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
+++ b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
@@ -47,7 +47,7 @@
 using namespace HTMLNames;
 
 static void DeflateIfOverlapped(LayoutRect&, LayoutRect&);
-static LayoutRect RectToAbsoluteCoordinates(LocalFrame* initial_frame,
+static LayoutRect RectToAbsoluteCoordinates(const LocalFrame* initial_frame,
                                             const LayoutRect&);
 static bool IsScrollableNode(const Node*);
 
@@ -144,7 +144,7 @@
 // Checks if |node| is offscreen the visible area (viewport) of its container
 // document. In case it is, one can scroll in direction or take any different
 // desired action later on.
-bool HasOffscreenRect(Node* node, WebFocusType type) {
+bool HasOffscreenRect(const Node* node, WebFocusType type) {
   // Get the LocalFrameView in which |node| is (which means the current viewport
   // if |node| is not in an inner document), so we can check if its content rect
   // is visible before we actually move the focus to it.
@@ -412,14 +412,14 @@
   }
 }
 
-static LayoutRect RectToAbsoluteCoordinates(LocalFrame* initial_frame,
+static LayoutRect RectToAbsoluteCoordinates(const LocalFrame* initial_frame,
                                             const LayoutRect& initial_rect) {
   return LayoutRect(
       initial_frame->View()->ContentsToRootFrame(initial_rect.Location()),
       initial_rect.Size());
 }
 
-LayoutRect NodeRectInAbsoluteCoordinates(Node* node, bool ignore_border) {
+LayoutRect NodeRectInAbsoluteCoordinates(const Node* node, bool ignore_border) {
   DCHECK(node);
   DCHECK(node->GetLayoutObject());
   DCHECK(!node->GetDocument().View()->NeedsLayout());
@@ -444,7 +444,7 @@
   return rect;
 }
 
-LayoutRect FrameRectInAbsoluteCoordinates(LocalFrame* frame) {
+LayoutRect FrameRectInAbsoluteCoordinates(const LocalFrame* frame) {
   return RectToAbsoluteCoordinates(
       frame,
       LayoutRect(
@@ -697,7 +697,7 @@
   return virtual_starting_rect;
 }
 
-LayoutRect VirtualRectForAreaElementAndDirection(HTMLAreaElement& area,
+LayoutRect VirtualRectForAreaElementAndDirection(const HTMLAreaElement& area,
                                                  WebFocusType type) {
   DCHECK(area.ImageElement());
   // Area elements tend to overlap more than other focusable elements. We
@@ -718,4 +718,25 @@
              : nullptr;
 };
 
+LayoutRect FindSearchStartPoint(const LocalFrame* frame,
+                                WebFocusType direction) {
+  LayoutRect starting_rect =
+      VirtualRectForDirection(direction, FrameRectInAbsoluteCoordinates(frame));
+
+  const Element* focused_element = frame->GetDocument()->FocusedElement();
+  if (focused_element) {
+    auto* area_element = ToHTMLAreaElementOrNull(focused_element);
+    if (area_element)
+      focused_element = area_element->ImageElement();
+    if (!HasOffscreenRect(focused_element)) {
+      starting_rect =
+          area_element
+              ? VirtualRectForAreaElementAndDirection(*area_element, direction)
+              : NodeRectInAbsoluteCoordinates(focused_element, true);
+    }
+  }
+
+  return starting_rect;
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/page/SpatialNavigation.h b/third_party/WebKit/Source/core/page/SpatialNavigation.h
index 09d17f9..5555d55 100644
--- a/third_party/WebKit/Source/core/page/SpatialNavigation.h
+++ b/third_party/WebKit/Source/core/page/SpatialNavigation.h
@@ -128,7 +128,7 @@
   bool is_offscreen_after_scrolling;
 };
 
-bool HasOffscreenRect(Node*, WebFocusType = kWebFocusTypeNone);
+bool HasOffscreenRect(const Node*, WebFocusType = kWebFocusTypeNone);
 bool ScrollInDirection(LocalFrame*, WebFocusType);
 bool ScrollInDirection(Node* container, WebFocusType);
 bool IsNavigableContainer(const Node*, WebFocusType);
@@ -142,14 +142,15 @@
 void DistanceDataForNode(WebFocusType,
                          const FocusCandidate& current,
                          FocusCandidate&);
-LayoutRect NodeRectInAbsoluteCoordinates(Node*, bool ignore_border = false);
-LayoutRect FrameRectInAbsoluteCoordinates(LocalFrame*);
+LayoutRect NodeRectInAbsoluteCoordinates(const Node*, bool ignore_border = false);
+LayoutRect FrameRectInAbsoluteCoordinates(const LocalFrame*);
 LayoutRect VirtualRectForDirection(WebFocusType,
                                    const LayoutRect& starting_rect,
                                    LayoutUnit width = LayoutUnit());
-LayoutRect VirtualRectForAreaElementAndDirection(HTMLAreaElement&,
+LayoutRect VirtualRectForAreaElementAndDirection(const HTMLAreaElement&,
                                                  WebFocusType);
 HTMLFrameOwnerElement* FrameOwnerElement(FocusCandidate&);
+LayoutRect FindSearchStartPoint(const LocalFrame*, WebFocusType);
 
 }  // namespace blink
 
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
index 461080f3..480f8d8 100644
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
@@ -842,6 +842,61 @@
   }
 }
 
+// Ensure a non-main local root doesn't interfere with the global root
+// scroller. This happens in this situation: Local <- Remote <- Local. This
+// tests the crash in https://crbug.com/800566.
+TEST_P(RootScrollerTest, NonMainLocalRootLifecycle) {
+  WebLocalFrameImpl* non_main_local_root = nullptr;
+
+  // Setup a Local <- Remote <- Local frame hierarchy.
+  {
+    Initialize();
+    WebURL base_url = URLTestHelpers::ToKURL("http://www.test.com/");
+    FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrameImpl(),
+                                     R"HTML(
+                                              <!DOCTYPE html>
+                                              <iframe></iframe>
+                                          )HTML",
+                                     base_url);
+    MainFrameView()->UpdateAllLifecyclePhases();
+
+    WebRemoteFrameImpl* remote_frame = FrameTestHelpers::CreateRemote();
+    WebLocalFrameImpl* child =
+        ToWebLocalFrameImpl(helper_.LocalMainFrame()->FirstChild());
+    child->Swap(remote_frame);
+    remote_frame->SetReplicatedOrigin(
+        WebSecurityOrigin(SecurityOrigin::CreateUnique()), false);
+
+    non_main_local_root = FrameTestHelpers::CreateLocalChild(*remote_frame);
+    ASSERT_EQ(non_main_local_root->LocalRoot(), non_main_local_root);
+    ASSERT_TRUE(non_main_local_root->Parent());
+  }
+
+  const TopDocumentRootScrollerController& global_controller =
+      MainFrame()->GetDocument()->GetPage()->GlobalRootScrollerController();
+
+  ASSERT_EQ(MainFrame()->GetDocument()->documentElement(),
+            global_controller.GlobalRootScroller());
+
+  GraphicsLayer* scroll_layer = global_controller.RootScrollerLayer();
+  GraphicsLayer* container_layer = global_controller.RootContainerLayer();
+
+  ASSERT_TRUE(scroll_layer);
+  ASSERT_TRUE(container_layer);
+
+  // Put the local main frame into Layout clean and have the non-main local
+  // root do a complete lifecycle update.
+  helper_.LocalMainFrame()->GetFrameView()->SetNeedsLayout();
+  helper_.LocalMainFrame()->GetFrameView()->UpdateLifecycleToLayoutClean();
+  non_main_local_root->GetFrameView()->UpdateAllLifecyclePhases();
+  helper_.LocalMainFrame()->GetFrameView()->UpdateAllLifecyclePhases();
+
+  EXPECT_EQ(MainFrame()->GetDocument()->documentElement(),
+            global_controller.GlobalRootScroller());
+  EXPECT_EQ(global_controller.RootScrollerLayer(), scroll_layer);
+  EXPECT_EQ(global_controller.RootContainerLayer(), container_layer);
+}
+
 // Tests that removing the root scroller element from the DOM resets the
 // effective root scroller without waiting for any lifecycle events.
 TEST_P(RootScrollerTest, RemoveRootScrollerFromDom) {
diff --git a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
index 43e36ba..81b65b5f 100644
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
@@ -188,10 +188,16 @@
   return ToLocalFrame(page_->MainFrame())->GetDocument();
 }
 
-void TopDocumentRootScrollerController::DidUpdateCompositing() {
+void TopDocumentRootScrollerController::DidUpdateCompositing(
+    const LocalFrameView& frame_view) {
   if (!page_)
     return;
 
+  // The only other way to get here is from a local root OOPIF but we ignore
+  // that case since the global root can't cross remote frames today.
+  if (!frame_view.GetFrame().IsMainFrame())
+    return;
+
   // Let the compositor-side counterpart know about this change.
   page_->GetChromeClient().RegisterViewportLayers();
 }
diff --git a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h
index b2005b9..73bae61 100644
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h
@@ -13,6 +13,7 @@
 namespace blink {
 
 class Element;
+class LocalFrameView;
 class Page;
 class GraphicsLayer;
 class PaintLayer;
@@ -36,7 +37,7 @@
 
   // This class needs to be informed of changes to compositing so that it can
   // update the compositor when the effective root scroller changes.
-  void DidUpdateCompositing();
+  void DidUpdateCompositing(const LocalFrameView&);
 
   // PaintLayerScrollableAreas need to notify this class when they're being
   // disposed so that we can remove them as the root scroller.
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index fd852867..05529de7 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -911,10 +911,8 @@
   const LayoutRect border_box = ToLayoutBox(GetLayoutObject()).BorderBoxRect();
   const ComputedStyle& style = GetLayoutObject().StyleRef();
 
-  return FloatPoint(FloatValueForLength(style.PerspectiveOriginX(),
-                                        border_box.Width().ToFloat()),
-                    FloatValueForLength(style.PerspectiveOriginY(),
-                                        border_box.Height().ToFloat()));
+  return FloatPointForLengthPoint(style.PerspectiveOrigin(),
+                                  FloatSize(border_box.Size()));
 }
 
 PaintLayer* PaintLayer::ContainingLayer(const PaintLayer* ancestor,
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index b76896b..f21e733 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -436,7 +436,7 @@
       (should_composite_for_blend_mode ||
        paint_layer_.PaintsWithTransparency(
            painting_info.GetGlobalPaintFlags()))) {
-    FloatRect compositing_bounds = FloatRect(paint_layer_.PaintingExtent(
+    FloatRect compositing_bounds = EnclosingIntRect(paint_layer_.PaintingExtent(
         painting_info.root_layer, painting_info.sub_pixel_accumulation,
         painting_info.GetGlobalPaintFlags()));
     compositing_recorder.emplace(
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index cb2df30..7fbc847 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -112,7 +112,7 @@
 const int kResizerControlExpandRatioForTouch = 2;
 
 PaintLayerScrollableArea::PaintLayerScrollableArea(PaintLayer& layer)
-    : layer_(&layer),
+    : layer_(layer),
       next_topmost_scroll_child_(nullptr),
       topmost_scroll_child_(nullptr),
       in_resize_mode_(false),
@@ -130,7 +130,8 @@
       scroll_corner_(nullptr),
       resizer_(nullptr),
       scroll_anchor_(this),
-      non_composited_main_thread_scrolling_reasons_(0) {
+      non_composited_main_thread_scrolling_reasons_(0),
+      has_been_disposed_(false) {
   Node* node = GetLayoutBox()->GetNode();
   if (node && node->IsElementNode()) {
     // We save and restore only the scrollOffset as the other scroll values are
@@ -145,13 +146,13 @@
 }
 
 PaintLayerScrollableArea::~PaintLayerScrollableArea() {
-  DCHECK(HasBeenDisposed());
+  DCHECK(has_been_disposed_);
 }
 
 void PaintLayerScrollableArea::DidScroll(const gfx::ScrollOffset& offset) {
   ScrollableArea::DidScroll(offset);
   // This should be alive if it receives composited scroll callbacks.
-  CHECK(!HasBeenDisposed());
+  CHECK(!has_been_disposed_);
 }
 
 void PaintLayerScrollableArea::Dispose() {
@@ -210,11 +211,7 @@
   if (SmoothScrollSequencer* sequencer = GetSmoothScrollSequencer())
     sequencer->DidDisposeScrollableArea(*this);
 
-  layer_ = nullptr;
-}
-
-bool PaintLayerScrollableArea::HasBeenDisposed() const {
-  return !layer_;
+  has_been_disposed_ = true;
 }
 
 void PaintLayerScrollableArea::Trace(blink::Visitor* visitor) {
@@ -231,8 +228,6 @@
 
 SmoothScrollSequencer* PaintLayerScrollableArea::GetSmoothScrollSequencer()
     const {
-  if (HasBeenDisposed())
-    return nullptr;
   if (Page* page = GetLayoutBox()->GetFrame()->GetPage())
     return page->GetSmoothScrollSequencer();
   return nullptr;
@@ -464,14 +459,8 @@
   }
 
   if (AXObjectCache* cache =
-          GetLayoutBox()->GetDocument().ExistingAXObjectCache()) {
+          GetLayoutBox()->GetDocument().ExistingAXObjectCache())
     cache->HandleScrollPositionChanged(GetLayoutBox());
-    // The node can be removed by an accessibility notification listener
-    // handling the scroll position changed notification. If it has, we can no
-    // longer use the layer or layout box. See https://crbug.com/797298.
-    if (HasBeenDisposed())
-      return;
-  }
   GetLayoutBox()->View()->ClearHitTestCache();
 
   // Inform the FrameLoader of the new scroll position, so it can be restored
@@ -687,10 +676,10 @@
 
   // Paint properties need to be updated, because clip rects
   // are affected by overlay scrollbars.
-  layer_->GetLayoutObject().SetNeedsPaintPropertyUpdate();
+  layer_.GetLayoutObject().SetNeedsPaintPropertyUpdate();
 
   // TODO(chrishr): this should be able to be removed.
-  layer_->ClearClipRects();
+  layer_.ClearClipRects();
 
   if (LayoutView* view = GetLayoutBox()->View())
     view->ClearHitTestCache();
@@ -769,13 +758,11 @@
 }
 
 LayoutBox* PaintLayerScrollableArea::GetLayoutBox() const {
-  if (!layer_)
-    return nullptr;
-  return layer_->GetLayoutBox();
+  return layer_.GetLayoutBox();
 }
 
 PaintLayer* PaintLayerScrollableArea::Layer() const {
-  return layer_;
+  return &layer_;
 }
 
 LayoutUnit PaintLayerScrollableArea::ScrollWidth() const {
@@ -1539,7 +1526,7 @@
     return;
 
   const IntRect border_box =
-      GetLayoutBox()->PixelSnappedBorderBoxRect(layer_->SubpixelAccumulation());
+      GetLayoutBox()->PixelSnappedBorderBoxRect(layer_.SubpixelAccumulation());
 
   if (Scrollbar* vertical_scrollbar = VerticalScrollbar())
     vertical_scrollbar->SetFrameRect(RectForVerticalScrollbar(border_box));
@@ -1994,7 +1981,7 @@
     frame_view->RemoveScrollableArea(this);
   }
 
-  layer_->DidUpdateScrollsOverflow();
+  layer_.DidUpdateScrollsOverflow();
 }
 
 void PaintLayerScrollableArea::UpdateCompositingLayersAfterScroll() {
@@ -2194,18 +2181,18 @@
 
 CompositorAnimationHost* PaintLayerScrollableArea::GetCompositorAnimationHost()
     const {
-  return layer_->GetLayoutObject().GetFrameView()->GetCompositorAnimationHost();
+  return layer_.GetLayoutObject().GetFrameView()->GetCompositorAnimationHost();
 }
 
 CompositorAnimationTimeline*
 PaintLayerScrollableArea::GetCompositorAnimationTimeline() const {
-  return layer_->GetLayoutObject()
+  return layer_.GetLayoutObject()
       .GetFrameView()
       ->GetCompositorAnimationTimeline();
 }
 
 void PaintLayerScrollableArea::GetTickmarks(Vector<IntRect>& tickmarks) const {
-  if (layer_->IsRootLayer()) {
+  if (layer_.IsRootLayer()) {
     tickmarks = GetLayoutBox()
                     ->GetDocument()
                     .Markers()
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
index 150ec2c..4aa99dab 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
@@ -226,7 +226,6 @@
 
   ~PaintLayerScrollableArea() override;
   void Dispose();
-  bool HasBeenDisposed() const override;
 
   void ForceVerticalScrollbarForFirstLayout() { SetHasVerticalScrollbar(true); }
   bool HasHorizontalScrollbar() const { return HorizontalScrollbar(); }
@@ -559,10 +558,7 @@
 
   IntRect CornerRect(const IntRect& bounds) const;
 
-  // PaintLayer is destructed before PaintLayerScrollable area, during this
-  // time before PaintLayerScrollableArea has been collected layer_ will
-  // be set to nullptr by the Dispose method.
-  PaintLayer* layer_;
+  PaintLayer& layer_;
 
   PaintLayer* next_topmost_scroll_child_;
   PaintLayer* topmost_scroll_child_;
@@ -619,6 +615,8 @@
 
   // MainThreadScrollingReason due to the properties of the LayoutObject
   uint32_t non_composited_main_thread_scrolling_reasons_;
+
+  bool has_been_disposed_;
 };
 
 DEFINE_TYPE_CASTS(PaintLayerScrollableArea,
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index bb13fbe..badf0d5 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -1145,10 +1145,7 @@
   // Perspective origin has no effect without perspective.
   DCHECK(style.HasPerspective());
   FloatSize border_box_size(box.Size());
-  return FloatPoint(
-      FloatValueForLength(style.PerspectiveOriginX(), border_box_size.Width()),
-      FloatValueForLength(style.PerspectiveOriginY(),
-                          border_box_size.Height()));
+  return FloatPointForLengthPoint(style.PerspectiveOrigin(), border_box_size);
 }
 
 static bool NeedsPerspective(const LayoutObject& object) {
diff --git a/third_party/WebKit/Source/core/style/BasicShapes.cpp b/third_party/WebKit/Source/core/style/BasicShapes.cpp
index 7e50257..c2aaaa8 100644
--- a/third_party/WebKit/Source/core/style/BasicShapes.cpp
+++ b/third_party/WebKit/Source/core/style/BasicShapes.cpp
@@ -140,13 +140,6 @@
   return wind_rule_ == other.wind_rule_ && values_ == other.values_;
 }
 
-static FloatSize FloatSizeForLengthSize(const LengthSize& length_size,
-                                        const FloatRect& bounding_box) {
-  return FloatSize(
-      FloatValueForLength(length_size.Width(), bounding_box.Width()),
-      FloatValueForLength(length_size.Height(), bounding_box.Height()));
-}
-
 void BasicShapeInset::GetPath(Path& path, const FloatRect& bounding_box) {
   DCHECK(path.IsEmpty());
   float left = FloatValueForLength(left_, bounding_box.Width());
@@ -159,11 +152,12 @@
       std::max<float>(bounding_box.Height() - top -
                           FloatValueForLength(bottom_, bounding_box.Height()),
                       0));
+  const FloatSize& box_size = bounding_box.Size();
   auto radii = FloatRoundedRect::Radii(
-      FloatSizeForLengthSize(top_left_radius_, bounding_box),
-      FloatSizeForLengthSize(top_right_radius_, bounding_box),
-      FloatSizeForLengthSize(bottom_left_radius_, bounding_box),
-      FloatSizeForLengthSize(bottom_right_radius_, bounding_box));
+      FloatSizeForLengthSize(top_left_radius_, box_size),
+      FloatSizeForLengthSize(top_right_radius_, box_size),
+      FloatSizeForLengthSize(bottom_left_radius_, box_size),
+      FloatSizeForLengthSize(bottom_right_radius_, box_size));
 
   FloatRoundedRect final_rect(rect, radii);
   final_rect.ConstrainRadii();
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 5f03be0..6663d0e1 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1053,26 +1053,6 @@
   return DataEquivalent(TextShadow(), other.TextShadow());
 }
 
-static FloatRoundedRect::Radii CalcRadiiFor(const LengthSize& top_left,
-                                            const LengthSize& top_right,
-                                            const LengthSize& bottom_left,
-                                            const LengthSize& bottom_right,
-                                            LayoutSize size) {
-  return FloatRoundedRect::Radii(
-      FloatSize(
-          FloatValueForLength(top_left.Width(), size.Width().ToFloat()),
-          FloatValueForLength(top_left.Height(), size.Height().ToFloat())),
-      FloatSize(
-          FloatValueForLength(top_right.Width(), size.Width().ToFloat()),
-          FloatValueForLength(top_right.Height(), size.Height().ToFloat())),
-      FloatSize(
-          FloatValueForLength(bottom_left.Width(), size.Width().ToFloat()),
-          FloatValueForLength(bottom_left.Height(), size.Height().ToFloat())),
-      FloatSize(
-          FloatValueForLength(bottom_right.Width(), size.Width().ToFloat()),
-          FloatValueForLength(bottom_right.Height(), size.Height().ToFloat())));
-}
-
 StyleImage* ComputedStyle::ListStyleImage() const {
   return ListStyleImageInternal();
 }
@@ -1087,6 +1067,17 @@
   SetColorInternal(v);
 }
 
+static FloatRoundedRect::Radii CalcRadiiFor(const LengthSize& top_left,
+                                            const LengthSize& top_right,
+                                            const LengthSize& bottom_left,
+                                            const LengthSize& bottom_right,
+                                            FloatSize size) {
+  return FloatRoundedRect::Radii(FloatSizeForLengthSize(top_left, size),
+                                 FloatSizeForLengthSize(top_right, size),
+                                 FloatSizeForLengthSize(bottom_left, size),
+                                 FloatSizeForLengthSize(bottom_right, size));
+}
+
 FloatRoundedRect ComputedStyle::GetRoundedBorderFor(
     const LayoutRect& border_rect,
     bool include_logical_left_edge,
@@ -1095,7 +1086,7 @@
   if (HasBorderRadius()) {
     FloatRoundedRect::Radii radii = CalcRadiiFor(
         BorderTopLeftRadius(), BorderTopRightRadius(), BorderBottomLeftRadius(),
-        BorderBottomRightRadius(), border_rect.Size());
+        BorderBottomRightRadius(), FloatSize(border_rect.Size()));
     rounded_rect.IncludeLogicalEdges(radii, IsHorizontalWritingMode(),
                                      include_logical_left_edge,
                                      include_logical_right_edge);
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index c76781d5..40a3e55 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -356,20 +356,14 @@
     // http://dev.w3.org/csswg/css3-transforms/
     float zoom = style->EffectiveZoom();
     TransformationMatrix transform;
-    if (zoom != 1) {
+    if (zoom != 1)
       reference_box.Scale(zoom);
-      transform.Scale(1 / zoom);
-      style->ApplyTransform(
-          transform, reference_box, ComputedStyle::kIncludeTransformOrigin,
-          ComputedStyle::kIncludeMotionPath,
-          ComputedStyle::kIncludeIndependentTransformProperties);
-      transform.Scale(zoom);
-    } else {
-      style->ApplyTransform(
-          transform, reference_box, ComputedStyle::kIncludeTransformOrigin,
-          ComputedStyle::kIncludeMotionPath,
-          ComputedStyle::kIncludeIndependentTransformProperties);
-    }
+    style->ApplyTransform(
+        transform, reference_box, ComputedStyle::kIncludeTransformOrigin,
+        ComputedStyle::kIncludeMotionPath,
+        ComputedStyle::kIncludeIndependentTransformProperties);
+    if (zoom != 1)
+      transform.Zoom(1 / zoom);
     // Flatten any 3D transform.
     matrix = transform.ToAffineTransform();
   }
@@ -1270,6 +1264,35 @@
   target_element->EnsureSVGRareData()->IncomingReferences().insert(this);
 }
 
+void SVGElement::NotifyIncomingReferences(bool needs_layout) {
+  if (!HasSVGRareData())
+    return;
+
+  SVGElementSet& dependencies = SvgRareData()->IncomingReferences();
+  if (dependencies.IsEmpty())
+    return;
+
+  // We allow cycles in the reference graph in order to avoid expensive
+  // adjustments on changes, so we need to break possible cycles here.
+  // This strong reference is safe, as it is guaranteed that this set will be
+  // emptied at the end of recursion.
+  DEFINE_STATIC_LOCAL(SVGElementSet, invalidating_dependencies,
+                      (new SVGElementSet));
+
+  for (SVGElement* element : dependencies) {
+    if (LayoutObject* layout_object = element->GetLayoutObject()) {
+      if (UNLIKELY(!invalidating_dependencies.insert(element).is_new_entry)) {
+        // Reference cycle: we are in process of invalidating this dependant.
+        continue;
+      }
+
+      LayoutSVGResourceContainer::MarkForLayoutAndParentResourceInvalidation(
+          layout_object, needs_layout);
+      invalidating_dependencies.erase(element);
+    }
+  }
+}
+
 void SVGElement::RebuildAllIncomingReferences() {
   if (!HasSVGRareData())
     return;
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.h b/third_party/WebKit/Source/core/svg/SVGElement.h
index 1189d73f..cd52c1d 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.h
+++ b/third_party/WebKit/Source/core/svg/SVGElement.h
@@ -173,8 +173,8 @@
 
   SVGElementProxySet* ElementProxySet();
 
-  SVGElementSet* SetOfIncomingReferences() const;
   void AddReferenceTo(SVGElement*);
+  void NotifyIncomingReferences(bool needs_layout);
   void RebuildAllIncomingReferences();
   void RemoveAllIncomingReferences();
   void RemoveAllOutgoingReferences();
@@ -242,6 +242,8 @@
 
   bool HasSVGParent() const;
 
+  SVGElementSet* SetOfIncomingReferences() const;
+
   SVGElementRareData* EnsureSVGRareData();
   inline bool HasSVGRareData() const { return svg_rare_data_; }
   inline SVGElementRareData* SvgRareData() const {
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
index c3be863..891e32b1 100644
--- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
+++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapProfileView.js
@@ -112,6 +112,7 @@
     if (!this.profileBeingRecorded() || !this.profileBeingRecorded()._heapProfilerModel)
       return;
 
+    this.profileBeingRecorded().updateStatus(Common.UIString('Stopping\u2026'));
     var profile = await this._stopSampling();
     var recordedProfile = this.profileBeingRecorded();
     if (recordedProfile) {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js
index 15367feb..d4a77cc 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/HeapProfilerModel.js
@@ -50,7 +50,7 @@
   }
 
   startNativeSampling() {
-    var defaultSamplingIntervalInBytes = 16384;
+    var defaultSamplingIntervalInBytes = 65536;
     this._memoryAgent.startSampling(defaultSamplingIntervalInBytes);
   }
 
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
index ce2577f..5a04794 100644
--- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
@@ -69,7 +69,8 @@
     const ImageResourceObserver& client,
     const IntSize& container_size,
     const CSSStyleValueVector* paint_arguments) {
-  DCHECK(paint_arguments);
+  if (!paint_arguments)
+    return nullptr;
 
   // TODO: Break dependency on LayoutObject. Passing the Node should work.
   const LayoutObject& layout_object = static_cast<const LayoutObject&>(client);
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
index dc484b9..10b30a5 100644
--- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
+++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
@@ -8,6 +8,7 @@
 #include "core/CSSPropertyNames.h"
 #include "core/css/CSSSyntaxDescriptor.h"
 #include "core/css/cssom/CSSStyleValue.h"
+#include "modules/ModulesExport.h"
 #include "modules/csspaint/PaintRenderingContext2DSettings.h"
 #include "platform/bindings/ScriptWrappable.h"
 #include "platform/bindings/TraceWrapperMember.h"
@@ -25,7 +26,7 @@
 // Represents a javascript class registered on the PaintWorkletGlobalScope by
 // the author. It will store the properties for invalidation and input argument
 // types as well.
-class CSSPaintDefinition final
+class MODULES_EXPORT CSSPaintDefinition final
     : public GarbageCollectedFinalized<CSSPaintDefinition>,
       public TraceWrapperBase {
  public:
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
index 3f11f04..aa14d48 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletTest.cpp
@@ -9,6 +9,7 @@
 #include "bindings/core/v8/V8GCController.h"
 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
 #include "core/frame/LocalFrame.h"
+#include "core/layout/LayoutView.h"
 #include "core/testing/PageTestBase.h"
 #include "modules/csspaint/CSSPaintDefinition.h"
 #include "modules/csspaint/PaintWorkletGlobalScope.h"
@@ -57,6 +58,10 @@
     return PaintWorkletGlobalScopeProxy::From(proxy_.Get());
   }
 
+  ImageResourceObserver* GetImageResourceObserver() {
+    return GetDocument().domWindow()->GetFrame()->ContentLayoutObject();
+  }
+
   // Helper function used in GlobalScopeSelection test.
   void ExpectSwitchGlobalScope(bool expect_switch_within_frame,
                                size_t num_paint_calls,
@@ -133,6 +138,28 @@
   DCHECK(handle.IsEmpty());
 }
 
+// This is a crash test for crbug.com/803026. At some point, we shipped the
+// CSSPaintAPI without shipping the CSSPaintAPIArguments, the result of it is
+// that the |paint_arguments| in the CSSPaintDefinition::Paint() becomes
+// nullptr and we need to null check that. This is a regression test to ensure
+// that we don't crash.
+TEST_F(PaintWorkletTest, PaintWithNullPaintArguments) {
+  PaintWorkletGlobalScope* global_scope = GetProxy()->global_scope();
+  global_scope->ScriptController()->Evaluate(
+      ScriptSourceCode("registerPaint('foo', class { paint() { } });"));
+
+  CSSPaintDefinition* definition = global_scope->FindDefinition("foo");
+  ASSERT_TRUE(definition);
+
+  ImageResourceObserver* observer = GetImageResourceObserver();
+  ASSERT_TRUE(observer);
+
+  const IntSize container_size(100, 100);
+  scoped_refptr<Image> image =
+      definition->Paint(*observer, container_size, nullptr);
+  EXPECT_EQ(image, nullptr);
+}
+
 // In this test, we set a list of "paints_to_switch" numbers, and in each frame,
 // we switch to a new global scope when the number of paint calls is >= the
 // corresponding number.
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp
index b882ed2..8d3ae00a 100644
--- a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.cpp
@@ -30,7 +30,6 @@
 #include "core/frame/LocalDOMWindow.h"
 #include "core/frame/UseCounter.h"
 #include "modules/filesystem/DOMFileSystem.h"
-#include "modules/filesystem/FileSystemCallback.h"
 #include "modules/filesystem/FileSystemCallbacks.h"
 #include "modules/filesystem/LocalFileSystem.h"
 #include "platform/FileSystemType.h"
@@ -43,7 +42,7 @@
     LocalDOMWindow& window,
     int type,
     long long size,
-    FileSystemCallback* success_callback,
+    V8FileSystemCallback* success_callback,
     V8ErrorCallback* error_callback) {
   if (!window.IsCurrentlyDisplayedInFrame())
     return;
@@ -75,9 +74,11 @@
 
   LocalFileSystem::From(*document)->RequestFileSystem(
       document, file_system_type, size,
-      FileSystemCallbacks::Create(success_callback,
-                                  ScriptErrorCallback::Wrap(error_callback),
-                                  document, file_system_type));
+      FileSystemCallbacks::Create(
+          FileSystemCallbacks::OnDidOpenFileSystemV8Impl::Create(
+              success_callback),
+          ScriptErrorCallback::Wrap(error_callback), document,
+          file_system_type));
 }
 
 void DOMWindowFileSystem::webkitResolveLocalFileSystemURL(
diff --git a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.h b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.h
index a006d6fb..4541f1c3 100644
--- a/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.h
+++ b/third_party/WebKit/Source/modules/filesystem/DOMWindowFileSystem.h
@@ -32,10 +32,10 @@
 
 namespace blink {
 
-class FileSystemCallback;
 class LocalDOMWindow;
 class V8EntryCallback;
 class V8ErrorCallback;
+class V8FileSystemCallback;
 
 class DOMWindowFileSystem {
   STATIC_ONLY(DOMWindowFileSystem);
@@ -44,7 +44,7 @@
   static void webkitRequestFileSystem(LocalDOMWindow&,
                                       int type,
                                       long long size,
-                                      FileSystemCallback*,
+                                      V8FileSystemCallback*,
                                       V8ErrorCallback*);
   static void webkitResolveLocalFileSystemURL(LocalDOMWindow&,
                                               const String&,
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
index 74592ac7..63687dfb 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -36,6 +36,7 @@
 #include "bindings/modules/v8/V8EntryCallback.h"
 #include "bindings/modules/v8/V8ErrorCallback.h"
 #include "bindings/modules/v8/V8FileCallback.h"
+#include "bindings/modules/v8/V8FileSystemCallback.h"
 #include "core/dom/ExecutionContext.h"
 #include "core/fileapi/File.h"
 #include "core/fileapi/FileError.h"
@@ -47,7 +48,6 @@
 #include "modules/filesystem/DirectoryReader.h"
 #include "modules/filesystem/Entry.h"
 #include "modules/filesystem/FileEntry.h"
-#include "modules/filesystem/FileSystemCallback.h"
 #include "modules/filesystem/FileWriterBase.h"
 #include "modules/filesystem/FileWriterBaseCallback.h"
 #include "modules/filesystem/Metadata.h"
@@ -260,8 +260,19 @@
 
 // FileSystemCallbacks --------------------------------------------------------
 
+void FileSystemCallbacks::OnDidOpenFileSystemV8Impl::Trace(
+    blink::Visitor* visitor) {
+  visitor->Trace(callback_);
+  OnDidOpenFileSystemCallback::Trace(visitor);
+}
+
+void FileSystemCallbacks::OnDidOpenFileSystemV8Impl::OnSuccess(
+    DOMFileSystem* file_system) {
+  callback_->handleEvent(file_system);
+}
+
 std::unique_ptr<AsyncFileSystemCallbacks> FileSystemCallbacks::Create(
-    FileSystemCallback* success_callback,
+    OnDidOpenFileSystemCallback* success_callback,
     ErrorCallbackBase* error_callback,
     ExecutionContext* context,
     FileSystemType type) {
@@ -269,20 +280,23 @@
       new FileSystemCallbacks(success_callback, error_callback, context, type));
 }
 
-FileSystemCallbacks::FileSystemCallbacks(FileSystemCallback* success_callback,
-                                         ErrorCallbackBase* error_callback,
-                                         ExecutionContext* context,
-                                         FileSystemType type)
+FileSystemCallbacks::FileSystemCallbacks(
+    OnDidOpenFileSystemCallback* success_callback,
+    ErrorCallbackBase* error_callback,
+    ExecutionContext* context,
+    FileSystemType type)
     : FileSystemCallbacksBase(error_callback, nullptr, context),
       success_callback_(success_callback),
       type_(type) {}
 
 void FileSystemCallbacks::DidOpenFileSystem(const String& name,
                                             const KURL& root_url) {
-  if (success_callback_)
-    HandleEventOrScheduleCallback(
-        success_callback_.Release(),
-        DOMFileSystem::Create(execution_context_.Get(), name, type_, root_url));
+  if (!success_callback_)
+    return;
+
+  InvokeOrScheduleCallback(
+      &OnDidOpenFileSystemCallback::OnSuccess, success_callback_.Release(),
+      DOMFileSystem::Create(execution_context_.Get(), name, type_, root_url));
 }
 
 // ResolveURICallbacks --------------------------------------------------------
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
index 0830358..aeea11c8 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
+++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.h
@@ -42,6 +42,7 @@
 
 namespace blink {
 
+class DOMFileSystem;
 class DOMFileSystemBase;
 class DirectoryReaderBase;
 class DirectoryReaderOnDidReadCallback;
@@ -49,13 +50,13 @@
 class ExecutionContext;
 class File;
 class FileMetadata;
-class FileSystemCallback;
 class FileWriterBase;
 class FileWriterBaseCallback;
 class MetadataCallback;
 class V8EntryCallback;
 class V8ErrorCallback;
 class V8FileCallback;
+class V8FileSystemCallback;
 class VoidCallback;
 
 // Passed to DOMFileSystem implementations that may report errors. Subclasses
@@ -194,18 +195,45 @@
 
 class FileSystemCallbacks final : public FileSystemCallbacksBase {
  public:
-  static std::unique_ptr<AsyncFileSystemCallbacks> Create(FileSystemCallback*,
-                                                          ErrorCallbackBase*,
-                                                          ExecutionContext*,
-                                                          FileSystemType);
+  class OnDidOpenFileSystemCallback
+      : public GarbageCollectedFinalized<OnDidOpenFileSystemCallback> {
+   public:
+    virtual ~OnDidOpenFileSystemCallback() = default;
+    virtual void Trace(blink::Visitor*) {}
+    virtual void OnSuccess(DOMFileSystem*) = 0;
+
+   protected:
+    OnDidOpenFileSystemCallback() = default;
+  };
+
+  class OnDidOpenFileSystemV8Impl : public OnDidOpenFileSystemCallback {
+   public:
+    static OnDidOpenFileSystemV8Impl* Create(V8FileSystemCallback* callback) {
+      return callback ? new OnDidOpenFileSystemV8Impl(callback) : nullptr;
+    }
+    void Trace(blink::Visitor*) override;
+    void OnSuccess(DOMFileSystem*) override;
+
+   private:
+    OnDidOpenFileSystemV8Impl(V8FileSystemCallback* callback)
+        : callback_(callback) {}
+
+    Member<V8FileSystemCallback> callback_;
+  };
+
+  static std::unique_ptr<AsyncFileSystemCallbacks> Create(
+      OnDidOpenFileSystemCallback*,
+      ErrorCallbackBase*,
+      ExecutionContext*,
+      FileSystemType);
   void DidOpenFileSystem(const String& name, const KURL& root_url) override;
 
  private:
-  FileSystemCallbacks(FileSystemCallback*,
+  FileSystemCallbacks(OnDidOpenFileSystemCallback*,
                       ErrorCallbackBase*,
                       ExecutionContext*,
                       FileSystemType);
-  Persistent<FileSystemCallback> success_callback_;
+  Persistent<OnDidOpenFileSystemCallback> success_callback_;
   FileSystemType type_;
 };
 
diff --git a/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h b/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h
index e4bba29..4f04732 100644
--- a/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h
+++ b/third_party/WebKit/Source/modules/filesystem/SyncCallbackHelper.h
@@ -38,7 +38,6 @@
 #include "modules/filesystem/DirectoryEntry.h"
 #include "modules/filesystem/EntrySync.h"
 #include "modules/filesystem/FileEntry.h"
-#include "modules/filesystem/FileSystemCallback.h"
 #include "modules/filesystem/FileSystemCallbacks.h"
 #include "modules/filesystem/MetadataCallback.h"
 #include "platform/heap/Handle.h"
@@ -140,19 +139,15 @@
     MetadataSyncCallbackHelper;
 typedef SyncCallbackHelper<VoidCallback, EmptyType*, EmptyType>
     VoidSyncCallbackHelper;
-typedef SyncCallbackHelper<FileSystemCallback,
-                           DOMFileSystem*,
-                           DOMFileSystemSync>
-    FileSystemSyncCallbackHelper;
 
 // Helper class to support DOMFileSystemSync implementation.
 template <typename SuccessCallback, typename CallbackArg>
-class FileSystemCallbacksSyncHelper final
+class DOMFileSystemCallbacksSyncHelper final
     : public GarbageCollected<
-          FileSystemCallbacksSyncHelper<SuccessCallback, CallbackArg>> {
+          DOMFileSystemCallbacksSyncHelper<SuccessCallback, CallbackArg>> {
  public:
-  static FileSystemCallbacksSyncHelper* Create() {
-    return new FileSystemCallbacksSyncHelper();
+  static DOMFileSystemCallbacksSyncHelper* Create() {
+    return new DOMFileSystemCallbacksSyncHelper();
   }
 
   void Trace(blink::Visitor* visitor) { visitor->Trace(result_); }
@@ -168,7 +163,6 @@
       return nullptr;
     }
 
-    DCHECK(result_);
     return result_;
   }
 
@@ -179,14 +173,17 @@
       visitor->Trace(helper_);
       SuccessCallback::Trace(visitor);
     }
-    void OnSuccess(CallbackArg* arg) override { helper_->result_ = arg; }
+    void OnSuccess(CallbackArg* arg) override {
+      DCHECK(arg);
+      helper_->result_ = arg;
+    }
 
    private:
-    explicit SuccessCallbackImpl(FileSystemCallbacksSyncHelper* helper)
+    explicit SuccessCallbackImpl(DOMFileSystemCallbacksSyncHelper* helper)
         : helper_(helper) {}
-    Member<FileSystemCallbacksSyncHelper> helper_;
+    Member<DOMFileSystemCallbacksSyncHelper> helper_;
 
-    friend class FileSystemCallbacksSyncHelper;
+    friend class DOMFileSystemCallbacksSyncHelper;
   };
 
   class ErrorCallbackImpl final : public ErrorCallbackBase {
@@ -196,18 +193,19 @@
       ErrorCallbackBase::Trace(visitor);
     }
     void Invoke(FileError::ErrorCode error_code) override {
+      DCHECK_NE(error_code, FileError::ErrorCode::kOK);
       helper_->error_code_ = error_code;
     }
 
    private:
-    explicit ErrorCallbackImpl(FileSystemCallbacksSyncHelper* helper)
+    explicit ErrorCallbackImpl(DOMFileSystemCallbacksSyncHelper* helper)
         : helper_(helper) {}
-    Member<FileSystemCallbacksSyncHelper> helper_;
+    Member<DOMFileSystemCallbacksSyncHelper> helper_;
 
-    friend class FileSystemCallbacksSyncHelper;
+    friend class DOMFileSystemCallbacksSyncHelper;
   };
 
-  FileSystemCallbacksSyncHelper() = default;
+  DOMFileSystemCallbacksSyncHelper() = default;
 
   Member<CallbackArg> result_;
   FileError::ErrorCode error_code_ = FileError::ErrorCode::kOK;
@@ -217,7 +215,11 @@
 };
 
 using EntryCallbacksSyncHelper =
-    FileSystemCallbacksSyncHelper<EntryCallbacks::OnDidGetEntryCallback, Entry>;
+    DOMFileSystemCallbacksSyncHelper<EntryCallbacks::OnDidGetEntryCallback,
+                                     Entry>;
+using FileSystemCallbacksSyncHelper = DOMFileSystemCallbacksSyncHelper<
+    FileSystemCallbacks::OnDidOpenFileSystemCallback,
+    DOMFileSystem>;
 
 }  // namespace blink
 
diff --git a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
index c8cdb73..5b51408 100644
--- a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.cpp
@@ -37,7 +37,6 @@
 #include "modules/filesystem/DOMFileSystemBase.h"
 #include "modules/filesystem/DirectoryEntrySync.h"
 #include "modules/filesystem/FileEntrySync.h"
-#include "modules/filesystem/FileSystemCallback.h"
 #include "modules/filesystem/FileSystemCallbacks.h"
 #include "modules/filesystem/LocalFileSystem.h"
 #include "modules/filesystem/SyncCallbackHelper.h"
@@ -50,7 +49,7 @@
     WorkerGlobalScope& worker,
     int type,
     long long size,
-    FileSystemCallback* success_callback,
+    V8FileSystemCallback* success_callback,
     V8ErrorCallback* error_callback) {
   ExecutionContext* secure_context = worker.GetExecutionContext();
   if (!secure_context->GetSecurityOrigin()->CanAccessFileSystem()) {
@@ -72,9 +71,11 @@
 
   LocalFileSystem::From(worker)->RequestFileSystem(
       &worker, file_system_type, size,
-      FileSystemCallbacks::Create(success_callback,
-                                  ScriptErrorCallback::Wrap(error_callback),
-                                  &worker, file_system_type));
+      FileSystemCallbacks::Create(
+          FileSystemCallbacks::OnDidOpenFileSystemV8Impl::Create(
+              success_callback),
+          ScriptErrorCallback::Wrap(error_callback), &worker,
+          file_system_type));
 }
 
 DOMFileSystemSync* WorkerGlobalScopeFileSystem::webkitRequestFileSystemSync(
@@ -98,16 +99,18 @@
     return nullptr;
   }
 
-  FileSystemSyncCallbackHelper* helper = FileSystemSyncCallbackHelper::Create();
+  FileSystemCallbacksSyncHelper* sync_helper =
+      FileSystemCallbacksSyncHelper::Create();
   std::unique_ptr<AsyncFileSystemCallbacks> callbacks =
-      FileSystemCallbacks::Create(helper->GetSuccessCallback(),
-                                  helper->GetErrorCallback(), &worker,
+      FileSystemCallbacks::Create(sync_helper->GetSuccessCallback(),
+                                  sync_helper->GetErrorCallback(), &worker,
                                   file_system_type);
   callbacks->SetShouldBlockUntilCompletion(true);
 
   LocalFileSystem::From(worker)->RequestFileSystem(&worker, file_system_type,
                                                    size, std::move(callbacks));
-  return helper->GetResult(exception_state);
+  DOMFileSystem* file_system = sync_helper->GetResultOrThrow(exception_state);
+  return file_system ? DOMFileSystemSync::Create(file_system) : nullptr;
 }
 
 void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(
diff --git a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h
index b155a85..6a78aba9 100644
--- a/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h
+++ b/third_party/WebKit/Source/modules/filesystem/WorkerGlobalScopeFileSystem.h
@@ -34,9 +34,9 @@
 
 class EntrySync;
 class ExceptionState;
-class FileSystemCallback;
 class V8EntryCallback;
 class V8ErrorCallback;
+class V8FileSystemCallback;
 class WorkerGlobalScope;
 
 class WorkerGlobalScopeFileSystem {
@@ -51,7 +51,7 @@
   static void webkitRequestFileSystem(WorkerGlobalScope&,
                                       int type,
                                       long long size,
-                                      FileSystemCallback* success_callback,
+                                      V8FileSystemCallback* success_callback,
                                       V8ErrorCallback*);
   static DOMFileSystemSync* webkitRequestFileSystemSync(WorkerGlobalScope&,
                                                         int type,
diff --git a/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.cpp b/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.cpp
index 2d67f81..8a72555 100644
--- a/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.cpp
+++ b/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.cpp
@@ -6,7 +6,7 @@
 
 #include "platform/bindings/DOMDataStore.h"
 #include "platform/bindings/ScriptWrappable.h"
-#include "platform/bindings/ScriptWrappableMarkingVisitor.h"
+#include "platform/bindings/ScriptWrappableVisitor.h"
 #include "platform/bindings/V8Binding.h"
 #include "platform/bindings/V8PerIsolateData.h"
 
@@ -21,7 +21,7 @@
 
 void ActiveScriptWrappableBase::TraceActiveScriptWrappables(
     v8::Isolate* isolate,
-    ScriptWrappableMarkingVisitor* visitor) {
+    ScriptWrappableVisitor* visitor) {
   V8PerIsolateData* isolate_data = V8PerIsolateData::From(isolate);
   const auto* active_script_wrappables = isolate_data->ActiveScriptWrappables();
   if (!active_script_wrappables)
@@ -46,12 +46,14 @@
     // TODO(haraken): Implement correct lifetime using traceWrapper.
     if (active_wrappable->IsContextDestroyed())
       continue;
-
     ScriptWrappable* script_wrappable = active_wrappable->ToScriptWrappable();
-    auto* wrapper_type_info =
-        const_cast<WrapperTypeInfo*>(script_wrappable->GetWrapperTypeInfo());
-    visitor->RegisterV8Reference(
-        std::make_pair(wrapper_type_info, script_wrappable));
+    // Notify the visitor about this script_wrappable by dispatching to the
+    // corresponding visitor->Visit(script_wrappable) method.
+    // Ideally, we would call visitor->TraceWrappers(script_wrappable) here,
+    // but that method requires TraceWrapperMember<T>. Since we are getting
+    // the script wrappable from ActiveScriptWrappables, we do not have
+    // TraceWrapperMember<T> and have to use TraceWrappersFromGeneratedCode.
+    visitor->TraceWrappersFromGeneratedCode(script_wrappable);
   }
 }
 
diff --git a/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.h b/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.h
index 5853b5e..7ac63c0e 100644
--- a/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.h
+++ b/third_party/WebKit/Source/platform/bindings/ActiveScriptWrappableBase.h
@@ -16,7 +16,7 @@
 namespace blink {
 
 class ScriptWrappable;
-class ScriptWrappableMarkingVisitor;
+class ScriptWrappableVisitor;
 
 /**
  * Classes deriving from ActiveScriptWrappable will be registered in a
@@ -30,7 +30,7 @@
   ActiveScriptWrappableBase();
 
   static void TraceActiveScriptWrappables(v8::Isolate*,
-                                          ScriptWrappableMarkingVisitor*);
+                                          ScriptWrappableVisitor*);
 
  protected:
   virtual bool IsContextDestroyed() const = 0;
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
index 05fde446..36c1cf5 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
@@ -167,6 +167,10 @@
       }
 
       for (size_t i = 1; i < tokens.size(); i++) {
+        if (!tokens[i].ContainsOnlyASCII()) {
+          messages->push_back("Non-ASCII characters in origin.");
+          continue;
+        }
         if (EqualIgnoringASCIICase(tokens[i], "'self'")) {
           origins.push_back(self_origin->ToUrlOrigin());
         } else if (src_origin && EqualIgnoringASCIICase(tokens[i], "'src'")) {
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
index 998e7dcf..f77b1f5 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
@@ -51,7 +51,8 @@
     "vibrate https://bad;origin",
     "vibrate https:/bad,origin",
     "vibrate https://example.com, https://a.com",
-    "vibrate *, payment data://badorigin"};
+    "vibrate *, payment data://badorigin",
+    "vibrate ws://xn--fd\xbcwsw3taaaaaBaa333aBBBBBBJBBJBBBt"};
 
 }  // namespace
 
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index 5cf58cd..eaf0069 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -305,11 +305,6 @@
   // Tell the derived class to scroll its contents.
   UpdateScrollOffset(truncated_offset, scroll_type);
 
-  // If the layout object has been detached as a result of updating the scroll
-  // this object will be cleaned up shortly.
-  if (HasBeenDisposed())
-    return;
-
   // Tell the scrollbars to update their thumb postions.
   // If the scrollbar does not have its own layer, it must always be
   // invalidated to reflect the new thumb offset, even if the theme did not
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
index 9f60511..f3756ba4 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h
@@ -421,8 +421,6 @@
   // then reset to alpha, causing spurrious "visibilityChanged" calls.
   virtual void ScrollbarVisibilityChanged() {}
 
-  virtual bool HasBeenDisposed() const { return false; }
-
  private:
   FRIEND_TEST_ALL_PREFIXES(ScrollableAreaTest,
                            PopupOverlayScrollbarShouldNotFadeOut);
diff --git a/third_party/WebKit/public/platform/WebHTTPBody.h b/third_party/WebKit/public/platform/WebHTTPBody.h
index 9f6c0e47..5f8d3be 100644
--- a/third_party/WebKit/public/platform/WebHTTPBody.h
+++ b/third_party/WebKit/public/platform/WebHTTPBody.h
@@ -51,7 +51,6 @@
       kTypeData,
       kTypeFile,
       kTypeBlob,
-      kTypeFileSystemURL,
       kTypeDataPipe,
     } type;
     WebData data;
@@ -59,7 +58,6 @@
     long long file_start;
     long long file_length;  // -1 means to the end of the file.
     double modification_time;
-    WebURL file_system_url;
     WebString blob_uuid;
     // |data_pipe_getter| is a network::mojom::DataPipeGetterPtr. It's declared
     // as a generic ScopedMessagePipeHandle so it can be "cast" between Blink
diff --git a/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h
index 2b0045d..a9b804ba 100644
--- a/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h
+++ b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerRegistration.h
@@ -52,11 +52,7 @@
   virtual void ProxyStopped() {}
 
   virtual WebURL Scope() const { return WebURL(); }
-  // TODO(crbug.com/675540): Make this pure virtual once
-  // implemented in derived classes.
-  virtual mojom::ServiceWorkerUpdateViaCache UpdateViaCache() const {
-    return mojom::ServiceWorkerUpdateViaCache::kImports;
-  }
+  virtual mojom::ServiceWorkerUpdateViaCache UpdateViaCache() const = 0;
   virtual int64_t RegistrationId() const = 0;
   virtual void Update(std::unique_ptr<WebServiceWorkerUpdateCallbacks>) {}
   virtual void Unregister(
diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h
index 6370fb7..ff0e6e8 100644
--- a/third_party/WebKit/public/web/WebLocalFrame.h
+++ b/third_party/WebKit/public/web/WebLocalFrame.h
@@ -785,8 +785,8 @@
   // If set to false, do not draw scrollbars on this frame's view.
   virtual void SetCanHaveScrollbars(bool) = 0;
 
-  // The size of the contents area.
-  virtual WebSize ContentsSize() const = 0;
+  // The size of the document in this frame.
+  virtual WebSize DocumentSize() const = 0;
 
   // Returns true if the contents (minus scrollbars) has non-zero area.
   virtual bool HasVisibleContent() const = 0;
diff --git a/third_party/android_crazy_linker/BUILD.gn b/third_party/android_crazy_linker/BUILD.gn
index ec34f87..49729ea 100644
--- a/third_party/android_crazy_linker/BUILD.gn
+++ b/third_party/android_crazy_linker/BUILD.gn
@@ -32,7 +32,6 @@
     "src/src/crazy_linker_error.h",
     "src/src/crazy_linker_globals.cpp",
     "src/src/crazy_linker_globals.h",
-    "src/src/crazy_linker_leb128.h",
     "src/src/crazy_linker_library_list.cpp",
     "src/src/crazy_linker_library_list.h",
     "src/src/crazy_linker_library_view.cpp",
@@ -61,10 +60,11 @@
     "src/src/elf_traits.h",
     "src/src/linker_phdr.cpp",
     "src/src/linker_phdr.h",
+    "src/src/linker_reloc_iterators.h",
+    "src/src/linker_sleb128.h",
   ]
 
   include_dirs = [ "src/src" ]
-  defines = [ "CRAZY_DEBUG=0" ]
 
   public_configs = [ ":crazy_config" ]
   configs -= [ "//build/config/compiler:chromium_code" ]
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_defines.h b/third_party/android_crazy_linker/src/src/crazy_linker_defines.h
new file mode 100644
index 0000000..8b1dffd
--- /dev/null
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_defines.h
@@ -0,0 +1,10 @@
+// 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.
+
+// Comes from bionic/linker/linker_common_types.h
+// Android uses RELA for aarch64 and x86_64. mips64 still uses REL.
+#if defined(__aarch64__) || defined(__x86_64__)
+// USE_RELA means relocations have explicit addends.
+#define USE_RELA 1
+#endif
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.cpp
index 9f6d826..9b49601 100644
--- a/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.cpp
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.cpp
@@ -6,15 +6,17 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <memory>
 
 #include "crazy_linker_debug.h"
 #include "crazy_linker_elf_symbols.h"
 #include "crazy_linker_elf_view.h"
 #include "crazy_linker_error.h"
-#include "crazy_linker_leb128.h"
 #include "crazy_linker_system.h"
 #include "crazy_linker_util.h"
 #include "linker_phdr.h"
+#include "linker_reloc_iterators.h"
+#include "linker_sleb128.h"
 
 #define DEBUG_RELOCATIONS 0
 
@@ -187,11 +189,6 @@
   phdr_count_ = view->phdr_count();
   load_bias_ = view->load_bias();
 
-  // We handle only Rel or Rela, but not both. If DT_RELA or DT_RELASZ
-  // then we require DT_PLTREL to agree.
-  bool has_rela_relocations = false;
-  bool has_rel_relocations = false;
-
   // Parse the dynamic table.
   ElfView::DynamicIterator dyn(view);
   for (; dyn.HasNext(); dyn.GetNext()) {
@@ -200,88 +197,93 @@
 
     const ELF::Addr tag = dyn.GetTag();
     switch (tag) {
+#if defined(USE_RELA)
+      case DT_REL:
+      case DT_RELSZ:
+      case DT_ANDROID_REL:
+      case DT_ANDROID_RELSZ:
+#else
+      case DT_RELA:
+      case DT_RELASZ:
+      case DT_ANDROID_RELA:
+      case DT_ANDROID_RELASZ:
+#endif
+        LOG("unsupported relocation type");
+        *error = "Relocation for wrong architecture";
+        return false;
       case DT_PLTREL:
         RLOG("  DT_PLTREL value=%d\n", dyn_value);
-        if (dyn_value != DT_REL && dyn_value != DT_RELA) {
-          *error = "Invalid DT_PLTREL value in dynamic section";
+#if defined(USE_RELA)
+        if (dyn_value != DT_RELA) {
+          RLOG("unsupported DT_PLTREL in \"%s\"; expected DT_RELA");
           return false;
         }
-        relocations_type_ = dyn_value;
+#else
+        if (dyn_value != DT_REL) {
+          RLOG("unsupported DT_PLTREL in \"%s\"; expected DT_REL");
+          return false;
+        }
+#endif
         break;
       case DT_JMPREL:
-        RLOG("  DT_JMPREL addr=%p\n", dyn_addr);
+        RLOG("  DT_JMPREL addr=%p\n", dyn_addr - load_bias_);
         plt_relocations_ = dyn_addr;
         break;
       case DT_PLTRELSZ:
         plt_relocations_size_ = dyn_value;
         RLOG("  DT_PLTRELSZ size=%d\n", dyn_value);
         break;
+#if defined(USE_RELA)
       case DT_RELA:
+#else
       case DT_REL:
-        RLOG("  %s addr=%p\n",
-             (tag == DT_RELA) ? "DT_RELA" : "DT_REL",
-             dyn_addr);
+#endif
+        RLOG("  %s addr=%p\n", (tag == DT_RELA) ? "DT_RELA" : "DT_REL",
+             dyn_addr - load_bias_);
         if (relocations_) {
           *error = "Unsupported DT_RELA/DT_REL combination in dynamic section";
           return false;
         }
         relocations_ = dyn_addr;
-        if (tag == DT_RELA)
-          has_rela_relocations = true;
-        else
-          has_rel_relocations = true;
         break;
+#if defined(USE_RELA)
       case DT_RELASZ:
+#else
       case DT_RELSZ:
-        RLOG("  %s size=%d\n",
-             (tag == DT_RELASZ) ? "DT_RELASZ" : "DT_RELSZ",
-             dyn_addr);
-        if (relocations_size_) {
-          *error = "Unsupported DT_RELASZ/DT_RELSZ combination in dyn section";
-          return false;
-        }
+#endif
+        RLOG("  %s size=%d\n", (tag == DT_RELASZ) ? "DT_RELASZ" : "DT_RELSZ",
+             dyn_value);
         relocations_size_ = dyn_value;
-        if (tag == DT_RELASZ)
-          has_rela_relocations = true;
-        else
-          has_rel_relocations = true;
         break;
+#if defined(USE_RELA)
       case DT_ANDROID_RELA:
+#else
       case DT_ANDROID_REL:
+#endif
         RLOG("  %s addr=%p\n",
-             (tag == DT_ANDROID_RELA) ? "DT_ANDROID_RELA" : "DT_ANDROID_REL",
-             dyn_addr);
+             (tag == DT_ANDROID_REL) ? "DT_ANDROID_REL" : "DT_ANDROID_RELA",
+             dyn_addr - load_bias_);
         if (android_relocations_) {
-          *error = "Unsupported DT_ANDROID_RELA/DT_ANDROID_REL "
-                   "combination in dynamic section";
+          *error = "Multiple DT_ANDROID_* sections defined.";
           return false;
         }
         android_relocations_ = reinterpret_cast<uint8_t*>(dyn_addr);
-        if (tag == DT_ANDROID_RELA)
-          has_rela_relocations = true;
-        else
-          has_rel_relocations = true;
         break;
+#if defined(USE_RELA)
       case DT_ANDROID_RELASZ:
+#else
       case DT_ANDROID_RELSZ:
+#endif
         RLOG("  %s size=%d\n",
-             (tag == DT_ANDROID_RELASZ)
-                 ? "DT_ANDROID_RELASZ" : "DT_ANDROID_RELSZ", dyn_addr);
-        if (android_relocations_size_) {
-          *error = "Unsupported DT_ANDROID_RELASZ/DT_ANDROID_RELSZ "
-                   "combination in dyn section";
-          return false;
-        }
+             (tag == DT_ANDROID_RELASZ) ? "DT_ANDROID_RELASZ"
+                                        : "DT_ANDROID_RELSZ",
+             dyn_value);
         android_relocations_size_ = dyn_value;
-        if (tag == DT_ANDROID_RELASZ)
-          has_rela_relocations = true;
-        else
-          has_rel_relocations = true;
         break;
       case DT_PLTGOT:
         // Only used on MIPS currently. Could also be used on other platforms
         // when lazy binding (i.e. RTLD_LAZY) is implemented.
-        RLOG("  DT_PLTGOT addr=%p\n", dyn_addr);
+        RLOG("  DT_PLTGOT addr=%p\n", dyn_addr - load_bias_);
         plt_got_ = reinterpret_cast<ELF::Addr*>(dyn_addr);
         break;
       case DT_TEXTREL:
@@ -322,32 +324,6 @@
     }
   }
 
-  if (has_rel_relocations && has_rela_relocations) {
-    *error = "Combining relocations with and without addends is not "
-             "currently supported";
-    return false;
-  }
-
-  // If DT_PLTREL did not explicitly assign relocations_type_, set it
-  // here based on the type of relocations found.
-  if (relocations_type_ != DT_REL && relocations_type_ != DT_RELA) {
-    if (has_rel_relocations)
-      relocations_type_ = DT_REL;
-    else if (has_rela_relocations)
-      relocations_type_ = DT_RELA;
-  }
-
-  if (relocations_type_ == DT_REL && has_rela_relocations) {
-    *error = "Found relocations with addends in dyn section, "
-             "but DT_PLTREL is DT_REL";
-    return false;
-  }
-  if (relocations_type_ == DT_RELA && has_rel_relocations) {
-    *error = "Found relocations without addends in dyn section, "
-             "but DT_PLTREL is DT_RELA";
-    return false;
-  }
-
   return true;
 }
 
@@ -366,35 +342,13 @@
   if (!ApplyAndroidRelocations(symbols, resolver, error))
     return false;
 
-  if (relocations_type_ == DT_REL) {
-    if (!ApplyRelRelocs(reinterpret_cast<ELF::Rel*>(relocations_),
-                        relocations_size_ / sizeof(ELF::Rel),
-                        symbols,
-                        resolver,
-                        error))
-      return false;
-    if (!ApplyRelRelocs(reinterpret_cast<ELF::Rel*>(plt_relocations_),
-                        plt_relocations_size_ / sizeof(ELF::Rel),
-                        symbols,
-                        resolver,
-                        error))
-      return false;
-  }
-
-  if (relocations_type_ == DT_RELA) {
-    if (!ApplyRelaRelocs(reinterpret_cast<ELF::Rela*>(relocations_),
-                         relocations_size_ / sizeof(ELF::Rela),
-                         symbols,
-                         resolver,
-                         error))
-      return false;
-    if (!ApplyRelaRelocs(reinterpret_cast<ELF::Rela*>(plt_relocations_),
-                         plt_relocations_size_ / sizeof(ELF::Rela),
-                         symbols,
-                         resolver,
-                         error))
-      return false;
-  }
+  if (!ApplyRelocs(reinterpret_cast<rel_t*>(relocations_),
+                   relocations_size_ / sizeof(rel_t), symbols, resolver, error))
+    return false;
+  if (!ApplyRelocs(reinterpret_cast<rel_t*>(plt_relocations_),
+                   plt_relocations_size_ / sizeof(rel_t), symbols, resolver,
+                   error))
+    return false;
 
 #ifdef __mips__
   if (!RelocateMipsGot(symbols, resolver, error))
@@ -442,76 +396,41 @@
   const size_t flags_;
 };
 
+template <typename ElfRelIteratorT>
+bool ElfRelocations::ForEachAndroidRelocationHelper(
+    ElfRelIteratorT&& rel_iterator,
+    RelocationHandler handler,
+    void* opaque) {
+  size_t relocations_handled = 0;
+  while (rel_iterator.has_next()) {
+    const auto rel = rel_iterator.next();
+    if (rel == nullptr) {
+      LOG("%s: failed to parse relocation %d\n", __FUNCTION__,
+          relocations_handled);
+      return false;
+    }
+    // Pass the relocation to the supplied handler function. If the handler
+    // returns false we view this as failure and return false to our caller.
+    if (!handler(this, rel, opaque)) {
+      LOG("%s: failed handling relocation %d\n", __FUNCTION__,
+          relocations_handled);
+      return false;
+    }
+    relocations_handled++;
+  }
+  LOG("%s: relocations_handled=%d\n", __FUNCTION__, relocations_handled);
+  return true;
+}
+
 bool ElfRelocations::ForEachAndroidRelocation(RelocationHandler handler,
                                               void* opaque) {
   // Skip over the "APS2" signature.
-  Sleb128Decoder decoder(android_relocations_ + 4,
-                         android_relocations_size_ - 4);
-
-  // Unpacking into a relocation with addend, both for REL and RELA, is
-  // convenient at this point. If REL, the handler needs to take care of
-  // any conversion before use.
-  ELF::Rela relocation;
-  memset(&relocation, 0, sizeof(relocation));
-
-  // Read the relocation count and initial offset.
-  const size_t relocation_count = decoder.pop_front();
-  relocation.r_offset = decoder.pop_front();
-
-  LOG("%s: relocation_count=%d, initial r_offset=%p\n",
-      __FUNCTION__,
-      relocation_count,
-      relocation.r_offset);
-
-  size_t relocations_handled = 0;
-  while (relocations_handled < relocation_count) {
-    // Read the start of the group header to obtain its size and flags.
-    const size_t group_size = decoder.pop_front();
-    AndroidPackedRelocationGroupFlags group_flags(decoder.pop_front());
-
-    // Read other group header fields, depending on the flags read above.
-    size_t group_r_offset_delta = 0;
-    if (group_flags.is_relocation_grouped_by_offset_delta())
-      group_r_offset_delta = decoder.pop_front();
-
-    if (group_flags.is_relocation_grouped_by_info())
-      relocation.r_info = decoder.pop_front();
-
-    if (group_flags.is_relocation_group_has_addend() &&
-        group_flags.is_relocation_grouped_by_addend())
-      relocation.r_addend += decoder.pop_front();
-    else if (!group_flags.is_relocation_group_has_addend())
-      relocation.r_addend = 0;
-
-    // Expand the group into individual relocations.
-    for (size_t group_index = 0; group_index < group_size; group_index++) {
-      if (group_flags.is_relocation_grouped_by_offset_delta())
-        relocation.r_offset += group_r_offset_delta;
-      else
-        relocation.r_offset += decoder.pop_front();
-
-      if (!group_flags.is_relocation_grouped_by_info())
-        relocation.r_info = decoder.pop_front();
-
-      if (group_flags.is_relocation_group_has_addend() &&
-          !group_flags.is_relocation_grouped_by_addend())
-        relocation.r_addend += decoder.pop_front();
-
-      // Pass the relocation to the supplied handler function. If the handler
-      // returns false we view this as failure and return false to our caller.
-      if (!handler(this, &relocation, opaque)) {
-        LOG("%s: failed handling relocation %d\n",
-            __FUNCTION__,
-            relocations_handled);
-        return false;
-      }
-
-      relocations_handled++;
-    }
-  }
-
-  LOG("%s: relocations_handled=%d\n", __FUNCTION__, relocations_handled);
-  return true;
+  const uint8_t* packed_relocs = android_relocations_ + 4;
+  const size_t packed_relocs_size = android_relocations_size_ - 4;
+  return ForEachAndroidRelocationHelper(
+      packed_reloc_iterator<sleb128_decoder>(
+          sleb128_decoder(packed_relocs, packed_relocs_size)),
+      handler, opaque);
 }
 
 namespace {
@@ -529,19 +448,10 @@
           android_relocations[3] == '2');
 }
 
-// Narrow a Rela to its equivalent Rel. The r_addend field in the input
-// Rela must be zero.
-void ConvertRelaToRel(const ELF::Rela* rela, ELF::Rel* rel) {
-  assert(rela->r_addend == 0);
-  rel->r_offset = rela->r_offset;
-  rel->r_info = rela->r_info;
-}
-
 }  // namespace
 
 // Args for ApplyAndroidRelocation handler function.
 struct ApplyAndroidRelocationArgs {
-  ELF::Addr relocations_type;
   const ElfSymbols* symbols;
   ElfRelocations::SymbolResolver* resolver;
   Error* error;
@@ -549,28 +459,16 @@
 
 // Static ForEachAndroidRelocation() handler.
 bool ElfRelocations::ApplyAndroidRelocation(ElfRelocations* relocations,
-                                            const ELF::Rela* relocation,
+                                            const rel_t* relocation,
                                             void* opaque) {
   // Unpack args from opaque.
   ApplyAndroidRelocationArgs* args =
       reinterpret_cast<ApplyAndroidRelocationArgs*>(opaque);
-  const ELF::Addr relocations_type = args->relocations_type;
   const ElfSymbols* symbols = args->symbols;
   ElfRelocations::SymbolResolver* resolver = args->resolver;
   Error* error = args->error;
 
-  // For REL relocations, convert from RELA to REL and apply the conversion.
-  // For RELA relocations, apply RELA directly.
-  if (relocations_type == DT_REL) {
-    ELF::Rel converted;
-    ConvertRelaToRel(relocation, &converted);
-    return relocations->ApplyRelReloc(&converted, symbols, resolver, error);
-  }
-
-  if (relocations_type == DT_RELA)
-    return relocations->ApplyRelaReloc(relocation, symbols, resolver, error);
-
-  return true;
+  return relocations->ApplyReloc(relocation, symbols, resolver, error);
 }
 
 bool ElfRelocations::ApplyAndroidRelocations(const ElfSymbols* symbols,
@@ -584,17 +482,17 @@
     return false;
 
   ApplyAndroidRelocationArgs args;
-  args.relocations_type = relocations_type_;
   args.symbols = symbols;
   args.resolver = resolver;
   args.error = error;
   return ForEachAndroidRelocation(&ApplyAndroidRelocation, &args);
 }
 
-bool ElfRelocations::ApplyResolvedRelaReloc(const ELF::Rela* rela,
-                                            ELF::Addr sym_addr,
-                                            bool resolved CRAZY_UNUSED,
-                                            Error* error) {
+#if defined(USE_RELA)
+bool ElfRelocations::ApplyResolvedReloc(const ELF::Rela* rela,
+                                        ELF::Addr sym_addr,
+                                        bool resolved CRAZY_UNUSED,
+                                        Error* error) {
   const ELF::Word rela_type = ELF_R_TYPE(rela->r_info);
   const ELF::Word CRAZY_UNUSED rela_symbol = ELF_R_SYM(rela->r_info);
   const ELF::Sword CRAZY_UNUSED addend = rela->r_addend;
@@ -686,10 +584,12 @@
   return true;
 }
 
-bool ElfRelocations::ApplyResolvedRelReloc(const ELF::Rel* rel,
-                                           ELF::Addr sym_addr,
-                                           bool resolved CRAZY_UNUSED,
-                                           Error* error) {
+#else
+
+bool ElfRelocations::ApplyResolvedReloc(const ELF::Rel* rel,
+                                        ELF::Addr sym_addr,
+                                        bool resolved CRAZY_UNUSED,
+                                        Error* error) {
   const ELF::Word rel_type = ELF_R_TYPE(rel->r_info);
   const ELF::Word CRAZY_UNUSED rel_symbol = ELF_R_SYM(rel->r_info);
 
@@ -791,6 +691,7 @@
 
   return true;
 }
+#endif  // defined(USE_RELA)
 
 bool ElfRelocations::ResolveSymbol(ELF::Word rel_type,
                                    ELF::Word rel_symbol,
@@ -847,20 +748,17 @@
   return false;
 }
 
-bool ElfRelocations::ApplyRelReloc(const ELF::Rel* rel,
-                                   const ElfSymbols* symbols,
-                                   SymbolResolver* resolver,
-                                   Error* error) {
+bool ElfRelocations::ApplyReloc(const rel_t* rel,
+                                const ElfSymbols* symbols,
+                                SymbolResolver* resolver,
+                                Error* error) {
   const ELF::Word rel_type = ELF_R_TYPE(rel->r_info);
   const ELF::Word rel_symbol = ELF_R_SYM(rel->r_info);
 
   ELF::Addr sym_addr = 0;
   ELF::Addr reloc = static_cast<ELF::Addr>(rel->r_offset + load_bias_);
-  RLOG("  reloc=%p offset=%p type=%d symbol=%d\n",
-       reloc,
-       rel->r_offset,
-       rel_type,
-       rel_symbol);
+  RLOG("  offset=%p type=%d reloc=%p symbol=%d\n", rel->r_offset, rel_type,
+       reloc, rel_symbol);
 
   if (rel_type == 0)
     return true;
@@ -881,14 +779,14 @@
     resolved = true;
   }
 
-  return ApplyResolvedRelReloc(rel, sym_addr, resolved, error);
+  return ApplyResolvedReloc(rel, sym_addr, resolved, error);
 }
 
-bool ElfRelocations::ApplyRelRelocs(const ELF::Rel* rel,
-                                    size_t rel_count,
-                                    const ElfSymbols* symbols,
-                                    SymbolResolver* resolver,
-                                    Error* error) {
+bool ElfRelocations::ApplyRelocs(const rel_t* rel,
+                                 size_t rel_count,
+                                 const ElfSymbols* symbols,
+                                 SymbolResolver* resolver,
+                                 Error* error) {
   RLOG("%s: rel=%p rel_count=%d\n", __FUNCTION__, rel, rel_count);
 
   if (!rel)
@@ -897,64 +795,7 @@
   for (size_t rel_n = 0; rel_n < rel_count; rel++, rel_n++) {
     RLOG("  Relocation %d of %d:\n", rel_n + 1, rel_count);
 
-    if (!ApplyRelReloc(rel, symbols, resolver, error))
-      return false;
-  }
-
-  return true;
-}
-
-bool ElfRelocations::ApplyRelaReloc(const ELF::Rela* rela,
-                                    const ElfSymbols* symbols,
-                                    SymbolResolver* resolver,
-                                    Error* error) {
-  const ELF::Word rel_type = ELF_R_TYPE(rela->r_info);
-  const ELF::Word rel_symbol = ELF_R_SYM(rela->r_info);
-
-  ELF::Addr sym_addr = 0;
-  ELF::Addr reloc = static_cast<ELF::Addr>(rela->r_offset + load_bias_);
-  RLOG("  reloc=%p offset=%p type=%d symbol=%d\n",
-       reloc,
-       rela->r_offset,
-       rel_type,
-       rel_symbol);
-
-  if (rel_type == 0)
-    return true;
-
-  bool resolved = false;
-
-  // If this is a symbolic relocation, compute the symbol's address.
-  if (__builtin_expect(rel_symbol != 0, 0)) {
-    if (!ResolveSymbol(rel_type,
-                       rel_symbol,
-                       symbols,
-                       resolver,
-                       reloc,
-                       &sym_addr,
-                       error)) {
-      return false;
-    }
-    resolved = true;
-  }
-
-  return ApplyResolvedRelaReloc(rela, sym_addr, resolved, error);
-}
-
-bool ElfRelocations::ApplyRelaRelocs(const ELF::Rela* rela,
-                                     size_t rela_count,
-                                     const ElfSymbols* symbols,
-                                     SymbolResolver* resolver,
-                                     Error* error) {
-  RLOG("%s: rela=%p rela_count=%d\n", __FUNCTION__, rela, rela_count);
-
-  if (!rela)
-    return true;
-
-  for (size_t rel_n = 0; rel_n < rela_count; rela++, rel_n++) {
-    RLOG("  Relocation %d of %d:\n", rel_n + 1, rela_count);
-
-    if (!ApplyRelaReloc(rela, symbols, resolver, error))
+    if (!ApplyReloc(rel, symbols, resolver, error))
       return false;
   }
 
@@ -1050,7 +891,7 @@
   }
 }
 
-void ElfRelocations::AdjustAndroidRelocation(const ELF::Rela* relocation,
+void ElfRelocations::AdjustAndroidRelocation(const rel_t* relocation,
                                              size_t src_addr,
                                              size_t dst_addr,
                                              size_t map_addr,
@@ -1088,7 +929,7 @@
 
 // Static ForEachAndroidRelocation() handler.
 bool ElfRelocations::RelocateAndroidRelocation(ElfRelocations* relocations,
-                                               const ELF::Rela* relocation,
+                                               const rel_t* relocation,
                                                void* opaque) {
   // Unpack args from opaque, to obtain addrs and size;
   RelocateAndroidRelocationArgs* args =
@@ -1098,11 +939,6 @@
   const size_t map_addr = args->map_addr;
   const size_t size = args->size;
 
-  // Relocate the given relocation.  Because the r_addend field is ignored
-  // in relocating RELA relocations we do not need to convert from REL to
-  // RELA and supply alternative relocator functions; instead we can work
-  // here directly on the RELA supplied by ForEachAndroidRelocation(), even
-  // on REL architectures.
   relocations->AdjustAndroidRelocation(relocation,
                                        src_addr,
                                        dst_addr,
@@ -1129,7 +965,6 @@
   ForEachAndroidRelocation(&RelocateAndroidRelocation, &args);
 }
 
-template<typename Rel>
 void ElfRelocations::RelocateRelocations(size_t src_addr,
                                          size_t dst_addr,
                                          size_t map_addr,
@@ -1140,9 +975,9 @@
   const size_t map_delta = map_addr - src_addr;
 
   // Ignore PLT relocations, which all target symbols (ignored here).
-  const Rel* rel = reinterpret_cast<Rel*>(relocations_);
-  const size_t relocations_count = relocations_size_ / sizeof(Rel);
-  const Rel* rel_limit = rel + relocations_count;
+  const rel_t* rel = reinterpret_cast<rel_t*>(relocations_);
+  const size_t relocations_count = relocations_size_ / sizeof(rel_t);
+  const rel_t* rel_limit = rel + relocations_count;
 
   for (; rel < rel_limit; ++rel) {
     const ELF::Word rel_type = ELF_R_TYPE(rel->r_info);
@@ -1163,12 +998,6 @@
   }
 }
 
-template void ElfRelocations::RelocateRelocations<ELF::Rel>(
-    size_t src_addr, size_t dst_addr, size_t map_addr, size_t size);
-
-template void ElfRelocations::RelocateRelocations<ELF::Rela>(
-    size_t src_addr, size_t dst_addr, size_t map_addr, size_t size);
-
 void ElfRelocations::CopyAndRelocate(size_t src_addr,
                                      size_t dst_addr,
                                      size_t map_addr,
@@ -1182,11 +1011,7 @@
   RelocateAndroidRelocations(src_addr, dst_addr, map_addr, size);
 
   // Relocate relocations.
-  if (relocations_type_ == DT_REL)
-    RelocateRelocations<ELF::Rel>(src_addr, dst_addr, map_addr, size);
-
-  if (relocations_type_ == DT_RELA)
-    RelocateRelocations<ELF::Rela>(src_addr, dst_addr, map_addr, size);
+  RelocateRelocations(src_addr, dst_addr, map_addr, size);
 
 #ifdef __mips__
   // Add this value to each source address to get the corresponding
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.h b/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.h
index 1c7c15b..8e71551 100644
--- a/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.h
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_elf_relocations.h
@@ -8,6 +8,9 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <link.h>
+
+#include "crazy_linker_defines.h"
 #include "elf_traits.h"
 
 namespace crazy {
@@ -19,6 +22,11 @@
 // An ElfRelocations instance holds information about relocations in a mapped
 // ELF binary.
 class ElfRelocations {
+#if defined(USE_RELA)
+  typedef ELF::Rela rel_t;
+#else
+  typedef ELF::Rel rel_t;
+#endif
  public:
   ElfRelocations() { ::memset(this, 0, sizeof(*this)); }
   ~ElfRelocations() {}
@@ -64,42 +72,28 @@
                      ELF::Addr reloc,
                      ELF::Addr* sym_addr,
                      Error* error);
-  bool ApplyResolvedRelaReloc(const ELF::Rela* rela,
-                              ELF::Addr sym_addr,
-                              bool resolved,
-                              Error* error);
-  bool ApplyResolvedRelReloc(const ELF::Rel* rel,
-                             ELF::Addr sym_addr,
-                             bool resolved,
-                             Error* error);
-  bool ApplyRelaReloc(const ELF::Rela* rela,
-                      const ElfSymbols* symbols,
-                      SymbolResolver* resolver,
-                      Error* error);
-  bool ApplyRelReloc(const ELF::Rel* rel,
-                     const ElfSymbols* symbols,
-                     SymbolResolver* resolver,
-                     Error* error);
-  bool ApplyRelaRelocs(const ELF::Rela* relocs,
-                       size_t relocs_count,
-                       const ElfSymbols* symbols,
-                       SymbolResolver* resolver,
-                       Error* error);
-  bool ApplyRelRelocs(const ELF::Rel* relocs,
-                      size_t relocs_count,
-                      const ElfSymbols* symbols,
-                      SymbolResolver* resolver,
-                      Error* error);
+  bool ApplyResolvedReloc(const rel_t* rela,
+                          ELF::Addr sym_addr,
+                          bool resolved,
+                          Error* error);
+  bool ApplyReloc(const rel_t* rela,
+                  const ElfSymbols* symbols,
+                  SymbolResolver* resolver,
+                  Error* error);
+  bool ApplyRelocs(const rel_t* relocs,
+                   size_t relocs_count,
+                   const ElfSymbols* symbols,
+                   SymbolResolver* resolver,
+                   Error* error);
   void AdjustRelocation(ELF::Word rel_type,
                         ELF::Addr src_reloc,
                         size_t dst_delta,
                         size_t map_delta);
-  template<typename Rel>
   void RelocateRelocations(size_t src_addr,
                           size_t dst_addr,
                           size_t map_addr,
                           size_t size);
-  void AdjustAndroidRelocation(const ELF::Rela* relocation,
+  void AdjustAndroidRelocation(const rel_t* relocation,
                                size_t src_addr,
                                size_t dst_addr,
                                size_t map_addr,
@@ -108,10 +102,14 @@
   // Android packed relocations unpacker. Calls the given handler for
   // each relocation in the unpacking stream.
   typedef bool (*RelocationHandler)(ElfRelocations* relocations,
-                                    const ELF::Rela* relocation,
+                                    const rel_t* relocation,
                                     void* opaque);
   bool ForEachAndroidRelocation(RelocationHandler handler,
                                 void* opaque);
+  template <typename ElfRelIteratorT>
+  bool ForEachAndroidRelocationHelper(ElfRelIteratorT&& rel_iterator,
+                                      ElfRelocations::RelocationHandler handler,
+                                      void* opaque);
 
   // Apply Android packed relocations.
   // On error, return false and set |error| message.
@@ -120,7 +118,7 @@
                                SymbolResolver* resolver,
                                Error* error);
   static bool ApplyAndroidRelocation(ElfRelocations* relocations,
-                                     const ELF::Rela* relocation,
+                                     const rel_t* relocation,
                                      void* opaque);
 
   // Relocate Android packed relocations.
@@ -130,7 +128,7 @@
                                   size_t map_addr,
                                   size_t size);
   static bool RelocateAndroidRelocation(ElfRelocations* relocations,
-                                        const ELF::Rela* relocation,
+                                        const rel_t* relocation,
                                         void* opaque);
 
 #if defined(__mips__)
@@ -143,7 +141,6 @@
   size_t phdr_count_;
   size_t load_bias_;
 
-  ELF::Addr relocations_type_;
   ELF::Addr plt_relocations_;
   size_t plt_relocations_size_;
   ELF::Addr* plt_got_;
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_leb128.h b/third_party/android_crazy_linker/src/src/crazy_linker_leb128.h
deleted file mode 100644
index 08bea66..0000000
--- a/third_party/android_crazy_linker/src/src/crazy_linker_leb128.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CRAZY_LINKER_LEB128_H
-#define CRAZY_LINKER_LEB128_H
-
-#include <assert.h>
-#include <stdint.h>
-
-// Helper classes for decoding LEB128, used in packed relocation data.
-// http://en.wikipedia.org/wiki/LEB128
-
-namespace crazy {
-
-class Sleb128Decoder {
- public:
-  Sleb128Decoder(const uint8_t* buffer, size_t count) : current_(buffer)
-#ifndef NDEBUG
-      , end_(buffer + count)
-#endif
-  {}
-
-  size_t pop_front() {
-    size_t value = 0;
-    static const size_t size = CHAR_BIT * sizeof(value);
-
-    size_t shift = 0;
-    uint8_t byte;
-
-    do {
-      assert(current_ < end_);
-
-      byte = *current_++;
-      value |= (static_cast<size_t>(byte & 127) << shift);
-      shift += 7;
-    } while (byte & 128);
-
-    if (shift < size && (byte & 64)) {
-      value |= -(static_cast<size_t>(1) << shift);
-    }
-
-    return value;
-  }
-
- private:
-  const uint8_t* current_;
-#ifndef NDEBUG
-  const uint8_t* const end_;
-#endif
-};
-
-}  // namespace crazy
-
-#endif  // CRAZY_LINKER_LEB128_H
diff --git a/third_party/android_crazy_linker/src/src/linker_reloc_iterators.h b/third_party/android_crazy_linker/src/src/linker_reloc_iterators.h
new file mode 100644
index 0000000..08a67fc
--- /dev/null
+++ b/third_party/android_crazy_linker/src/src/linker_reloc_iterators.h
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef __LINKER_RELOC_ITERATORS_H
+#define __LINKER_RELOC_ITERATORS_H
+
+#include <string.h>
+
+#include <link.h>
+
+#include "crazy_linker_debug.h"
+#include "crazy_linker_defines.h"
+
+const size_t RELOCATION_GROUPED_BY_INFO_FLAG = 1;
+const size_t RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG = 2;
+const size_t RELOCATION_GROUPED_BY_ADDEND_FLAG = 4;
+const size_t RELOCATION_GROUP_HAS_ADDEND_FLAG = 8;
+
+class plain_reloc_iterator {
+#if defined(USE_RELA)
+  typedef ElfW(Rela) rel_t;
+#else
+  typedef ElfW(Rel) rel_t;
+#endif
+ public:
+  plain_reloc_iterator(rel_t* rel_array, size_t count)
+      : begin_(rel_array), end_(begin_ + count), current_(begin_) {}
+
+  bool has_next() { return current_ < end_; }
+
+  rel_t* next() { return current_++; }
+
+ private:
+  rel_t* const begin_;
+  rel_t* const end_;
+  rel_t* current_;
+};
+
+template <typename decoder_t>
+class packed_reloc_iterator {
+#if defined(USE_RELA)
+  typedef ElfW(Rela) rel_t;
+#else
+  typedef ElfW(Rel) rel_t;
+#endif
+ public:
+  explicit packed_reloc_iterator(decoder_t&& decoder) : decoder_(decoder) {
+    // initialize fields
+    memset(&reloc_, 0, sizeof(reloc_));
+    relocation_count_ = decoder_.pop_front();
+    reloc_.r_offset = decoder_.pop_front();
+    relocation_index_ = 0;
+    relocation_group_index_ = 0;
+    group_size_ = 0;
+  }
+
+  bool has_next() const { return relocation_index_ < relocation_count_; }
+
+  rel_t* next() {
+    if (relocation_group_index_ == group_size_) {
+      if (!read_group_fields()) {
+        // Iterator is inconsistent state; it should not be called again
+        // but in case it is let's make sure has_next() returns false.
+        relocation_index_ = relocation_count_ = 0;
+        return nullptr;
+      }
+    }
+
+    if (is_relocation_grouped_by_offset_delta()) {
+      reloc_.r_offset += group_r_offset_delta_;
+    } else {
+      reloc_.r_offset += decoder_.pop_front();
+    }
+
+    if (!is_relocation_grouped_by_info()) {
+      reloc_.r_info = decoder_.pop_front();
+    }
+
+#if defined(USE_RELA)
+    if (is_relocation_group_has_addend() &&
+        !is_relocation_grouped_by_addend()) {
+      reloc_.r_addend += decoder_.pop_front();
+    }
+#endif
+
+    relocation_index_++;
+    relocation_group_index_++;
+
+    return &reloc_;
+  }
+
+ private:
+  bool read_group_fields() {
+    group_size_ = decoder_.pop_front();
+    group_flags_ = decoder_.pop_front();
+
+    if (is_relocation_grouped_by_offset_delta()) {
+      group_r_offset_delta_ = decoder_.pop_front();
+    }
+
+    if (is_relocation_grouped_by_info()) {
+      reloc_.r_info = decoder_.pop_front();
+    }
+
+    if (is_relocation_group_has_addend() && is_relocation_grouped_by_addend()) {
+#if !defined(USE_RELA)
+      // This platform does not support rela, and yet we have it encoded in
+      // android_rel section.
+      LOG("unexpected r_addend in android.rel section");
+      return false;
+#else
+      reloc_.r_addend += decoder_.pop_front();
+    } else if (!is_relocation_group_has_addend()) {
+      reloc_.r_addend = 0;
+#endif
+    }
+
+    relocation_group_index_ = 0;
+    return true;
+  }
+
+  bool is_relocation_grouped_by_info() {
+    return (group_flags_ & RELOCATION_GROUPED_BY_INFO_FLAG) != 0;
+  }
+
+  bool is_relocation_grouped_by_offset_delta() {
+    return (group_flags_ & RELOCATION_GROUPED_BY_OFFSET_DELTA_FLAG) != 0;
+  }
+
+  bool is_relocation_grouped_by_addend() {
+    return (group_flags_ & RELOCATION_GROUPED_BY_ADDEND_FLAG) != 0;
+  }
+
+  bool is_relocation_group_has_addend() {
+    return (group_flags_ & RELOCATION_GROUP_HAS_ADDEND_FLAG) != 0;
+  }
+
+  decoder_t decoder_;
+  size_t relocation_count_;
+  size_t group_size_;
+  size_t group_flags_;
+  size_t group_r_offset_delta_;
+  size_t relocation_index_;
+  size_t relocation_group_index_;
+  rel_t reloc_;
+};
+
+#endif  // __LINKER_RELOC_ITERATORS_H
diff --git a/third_party/android_crazy_linker/src/src/linker_sleb128.h b/third_party/android_crazy_linker/src/src/linker_sleb128.h
new file mode 100644
index 0000000..cceaa1c
--- /dev/null
+++ b/third_party/android_crazy_linker/src/src/linker_sleb128.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _LINKER_SLEB128_H
+#define _LINKER_SLEB128_H
+
+#include <assert.h>
+#include <stdint.h>
+
+// Helper classes for decoding LEB128, used in packed relocation data.
+// http://en.wikipedia.org/wiki/LEB128
+
+class sleb128_decoder {
+ public:
+  sleb128_decoder(const uint8_t* buffer, size_t count)
+      : current_(buffer)
+#ifndef NDEBUG
+        ,
+        end_(buffer + count)
+#endif
+  {
+  }
+  size_t pop_front() {
+    size_t value = 0;
+    static const size_t size = CHAR_BIT * sizeof(value);
+
+    size_t shift = 0;
+    uint8_t byte;
+
+    do {
+      assert(current_ < end_);
+      byte = *current_++;
+      value |= (static_cast<size_t>(byte & 127) << shift);
+      shift += 7;
+    } while (byte & 128);
+
+    if (shift < size && (byte & 64)) {
+      value |= -(static_cast<size_t>(1) << shift);
+    }
+
+    return value;
+  }
+
+ private:
+  const uint8_t* current_;
+#ifndef NDEBUG
+  const uint8_t* const end_;
+#endif
+};
+
+#endif  // __LINKER_SLEB128_H
diff --git a/third_party/zlib/contrib/bench/zlib_bench.cc b/third_party/zlib/contrib/bench/zlib_bench.cc
index 300cf09..b2954e64 100644
--- a/third_party/zlib/contrib/bench/zlib_bench.cc
+++ b/third_party/zlib/contrib/bench/zlib_bench.cc
@@ -29,7 +29,6 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <time.h>
 
 #include "zlib.h"
 
@@ -61,10 +60,10 @@
   Data data(file.tellg());
   file.seekg(0, std::ios::beg);
 
-  if (data.data)
+  if (file && data.data)
     file.read(data.data.get(), data.size);
 
-  if (file.bad() || !data.data) {
+  if (!file || !data.data) {
     perror((std::string("error reading ") + name).c_str());
     exit(1);
   } else if (!data.size) {
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 1eca3d36..cab981e 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -131,7 +131,6 @@
 
 def EnsureDirExists(path):
   if not os.path.exists(path):
-    print "Creating directory %s" % path
     os.makedirs(path)
 
 
@@ -270,20 +269,6 @@
     return
 
   Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR)
-
-  # Back out previous local patches. This needs to be kept around a bit
-  # until all bots have cycled. See https://crbug.com/755777.
-  files = [
-    'lib/Transforms/InstCombine/InstructionCombining.cpp',
-    'test/DebugInfo/X86/formal_parameter.ll',
-    'test/DebugInfo/X86/instcombine-instrinsics.ll',
-    'test/Transforms/InstCombine/debuginfo-skip.ll',
-    'test/Transforms/InstCombine/debuginfo.ll',
-    'test/Transforms/Util/simplify-dbg-declare-load.ll',
-  ]
-  for f in [os.path.join(LLVM_DIR, f) for f in files]:
-    RunCommand(['svn', 'revert', f])
-
   Checkout('Clang', LLVM_REPO_URL + '/cfe/trunk', CLANG_DIR)
   if True:
     Checkout('LLD', LLVM_REPO_URL + '/lld/trunk', LLD_DIR)
@@ -475,20 +460,16 @@
   if ReadStampFile() == expected_stamp and not args.force_local_build:
     return 0
 
-  print 'Updating Clang to %s...' % PACKAGE_VERSION
-
   # Reset the stamp file in case the build is unsuccessful.
   WriteStampFile('')
 
   if not args.force_local_build:
-    print 'Downloading prebuilt clang'
     if os.path.exists(LLVM_BUILD_DIR):
       RmTree(LLVM_BUILD_DIR)
 
     DownloadAndUnpackClangPackage(sys.platform)
     if 'win' in target_os:
       DownloadAndUnpackClangPackage('win32', runtimes_only=True)
-    print 'clang %s unpacked' % PACKAGE_VERSION
     if sys.platform == 'win32':
       CopyDiaDllTo(os.path.join(LLVM_BUILD_DIR, 'bin'))
     WriteStampFile(expected_stamp)
@@ -502,6 +483,8 @@
     print 'for how to install the NDK, or pass --without-android.'
     return 1
 
+  print 'Locally building Clang %s...' % PACKAGE_VERSION
+
   DownloadHostGcc(args)
   AddCMakeToPath(args)
   AddGnuWinToPath()
diff --git a/tools/gn/BUILD.gn b/tools/gn/BUILD.gn
index a2616a2d..31e24936 100644
--- a/tools/gn/BUILD.gn
+++ b/tools/gn/BUILD.gn
@@ -343,6 +343,8 @@
     "substitution_writer_unittest.cc",
     "target_unittest.cc",
     "template_unittest.cc",
+    "test_with_scheduler.cc",
+    "test_with_scheduler.h",
     "test_with_scope.cc",
     "test_with_scope.h",
     "tokenizer_unittest.cc",
diff --git a/tools/gn/action_target_generator_unittest.cc b/tools/gn/action_target_generator_unittest.cc
index 5a45932e..254bc982 100644
--- a/tools/gn/action_target_generator_unittest.cc
+++ b/tools/gn/action_target_generator_unittest.cc
@@ -4,11 +4,13 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/scheduler.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
+using ActionTargetGenerator = TestWithScheduler;
+
 // Tests that actions can't have output substitutions.
-TEST(ActionTargetGenerator, ActionOutputSubstitutions) {
-  Scheduler scheduler;
+TEST_F(ActionTargetGenerator, ActionOutputSubstitutions) {
   TestWithScope setup;
   Scope::ItemVector items_;
   setup.scope()->set_item_collector(&items_);
@@ -43,8 +45,7 @@
 
 // Tests that arg and response file substitutions are validated for
 // action_foreach targets.
-TEST(ActionTargetGenerator, ActionForeachSubstitutions) {
-  Scheduler scheduler;
+TEST_F(ActionTargetGenerator, ActionForeachSubstitutions) {
   TestWithScope setup;
   Scope::ItemVector items_;
   setup.scope()->set_item_collector(&items_);
diff --git a/tools/gn/command_format_unittest.cc b/tools/gn/command_format_unittest.cc
index bf84061..c351df04 100644
--- a/tools/gn/command_format_unittest.cc
+++ b/tools/gn/command_format_unittest.cc
@@ -2,16 +2,20 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "tools/gn/command_format.h"
+
 #include "base/files/file_util.h"
 #include "base/path_service.h"
 #include "base/strings/string_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "tools/gn/command_format.h"
 #include "tools/gn/commands.h"
 #include "tools/gn/setup.h"
+#include "tools/gn/test_with_scheduler.h"
+
+using FormatTest = TestWithScheduler;
 
 #define FORMAT_TEST(n)                                                      \
-  TEST(Format, n) {                                                         \
+  TEST_F(FormatTest, n) {                                                   \
     ::Setup setup;                                                          \
     std::string out;                                                        \
     std::string expected;                                                   \
diff --git a/tools/gn/function_forward_variables_from_unittest.cc b/tools/gn/function_forward_variables_from_unittest.cc
index 84d8b6e..3d697886 100644
--- a/tools/gn/function_forward_variables_from_unittest.cc
+++ b/tools/gn/function_forward_variables_from_unittest.cc
@@ -4,10 +4,12 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/scheduler.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
-TEST(FunctionForwardVariablesFrom, List) {
-  Scheduler scheduler;
+using FunctionForwardVariablesFromTest = TestWithScheduler;
+
+TEST_F(FunctionForwardVariablesFromTest, List) {
   Err err;
   std::string program =
       "template(\"a\") {\n"
@@ -50,8 +52,7 @@
   }
 }
 
-TEST(FunctionForwardVariablesFrom, LiteralList) {
-  Scheduler scheduler;
+TEST_F(FunctionForwardVariablesFromTest, LiteralList) {
   TestWithScope setup;
 
   // Forwards all variables from a literal scope into another scope definition.
@@ -72,8 +73,7 @@
   setup.print_output().clear();
 }
 
-TEST(FunctionForwardVariablesFrom, ListWithExclusion) {
-  Scheduler scheduler;
+TEST_F(FunctionForwardVariablesFromTest, ListWithExclusion) {
   TestWithScope setup;
 
   // Defines a template and copy the two x and y, and z values out.
@@ -100,8 +100,7 @@
   setup.print_output().clear();
 }
 
-TEST(FunctionForwardVariablesFrom, ErrorCases) {
-  Scheduler scheduler;
+TEST_F(FunctionForwardVariablesFromTest, ErrorCases) {
   TestWithScope setup;
 
   // Type check the source scope.
@@ -190,8 +189,7 @@
   EXPECT_EQ("Wrong number of arguments.", err.message());
 }
 
-TEST(FunctionForwardVariablesFrom, Star) {
-  Scheduler scheduler;
+TEST_F(FunctionForwardVariablesFromTest, Star) {
   TestWithScope setup;
 
   // Defines a template and copy the two x and y values out. The "*" behavior
@@ -217,9 +215,7 @@
   setup.print_output().clear();
 }
 
-
-TEST(FunctionForwardVariablesFrom, StarWithExclusion) {
-  Scheduler scheduler;
+TEST_F(FunctionForwardVariablesFromTest, StarWithExclusion) {
   TestWithScope setup;
 
   // Defines a template and copy all values except z value. The "*" behavior
diff --git a/tools/gn/function_toolchain_unittest.cc b/tools/gn/function_toolchain_unittest.cc
index 2d8a548e..eec8779 100644
--- a/tools/gn/function_toolchain_unittest.cc
+++ b/tools/gn/function_toolchain_unittest.cc
@@ -5,10 +5,12 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/functions.h"
 #include "tools/gn/scheduler.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
-TEST(FunctionToolchain, RuntimeOutputs) {
-  Scheduler scheduler;
+using FunctionToolchain = TestWithScheduler;
+
+TEST_F(FunctionToolchain, RuntimeOutputs) {
   TestWithScope setup;
 
   // These runtime outputs are a subset of the outputs so are OK.
diff --git a/tools/gn/function_write_file_unittest.cc b/tools/gn/function_write_file_unittest.cc
index 8f2b42a..db2ea1e0 100644
--- a/tools/gn/function_write_file_unittest.cc
+++ b/tools/gn/function_write_file_unittest.cc
@@ -10,6 +10,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/functions.h"
 #include "tools/gn/scheduler.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
 namespace {
@@ -33,8 +34,9 @@
 
 }  // namespace
 
-TEST(WriteFile, WithData) {
-  Scheduler scheduler;
+using WriteFileTest = TestWithScheduler;
+
+TEST_F(WriteFileTest, WithData) {
   TestWithScope setup;
 
   // Make a real directory for writing the files.
diff --git a/tools/gn/functions_target_unittest.cc b/tools/gn/functions_target_unittest.cc
index cef75170..de701ef0 100644
--- a/tools/gn/functions_target_unittest.cc
+++ b/tools/gn/functions_target_unittest.cc
@@ -5,12 +5,13 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/scheduler.h"
 #include "tools/gn/scope.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
+using FunctionsTarget = TestWithScheduler;
 
 // Checks that we find unused identifiers in targets.
-TEST(FunctionsTarget, CheckUnused) {
-  Scheduler scheduler;
+TEST_F(FunctionsTarget, CheckUnused) {
   TestWithScope setup;
 
   // The target generator needs a place to put the targets or it will fail.
@@ -38,8 +39,7 @@
 }
 
 // Checks that we find uses of identifiers marked as not needed.
-TEST(FunctionsTarget, CheckNotNeeded) {
-  Scheduler scheduler;
+TEST_F(FunctionsTarget, CheckNotNeeded) {
   TestWithScope setup;
 
   // The target generator needs a place to put the targets or it will fail.
@@ -93,8 +93,7 @@
 // Checks that the defaults applied to a template invoked by target() use
 // the name of the template, rather than the string "target" (which is the
 // name of the actual function being called).
-TEST(FunctionsTarget, TemplateDefaults) {
-  Scheduler scheduler;
+TEST_F(FunctionsTarget, TemplateDefaults) {
   TestWithScope setup;
 
   // The target generator needs a place to put the targets or it will fail.
diff --git a/tools/gn/gn_main.cc b/tools/gn/gn_main.cc
index 245270ee..4d51158 100644
--- a/tools/gn/gn_main.cc
+++ b/tools/gn/gn_main.cc
@@ -2,9 +2,16 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <algorithm>
+#include <string>
+
 #include "base/at_exit.h"
 #include "base/command_line.h"
+#include "base/message_loop/message_loop.h"
+#include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
+#include "base/sys_info.h"
+#include "base/task_scheduler/task_scheduler.h"
 #include "build/build_config.h"
 #include "tools/gn/commands.h"
 #include "tools/gn/err.h"
@@ -34,6 +41,54 @@
 #endif
 }
 
+int GetThreadCount() {
+  std::string thread_count =
+      base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+          switches::kThreads);
+
+  // See if an override was specified on the command line.
+  int result;
+  if (!thread_count.empty() && base::StringToInt(thread_count, &result) &&
+      result >= 1) {
+    return result;
+  }
+
+  // Base the default number of worker threads on number of cores in the
+  // system. When building large projects, the speed can be limited by how fast
+  // the main thread can dispatch work and connect the dependency graph. If
+  // there are too many worker threads, the main thread can be starved and it
+  // will run slower overall.
+  //
+  // One less worker thread than the number of physical CPUs seems to be a
+  // good value, both theoretically and experimentally. But always use at
+  // least some workers to prevent us from being too sensitive to I/O latency
+  // on low-end systems.
+  //
+  // The minimum thread count is based on measuring the optimal threads for the
+  // Chrome build on a several-year-old 4-core MacBook.
+  // Almost all CPUs now are hyperthreaded.
+  int num_cores = base::SysInfo::NumberOfProcessors() / 2;
+  return std::max(num_cores - 1, 8);
+}
+
+void StartTaskScheduler() {
+  constexpr base::TimeDelta kSuggestedReclaimTime =
+      base::TimeDelta::FromSeconds(30);
+
+  constexpr int kBackgroundMaxThreads = 1;
+  constexpr int kBackgroundBlockingMaxThreads = 2;
+  const int kForegroundMaxThreads =
+      std::max(1, base::SysInfo::NumberOfProcessors());
+  const int foreground_blocking_max_threads = GetThreadCount();
+
+  base::TaskScheduler::Create("gn");
+  base::TaskScheduler::GetInstance()->Start(
+      {{kBackgroundMaxThreads, kSuggestedReclaimTime},
+       {kBackgroundBlockingMaxThreads, kSuggestedReclaimTime},
+       {kForegroundMaxThreads, kSuggestedReclaimTime},
+       {foreground_blocking_max_threads, kSuggestedReclaimTime}});
+}
+
 }  // namespace
 
 int main(int argc, char** argv) {
@@ -71,7 +126,10 @@
 
   int retval;
   if (found_command != command_map.end()) {
+    base::MessageLoop message_loop;
+    StartTaskScheduler();
     retval = found_command->second.runner(args);
+    base::TaskScheduler::GetInstance()->Shutdown();
   } else {
     Err(Location(), "Command \"" + command + "\" unknown.").PrintToStdout();
     OutputString(
diff --git a/tools/gn/header_checker.cc b/tools/gn/header_checker.cc
index 30ab4c1d..39d53ee 100644
--- a/tools/gn/header_checker.cc
+++ b/tools/gn/header_checker.cc
@@ -9,9 +9,8 @@
 #include "base/bind.h"
 #include "base/containers/queue.h"
 #include "base/files/file_util.h"
-#include "base/message_loop/message_loop.h"
 #include "base/strings/string_util.h"
-#include "base/threading/sequenced_worker_pool.h"
+#include "base/task_scheduler/post_task.h"
 #include "tools/gn/build_settings.h"
 #include "tools/gn/builder.h"
 #include "tools/gn/c_include_iterator.h"
@@ -128,8 +127,7 @@
 
 HeaderChecker::HeaderChecker(const BuildSettings* build_settings,
                              const std::vector<const Target*>& targets)
-    : main_loop_(base::MessageLoop::current()),
-      build_settings_(build_settings) {
+    : build_settings_(build_settings), task_count_cv_(&lock_) {
   for (auto* target : targets)
     AddTargetToFileMap(target, &file_map_);
 }
@@ -151,11 +149,6 @@
 }
 
 void HeaderChecker::RunCheckOverFiles(const FileMap& files, bool force_check) {
-  if (files.empty())
-    return;
-
-  scoped_refptr<base::SequencedWorkerPool> pool(new base::SequencedWorkerPool(
-      16, "HeaderChecker", base::TaskPriority::USER_VISIBLE));
   for (const auto& file : files) {
     // Only check C-like source files (RC files also have includes).
     SourceFileType type = GetSourceFileType(file.first);
@@ -174,16 +167,17 @@
 
     for (const auto& vect_i : file.second) {
       if (vect_i.target->check_includes()) {
-        pool->PostWorkerTaskWithShutdownBehavior(
-            FROM_HERE,
-            base::Bind(&HeaderChecker::DoWork, this, vect_i.target, file.first),
-            base::SequencedWorkerPool::BLOCK_SHUTDOWN);
+        base::PostTaskWithTraits(FROM_HERE, {base::MayBlock()},
+                                 base::BindOnce(&HeaderChecker::DoWork, this,
+                                                vect_i.target, file.first));
       }
     }
   }
 
-  // After this call we're single-threaded again.
-  pool->Shutdown();
+  // Wait for all tasks posted by this method to complete.
+  base::AutoLock auto_lock(lock_);
+  while (!task_count_.IsZero())
+    task_count_cv_.Wait();
 }
 
 void HeaderChecker::DoWork(const Target* target, const SourceFile& file) {
@@ -192,6 +186,12 @@
     base::AutoLock lock(lock_);
     errors_.push_back(err);
   }
+
+  if (!task_count_.Decrement()) {
+    // Signal |task_count_cv_| when |task_count_| becomes zero.
+    base::AutoLock auto_lock(lock_);
+    task_count_cv_.Signal();
+  }
 }
 
 // static
diff --git a/tools/gn/header_checker.h b/tools/gn/header_checker.h
index 0c0eb4a9..c6411ebb 100644
--- a/tools/gn/header_checker.h
+++ b/tools/gn/header_checker.h
@@ -6,14 +6,14 @@
 #define TOOLS_GN_HEADER_CHECKER_H_
 
 #include <map>
-#include <set>
 #include <vector>
 
+#include "base/atomic_ref_count.h"
 #include "base/gtest_prod_util.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
-#include "base/run_loop.h"
 #include "base/strings/string_piece.h"
+#include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
 #include "tools/gn/err.h"
 
@@ -23,10 +23,6 @@
 class SourceFile;
 class Target;
 
-namespace base {
-class MessageLoop;
-}
-
 class HeaderChecker : public base::RefCountedThreadSafe<HeaderChecker> {
  public:
   // Represents a dependency chain.
@@ -160,14 +156,15 @@
   // These are initialized during construction (which happens on one thread)
   // and are not modified after, so any thread can read these without locking.
 
-  base::MessageLoop* main_loop_;
-  base::RunLoop main_thread_runner_;
-
   const BuildSettings* build_settings_;
 
   // Maps source files to targets it appears in (usually just one target).
   FileMap file_map_;
 
+  // Number of tasks posted by RunCheckOverFiles() that haven't completed their
+  // execution.
+  base::AtomicRefCount task_count_;
+
   // Locked variables ----------------------------------------------------------
   //
   // These are mutable during runtime and require locking.
@@ -176,6 +173,9 @@
 
   std::vector<Err> errors_;
 
+  // Signaled when |task_count_| becomes zero.
+  base::ConditionVariable task_count_cv_;
+
   DISALLOW_COPY_AND_ASSIGN(HeaderChecker);
 };
 
diff --git a/tools/gn/header_checker_unittest.cc b/tools/gn/header_checker_unittest.cc
index 84550b43..2aa0860 100644
--- a/tools/gn/header_checker_unittest.cc
+++ b/tools/gn/header_checker_unittest.cc
@@ -9,11 +9,12 @@
 #include "tools/gn/header_checker.h"
 #include "tools/gn/scheduler.h"
 #include "tools/gn/target.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
 namespace {
 
-class HeaderCheckerTest : public testing::Test {
+class HeaderCheckerTest : public TestWithScheduler {
  public:
   HeaderCheckerTest()
       : a_(setup_.settings(), Label(SourceDir("//a/"), "a")),
@@ -52,8 +53,6 @@
   }
 
  protected:
-  Scheduler scheduler_;
-
   TestWithScope setup_;
 
   // Some headers that are automatically set up with a public dependency chain.
diff --git a/tools/gn/input_conversion_unittest.cc b/tools/gn/input_conversion_unittest.cc
index a2cfe4d0..9568daf8 100644
--- a/tools/gn/input_conversion_unittest.cc
+++ b/tools/gn/input_conversion_unittest.cc
@@ -2,19 +2,21 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "tools/gn/input_conversion.h"
+
 #include "testing/gtest/include/gtest/gtest.h"
 #include "tools/gn/err.h"
-#include "tools/gn/input_conversion.h"
 #include "tools/gn/input_file.h"
 #include "tools/gn/parse_tree.h"
 #include "tools/gn/scheduler.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 #include "tools/gn/value.h"
 
 namespace {
 
 // InputConversion needs a global scheduler object.
-class InputConversionTest : public testing::Test {
+class InputConversionTest : public TestWithScheduler {
  public:
   InputConversionTest() = default;
 
@@ -22,8 +24,6 @@
 
  private:
   TestWithScope setup_;
-
-  Scheduler scheduler_;
 };
 
 }  // namespace
diff --git a/tools/gn/loader_unittest.cc b/tools/gn/loader_unittest.cc
index 4b240c32..e42ee5b 100644
--- a/tools/gn/loader_unittest.cc
+++ b/tools/gn/loader_unittest.cc
@@ -16,6 +16,7 @@
 #include "tools/gn/parse_tree.h"
 #include "tools/gn/parser.h"
 #include "tools/gn/scheduler.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/tokenizer.h"
 
 namespace {
@@ -139,14 +140,13 @@
 
 // LoaderTest ------------------------------------------------------------------
 
-class LoaderTest : public testing::Test {
+class LoaderTest : public TestWithScheduler {
  public:
   LoaderTest() {
     build_settings_.SetBuildDir(SourceDir("//out/Debug/"));
   }
 
  protected:
-  Scheduler scheduler_;
   BuildSettings build_settings_;
   MockBuilder mock_builder_;
   MockInputFileManager mock_ifm_;
@@ -212,7 +212,7 @@
   base::RunLoop().RunUntilIdle();
   EXPECT_TRUE(mock_ifm_.HasTwoPending(second_file, third_file));
 
-  EXPECT_FALSE(scheduler_.is_failed());
+  EXPECT_FALSE(scheduler().is_failed());
 }
 
 TEST_F(LoaderTest, BuildDependencyFilesAreCollected) {
@@ -260,5 +260,5 @@
   EXPECT_TRUE(items[3]->AsPool());
   EXPECT_TRUE(ItemContainsBuildDependencyFile(items[3], root_build));
 
-  EXPECT_FALSE(scheduler_.is_failed());
+  EXPECT_FALSE(scheduler().is_failed());
 }
diff --git a/tools/gn/ninja_binary_target_writer_unittest.cc b/tools/gn/ninja_binary_target_writer_unittest.cc
index 87008692..e801723 100644
--- a/tools/gn/ninja_binary_target_writer_unittest.cc
+++ b/tools/gn/ninja_binary_target_writer_unittest.cc
@@ -12,9 +12,12 @@
 #include "tools/gn/config.h"
 #include "tools/gn/scheduler.h"
 #include "tools/gn/target.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
-TEST(NinjaBinaryTargetWriter, SourceSet) {
+using NinjaBinaryTargetWriterTest = TestWithScheduler;
+
+TEST_F(NinjaBinaryTargetWriterTest, SourceSet) {
   Err err;
   TestWithScope setup;
 
@@ -147,7 +150,7 @@
   }
 }
 
-TEST(NinjaBinaryTargetWriter, StaticLibrary) {
+TEST_F(NinjaBinaryTargetWriterTest, StaticLibrary) {
   TestWithScope setup;
   Err err;
 
@@ -179,7 +182,7 @@
   EXPECT_EQ(expected, out_str);
 }
 
-TEST(NinjaBinaryTargetWriter, CompleteStaticLibrary) {
+TEST_F(NinjaBinaryTargetWriterTest, CompleteStaticLibrary) {
   TestWithScope setup;
   Err err;
 
@@ -256,7 +259,7 @@
 
 // This tests that output extension and output dir overrides apply, and input
 // dependencies are applied.
-TEST(NinjaBinaryTargetWriter, OutputExtensionAndInputDeps) {
+TEST_F(NinjaBinaryTargetWriterTest, OutputExtensionAndInputDeps) {
   Err err;
   TestWithScope setup;
 
@@ -311,7 +314,7 @@
 }
 
 // Tests libs are applied.
-TEST(NinjaBinaryTargetWriter, LibsAndLibDirs) {
+TEST_F(NinjaBinaryTargetWriterTest, LibsAndLibDirs) {
   Err err;
   TestWithScope setup;
 
@@ -346,7 +349,7 @@
   EXPECT_EQ(expected, out_str);
 }
 
-TEST(NinjaBinaryTargetWriter, EmptyOutputExtension) {
+TEST_F(NinjaBinaryTargetWriterTest, EmptyOutputExtension) {
   Err err;
   TestWithScope setup;
 
@@ -390,7 +393,7 @@
   EXPECT_EQ(expected, out_str);
 }
 
-TEST(NinjaBinaryTargetWriter, SourceSetDataDeps) {
+TEST_F(NinjaBinaryTargetWriterTest, SourceSetDataDeps) {
   Err err;
   TestWithScope setup;
 
@@ -470,7 +473,7 @@
   EXPECT_EQ(final_expected, final_out.str());
 }
 
-TEST(NinjaBinaryTargetWriter, SharedLibraryModuleDefinitionFile) {
+TEST_F(NinjaBinaryTargetWriterTest, SharedLibraryModuleDefinitionFile) {
   Err err;
   TestWithScope setup;
 
@@ -504,7 +507,7 @@
   EXPECT_EQ(expected, out.str());
 }
 
-TEST(NinjaBinaryTargetWriter, LoadableModule) {
+TEST_F(NinjaBinaryTargetWriterTest, LoadableModule) {
   Err err;
   TestWithScope setup;
 
@@ -570,7 +573,7 @@
   EXPECT_EQ(final_expected, final_out.str());
 }
 
-TEST(NinjaBinaryTargetWriter, WinPrecompiledHeaders) {
+TEST_F(NinjaBinaryTargetWriterTest, WinPrecompiledHeaders) {
   Err err;
 
   // This setup's toolchain does not have precompiled headers defined.
@@ -697,7 +700,7 @@
   }
 }
 
-TEST(NinjaBinaryTargetWriter, GCCPrecompiledHeaders) {
+TEST_F(NinjaBinaryTargetWriterTest, GCCPrecompiledHeaders) {
   Err err;
 
   // This setup's toolchain does not have precompiled headers defined.
@@ -822,27 +825,25 @@
 
 // Should throw an error with the scheduler if a duplicate object file exists.
 // This is dependent on the toolchain's object file mapping.
-TEST(NinjaBinaryTargetWriter, DupeObjFileError) {
-  Scheduler scheduler;
-
+TEST_F(NinjaBinaryTargetWriterTest, DupeObjFileError) {
   TestWithScope setup;
   TestTarget target(setup, "//foo:bar", Target::EXECUTABLE);
   target.sources().push_back(SourceFile("//a.cc"));
   target.sources().push_back(SourceFile("//a.cc"));
 
-  EXPECT_FALSE(scheduler.is_failed());
+  EXPECT_FALSE(scheduler().is_failed());
 
   std::ostringstream out;
   NinjaBinaryTargetWriter writer(&target, out);
   writer.Run();
 
   // Should have issued an error.
-  EXPECT_TRUE(scheduler.is_failed());
+  EXPECT_TRUE(scheduler().is_failed());
 }
 
 // This tests that output extension and output dir overrides apply, and input
 // dependencies are applied.
-TEST(NinjaBinaryTargetWriter, InputFiles) {
+TEST_F(NinjaBinaryTargetWriterTest, InputFiles) {
   Err err;
   TestWithScope setup;
 
diff --git a/tools/gn/ninja_build_writer_unittest.cc b/tools/gn/ninja_build_writer_unittest.cc
index 6dac481b..1937135 100644
--- a/tools/gn/ninja_build_writer_unittest.cc
+++ b/tools/gn/ninja_build_writer_unittest.cc
@@ -9,10 +9,12 @@
 #include "tools/gn/pool.h"
 #include "tools/gn/scheduler.h"
 #include "tools/gn/target.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
-TEST(NinjaBuildWriter, TwoTargets) {
-  Scheduler scheduler;
+using NinjaBuildWriterTest = TestWithScheduler;
+
+TEST_F(NinjaBuildWriterTest, TwoTargets) {
   TestWithScope setup;
   Err err;
 
@@ -95,8 +97,7 @@
 #undef EXPECT_SNIPPET
 }
 
-TEST(NinjaBuildWriter, DuplicateOutputs) {
-  Scheduler scheduler;
+TEST_F(NinjaBuildWriterTest, DuplicateOutputs) {
   TestWithScope setup;
   Err err;
 
diff --git a/tools/gn/runtime_deps_unittest.cc b/tools/gn/runtime_deps_unittest.cc
index 5dc89eb..bb5d46f7 100644
--- a/tools/gn/runtime_deps_unittest.cc
+++ b/tools/gn/runtime_deps_unittest.cc
@@ -9,6 +9,7 @@
 #include "tools/gn/runtime_deps.h"
 #include "tools/gn/scheduler.h"
 #include "tools/gn/target.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 
 namespace {
@@ -40,8 +41,10 @@
 
 }  // namespace
 
+using RuntimeDeps = TestWithScheduler;
+
 // Tests an exe depending on different types of libraries.
-TEST(RuntimeDeps, Libs) {
+TEST_F(RuntimeDeps, Libs) {
   TestWithScope setup;
   Err err;
 
@@ -113,7 +116,7 @@
 
 // Tests that executables that aren't listed as data deps aren't included in
 // the output, but executables that are data deps are included.
-TEST(RuntimeDeps, ExeDataDep) {
+TEST_F(RuntimeDeps, ExeDataDep) {
   TestWithScope setup;
   Err err;
 
@@ -165,7 +168,7 @@
       << GetVectorDescription(result);
 }
 
-TEST(RuntimeDeps, ActionSharedLib) {
+TEST_F(RuntimeDeps, ActionSharedLib) {
   TestWithScope setup;
   Err err;
 
@@ -208,7 +211,7 @@
 // Tests that action and copy outputs are considered if they're data deps, but
 // not if they're regular deps. Action and copy "data" files are always
 // included.
-TEST(RuntimeDeps, ActionOutputs) {
+TEST_F(RuntimeDeps, ActionOutputs) {
   TestWithScope setup;
   Err err;
 
@@ -294,7 +297,7 @@
 // Tests that the search for dependencies terminates at a bundle target,
 // ignoring any shared libraries or loadable modules that get copied into the
 // bundle.
-TEST(RuntimeDeps, CreateBundle) {
+TEST_F(RuntimeDeps, CreateBundle) {
   TestWithScope setup;
   Err err;
 
@@ -393,7 +396,7 @@
 
 // Tests that a dependency duplicated in regular and data deps is processed
 // as a data dep.
-TEST(RuntimeDeps, Dupe) {
+TEST_F(RuntimeDeps, Dupe) {
   TestWithScope setup;
   Err err;
 
@@ -418,8 +421,7 @@
 }
 
 // Tests that actions can't have output substitutions.
-TEST(RuntimeDeps, WriteRuntimeDepsVariable) {
-  Scheduler scheduler;
+TEST_F(RuntimeDeps, WriteRuntimeDepsVariable) {
   TestWithScope setup;
   Err err;
 
@@ -442,5 +444,5 @@
       "  group(\"bar\") { write_runtime_deps = \"//out/Debug/bar.txt\" }\n"
       "}", &err));
   EXPECT_EQ(1U, setup.items().size());
-  EXPECT_EQ(1U, scheduler.GetWriteRuntimeDepsTargets().size());
+  EXPECT_EQ(1U, scheduler().GetWriteRuntimeDepsTargets().size());
 }
diff --git a/tools/gn/scheduler.cc b/tools/gn/scheduler.cc
index 5327792..cf66dc74 100644
--- a/tools/gn/scheduler.cc
+++ b/tools/gn/scheduler.cc
@@ -7,80 +7,26 @@
 #include <algorithm>
 
 #include "base/bind.h"
-#include "base/command_line.h"
 #include "base/single_thread_task_runner.h"
-#include "base/strings/string_number_conversions.h"
-#include "build/build_config.h"
+#include "base/task_scheduler/post_task.h"
+#include "base/threading/thread_task_runner_handle.h"
 #include "tools/gn/standard_out.h"
-#include "tools/gn/switches.h"
 #include "tools/gn/target.h"
 
-#if defined(OS_WIN)
-#include <windows.h>
-#else
-#include <unistd.h>
-#endif
-
 Scheduler* g_scheduler = nullptr;
 
-namespace {
-
-#if defined(OS_WIN)
-int GetCPUCount() {
-  SYSTEM_INFO sysinfo;
-  ::GetSystemInfo(&sysinfo);
-  return sysinfo.dwNumberOfProcessors;
-}
-#else
-int GetCPUCount() {
-  return static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN));
-}
-#endif
-
-int GetThreadCount() {
-  std::string thread_count =
-      base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
-          switches::kThreads);
-
-  // See if an override was specified on the command line.
-  int result;
-  if (!thread_count.empty() && base::StringToInt(thread_count, &result))
-    return result;
-
-  // Base the default number of worker threads on number of cores in the
-  // system. When building large projects, the speed can be limited by how fast
-  // the main thread can dispatch work and connect the dependency graph. If
-  // there are too many worker threads, the main thread can be starved and it
-  // will run slower overall.
-  //
-  // One less worker thread than the number of physical CPUs seems to be a
-  // good value, both theoretically and experimentally. But always use at
-  // least some workers to prevent us from being too sensitive to I/O latency
-  // on low-end systems.
-  //
-  // The minimum thread count is based on measuring the optimal threads for the
-  // Chrome build on a several-year-old 4-core MacBook.
-  int num_cores = GetCPUCount() / 2;  // Almost all CPUs now are hyperthreaded.
-  return std::max(num_cores - 1, 8);
-}
-
-}  // namespace
-
 Scheduler::Scheduler()
-    : pool_(new base::SequencedWorkerPool(GetThreadCount(),
-                                          "worker_",
-                                          base::TaskPriority::USER_VISIBLE)),
+    : main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()),
       input_file_manager_(new InputFileManager),
       verbose_logging_(false),
-      work_count_(0),
+      pool_work_count_cv_(&pool_work_count_lock_),
       is_failed_(false),
       has_been_shutdown_(false) {
   g_scheduler = this;
 }
 
 Scheduler::~Scheduler() {
-  if (!has_been_shutdown_)
-    pool_->Shutdown();
+  WaitForPoolTasks();
   g_scheduler = nullptr;
 }
 
@@ -92,9 +38,9 @@
     local_is_failed = is_failed();
     has_been_shutdown_ = true;
   }
-  // Don't do this inside the lock since it will block on the workers, which
-  // may be in turn waiting on the lock.
-  pool_->Shutdown();
+  // Don't do this while holding |lock_|, since it will block on the workers,
+  // which may be in turn waiting on the lock.
+  WaitForPoolTasks();
   return !local_is_failed;
 }
 
@@ -131,12 +77,13 @@
   }
 }
 
-void Scheduler::ScheduleWork(const base::Closure& work) {
+void Scheduler::ScheduleWork(base::OnceClosure work) {
   IncrementWorkCount();
-  pool_->PostWorkerTaskWithShutdownBehavior(
-      FROM_HERE, base::Bind(&Scheduler::DoWork,
-                            base::Unretained(this), work),
-      base::SequencedWorkerPool::BLOCK_SHUTDOWN);
+  pool_work_count_.Increment();
+  base::PostTaskWithTraits(
+      FROM_HERE, {base::MayBlock()},
+      base::BindOnce(&Scheduler::DoWork, base::Unretained(this),
+                     std::move(work)));
 }
 
 void Scheduler::AddGenDependency(const base::FilePath& file) {
@@ -230,9 +177,13 @@
   runner_.Quit();
 }
 
-void Scheduler::DoWork(const base::Closure& closure) {
-  closure.Run();
+void Scheduler::DoWork(base::OnceClosure closure) {
+  std::move(closure).Run();
   DecrementWorkCount();
+  if (!pool_work_count_.Decrement()) {
+    base::AutoLock auto_lock(pool_work_count_lock_);
+    pool_work_count_cv_.Signal();
+  }
 }
 
 void Scheduler::OnComplete() {
@@ -240,3 +191,9 @@
   DCHECK(task_runner()->BelongsToCurrentThread());
   runner_.Quit();
 }
+
+void Scheduler::WaitForPoolTasks() {
+  base::AutoLock lock(pool_work_count_lock_);
+  while (!pool_work_count_.IsZero())
+    pool_work_count_cv_.Wait();
+}
diff --git a/tools/gn/scheduler.h b/tools/gn/scheduler.h
index e20bced..b0732aea 100644
--- a/tools/gn/scheduler.h
+++ b/tools/gn/scheduler.h
@@ -13,8 +13,8 @@
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
+#include "base/synchronization/condition_variable.h"
 #include "base/synchronization/lock.h"
-#include "base/threading/sequenced_worker_pool.h"
 #include "tools/gn/input_file_manager.h"
 #include "tools/gn/label.h"
 #include "tools/gn/source_file.h"
@@ -31,7 +31,7 @@
   bool Run();
 
   scoped_refptr<base::SingleThreadTaskRunner> task_runner() {
-    return main_loop_.task_runner();
+    return main_thread_task_runner_;
   }
 
   InputFileManager* input_file_manager() { return input_file_manager_.get(); }
@@ -45,7 +45,7 @@
   void Log(const std::string& verb, const std::string& msg);
   void FailWithError(const Err& err);
 
-  void ScheduleWork(const base::Closure& work);
+  void ScheduleWork(base::OnceClosure work);
 
   void Shutdown();
 
@@ -97,12 +97,15 @@
 
   void DoTargetFileWrite(const Target* target);
 
-  void DoWork(const base::Closure& closure);
+  void DoWork(base::OnceClosure closure);
 
   void OnComplete();
 
-  base::MessageLoop main_loop_;
-  scoped_refptr<base::SequencedWorkerPool> pool_;
+  // Waits for tasks scheduled via ScheduleWork() to complete their execution.
+  void WaitForPoolTasks();
+
+  // TaskRunner for the thread on which the Scheduler is initialized.
+  const scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
 
   scoped_refptr<InputFileManager> input_file_manager_;
 
@@ -112,6 +115,16 @@
 
   base::AtomicRefCount work_count_;
 
+  // Number of tasks scheduled by ScheduleWork() that haven't completed their
+  // execution.
+  base::AtomicRefCount pool_work_count_;
+
+  // Lock for |pool_work_count_cv_|.
+  base::Lock pool_work_count_lock_;
+
+  // Condition variable signaled when |pool_work_count_| reaches zero.
+  base::ConditionVariable pool_work_count_cv_;
+
   mutable base::Lock lock_;
   bool is_failed_;
 
diff --git a/tools/gn/target.h b/tools/gn/target.h
index de5c13d..b286518 100644
--- a/tools/gn/target.h
+++ b/tools/gn/target.h
@@ -309,7 +309,7 @@
                                std::vector<OutputFile>* outputs) const;
 
  private:
-  FRIEND_TEST_ALL_PREFIXES(Target, ResolvePrecompiledHeaders);
+  FRIEND_TEST_ALL_PREFIXES(TargetTest, ResolvePrecompiledHeaders);
 
   // Pulls necessary information from dependencies to this one when all
   // dependencies have been resolved.
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index bee46f1..31d3382 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -12,6 +12,7 @@
 #include "tools/gn/config.h"
 #include "tools/gn/scheduler.h"
 #include "tools/gn/settings.h"
+#include "tools/gn/test_with_scheduler.h"
 #include "tools/gn/test_with_scope.h"
 #include "tools/gn/toolchain.h"
 
@@ -33,9 +34,11 @@
 
 }  // namespace
 
+using TargetTest = TestWithScheduler;
+
 // Tests that lib[_dir]s are inherited across deps boundaries for static
 // libraries but not executables.
-TEST(Target, LibInheritance) {
+TEST_F(TargetTest, LibInheritance) {
   TestWithScope setup;
   Err err;
 
@@ -80,7 +83,7 @@
 }
 
 // Test all_dependent_configs and public_config inheritance.
-TEST(Target, DependentConfigs) {
+TEST_F(TargetTest, DependentConfigs) {
   TestWithScope setup;
   Err err;
 
@@ -139,7 +142,7 @@
 }
 
 // Tests that dependent configs don't propagate between toolchains.
-TEST(Target, NoDependentConfigsBetweenToolchains) {
+TEST_F(TargetTest, NoDependentConfigsBetweenToolchains) {
   TestWithScope setup;
   Err err;
 
@@ -193,7 +196,7 @@
   ASSERT_EQ(0u, a.all_dependent_configs().size());
 }
 
-TEST(Target, InheritLibs) {
+TEST_F(TargetTest, InheritLibs) {
   TestWithScope setup;
   Err err;
 
@@ -230,7 +233,7 @@
   EXPECT_EQ(&b, a_inherited[0]);
 }
 
-TEST(Target, InheritCompleteStaticLib) {
+TEST_F(TargetTest, InheritCompleteStaticLib) {
   TestWithScope setup;
   Err err;
 
@@ -271,7 +274,7 @@
   EXPECT_EQ(lib_dir, a.all_lib_dirs()[0]);
 }
 
-TEST(Target, InheritCompleteStaticLibStaticLibDeps) {
+TEST_F(TargetTest, InheritCompleteStaticLibStaticLibDeps) {
   TestWithScope setup;
   Err err;
 
@@ -300,7 +303,7 @@
   EXPECT_EQ(&b, a_inherited[0]);
 }
 
-TEST(Target, InheritCompleteStaticLibInheritedCompleteStaticLibDeps) {
+TEST_F(TargetTest, InheritCompleteStaticLibInheritedCompleteStaticLibDeps) {
   TestWithScope setup;
   Err err;
 
@@ -331,7 +334,7 @@
   EXPECT_EQ(&c, a_inherited[1]);
 }
 
-TEST(Target, NoActionDepPropgation) {
+TEST_F(TargetTest, NoActionDepPropgation) {
   TestWithScope setup;
   Err err;
 
@@ -356,7 +359,7 @@
   }
 }
 
-TEST(Target, GetComputedOutputName) {
+TEST_F(TargetTest, GetComputedOutputName) {
   TestWithScope setup;
   Err err;
 
@@ -393,7 +396,7 @@
 }
 
 // Test visibility failure case.
-TEST(Target, VisibilityFails) {
+TEST_F(TargetTest, VisibilityFails) {
   TestWithScope setup;
   Err err;
 
@@ -411,7 +414,7 @@
 }
 
 // Test visibility with a single data_dep.
-TEST(Target, VisibilityDatadeps) {
+TEST_F(TargetTest, VisibilityDatadeps) {
   TestWithScope setup;
   Err err;
 
@@ -429,7 +432,7 @@
 
 // Tests that A -> Group -> B where the group is visible from A but B isn't,
 // passes visibility even though the group's deps get expanded into A.
-TEST(Target, VisibilityGroup) {
+TEST_F(TargetTest, VisibilityGroup) {
   TestWithScope setup;
   Err err;
 
@@ -457,7 +460,7 @@
 // Verifies that only testonly targets can depend on other testonly targets.
 // Many of the above dependency checking cases covered the non-testonly
 // case.
-TEST(Target, Testonly) {
+TEST_F(TargetTest, Testonly) {
   TestWithScope setup;
   Err err;
 
@@ -479,7 +482,7 @@
   ASSERT_FALSE(product.OnResolved(&err));
 }
 
-TEST(Target, PublicConfigs) {
+TEST_F(TargetTest, PublicConfigs) {
   TestWithScope setup;
   Err err;
 
@@ -519,7 +522,7 @@
 }
 
 // Tests that configs are ordered properly between local and pulled ones.
-TEST(Target, ConfigOrdering) {
+TEST_F(TargetTest, ConfigOrdering) {
   TestWithScope setup;
   Err err;
 
@@ -584,7 +587,7 @@
 }
 
 // Tests that different link/depend outputs work for solink tools.
-TEST(Target, LinkAndDepOutputs) {
+TEST_F(TargetTest, LinkAndDepOutputs) {
   TestWithScope setup;
   Err err;
 
@@ -625,7 +628,7 @@
 
 // Tests that runtime_outputs works without an explicit link_output for
 // solink tools.
-TEST(Target, RuntimeOuputs) {
+TEST_F(TargetTest, RuntimeOuputs) {
   TestWithScope setup;
   Err err;
 
@@ -670,7 +673,7 @@
 
 // Shared libraries should be inherited across public shared liobrary
 // boundaries.
-TEST(Target, SharedInheritance) {
+TEST_F(TargetTest, SharedInheritance) {
   TestWithScope setup;
   Err err;
 
@@ -710,8 +713,7 @@
   EXPECT_EQ(&pub, exe_inherited[1]);
 }
 
-TEST(Target, GeneratedInputs) {
-  Scheduler scheduler;
+TEST_F(TargetTest, GeneratedInputs) {
   TestWithScope setup;
   Err err;
 
@@ -724,7 +726,7 @@
   EXPECT_TRUE(non_existent_generator.OnResolved(&err)) << err.message();
   AssertSchedulerHasOneUnknownFileMatching(&non_existent_generator,
                                            generated_file);
-  scheduler.ClearUnknownGeneratedInputsAndWrittenFiles();
+  scheduler().ClearUnknownGeneratedInputsAndWrittenFiles();
 
   // Make a target that generates the file.
   TestTarget generator(setup, "//foo:generator", Target::ACTION);
@@ -740,7 +742,7 @@
   existent_generator.sources().push_back(generated_file);
   existent_generator.private_deps().push_back(LabelTargetPair(&generator));
   EXPECT_TRUE(existent_generator.OnResolved(&err)) << err.message();
-  EXPECT_TRUE(scheduler.GetUnknownGeneratedInputs().empty());
+  EXPECT_TRUE(scheduler().GetUnknownGeneratedInputs().empty());
 
   // A target that depends on the previous one should *not* be allowed to
   // use the generated file, because existent_generator used private deps.
@@ -753,7 +755,7 @@
       LabelTargetPair(&existent_generator));
   EXPECT_TRUE(indirect_private.OnResolved(&err));
   AssertSchedulerHasOneUnknownFileMatching(&indirect_private, generated_file);
-  scheduler.ClearUnknownGeneratedInputsAndWrittenFiles();
+  scheduler().ClearUnknownGeneratedInputsAndWrittenFiles();
 
   // Now make a chain like the above but with all public deps, it should be OK.
   TestTarget existent_public(setup, "//foo:existent_public",
@@ -765,12 +767,11 @@
   indirect_public.sources().push_back(generated_file);
   indirect_public.public_deps().push_back(LabelTargetPair(&existent_public));
   EXPECT_TRUE(indirect_public.OnResolved(&err)) << err.message();
-  EXPECT_TRUE(scheduler.GetUnknownGeneratedInputs().empty());
+  EXPECT_TRUE(scheduler().GetUnknownGeneratedInputs().empty());
 }
 
 // This is sort of a Scheduler test, but is related to the above test more.
-TEST(Target, WriteFileGeneratedInputs) {
-  Scheduler scheduler;
+TEST_F(TargetTest, WriteFileGeneratedInputs) {
   TestWithScope setup;
   Err err;
 
@@ -783,21 +784,20 @@
   EXPECT_TRUE(non_existent_generator.OnResolved(&err));
   AssertSchedulerHasOneUnknownFileMatching(&non_existent_generator,
                                            generated_file);
-  scheduler.ClearUnknownGeneratedInputsAndWrittenFiles();
+  scheduler().ClearUnknownGeneratedInputsAndWrittenFiles();
 
   // This target has a generated file and we've decared we write it.
   TestTarget existent_generator(setup, "//foo:existent_generator",
                                 Target::EXECUTABLE);
   existent_generator.sources().push_back(generated_file);
   EXPECT_TRUE(existent_generator.OnResolved(&err));
-  scheduler.AddWrittenFile(generated_file);
+  scheduler().AddWrittenFile(generated_file);
 
   // Should be OK.
-  EXPECT_TRUE(scheduler.GetUnknownGeneratedInputs().empty());
+  EXPECT_TRUE(scheduler().GetUnknownGeneratedInputs().empty());
 }
 
-TEST(Target, WriteRuntimeDepsGeneratedInputs) {
-  Scheduler scheduler;
+TEST_F(TargetTest, WriteRuntimeDepsGeneratedInputs) {
   TestWithScope setup;
   Err err;
 
@@ -816,14 +816,14 @@
   dep_missing.sources().push_back(source_file);
   EXPECT_TRUE(dep_missing.OnResolved(&err));
   AssertSchedulerHasOneUnknownFileMatching(&dep_missing, source_file);
-  scheduler.ClearUnknownGeneratedInputsAndWrittenFiles();
+  scheduler().ClearUnknownGeneratedInputsAndWrittenFiles();
 
   // This target has a generated file and we've directly dependended on it.
   TestTarget dep_present(setup, "//foo:with_dep", Target::EXECUTABLE);
   dep_present.sources().push_back(source_file);
   dep_present.private_deps().push_back(LabelTargetPair(&generator));
   EXPECT_TRUE(dep_present.OnResolved(&err));
-  EXPECT_TRUE(scheduler.GetUnknownGeneratedInputs().empty());
+  EXPECT_TRUE(scheduler().GetUnknownGeneratedInputs().empty());
 
   // This target has a generated file and we've indirectly dependended on it
   // via data_deps.
@@ -832,7 +832,7 @@
   dep_indirect.data_deps().push_back(LabelTargetPair(&middle_data_dep));
   EXPECT_TRUE(dep_indirect.OnResolved(&err));
   AssertSchedulerHasOneUnknownFileMatching(&dep_indirect, source_file);
-  scheduler.ClearUnknownGeneratedInputsAndWrittenFiles();
+  scheduler().ClearUnknownGeneratedInputsAndWrittenFiles();
 
   // This target has a generated file and we've directly dependended on it
   // via data_deps.
@@ -840,15 +840,14 @@
   data_dep_present.sources().push_back(source_file);
   data_dep_present.data_deps().push_back(LabelTargetPair(&generator));
   EXPECT_TRUE(data_dep_present.OnResolved(&err));
-  EXPECT_TRUE(scheduler.GetUnknownGeneratedInputs().empty());
+  EXPECT_TRUE(scheduler().GetUnknownGeneratedInputs().empty());
 }
 
 // Tests that intermediate object files generated by binary targets are also
 // considered generated for the purposes of input checking. Above, we tested
 // the failure cases for generated inputs, so here only test .o files that are
 // present.
-TEST(Target, ObjectGeneratedInputs) {
-  Scheduler scheduler;
+TEST_F(TargetTest, ObjectGeneratedInputs) {
   TestWithScope setup;
   Err err;
 
@@ -868,7 +867,7 @@
   AssertSchedulerHasOneUnknownFileMatching(&final_target, object_file);
 }
 
-TEST(Target, ResolvePrecompiledHeaders) {
+TEST_F(TargetTest, ResolvePrecompiledHeaders) {
   TestWithScope setup;
   Err err;
 
@@ -886,7 +885,7 @@
   ASSERT_TRUE(config_1.OnResolved(&err));
   target.configs().push_back(LabelConfigPair(&config_1));
 
-  // No PCH info specified on target, but the config specifies one, the
+  // No PCH info specified on TargetTest, but the config specifies one, the
   // values should get copied to the target.
   EXPECT_TRUE(target.ResolvePrecompiledHeaders(&err));
   EXPECT_EQ(pch_1, target.config_values().precompiled_header());
@@ -925,7 +924,7 @@
       err.help_text());
 }
 
-TEST(Target, AssertNoDeps) {
+TEST_F(TargetTest, AssertNoDeps) {
   TestWithScope setup;
   Err err;
 
@@ -980,7 +979,7 @@
   ASSERT_TRUE(a2.OnResolved(&err));
 }
 
-TEST(Target, PullRecursiveBundleData) {
+TEST_F(TargetTest, PullRecursiveBundleData) {
   TestWithScope setup;
   Err err;
 
diff --git a/tools/gn/test_with_scheduler.cc b/tools/gn/test_with_scheduler.cc
new file mode 100644
index 0000000..ce7a90c
--- /dev/null
+++ b/tools/gn/test_with_scheduler.cc
@@ -0,0 +1,8 @@
+// Copyright 2018 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 "tools/gn/test_with_scheduler.h"
+
+TestWithScheduler::TestWithScheduler() = default;
+TestWithScheduler::~TestWithScheduler() = default;
diff --git a/tools/gn/test_with_scheduler.h b/tools/gn/test_with_scheduler.h
new file mode 100644
index 0000000..230f69e5
--- /dev/null
+++ b/tools/gn/test_with_scheduler.h
@@ -0,0 +1,27 @@
+// Copyright 2018 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 TOOLS_GN_TEST_WITH_SCHEDULER_H_
+#define TOOLS_GN_TEST_WITH_SCHEDULER_H_
+
+#include "base/macros.h"
+#include "base/test/scoped_task_environment.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "tools/gn/scheduler.h"
+
+class TestWithScheduler : public testing::Test {
+ protected:
+  TestWithScheduler();
+  ~TestWithScheduler() override;
+
+  Scheduler& scheduler() { return scheduler_; }
+
+ private:
+  base::test::ScopedTaskEnvironment scoped_task_environment_;
+  Scheduler scheduler_;
+
+  DISALLOW_COPY_AND_ASSIGN(TestWithScheduler);
+};
+
+#endif  // TOOLS_GN_TEST_WITH_SCHEDULER_H_
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
index 6a13f8ed..220b7eab 100644
--- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc
+++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -1488,22 +1488,6 @@
         p->SetToBlobRange(uuid, offset, length);
         return true;
       }
-      case network::DataElement::Type::TYPE_FILE_FILESYSTEM: {
-        GURL url;
-        uint64_t offset;
-        uint64_t length;
-        base::Time modification_time;
-        if (!FuzzParam(&url, fuzzer))
-          return false;
-        if (!FuzzParam(&offset, fuzzer))
-          return false;
-        if (!FuzzParam(&length, fuzzer))
-          return false;
-        if (!FuzzParam(&modification_time, fuzzer))
-          return false;
-        p->SetToFileSystemUrlRange(url, offset, length, modification_time);
-        return true;
-      }
       default: {
         NOTREACHED();
         return false;
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index a2836784..d6603d68 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -711,6 +711,7 @@
         return ret
 
     android = 'target_os="android"' in vals['gn_args']
+    fuchsia = 'target_os="fuchsia"' in vals['gn_args']
     for target in swarming_targets:
       if android:
         # Android targets may be either android_apk or executable. The former
@@ -720,6 +721,11 @@
         runtime_deps_targets = [
             target + '.runtime_deps',
             'obj/%s.stamp.runtime_deps' % label.replace(':', '/')]
+      elif fuchsia:
+        # Only emit a runtime deps file for the group() target on Fuchsia.
+        label = isolate_map[target]['label']
+        runtime_deps_targets = [
+          'obj/%s.stamp.runtime_deps' % label.replace(':', '/')]
       elif (isolate_map[target]['type'] == 'script' or
             isolate_map[target].get('label_type') == 'group'):
         # For script targets, the build target is usually a group,
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl
index f78812a..cf7764a 100644
--- a/tools/mb/mb_config.pyl
+++ b/tools/mb/mb_config.pyl
@@ -35,7 +35,6 @@
       'Android ASAN (dbg)': 'android_clang_asan_debug_bot_minimal_symbols',
       'Android Cronet ARM64 Builder': 'android_cronet_release_bot_minimal_symbols_arm64',
       'Android Cronet ARM64 Builder (dbg)': 'android_cronet_debug_static_bot_arm64',
-      'Android Cronet ARMv6 Builder': 'android_cronet_release_bot_minimal_symbols_armv6',
       'Android Cronet Builder': 'android_cronet_release_bot_minimal_symbols_arm_no_neon',
       'Android Cronet Builder (dbg)': 'android_cronet_debug_static_bot_arm_no_neon',
       'Android Cronet Builder Asan': 'android_cronet_release_bot_minimal_symbols_arm_no_neon_clang_asan',
@@ -44,7 +43,6 @@
       'Android Cronet Lollipop Builder': 'android_cronet_release_bot_minimal_symbols_arm_no_neon',
       'Android Cronet Marshmallow 64bit Builder': 'android_cronet_release_bot_minimal_symbols_arm64',
       'Android Cronet Marshmallow 64bit Perf': 'android_cronet_release_bot_minimal_symbols_arm64',
-      'Android Cronet MIPS Builder': 'android_cronet_release_bot_minimal_symbols_mipsel',
       'Android Cronet x86 Builder': 'android_cronet_release_bot_minimal_symbols_x86',
       'Android Cronet x86 Builder (dbg)': 'android_cronet_debug_static_bot_x86',
       'Android MIPS Builder (dbg)': 'android_debug_static_bot_mipsel',
@@ -59,7 +57,6 @@
     },
 
     'chromium.android.fyi': {
-      'Android Cronet ARMv6 Builder': 'android_cronet_release_bot_minimal_symbols_armv6',
       'Android Cronet Builder (dbg)': 'android_cronet_debug_static_bot_arm_no_neon',
       'Android Cronet Builder Asan': 'android_cronet_release_bot_minimal_symbols_arm_no_neon_clang_asan',
       'Android Cronet Data Reduction Proxy Builder': 'android_cronet_data_reduction_proxy_release_bot_minimal_symbols_arm_no_neon',
@@ -862,11 +859,6 @@
       'strip_debug_info',
     ],
 
-    'android_cronet_release_bot_minimal_symbols_armv6': [
-      'android', 'cronet', 'official_optimize', 'release_bot', 'minimal_symbols', 'armv6',
-      'strip_debug_info',
-    ],
-
     'android_cronet_release_bot_minimal_symbols_arm_no_neon': [
       'android', 'cronet', 'official_optimize', 'release_bot', 'minimal_symbols', 'arm_no_neon',
       'strip_debug_info',
@@ -877,11 +869,6 @@
       'strip_debug_info',
     ],
 
-    'android_cronet_release_bot_minimal_symbols_mipsel': [
-      'android', 'cronet', 'official_optimize', 'release_bot', 'minimal_symbols', 'mipsel',
-      'strip_debug_info',
-    ],
-
     'android_cronet_release_bot_minimal_symbols_x86': [
       'android', 'cronet', 'official_optimize', 'release_bot', 'minimal_symbols', 'x86',
       'strip_debug_info',
@@ -1762,10 +1749,6 @@
       'gn_args': 'target_cpu="arm64"',
     },
 
-    'armv6': {
-      'gn_args': 'arm_version=6',
-    },
-
     'arm_no_neon': {
       'mixins': ['arm'],
       'gn_args': 'arm_use_neon=false',
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index b7ea9b56..ff72790 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -82623,6 +82623,9 @@
 </histogram>
 
 <histogram base="true" name="SimpleCache.LastClusterLossPercent" units="%">
+  <obsolete>
+    Deprecated 2018-01; not viewed as actionable.
+  </obsolete>
   <owner>morlovich@chromium.org</owner>
   <summary>
     For each file in the Simple Cache, the percentage of disk space used by the
@@ -82632,6 +82635,9 @@
 </histogram>
 
 <histogram base="true" name="SimpleCache.LastClusterSize" units="bytes">
+  <obsolete>
+    Deprecated 2018-01; not viewed as actionable.
+  </obsolete>
   <owner>morlovich@chromium.org</owner>
   <summary>
     For each file in the Simple Cache, the number of bytes in the last 4096 byte
diff --git a/tools/perf/core/stacktrace_unittest.py b/tools/perf/core/stacktrace_unittest.py
index 7e222c3..9de49a6 100644
--- a/tools/perf/core/stacktrace_unittest.py
+++ b/tools/perf/core/stacktrace_unittest.py
@@ -15,7 +15,8 @@
   # Stack traces do not currently work on 10.6, but they are also being
   # disabled shortly so just disable it for now.
   # All platforms except chromeos should at least have a valid minidump.
-  @decorators.Disabled('snowleopard', 'chromeos')
+  # Disabled on win due to crbug.com/804452.
+  @decorators.Disabled('snowleopard', 'chromeos', 'win')
   def testValidDump(self):
     with self.assertRaises(exceptions.DevtoolsTargetCrashException) as c:
       self._tab.Navigate('chrome://crash', timeout=5)
diff --git a/tools/traffic_annotation/auditor/safe_list.txt b/tools/traffic_annotation/auditor/safe_list.txt
index 65aa3356..93bf3ff 100644
--- a/tools/traffic_annotation/auditor/safe_list.txt
+++ b/tools/traffic_annotation/auditor/safe_list.txt
@@ -5,4 +5,4 @@
 all,tools
 missing,net/url_request/url_fetcher.cc
 missing,net/url_request/url_request_context.cc
-direct_assignment,download::ProtoConversions::EntryFromProto@components/download/internal/proto_conversions.cc
\ No newline at end of file
+direct_assignment,download::ProtoConversions::EntryFromProto@components/download/internal/background_service/proto_conversions.cc
\ No newline at end of file
diff --git a/tools/traffic_annotation/auditor/tests/extractor_outputs/good_assignment.txt b/tools/traffic_annotation/auditor/tests/extractor_outputs/good_assignment.txt
index cb6237d..67a84a98 100644
--- a/tools/traffic_annotation/auditor/tests/extractor_outputs/good_assignment.txt
+++ b/tools/traffic_annotation/auditor/tests/extractor_outputs/good_assignment.txt
@@ -1,3 +1,3 @@
-components/download/internal/proto_conversions.cc
+components/download/internal/background_service/proto_conversions.cc
 download::ProtoConversions::EntryFromProto
 267
\ No newline at end of file
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml
index 2a01af1..49cb8d2 100644
--- a/tools/traffic_annotation/summary/annotations.xml
+++ b/tools/traffic_annotation/summary/annotations.xml
@@ -31,7 +31,7 @@
  <item id="captive_portal_service" hash_code="88754904" type="0" content_hash_code="70737580" os_list="linux,windows" file_path="chrome/browser/captive_portal/captive_portal_service.cc"/>
  <item id="cast_keep_alive_delegate" hash_code="134755844" type="0" content_hash_code="66118796" os_list="linux,windows" file_path="components/cast_channel/keep_alive_delegate.cc"/>
  <item id="cast_socket" hash_code="115192205" type="0" content_hash_code="63056899" os_list="linux,windows" file_path="components/cast_channel/cast_socket.cc"/>
- <item id="cast_udp_transport" hash_code="5576536" type="0" content_hash_code="107643273" os_list="linux,windows" file_path="media/cast/net/udp_transport.cc"/>
+ <item id="cast_udp_transport" hash_code="5576536" type="0" content_hash_code="107643273" os_list="linux,windows" file_path="media/cast/net/udp_transport_impl.cc"/>
  <item id="certificate_verifier" hash_code="113553577" type="0" content_hash_code="62346354" os_list="linux,windows" file_path="net/cert_net/cert_net_fetcher_impl.cc"/>
  <item id="chrome_apps_socket_api" hash_code="8591273" type="0" content_hash_code="70868355" os_list="linux,windows" file_path="extensions/browser/api/socket/socket.cc"/>
  <item id="chrome_cleaner" hash_code="27071967" type="0" content_hash_code="111240292" os_list="windows" file_path="chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_fetcher_win.cc"/>
diff --git a/ui/gfx/vsync_provider.cc b/ui/gfx/vsync_provider.cc
index d54ffe8..6276b7f 100644
--- a/ui/gfx/vsync_provider.cc
+++ b/ui/gfx/vsync_provider.cc
@@ -19,8 +19,12 @@
   return true;
 }
 
-bool FixedVSyncProvider::SupportGetVSyncParametersIfAvailable() {
+bool FixedVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
   return true;
 }
 
+bool FixedVSyncProvider::IsHWClock() const {
+  return false;
+}
+
 }  // namespace gfx
diff --git a/ui/gfx/vsync_provider.h b/ui/gfx/vsync_provider.h
index a1c1098..e8aa0fe7 100644
--- a/ui/gfx/vsync_provider.h
+++ b/ui/gfx/vsync_provider.h
@@ -33,7 +33,10 @@
                                              base::TimeDelta* interval) = 0;
 
   // Returns true, if GetVSyncParametersIfAvailable is supported.
-  virtual bool SupportGetVSyncParametersIfAvailable() = 0;
+  virtual bool SupportGetVSyncParametersIfAvailable() const = 0;
+
+  // Returns true, if VSyncProvider gets VSync timebase from HW.
+  virtual bool IsHWClock() const = 0;
 };
 
 // Provides a constant timebase and interval.
@@ -48,7 +51,8 @@
   void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
   bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
                                      base::TimeDelta* interval) override;
-  bool SupportGetVSyncParametersIfAvailable() override;
+  bool SupportGetVSyncParametersIfAvailable() const override;
+  bool IsHWClock() const override;
 
  private:
   base::TimeTicks timebase_;
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
index b3a2342..5c7b79ae 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -39,6 +39,7 @@
     case GL_RG:
     case GL_BGRA_EXT:
     case GL_RGB:
+    case GL_RGB10_A2_EXT:
     case GL_RGB_YCBCR_420V_CHROMIUM:
     case GL_RGB_YCBCR_422_CHROMIUM:
     case GL_RGBA:
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc
index 67255b5..4db7485 100644
--- a/ui/gl/gl_surface_egl.cc
+++ b/ui/gl/gl_surface_egl.cc
@@ -29,6 +29,7 @@
 #include "ui/gl/gl_context_egl.h"
 #include "ui/gl/gl_image.h"
 #include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface_presentation_helper.h"
 #include "ui/gl/gl_surface_stub.h"
 #include "ui/gl/gl_utils.h"
 #include "ui/gl/scoped_make_current.h"
@@ -198,6 +199,8 @@
     return false;
   }
 
+  bool IsHWClock() const override { return true; }
+
  private:
   EGLSurface surface_;
 
@@ -982,6 +985,9 @@
         std::make_unique<EGLSyncControlVSyncProvider>(surface_);
   }
 
+  presentation_helper_ =
+      std::make_unique<GLSurfacePresentationHelper>(GetVSyncProvider());
+
   return true;
 }
 
@@ -1034,11 +1040,16 @@
   use_egl_timestamps_ = !supported_egl_timestamps_.empty();
 }
 
+bool NativeViewGLSurfaceEGL::SupportsPresentationCallback() {
+  return true;
+}
+
 bool NativeViewGLSurfaceEGL::InitializeNativeWindow() {
   return true;
 }
 
 void NativeViewGLSurfaceEGL::Destroy() {
+  presentation_helper_ = nullptr;
   vsync_provider_internal_ = nullptr;
 
   if (surface_) {
@@ -1073,17 +1084,17 @@
         !!eglGetNextFrameIdANDROID(GetDisplay(), surface_, &newFrameId);
   }
 
+  presentation_helper_->PreSwapBuffers(callback);
+  gfx::SwapResult swap_result = gfx::SwapResult::SWAP_ACK;
   if (!eglSwapBuffers(GetDisplay(), surface_)) {
     DVLOG(1) << "eglSwapBuffers failed with error "
              << GetLastEGLErrorString();
-    return gfx::SwapResult::SWAP_FAILED;
-  }
-
-  if (use_egl_timestamps_) {
+    swap_result = gfx::SwapResult::SWAP_FAILED;
+  } else if (use_egl_timestamps_) {
     UpdateSwapEvents(newFrameId, newFrameIdIsValid);
   }
-
-  return gfx::SwapResult::SWAP_ACK;
+  presentation_helper_->PostSwapBuffers(swap_result);
+  return swap_result;
 }
 
 void NativeViewGLSurfaceEGL::UpdateSwapEvents(EGLuint64KHR newFrameId,
@@ -1278,14 +1289,17 @@
     return gfx::SwapResult::SWAP_FAILED;
   }
 
+  presentation_helper_->PreSwapBuffers(callback);
+  gfx::SwapResult swap_result = gfx::SwapResult::SWAP_ACK;
   if (!eglSwapBuffersWithDamageKHR(GetDisplay(), surface_,
                                    const_cast<EGLint*>(rects.data()),
                                    static_cast<EGLint>(rects.size() / 4))) {
     DVLOG(1) << "eglSwapBuffersWithDamageKHR failed with error "
              << GetLastEGLErrorString();
-    return gfx::SwapResult::SWAP_FAILED;
+    swap_result = gfx::SwapResult::SWAP_FAILED;
   }
-  return gfx::SwapResult::SWAP_ACK;
+  presentation_helper_->PostSwapBuffers(swap_result);
+  return swap_result;
 }
 
 gfx::SwapResult NativeViewGLSurfaceEGL::PostSubBuffer(
@@ -1306,12 +1320,15 @@
     // bottom left.
     y = GetSize().height() - y - height;
   }
+  presentation_helper_->PreSwapBuffers(callback);
+  gfx::SwapResult swap_result = gfx::SwapResult::SWAP_ACK;
   if (!eglPostSubBufferNV(GetDisplay(), surface_, x, y, width, height)) {
     DVLOG(1) << "eglPostSubBufferNV failed with error "
              << GetLastEGLErrorString();
-    return gfx::SwapResult::SWAP_FAILED;
+    swap_result = gfx::SwapResult::SWAP_FAILED;
   }
-  return gfx::SwapResult::SWAP_ACK;
+  presentation_helper_->PostSwapBuffers(swap_result);
+  return swap_result;
 }
 
 bool NativeViewGLSurfaceEGL::SupportsCommitOverlayPlanes() {
@@ -1333,6 +1350,11 @@
                                          : gfx::SwapResult::SWAP_FAILED;
 }
 
+bool NativeViewGLSurfaceEGL::OnMakeCurrent(GLContext* context) {
+  presentation_helper_->OnMakeCurrent(context, this);
+  return GLSurfaceEGL::OnMakeCurrent(context);
+}
+
 gfx::VSyncProvider* NativeViewGLSurfaceEGL::GetVSyncProvider() {
   return vsync_provider_external_ ? vsync_provider_external_.get()
                                   : vsync_provider_internal_.get();
diff --git a/ui/gl/gl_surface_egl.h b/ui/gl/gl_surface_egl.h
index 30a7196..1e8cb17 100644
--- a/ui/gl/gl_surface_egl.h
+++ b/ui/gl/gl_surface_egl.h
@@ -28,6 +28,8 @@
 
 namespace gl {
 
+class GLSurfacePresentationHelper;
+
 // If adding a new type, also add it to EGLDisplayType in
 // tools/metrics/histograms/histograms.xml. Don't remove or reorder entries.
 enum DisplayType {
@@ -104,10 +106,10 @@
                          std::unique_ptr<gfx::VSyncProvider> vsync_provider);
 
   // Implement GLSurface.
-  using GLSurfaceEGL::Initialize;
   bool Initialize(GLSurfaceFormat format) override;
   bool SupportsSwapTimestamps() const override;
   void SetEnableSwapTimestamps() override;
+  bool SupportsPresentationCallback() override;
   void Destroy() override;
   bool Resize(const gfx::Size& size,
               float scale_factor,
@@ -127,6 +129,7 @@
   bool SupportsCommitOverlayPlanes() override;
   gfx::SwapResult CommitOverlayPlanes(
       const PresentationCallback& callback) override;
+  bool OnMakeCurrent(GLContext* context) override;
   gfx::VSyncProvider* GetVSyncProvider() override;
   bool ScheduleOverlayPlane(int z_order,
                             gfx::OverlayTransform transform,
@@ -180,6 +183,8 @@
 
   base::queue<SwapInfo> swap_info_queue_;
 
+  std::unique_ptr<GLSurfacePresentationHelper> presentation_helper_;
+
   DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL);
 };
 
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index ba10ace..a8a05af 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -168,6 +168,8 @@
     return true;
   }
 
+  bool IsHWClock() const override { return true; }
+
  private:
   GLXWindow glx_window_;
 
@@ -344,8 +346,8 @@
       const gfx::VSyncProvider::UpdateVSyncCallback& callback) override {
     // Only one outstanding request per surface.
     if (!pending_callback_) {
-      pending_callback_.reset(
-          new gfx::VSyncProvider::UpdateVSyncCallback(callback));
+      pending_callback_ =
+          std::make_unique<gfx::VSyncProvider::UpdateVSyncCallback>(callback);
       vsync_thread_->task_runner()->PostTask(
           FROM_HERE,
           base::BindOnce(&SGIVideoSyncProviderThreadShim::GetVSyncParameters,
@@ -361,7 +363,8 @@
     return false;
   }
 
-  bool SupportGetVSyncParametersIfAvailable() override { return false; }
+  bool SupportGetVSyncParametersIfAvailable() const override { return false; }
+  bool IsHWClock() const override { return false; }
 
  private:
   void PendingCallbackRunner(const base::TimeTicks timebase,
@@ -609,13 +612,15 @@
   }
 
   if (g_glx_oml_sync_control_supported) {
-    vsync_provider_.reset(new OMLSyncControlVSyncProvider(glx_window_));
-    presentation_helper_ = std::make_unique<GLSurfacePresentationHelper>(
-        vsync_provider_.get(), true);
+    vsync_provider_ =
+        std::make_unique<OMLSyncControlVSyncProvider>(glx_window_);
+    presentation_helper_ =
+        std::make_unique<GLSurfacePresentationHelper>(vsync_provider_.get());
   } else if (g_glx_sgi_video_sync_supported) {
-    vsync_provider_.reset(new SGIVideoSyncVSyncProvider(parent_window_));
-    presentation_helper_ = std::make_unique<GLSurfacePresentationHelper>(
-        vsync_provider_.get(), false);
+    vsync_provider_ =
+        std::make_unique<SGIVideoSyncVSyncProvider>(parent_window_);
+    presentation_helper_ =
+        std::make_unique<GLSurfacePresentationHelper>(vsync_provider_.get());
   } else {
     // Assume a refresh rate of 59.9 Hz, which will cause us to skip
     // 1 frame every 10 seconds on a 60Hz monitor, but will prevent us
@@ -625,8 +630,8 @@
     const base::TimeTicks kDefaultTimebase;
     const base::TimeDelta kDefaultInterval =
         base::TimeDelta::FromSeconds(1) / 59.9;
-    vsync_provider_.reset(
-        new gfx::FixedVSyncProvider(kDefaultTimebase, kDefaultInterval));
+    vsync_provider_ = std::make_unique<gfx::FixedVSyncProvider>(
+        kDefaultTimebase, kDefaultInterval);
     presentation_helper_ = std::make_unique<GLSurfacePresentationHelper>(
         kDefaultTimebase, kDefaultInterval);
   }
@@ -670,7 +675,7 @@
                GetSize().width(), "height", GetSize().height());
   presentation_helper_->PreSwapBuffers(callback);
   glXSwapBuffers(g_display, GetDrawableHandle());
-  presentation_helper_->PostSwapBuffers();
+  presentation_helper_->PostSwapBuffers(gfx::SwapResult::SWAP_ACK);
   return gfx::SwapResult::SWAP_ACK;
 }
 
@@ -713,7 +718,7 @@
   DCHECK(g_driver_glx.ext.b_GLX_MESA_copy_sub_buffer);
   presentation_helper_->PreSwapBuffers(callback);
   glXCopySubBufferMESA(g_display, GetDrawableHandle(), x, y, width, height);
-  presentation_helper_->PostSwapBuffers();
+  presentation_helper_->PostSwapBuffers(gfx::SwapResult::SWAP_ACK);
   return gfx::SwapResult::SWAP_ACK;
 }
 
diff --git a/ui/gl/gl_surface_presentation_helper.cc b/ui/gl/gl_surface_presentation_helper.cc
index 41acab4..15e8dee 100644
--- a/ui/gl/gl_surface_presentation_helper.cc
+++ b/ui/gl/gl_surface_presentation_helper.cc
@@ -24,19 +24,13 @@
 operator=(Frame&& other) = default;
 
 GLSurfacePresentationHelper::GLSurfacePresentationHelper(
-    gfx::VSyncProvider* vsync_provider,
-    bool hw_clock)
-    : vsync_provider_(vsync_provider),
-      hw_clock_(hw_clock),
-      weak_ptr_factory_(this) {
-  DCHECK(vsync_provider_);
-}
+    gfx::VSyncProvider* vsync_provider)
+    : vsync_provider_(vsync_provider), weak_ptr_factory_(this) {}
 
 GLSurfacePresentationHelper::GLSurfacePresentationHelper(
     base::TimeTicks timebase,
     base::TimeDelta interval)
     : vsync_provider_(nullptr),
-      hw_clock_(false),
       vsync_timebase_(timebase),
       vsync_interval_(interval),
       weak_ptr_factory_(this) {}
@@ -88,9 +82,19 @@
   pending_frames_.push_back(Frame(std::move(timer), callback));
 }
 
-void GLSurfacePresentationHelper::PostSwapBuffers() {
-  if (!waiting_for_vsync_parameters_)
+void GLSurfacePresentationHelper::PostSwapBuffers(gfx::SwapResult result) {
+  DCHECK(!pending_frames_.empty());
+  if (result != gfx::SwapResult::SWAP_ACK) {
+    auto frame = std::move(pending_frames_.back());
+    pending_frames_.pop_back();
+    if (frame.timer) {
+      bool has_context = gl_context_ && gl_context_->IsCurrent(surface_);
+      frame.timer->Destroy(has_context);
+    }
+    frame.callback.Run(gfx::PresentationFeedback());
+  } else if (!waiting_for_vsync_parameters_) {
     CheckPendingFrames();
+  }
 }
 
 void GLSurfacePresentationHelper::CheckPendingFrames() {
@@ -113,7 +117,8 @@
   if (gl_context_ && !gl_context_->IsCurrent(surface_)) {
     gpu_timing_client_ = nullptr;
     for (auto& frame : pending_frames_) {
-      frame.timer->Destroy(false /* has_context */);
+      if (frame.timer)
+        frame.timer->Destroy(false /* has_context */);
       frame.callback.Run(gfx::PresentationFeedback());
     }
     pending_frames_.clear();
@@ -155,6 +160,7 @@
         };
 
     const bool fixed_vsync = !vsync_provider_;
+    const bool hw_clock = vsync_provider_ && vsync_provider_->IsHWClock();
     if (vsync_interval_.is_zero() || fixed_vsync) {
       // If VSync parameters are fixed or not avaliable, we just run
       // presentation callbacks with timestamp from GPUTimers.
@@ -170,7 +176,7 @@
         // The |vsync_timebase_| is the closest VSync's timestamp after the GPU
         // finished renderering.
         timestamp = vsync_timebase_;
-        if (hw_clock_)
+        if (hw_clock)
           flags |= gfx::PresentationFeedback::kHWClock;
       } else {
         // The |vsync_timebase_| isn't the closest VSync's timestamp after the
diff --git a/ui/gl/gl_surface_presentation_helper.h b/ui/gl/gl_surface_presentation_helper.h
index b00f6e94..234f08e5 100644
--- a/ui/gl/gl_surface_presentation_helper.h
+++ b/ui/gl/gl_surface_presentation_helper.h
@@ -9,6 +9,7 @@
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
 #include "base/time/time.h"
+#include "ui/gfx/swap_result.h"
 #include "ui/gl/gl_export.h"
 #include "ui/gl/gl_surface.h"
 
@@ -26,8 +27,8 @@
 // implementations.
 class GL_EXPORT GLSurfacePresentationHelper {
  public:
-  GLSurfacePresentationHelper(gfx::VSyncProvider* vsync_provider,
-                              bool hw_clock);
+  explicit GLSurfacePresentationHelper(gfx::VSyncProvider* vsync_provider);
+
   // For using fixed VSync provider.
   GLSurfacePresentationHelper(const base::TimeTicks timebase,
                               const base::TimeDelta interval);
@@ -35,7 +36,7 @@
 
   void OnMakeCurrent(GLContext* context, GLSurface* surface);
   void PreSwapBuffers(const GLSurface::PresentationCallback& callback);
-  void PostSwapBuffers();
+  void PostSwapBuffers(gfx::SwapResult result);
 
  private:
   struct Frame {
@@ -58,7 +59,6 @@
                            const base::TimeDelta interval);
 
   gfx::VSyncProvider* const vsync_provider_;
-  const bool hw_clock_;
   scoped_refptr<GLContext> gl_context_;
   GLSurface* surface_ = nullptr;
   scoped_refptr<GPUTimingClient> gpu_timing_client_;
diff --git a/ui/gl/sync_control_vsync_provider.cc b/ui/gl/sync_control_vsync_provider.cc
index 7f9c6c0..6ce9350 100644
--- a/ui/gl/sync_control_vsync_provider.cc
+++ b/ui/gl/sync_control_vsync_provider.cc
@@ -164,7 +164,7 @@
 #endif  // defined(OS_LINUX)
 }
 
-bool SyncControlVSyncProvider::SupportGetVSyncParametersIfAvailable() {
+bool SyncControlVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
 #if defined(OS_LINUX)
   return true;
 #else
diff --git a/ui/gl/sync_control_vsync_provider.h b/ui/gl/sync_control_vsync_provider.h
index 7612e60..735d7ee 100644
--- a/ui/gl/sync_control_vsync_provider.h
+++ b/ui/gl/sync_control_vsync_provider.h
@@ -23,7 +23,7 @@
   void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
   bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
                                      base::TimeDelta* interval) override;
-  bool SupportGetVSyncParametersIfAvailable() override;
+  bool SupportGetVSyncParametersIfAvailable() const override;
 
   static constexpr bool IsSupported() {
 #if defined(OS_LINUX)
diff --git a/ui/gl/vsync_provider_win.cc b/ui/gl/vsync_provider_win.cc
index 041cdd7..34dc0077 100644
--- a/ui/gl/vsync_provider_win.cc
+++ b/ui/gl/vsync_provider_win.cc
@@ -122,7 +122,11 @@
   return true;
 }
 
-bool VSyncProviderWin::SupportGetVSyncParametersIfAvailable() {
+bool VSyncProviderWin::SupportGetVSyncParametersIfAvailable() const {
+  return true;
+}
+
+bool VSyncProviderWin::IsHWClock() const {
   return true;
 }
 
diff --git a/ui/gl/vsync_provider_win.h b/ui/gl/vsync_provider_win.h
index 0ec56442..3ee9a29 100644
--- a/ui/gl/vsync_provider_win.h
+++ b/ui/gl/vsync_provider_win.h
@@ -22,7 +22,8 @@
   void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
   bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
                                      base::TimeDelta* interval) override;
-  bool SupportGetVSyncParametersIfAvailable() override;
+  bool SupportGetVSyncParametersIfAvailable() const override;
+  bool IsHWClock() const override;
 
  private:
   gfx::AcceleratedWidget window_;
diff --git a/ui/ozone/platform/drm/gpu/crtc_controller.cc b/ui/ozone/platform/drm/gpu/crtc_controller.cc
index ef596c0..8845685 100644
--- a/ui/ozone/platform/drm/gpu/crtc_controller.cc
+++ b/ui/ozone/platform/drm/gpu/crtc_controller.cc
@@ -120,12 +120,6 @@
   return true;
 }
 
-bool CrtcController::IsFormatSupported(uint32_t fourcc_format,
-                                       uint32_t z_order) const {
-  return drm_->plane_manager()->IsFormatSupported(fourcc_format, z_order,
-                                                  crtc_);
-}
-
 std::vector<uint64_t> CrtcController::GetFormatModifiers(uint32_t format) {
   return drm_->plane_manager()->GetFormatModifiers(crtc_, format);
 }
diff --git a/ui/ozone/platform/drm/gpu/crtc_controller.h b/ui/ozone/platform/drm/gpu/crtc_controller.h
index dcbd0ae..98b27671 100644
--- a/ui/ozone/platform/drm/gpu/crtc_controller.h
+++ b/ui/ozone/platform/drm/gpu/crtc_controller.h
@@ -59,10 +59,6 @@
                         bool test_only,
                         scoped_refptr<PageFlipRequest> page_flip_request);
 
-  // Returns true if hardware plane with z_order equal to |z_order| can support
-  // |fourcc_format| format.
-  bool IsFormatSupported(uint32_t fourcc_format, uint32_t z_order) const;
-
   // Returns a vector of format modifiers for the given fourcc format
   // on this CRTCs primary plane. A format modifier describes the
   // actual layout of the buffer, such as whether it's linear, tiled
diff --git a/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc b/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
index 1abc94f..15d5bae1 100644
--- a/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
+++ b/ui/ozone/platform/drm/gpu/drm_overlay_validator.cc
@@ -75,18 +75,9 @@
       continue;
     }
 
-    uint32_t original_format =
-        params[i].plane_z_order
-            ? GetFourCCFormatFromBufferFormat(params[i].format)
-            : GetFourCCFormatForOpaqueFramebuffer(params[i].format);
-    if (!controller->IsFormatSupported(original_format,
-                                       params[i].plane_z_order)) {
-      returns[i].status = OVERLAY_STATUS_NOT;
-      continue;
-    }
-
     scoped_refptr<ScanoutBuffer> buffer =
-        GetBufferForPageFlipTest(drm, params[i].buffer_size, original_format,
+        GetBufferForPageFlipTest(drm, params[i].buffer_size,
+                                 GetFourCCFormatFromBufferFormat(params[i].format),
                                  buffer_generator_, &reusable_buffers);
 
     OverlayPlane plane(buffer, params[i].plane_z_order, params[i].transform,
diff --git a/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc b/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
index 7f475117..4b153e2 100644
--- a/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
+++ b/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
@@ -23,8 +23,12 @@
   return false;
 }
 
-bool DrmVSyncProvider::SupportGetVSyncParametersIfAvailable() {
+bool DrmVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
   return false;
 }
 
+bool DrmVSyncProvider::IsHWClock() const {
+  return true;
+}
+
 }  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_vsync_provider.h b/ui/ozone/platform/drm/gpu/drm_vsync_provider.h
index 6db9948..d0ec9a6 100644
--- a/ui/ozone/platform/drm/gpu/drm_vsync_provider.h
+++ b/ui/ozone/platform/drm/gpu/drm_vsync_provider.h
@@ -21,7 +21,8 @@
   void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
   bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
                                      base::TimeDelta* interval) override;
-  bool SupportGetVSyncParametersIfAvailable() override;
+  bool SupportGetVSyncParametersIfAvailable() const override;
+  bool IsHWClock() const override;
 
  private:
   DrmWindowProxy* window_;
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
index 2574cf69..b128ab7 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.cc
@@ -145,17 +145,6 @@
   return status;
 }
 
-bool HardwareDisplayController::IsFormatSupported(uint32_t fourcc_format,
-                                                  uint32_t z_order) const {
-  for (size_t i = 0; i < crtc_controllers_.size(); ++i) {
-    // Make sure all displays have overlay to support this format.
-    if (!crtc_controllers_[i]->IsFormatSupported(fourcc_format, z_order))
-      return false;
-  }
-
-  return true;
-}
-
 std::vector<uint64_t> HardwareDisplayController::GetFormatModifiers(
     uint32_t format) {
   std::vector<uint64_t> modifiers;
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_controller.h b/ui/ozone/platform/drm/gpu/hardware_display_controller.h
index d96d66f4..1fa3665 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_controller.h
+++ b/ui/ozone/platform/drm/gpu/hardware_display_controller.h
@@ -123,8 +123,6 @@
   // doesn't change any state.
   bool TestPageFlip(const OverlayPlaneList& plane_list);
 
-  bool IsFormatSupported(uint32_t fourcc_format, uint32_t z_order) const;
-
   // Return the supported modifiers for |fourcc_format| for this
   // controller.
   std::vector<uint64_t> GetFormatModifiers(uint32_t fourcc_format);
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
index c102c12..b745207 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.cc
@@ -310,39 +310,6 @@
   return supported_formats_;
 }
 
-bool HardwareDisplayPlaneManager::IsFormatSupported(uint32_t fourcc_format,
-                                                    uint32_t z_order,
-                                                    uint32_t crtc_id) const {
-  bool format_supported = false;
-  int crtc_index = LookupCrtcIndex(crtc_id);
-  if (crtc_index < 0) {
-    LOG(ERROR) << "Cannot find crtc " << crtc_id;
-    return format_supported;
-  }
-
-  // We dont have a way to query z_order of a plane. This is a temporary
-  // solution till driver exposes z_order property.
-  uint32_t plane_z_order = 0;
-  for (const auto& hardware_plane : planes_) {
-    if (plane_z_order > z_order)
-      break;
-
-    if (!hardware_plane->CanUseForCrtc(crtc_index))
-      continue;
-
-    if (plane_z_order == z_order) {
-      if (hardware_plane->IsSupportedFormat(fourcc_format))
-        format_supported = true;
-
-      break;
-    } else {
-      plane_z_order++;
-    }
-  }
-
-  return format_supported;
-}
-
 std::vector<uint64_t> HardwareDisplayPlaneManager::GetFormatModifiers(
     uint32_t crtc_id,
     uint32_t format) {
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h
index 175ca07..f49d7cb 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane_manager.h
@@ -109,13 +109,8 @@
   virtual void RequestPlanesReadyCallback(const OverlayPlaneList& planes,
                                           base::OnceClosure callback) = 0;
 
-  // Returns all formats which can be scanned out by this PlaneManager. Use
-  // IsFormatSupported to find if a given format is supported on a particular
-  // plane for a given crtc.
+  // Returns all formats which can be scanned out by this PlaneManager.
   const std::vector<uint32_t>& GetSupportedFormats() const;
-  bool IsFormatSupported(uint32_t fourcc_format,
-                         uint32_t z_order,
-                         uint32_t crtc_id) const;
 
   std::vector<uint64_t> GetFormatModifiers(uint32_t crtc_id, uint32_t format);
 
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_config.html b/ui/webui/resources/cr_components/chromeos/network/network_config.html
index 4797bb1..e69e377 100644
--- a/ui/webui/resources/cr_components/chromeos/network/network_config.html
+++ b/ui/webui/resources/cr_components/chromeos/network/network_config.html
@@ -3,6 +3,7 @@
 <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_icon.html">
 <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
 <link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html">
 <link rel="import" href="network_shared_css.html">
@@ -43,6 +44,8 @@
     <template is="dom-if" if="[[configRequiresPassphrase_(type, security_)]]">
       <network-config-input label="[[i18n('OncWiFi-Passphrase')]]"
           value="{{configProperties_.WiFi.Passphrase}}" password>
+        <iron-a11y-keys keys="enter" on-keys-pressed="connectIfConfigured_">
+        </iron-a11y-keys>
       </network-config-input>
     </template>
 
diff --git a/ui/webui/resources/cr_components/chromeos/network/network_config.js b/ui/webui/resources/cr_components/chromeos/network/network_config.js
index 73c46628..89d0f3cf 100644
--- a/ui/webui/resources/cr_components/chromeos/network/network_config.js
+++ b/ui/webui/resources/cr_components/chromeos/network/network_config.js
@@ -386,6 +386,13 @@
   },
 
   /** @private */
+  connectIfConfigured_: function() {
+    if (!this.isConfigured_)
+      return;
+    this.saveOrConnect();
+  },
+
+  /** @private */
   close_: function() {
     this.fire('close');
   },