diff --git a/DEPS b/DEPS
index 282bad33..e1445de 100644
--- a/DEPS
+++ b/DEPS
@@ -40,11 +40,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': '8e200787b769ba9ee0bd4bd37d27ded1fafc06e6',
+  'skia_revision': '1608a1dd17187aeeada376e710ecfafb1e229af2',
   # 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': '4668fa98f8923a491d8f80ff7260c9a3b3979c00',
+  'v8_revision': 'a5838cc92b08746ec9ebbb64f4ca2a1d44435491',
   # 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.
@@ -96,7 +96,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling catapult
   # and whatever else without interference from each other.
-  'catapult_revision': 'e7bf345be18c1f99e8ddd3d161c1f46013d095ed',
+  'catapult_revision': 'ceb07cf9dce01b0b83e76f1d8b6bcbf25b484f4e',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libFuzzer
   # and whatever else without interference from each other.
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc
index 59b5d15..c0244b5 100644
--- a/ash/login/ui/lock_contents_view.cc
+++ b/ash/login/ui/lock_contents_view.cc
@@ -9,6 +9,7 @@
 #include "ash/session/session_controller.h"
 #include "ash/shell.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/layout/box_layout.h"
@@ -16,7 +17,7 @@
 namespace ash {
 
 LockContentsView::LockContentsView() {
-  auto* layout = new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+  auto* layout = new views::BoxLayout(views::BoxLayout::kVertical);
   SetLayoutManager(layout);
 
   views::Label* label = new views::Label();
diff --git a/ash/sticky_keys/sticky_keys_overlay.cc b/ash/sticky_keys/sticky_keys_overlay.cc
index 36931e8..d4ff9bc 100644
--- a/ash/sticky_keys/sticky_keys_overlay.cc
+++ b/ash/sticky_keys/sticky_keys_overlay.cc
@@ -15,6 +15,7 @@
 #include "ui/compositor/scoped_layer_animation_settings.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/font_list.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/layout/box_layout.h"
@@ -140,9 +141,9 @@
   int vertical_spacing = font_size / 2 - font_padding;
   int child_spacing = font_size - 2 * font_padding;
 
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
-                                        horizontal_spacing, vertical_spacing,
-                                        child_spacing));
+  SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kVertical,
+      gfx::Insets(vertical_spacing, horizontal_spacing), child_spacing));
   AddKeyLabel(ui::EF_CONTROL_DOWN,
               l10n_util::GetStringUTF8(IDS_ASH_CONTROL_KEY));
   AddKeyLabel(ui::EF_ALT_DOWN, l10n_util::GetStringUTF8(IDS_ASH_ALT_KEY));
diff --git a/ash/system/bluetooth/tray_bluetooth.cc b/ash/system/bluetooth/tray_bluetooth.cc
index 5c8674c..b665240 100644
--- a/ash/system/bluetooth/tray_bluetooth.cc
+++ b/ash/system/bluetooth/tray_bluetooth.cc
@@ -27,6 +27,7 @@
 #include "device/bluetooth/bluetooth_common.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/image/image.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/vector_icon_types.h"
@@ -454,7 +455,7 @@
   views::View* CreateDisabledPanel() {
     views::View* container = new views::View;
     views::BoxLayout* box_layout =
-        new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+        new views::BoxLayout(views::BoxLayout::kVertical);
     box_layout->set_main_axis_alignment(
         views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
     container->SetLayoutManager(box_layout);
diff --git a/ash/system/date/date_view.cc b/ash/system/date/date_view.cc
index 604242c..071d7e0 100644
--- a/ash/system/date/date_view.cc
+++ b/ash/system/date/date_view.cc
@@ -20,6 +20,7 @@
 #include "third_party/icu/source/i18n/unicode/smpdtfmt.h"
 #include "ui/accessibility/ax_node_data.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/button.h"
 #include "ui/views/controls/label.h"
@@ -131,8 +132,9 @@
 DateView::DateView(SystemTrayItem* owner)
     : BaseDateTimeView(owner), action_(DateAction::NONE) {
   // TODO(tdanderson): Tweak spacing and layout for material design.
-  views::BoxLayout* box_layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, kTrayPopupLabelHorizontalPadding, 0, 0);
+  views::BoxLayout* box_layout =
+      new views::BoxLayout(views::BoxLayout::kHorizontal,
+                           gfx::Insets(0, kTrayPopupLabelHorizontalPadding), 0);
   box_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
   box_layout->set_cross_axis_alignment(
diff --git a/ash/system/date/system_info_default_view.cc b/ash/system/date/system_info_default_view.cc
index 9b11ab8e..ae78671 100644
--- a/ash/system/date/system_info_default_view.cc
+++ b/ash/system/date/system_info_default_view.cc
@@ -11,6 +11,7 @@
 #include "ash/system/tray/tray_popup_utils.h"
 #include "ash/system/tray/tri_view.h"
 #include "base/memory/ptr_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/separator.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/layout/fill_layout.h"
@@ -38,8 +39,7 @@
   if (PowerStatus::Get()->IsBatteryPresent()) {
     power_status_view_ = new ash::PowerStatusView();
     std::unique_ptr<views::BoxLayout> box_layout =
-        base::MakeUnique<views::BoxLayout>(views::BoxLayout::kHorizontal, 0, 0,
-                                           0);
+        base::MakeUnique<views::BoxLayout>(views::BoxLayout::kHorizontal);
     box_layout->set_cross_axis_alignment(
         views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
     box_layout->set_inside_border_insets(
diff --git a/ash/system/ime_menu/ime_menu_tray.cc b/ash/system/ime_menu/ime_menu_tray.cc
index b0c7fde..17720b43 100644
--- a/ash/system/ime_menu/ime_menu_tray.cc
+++ b/ash/system/ime_menu/ime_menu_tray.cc
@@ -30,6 +30,7 @@
 #include "ui/base/ime/text_input_client.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/range/range.h"
 #include "ui/keyboard/keyboard_controller.h"
@@ -132,8 +133,7 @@
         views::CreateSolidSidedBorder(0, 0, kSeparatorWidth, 0,
                                       kMenuSeparatorColor),
         gfx::Insets(kMenuSeparatorVerticalPadding - kSeparatorWidth, 0)));
-    auto* box_layout =
-        new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+    auto* box_layout = new views::BoxLayout(views::BoxLayout::kHorizontal);
     box_layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight);
     SetLayoutManager(box_layout);
     auto* title_label =
@@ -214,8 +214,7 @@
 
  private:
   void Init() {
-    auto* box_layout =
-        new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+    auto* box_layout = new views::BoxLayout(views::BoxLayout::kHorizontal);
     box_layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight);
     SetLayoutManager(box_layout);
     SetBorder(views::CreatePaddedBorder(
diff --git a/ash/system/palette/palette_tray.cc b/ash/system/palette/palette_tray.cc
index e82b4e7..79c3677 100644
--- a/ash/system/palette/palette_tray.cc
+++ b/ash/system/palette/palette_tray.cc
@@ -28,6 +28,7 @@
 #include "ui/events/devices/input_device_manager.h"
 #include "ui/events/devices/stylus_state.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
@@ -81,8 +82,7 @@
   explicit TitleView(PaletteTray* palette_tray) : palette_tray_(palette_tray) {
     // TODO(tdanderson|jdufault): Use TriView to handle the layout of the title.
     // See crbug.com/614453.
-    auto* box_layout =
-        new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+    auto* box_layout = new views::BoxLayout(views::BoxLayout::kHorizontal);
     SetLayoutManager(box_layout);
 
     auto* title_label =
diff --git a/ash/system/power/power_status_view.cc b/ash/system/power/power_status_view.cc
index 4e3e280..c7e6efe 100644
--- a/ash/system/power/power_status_view.cc
+++ b/ash/system/power/power_status_view.cc
@@ -14,6 +14,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "ui/accessibility/ax_node_data.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
@@ -32,8 +33,9 @@
   separator_label_->SetEnabledColor(kHeaderTextColorNormal);
   separator_label_->SetText(base::ASCIIToUTF16(" - "));
 
-  views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 12, 0, kTrayPopupPaddingBetweenItems);
+  views::BoxLayout* layout =
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(0, 12),
+                           kTrayPopupPaddingBetweenItems);
   SetLayoutManager(layout);
 
   AddChildView(percentage_label_);
diff --git a/ash/system/tiles/tiles_default_view.cc b/ash/system/tiles/tiles_default_view.cc
index 6a47922..4cfe1d2 100644
--- a/ash/system/tiles/tiles_default_view.cc
+++ b/ash/system/tiles/tiles_default_view.cc
@@ -53,7 +53,7 @@
 
 void TilesDefaultView::Init() {
   views::BoxLayout* box_layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 4, 0, 0);
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(0, 4));
   box_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   box_layout->set_cross_axis_alignment(
diff --git a/ash/system/toast/toast_overlay.cc b/ash/system/toast/toast_overlay.cc
index 48d5b92..5190d12 100644
--- a/ash/system/toast/toast_overlay.cc
+++ b/ash/system/toast/toast_overlay.cc
@@ -17,6 +17,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/font_list.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/label_button.h"
 #include "ui/views/controls/label.h"
@@ -146,7 +147,7 @@
     const base::string16& text,
     const base::Optional<base::string16>& dismiss_text)
     : overlay_(overlay) {
-  auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+  auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal);
   SetLayoutManager(layout);
 
   if (dismiss_text.has_value()) {
diff --git a/ash/system/tray/tray_container.cc b/ash/system/tray/tray_container.cc
index 85c513d7..0599aef 100644
--- a/ash/system/tray/tray_container.cc
+++ b/ash/system/tray/tray_container.cc
@@ -68,8 +68,8 @@
   int vertical_margin = cross_axis_margin_;
   if (!is_horizontal)
     std::swap(horizontal_margin, vertical_margin);
-  views::BoxLayout* layout =
-      new views::BoxLayout(orientation, horizontal_margin, vertical_margin, 0);
+  views::BoxLayout* layout = new views::BoxLayout(
+      orientation, gfx::Insets(vertical_margin, horizontal_margin), 0);
 
   layout->set_minimum_cross_axis_size(kTrayItemSize);
   views::View::SetLayoutManager(layout);
diff --git a/ash/system/tray/tray_details_view.cc b/ash/system/tray/tray_details_view.cc
index ac448de..f4507f0 100644
--- a/ash/system/tray/tray_details_view.cc
+++ b/ash/system/tray/tray_details_view.cc
@@ -22,6 +22,7 @@
 #include "ui/compositor/paint_context.h"
 #include "ui/compositor/paint_recorder.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/image/image_skia.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/skia_paint_util.h"
@@ -53,8 +54,7 @@
 class ScrollContentsView : public views::View {
  public:
   ScrollContentsView()
-      : box_layout_(
-            new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)) {
+      : box_layout_(new views::BoxLayout(views::BoxLayout::kVertical)) {
     SetLayoutManager(box_layout_);
   }
   ~ScrollContentsView() override {}
@@ -272,7 +272,7 @@
 
 TrayDetailsView::TrayDetailsView(SystemTrayItem* owner)
     : owner_(owner),
-      box_layout_(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)),
+      box_layout_(new views::BoxLayout(views::BoxLayout::kVertical)),
       scroller_(nullptr),
       scroll_content_(nullptr),
       progress_bar_(nullptr),
diff --git a/ash/system/tray/tray_popup_utils.cc b/ash/system/tray/tray_popup_utils.cc
index 0fdbd9c..6b7c328 100644
--- a/ash/system/tray/tray_popup_utils.cc
+++ b/ash/system/tray/tray_popup_utils.cc
@@ -19,6 +19,7 @@
 #include "base/memory/ptr_util.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
@@ -49,7 +50,8 @@
 std::unique_ptr<views::LayoutManager> CreateDefaultCenterLayoutManager() {
   // TODO(bruthig): Use constants instead of magic numbers.
   auto box_layout = base::MakeUnique<views::BoxLayout>(
-      views::BoxLayout::kVertical, kTrayPopupLabelHorizontalPadding, 8, 0);
+      views::BoxLayout::kVertical,
+      gfx::Insets(8, kTrayPopupLabelHorizontalPadding));
   box_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
   box_layout->set_cross_axis_alignment(
@@ -60,8 +62,8 @@
 // Creates a layout manager that positions Views horizontally. The Views will be
 // centered along the horizontal and vertical axis.
 std::unique_ptr<views::LayoutManager> CreateDefaultEndsLayoutManager() {
-  auto box_layout = base::MakeUnique<views::BoxLayout>(
-      views::BoxLayout::kHorizontal, 0, 0, 0);
+  auto box_layout =
+      base::MakeUnique<views::BoxLayout>(views::BoxLayout::kHorizontal);
   box_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
   box_layout->set_cross_axis_alignment(
diff --git a/ash/system/tray/tri_view.cc b/ash/system/tray/tri_view.cc
index a25ce00..d9d54c4 100644
--- a/ash/system/tray/tri_view.cc
+++ b/ash/system/tray/tri_view.cc
@@ -6,6 +6,7 @@
 
 #include "ash/system/tray/size_range_layout.h"
 #include "base/logging.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/layout/fill_layout.h"
@@ -50,8 +51,7 @@
 
 TriView::TriView(Orientation orientation, int padding_between_containers)
     : box_layout_(new views::BoxLayout(GetOrientation(orientation),
-                                       0,
-                                       0,
+                                       gfx::Insets(),
                                        padding_between_containers)),
       start_container_layout_manager_(new SizeRangeLayout),
       center_container_layout_manager_(new SizeRangeLayout),
diff --git a/ash/system/tray/tri_view_unittest.cc b/ash/system/tray/tri_view_unittest.cc
index ed5b82f0..c949063 100644
--- a/ash/system/tray/tri_view_unittest.cc
+++ b/ash/system/tray/tri_view_unittest.cc
@@ -20,8 +20,8 @@
 // Returns a layout manager that will size views according to their preferred
 // size.
 std::unique_ptr<views::LayoutManager> CreatePreferredSizeLayoutManager() {
-  auto layout = base::MakeUnique<views::BoxLayout>(
-      views::BoxLayout::kHorizontal, 0, 0, 0);
+  auto layout =
+      base::MakeUnique<views::BoxLayout>(views::BoxLayout::kHorizontal);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
   return std::move(layout);
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index 170df54..a1e8761 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -20,6 +20,7 @@
 #include "components/signin/core/account_id/account_id.h"
 #include "components/user_manager/user_info.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/image/image.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/label.h"
@@ -164,7 +165,7 @@
           kTrayLabelItemHorizontalPaddingBottomAlignment));
     }
     layout_view_->SetLayoutManager(new views::BoxLayout(
-        views::BoxLayout::kHorizontal, 0, 0, kUserLabelToIconPadding));
+        views::BoxLayout::kHorizontal, gfx::Insets(), kUserLabelToIconPadding));
   } else {
     if (avatar_) {
       avatar_->SetCornerRadii(0, 0, kTrayRoundedBorderRadius,
@@ -178,7 +179,7 @@
           kTrayLabelItemHorizontalPaddingBottomAlignment));
     }
     layout_view_->SetLayoutManager(new views::BoxLayout(
-        views::BoxLayout::kVertical, 0, 0, kUserLabelToIconPadding));
+        views::BoxLayout::kVertical, gfx::Insets(), kUserLabelToIconPadding));
   }
 }
 
diff --git a/ash/system/user/user_card_view.cc b/ash/system/user/user_card_view.cc
index aa69592..fff6686d 100644
--- a/ash/system/user/user_card_view.cc
+++ b/ash/system/user/user_card_view.cc
@@ -283,8 +283,9 @@
 
 UserCardView::UserCardView(LoginStatus login_status, int user_index)
     : user_index_(user_index) {
-  auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
-                                      kTrayPopupLabelHorizontalPadding);
+  auto* layout =
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
+                           kTrayPopupLabelHorizontalPadding);
   SetLayoutManager(layout);
   layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight);
   layout->set_cross_axis_alignment(
@@ -415,7 +416,7 @@
   AddChildView(stack_of_labels);
   layout->SetFlexForView(stack_of_labels, 1);
   stack_of_labels->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   stack_of_labels->AddChildView(user_name_);
   stack_of_labels->AddChildView(user_email);
   // The name and email have different font sizes. This border is designed
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc
index 9b79b8ca..04b17b6 100644
--- a/ash/system/user/user_view.cc
+++ b/ash/system/user/user_view.cc
@@ -76,7 +76,7 @@
   auto* view = new views::View;
   const int icon_padding = (kMenuButtonSize - kMenuIconSize) / 2;
   auto* layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
                            kTrayPopupLabelHorizontalPadding + icon_padding);
   layout->set_minimum_cross_axis_size(kTrayPopupItemMinHeight);
   view->SetLayoutManager(layout);
@@ -209,7 +209,7 @@
   AddLogoutButton(login);
   AddUserCard(login);
 
-  auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+  auto* layout = new views::BoxLayout(views::BoxLayout::kHorizontal);
   SetLayoutManager(layout);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
@@ -355,7 +355,7 @@
   user_dropdown_padding->SetBorder(views::CreateSolidSidedBorder(
       kMenuSeparatorVerticalPadding - kSeparatorWidth, 0, 0, 0, bg_color));
   user_dropdown_padding->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   views::Separator* separator = new views::Separator();
   separator->SetPreferredHeight(kSeparatorWidth);
   separator->SetColor(
diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc
index dc63d0b8b..5e8ebda 100644
--- a/ash/touch/touch_hud_debug.cc
+++ b/ash/touch/touch_hud_debug.cc
@@ -22,6 +22,7 @@
 #include "ui/events/event.h"
 #include "ui/gfx/animation/animation_delegate.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/geometry/vector2d.h"
 #include "ui/gfx/transform.h"
@@ -335,7 +336,7 @@
 
   label_container_ = new views::View;
   label_container_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
 
   for (int i = 0; i < kMaxTouchPoints; ++i) {
     touch_labels_[i] = new views::Label;
diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc
index 78a978d..76bdee5 100644
--- a/ash/wm/overview/window_selector.cc
+++ b/ash/wm/overview/window_selector.cc
@@ -37,6 +37,7 @@
 #include "ui/display/screen.h"
 #include "ui/events/event.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/skia_util.h"
 #include "ui/vector_icons/vector_icons.h"
@@ -180,8 +181,9 @@
   DCHECK(text_height);
   const int vertical_padding = (params.bounds.height() - text_height) / 2;
   views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, kTextFilterHorizontalPadding,
-      vertical_padding, kTextFilterHorizontalPadding);
+      views::BoxLayout::kHorizontal,
+      gfx::Insets(vertical_padding, kTextFilterHorizontalPadding),
+      kTextFilterHorizontalPadding);
   container->SetLayoutManager(layout);
 
   views::Textfield* textfield = new views::Textfield;
diff --git a/ash/wm/window_cycle_list.cc b/ash/wm/window_cycle_list.cc
index 5047f2c..e5946b5 100644
--- a/ash/wm/window_cycle_list.cc
+++ b/ash/wm/window_cycle_list.cc
@@ -20,6 +20,7 @@
 #include "ui/display/display.h"
 #include "ui/display/screen.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/label.h"
@@ -228,8 +229,8 @@
     const int kInsideBorderPaddingDip = 64;
     const int kBetweenChildPaddingDip = 10;
     views::BoxLayout* layout = new views::BoxLayout(
-        views::BoxLayout::kHorizontal, kInsideBorderPaddingDip,
-        kInsideBorderPaddingDip, kBetweenChildPaddingDip);
+        views::BoxLayout::kHorizontal, gfx::Insets(kInsideBorderPaddingDip),
+        kBetweenChildPaddingDip);
     layout->set_cross_axis_alignment(
         views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
     mirror_container_->SetLayoutManager(layout);
diff --git a/cc/input/input_handler.h b/cc/input/input_handler.h
index 6ffdcce5..4e68a3d 100644
--- a/cc/input/input_handler.h
+++ b/cc/input/input_handler.h
@@ -104,7 +104,7 @@
     NON_BUBBLING_GESTURE
   };
 
-  enum class TouchStartEventListenerType {
+  enum class TouchStartOrMoveEventListenerType {
     NO_HANDLER,
     HANDLER,
     HANDLER_ON_SCROLLING_LAYER
@@ -194,12 +194,13 @@
   virtual EventListenerProperties GetEventListenerProperties(
       EventListenerClass event_class) const = 0;
 
-  // It returns the type of a touch start event listener at |viewport_point|.
-  // Whether the page should be given the opportunity to suppress scrolling by
-  // consuming touch events that started at |viewport_point|, and whether
-  // |viewport_point| is on the currently scrolling layer.
-  virtual TouchStartEventListenerType EventListenerTypeForTouchStartAt(
-      const gfx::Point& viewport_point) = 0;
+  // It returns the type of a touch start or move event listener at
+  // |viewport_point|. Whether the page should be given the opportunity to
+  // suppress scrolling by consuming touch events that started at
+  // |viewport_point|, and whether |viewport_point| is on the currently
+  // scrolling layer.
+  virtual TouchStartOrMoveEventListenerType
+  EventListenerTypeForTouchStartOrMoveAt(const gfx::Point& viewport_point) = 0;
 
   // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped
   // LatencyInfoSwapPromiseMonitor. During the life time of the
diff --git a/cc/layers/painted_scrollbar_layer_impl.cc b/cc/layers/painted_scrollbar_layer_impl.cc
index 3abad0dd..6e6db9f9 100644
--- a/cc/layers/painted_scrollbar_layer_impl.cc
+++ b/cc/layers/painted_scrollbar_layer_impl.cc
@@ -209,4 +209,9 @@
   return "cc::PaintedScrollbarLayerImpl";
 }
 
+LayerTreeSettings::ScrollbarAnimator
+PaintedScrollbarLayerImpl::GetScrollbarAnimator() const {
+  return LayerTreeSettings::NO_ANIMATOR;
+}
+
 }  // namespace cc
diff --git a/cc/layers/painted_scrollbar_layer_impl.h b/cc/layers/painted_scrollbar_layer_impl.h
index 9ff7e89..81b5aa2 100644
--- a/cc/layers/painted_scrollbar_layer_impl.h
+++ b/cc/layers/painted_scrollbar_layer_impl.h
@@ -57,6 +57,8 @@
 
   int ThumbThickness() const override;
 
+  LayerTreeSettings::ScrollbarAnimator GetScrollbarAnimator() const override;
+
  protected:
   PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl,
                             int id,
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index f9b342a..1758c6f 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -265,4 +265,9 @@
   layer_tree_impl()->set_needs_update_draw_properties();
 }
 
+LayerTreeSettings::ScrollbarAnimator
+ScrollbarLayerImplBase::GetScrollbarAnimator() const {
+  return layer_tree_impl()->settings().scrollbar_animator;
+}
+
 }  // namespace cc
diff --git a/cc/layers/scrollbar_layer_impl_base.h b/cc/layers/scrollbar_layer_impl_base.h
index 644557a..91dbebe 100644
--- a/cc/layers/scrollbar_layer_impl_base.h
+++ b/cc/layers/scrollbar_layer_impl_base.h
@@ -11,6 +11,7 @@
 #include "cc/input/scrollbar.h"
 #include "cc/layers/layer.h"
 #include "cc/layers/layer_impl.h"
+#include "cc/trees/layer_tree_settings.h"
 
 namespace cc {
 
@@ -63,6 +64,8 @@
   // on overlay scrollbar layers.
   void SetOverlayScrollbarLayerOpacityAnimated(float opacity);
 
+  virtual LayerTreeSettings::ScrollbarAnimator GetScrollbarAnimator() const;
+
  protected:
   ScrollbarLayerImplBase(LayerTreeImpl* tree_impl,
                          int id,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index a564c78..ff79b257 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -615,8 +615,8 @@
   return false;
 }
 
-InputHandler::TouchStartEventListenerType
-LayerTreeHostImpl::EventListenerTypeForTouchStartAt(
+InputHandler::TouchStartOrMoveEventListenerType
+LayerTreeHostImpl::EventListenerTypeForTouchStartOrMoveAt(
     const gfx::Point& viewport_point) {
   gfx::PointF device_viewport_point = gfx::ScalePoint(
       gfx::PointF(viewport_point), active_tree_->device_scale_factor());
@@ -627,22 +627,22 @@
       active_tree_->FindLayerThatIsHitByPointInTouchHandlerRegion(
           device_viewport_point);
   if (layer_impl_with_touch_handler == NULL)
-    return InputHandler::TouchStartEventListenerType::NO_HANDLER;
+    return InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER;
 
   if (!CurrentlyScrollingNode())
-    return InputHandler::TouchStartEventListenerType::HANDLER;
+    return InputHandler::TouchStartOrMoveEventListenerType::HANDLER;
 
-  // Check if the touch start hits on the current scrolling layer or its
-  // descendant. layer_impl_with_touch_handler is the layer hit by the pointer
-  // and has an event handler, otherwise it is null.
-  // We want to compare the most inner layer we are hitting on which may not
-  // have an event listener with the actual scrolling layer.
+  // Check if the touch start (or move) hits on the current scrolling layer or
+  // its descendant. layer_impl_with_touch_handler is the layer hit by the
+  // pointer and has an event handler, otherwise it is null. We want to compare
+  // the most inner layer we are hitting on which may not have an event listener
+  // with the actual scrolling layer.
   LayerImpl* layer_impl =
       active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
   bool is_ancestor = IsScrolledBy(layer_impl, CurrentlyScrollingNode());
-  return is_ancestor ? InputHandler::TouchStartEventListenerType::
+  return is_ancestor ? InputHandler::TouchStartOrMoveEventListenerType::
                            HANDLER_ON_SCROLLING_LAYER
-                     : InputHandler::TouchStartEventListenerType::HANDLER;
+                     : InputHandler::TouchStartOrMoveEventListenerType::HANDLER;
 }
 
 std::unique_ptr<SwapPromiseMonitor>
@@ -3753,8 +3753,6 @@
 void LayerTreeHostImpl::RegisterScrollbarAnimationController(
     ElementId scroll_element_id,
     float scrollbar_opacity) {
-  if (settings().scrollbar_animator == LayerTreeSettings::NO_ANIMATOR)
-    return;
   if (ScrollbarAnimationControllerForElementId(scroll_element_id))
     return;
 
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 28f58a33..f065db8 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -201,7 +201,8 @@
       InputHandler::ScrollInputType type) const override;
   EventListenerProperties GetEventListenerProperties(
       EventListenerClass event_class) const override;
-  InputHandler::TouchStartEventListenerType EventListenerTypeForTouchStartAt(
+  InputHandler::TouchStartOrMoveEventListenerType
+  EventListenerTypeForTouchStartOrMoveAt(
       const gfx::Point& viewport_port) override;
   std::unique_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor(
       ui::LatencyInfo* latency) override;
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc
index 7122a27..176e8b34 100644
--- a/cc/trees/layer_tree_host_impl_unittest.cc
+++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -967,8 +967,9 @@
 
   // Touch handler regions determine whether touch events block scroll.
   root->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 100, 100));
-  EXPECT_EQ(InputHandler::TouchStartEventListenerType::HANDLER,
-            host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(10, 10)));
+  EXPECT_EQ(
+      InputHandler::TouchStartOrMoveEventListenerType::HANDLER,
+      host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(10, 10)));
 
   // But they don't influence the actual handling of the scroll gestures.
   InputHandler::ScrollStatus status = host_impl_->ScrollBegin(
@@ -978,14 +979,17 @@
             status.main_thread_scrolling_reasons);
   host_impl_->ScrollEnd(EndState().get());
 
-  EXPECT_EQ(InputHandler::TouchStartEventListenerType::HANDLER,
-            host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(10, 30)));
+  EXPECT_EQ(
+      InputHandler::TouchStartOrMoveEventListenerType::HANDLER,
+      host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(10, 30)));
   root->SetTouchEventHandlerRegion(gfx::Rect());
-  EXPECT_EQ(InputHandler::TouchStartEventListenerType::NO_HANDLER,
-            host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(10, 30)));
+  EXPECT_EQ(
+      InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER,
+      host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(10, 30)));
   child->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 50, 50));
-  EXPECT_EQ(InputHandler::TouchStartEventListenerType::HANDLER,
-            host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(10, 30)));
+  EXPECT_EQ(
+      InputHandler::TouchStartOrMoveEventListenerType::HANDLER,
+      host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(10, 30)));
 }
 
 TEST_F(LayerTreeHostImplTest, FlingOnlyWhenScrollingTouchscreen) {
@@ -10527,11 +10531,13 @@
 
   {
     // Touch on a layer which does not have a handler will return kNone.
-    EXPECT_EQ(InputHandler::TouchStartEventListenerType::NO_HANDLER,
-              host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(10, 10)));
+    EXPECT_EQ(
+        InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER,
+        host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(10, 10)));
     child_layer->SetTouchEventHandlerRegion(gfx::Rect(0, 0, 100, 100));
-    EXPECT_EQ(InputHandler::TouchStartEventListenerType::HANDLER,
-              host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(10, 10)));
+    EXPECT_EQ(
+        InputHandler::TouchStartOrMoveEventListenerType::HANDLER,
+        host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(10, 10)));
     // Flinging the grand_child layer.
     EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
               host_impl_
@@ -10545,8 +10551,9 @@
     // Touch on the grand_child layer, which is an active fling layer, the touch
     // event handler will force to be passive.
     EXPECT_EQ(
-        InputHandler::TouchStartEventListenerType::HANDLER_ON_SCROLLING_LAYER,
-        host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(70, 80)));
+        InputHandler::TouchStartOrMoveEventListenerType::
+            HANDLER_ON_SCROLLING_LAYER,
+        host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(70, 80)));
   }
 }
 
@@ -10603,13 +10610,15 @@
     // Touch on the grand_child layer, which is an active fling layer, the touch
     // event handler will force to be passive.
     EXPECT_EQ(
-        InputHandler::TouchStartEventListenerType::HANDLER_ON_SCROLLING_LAYER,
-        host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(70, 80)));
+        InputHandler::TouchStartOrMoveEventListenerType::
+            HANDLER_ON_SCROLLING_LAYER,
+        host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(70, 80)));
     // Touch on the great_grand_child_layer layer, which is the child of the
     // active fling layer, the touch event handler will force to be passive.
     EXPECT_EQ(
-        InputHandler::TouchStartEventListenerType::HANDLER_ON_SCROLLING_LAYER,
-        host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(20, 30)));
+        InputHandler::TouchStartOrMoveEventListenerType::
+            HANDLER_ON_SCROLLING_LAYER,
+        host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(20, 30)));
 
     // Now flinging on the great_grand_child_layer.
     EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD,
@@ -10622,8 +10631,9 @@
     EXPECT_EQ(great_grand_child_layer->scroll_tree_index(),
               host_impl_->CurrentlyScrollingNode()->id);
     // Touch on the child layer, the touch event handler will be blocked.
-    EXPECT_EQ(InputHandler::TouchStartEventListenerType::HANDLER,
-              host_impl_->EventListenerTypeForTouchStartAt(gfx::Point(60, 60)));
+    EXPECT_EQ(
+        InputHandler::TouchStartOrMoveEventListenerType::HANDLER,
+        host_impl_->EventListenerTypeForTouchStartOrMoveAt(gfx::Point(60, 60)));
   }
 }
 
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 4be11db..7ff75e3 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -1693,7 +1693,9 @@
     scrollbar_ids.vertical = scrollbar_layer->id();
   }
 
-  if (IsActiveTree() && scrollbar_layer->is_overlay_scrollbar()) {
+  if (IsActiveTree() && scrollbar_layer->is_overlay_scrollbar() &&
+      scrollbar_layer->GetScrollbarAnimator() !=
+          LayerTreeSettings::NO_ANIMATOR) {
     layer_tree_host_impl_->RegisterScrollbarAnimationController(
         scroll_element_id, scrollbar_layer->Opacity());
   }
diff --git a/chrome/android/java/res/drawable/logo_avatar_anonymous.xml b/chrome/android/java/res/drawable/logo_avatar_anonymous.xml
new file mode 100644
index 0000000..a2ff9d3
--- /dev/null
+++ b/chrome/android/java/res/drawable/logo_avatar_anonymous.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:targetApi="21"
+    android:width="40dp"
+    android:height="40dp"
+    android:viewportWidth="192"
+    android:viewportHeight="192">
+
+    <path
+        android:fillColor="#E0E0E0"
+        android:pathData="M96,0C43.01,0,0,43.01,0,96s43.01,96,96,96s96-43.01,96-96S148.99,0,96,0z" />
+    <path
+        android:fillColor="#BDBDBD"
+        android:pathData="M96,85.09c13.28,0,24-10.72,24-24c0-13.28-10.72-24-24-24s-24,10.72-24,24
+C72,74.37,82.72,85.09,96,85.09z" />
+    <path
+        android:fillColor="#BDBDBD"
+        android:pathData="M96,99.27c-29.33,0-52.36,14.18-52.36,27.27c11.09,17.06,30.51,28.36,52.36,28.36
+s41.27-11.3,52.36-28.36C148.36,113.45,125.33,99.27,96,99.27z" />
+    <path
+        android:pathData="M 0 0 H 192 V 192 H 0 V 0 Z" />
+</vector>
\ No newline at end of file
diff --git a/chrome/android/java/res/layout/payment_request_editor_icons.xml b/chrome/android/java/res/layout/payment_request_editor_icons.xml
index 6af75a9..2d98e4a 100644
--- a/chrome/android/java/res/layout/payment_request_editor_icons.xml
+++ b/chrome/android/java/res/layout/payment_request_editor_icons.xml
@@ -19,11 +19,15 @@
             android:layout_height="wrap_content"
             android:textAppearance="@style/PreferenceFloatLabelTextAppearance" />
 
-    <LinearLayout
+    <org.chromium.chrome.browser.payments.ui.ExpandableGridView
             android:id="@+id/icons_container"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:columnWidth="@dimen/payments_section_logo_width"
             android:layout_marginTop="@dimen/payments_section_small_spacing"
-            android:orientation="horizontal" />
+            android:verticalSpacing="@dimen/payments_section_small_spacing"
+            android:horizontalSpacing="@dimen/payments_section_small_spacing"
+            android:stretchMode="none"
+            android:numColumns="auto_fit" />
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ProfileDataCache.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ProfileDataCache.java
index ba5e5ac..2e68ef5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ProfileDataCache.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ProfileDataCache.java
@@ -7,13 +7,15 @@
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.Bitmap.Config;
-import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.Paint;
 import android.graphics.PorterDuff.Mode;
 import android.graphics.PorterDuffXfermode;
 import android.graphics.Rect;
+import android.graphics.drawable.BitmapDrawable;
+import android.graphics.drawable.Drawable;
+import android.support.v7.content.res.AppCompatResources;
 
 import org.chromium.base.ObserverList;
 import org.chromium.chrome.R;
@@ -29,22 +31,33 @@
  * should be provided by calling {@link #update(List)}
  */
 public class ProfileDataCache implements ProfileDownloader.Observer {
+    /**
+     * Observer to get notifications about changes in profile data.
+     */
+    public interface Observer {
+        /**
+         * Notifies that an account's profile data has been updated.
+         * @param accountId An account ID.
+         */
+        void onProfileDataUpdated(String accountId);
+    }
+
     private static class CacheEntry {
-        public CacheEntry(Bitmap picture, String fullName, String givenName) {
+        public CacheEntry(Drawable picture, String fullName, String givenName) {
             this.picture = picture;
             this.fullName = fullName;
             this.givenName = givenName;
         }
 
-        public Bitmap picture;
+        public Drawable picture;
         public String fullName;
         public String givenName;
     }
 
     private final HashMap<String, CacheEntry> mCacheEntries = new HashMap<>();
 
-    private final Bitmap mPlaceholderImage;
-    private final ObserverList<ProfileDownloader.Observer> mObservers = new ObserverList<>();
+    private final Drawable mPlaceholderImage;
+    private final ObserverList<Observer> mObservers = new ObserverList<>();
 
     private final Context mContext;
     private Profile mProfile;
@@ -53,9 +66,8 @@
         mContext = context;
         mProfile = profile;
 
-        Bitmap placeHolder = BitmapFactory.decodeResource(mContext.getResources(),
-                R.drawable.fre_placeholder);
-        mPlaceholderImage = getCroppedBitmap(placeHolder);
+        mPlaceholderImage =
+                AppCompatResources.getDrawable(context, R.drawable.logo_avatar_anonymous);
 
         ProfileDownloader.addObserver(this);
     }
@@ -80,7 +92,7 @@
      * @return Returns the profile image for a given Google account ID if it's in
      *         the cache, otherwise returns a placeholder image.
      */
-    public Bitmap getImage(String accountId) {
+    public Drawable getImage(String accountId) {
         CacheEntry cacheEntry = mCacheEntries.get(accountId);
         if (cacheEntry == null) return mPlaceholderImage;
         return cacheEntry.picture;
@@ -116,28 +128,28 @@
     /**
      * @param observer Observer that should be notified when new profile images are available.
      */
-    public void addObserver(ProfileDownloader.Observer observer) {
+    public void addObserver(Observer observer) {
         mObservers.addObserver(observer);
     }
 
     /**
      * @param observer Observer that was added by {@link #addObserver} and should be removed.
      */
-    public void removeObserver(ProfileDownloader.Observer observer) {
+    public void removeObserver(Observer observer) {
         mObservers.removeObserver(observer);
     }
 
     @Override
     public void onProfileDownloaded(String accountId, String fullName, String givenName,
             Bitmap bitmap) {
-        bitmap = getCroppedBitmap(bitmap);
-        mCacheEntries.put(accountId, new CacheEntry(bitmap, fullName, givenName));
-        for (ProfileDownloader.Observer observer : mObservers) {
-            observer.onProfileDownloaded(accountId, fullName, givenName, bitmap);
+        Drawable drawable = getCroppedAvatar(bitmap);
+        mCacheEntries.put(accountId, new CacheEntry(drawable, fullName, givenName));
+        for (Observer observer : mObservers) {
+            observer.onProfileDataUpdated(accountId);
         }
     }
 
-    private Bitmap getCroppedBitmap(Bitmap bitmap) {
+    private Drawable getCroppedAvatar(Bitmap bitmap) {
         Bitmap output = Bitmap.createBitmap(
                 bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
         Canvas canvas = new Canvas(output);
@@ -154,6 +166,6 @@
         paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
         canvas.drawBitmap(bitmap, rect, rect, paint);
 
-        return output;
+        return new BitmapDrawable(mContext.getResources(), output);
     }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
index d985e9f8..2181aaeb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
@@ -14,12 +14,16 @@
 import org.chromium.base.VisibleForTesting;
 import org.chromium.base.annotations.CalledByNative;
 import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeActivity;
 import org.chromium.chrome.browser.banners.SwipableOverlayView;
 import org.chromium.chrome.browser.infobar.InfoBarContainerLayout.Item;
 import org.chromium.chrome.browser.snackbar.SnackbarManager;
 import org.chromium.chrome.browser.tab.EmptyTabObserver;
 import org.chromium.chrome.browser.tab.Tab;
 import org.chromium.chrome.browser.tab.TabObserver;
+import org.chromium.chrome.browser.widget.bottomsheet.BottomSheet;
+import org.chromium.chrome.browser.widget.bottomsheet.BottomSheetObserver;
+import org.chromium.chrome.browser.widget.bottomsheet.EmptyBottomSheetObserver;
 import org.chromium.content.browser.ContentViewCore;
 import org.chromium.content_public.browser.WebContents;
 import org.chromium.ui.UiUtils;
@@ -160,6 +164,9 @@
     /** Whether or not another View is occupying the same space as this one. */
     private boolean mIsObscured;
 
+    /** A {@link BottomSheetObserver} so this view knows when to show/hide. */
+    private BottomSheetObserver mBottomSheetObserver;
+
     private final ObserverList<InfoBarContainerObserver> mObservers =
             new ObserverList<InfoBarContainerObserver>();
 
@@ -183,7 +190,6 @@
         setLayoutParams(lp);
 
         mParentView = parentView;
-
         mLayout = new InfoBarContainerLayout(context);
         addView(mLayout, new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                 LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL));
@@ -325,6 +331,9 @@
     }
 
     public void destroy() {
+        if (mBottomSheetObserver != null) {
+            mTab.getActivity().getBottomSheet().removeObserver(mBottomSheetObserver);
+        }
         mLayout.removeAnimationListener(mIPHSupport);
         removeObserver(mIPHSupport);
         mDestroyed = true;
@@ -397,6 +406,20 @@
             setAlpha(0f);
             animate().alpha(1f).setDuration(REATTACH_FADE_IN_MS);
         }
+
+        // Activity is checked first in the following block for tests.
+        ChromeActivity activity = mTab.getActivity();
+        if (activity != null && activity.getBottomSheet() != null && mBottomSheetObserver == null) {
+            mBottomSheetObserver = new EmptyBottomSheetObserver() {
+                @Override
+                public void onSheetStateChanged(int sheetState) {
+                    if (mTab.isHidden()) return;
+                    setVisibility(sheetState == BottomSheet.SHEET_STATE_FULL ? INVISIBLE : VISIBLE);
+                }
+            };
+            activity.getBottomSheet().addObserver(mBottomSheetObserver);
+        }
+
         // Notify observers that the container has attached to the window.
         for (InfoBarContainerObserver observer : mObservers) {
             observer.onInfoBarContainerAttachedToWindow(!mInfoBars.isEmpty());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java
index 86ec7157..df83e7d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java
@@ -9,7 +9,9 @@
 import android.content.DialogInterface;
 import android.content.res.Resources;
 import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
 import android.support.v7.app.AlertDialog;
+import android.support.v7.content.res.AppCompatResources;
 import android.text.SpannableString;
 import android.text.Spanned;
 import android.text.TextUtils;
@@ -119,12 +121,12 @@
                 Credential credential = getItem(position);
 
                 ImageView avatarView = (ImageView) convertView.findViewById(R.id.profile_image);
-                Bitmap avatar = credential.getAvatar();
-                if (avatar != null) {
-                    avatarView.setImageBitmap(avatar);
-                } else {
-                    avatarView.setImageResource(R.drawable.account_management_no_picture);
+                Drawable avatar = credential.getAvatar();
+                if (avatar == null) {
+                    avatar = AppCompatResources.getDrawable(
+                            getContext(), R.drawable.logo_avatar_anonymous);
                 }
+                avatarView.setImageDrawable(avatar);
 
                 TextView mainNameView = (TextView) convertView.findViewById(R.id.main_name);
                 TextView secondaryNameView =
@@ -271,15 +273,15 @@
         if (mIsDestroyed) return;
         assert index >= 0 && index < mCredentials.length;
         assert mCredentials[index] != null;
-        avatarBitmap = AccountManagementFragment.makeRoundUserPicture(avatarBitmap);
-        mCredentials[index].setBitmap(avatarBitmap);
+        Drawable avatar = AccountManagementFragment.makeRoundUserPicture(mContext, avatarBitmap);
+        mCredentials[index].setAvatar(avatar);
         ListView view = mDialog.getListView();
         if (index >= view.getFirstVisiblePosition() && index <= view.getLastVisiblePosition()) {
             // Profile image is in the visible range.
             View credentialView = view.getChildAt(index - view.getFirstVisiblePosition());
             if (credentialView == null) return;
-            ImageView avatar = (ImageView) credentialView.findViewById(R.id.profile_image);
-            avatar.setImageBitmap(avatarBitmap);
+            ImageView avatarView = (ImageView) credentialView.findViewById(R.id.profile_image);
+            avatarView.setImageDrawable(avatar);
         }
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java
index 750bf7b..0745d16 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/password_manager/Credential.java
@@ -4,7 +4,7 @@
 
 package org.chromium.chrome.browser.password_manager;
 
-import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
 
 import org.chromium.base.annotations.CalledByNative;
 
@@ -18,7 +18,7 @@
     private final String mOriginUrl;
     private final String mFederation;
     private final int mIndex;
-    private Bitmap mAvatar;
+    private Drawable mAvatar;
 
     /**
      * @param username username which is used to authenticate user.
@@ -59,11 +59,11 @@
         return mIndex;
     }
 
-    public Bitmap getAvatar() {
+    public Drawable getAvatar() {
         return mAvatar;
     }
 
-    public void setBitmap(Bitmap avatar) {
+    public void setAvatar(Drawable avatar) {
         mAvatar = avatar;
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java
index b9b48d67..def641f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorIconsField.java
@@ -9,14 +9,14 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.view.ViewGroup.LayoutParams;
+import android.widget.BaseAdapter;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.chrome.R;
 
+import java.util.List;
+
 /**
  * Helper class for creating a horizontal list of icons with a title.
  */
@@ -38,29 +38,62 @@
 
         ((TextView) mLayout.findViewById(R.id.label)).setText(fieldModel.getLabel());
 
-        LinearLayout container = (LinearLayout) mLayout.findViewById(R.id.icons_container);
-        int size =
-                context.getResources().getDimensionPixelSize(R.dimen.payments_section_logo_width);
-        int margin = context.getResources().getDimensionPixelSize(
-                R.dimen.payments_section_small_spacing);
-        LinearLayout.LayoutParams layoutParams =
-                new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
-        ApiCompatibilityUtils.setMarginEnd(layoutParams, margin);
-        for (int i = 0; i < fieldModel.getIconResourceIds().size(); i++) {
-            ImageView icon = new ImageView(context);
-            icon.setImageDrawable(AppCompatResources.getDrawable(
-                    context, fieldModel.getIconResourceIds().get(i)));
-            icon.setContentDescription(context.getString(
-                    fieldModel.getIconDescriptionsForAccessibility().get(i)));
-            icon.setAdjustViewBounds(true);
-            icon.setMaxWidth(size);
-            icon.setMaxHeight(size);
-            container.addView(icon, layoutParams);
-        }
+        ExpandableGridView iconsContainer =
+                (ExpandableGridView) mLayout.findViewById(R.id.icons_container);
+        iconsContainer.setAdapter(new IconListAdapter(context, fieldModel.getIconResourceIds(),
+                fieldModel.getIconDescriptionsForAccessibility()));
     }
 
     /** @return The View containing everything. */
     public View getLayout() {
         return mLayout;
     }
+
+    /**
+     * An instance of a {@link BaseAdapter} that provides a list of card icon views.
+     */
+    private static class IconListAdapter extends BaseAdapter {
+        private Context mContext;
+        private List<Integer> mIconResourceIds;
+        private List<Integer> mIconDescriptionIds;
+        private int mIconSize;
+
+        public IconListAdapter(
+                Context context, List<Integer> iconResourceIds, List<Integer> iconDescriptionIds) {
+            mContext = context;
+            mIconResourceIds = iconResourceIds;
+            mIconDescriptionIds = iconDescriptionIds;
+            mIconSize = mContext.getResources().getDimensionPixelSize(
+                    R.dimen.payments_section_logo_width);
+            assert mIconResourceIds.size() == mIconDescriptionIds.size();
+        }
+
+        @Override
+        public int getCount() {
+            return mIconResourceIds.size();
+        }
+
+        @Override
+        public Object getItem(int position) {
+            return mIconResourceIds.get(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            ImageView iconView = (ImageView) convertView;
+            if (iconView == null) iconView = new ImageView(mContext);
+            iconView.setImageDrawable(
+                    AppCompatResources.getDrawable(mContext, mIconResourceIds.get(position)));
+            iconView.setContentDescription(mContext.getString(mIconDescriptionIds.get(position)));
+            iconView.setAdjustViewBounds(true);
+            iconView.setMaxWidth(mIconSize);
+            iconView.setMaxHeight(mIconSize);
+            return iconView;
+        }
+    }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ExpandableGridView.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ExpandableGridView.java
new file mode 100644
index 0000000..5cacde5
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/ExpandableGridView.java
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.payments.ui;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.GridView;
+
+/**
+ * This class is a customized GridView which draws items in multiple lines automatically.
+ */
+public class ExpandableGridView extends GridView {
+    /** Constructor for when the gridview is inflated from XML. */
+    public ExpandableGridView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    @Override
+    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        // GridView does not work well in a ScrollView when it uses WRAP_CONTENT.
+        // Instead, force it to use AT_MOST.
+        // https://stackoverflow.com/questions/4523609/grid-of-images-inside-scrollview
+        final int heightSize = MeasureSpec.getSize(heightMeasureSpec);
+        int heightSpec;
+        if (getLayoutParams().height == LayoutParams.WRAP_CONTENT) {
+            heightSpec = MeasureSpec.makeMeasureSpec(heightSize, MeasureSpec.AT_MOST);
+        } else {
+            heightSpec = heightMeasureSpec;
+        }
+
+        super.onMeasure(widthMeasureSpec, heightSpec);
+    }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java
index a78769f..f0f6c17 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SignInPreference.java
@@ -5,10 +5,9 @@
 package org.chromium.chrome.browser.preferences;
 
 import android.content.Context;
-import android.content.res.Resources;
 import android.graphics.Bitmap;
-import android.graphics.drawable.BitmapDrawable;
 import android.preference.Preference;
+import android.support.v7.content.res.AppCompatResources;
 import android.text.TextUtils;
 import android.util.AttributeSet;
 import android.view.View;
@@ -121,7 +120,7 @@
         setTitle(R.string.sign_in_to_chrome);
         setSummary(R.string.sign_in_to_chrome_summary);
         setFragment(null);
-        setIcon(R.drawable.account_management_no_picture);
+        setIcon(AppCompatResources.getDrawable(getContext(), R.drawable.logo_avatar_anonymous));
         setWidgetLayoutResource(0);
         setViewEnabled(true);
     }
@@ -141,10 +140,7 @@
         setTitle(title);
         setSummary(SyncPreference.getSyncStatusSummary(getContext()));
         setFragment(AccountManagementFragment.class.getName());
-
-        Resources resources = getContext().getResources();
-        Bitmap bitmap = AccountManagementFragment.getUserPicture(accountName, resources);
-        setIcon(new BitmapDrawable(resources, bitmap));
+        setIcon(AccountManagementFragment.getUserPicture(getContext(), accountName));
 
         setWidgetLayoutResource(
                 SyncPreference.showSyncErrorIcon(getContext()) ? R.layout.sync_error_widget : 0);
@@ -187,7 +183,8 @@
     @Override
     public void onProfileDownloaded(String accountId, String fullName, String givenName,
             Bitmap bitmap) {
-        AccountManagementFragment.updateUserNamePictureCache(accountId, fullName, bitmap);
+        AccountManagementFragment.updateUserNamePictureCache(
+                getContext(), accountId, fullName, bitmap);
         update();
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java
index 7716a10..07de6dbc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountManagementFragment.java
@@ -32,6 +32,7 @@
 import android.preference.PreferenceFragment;
 import android.preference.PreferenceScreen;
 import android.support.annotation.Nullable;
+import android.support.v7.content.res.AppCompatResources;
 import android.text.TextUtils;
 import android.util.Pair;
 import android.widget.ListView;
@@ -94,10 +95,10 @@
      */
     private static final String SIGN_OUT_ALLOWED = "auto_signed_in_school_account";
 
-    private static final HashMap<String, Pair<String, Bitmap>> sToNamePicture = new HashMap<>();
+    private static final HashMap<String, Pair<String, Drawable>> sToNamePicture = new HashMap<>();
 
     private static String sChildAccountId;
-    private static Bitmap sCachedBadgedPicture;
+    private static Drawable sCachedBadgedPicture;
 
     public static final String PREF_ACCOUNTS_CATEGORY = "accounts_category";
     public static final String PREF_PARENTAL_SETTINGS = "parental_settings";
@@ -190,6 +191,7 @@
      * Initiate fetching the user accounts data (images and the full name).
      * Fetched data will be sent to observers of ProfileDownloader.
      *
+     * @param context A context to get resources, current theme, etc.
      * @param profile Profile to use.
      */
     private static void startFetchingAccountsInformation(Context context, Profile profile) {
@@ -384,9 +386,8 @@
             ChromeBasePreference pref = new ChromeBasePreference(getActivity());
             pref.setTitle(account.name);
 
-            pref.setIcon(new BitmapDrawable(getResources(),
-                    isChildAccount ? getBadgedUserPicture(account.name, getResources()) :
-                        getUserPicture(account.name, getResources())));
+            pref.setIcon(isChildAccount ? getBadgedUserPicture(getActivity(), account.name)
+                                        : getUserPicture(getActivity(), account.name));
 
             pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                 @Override
@@ -442,7 +443,7 @@
     @Override
     public void onProfileDownloaded(String accountId, String fullName, String givenName,
             Bitmap bitmap) {
-        updateUserNamePictureCache(accountId, fullName, bitmap);
+        updateUserNamePictureCache(getActivity(), accountId, fullName, bitmap);
         updateAccountsList();
     }
 
@@ -557,27 +558,29 @@
 
     /**
      * Converts a square user picture to a round user picture.
+     *
+     * @param context A context to get resources, current theme, etc.
      * @param bitmap A bitmap to convert.
      * @return A rounded picture bitmap.
      */
-    public static Bitmap makeRoundUserPicture(Bitmap bitmap) {
+    public static Drawable makeRoundUserPicture(Context context, Bitmap bitmap) {
         if (bitmap == null) return null;
 
-        Bitmap output = Bitmap.createBitmap(
-                bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
+        int imageSizePx = context.getResources().getDimensionPixelSize(R.dimen.user_picture_size);
+        Bitmap output = Bitmap.createBitmap(imageSizePx, imageSizePx, Config.ARGB_8888);
         Canvas canvas = new Canvas(output);
 
         final Paint paint = new Paint();
-        final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
-
         canvas.drawARGB(0, 0, 0, 0);
         paint.setAntiAlias(true);
         paint.setColor(0xFFFFFFFF);
-        canvas.drawCircle(bitmap.getWidth() * 0.5f, bitmap.getHeight() * 0.5f,
-                bitmap.getWidth() * 0.5f, paint);
+        canvas.drawCircle(imageSizePx * 0.5f, imageSizePx * 0.5f, imageSizePx * 0.5f, paint);
         paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
-        canvas.drawBitmap(bitmap, rect, rect, paint);
-        return output;
+
+        Rect srcRect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
+        Rect dstRect = new Rect(0, 0, imageSizePx, imageSizePx);
+        canvas.drawBitmap(bitmap, srcRect, dstRect, paint);
+        return new BitmapDrawable(context.getResources(), output);
     }
 
     /**
@@ -586,9 +589,9 @@
      * @param badge A bitmap to overlay with.
      * @return A bitmap with the badge overlaying the {@code userPicture}.
      */
-    private static Bitmap overlayChildBadgeOnUserPicture(
-            Bitmap userPicture, Bitmap badge, Resources resources) {
-        assert userPicture.getWidth() == resources.getDimensionPixelSize(R.dimen.user_picture_size);
+    private static Drawable overlayChildBadgeOnUserPicture(
+            Drawable userPicture, Bitmap badge, Resources resources) {
+        int imageSizePx = resources.getDimensionPixelOffset(R.dimen.user_picture_size);
         int borderSize = resources.getDimensionPixelOffset(R.dimen.badge_border_size);
         int badgeRadius = resources.getDimensionPixelOffset(R.dimen.badge_radius);
 
@@ -600,7 +603,8 @@
         Bitmap badgedPicture = Bitmap.createBitmap(badgedPictureWidth, badgedPictureHeight,
                 Bitmap.Config.ARGB_8888);
         Canvas canvas = new Canvas(badgedPicture);
-        canvas.drawBitmap(userPicture, 0, 0, null);
+        userPicture.setBounds(0, 0, imageSizePx, imageSizePx);
+        userPicture.draw(canvas);
 
         // Cut a transparent hole through the background image.
         // This will serve as a border to the badge being overlaid.
@@ -613,20 +617,22 @@
 
         // Draw the badge
         canvas.drawBitmap(badge, badgeCenterX - badgeRadius, badgeCenterY - badgeRadius, null);
-        return badgedPicture;
+        return new BitmapDrawable(resources, badgedPicture);
     }
 
     /**
      * Updates the user name and picture in the cache.
+     *
+     * @param context A context to get resources, current theme, etc.
      * @param accountId User's account id.
      * @param fullName User name.
      * @param bitmap User picture.
      */
     public static void updateUserNamePictureCache(
-            String accountId, String fullName, Bitmap bitmap) {
+            Context context, String accountId, String fullName, Bitmap bitmap) {
         sChildAccountId = null;
         sCachedBadgedPicture = null;
-        sToNamePicture.put(accountId, new Pair<>(fullName, makeRoundUserPicture(bitmap)));
+        sToNamePicture.put(accountId, new Pair<>(fullName, makeRoundUserPicture(context, bitmap)));
     }
 
     /**
@@ -634,7 +640,7 @@
      * @return A cached user name for a given account.
      */
     public static String getCachedUserName(String accountId) {
-        Pair<String, Bitmap> pair = sToNamePicture.get(accountId);
+        Pair<String, Drawable> pair = sToNamePicture.get(accountId);
         return pair != null ? pair.first : null;
     }
 
@@ -642,18 +648,21 @@
      * Gets the user picture for the account from the cache, or returns the default picture if
      * unavailable.
      *
+     * @param context A context to get resources, current theme, etc.
      * @param accountId A child account.
      * @return A user picture with badge for a given child account.
      */
-    public static Bitmap getBadgedUserPicture(String accountId, Resources res) {
+    private static Drawable getBadgedUserPicture(Context context, String accountId) {
         if (sChildAccountId != null) {
             assert TextUtils.equals(accountId, sChildAccountId);
             return sCachedBadgedPicture;
         }
         sChildAccountId = accountId;
-        Bitmap picture = getUserPicture(accountId, res);
-        Bitmap badge = BitmapFactory.decodeResource(res, R.drawable.ic_account_child_20dp);
-        sCachedBadgedPicture = overlayChildBadgeOnUserPicture(picture, badge, res);
+        Drawable picture = getUserPicture(context, accountId);
+        Bitmap badge = BitmapFactory.decodeResource(
+                context.getResources(), R.drawable.ic_account_child_20dp);
+        sCachedBadgedPicture =
+                overlayChildBadgeOnUserPicture(picture, badge, context.getResources());
         return sCachedBadgedPicture;
     }
 
@@ -661,21 +670,24 @@
      * Gets the user picture for the account from the cache, or returns the default picture if
      * unavailable.
      *
-     * @param accountId An account.
-     * @param resources The collection containing the application resources.
+     * @param context A context to get resources, current theme, etc.
+     * @param accountId Name of the account to get picture for.
      * @return A user picture for a given account.
      */
-    public static Bitmap getUserPicture(String accountId, Resources resources) {
-        Pair<String, Bitmap> pair = sToNamePicture.get(accountId);
-        return pair != null ? pair.second : BitmapFactory.decodeResource(resources,
-                R.drawable.account_management_no_picture);
+    public static Drawable getUserPicture(Context context, String accountId) {
+        Pair<String, Drawable> pair = sToNamePicture.get(accountId);
+        return pair != null ? pair.second : getAvatarPlaceholder(context);
+    }
+
+    private static Drawable getAvatarPlaceholder(Context context) {
+        return AppCompatResources.getDrawable(context, R.drawable.logo_avatar_anonymous);
     }
 
     /**
      * Initiate fetching of an image and a picture of a given account. Fetched data will be sent to
      * observers of ProfileDownloader.
      *
-     * @param context A context.
+     * @param context A context to get resources, current theme, etc.
      * @param profile A profile.
      * @param accountName An account name.
      */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java
index 198406f..a385d69d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninChooseView.java
@@ -72,7 +72,7 @@
             // Sets account profile image and name.
             String accountName = accounts.get(i);
             ((ImageView) view.findViewById(R.id.account_image))
-                    .setImageBitmap(profileData.getImage(accountName));
+                    .setImageDrawable(profileData.getImage(accountName));
             ((TextView) view.findViewById(R.id.account_name)).setText(accountName);
 
             view.setOnClickListener(new View.OnClickListener() {
@@ -125,7 +125,7 @@
             String accountEmail =
                     ((TextView) view.findViewById(R.id.account_name)).getText().toString();
             ((ImageView) view.findViewById(R.id.account_image))
-                    .setImageBitmap(profileData.getImage(accountEmail));
+                    .setImageDrawable(profileData.getImage(accountEmail));
         }
     }
 
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 5b5f754f..ab4fba7 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
@@ -7,7 +7,6 @@
 import android.app.Activity;
 import android.app.FragmentManager;
 import android.content.Context;
-import android.graphics.Bitmap;
 import android.os.SystemClock;
 import android.support.v7.app.AlertDialog;
 import android.text.TextUtils;
@@ -29,7 +28,6 @@
 import org.chromium.chrome.browser.externalauth.UserRecoverableErrorHandler;
 import org.chromium.chrome.browser.firstrun.ProfileDataCache;
 import org.chromium.chrome.browser.preferences.PrefServiceBridge;
-import org.chromium.chrome.browser.profiles.ProfileDownloader;
 import org.chromium.chrome.browser.signin.AccountTrackerService.OnSystemAccountsSeededListener;
 import org.chromium.chrome.browser.signin.ConfirmImportSyncDataDialog.ImportSyncType;
 import org.chromium.components.signin.AccountManagerHelper;
@@ -50,8 +48,7 @@
  * {@link AccountSigninView#setDelegate(Delegate)} after the view has been inflated.
  */
 
-public class AccountSigninView extends FrameLayout implements ProfileDownloader.Observer {
-
+public class AccountSigninView extends FrameLayout {
     /**
      * Callbacks for various account selection events.
      */
@@ -147,7 +144,12 @@
     public void init(ProfileDataCache profileData, boolean isChildAccount, String forcedAccountName,
             Delegate delegate, Listener listener) {
         mProfileData = profileData;
-        mProfileData.addObserver(this);
+        mProfileData.addObserver(new ProfileDataCache.Observer() {
+            @Override
+            public void onProfileDataUpdated(String accountId) {
+                updateProfileData();
+            }
+        });
         mIsChildAccount = isChildAccount;
         mForcedAccountName = TextUtils.isEmpty(forcedAccountName) ? null : forcedAccountName;
         mDelegate = delegate;
@@ -368,9 +370,7 @@
         return new AccountSelectionResult(0, false);
     }
 
-    @Override
-    public void onProfileDownloaded(String accountId, String fullName, String givenName,
-            Bitmap bitmap) {
+    public void updateProfileData() {
         mSigninChooseView.updateAccountProfileImages(mProfileData);
 
         if (mSignedIn) updateSignedInAccountInfo();
@@ -378,7 +378,7 @@
 
     private void updateSignedInAccountInfo() {
         String selectedAccountEmail = getSelectedAccountName();
-        mSigninAccountImage.setImageBitmap(mProfileData.getImage(selectedAccountEmail));
+        mSigninAccountImage.setImageDrawable(mProfileData.getImage(selectedAccountEmail));
         String name = null;
         if (mIsChildAccount) name = mProfileData.getGivenName(selectedAccountEmail);
         if (name == null) name = mProfileData.getFullName(selectedAccountEmail);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
index 28e5441..79fce570 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/Snackbar.java
@@ -4,7 +4,7 @@
 
 package org.chromium.chrome.browser.snackbar;
 
-import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
 
 import org.chromium.base.VisibleForTesting;
 import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController;
@@ -67,7 +67,7 @@
     private int mBackgroundColor;
     private boolean mSingleLine = true;
     private int mDurationMs;
-    private Bitmap mProfileImage;
+    private Drawable mProfileImage;
     private int mType;
     private int mIdentifier = UMA_UNKNOWN;
 
@@ -120,7 +120,7 @@
      * If null, there won't be a profile image. The ability to have an icon is exclusive to
      * identity snackbars.
      */
-    public Snackbar setProfileImage(Bitmap profileImage) {
+    public Snackbar setProfileImage(Drawable profileImage) {
         mProfileImage = profileImage;
         return this;
     }
@@ -196,7 +196,7 @@
     /**
      * If method returns null, then no profileImage will be shown in snackbar.
      */
-    Bitmap getProfileImage() {
+    Drawable getProfileImage() {
         return mProfileImage;
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarView.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarView.java
index eb0cd73..5fb75d9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/SnackbarView.java
@@ -9,8 +9,8 @@
 import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
 import android.app.Activity;
-import android.graphics.Bitmap;
 import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
 import android.graphics.drawable.GradientDrawable;
 import android.support.annotation.Nullable;
 import android.view.Gravity;
@@ -233,10 +233,10 @@
         } else {
             mActionButtonView.setVisibility(View.GONE);
         }
-        Bitmap profileImage = snackbar.getProfileImage();
+        Drawable profileImage = snackbar.getProfileImage();
         if (profileImage != null) {
             mProfileImageView.setVisibility(View.VISIBLE);
-            mProfileImageView.setImageBitmap(profileImage);
+            mProfileImageView.setImageDrawable(profileImage);
         } else {
             mProfileImageView.setVisibility(View.GONE);
         }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java
index bc6f562d..2977787 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java
@@ -4,9 +4,9 @@
 
 package org.chromium.chrome.browser.snackbar.smartlockautosignin;
 
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.support.v7.content.res.AppCompatResources;
 
 import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.base.annotations.CalledByNative;
@@ -40,10 +40,10 @@
                 new AutoSigninSnackbarController(snackbarManager, tab);
         Snackbar snackbar = Snackbar.make(text, snackbarController, Snackbar.TYPE_NOTIFICATION,
                 Snackbar.UMA_AUTO_LOGIN);
-        Resources resources = tab.getWindowAndroid().getActivity().get().getResources();
-        int backgroundColor = ApiCompatibilityUtils.getColor(resources, R.color.light_active_color);
-        Bitmap icon = BitmapFactory.decodeResource(
-                resources, R.drawable.account_management_no_picture);
+        Context context = tab.getWindowAndroid().getActivity().get();
+        int backgroundColor =
+                ApiCompatibilityUtils.getColor(context.getResources(), R.color.light_active_color);
+        Drawable icon = AppCompatResources.getDrawable(context, R.drawable.logo_avatar_anonymous);
         snackbar.setSingleLine(false).setBackgroundColor(backgroundColor).setProfileImage(icon);
         snackbarManager.showSnackbar(snackbar);
     }
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index 5a09d694..4649655 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -786,6 +786,7 @@
   "java/src/org/chromium/chrome/browser/payments/ui/EditorModel.java",
   "java/src/org/chromium/chrome/browser/payments/ui/EditorTextField.java",
   "java/src/org/chromium/chrome/browser/payments/ui/EditorDialog.java",
+  "java/src/org/chromium/chrome/browser/payments/ui/ExpandableGridView.java",
   "java/src/org/chromium/chrome/browser/payments/ui/LineItem.java",
   "java/src/org/chromium/chrome/browser/payments/ui/PaymentInformation.java",
   "java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java",
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index 3f0cfaf..5d453a5 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -5649,8 +5649,8 @@
   <message name="IDS_ENTERPRISE_ENROLLMENT_STATUS_NO_MACHINE_IDENTIFICATION" desc="Error message shown on the enrollment screen when the system failed to determine the device model or serial number.">
     Oops!  The system failed to determine device model or serial number.
   </message>
-  <message name="IDS_ENTERPRISE_ENROLLMENT_ERROR_ACTIVE_DIRECTORY_POLICY_FETCH" desc="Error message shown on the enrollment screen when the system failed to fetch device policy from Active Directory.">
-    Oops!  The system failed to fetch policy from Microsoft® Active Directory®.
+  <message name="IDS_ENTERPRISE_ENROLLMENT_ERROR_ACTIVE_DIRECTORY_POLICY_FETCH" desc="Error message shown on the enrollment screen when the system failed to fetch device policy from the local server, e.g. Samba or Active Directory.">
+    Oops!  The system failed to fetch policy for your device.
   </message>
   <message name="IDS_ENTERPRISE_ENROLLMENT_ERROR_SAVE_DEVICE_CONFIGURATION" desc="Error message shown on the enrollment screen when the system failed to save some part of the device configuration. E.g. token from the Device Management server.">
     Oops!  The system failed to save device configuration.
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index a5d48f14..a96cff4 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -13,16 +13,6 @@
         <structure name="IDR_APP_LIST_START_PAGE_HTML" file="resources\app_list\start_page.html" flattenhtml="true" type="chrome_html" />
         <structure name="IDR_APP_LIST_START_PAGE_JS" file="resources\app_list\start_page.js" flattenhtml="true" type="chrome_html" />
       </if>
-      <if expr="is_win">
-        <structure name="IDR_CLEANUP_TOOL_BROWSER_PROXY_HTML" file="resources\cleanup_tool\cleanup_browser_proxy.html" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_BROWSER_PROXY_JS" file="resources\cleanup_tool\cleanup_browser_proxy.js" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_ICONS_HTML" file="resources\cleanup_tool\icons.html" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_MANAGER_HTML" file="resources\cleanup_tool\manager.html" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_MANAGER_JS" file="resources\cleanup_tool\manager.js" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_HTML" file="resources\cleanup_tool\cleanup.html" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_TOOLBAR_HTML" file="resources\cleanup_tool\toolbar.html" type="chrome_html" />
-        <structure name="IDR_CLEANUP_TOOL_TOOLBAR_JS" file="resources\cleanup_tool\toolbar.js" type="chrome_html" />
-      </if>
       <if expr="enable_extensions">
         <structure name="IDR_EXTENSIONS_HTML" file="resources\extensions\extensions.html" flattenhtml="true" type="chrome_html" />
         <structure name="IDR_MD_EXTENSIONS_EXTENSIONS_HTML" file="resources\md_extensions\extensions.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
diff --git a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc
index fed1fc3..077bf5a 100644
--- a/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc
+++ b/chrome/browser/chromeos/extensions/device_local_account_management_policy_provider.cc
@@ -10,6 +10,7 @@
 #include <string>
 
 #include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
 #include "base/values.h"
@@ -18,6 +19,8 @@
 #include "extensions/common/manifest.h"
 #include "extensions/common/manifest_constants.h"
 #include "extensions/common/manifest_handlers/app_isolation_info.h"
+#include "extensions/common/permissions/api_permission.h"
+#include "extensions/common/permissions/permissions_info.h"
 #include "ui/base/l10n/l10n_util.h"
 
 namespace chromeos {
@@ -762,6 +765,17 @@
   return ArrayContainsImpl(char_array, N, entry);
 }
 
+// Helper method used to log extension permissions UMA stats.
+void LogPermissionUmaStats(const std::string& permission_string) {
+  const auto* permission_info =
+      extensions::PermissionsInfo::GetInstance()->GetByName(permission_string);
+  // Not a permission.
+  if (!permission_info) return;
+
+  UMA_HISTOGRAM_SPARSE_SLOWLY("Enterprise.PublicSession.ExtensionPermissions",
+                              permission_info->id());
+}
+
 // Returns true for extensions that are considered safe for Public Sessions,
 // which among other things requires the manifest top-level entries to be
 // contained in the |kSafeManifestEntries| whitelist and all permissions to be
@@ -809,6 +823,8 @@
           }
           for (base::DictionaryValue::Iterator it3(*dict_value);
                !it3.IsAtEnd(); it3.Advance()) {
+            // Log permission (dictionary form).
+            LogPermissionUmaStats(it3.key());
             if (!ArrayContains(kSafePermissionDicts, it3.key())) {
               LOG(ERROR) << extension->id()
                          << " has non-whitelisted dict in permission list: "
@@ -827,6 +843,8 @@
           safe = false;
           continue;
         }
+        // Log permission (usual, string form).
+        LogPermissionUmaStats(permission_string);
         // Accept whitelisted permissions.
         if (ArrayContains(kSafePermissionStrings, permission_string)) {
           continue;
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
index 717e78e..866cd0e 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/automation_predicate.js
@@ -278,7 +278,7 @@
 AutomationPredicate.container = function(node) {
   return AutomationPredicate.match({
     anyRole: [
-      Role.DIV,
+      Role.GENERIC_CONTAINER,
       Role.DOCUMENT,
       Role.GROUP,
       Role.LIST_ITEM,
@@ -372,7 +372,7 @@
   return AutomationPredicate.leaf(node) &&
       (AutomationPredicate.roles([Role.CLIENT,
                                   Role.COLUMN,
-                                  Role.DIV,
+                                  Role.GENERIC_CONTAINER,
                                   Role.GROUP,
                                   Role.IMAGE,
                                   Role.STATIC_TEXT,
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/earcon_engine.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/earcon_engine.js
index ae0d58a..07c3581 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/earcon_engine.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/earcon_engine.js
@@ -175,7 +175,7 @@
   // Decode asynchronously.
   request.onload = (function() {
     this.context_.decodeAudioData(
-        /** @type {ArrayBuffer} */ (request.response),
+        /** @type {!ArrayBuffer} */ (request.response),
         (function(buffer) {
           this.buffers_[name] = buffer;
         }).bind(this));
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
index 5d9e6611..da10040 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -1256,7 +1256,9 @@
           options.annotation.push(token);
           var msg = node.role;
           var info = Output.ROLE_INFO_[node.role];
-          if (info) {
+          if (node.roleDescription) {
+            msg = node.roleDescription;
+          } else if (info) {
             if (this.formatOptions_.braille)
               msg = Msgs.getMsg(info.msgId + '_brl');
             else
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs
index f3c5b83..07ae9313 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output_test.extjs
@@ -771,3 +771,19 @@
           o);
   });
 });
+
+TEST_F('OutputE2ETest', 'RoleDescription', function() {
+  this.runWithLoadedTree(function(root) {/*!
+    <div aria-label="hi" role="button" aria-roledescription="foo"></div>
+  */}, function(root) {
+    var obj = root.find({role: RoleType.BUTTON});
+    var o = new Output().withSpeech(cursors.Range.fromNode(obj));
+    checkSpeechOutput('hi|foo',
+        [
+          {value: 'name', start: 0, end: 2},
+          {value: new Output.EarconAction('BUTTON'), start: 0, end: 2},
+          {value: 'role', start: 3, end: 6}
+        ],
+      o);
+  });
+});
diff --git a/chrome/browser/resources/cleanup_tool/cleanup.html b/chrome/browser/resources/cleanup_tool/cleanup.html
deleted file mode 100644
index 52eabe8..0000000
--- a/chrome/browser/resources/cleanup_tool/cleanup.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!doctype html>
-<html dir="$i18n{textdirection}" lang="$i18n{language}">
-<head>
-  <meta name="google" value="notranslate">
-  <meta charset="utf-8">
-  <title>$i18n{title}</title>
-  <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">
-  <link rel="stylesheet" href="chrome://resources/css/md_colors.css">
-
-  <style>
-    html {
-      --cleanup-card-margin: 25px;
-      --cleanup-card-width: 800px;
-      background: var(--md-background-color);
-    }
-
-    body {
-      margin: 0;
-    }
-  </style>
-</head>
-
-<body>
-  <cleanup-tool-toolbar></cleanup-tool-toolbar>
-  <cleanup-manager></cleanup-manager>
-  <link rel="import" href="chrome://resources/html/cr.html">
-  <link rel="import" href="chrome://resources/html/load_time_data.html">
-  <link rel="import" href="chrome://resources/html/polymer.html">
-  <link rel="import" href="chrome://cleanup/cleanup_browser_proxy.html">
-  <link rel="import" href="chrome://cleanup/icons.html">
-  <link rel="import" href="chrome://cleanup/manager.html">
-  <link rel="import" href="chrome://cleanup/toolbar.html">
-  <script src="strings.js"></script>
-</body>
-
-</html>
diff --git a/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.html b/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.html
deleted file mode 100644
index 8b221d7..0000000
--- a/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<link rel="import" href="chrome://resources/html/cr.html">
-<script src="cleanup_browser_proxy.js"></script>
diff --git a/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js b/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js
deleted file mode 100644
index e9c463d..0000000
--- a/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js
+++ /dev/null
@@ -1,78 +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.
-
-/**
- * @fileoverview Helper object and related behavior that encapsulate messaging
- * between JS and C++ for interacting with the Chrome Cleanup Tool.
- */
-
-/**
- * @typedef {{
- *   hasScanResults: boolean,
- *   isInfected: boolean,
- *   detectionStatusText: string,
- *   detectionTimeText: string,
- * }}
- */
-var LastScanResult;
-
-/**
- * @typedef {{
- *   wasCancelled: boolean,
- *   uwsRemoved: Array<string>,
- *   requiresReboot: boolean,
- * }}
- */
-var CleanupResult;
-
-cr.define('cleanup', function() {
-  /** @interface */
-  function CleanupBrowserProxy() {}
-
-  CleanupBrowserProxy.prototype = {
-    /**
-     * Fetch the result of the latest Chrome Cleanup Tool scanning task.
-     * @return {!Promise<LastScanResult>}
-     */
-    requestLastScanResult: function() {},
-    /**
-     * Attempts to run the Chrome Cleanup Tool in scanning mode.
-     * @return {!Promise<LastScanResult>}
-     */
-    startScan: function() {},
-
-    /**
-     * Opens the prompt to run the Chrome Cleanup Tool.
-     * @return {!Promise<CleanupResult>}
-     */
-    startCleanup: function() {},
-  };
-
-  /**
-   * @constructor
-   * @implements {cleanup.CleanupBrowserProxy}
-   */
-  function CleanupBrowserProxyImpl() {}
-  cr.addSingletonGetter(CleanupBrowserProxyImpl);
-
-  CleanupBrowserProxyImpl.prototype = {
-    /** @override */
-    requestLastScanResult: function() {
-      return cr.sendWithPromise('requestLastScanResult');
-    },
-    /** @override */
-    startScan: function() {
-      return cr.sendWithPromise('startScan');
-    },
-    /** @override */
-    startCleanup: function() {
-      return cr.sendWithPromise('startCleanup');
-    },
-  };
-
-  return {
-    CleanupBrowserProxy: CleanupBrowserProxy,
-    CleanupBrowserProxyImpl: CleanupBrowserProxyImpl,
-  };
-});
diff --git a/chrome/browser/resources/cleanup_tool/compiled_resources2.gyp b/chrome/browser/resources/cleanup_tool/compiled_resources2.gyp
deleted file mode 100644
index 7e5b6af..0000000
--- a/chrome/browser/resources/cleanup_tool/compiled_resources2.gyp
+++ /dev/null
@@ -1,33 +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.
-{
-  'targets': [
-    {
-      'target_name': 'cleanup_browser_proxy',
-      'dependencies': [
-        '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
-      ],
-      'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
-    },
-    {
-      'target_name': 'manager',
-      'dependencies': [
-        '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
-        '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
-        '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
-        '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util',
-        '<(DEPTH)/ui/webui/resources/js/cr/compiled_resources2.gyp:ui',
-        'cleanup_browser_proxy',
-      ],
-      'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
-    },
-    {
-      'target_name': 'toolbar',
-      'dependencies': [
-        '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
-      ],
-      'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
-    },
-  ],
-}
diff --git a/chrome/browser/resources/cleanup_tool/icons.html b/chrome/browser/resources/cleanup_tool/icons.html
deleted file mode 100644
index cbf91f1c..0000000
--- a/chrome/browser/resources/cleanup_tool/icons.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<link rel="import" href="chrome://resources/html/polymer.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-iconset-svg/iron-iconset-svg.html">
-
-<iron-iconset-svg size="24" name="cleanup">
-  <svg>
-    <defs>
-      <!--
-      This icon is not from Polymer's iron-icons; it was manually edited to put
-      an exclamation mark inside of a shield.
-      -->
-      <g id="infected-user"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm1 12h-2V6h2v6zm0 4h-2v-2h2v2z"></path></g>
-      <!--
-      These icons are copied from Polymer's iron-icons and kept in sorted order.
-      See http://goo.gl/Y1OdAq for instructions on adding additional icons.
-      -->
-      <g id="verified-user"><path d="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z"></path></g>
-    </defs>
-  </svg>
-</iron-iconset-svg>
diff --git a/chrome/browser/resources/cleanup_tool/manager.html b/chrome/browser/resources/cleanup_tool/manager.html
deleted file mode 100644
index 769e5cb9..0000000
--- a/chrome/browser/resources/cleanup_tool/manager.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<link rel="import" href="chrome://resources/cr_elements/icons.html">
-<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
-<link rel="import" href="chrome://resources/html/cr.html">
-<link rel="import" href="chrome://resources/html/icon.html">
-<link rel="import" href="chrome://resources/html/polymer.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner.html">
-
-<dom-module id="cleanup-manager">
-  <template>
-    <style>
-      #content {
-        margin: 6px auto;
-        max-width: var(--cleanup-card-width);
-      }
-
-      :host {
-        -webkit-margin-start: 3px;
-        display: block;
-      }
-
-      #cleanup-tool-title {
-        margin: 24px auto 10px;
-      }
-
-      .section-title {
-        color: var(--paper-grey-600);
-        font-size: 13px;
-        font-weight: 500;
-      }
-
-      #card {
-        @apply(--shadow-elevation-2dp);
-        background: white;
-        border-radius: 2px;
-        font-size: 16px;
-        font-weight: 500;
-      }
-
-      .card-section {
-        align-items: center;
-        border-top: 1px solid var(--paper-grey-400);
-        display: flex;
-        min-height: 103px;
-      }
-
-      .card-section:first-child {
-        border-top: none;
-      }
-
-      .icon-wrapper {
-        margin: 0 24px;
-      }
-
-      .clean-icon {
-        color: var(--paper-blue-700);
-      }
-
-      .infected-icon {
-        color: var(--paper-red-700);
-      }
-
-      #status-icon {
-        height: 32px;
-        width: 32px;
-      }
-
-      .scan-details {
-        flex: 1;
-        min-width: 200px;
-      }
-
-      .under-text {
-        color: var(--paper-grey-500);
-      }
-
-      #spinner-container {
-        min-width: 28px;
-      }
-
-      #tool-action-container {
-        color: var(--paper-grey-700);
-        font-size: 18px;
-        padding: 24px;
-      }
-
-      .scan-or-cleanup-action {
-        @apply(--cr-actionable);
-        text-transform: uppercase;
-      }
-
-      #about-link {
-        color: var(--paper-blue-700);
-        padding: 24px;
-        text-decoration: none;
-      }
-    </style>
-
-    <div id="content">
-      <h3 id="cleanup-tool-title" class="section-title">
-        $i18n{sectionHeader}
-      </h3>
-      <div id="card">
-        <div class="card-section">
-          <div id="status-icon-wrapper" class="icon-wrapper">
-            <iron-icon icon="[[getStatusIcon_(hasScanResults, isInfected)]]"
-                class$="[[getIconClassName_(hasScanResults, isInfected)]]"
-                id="status-icon">
-            </iron-icon>
-          </div>
-          <div class="scan-details">
-            <div id="scan-detections">
-              [[detectionStatusText]]
-            </div>
-            <div class="under-text">
-              [[detectionTimeText]]
-            </div>
-          </div>
-          <div id="spinner-container" hidden="[[!isRunning]]">
-            <paper-spinner active></paper-spinner>
-          </div>
-          <div id="tool-action-container">
-            <div class="scan-or-cleanup-action"
-                hidden="[[!shouldShowScan_(hasScanResults, isRunning)]]"
-                on-tap="onScanTap_">$i18n{scanAction}</div>
-            <div hidden="[[!shouldShowScanning_(hasScanResults, isRunning)]]">
-                $i18n{scanning}</div>
-            <div hidden="[[!shouldShowCleaning_(hasScanResults, isRunning)]]">
-                $i18n{cleaning}</div>
-            <div class="scan-or-cleanup-action"
-                hidden="[[!shouldShowClean_(hasScanResults, isRunning)]]"
-                on-tap="onCleanupTap_">$i18n{cleanAction}</div>
-          </div>
-        </div>
-        <div class="card-section">
-          <!-- TODO(proberge): Replace answer ID with a P-link as per
-               crbug.com/679462 -->
-          <a id="about-link"
-              href="https://support.google.com/chrome/answer/6086368">
-            $i18n{about}
-          </a>
-        </div>
-      </div>
-    </div>
-
-  </template>
-  <script src="chrome://cleanup/manager.js"></script>
-</dom-module>
diff --git a/chrome/browser/resources/cleanup_tool/manager.js b/chrome/browser/resources/cleanup_tool/manager.js
deleted file mode 100644
index ce921d61d..0000000
--- a/chrome/browser/resources/cleanup_tool/manager.js
+++ /dev/null
@@ -1,170 +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.
-
-Polymer({
-  is: 'cleanup-manager',
-
-  properties: {
-    hasScanResults: {
-      type: Boolean,
-      value: false,
-    },
-
-    isInfected: {
-      type: Boolean,
-      value: false,
-    },
-
-    isRunning: {
-      type: Boolean,
-      value: false,
-    },
-
-    detectionStatusText: {
-      type: String,
-      value: ""
-    },
-
-    detectionTimeText: {
-      type: String,
-      value: ""
-    },
-
-    /** @private {!cleanup.CleanupBrowserProxy} */
-    browserProxy_: Object,
-  },
-
-  /** @override */
-  attached: function() {
-    // Fetch data to have it displayed as soon as possible.
-    this.requestLastScanResult_();
-  },
-
-  /** @override */
-  created: function() {
-    this.browserProxy_ = cleanup.CleanupBrowserProxyImpl.getInstance();
-  },
-
-  /**
-   * Sends a request for Chrome to start the Cleanup Tool's scanning process.
-   * @private
-   */
-  onScanTap_: function() {
-    this.isRunningScanner = true;
-    this.browserProxy_.startScan().then(this.onScanComplete_.bind(this));
-  },
-
-  /**
-   * @param {LastScanResult} lastScanResults
-   */
-  onScanComplete_: function(lastScanResults) {
-    this.isRunningScanner = false;
-    this.updateLastScanState_(lastScanResults);
-  },
-
-  /**
-   * Sends a request for Chrome to open the Cleanup Tool's cleanup prompt.
-   * @private
-   */
-  onCleanupTap_: function() {
-    this.isRunning = true;
-    this.browserProxy_.startCleanup().then(this.onCleanupResult_.bind(this));
-  },
-
-  /**
-   * @param {CleanupResult} cleanupResults
-   */
-  onCleanupResult_: function(cleanupResults) {
-    this.isRunning = false;
-
-    if (!cleanupResults.wasCancelled)
-      // Assume cleanup was completed and clear infected status.
-      this.isInfected = false;
-
-    // TODO(proberge): Do something about cleanupResults.uwsRemoved.
-  },
-
-  /**
-   * @param {boolean} hasScanResults
-   * @param {boolean} isInfected
-   * @return {string} A class name for icon-specific styling.
-   * @private
-   */
-  getIconClassName_: function(hasScanResults, isInfected) {
-    return hasScanResults && isInfected ? "infected-icon" : "clean-icon";
-  },
-
-  /**
-   * @param {boolean} hasScanResults
-   * @param {boolean} isInfected
-   * @return {string} An icon id. See icons.html.
-   * @private
-   */
-  getStatusIcon_: function(hasScanResults, isInfected) {
-    return hasScanResults && isInfected ?
-        "cleanup:infected-user" :
-        "cleanup:verified-user";
-  },
-
-  /**
-   * @param {boolean} hasScanResults
-   * @param {boolean} isRunning
-   * @return {boolean} Whether the "Scan" button should be displayed.
-   * @private
-   */
-  shouldShowScan_: function(hasScanResults, isRunning) {
-    return !hasScanResults && !isRunning;
-  },
-
-  /**
-   * @param {boolean} hasScanResults
-   * @param {boolean} isRunning
-   * @return {boolean} Whether the "Run Chrome Cleanup" button should be
-   *     displayed.
-   * @private
-   */
-  shouldShowClean_: function(hasScanResults, isRunning) {
-    return hasScanResults && !isRunning;
-  },
-
-  /**
-   * @param {boolean} hasScanResults
-   * @param {boolean} isRunning
-   * @return {boolean} True Whether the "Scanning" label should be displayed.
-   * @private
-   */
-  shouldShowScanning_: function(hasScanResults, isRunning) {
-    return !hasScanResults && isRunning;
-  },
-
-  /**
-   * @param {boolean} hasScanResults
-   * @param {boolean} isRunning
-   * @return {boolean} True Whether the "Cleaning" label should be displayed.
-   * @private
-   */
-  shouldShowCleaning_: function(hasScanResults, isRunning) {
-    return hasScanResults && isRunning;
-  },
-
-  /**
-   * Requests the latest Chrome Cleanup Tool scan results from Chrome, then
-   * updates the local state with the new information.
-   * @private
-   */
-  requestLastScanResult_: function() {
-    this.browserProxy_.requestLastScanResult().then(
-        this.updateLastScanState_.bind(this));
-  },
-
-  /**
-   @param {LastScanResult} lastScanResults
-  */
-  updateLastScanState_: function(lastScanResults) {
-    this.hasScanResults = lastScanResults.hasScanResults;
-    this.isInfected = lastScanResults.hasScanResults;
-    this.detectionStatusText = lastScanResults.detectionStatusText;
-    this.detectionTimeText = lastScanResults.detectionTimeText;
-  }
-});
diff --git a/chrome/browser/resources/cleanup_tool/toolbar.html b/chrome/browser/resources/cleanup_tool/toolbar.html
deleted file mode 100644
index 7180a88..0000000
--- a/chrome/browser/resources/cleanup_tool/toolbar.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<link rel="import" href="chrome://resources/html/assert.html">
-<link rel="import" href="chrome://resources/html/cr.html">
-<link rel="import" href="chrome://resources/html/polymer.html">
-
-<dom-module id="cleanup-tool-toolbar">
-  <template>
-    <style>
-      :host {
-        align-items: center;
-        background: var(--md-toolbar-color);
-        color: white;
-        display: flex;
-        min-height: 56px;
-      }
-
-      #page-title {
-        -webkit-padding-start: 18px;
-        font-size: 123%;
-        overflow: hidden;
-        white-space: nowrap;
-      }
-    </style>
-    <div id="page-title">$i18n{title}</div>
-  </template>
-  <script src="chrome://cleanup/toolbar.js"></script>
-</dom-module>
diff --git a/chrome/browser/resources/cleanup_tool/toolbar.js b/chrome/browser/resources/cleanup_tool/toolbar.js
deleted file mode 100644
index e12d720e..0000000
--- a/chrome/browser/resources/cleanup_tool/toolbar.js
+++ /dev/null
@@ -1,11 +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.
-
-cr.define('cleanup', function() {
-  var Toolbar = Polymer({
-    is: 'cleanup-tool-toolbar',
-  });
-
-  return {Toolbar: Toolbar};
-});
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 167fa80..a02cf3e2 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -3114,10 +3114,6 @@
       "views/settings_reset_prompt_dialog.h",
       "views/uninstall_view.cc",
       "views/uninstall_view.h",
-      "webui/cleanup_tool/cleanup_action_handler.cc",
-      "webui/cleanup_tool/cleanup_action_handler.h",
-      "webui/cleanup_tool/cleanup_tool_ui.cc",
-      "webui/cleanup_tool/cleanup_tool_ui.h",
       "webui/conflicts_handler.cc",
       "webui/conflicts_handler.h",
       "webui/conflicts_ui.cc",
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 23684a2..162acc9 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -279,16 +279,6 @@
     to->insert(to->end(), from.begin(), from.end());
 }
 
-// Prevent profiles created in M56 from seeing Welcome page. See
-// crbug.com/704977.
-// TODO(tmartino): Remove this in ~M60.
-void ProcessErroneousWelcomePagePrefs(Profile* profile) {
-  const std::string kVersionErroneousWelcomeFixed = "58.0.0.0";
-  if (profile->WasCreatedByVersionOrLater(kVersionErroneousWelcomeFixed))
-    return;
-  profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, true);
-}
-
 }  // namespace
 
 namespace internals {
@@ -629,8 +619,6 @@
   if (process_startup && command_line_.HasSwitch(switches::kNoStartupWindow))
     return;
 
-  ProcessErroneousWelcomePagePrefs(profile_);
-
   StartupTabs cmd_line_tabs;
   UrlsToTabs(cmd_line_urls, &cmd_line_tabs);
 
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
index fa269fe7..04e98e4 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -25,6 +25,7 @@
 #include "extensions/browser/extension_registry.h"
 #include "extensions/common/extension.h"
 #include "extensions/common/manifest.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/rect.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/views/border.h"
@@ -113,8 +114,7 @@
                              Profile* profile,
                              const extensions::Extension* app)
     : profile_(profile), app_id_(app->id()) {
-  views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+  views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical);
   SetLayoutManager(layout);
 
   const int kHorizontalSeparatorHeight = 1;
@@ -137,10 +137,7 @@
   const ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   dialog_body_contents->SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kVertical,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL)));
   dialog_body_contents->AddChildView(new AppInfoSummaryPanel(profile, app));
   dialog_body_contents->AddChildView(new AppInfoPermissionsPanel(profile, app));
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
index d7584ee..94aad1a7 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.cc
@@ -15,6 +15,7 @@
 #include "extensions/common/extension.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/events/event.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/button/md_text_button.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/view.h"
@@ -42,10 +43,7 @@
 
   SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kHorizontal,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL)));
 
   LayoutButtons();
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc
index 949b194..2fff981 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.cc
@@ -25,6 +25,7 @@
 #include "net/base/url_util.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/image/image.h"
 #include "ui/gfx/image/image_skia.h"
@@ -53,10 +54,7 @@
 
   SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kHorizontal,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)));
 
   CreateControls();
@@ -76,7 +74,7 @@
   // Create a vertical container to store the app's name and link.
   views::View* vertical_info_container = new views::View();
   views::BoxLayout* vertical_container_layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+      new views::BoxLayout(views::BoxLayout::kVertical);
   vertical_container_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
   vertical_info_container->SetLayoutManager(vertical_container_layout);
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc
index b23dbc0f..4779d8a 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.cc
@@ -8,6 +8,7 @@
 #include "chrome/browser/ui/browser_navigator_params.h"
 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/widget/widget.h"
@@ -46,8 +47,8 @@
 
 views::View* AppInfoPanel::CreateVerticalStack(int child_spacing) const {
   views::View* vertically_stacked_view = new views::View();
-  vertically_stacked_view->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, child_spacing));
+  vertically_stacked_view->SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kVertical, gfx::Insets(), child_spacing));
   return vertically_stacked_view;
 }
 
@@ -58,8 +59,8 @@
 
 views::View* AppInfoPanel::CreateHorizontalStack(int child_spacing) const {
   views::View* vertically_stacked_view = new views::View();
-  vertically_stacked_view->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, child_spacing));
+  vertically_stacked_view->SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kHorizontal, gfx::Insets(), child_spacing));
   return vertically_stacked_view;
 }
 
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
index 18d72ac..7576baa5 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_permissions_panel.cc
@@ -21,6 +21,7 @@
 #include "extensions/common/permissions/permissions_data.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/text_constants.h"
 #include "ui/resources/grit/ui_resources.h"
 #include "ui/views/border.h"
@@ -202,7 +203,7 @@
     const extensions::Extension* app)
     : AppInfoPanel(profile, app) {
   SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(),
                            ChromeLayoutProvider::Get()->GetDistanceMetric(
                                views::DISTANCE_RELATED_CONTROL_VERTICAL)));
 
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
index 908cf5d..1287efa 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
@@ -30,6 +30,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/models/combobox_model.h"
 #include "ui/base/text/bytes_formatting.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/combobox/combobox.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/link.h"
@@ -140,7 +141,7 @@
       launch_options_combobox_(NULL),
       weak_ptr_factory_(this) {
   SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(),
                            ChromeLayoutProvider::Get()->GetDistanceMetric(
                                views::DISTANCE_RELATED_CONTROL_VERTICAL)));
 
@@ -156,7 +157,7 @@
     views::View* vertical_stack) {
   views::View* description_and_labels_stack = new views::View();
   description_and_labels_stack->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(),
                            ChromeLayoutProvider::Get()->GetDistanceMetric(
                                DISTANCE_RELATED_CONTROL_VERTICAL_SMALL)));
 
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc b/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc
index 3c90b3e..77c7212 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/arc_app_info_links_panel.cc
@@ -10,6 +10,7 @@
 #include "chrome/grit/generated_resources.h"
 #include "components/arc/common/app.mojom.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/link.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/view.h"
@@ -24,7 +25,7 @@
       app_list_observer_(this),
       manage_link_(nullptr) {
   SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(),
                            ChromeLayoutProvider::Get()->GetDistanceMetric(
                                views::DISTANCE_RELATED_CONTROL_VERTICAL)));
   manage_link_ = new views::Link(
diff --git a/chrome/browser/ui/views/arc_app_dialog_view.cc b/chrome/browser/ui/views/arc_app_dialog_view.cc
index 9ade66b..ca0c00c7d 100644
--- a/chrome/browser/ui/views/arc_app_dialog_view.cc
+++ b/chrome/browser/ui/views/arc_app_dialog_view.cc
@@ -21,6 +21,7 @@
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/ui_base_types.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/layout/box_layout.h"
@@ -128,10 +129,7 @@
 
   SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kHorizontal,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)));
 
   icon_view_ = new views::ImageView();
@@ -140,7 +138,7 @@
 
   views::View* text_container = new views::View();
   views::BoxLayout* text_container_layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+      new views::BoxLayout(views::BoxLayout::kVertical);
   text_container_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
   text_container_layout->set_cross_axis_alignment(
diff --git a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
index ede410f..e5486c5 100644
--- a/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
+++ b/chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc
@@ -23,6 +23,7 @@
 #include "ui/compositor/compositing_recorder.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/safe_integer_conversions.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/vector_icons/vector_icons.h"
@@ -224,7 +225,7 @@
   // Local storage checkbox and (?) tooltip.
   storage_row_ = new FadeOutView();
   views::BoxLayout* storage_row_layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, kEdgePadding, kEdgePadding, 0);
+      views::BoxLayout::kHorizontal, gfx::Insets(kEdgePadding));
   storage_row_->SetLayoutManager(storage_row_layout);
   storage_row_->SetBorder(
       views::CreateSolidSidedBorder(1, 0, 0, 0, kSubtleBorderColor));
@@ -384,7 +385,7 @@
 
   main_contents_ = new views::View();
   main_contents_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 12));
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(), 12));
   AddChildView(main_contents_);
 
   permanent_error_label_ = new views::Label();
@@ -403,8 +404,8 @@
   main_contents_->AddChildView(permanent_error_label_);
 
   views::View* controls_container = new views::View();
-  controls_container->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, kEdgePadding, 0, 0));
+  controls_container->SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kVertical, gfx::Insets(0, kEdgePadding)));
   main_contents_->AddChildView(controls_container);
 
   instructions_ = new views::Label(controller_->GetInstructionsMessage());
@@ -416,7 +417,7 @@
 
   input_row_ = new views::View();
   input_row_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 5));
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(), 5));
   controls_container->AddChildView(input_row_);
 
   month_input_ = new views::Combobox(&month_combobox_model_);
@@ -446,7 +447,7 @@
 
   views::View* temporary_error = new views::View();
   views::BoxLayout* temporary_error_layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 4);
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(), 4);
   temporary_error->SetLayoutManager(temporary_error_layout);
   temporary_error_layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
@@ -469,7 +470,7 @@
   progress_overlay_ = new FadeOutView();
   progress_overlay_->set_fade_everything(true);
   views::BoxLayout* progress_layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 5);
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(), 5);
   progress_layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
   progress_layout->set_main_axis_alignment(
diff --git a/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc b/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
index c226346..1deca5aa 100644
--- a/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
@@ -13,6 +13,7 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/background.h"
@@ -45,7 +46,7 @@
             const base::string16& generated_password,
             const gfx::FontList& font_list) {
     views::BoxLayout* box_layout = new views::BoxLayout(
-        views::BoxLayout::kVertical, 0, 12, 5);
+        views::BoxLayout::kVertical, gfx::Insets(12, 0), 5);
     box_layout->set_main_axis_alignment(
         views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
     SetLayoutManager(box_layout);
@@ -93,7 +94,7 @@
             const gfx::FontList& font_list) {
     views::BoxLayout* box_layout = new views::BoxLayout(
         views::BoxLayout::kHorizontal,
-        PasswordGenerationPopupController::kHorizontalPadding, 0,
+        gfx::Insets(0, PasswordGenerationPopupController::kHorizontalPadding),
         PasswordGenerationPopupController::kHorizontalPadding);
     box_layout->set_main_axis_alignment(
         views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
diff --git a/chrome/browser/ui/views/autofill/save_card_bubble_views.cc b/chrome/browser/ui/views/autofill/save_card_bubble_views.cc
index 56566fe2..4a3a16c 100644
--- a/chrome/browser/ui/views/autofill/save_card_bubble_views.cc
+++ b/chrome/browser/ui/views/autofill/save_card_bubble_views.cc
@@ -18,6 +18,7 @@
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/bubble/bubble_frame_view.h"
 #include "ui/views/controls/button/blue_button.h"
@@ -85,8 +86,7 @@
 
   // Use BoxLayout to provide insets around the label.
   View* view = new View();
-  view->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+  view->SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical));
 
   // Add a StyledLabel for each line of the legal message.
   for (const LegalMessageLine& line : controller_->GetLegalMessageLines())
@@ -194,13 +194,13 @@
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
 
   view->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0,
+      views::BoxLayout::kVertical, gfx::Insets(),
       provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_VERTICAL)));
 
   // Add the card type icon, last four digits and expiration date.
   views::View* description_view = new views::View();
   description_view->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 0, 0,
+      views::BoxLayout::kHorizontal, gfx::Insets(),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL)));
   view->AddChildView(description_view);
 
@@ -237,7 +237,7 @@
   request_cvc_view->SetBackground(views::CreateThemedSolidBackground(
       request_cvc_view.get(), ui::NativeTheme::kColorId_BubbleBackground));
   views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
                            ChromeLayoutProvider::Get()->GetDistanceMetric(
                                views::DISTANCE_RELATED_BUTTON_HORIZONTAL));
   layout->set_cross_axis_alignment(
@@ -277,7 +277,7 @@
 }
 
 void SaveCardBubbleViews::Init() {
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical));
   view_stack_ = new ViewStack();
   view_stack_->SetBackground(views::CreateThemedSolidBackground(
       view_stack_, ui::NativeTheme::kColorId_BubbleBackground));
diff --git a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc
index 81b1596..46764b9 100644
--- a/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc
+++ b/chrome/browser/ui/views/chrome_cleaner_dialog_win.cc
@@ -12,6 +12,7 @@
 #include "components/constrained_window/constrained_window_views.h"
 #include "ui/base/ui_base_types.h"
 #include "ui/events/event.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/native_widget_types.h"
 #include "ui/gfx/text_constants.h"
 #include "ui/views/controls/button/md_text_button.h"
@@ -44,10 +45,8 @@
   DCHECK(controller_);
 
   SetLayoutManager(new views::BoxLayout(
-      /*orientation=*/views::BoxLayout::kVertical,
-      /*inside_border_horizontal_spacing=*/views::kButtonHEdgeMarginNew,
-      /*inside_border_vertical_spacing=*/views::kPanelVertMargin,
-      /*between_child_spacing=*/0));
+      views::BoxLayout::kVertical,
+      gfx::Insets(views::kPanelVertMargin, views::kButtonHEdgeMarginNew), 0));
   views::Label* label = new views::Label(controller_->GetMainText());
   label->SetMultiLine(true);
   label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
diff --git a/chrome/browser/ui/views/collected_cookies_views.cc b/chrome/browser/ui/views/collected_cookies_views.cc
index 0a13cfd..1ec7339 100644
--- a/chrome/browser/ui/views/collected_cookies_views.cc
+++ b/chrome/browser/ui/views/collected_cookies_views.cc
@@ -38,6 +38,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/color_utils.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/md_text_button.h"
 #include "ui/views/controls/image_view.h"
@@ -144,12 +145,11 @@
   // Initialize contents and layout.
   void Init() {
     AddChildView(content_);
-    content_->SetLayoutManager(
-        new views::BoxLayout(views::BoxLayout::kHorizontal,
-                             kInfobarHorizontalPadding,
-                             kInfobarVerticalPadding,
-                             ChromeLayoutProvider::Get()->GetDistanceMetric(
-                                DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL)));
+    content_->SetLayoutManager(new views::BoxLayout(
+        views::BoxLayout::kHorizontal,
+        gfx::Insets(kInfobarVerticalPadding, kInfobarHorizontalPadding),
+        ChromeLayoutProvider::Get()->GetDistanceMetric(
+            DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL)));
     content_->AddChildView(info_image_);
     content_->AddChildView(label_);
     UpdateVisibility(false, CONTENT_SETTING_BLOCK, base::string16());
diff --git a/chrome/browser/ui/views/conflicting_module_view_win.cc b/chrome/browser/ui/views/conflicting_module_view_win.cc
index 8d1378d..3b5d671 100644
--- a/chrome/browser/ui/views/conflicting_module_view_win.cc
+++ b/chrome/browser/ui/views/conflicting_module_view_win.cc
@@ -22,6 +22,7 @@
 #include "ui/accessibility/ax_node_data.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/layout/box_layout.h"
@@ -137,9 +138,9 @@
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
 
   SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
-      ChromeLayoutProvider::Get()->GetDistanceMetric(
-          DISTANCE_RELATED_LABEL_HORIZONTAL)));
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
+                           ChromeLayoutProvider::Get()->GetDistanceMetric(
+                               DISTANCE_RELATED_LABEL_HORIZONTAL)));
 
   views::ImageView* icon = new views::ImageView();
   icon->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT_MENU));
diff --git a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
index 13758ba..fe21821 100644
--- a/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
+++ b/chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.cc
@@ -24,6 +24,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/button/checkbox.h"
 #include "ui/views/controls/scroll_view.h"
 #include "ui/views/controls/tabbed_pane/tabbed_pane.h"
@@ -67,10 +68,7 @@
 
   SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kVertical,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_VERTICAL_SMALL)));
 
   description_label_->SetMultiLine(true);
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
index 7b76bb7..c573748c 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -39,6 +39,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/text_utils.h"
 #include "ui/native_theme/common_theme.h"
@@ -245,8 +246,8 @@
   if (prompt_->has_webstore_data()) {
     layout->StartRow(0, column_set_id);
     views::View* rating = new views::View();
-    rating->SetLayoutManager(new views::BoxLayout(
-        views::BoxLayout::kHorizontal, 0, 0, 0));
+    rating->SetLayoutManager(
+        new views::BoxLayout(views::BoxLayout::kHorizontal));
     layout->AddView(rating);
     prompt_->AppendRatingStars(AddResourceIcon, rating);
 
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
index 2ed8929a..838d4dd7 100644
--- a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
@@ -31,6 +31,7 @@
 #include "components/bubble/bubble_ui.h"
 #include "extensions/common/extension.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/image/image_skia_operations.h"
 #include "ui/views/bubble/bubble_dialog_delegate.h"
 #include "ui/views/controls/label.h"
@@ -212,7 +213,7 @@
 
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   std::unique_ptr<views::BoxLayout> layout(new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0,
+      views::BoxLayout::kVertical, gfx::Insets(),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)));
   layout->set_minimum_cross_axis_size(kRightColumnWidth);
   // Indent by the size of the icon.
diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
index b8cff76..bd8a0a64 100644
--- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
@@ -20,6 +20,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/compositor/compositor.h"
 #include "ui/compositor/layer.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/button/checkbox.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
@@ -172,10 +173,7 @@
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kHorizontal,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL)));
 
   icon_ = new views::ImageView();
diff --git a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
index 9f92e8e..bb1afe81 100644
--- a/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
+++ b/chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc
@@ -17,6 +17,7 @@
 #include "components/web_modal/web_contents_modal_dialog_manager.h"
 #include "content/public/browser/web_contents.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/checkbox.h"
@@ -130,7 +131,7 @@
       provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_VERTICAL_SMALL);
   ScrollableView* scroll_container = new ScrollableView();
   scroll_container->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0, small_vertical_padding));
+      views::BoxLayout::kVertical, gfx::Insets(), small_vertical_padding));
   scroll_container->SetBorder(
       views::CreateEmptyBorder(vertical_padding, 0, vertical_padding, 0));
 
diff --git a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
index d8ed506..616c5ba 100644
--- a/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
+++ b/chrome/browser/ui/views/extensions/media_gallery_checkbox_view.cc
@@ -7,6 +7,7 @@
 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
 #include "third_party/skia/include/core/SkColor.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/rect.h"
 #include "ui/views/border.h"
 #include "ui/views/context_menu_controller.h"
@@ -28,8 +29,7 @@
     views::ButtonListener* button_listener,
     views::ContextMenuController* menu_controller) {
   DCHECK(button_listener != NULL);
-  SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal));
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   const int border_horiz_margin = provider->GetDistanceMetric(
       views::DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN);
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index c0a768c..49627d7 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -29,6 +29,7 @@
 #include "ui/base/theme_provider.h"
 #include "ui/events/event.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/vector_icons/vector_icons.h"
@@ -167,8 +168,8 @@
   find_text_->SetBorder(views::NullBorder());
 
   views::BoxLayout* manager =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, kInteriorPadding,
-                           kInteriorPadding, kInterChildSpacing);
+      new views::BoxLayout(views::BoxLayout::kHorizontal,
+                           gfx::Insets(kInteriorPadding), kInterChildSpacing);
   SetLayoutManager(manager);
   manager->SetFlexForView(find_text_, 1);
 }
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view.cc b/chrome/browser/ui/views/intent_picker_bubble_view.cc
index 4c6a5a8..1002e7a 100644
--- a/chrome/browser/ui/views/intent_picker_bubble_view.cc
+++ b/chrome/browser/ui/views/intent_picker_bubble_view.cc
@@ -18,6 +18,7 @@
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/animation/ink_drop_host_view.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/image_button.h"
@@ -169,7 +170,7 @@
   // Creates a view to hold the views for each app.
   views::View* scrollable_view = new views::View();
   views::BoxLayout* scrollable_layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+      new views::BoxLayout(views::BoxLayout::kVertical);
   scrollable_view->SetLayoutManager(scrollable_layout);
   for (size_t i = 0; i < app_info_.size(); ++i) {
     IntentPickerLabelButton* app_button = new IntentPickerLabelButton(
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
index c2d8d20..eb4d9d37 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -35,6 +35,7 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/base/ui_features.h"
 #include "ui/gfx/favicon_size.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/text_utils.h"
 #include "ui/gfx/vector_icon_types.h"
 #include "ui/native_theme/native_theme.h"
@@ -266,8 +267,8 @@
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   const int margin =
       provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL);
-  views::BoxLayout* box_layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, margin, 0, margin);
+  views::BoxLayout* box_layout = new views::BoxLayout(
+      views::BoxLayout::kHorizontal, gfx::Insets(0, margin), margin);
 
   box_layout->set_main_axis_alignment(
       views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
diff --git a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
index abdd29e7..38641812 100644
--- a/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info/page_info_bubble_view.cc
@@ -247,7 +247,7 @@
   layout->StartRow(0, label_column_status);
   reset_decisions_label_container_ = new views::View();
   reset_decisions_label_container_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kHorizontal));
   layout->AddView(reset_decisions_label_container_, 1, 1,
                   views::GridLayout::FILL, views::GridLayout::LEADING);
 
@@ -343,8 +343,8 @@
   set_anchor_view_insets(gfx::Insets(
       GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
 
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, kSpacing,
-                                        kSpacing, kSpacing));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
+                                        gfx::Insets(kSpacing), kSpacing));
   set_margins(gfx::Insets());
   if (ChromeLayoutProvider::Get()->ShouldShowWindowIcon()) {
     views::ImageView* icon_view = new NonAccessibleImageView();
@@ -669,7 +669,7 @@
   views::View* link_section = new views::View();
   const int kLinkMarginTop = 4;
   link_section->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 0, kLinkMarginTop, 0));
+      views::BoxLayout::kHorizontal, gfx::Insets(kLinkMarginTop, 0)));
   link_section->AddChildView(site_settings_link);
   site_settings_view_->AddChildView(link_section);
 
@@ -726,8 +726,8 @@
 
 views::View* PageInfoBubbleView::CreateSiteSettingsView(int side_margin) {
   views::View* site_settings_view = new views::View();
-  views::BoxLayout* box_layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, side_margin, 0, 0);
+  views::BoxLayout* box_layout = new views::BoxLayout(
+      views::BoxLayout::kVertical, gfx::Insets(0, side_margin));
   site_settings_view->SetLayoutManager(box_layout);
   box_layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
diff --git a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc
index c601beb..4250a66 100644
--- a/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc
+++ b/chrome/browser/ui/views/passwords/account_chooser_dialog_view.cc
@@ -17,6 +17,7 @@
 #include "content/public/browser/web_contents.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/strings/grit/ui_strings.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/scroll_view.h"
@@ -74,7 +75,7 @@
     net::URLRequestContextGetter* request_context) {
   views::View* list_view = new views::View;
   list_view->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   int item_height = 0;
   for (const auto& form : forms) {
     std::pair<base::string16, base::string16> titles =
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
index 6a2ce102..f6b471d 100644
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -36,6 +36,7 @@
 #include "components/payments/content/payment_request_state.h"
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/controls/button/md_text_button.h"
 #include "ui/views/controls/image_view.h"
@@ -197,8 +198,10 @@
   // the first input field.
   constexpr int kRowBottomPadding = 6;
   views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kVertical, payments::kPaymentRequestRowHorizontalInsets,
-      kRowBottomPadding, kRowVerticalSpacing);
+      views::BoxLayout::kVertical,
+      gfx::Insets(kRowBottomPadding,
+                  payments::kPaymentRequestRowHorizontalInsets),
+      kRowVerticalSpacing);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
@@ -213,7 +216,7 @@
   constexpr int kPaddingBetweenCardIcons = 8;
   std::unique_ptr<views::View> icons_row = base::MakeUnique<views::View>();
   views::BoxLayout* icons_layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 0, 0, kPaddingBetweenCardIcons);
+      views::BoxLayout::kHorizontal, gfx::Insets(), kPaddingBetweenCardIcons);
   icons_row->SetLayoutManager(icons_layout);
 
   std::string selected_network =
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.cc b/chrome/browser/ui/views/payments/editor_view_controller.cc
index 40b4fc8..f302d02 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/editor_view_controller.cc
@@ -51,7 +51,7 @@
   std::unique_ptr<views::View> view = base::MakeUnique<views::View>();
 
   std::unique_ptr<views::BoxLayout> layout =
-      base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0, 0, 0);
+      base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
@@ -151,8 +151,7 @@
 }
 
 void EditorViewController::FillContentView(views::View* content_view) {
-  views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+  views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
diff --git a/chrome/browser/ui/views/payments/error_message_view_controller.cc b/chrome/browser/ui/views/payments/error_message_view_controller.cc
index f12695a..b6b532f 100644
--- a/chrome/browser/ui/views/payments/error_message_view_controller.cc
+++ b/chrome/browser/ui/views/payments/error_message_view_controller.cc
@@ -10,6 +10,7 @@
 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/layout/box_layout.h"
@@ -38,7 +39,8 @@
 
 void ErrorMessageViewController::FillContentView(views::View* content_view) {
   views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kVertical, kPaymentRequestRowHorizontalInsets, 0, 0);
+      views::BoxLayout::kVertical,
+      gfx::Insets(0, kPaymentRequestRowHorizontalInsets), 0);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
diff --git a/chrome/browser/ui/views/payments/order_summary_view_controller.cc b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
index fff3282..42ff50a 100644
--- a/chrome/browser/ui/views/payments/order_summary_view_controller.cc
+++ b/chrome/browser/ui/views/payments/order_summary_view_controller.cc
@@ -19,6 +19,7 @@
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/font.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/md_text_button.h"
 #include "ui/views/controls/label.h"
@@ -150,8 +151,7 @@
 }
 
 void OrderSummaryViewController::FillContentView(views::View* content_view) {
-  views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0, 0);
+  views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
index 99211628..a431d9c1 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -25,6 +25,7 @@
 #include "components/strings/grit/components_strings.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/controls/button/label_button.h"
@@ -103,8 +104,9 @@
     card_info_container->set_can_process_events_within_subtree(false);
 
     std::unique_ptr<views::BoxLayout> box_layout =
-        base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0,
-                                           kPaymentRequestRowVerticalInsets, 0);
+        base::MakeUnique<views::BoxLayout>(
+            views::BoxLayout::kVertical,
+            gfx::Insets(kPaymentRequestRowVerticalInsets, 0));
     box_layout->set_cross_axis_alignment(
         views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
     card_info_container->SetLayoutManager(box_layout.release());
@@ -195,8 +197,9 @@
 PaymentMethodViewController::CreateExtraFooterView() {
   std::unique_ptr<views::View> extra_view = base::MakeUnique<views::View>();
 
-  extra_view->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 0, 0, kPaymentRequestButtonSpacing));
+  extra_view->SetLayoutManager(
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
+                           kPaymentRequestButtonSpacing));
 
   views::LabelButton* button = views::MdTextButton::CreateSecondaryUiButton(
       this, l10n_util::GetStringUTF16(IDS_AUTOFILL_ADD_CREDITCARD_CAPTION));
diff --git a/chrome/browser/ui/views/payments/payment_request_item_list.cc b/chrome/browser/ui/views/payments/payment_request_item_list.cc
index d9cb675..fde62d1 100644
--- a/chrome/browser/ui/views/payments/payment_request_item_list.cc
+++ b/chrome/browser/ui/views/payments/payment_request_item_list.cc
@@ -9,6 +9,7 @@
 #include "chrome/browser/ui/views/payments/payment_request_views_util.h"
 #include "components/payments/content/payment_request_state.h"
 #include "ui/gfx/color_utils.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/vector_icons/vector_icons.h"
 #include "ui/views/controls/button/button.h"
@@ -167,8 +168,9 @@
 std::unique_ptr<views::View> PaymentRequestItemList::CreateListView() {
   std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
 
-  views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, kPaymentRequestRowVerticalInsets, 0);
+  views::BoxLayout* layout =
+      new views::BoxLayout(views::BoxLayout::kVertical,
+                           gfx::Insets(kPaymentRequestRowVerticalInsets, 0), 0);
   content_view->SetLayoutManager(layout);
 
   for (auto& item : items_)
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 c3461f9..ee1f84f 100644
--- a/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_request_sheet_controller.cc
@@ -12,6 +12,7 @@
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/md_text_button.h"
@@ -345,8 +346,9 @@
   std::unique_ptr<views::View> trailing_buttons_container =
       base::MakeUnique<views::View>();
 
-  trailing_buttons_container->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 0, 0, kPaymentRequestButtonSpacing));
+  trailing_buttons_container->SetLayoutManager(
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
+                           kPaymentRequestButtonSpacing));
 
 #if defined(OS_MACOSX)
   AddSecondaryButton(trailing_buttons_container.get());
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 2866859..c8c087e 100644
--- a/chrome/browser/ui/views/payments/payment_request_views_util.cc
+++ b/chrome/browser/ui/views/payments/payment_request_views_util.cc
@@ -60,8 +60,8 @@
                                                  const base::string16& s3,
                                                  bool enabled = true) {
   std::unique_ptr<views::View> container = base::MakeUnique<views::View>();
-  std::unique_ptr<views::BoxLayout> layout =
-      base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0, 0, 0);
+  std::unique_ptr<views::BoxLayout> layout = base::MakeUnique<views::BoxLayout>(
+      views::BoxLayout::kVertical, gfx::Insets(), 0);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
   container->SetLayoutManager(layout.release());
@@ -241,7 +241,7 @@
   std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
 
   views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(), 0);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
@@ -346,8 +346,8 @@
     bool emphasize_label) {
   std::unique_ptr<views::View> container = base::MakeUnique<views::View>();
 
-  std::unique_ptr<views::BoxLayout> layout =
-      base::MakeUnique<views::BoxLayout>(views::BoxLayout::kVertical, 0, 0, 0);
+  std::unique_ptr<views::BoxLayout> layout = base::MakeUnique<views::BoxLayout>(
+      views::BoxLayout::kVertical, gfx::Insets(), 0);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
   container->SetLayoutManager(layout.release());
diff --git a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
index 1bcb9da..cfd81d2 100644
--- a/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_sheet_view_controller.cc
@@ -1,4 +1,4 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -41,6 +41,7 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/color_utils.h"
 #include "ui/gfx/font.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/range/range.h"
 #include "ui/gfx/text_elider.h"
@@ -855,8 +856,9 @@
 
 std::unique_ptr<views::View> PaymentSheetViewController::CreateDataSourceRow() {
   std::unique_ptr<views::View> content_view = base::MakeUnique<views::View>();
-  views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kVertical, kPaymentRequestRowHorizontalInsets, 0, 0);
+  views::BoxLayout* layout =
+      new views::BoxLayout(views::BoxLayout::kVertical,
+                           gfx::Insets(0, kPaymentRequestRowHorizontalInsets));
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
diff --git a/chrome/browser/ui/views/payments/profile_list_view_controller.cc b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
index 3e4b9cb2..e6a9645 100644
--- a/chrome/browser/ui/views/payments/profile_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
@@ -16,6 +16,7 @@
 #include "components/payments/core/strings_util.h"
 #include "components/strings/grit/components_strings.h"
 #include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/vector_icons/vector_icons.h"
@@ -170,7 +171,8 @@
     constexpr int kRowHorizontalSpacing = 8;
     views::BoxLayout* layout = new views::BoxLayout(
         views::BoxLayout::kHorizontal,
-        payments::kPaymentRequestRowHorizontalInsets, 0, kRowHorizontalSpacing);
+        gfx::Insets(0, payments::kPaymentRequestRowHorizontalInsets),
+        kRowHorizontalSpacing);
     layout->set_main_axis_alignment(
         views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
     layout->set_cross_axis_alignment(
@@ -363,8 +365,7 @@
 }
 
 void ProfileListViewController::FillContentView(views::View* content_view) {
-  views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0);
+  views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical);
   layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
@@ -381,8 +382,9 @@
 ProfileListViewController::CreateExtraFooterView() {
   std::unique_ptr<views::View> extra_view = base::MakeUnique<views::View>();
 
-  extra_view->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kHorizontal, 0, 0, kPaymentRequestButtonSpacing));
+  extra_view->SetLayoutManager(
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
+                           kPaymentRequestButtonSpacing));
 
   views::LabelButton* button = views::MdTextButton::CreateSecondaryUiButton(
       this, l10n_util::GetStringUTF16(GetSecondaryButtonTextId()));
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
index c9c7d11..42e5bcf 100644
--- a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
+++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
@@ -26,6 +26,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/text_constants.h"
 #include "ui/views/background.h"
@@ -93,7 +94,7 @@
 
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0,
+      views::BoxLayout::kVertical, gfx::Insets(),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)));
 
   display_origin_ = url_formatter::FormatUrlForSecurityDisplay(
@@ -106,7 +107,7 @@
     int indent =
         provider->GetDistanceMetric(DISTANCE_SUBSECTION_HORIZONTAL_INDENT);
     label_container->SetLayoutManager(new views::BoxLayout(
-        views::BoxLayout::kHorizontal, indent, 0,
+        views::BoxLayout::kHorizontal, gfx::Insets(0, indent),
         provider->GetDistanceMetric(DISTANCE_RELATED_LABEL_HORIZONTAL)));
     views::ImageView* icon = new views::ImageView();
     const gfx::VectorIcon& vector_id = requests[index]->GetIconId();
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 8decabd..bfc03b8 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -61,6 +61,7 @@
 #include "ui/compositor/paint_recorder.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/image/canvas_image_source.h"
 #include "ui/gfx/image/image.h"
 #include "ui/gfx/image/image_skia.h"
@@ -1025,7 +1026,7 @@
   // Sets an overall horizontal layout.
   views::View* view = new views::View();
   views::BoxLayout* layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, kMenuEdgeMargin, kMenuEdgeMargin,
+      views::BoxLayout::kHorizontal, gfx::Insets(kMenuEdgeMargin),
       provider->GetDistanceMetric(DISTANCE_UNRELATED_CONTROL_HORIZONTAL));
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
@@ -1042,7 +1043,7 @@
   const int small_vertical_spacing = provider->GetDistanceMetric(
       DISTANCE_RELATED_CONTROL_VERTICAL_SMALL);
   views::BoxLayout* vertical_layout = new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0, small_vertical_spacing);
+      views::BoxLayout::kVertical, gfx::Insets(), small_vertical_spacing);
   vertical_layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
   vertical_view->SetLayoutManager(vertical_layout);
@@ -1091,8 +1092,8 @@
   views::View* view = new views::View();
   const int vertical_spacing_small =
       provider->GetDistanceMetric(DISTANCE_RELATED_CONTROL_VERTICAL_SMALL);
-  view->SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0,
-                                              vertical_spacing_small, 0));
+  view->SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kVertical, gfx::Insets(vertical_spacing_small, 0), 0));
 
   // Container for the profile photo and avatar/user name.
   BackgroundColorHoverButton* current_profile_card =
@@ -1191,12 +1192,12 @@
       browser_->profile()->GetOriginalProfile());
   if (signin_manager->IsSigninAllowed()) {
     views::View* extra_links_view = new views::View();
-    views::BoxLayout* extra_links_layout =
-        new views::BoxLayout(
-            views::BoxLayout::kVertical, kMenuEdgeMargin,
-            provider->GetDistanceMetric(
-                views::DISTANCE_RELATED_CONTROL_VERTICAL),
-            kMenuEdgeMargin);
+    views::BoxLayout* extra_links_layout = new views::BoxLayout(
+        views::BoxLayout::kVertical,
+        gfx::Insets(provider->GetDistanceMetric(
+                        views::DISTANCE_RELATED_CONTROL_VERTICAL),
+                    kMenuEdgeMargin),
+        kMenuEdgeMargin);
     extra_links_layout->set_cross_axis_alignment(
         views::BoxLayout::CROSS_AXIS_ALIGNMENT_START);
     extra_links_view->SetLayoutManager(extra_links_layout);
diff --git a/chrome/browser/ui/views/settings_reset_prompt_dialog.cc b/chrome/browser/ui/views/settings_reset_prompt_dialog.cc
index d0a498c9..7d26ccc3 100644
--- a/chrome/browser/ui/views/settings_reset_prompt_dialog.cc
+++ b/chrome/browser/ui/views/settings_reset_prompt_dialog.cc
@@ -10,6 +10,7 @@
 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
 #include "components/constrained_window/constrained_window_views.h"
 #include "ui/gfx/font.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/styled_label.h"
 #include "ui/views/layout/box_layout.h"
@@ -43,11 +44,7 @@
 
   SetLayoutManager(new views::BoxLayout(
       views::BoxLayout::kVertical,
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN),
-      0));
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS), 0));
 
   views::StyledLabel* dialog_label =
       new views::StyledLabel(controller_->GetMainText(), /*listener=*/nullptr);
diff --git a/chrome/browser/ui/views/subtle_notification_view.cc b/chrome/browser/ui/views/subtle_notification_view.cc
index 44bc472..879d6d8 100644
--- a/chrome/browser/ui/views/subtle_notification_view.cc
+++ b/chrome/browser/ui/views/subtle_notification_view.cc
@@ -12,6 +12,7 @@
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/font_list.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/bubble/bubble_border.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/link.h"
@@ -76,8 +77,8 @@
     SkColor background_color)
     : foreground_color_(foreground_color), background_color_(background_color) {
   // The |between_child_spacing| is the horizontal margin of the key name.
-  views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kHorizontal,
-                                                  0, 0, kKeyNameMarginHorizPx);
+  views::BoxLayout* layout = new views::BoxLayout(
+      views::BoxLayout::kHorizontal, gfx::Insets(), kKeyNameMarginHorizPx);
   SetLayoutManager(layout);
 
   SetText(text);
@@ -124,7 +125,7 @@
 
   views::View* key = new views::View;
   views::BoxLayout* key_name_layout = new views::BoxLayout(
-      views::BoxLayout::kHorizontal, kKeyNamePaddingPx, 0, 0);
+      views::BoxLayout::kHorizontal, gfx::Insets(0, kKeyNamePaddingPx), 0);
   key_name_layout->set_minimum_cross_axis_size(
       label->GetPreferredSize().height() + kKeyNamePaddingPx * 2);
   key->SetLayoutManager(key_name_layout);
@@ -164,9 +165,9 @@
   AddChildView(instruction_view_);
   AddChildView(link_);
 
-  views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, outer_padding_horiz,
-                           outer_padding_vert, kMiddlePaddingPx);
+  views::BoxLayout* layout = new views::BoxLayout(
+      views::BoxLayout::kHorizontal,
+      gfx::Insets(outer_padding_vert, outer_padding_horiz), kMiddlePaddingPx);
   SetLayoutManager(layout);
 }
 
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
index 2f59d3d..f0828a9 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.cc
@@ -9,6 +9,7 @@
 #include "chrome/grit/locale_settings.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/color_palette.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/views/controls/button/label_button.h"
 #include "ui/views/controls/image_view.h"
@@ -74,7 +75,7 @@
   if (icon && label) {
     views::View* parent = new views::View();
     parent->SetLayoutManager(
-        new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0,
+        new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
                              ChromeLayoutProvider::Get()->GetDistanceMetric(
                                  views::DISTANCE_RELATED_CONTROL_VERTICAL)));
     parent->AddChildView(icon.release());
@@ -119,7 +120,7 @@
 void ToolbarActionsBarBubbleViews::Init() {
   ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0,
+      views::BoxLayout::kVertical, gfx::Insets(),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)));
 
   // Add the content string.
diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc
index 4f5f3af2..ac62eaa 100644
--- a/chrome/browser/ui/views/translate/translate_bubble_view.cc
+++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc
@@ -37,6 +37,7 @@
 #include "ui/base/models/combobox_model.h"
 #include "ui/base/models/simple_combobox_model.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/bubble/bubble_frame_view.h"
 #include "ui/views/controls/button/blue_button.h"
 #include "ui/views/controls/button/checkbox.h"
@@ -162,7 +163,7 @@
 }
 
 void TranslateBubbleView::Init() {
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical));
 
   should_always_translate_ = model_->ShouldAlwaysTranslate();
   if (Use2016Q2UI() && !is_in_incognito_window_) {
diff --git a/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc b/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc
index 7c479a6..b793422 100644
--- a/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc
+++ b/chrome/browser/ui/views/webshare/webshare_target_picker_view.cc
@@ -11,6 +11,7 @@
 #include "components/constrained_window/constrained_window_views.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/models/table_model.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/native_widget_types.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/table/table_view.h"
@@ -83,10 +84,7 @@
   const ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
   views::BoxLayout* layout = new views::BoxLayout(
       views::BoxLayout::kVertical,
-      provider->GetDistanceMetric(
-          views::DISTANCE_BUBBLE_CONTENTS_HORIZONTAL_MARGIN),
-      provider->GetDistanceMetric(
-          views::DISTANCE_BUBBLE_CONTENTS_VERTICAL_MARGIN),
+      provider->GetInsetsMetric(views::INSETS_DIALOG_CONTENTS),
       provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL));
   SetLayoutManager(layout);
 
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index ad04d3c..24a950d 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -171,7 +171,6 @@
 #endif
 
 #if defined(OS_WIN)
-#include "chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h"
 #include "chrome/browser/ui/webui/conflicts_ui.h"
 #include "chrome/browser/ui/webui/set_as_default_browser_ui_win.h"
 #include "chrome/browser/ui/webui/welcome_win10_ui.h"
@@ -457,9 +456,6 @@
     return &NewWebUI<UberUI>;
 #endif  // !defined(OS_ANDROID)
 #if defined(OS_WIN)
-  if (base::FeatureList::IsEnabled(features::kCleanupToolUI) &&
-      url.host_piece() == chrome::kChromeUICleanupToolHost)
-    return &NewWebUI<CleanupToolUI>;
   if (url.host_piece() == chrome::kChromeUIConflictsHost)
     return &NewWebUI<ConflictsUI>;
   if (url.host_piece() == chrome::kChromeUIMetroFlowHost)
diff --git a/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc b/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc
deleted file mode 100644
index d1e6bacc..0000000
--- a/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc
+++ /dev/null
@@ -1,139 +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.
-
-#include "chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h"
-
-#include "base/bind.h"
-#include "base/values.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/component_updater/sw_reporter_installer_win.h"
-#include "components/component_updater/component_updater_service.h"
-
-namespace {
-
-bool IsCleanupComponentRegistered() {
-  component_updater::ComponentUpdateService* cus =
-      g_browser_process->component_updater();
-  std::vector<std::string> component_ids = cus->GetComponentIDs();
-
-  return std::find(component_ids.begin(), component_ids.end(),
-                   component_updater::kSwReporterComponentId) !=
-         component_ids.end();
-}
-
-// TODO(proberge): Connect this to the Cleanup Tool manager class once that's
-// implemented.
-void StartScan(base::Closure callback) {
-  callback.Run();
-}
-
-// TODO(proberge): Connect this to the Cleanup Tool manager class once that's
-// implemented.
-void StartCleanup(base::Closure callback) {
-  callback.Run();
-}
-
-// TODO(proberge): Localize strings once they are finalized.
-constexpr char kDetectionOkText[] = "No problems detected";
-constexpr char kDetectionUwSText[] = "2 potentially harmful programs detected";
-constexpr char kDetectionTimeText[] = "Last scanned today";
-constexpr char kCleanupUnsupportedText[] = "Chrome Cleanup is not supported.";
-constexpr char kUnsupportedHelpText[] = "Please try reinstalling Chrome";
-
-}  // namespace
-
-CleanupActionHandler::CleanupActionHandler()
-    : callback_weak_ptr_factory_(this) {}
-
-CleanupActionHandler::~CleanupActionHandler() {}
-
-void CleanupActionHandler::RegisterMessages() {
-  web_ui()->RegisterMessageCallback(
-      "requestLastScanResult",
-      base::Bind(&CleanupActionHandler::HandleRequestLastScanResult,
-                 base::Unretained(this)));
-  web_ui()->RegisterMessageCallback(
-      "startScan", base::Bind(&CleanupActionHandler::HandleStartScan,
-                              base::Unretained(this)));
-  web_ui()->RegisterMessageCallback(
-      "startCleanup", base::Bind(&CleanupActionHandler::HandleStartCleanup,
-                                 base::Unretained(this)));
-}
-
-void CleanupActionHandler::OnJavascriptDisallowed() {
-  callback_weak_ptr_factory_.InvalidateWeakPtrs();
-}
-
-void CleanupActionHandler::HandleRequestLastScanResult(
-    const base::ListValue* args) {
-  CHECK_EQ(1U, args->GetSize());
-  std::string webui_callback_id;
-  bool success = args->GetString(0, &webui_callback_id);
-  DCHECK(success);
-
-  base::DictionaryValue last_scan_results;
-  // TODO(proberge): Return real information about the last run.
-  last_scan_results.SetBoolean("hasScanResults", false);
-  last_scan_results.SetBoolean("isInfected", false);
-  last_scan_results.SetString("detectionStatusText", kDetectionOkText);
-  last_scan_results.SetString("detectionTimeText", kDetectionTimeText);
-
-  AllowJavascript();
-  ResolveJavascriptCallback(base::Value(webui_callback_id), last_scan_results);
-}
-
-void CleanupActionHandler::HandleStartScan(const base::ListValue* args) {
-  std::string webui_callback_id;
-  CHECK_EQ(1U, args->GetSize());
-  bool success = args->GetString(0, &webui_callback_id);
-  DCHECK(success);
-
-  if (!IsCleanupComponentRegistered()) {
-    base::DictionaryValue scan_results;
-    scan_results.SetBoolean("hasScanResults", false);
-    scan_results.SetBoolean("isInfected", false);
-    scan_results.SetString("detectionStatusText", kCleanupUnsupportedText);
-    scan_results.SetString("detectionTimeText", kUnsupportedHelpText);
-
-    AllowJavascript();
-    ResolveJavascriptCallback(base::Value(webui_callback_id), scan_results);
-    return;
-  }
-
-  StartScan(base::Bind(&CleanupActionHandler::ReportScanResults,
-                       callback_weak_ptr_factory_.GetWeakPtr(),
-                       webui_callback_id));
-}
-
-void CleanupActionHandler::ReportScanResults(const std::string& callback_id) {
-  base::DictionaryValue scan_results;
-  // TODO(proberge): Return real information about the scan.
-  scan_results.SetBoolean("hasScanResults", true);
-  scan_results.SetBoolean("isInfected", true);
-  scan_results.SetString("detectionStatusText", kDetectionUwSText);
-  scan_results.SetString("detectionTimeText", kDetectionTimeText);
-
-  AllowJavascript();
-  ResolveJavascriptCallback(base::Value(callback_id), scan_results);
-}
-
-void CleanupActionHandler::HandleStartCleanup(const base::ListValue* args) {
-  CHECK_EQ(1U, args->GetSize());
-  std::string webui_callback_id;
-  bool success = args->GetString(0, &webui_callback_id);
-  DCHECK(success);
-
-  StartCleanup(base::Bind(&CleanupActionHandler::ReportCleanupResults,
-                          base::Unretained(this), webui_callback_id));
-}
-
-void CleanupActionHandler::ReportCleanupResults(
-    const std::string& callback_id) {
-  base::DictionaryValue cleanup_results;
-  // TODO(proberge): Return real information about the cleanup.
-  cleanup_results.SetBoolean("wasCancelled", true);
-  cleanup_results.SetBoolean("requiresReboot", false);
-
-  ResolveJavascriptCallback(base::Value(callback_id), cleanup_results);
-}
diff --git a/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h b/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h
deleted file mode 100644
index 97c87f0..0000000
--- a/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h
+++ /dev/null
@@ -1,44 +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 CHROME_BROWSER_UI_WEBUI_CLEANUP_TOOL_CLEANUP_ACTION_HANDLER_H_
-#define CHROME_BROWSER_UI_WEBUI_CLEANUP_TOOL_CLEANUP_ACTION_HANDLER_H_
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "content/public/browser/web_ui_message_handler.h"
-
-// The handler for Javascript messages related to the "Chrome Cleanup" view.
-class CleanupActionHandler : public content::WebUIMessageHandler {
- public:
-  CleanupActionHandler();
-  ~CleanupActionHandler() override;
-
-  // WebUIMessageHandler implementation.
-  void RegisterMessages() override;
-
- private:
-  // Invalidates the weak pointers in callbacks that are no longer safe to run.
-  void OnJavascriptDisallowed() override;
-
-  void HandleRequestLastScanResult(const base::ListValue* args);
-  void HandleStartScan(const base::ListValue* args);
-  void HandleStartCleanup(const base::ListValue* args);
-
-  // Returns the scan result initiated by HandleStartScan() to the Javascript
-  // caller refererenced by |callback_id|.
-  void ReportScanResults(const std::string& callback_id);
-
-  // Returns the cleanup result initiated by HandleStartCleanup() to the
-  // Javascript caller refererenced by |callback_id|.
-  void ReportCleanupResults(const std::string& callback_id);
-
-  // Used to cancel callbacks when JavaScript becomes disallowed.
-  base::WeakPtrFactory<CleanupActionHandler> callback_weak_ptr_factory_;
-
-  DISALLOW_COPY_AND_ASSIGN(CleanupActionHandler);
-};
-
-#endif  // CHROME_BROWSER_UI_WEBUI_CLEANUP_TOOL_CLEANUP_ACTION_HANDLER_H_
diff --git a/chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.cc b/chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.cc
deleted file mode 100644
index c227104..0000000
--- a/chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.cc
+++ /dev/null
@@ -1,46 +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.
-
-#include "chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h"
-
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h"
-#include "chrome/common/url_constants.h"
-#include "chrome/grit/browser_resources.h"
-#include "content/public/browser/web_ui_data_source.h"
-
-CleanupToolUI::CleanupToolUI(content::WebUI* web_ui)
-    : content::WebUIController(web_ui) {
-  content::WebUIDataSource* html_source =
-      content::WebUIDataSource::Create(chrome::kChromeUICleanupToolHost);
-
-  // TODO(proberge): Localize strings once they are finalized.
-  html_source->AddString("title", "Chrome Cleanup");
-  html_source->AddString("sectionHeader",
-                         "Remove suspicious or unwanted programs");
-  html_source->AddString("scanAction", "Scan Now");
-  html_source->AddString("cleaning", "Cleaning");
-  html_source->AddString("scanning", "Scanning");
-  html_source->AddString("cleanAction", "Run Chrome Cleanup");
-  html_source->AddString("about", "About Chrome Cleanup");
-  html_source->SetJsonPath("strings.js");
-
-  html_source->AddResourcePath("cleanup_browser_proxy.html",
-                               IDR_CLEANUP_TOOL_BROWSER_PROXY_HTML);
-  html_source->AddResourcePath("cleanup_browser_proxy.js",
-                               IDR_CLEANUP_TOOL_BROWSER_PROXY_JS);
-  html_source->AddResourcePath("icons.html", IDR_CLEANUP_TOOL_ICONS_HTML);
-  html_source->AddResourcePath("manager.html", IDR_CLEANUP_TOOL_MANAGER_HTML);
-  html_source->AddResourcePath("manager.js", IDR_CLEANUP_TOOL_MANAGER_JS);
-  html_source->AddResourcePath("toolbar.html", IDR_CLEANUP_TOOL_TOOLBAR_HTML);
-  html_source->AddResourcePath("toolbar.js", IDR_CLEANUP_TOOL_TOOLBAR_JS);
-  html_source->SetDefaultResource(IDR_CLEANUP_TOOL_HTML);
-
-  Profile* profile = Profile::FromWebUI(web_ui);
-  content::WebUIDataSource::Add(profile, html_source);
-
-  web_ui->AddMessageHandler(base::MakeUnique<CleanupActionHandler>());
-}
-
-CleanupToolUI::~CleanupToolUI() {}
diff --git a/chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h b/chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h
deleted file mode 100644
index c5d2871d..0000000
--- a/chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h
+++ /dev/null
@@ -1,23 +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 CHROME_BROWSER_UI_WEBUI_CLEANUP_TOOL_CLEANUP_TOOL_UI_H_
-#define CHROME_BROWSER_UI_WEBUI_CLEANUP_TOOL_CLEANUP_TOOL_UI_H_
-
-#include "base/macros.h"
-#include "content/public/browser/web_ui_controller.h"
-
-// The UI for chrome://cleanup, which will allow Windows users to see the
-// status of the last Chrome Cleanup Tool scan and to manually launch the
-// cleanup process.
-class CleanupToolUI : public content::WebUIController {
- public:
-  explicit CleanupToolUI(content::WebUI* web_ui);
-  ~CleanupToolUI() override;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(CleanupToolUI);
-};
-
-#endif  // CHROME_BROWSER_UI_WEBUI_CLEANUP_TOOL_CLEANUP_TOOL_UI_H_
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
index d6efa416..b70aa57 100644
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -103,11 +103,6 @@
 const base::Feature kCheckInstallabilityForBannerOnLoad{
     "CheckInstallabilityForBannerOnLoad", base::FEATURE_DISABLED_BY_DEFAULT};
 
-#if defined(OS_WIN)
-const base::Feature kCleanupToolUI{"CleanupToolUI",
-                                   base::FEATURE_DISABLED_BY_DEFAULT};
-#endif
-
 #if defined(OS_ANDROID)
 // Experiment to make Geolocation permissions in the omnibox and the default
 // search engine's search page consistent.
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h
index ede452d8..471c1b5 100644
--- a/chrome/common/chrome_features.h
+++ b/chrome/common/chrome_features.h
@@ -60,10 +60,6 @@
 
 extern const base::Feature kCheckInstallabilityForBannerOnLoad;
 
-#if defined(OS_WIN)
-extern const base::Feature kCleanupToolUI;
-#endif
-
 #if defined(OS_ANDROID)
 extern const base::Feature kConsistentOmniboxGeolocation;
 #endif
diff --git a/chrome/common/extensions/api/automation.idl b/chrome/common/extensions/api/automation.idl
index c01f356..56b61ba 100644
--- a/chrome/common/extensions/api/automation.idl
+++ b/chrome/common/extensions/api/automation.idl
@@ -398,6 +398,9 @@
     // The placeholder for this text field, if any.
     DOMString? placeholder;
 
+    // The role description for this node.
+    DOMString? roleDescription;
+
     // The accessible name for this node, via the
     // <a href="http://www.w3.org/TR/wai-aria/roles#namecalculation">
     // Accessible Name Calculation</a> process.
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index 82bd662..9a03682c 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -142,7 +142,6 @@
 #endif  // defined(OS_CHROMEOS)
 
 #if defined(OS_WIN)
-const char kChromeUICleanupToolURL[] = "chrome://cleanup/";
 const char kChromeUIMetroFlowURL[] = "chrome://make-metro/";
 #endif
 
@@ -333,7 +332,6 @@
 #endif  // defined(OS_CHROMEOS)
 
 #if defined(OS_WIN)
-const char kChromeUICleanupToolHost[] = "cleanup";
 const char kChromeUIMetroFlowHost[] = "make-metro";
 #endif
 
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index a9f875a..d422894 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -128,7 +128,6 @@
 #endif  // defined(OS_CHROMEOS)
 
 #if defined(OS_WIN)
-extern const char kChromeUICleanupToolURL[];
 extern const char kChromeUIMetroFlowURL[];
 #endif
 
@@ -312,7 +311,6 @@
 #endif  // defined(OS_CHROMEOS)
 
 #if defined(OS_WIN)
-extern const char kChromeUICleanupToolHost[];
 extern const char kChromeUIMetroFlowHost[];
 #endif
 
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js
index a960f732..95924e76 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -711,6 +711,7 @@
     'liveStatus',
     'name',
     'placeholder',
+    'roleDescription',
     'textInputType',
     'url',
     'value'];
diff --git a/components/exo/display.cc b/components/exo/display.cc
index 7e38bb4..a42d10e 100644
--- a/components/exo/display.cc
+++ b/components/exo/display.cc
@@ -216,18 +216,18 @@
 
 std::unique_ptr<NotificationSurface> Display::CreateNotificationSurface(
     Surface* surface,
-    const std::string& notification_id) {
+    const std::string& notification_key) {
   TRACE_EVENT2("exo", "Display::CreateNotificationSurface", "surface",
-               surface->AsTracedValue(), "notification_id", notification_id);
+               surface->AsTracedValue(), "notification_key", notification_key);
 
   if (!notification_surface_manager_ ||
-      notification_surface_manager_->GetSurface(notification_id)) {
-    DLOG(ERROR) << "Invalid notification id, id=" << notification_id;
+      notification_surface_manager_->GetSurface(notification_key)) {
+    DLOG(ERROR) << "Invalid notification key, key=" << notification_key;
     return nullptr;
   }
 
   return base::MakeUnique<NotificationSurface>(notification_surface_manager_,
-                                               surface, notification_id);
+                                               surface, notification_key);
 }
 
 }  // namespace exo
diff --git a/components/exo/display.h b/components/exo/display.h
index 780f4040..ea9d014c 100644
--- a/components/exo/display.h
+++ b/components/exo/display.h
@@ -86,7 +86,7 @@
   // Creates a notification surface for a surface and notification id.
   std::unique_ptr<NotificationSurface> CreateNotificationSurface(
       Surface* surface,
-      const std::string& notification_id);
+      const std::string& notification_key);
 
  private:
   NotificationSurfaceManager* const notification_surface_manager_;
diff --git a/components/exo/notification_surface.cc b/components/exo/notification_surface.cc
index 5f42548d..91c13bc 100644
--- a/components/exo/notification_surface.cc
+++ b/components/exo/notification_surface.cc
@@ -69,10 +69,10 @@
 
 NotificationSurface::NotificationSurface(NotificationSurfaceManager* manager,
                                          Surface* surface,
-                                         const std::string& notification_id)
+                                         const std::string& notification_key)
     : manager_(manager),
       surface_(surface),
-      notification_id_(notification_id),
+      notification_key_(notification_key),
       window_(new aura::Window(new CustomWindowDelegate(surface))) {
   surface_->SetSurfaceDelegate(this);
   surface_->AddSurfaceObserver(this);
diff --git a/components/exo/notification_surface.h b/components/exo/notification_surface.h
index 33bfa2f..c33a6b63 100644
--- a/components/exo/notification_surface.h
+++ b/components/exo/notification_surface.h
@@ -26,13 +26,13 @@
  public:
   NotificationSurface(NotificationSurfaceManager* manager,
                       Surface* surface,
-                      const std::string& notification_id);
+                      const std::string& notification_key);
   ~NotificationSurface() override;
 
   gfx::Size GetSize() const;
 
   aura::Window* window() { return window_.get(); }
-  const std::string& notification_id() const { return notification_id_; }
+  const std::string& notification_key() const { return notification_key_; }
 
   // Overridden from SurfaceDelegate:
   void OnSurfaceCommit() override;
@@ -44,7 +44,7 @@
  private:
   NotificationSurfaceManager* const manager_;  // Not owned.
   Surface* surface_;                           // Not owned.
-  const std::string notification_id_;
+  const std::string notification_key_;
 
   std::unique_ptr<aura::Window> window_;
   bool added_to_manager_ = false;
diff --git a/components/exo/notification_surface_manager.h b/components/exo/notification_surface_manager.h
index 2649638..f5427b8 100644
--- a/components/exo/notification_surface_manager.h
+++ b/components/exo/notification_surface_manager.h
@@ -16,7 +16,7 @@
   // Gets the NotificationSurface associated with the given notification id.
   // Returns nullptr if no NotificationSurface is associated with the id.
   virtual NotificationSurface* GetSurface(
-      const std::string& notification_id) const = 0;
+      const std::string& notification_key) const = 0;
 
   // Adds a NotificationSurface to the manager.
   virtual void AddSurface(NotificationSurface* surface) = 0;
diff --git a/components/exo/wayland/server.cc b/components/exo/wayland/server.cc
index 36441f2..84c17c1 100644
--- a/components/exo/wayland/server.cc
+++ b/components/exo/wayland/server.cc
@@ -2106,8 +2106,8 @@
 
   std::unique_ptr<NotificationSurface> CreateNotificationSurface(
       Surface* surface,
-      const std::string& notification_id) {
-    return display_->CreateNotificationSurface(surface, notification_id);
+      const std::string& notification_key) {
+    return display_->CreateNotificationSurface(surface, notification_key);
   }
 
   // Overridden from display::DisplayObserver:
@@ -2375,7 +2375,7 @@
                                            wl_resource* resource,
                                            uint32_t id,
                                            wl_resource* surface,
-                                           const char* notification_id) {
+                                           const char* notification_key) {
   if (GetUserDataAs<Surface>(surface)->HasSurfaceDelegate()) {
     wl_resource_post_error(resource, ZCR_REMOTE_SHELL_V1_ERROR_ROLE,
                            "surface has already been assigned a role");
@@ -2384,11 +2384,11 @@
 
   std::unique_ptr<NotificationSurface> notification_surface =
       GetUserDataAs<WaylandRemoteShell>(resource)->CreateNotificationSurface(
-          GetUserDataAs<Surface>(surface), std::string(notification_id));
+          GetUserDataAs<Surface>(surface), std::string(notification_key));
   if (!notification_surface) {
     wl_resource_post_error(resource,
-                           ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_ID,
-                           "invalid notification id");
+                           ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_KEY,
+                           "invalid notification key");
     return;
   }
 
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json
index de1916d..7082782 100644
--- a/components/policy/resources/policy_templates.json
+++ b/components/policy/resources/policy_templates.json
@@ -258,7 +258,7 @@
           Leaving this policy not set will allow the user to choose their home page on their own if HomepageIsNewTabPage is not set too.
 
           This policy is not available on Windows instances that are not joined
-          to an Active Directory domain.''',
+          to a Microsoft® Active Directory® domain.''',
           'label': '''Home page URL''',
         },
         {
@@ -286,7 +286,7 @@
           Leaving this policy not set will allow the user to choose whether the new tab page is their home page on their own.
 
           This policy is not available on Windows instances that are not joined
-          to an Active Directory domain.''',
+          to a Microsoft® Active Directory® domain.''',
         },
       ],
     },
@@ -318,7 +318,7 @@
 
           If the policy is not set or left empty the default new tab page is used.
 
-          This policy is not available on Windows instances that are not joined to an Active Directory domain.''',
+          This policy is not available on Windows instances that are not joined to a Microsoft® Active Directory® domain.''',
           'label': '''New Tab page URL''',
         },
       ],
@@ -1303,7 +1303,7 @@
       upon installation / first run.
 
       This policy is not available on Windows instances that are not joined to
-      an Active Directory domain.  (For Chrome OS, see
+      a Microsoft® Active Directory® domain.  (For Chrome OS, see
       DeviceMetricsReportingEnabled.)''',
     },
     {
@@ -2291,9 +2291,9 @@
 
           This policy takes precedence over a potentially conflicting <ph name="EXTENSION_INSTALL_BLACKLIST_POLICY_NAME">ExtensionInstallBlacklist</ph> policy. If an app or extension that previously had been force-installed is removed from this list, it is automatically uninstalled by <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
 
-          For Windows instances that are not joined to an Active Directory
-          domain, forced installation is limited to apps and extensions listed
-          in the Chrome Web Store.
+          For Windows instances that are not joined to a Microsoft® Active
+          Directory® domain, forced installation is limited to apps and
+          extensions listed in the Chrome Web Store.
 
           Note that the source code of any extension may be altered by users via Developer Tools (potentially rendering the extension dysfunctional). If this is a concern, the <ph name="DEVELOPER_TOOLS_POLICY_NAME">DeveloperToolsDisabled</ph> policy should be set.
 
@@ -2630,7 +2630,7 @@
           Disabling this setting is equivalent to leaving it not configured. The user will still be able to change it in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
 
           This policy is not available on Windows instances that are not joined
-          to an Active Directory domain.''',
+          to a Microsoft® Active Directory® domain.''',
         },
         {
           'name': 'RestoreOnStartupURLs',
@@ -2654,7 +2654,7 @@
           This policy only works if the 'RestoreOnStartup' policy is set to 'RestoreOnStartupIsURLs'.
 
           This policy is not available on Windows instances that are not joined
-          to an Active Directory domain.''',
+          to a Microsoft® Active Directory® domain.''',
         },
       ],
     },
@@ -2717,7 +2717,7 @@
           If this policy is left not set, the default search provider is enabled, and the user will be able to set the search provider list.
 
           This policy is not available on Windows instances that are not joined
-          to an Active Directory domain.''',
+          to a Microsoft® Active Directory® domain.''',
         },
         {
           'name': 'DefaultSearchProviderName',
@@ -9648,7 +9648,7 @@
 
       The recommended way to configure policy on Windows is via GPO, although
       provisioning policy via registry is still supported for Windows instances
-      that are joined to an Active Directory domain.'''
+      that are joined to a Microsoft® Active Directory® domain.'''
     },
     'doc_back_to_top': {
       'desc': '''Text of a link in the generated policy documentation, that takes the user to the top of the page''',
diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp
index 5e093d1..32150216 100644
--- a/components/policy_strings.grdp
+++ b/components/policy_strings.grdp
@@ -334,8 +334,8 @@
   <message name="IDS_POLICY_SOURCE_CLOUD" desc="Indicates that the policy originates from the cloud.">
     Cloud
   </message>
-  <message name="IDS_POLICY_SOURCE_ACTIVE_DIRECTORY" desc="Indicates that the policy originates from Active Directory.">
-    <ph name="MICROSOFT_ACTIVE_DIRECTORY">Microsoft® Active Directory®</ph>
+  <message name="IDS_POLICY_SOURCE_ACTIVE_DIRECTORY" desc="Indicates that the policy originates from a local server, e.g. Samba or Active Directory.">
+    <ph name="MICROSOFT_ACTIVE_DIRECTORY">Local Server</ph>
   </message>
   <message name="IDS_POLICY_SOURCE_PLATFORM" desc="Indicates that the policy is obtained from the local OS.">
     Platform
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.cc b/components/safe_browsing_db/v4_protocol_manager_util.cc
index 44aeee98..bd097a7 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util.cc
+++ b/components/safe_browsing_db/v4_protocol_manager_util.cc
@@ -305,7 +305,7 @@
   if (full_hash.size() < prefix_size) {
     return false;
   }
-  *hash_prefix = full_hash.substr(prefix_size);
+  *hash_prefix = full_hash.substr(0, prefix_size);
   return true;
 }
 
diff --git a/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc b/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
index 0680d3c..8018a9a8 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
+++ b/components/safe_browsing_db/v4_protocol_manager_util_unittest.cc
@@ -269,4 +269,28 @@
   }
 }
 
+TEST_F(V4ProtocolManagerUtilTest, TestFullHashToHashPrefix) {
+  const std::string full_hash = "abcdefgh";
+  std::vector<std::tuple<bool, std::string, PrefixSize, std::string>>
+      test_cases = {
+          std::make_tuple(true, "", 0, ""),
+          std::make_tuple(false, "", kMinHashPrefixLength, ""),
+          std::make_tuple(true, "a", 1, full_hash),
+          std::make_tuple(true, "abcd", kMinHashPrefixLength, full_hash),
+          std::make_tuple(true, "abcde", kMinHashPrefixLength + 1, full_hash)};
+  for (size_t i = 0; i < test_cases.size(); i++) {
+    DVLOG(1) << "Running case: " << i;
+    bool success = std::get<0>(test_cases[i]);
+    const auto& expected_prefix = std::get<1>(test_cases[i]);
+    const PrefixSize& prefix_size = std::get<2>(test_cases[i]);
+    const auto& input_full_hash = std::get<3>(test_cases[i]);
+    std::string prefix;
+    ASSERT_EQ(success, V4ProtocolManagerUtil::FullHashToHashPrefix(
+                           input_full_hash, prefix_size, &prefix));
+    if (success) {
+      ASSERT_EQ(expected_prefix, prefix);
+    }
+  }
+}
+
 }  // namespace safe_browsing
diff --git a/components/viz/host/BUILD.gn b/components/viz/host/BUILD.gn
new file mode 100644
index 0000000..4cf26cc
--- /dev/null
+++ b/components/viz/host/BUILD.gn
@@ -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.
+
+component("host") {
+  defines = [ "VIZ_HOST_IMPLEMENTATION" ]
+
+  sources = [
+    "frame_sink_manager_host.cc",
+    "frame_sink_manager_host.h",
+    "frame_sink_observer.h",
+    "viz_host_export.h",
+  ]
+
+  deps = [
+    "//base",
+    "//cc/ipc:interfaces",
+    "//cc/surfaces",
+    "//components/viz/frame_sinks",
+  ]
+}
diff --git a/components/viz/host/DEPS b/components/viz/host/DEPS
new file mode 100644
index 0000000..7245cd4
--- /dev/null
+++ b/components/viz/host/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+cc/ipc",
+  "+cc/surfaces",
+]
diff --git a/components/viz/host/OWNERS b/components/viz/host/OWNERS
new file mode 100644
index 0000000..c795b67c
--- /dev/null
+++ b/components/viz/host/OWNERS
@@ -0,0 +1 @@
+kylechar@chromium.org
\ No newline at end of file
diff --git a/content/browser/compositor/frame_sink_manager_host.cc b/components/viz/host/frame_sink_manager_host.cc
similarity index 95%
rename from content/browser/compositor/frame_sink_manager_host.cc
rename to components/viz/host/frame_sink_manager_host.cc
index fa5fc85..67a6058 100644
--- a/content/browser/compositor/frame_sink_manager_host.cc
+++ b/components/viz/host/frame_sink_manager_host.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 "content/browser/compositor/frame_sink_manager_host.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 
 #include <utility>
 
 #include "cc/surfaces/surface_info.h"
 #include "cc/surfaces/surface_manager.h"
 
-namespace content {
+namespace viz {
 
 FrameSinkManagerHost::FrameSinkManagerHost()
     : binding_(this),
@@ -69,4 +69,4 @@
     observer.OnSurfaceCreated(surface_info);
 }
 
-}  // namespace content
+}  // namespace viz
diff --git a/content/browser/compositor/frame_sink_manager_host.h b/components/viz/host/frame_sink_manager_host.h
similarity index 84%
rename from content/browser/compositor/frame_sink_manager_host.h
rename to components/viz/host/frame_sink_manager_host.h
index 6d600e61..6642580a 100644
--- a/content/browser/compositor/frame_sink_manager_host.h
+++ b/components/viz/host/frame_sink_manager_host.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef CONTENT_BROWSER_COMPOSITOR_FRAME_SINK_MANAGER_HOST_H_
-#define CONTENT_BROWSER_COMPOSITOR_FRAME_SINK_MANAGER_HOST_H_
+#ifndef COMPONENTS_VIZ_HOST_FRAME_SINK_MANAGER_HOST_H_
+#define COMPONENTS_VIZ_HOST_FRAME_SINK_MANAGER_HOST_H_
 
 #include "base/compiler_specific.h"
 #include "base/macros.h"
@@ -11,8 +11,8 @@
 #include "cc/ipc/frame_sink_manager.mojom.h"
 #include "cc/surfaces/frame_sink_id.h"
 #include "components/viz/frame_sinks/mojo_frame_sink_manager.h"
-#include "content/browser/compositor/frame_sink_observer.h"
-#include "content/common/content_export.h"
+#include "components/viz/host/frame_sink_observer.h"
+#include "components/viz/host/viz_host_export.h"
 #include "mojo/public/cpp/bindings/binding.h"
 
 namespace cc {
@@ -20,11 +20,11 @@
 class SurfaceManager;
 }
 
-namespace content {
+namespace viz {
 
 // Browser side implementation of mojom::FrameSinkManager. Manages frame sinks
 // and is intended to replace SurfaceManager.
-class CONTENT_EXPORT FrameSinkManagerHost
+class VIZ_HOST_EXPORT FrameSinkManagerHost
     : NON_EXPORTED_BASE(cc::mojom::FrameSinkManagerClient) {
  public:
   FrameSinkManagerHost();
@@ -62,7 +62,7 @@
   // This is owned here so that SurfaceManager will be accessible in process.
   // Other than using SurfaceManager, access to |frame_sink_manager_| should
   // happen using Mojo. See http://crbug.com/657959.
-  viz::MojoFrameSinkManager frame_sink_manager_;
+  MojoFrameSinkManager frame_sink_manager_;
 
   // Local observers to that receive OnSurfaceCreated() messages from IPC.
   base::ObserverList<FrameSinkObserver> observers_;
@@ -70,6 +70,6 @@
   DISALLOW_COPY_AND_ASSIGN(FrameSinkManagerHost);
 };
 
-}  // namespace content
+}  // namespace viz
 
-#endif  // CONTENT_BROWSER_COMPOSITOR_FRAME_SINK_MANAGER_HOST_H_
+#endif  // COMPONENTS_VIZ_HOST_FRAME_SINK_MANAGER_HOST_H_
diff --git a/content/browser/compositor/frame_sink_observer.h b/components/viz/host/frame_sink_observer.h
similarity index 67%
rename from content/browser/compositor/frame_sink_observer.h
rename to components/viz/host/frame_sink_observer.h
index 062b413..4c6de75 100644
--- a/content/browser/compositor/frame_sink_observer.h
+++ b/components/viz/host/frame_sink_observer.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 CONTENT_BROWSER_COMPOSITOR_FRAME_SINK_OBSERVER_H_
-#define CONTENT_BROWSER_COMPOSITOR_FRAME_SINK_OBSERVER_H_
+#ifndef COMPONENTS_VIZ_HOST_FRAME_SINK_OBSERVER_H_
+#define COMPONENTS_VIZ_HOST_FRAME_SINK_OBSERVER_H_
 
 namespace cc {
 class SurfaceInfo;
 }
 
-namespace content {
+namespace viz {
 
 class FrameSinkObserver {
  public:
@@ -21,6 +21,6 @@
   ~FrameSinkObserver() {}
 };
 
-}  // namespace content
+}  // namespace viz
 
-#endif  // CONTENT_BROWSER_COMPOSITOR_FRAME_SINK_OBSERVER_H_
+#endif  // COMPONENTS_VIZ_HOST_FRAME_SINK_OBSERVER_H_
diff --git a/components/viz/host/viz_host_export.h b/components/viz/host/viz_host_export.h
new file mode 100644
index 0000000..39846c1
--- /dev/null
+++ b/components/viz/host/viz_host_export.h
@@ -0,0 +1,29 @@
+// 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_VIZ_HOST_VIZ_HOST_EXPORT_H_
+#define COMPONENTS_VIZ_HOST_VIZ_HOST_EXPORT_H_
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(VIZ_HOST_IMPLEMENTATION)
+#define VIZ_HOST_EXPORT __declspec(dllexport)
+#else
+#define VIZ_HOST_EXPORT __declspec(dllimport)
+#endif  // defined(VIZ_HOST_IMPLEMENTATION)
+
+#else  // defined(WIN32)
+#if defined(VIZ_HOST_IMPLEMENTATION)
+#define VIZ_HOST_EXPORT __attribute__((visibility("default")))
+#else
+#define VIZ_HOST_EXPORT
+#endif
+#endif
+
+#else  // defined(COMPONENT_BUILD)
+#define VIZ_HOST_EXPORT
+#endif
+
+#endif  // COMPONENTS_VIZ_HOST_VIZ_HOST_EXPORT_H_
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index fd5bcf6..a249d77f 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -54,6 +54,7 @@
     "//components/variations",
     "//components/viz/display_compositor",
     "//components/viz/frame_sinks",
+    "//components/viz/host",
     "//content:resources",
     "//content/app/resources",
     "//content/app/strings",
@@ -498,9 +499,6 @@
     # NOTE: These files are here instead of in compositor_browser_sources
     # because the latter is not built on Android, whereas these files are
     # needed on all platforms.
-    "compositor/frame_sink_manager_host.cc",
-    "compositor/frame_sink_manager_host.h",
-    "compositor/frame_sink_observer.h",
     "compositor/surface_utils.cc",
     "compositor/surface_utils.h",
     "devtools/browser_devtools_agent_host.cc",
diff --git a/content/browser/compositor/OWNERS b/content/browser/compositor/OWNERS
index 76fab9b..008651e 100644
--- a/content/browser/compositor/OWNERS
+++ b/content/browser/compositor/OWNERS
@@ -2,8 +2,6 @@
 jbauman@chromium.org
 ccameron@chromium.org
 
-per-file frame_sink*=kylechar@chromium.org
-
 per-file *mus*=fsamuel@chromium.org
 per-file *mus*=sadrul@chromium.org
 per-file *mus*=rjkroege@chromium.org
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 2577ba21..417dc0f 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -33,8 +33,8 @@
 #include "components/viz/display_compositor/compositor_overlay_candidate_validator.h"
 #include "components/viz/display_compositor/gl_helper.h"
 #include "components/viz/display_compositor/host_shared_bitmap_manager.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "content/browser/compositor/browser_compositor_output_surface.h"
-#include "content/browser/compositor/frame_sink_manager_host.h"
 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.h"
 #include "content/browser/compositor/offscreen_browser_compositor_output_surface.h"
@@ -206,7 +206,7 @@
       callback_factory_(this) {
   cc::SetClientNameForMetrics("Browser");
 
-  frame_sink_manager_host_ = base::MakeUnique<FrameSinkManagerHost>();
+  frame_sink_manager_host_ = base::MakeUnique<viz::FrameSinkManagerHost>();
   frame_sink_manager_host_->ConnectToFrameSinkManager();
 
   base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
@@ -713,6 +713,15 @@
   return frame_sink_id_allocator_.NextFrameSinkId();
 }
 
+cc::SurfaceManager* GpuProcessTransportFactory::GetSurfaceManager() {
+  return frame_sink_manager_host_->surface_manager();
+}
+
+viz::FrameSinkManagerHost*
+GpuProcessTransportFactory::GetFrameSinkManagerHost() {
+  return frame_sink_manager_host_.get();
+}
+
 void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor,
                                                    bool visible) {
   PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor);
@@ -808,14 +817,6 @@
   observer_list_.RemoveObserver(observer);
 }
 
-cc::SurfaceManager* GpuProcessTransportFactory::GetSurfaceManager() {
-  return frame_sink_manager_host_->surface_manager();
-}
-
-FrameSinkManagerHost* GpuProcessTransportFactory::GetFrameSinkManagerHost() {
-  return frame_sink_manager_host_.get();
-}
-
 viz::GLHelper* GpuProcessTransportFactory::GetGLHelper() {
   if (!gl_helper_ && !per_compositor_data_.empty()) {
     scoped_refptr<cc::ContextProvider> provider =
diff --git a/content/browser/compositor/gpu_process_transport_factory.h b/content/browser/compositor/gpu_process_transport_factory.h
index 9ce2a46..9a9723a 100644
--- a/content/browser/compositor/gpu_process_transport_factory.h
+++ b/content/browser/compositor/gpu_process_transport_factory.h
@@ -34,9 +34,12 @@
 class ContextProviderCommandBuffer;
 }
 
+namespace viz {
+class FrameSinkManagerHost;
+}
+
 namespace content {
 class OutputDeviceBacking;
-class FrameSinkManagerHost;
 
 class GpuProcessTransportFactory : public ui::ContextFactory,
                                    public ui::ContextFactoryPrivate,
@@ -63,6 +66,8 @@
   void RemoveReflector(ui::Reflector* reflector) override;
   void RemoveCompositor(ui::Compositor* compositor) override;
   cc::FrameSinkId AllocateFrameSinkId() override;
+  cc::SurfaceManager* GetSurfaceManager() override;
+  viz::FrameSinkManagerHost* GetFrameSinkManagerHost() override;
   void SetDisplayVisible(ui::Compositor* compositor, bool visible) override;
   void ResizeDisplay(ui::Compositor* compositor,
                      const gfx::Size& size) override;
@@ -79,8 +84,6 @@
   // ImageTransportFactory implementation.
   ui::ContextFactory* GetContextFactory() override;
   ui::ContextFactoryPrivate* GetContextFactoryPrivate() override;
-  cc::SurfaceManager* GetSurfaceManager() override;
-  FrameSinkManagerHost* GetFrameSinkManagerHost() override;
   viz::GLHelper* GetGLHelper() override;
   void SetGpuChannelEstablishFactory(
       gpu::GpuChannelEstablishFactory* factory) override;
@@ -108,7 +111,7 @@
   SharedVulkanContextProvider();
 
   // Manages creation and hierarchy of frame sinks.
-  std::unique_ptr<FrameSinkManagerHost> frame_sink_manager_host_;
+  std::unique_ptr<viz::FrameSinkManagerHost> frame_sink_manager_host_;
 
   cc::FrameSinkIdAllocator frame_sink_id_allocator_;
 
diff --git a/content/browser/compositor/image_transport_factory.h b/content/browser/compositor/image_transport_factory.h
index 525ee02..7abfc77c 100644
--- a/content/browser/compositor/image_transport_factory.h
+++ b/content/browser/compositor/image_transport_factory.h
@@ -35,8 +35,6 @@
 
 namespace content {
 
-class FrameSinkManagerHost;
-
 // This class provides the interface for creating the support for the
 // cross-process image transport, both for creating the shared surface handle
 // (destination surface for the GPU process) and the transport client (logic for
@@ -72,9 +70,6 @@
   // (ImageTransportFactoryObserver::OnLostResources is called).
   virtual viz::GLHelper* GetGLHelper() = 0;
 
-  // Gets the frame sink manager host instance.
-  virtual FrameSinkManagerHost* GetFrameSinkManagerHost() = 0;
-
   virtual void SetGpuChannelEstablishFactory(
       gpu::GpuChannelEstablishFactory* factory) = 0;
 
diff --git a/content/browser/compositor/surface_utils.cc b/content/browser/compositor/surface_utils.cc
index bdf01d3..4fb995a 100644
--- a/content/browser/compositor/surface_utils.cc
+++ b/content/browser/compositor/surface_utils.cc
@@ -11,7 +11,7 @@
 #include "cc/output/copy_output_result.h"
 #include "cc/resources/single_release_callback.h"
 #include "components/viz/display_compositor/gl_helper.h"
-#include "content/browser/compositor/frame_sink_manager_host.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "skia/ext/image_operations.h"
 #include "third_party/skia/include/core/SkCanvas.h"
 #include "third_party/skia/include/core/SkColorFilter.h"
@@ -173,14 +173,14 @@
 #endif
 }
 
-FrameSinkManagerHost* GetFrameSinkManagerHost() {
+viz::FrameSinkManagerHost* GetFrameSinkManagerHost() {
 #if defined(OS_ANDROID)
   return CompositorImpl::GetFrameSinkManagerHost();
 #else
   ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
   if (!factory)
     return nullptr;
-  return factory->GetFrameSinkManagerHost();
+  return factory->GetContextFactoryPrivate()->GetFrameSinkManagerHost();
 #endif
 }
 
diff --git a/content/browser/compositor/surface_utils.h b/content/browser/compositor/surface_utils.h
index ea14352..dee84d8 100644
--- a/content/browser/compositor/surface_utils.h
+++ b/content/browser/compositor/surface_utils.h
@@ -18,14 +18,17 @@
 class SurfaceManager;
 }  // namespace cc
 
-namespace content {
+namespace viz {
 class FrameSinkManagerHost;
+}
+
+namespace content {
 
 CONTENT_EXPORT cc::FrameSinkId AllocateFrameSinkId();
 
 CONTENT_EXPORT cc::SurfaceManager* GetSurfaceManager();
 
-CONTENT_EXPORT FrameSinkManagerHost* GetFrameSinkManagerHost();
+CONTENT_EXPORT viz::FrameSinkManagerHost* GetFrameSinkManagerHost();
 
 void CopyFromCompositingSurfaceHasResult(
     const gfx::Size& dst_size_in_pixel,
diff --git a/content/browser/compositor/test/no_transport_image_transport_factory.cc b/content/browser/compositor/test/no_transport_image_transport_factory.cc
index 124b009..c2f01f1 100644
--- a/content/browser/compositor/test/no_transport_image_transport_factory.cc
+++ b/content/browser/compositor/test/no_transport_image_transport_factory.cc
@@ -18,9 +18,9 @@
 namespace content {
 
 NoTransportImageTransportFactory::NoTransportImageTransportFactory()
-    : frame_sink_manager_host_(base::MakeUnique<FrameSinkManagerHost>()),
+    : frame_sink_manager_host_(base::MakeUnique<viz::FrameSinkManagerHost>()),
       context_factory_(base::MakeUnique<ui::InProcessContextFactory>(
-          frame_sink_manager_host_->surface_manager())) {
+          frame_sink_manager_host_.get())) {
   // The context factory created here is for unit tests, thus using a higher
   // refresh rate to spend less time waiting for BeginFrames.
   context_factory_->SetUseFastRefreshRateForTests();
@@ -40,11 +40,6 @@
   return context_factory_.get();
 }
 
-FrameSinkManagerHost*
-NoTransportImageTransportFactory::GetFrameSinkManagerHost() {
-  return frame_sink_manager_host_.get();
-}
-
 viz::GLHelper* NoTransportImageTransportFactory::GetGLHelper() {
   if (!gl_helper_) {
     context_provider_ = context_factory_->SharedMainThreadContextProvider();
diff --git a/content/browser/compositor/test/no_transport_image_transport_factory.h b/content/browser/compositor/test/no_transport_image_transport_factory.h
index 6c8f6fe..6e548f20 100644
--- a/content/browser/compositor/test/no_transport_image_transport_factory.h
+++ b/content/browser/compositor/test/no_transport_image_transport_factory.h
@@ -10,7 +10,7 @@
 #include "base/macros.h"
 #include "build/build_config.h"
 #include "cc/surfaces/surface_manager.h"
-#include "content/browser/compositor/frame_sink_manager_host.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "content/browser/compositor/image_transport_factory.h"
 
 namespace cc {
@@ -33,7 +33,6 @@
   ui::ContextFactory* GetContextFactory() override;
   ui::ContextFactoryPrivate* GetContextFactoryPrivate() override;
   viz::GLHelper* GetGLHelper() override;
-  FrameSinkManagerHost* GetFrameSinkManagerHost() override;
   void SetGpuChannelEstablishFactory(
       gpu::GpuChannelEstablishFactory* factory) override;
 #if defined(OS_MACOSX)
@@ -42,7 +41,7 @@
 #endif
 
  private:
-  std::unique_ptr<FrameSinkManagerHost> frame_sink_manager_host_;
+  std::unique_ptr<viz::FrameSinkManagerHost> frame_sink_manager_host_;
   std::unique_ptr<ui::InProcessContextFactory> context_factory_;
   scoped_refptr<cc::ContextProvider> context_provider_;
   std::unique_ptr<viz::GLHelper> gl_helper_;
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index fff5edb..0fe80c4 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -49,7 +49,7 @@
 #include "components/viz/display_compositor/compositor_overlay_candidate_validator_android.h"
 #include "components/viz/display_compositor/gl_helper.h"
 #include "components/viz/display_compositor/host_shared_bitmap_manager.h"
-#include "content/browser/compositor/frame_sink_manager_host.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
 #include "content/browser/gpu/compositor_util.h"
@@ -101,7 +101,7 @@
   }
 
   SingleThreadTaskGraphRunner task_graph_runner;
-  FrameSinkManagerHost frame_sink_manager_host;
+  viz::FrameSinkManagerHost frame_sink_manager_host;
   cc::FrameSinkIdAllocator frame_sink_id_allocator;
 
 #if BUILDFLAG(ENABLE_VULKAN)
@@ -407,7 +407,7 @@
 }
 
 // static
-FrameSinkManagerHost* CompositorImpl::GetFrameSinkManagerHost() {
+viz::FrameSinkManagerHost* CompositorImpl::GetFrameSinkManagerHost() {
   return &g_compositor_dependencies.Get().frame_sink_manager_host;
 }
 
diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h
index 60867cb..2488823 100644
--- a/content/browser/renderer_host/compositor_impl_android.h
+++ b/content/browser/renderer_host/compositor_impl_android.h
@@ -42,9 +42,12 @@
 class VulkanContextProvider;
 }
 
+namespace viz {
+class FrameSinkManagerHost;
+}
+
 namespace content {
 class CompositorClient;
-class FrameSinkManagerHost;
 
 // -----------------------------------------------------------------------------
 // Browser-side compositor that manages a tree of content and UI layers.
@@ -62,7 +65,7 @@
   static bool IsInitialized();
 
   static cc::SurfaceManager* GetSurfaceManager();
-  static FrameSinkManagerHost* GetFrameSinkManagerHost();
+  static viz::FrameSinkManagerHost* GetFrameSinkManagerHost();
   static cc::FrameSinkId AllocateFrameSinkId();
 
   // ui::ResourceProvider implementation.
@@ -189,6 +192,6 @@
   DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
 };
 
-} // namespace content
+}  // namespace content
 
 #endif  // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
diff --git a/content/browser/renderer_host/offscreen_canvas_provider_impl_unittest.cc b/content/browser/renderer_host/offscreen_canvas_provider_impl_unittest.cc
index 06e1f5a..84763418 100644
--- a/content/browser/renderer_host/offscreen_canvas_provider_impl_unittest.cc
+++ b/content/browser/renderer_host/offscreen_canvas_provider_impl_unittest.cc
@@ -18,6 +18,7 @@
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom.h"
+#include "ui/compositor/compositor.h"
 
 #if !defined(OS_ANDROID)
 #include "content/browser/compositor/image_transport_factory.h"
@@ -143,6 +144,7 @@
         std::unique_ptr<ImageTransportFactory>(
             new NoTransportImageTransportFactory));
     ImageTransportFactory::GetInstance()
+        ->GetContextFactoryPrivate()
         ->GetFrameSinkManagerHost()
         ->ConnectToFrameSinkManager();
 #endif
diff --git a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
index 8058e25f..9102a66 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.cc
@@ -9,7 +9,7 @@
 
 #include "base/memory/ptr_util.h"
 #include "cc/surfaces/surface_manager.h"
-#include "content/browser/compositor/frame_sink_manager_host.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "content/browser/compositor/surface_utils.h"
 
 namespace content {
diff --git a/content/browser/renderer_host/offscreen_canvas_surface_impl.h b/content/browser/renderer_host/offscreen_canvas_surface_impl.h
index ff566c5..3034433c 100644
--- a/content/browser/renderer_host/offscreen_canvas_surface_impl.h
+++ b/content/browser/renderer_host/offscreen_canvas_surface_impl.h
@@ -9,7 +9,7 @@
 #include "base/compiler_specific.h"
 #include "cc/surfaces/frame_sink_id.h"
 #include "cc/surfaces/surface_info.h"
-#include "content/browser/compositor/frame_sink_observer.h"
+#include "components/viz/host/frame_sink_observer.h"
 #include "content/common/content_export.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "third_party/WebKit/public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom.h"
@@ -20,7 +20,7 @@
 // connections to both the renderer and frame sink manager.
 class CONTENT_EXPORT OffscreenCanvasSurfaceImpl
     : public blink::mojom::OffscreenCanvasSurface,
-      public NON_EXPORTED_BASE(FrameSinkObserver) {
+      public NON_EXPORTED_BASE(viz::FrameSinkObserver) {
  public:
   using DestroyCallback = base::OnceCallback<void()>;
 
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c19df265..b5be05f 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -3662,7 +3662,10 @@
       if (commit_type != blink::kWebHistoryInertCommit ||
           PageTransitionCoreTypeIs(navigation_state->GetTransitionType(),
                                    ui::PAGE_TRANSITION_RELOAD)) {
+        // TODO(maxlg): remove OnNavigationStarted and migrate this part into
+        // OnCommitProvisionalLoad.
         render_thread_impl->GetRendererScheduler()->OnNavigationStarted();
+        render_thread_impl->GetRendererScheduler()->OnCommitProvisionalLoad();
       }
     }
   }
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index cd76192..896e91b 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -248,6 +248,7 @@
     "//components/leveldb/public/interfaces",
     "//components/payments/mojom:mojom_payment_app",
     "//components/viz/display_compositor",
+    "//components/viz/host",
     "//content/app:both_for_content_tests",
     "//content/browser:for_content_tests",
     "//content/browser/speech/proto",
@@ -1487,6 +1488,7 @@
     "//components/ukm/public/interfaces",
     "//components/viz/display_compositor",
     "//components/viz/frame_sinks",
+    "//components/viz/host",
     "//content:resources",
     "//content/app:both_for_content_tests",
     "//content/browser:for_content_tests",
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd
index 7e1ad63..3eed013 100644
--- a/ios/chrome/app/strings/ios_strings.grd
+++ b/ios/chrome/app/strings/ios_strings.grd
@@ -543,12 +543,12 @@
       <message name="IDS_IOS_CONTENT_CONTEXT_SAVEIMAGE" desc="The name of the Save Image As command in the content area context menu">
         Save Image
       </message>
-      <message name="IDS_IOS_CONTENT_SUGGESTIONS_DELETE" desc="The name of the Delete command in the Content Suggestions articles context menu">
-        Delete
-      </message>
       <message name="IDS_IOS_CONTENT_SUGGESTIONS_FOOTER_TITLE" desc="The title of the footer of the sections of Content Suggestions">
         More
       </message>
+      <message name="IDS_IOS_CONTENT_SUGGESTIONS_REMOVE" desc="The name of the Remove command in the Content Suggestions articles context menu">
+        Remove
+      </message>
       <message name="IDS_IOS_CONTENT_SETTINGS_TITLE" desc="Title for content settings dialog [Length: 29em] [iOS only]">
         Content Settings
       </message>
diff --git a/ios/chrome/browser/content_suggestions/BUILD.gn b/ios/chrome/browser/content_suggestions/BUILD.gn
index 472f82f..40ff459 100644
--- a/ios/chrome/browser/content_suggestions/BUILD.gn
+++ b/ios/chrome/browser/content_suggestions/BUILD.gn
@@ -23,8 +23,10 @@
     "//components/ntp_tiles",
     "//components/rappor",
     "//components/reading_list/core",
+    "//components/strings",
     "//ios/chrome/app/strings",
     "//ios/chrome/browser",
+    "//ios/chrome/browser/browser_state",
     "//ios/chrome/browser/favicon",
     "//ios/chrome/browser/metrics:metrics_internal",
     "//ios/chrome/browser/ntp_snippets",
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
index e24f632a..44315761 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_coordinator.mm
@@ -14,6 +14,8 @@
 #include "components/ntp_tiles/metrics.h"
 #include "components/ntp_tiles/most_visited_sites.h"
 #include "components/reading_list/core/reading_list_model.h"
+#include "components/strings/grit/components_strings.h"
+#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
 #import "ios/chrome/browser/content_suggestions/content_suggestions_mediator.h"
 #include "ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h"
 #import "ios/chrome/browser/metrics/new_tab_page_uma.h"
@@ -29,8 +31,10 @@
 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h"
 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.h"
 #import "ios/chrome/browser/ui/content_suggestions/identifier/content_suggestion_identifier.h"
+#import "ios/chrome/browser/ui/uikit_ui_util.h"
 #import "ios/chrome/browser/ui/url_loader.h"
 #include "ios/chrome/grit/ios_strings.h"
+#import "ios/third_party/material_components_ios/src/components/Snackbar/src/MaterialSnackbar.h"
 #include "ios/web/public/referrer.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/strings/grit/ui_strings.h"
@@ -146,12 +150,7 @@
   ContentSuggestionsMostVisitedItem* mostVisitedItem =
       base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item);
 
-  new_tab_page_uma::RecordAction(
-      self.browserState, new_tab_page_uma::ACTION_OPENED_MOST_VISITED_ENTRY);
-  base::RecordAction(base::UserMetricsAction("MobileNTPMostVisited"));
-
-  ntp_tiles::metrics::RecordTileClick(mostVisitedIndex, mostVisitedItem.source,
-                                      [mostVisitedItem tileType]);
+  [self logMostVisitedOpening:mostVisitedItem atIndex:mostVisitedIndex];
 
   [self.URLLoader loadURL:mostVisitedItem.URL
                  referrer:web::Referrer()
@@ -222,7 +221,7 @@
                  style:UIAlertActionStyleDefault];
 
   NSString* deleteTitle =
-      l10n_util::GetNSString(IDS_IOS_CONTENT_SUGGESTIONS_DELETE);
+      l10n_util::GetNSString(IDS_IOS_CONTENT_SUGGESTIONS_REMOVE);
   [self.alertCoordinator addItemWithTitle:deleteTitle
                                    action:^{
                                      // TODO(crbug.com/691979): Add metrics.
@@ -240,6 +239,75 @@
   [self.alertCoordinator start];
 }
 
+- (void)displayContextMenuForMostVisitedItem:(CollectionViewItem*)item
+                                     atPoint:(CGPoint)touchLocation
+                                 atIndexPath:(NSIndexPath*)indexPath {
+  ContentSuggestionsMostVisitedItem* mostVisitedItem =
+      base::mac::ObjCCastStrict<ContentSuggestionsMostVisitedItem>(item);
+  self.alertCoordinator = [[ActionSheetCoordinator alloc]
+      initWithBaseViewController:self.navigationController
+                           title:nil
+                         message:nil
+                            rect:CGRectMake(touchLocation.x, touchLocation.y, 0,
+                                            0)
+                            view:self.suggestionsViewController.collectionView];
+
+  __weak ContentSuggestionsCoordinator* weakSelf = self;
+  __weak ContentSuggestionsMostVisitedItem* weakItem = mostVisitedItem;
+
+  [self.alertCoordinator
+      addItemWithTitle:l10n_util::GetNSStringWithFixup(
+                           IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB)
+                action:^{
+                  ContentSuggestionsCoordinator* strongSelf = weakSelf;
+                  ContentSuggestionsMostVisitedItem* strongItem = weakItem;
+                  if (!strongSelf || !strongItem)
+                    return;
+                  [strongSelf logMostVisitedOpening:strongItem
+                                            atIndex:indexPath.item];
+                  [strongSelf openNewTabWithURL:strongItem.URL incognito:NO];
+                }
+                 style:UIAlertActionStyleDefault];
+
+  if (!self.browserState->IsOffTheRecord()) {
+    [self.alertCoordinator
+        addItemWithTitle:l10n_util::GetNSStringWithFixup(
+                             IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB)
+                  action:^{
+                    ContentSuggestionsCoordinator* strongSelf = weakSelf;
+                    ContentSuggestionsMostVisitedItem* strongItem = weakItem;
+                    if (!strongSelf || !strongItem)
+                      return;
+                    [strongSelf logMostVisitedOpening:strongItem
+                                              atIndex:indexPath.item];
+                    [strongSelf openNewTabWithURL:strongItem.URL incognito:YES];
+                  }
+                   style:UIAlertActionStyleDefault];
+  }
+
+  [self.alertCoordinator
+      addItemWithTitle:l10n_util::GetNSStringWithFixup(
+                           IDS_IOS_CONTENT_SUGGESTIONS_REMOVE)
+                action:^{
+                  ContentSuggestionsCoordinator* strongSelf = weakSelf;
+                  ContentSuggestionsMostVisitedItem* strongItem = weakItem;
+                  if (!strongSelf || !strongItem)
+                    return;
+                  base::RecordAction(
+                      base::UserMetricsAction("MostVisited_UrlBlacklisted"));
+                  [strongSelf.contentSuggestionsMediator
+                      blacklistMostVisitedURL:strongItem.URL];
+                  [strongSelf showMostVisitedUndoForURL:strongItem.URL];
+                }
+                 style:UIAlertActionStyleDefault];
+
+  [self.alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_APP_CANCEL)
+                                   action:nil
+                                    style:UIAlertActionStyleCancel];
+
+  [self.alertCoordinator start];
+}
+
 - (void)dismissContextMenu {
   [self.alertCoordinator stop];
   self.alertCoordinator = nil;
@@ -270,4 +338,40 @@
   [self.suggestionsViewController dismissEntryAtIndexPath:indexPath];
 }
 
+// Logs a histogram due to a Most Visited item being opened.
+- (void)logMostVisitedOpening:(ContentSuggestionsMostVisitedItem*)item
+                      atIndex:(NSInteger)mostVisitedIndex {
+  new_tab_page_uma::RecordAction(
+      self.browserState, new_tab_page_uma::ACTION_OPENED_MOST_VISITED_ENTRY);
+  base::RecordAction(base::UserMetricsAction("MobileNTPMostVisited"));
+
+  ntp_tiles::metrics::RecordTileClick(mostVisitedIndex, item.source,
+                                      [item tileType]);
+}
+
+// Shows a snackbar with an action to undo the removal of the most visited item
+// with a |URL|.
+- (void)showMostVisitedUndoForURL:(GURL)URL {
+  GURL copiedURL = URL;
+
+  MDCSnackbarMessageAction* action = [[MDCSnackbarMessageAction alloc] init];
+  __weak ContentSuggestionsCoordinator* weakSelf = self;
+  action.handler = ^{
+    ContentSuggestionsCoordinator* strongSelf = weakSelf;
+    if (!strongSelf)
+      return;
+    [strongSelf.contentSuggestionsMediator whitelistMostVisitedURL:copiedURL];
+  };
+  action.title = l10n_util::GetNSString(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE);
+  action.accessibilityIdentifier = @"Undo";
+
+  TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
+  MDCSnackbarMessage* message = [MDCSnackbarMessage
+      messageWithText:l10n_util::GetNSString(
+                          IDS_IOS_NEW_TAB_MOST_VISITED_ITEM_REMOVED)];
+  message.action = action;
+  message.category = @"MostVisitedUndo";
+  [MDCSnackbarManager showMessage:message];
+}
+
 @end
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.h b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.h
index 00d2d4d..0ba0a2e 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.h
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.h
@@ -26,6 +26,7 @@
 
 @protocol ContentSuggestionsCommands;
 @class ContentSuggestionIdentifier;
+class GURL;
 
 // Mediator for ContentSuggestions. Makes the interface between a
 // ntp_snippets::ContentSuggestionsService and the Objective-C services using
@@ -52,6 +53,12 @@
 - (void)dismissSuggestion:
     (nonnull ContentSuggestionIdentifier*)suggestionIdentifier;
 
+// Blacklists the URL from the Most Visited sites.
+- (void)blacklistMostVisitedURL:(GURL)URL;
+
+// Whitelists the URL from the Most Visited sites.
+- (void)whitelistMostVisitedURL:(GURL)URL;
+
 @end
 
 #endif  // IOS_CHROME_BROWSER_CONTENT_SUGGESTIONS_CONTENT_SUGGESTIONS_MEDIATOR_H_
diff --git a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
index 1fba1201dd..d44703e 100644
--- a/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
+++ b/ios/chrome/browser/content_suggestions/content_suggestions_mediator.mm
@@ -125,6 +125,14 @@
   self.contentService->DismissSuggestion(suggestion_id);
 }
 
+- (void)blacklistMostVisitedURL:(GURL)URL {
+  _mostVisitedSites->AddOrRemoveBlacklistedUrl(URL, true);
+}
+
+- (void)whitelistMostVisitedURL:(GURL)URL {
+  _mostVisitedSites->AddOrRemoveBlacklistedUrl(URL, false);
+}
+
 #pragma mark - ContentSuggestionsDataSource
 
 - (NSArray<ContentSuggestionsSectionInformation*>*)sectionsInfo {
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h
index f20fccb..ebcfb02c 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h
@@ -17,10 +17,15 @@
 // Opens the Most Visited associated with this |item| at the |mostVisitedItem|.
 - (void)openMostVisitedItem:(nonnull CollectionViewItem*)item
                     atIndex:(NSInteger)mostVisitedIndex;
-// Displays a context menu for opening the |articleItem|.
-- (void)displayContextMenuForArticle:(nonnull CollectionViewItem*)item
+// Displays a context menu for the |articleItem|.
+- (void)displayContextMenuForArticle:(nonnull CollectionViewItem*)articleItem
                              atPoint:(CGPoint)touchLocation
                          atIndexPath:(nonnull NSIndexPath*)indexPath;
+// Displays a context menu for the |mostVisitedItem|.
+- (void)displayContextMenuForMostVisitedItem:
+            (nonnull CollectionViewItem*)mostVisitedItem
+                                     atPoint:(CGPoint)touchLocation
+                                 atIndexPath:(nonnull NSIndexPath*)indexPath;
 // Dismisses the context menu if it is displayed.
 - (void)dismissContextMenu;
 
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
index 6283c89..ff1422e 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -194,6 +194,17 @@
 
 #pragma mark - MDCCollectionViewStylingDelegate
 
+// TODO(crbug.com/724493): Use collectionView:hidesInkViewAtIndexPath: when it
+// is fixed. For now hidding the ink prevent cell interaction.
+- (UIColor*)collectionView:(UICollectionView*)collectionView
+       inkColorAtIndexPath:(NSIndexPath*)indexPath {
+  if ([self.collectionUpdater
+          shouldUseCustomStyleForSection:indexPath.section]) {
+    return [UIColor clearColor];
+  }
+  return nil;
+}
+
 - (UIColor*)collectionView:(nonnull UICollectionView*)collectionView
     cellBackgroundColorAtIndexPath:(nonnull NSIndexPath*)indexPath {
   if ([self.collectionUpdater
@@ -248,16 +259,25 @@
   CollectionViewItem* touchedItem =
       [self.collectionViewModel itemAtIndexPath:touchedItemIndexPath];
 
-  if ([self.collectionUpdater contentSuggestionTypeForItem:touchedItem] !=
-      ContentSuggestionTypeArticle) {
-    // Only trigger context menu on articles.
-    return;
+  ContentSuggestionType type =
+      [self.collectionUpdater contentSuggestionTypeForItem:touchedItem];
+  switch (type) {
+    case ContentSuggestionTypeArticle:
+      [self.suggestionCommandHandler
+          displayContextMenuForArticle:touchedItem
+                               atPoint:touchLocation
+                           atIndexPath:touchedItemIndexPath];
+      break;
+    case ContentSuggestionTypeMostVisited:
+      [self.suggestionCommandHandler
+          displayContextMenuForMostVisitedItem:touchedItem
+                                       atPoint:touchLocation
+                                   atIndexPath:touchedItemIndexPath];
+      break;
+    default:
+      break;
   }
 
-  [self.suggestionCommandHandler
-      displayContextMenuForArticle:touchedItem
-                           atPoint:touchLocation
-                       atIndexPath:touchedItemIndexPath];
 }
 
 // Checks if the |section| is empty and add an empty element if it is the case.
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
index e23b18f..48c1185 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
@@ -10,13 +10,12 @@
 #include "base/metrics/histogram_macros.h"
 #include "base/metrics/user_metrics.h"
 #include "base/metrics/user_metrics_action.h"
-#include "base/strings/sys_string_conversions.h"
 #include "base/time/time.h"
 #include "components/reading_list/core/reading_list_entry.h"
 #include "components/strings/grit/components_strings.h"
-#include "components/url_formatter/url_formatter.h"
 #include "ios/chrome/browser/reading_list/offline_url_utils.h"
 #import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h"
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h"
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h"
 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
 #import "ios/chrome/browser/ui/favicon/favicon_attributes_provider.h"
@@ -59,9 +58,6 @@
 // Typedef for a block taking a GURL as parameter and returning nothing.
 typedef void (^EntryUpdater)(const GURL&);
 
-// Type for map used to sort ReadingListEntry by timestamp. Multiple entries can
-// have the same timestamp.
-using ItemsMapByDate = std::multimap<int64_t, ReadingListCollectionViewItem*>;
 }
 
 @interface ReadingListCollectionViewController ()<
@@ -88,28 +84,19 @@
 - (void)donePressed;
 // Loads all the items in all sections.
 - (void)loadItems;
-// Fills section |sectionIdentifier| with the items from |map| in reverse order
-// of the map key.
-- (void)loadItemsFromMap:(const ItemsMapByDate&)map
-               toSection:(SectionIdentifier)sectionIdentifier;
+// Fills section |sectionIdentifier| with the items from |array|.
+- (void)loadItemsFromArray:(NSArray<ReadingListCollectionViewItem*>*)array
+                 toSection:(SectionIdentifier)sectionIdentifier;
 // Whether the data source has changed.
 - (BOOL)hasDataSourceChanged;
 // Returns whether there is a difference between the elements contained in the
-// |sectionIdentifier| and those in the |map|.
+// |sectionIdentifier| and those in the |array|.
 - (BOOL)section:(SectionIdentifier)sectionIdentifier
-    isDifferentOfMap:(ItemsMapByDate&)map;
+    isDifferentOfArray:(NSArray<ReadingListCollectionViewItem*>*)array;
 // Reloads the data if a changed occured during editing
 - (void)applyPendingUpdates;
-// Convenience method to create cell items for reading list entries.
-- (ReadingListCollectionViewItem*)cellItemForReadingListEntry:
-    (const ReadingListEntry&)entry;
-// Sets and fetches the |faviconURL| of this |item|, then reconfigures it.
-- (void)setItem:(ReadingListCollectionViewItem*)item
-     faviconURL:(const GURL&)url;
-// Fills the |unread_map| and the |read_map| with the corresponding
-// ReadingListCollectionViewItem from the data source.
-- (void)fillUnreadMap:(ItemsMapByDate&)unread_map
-              readMap:(ItemsMapByDate&)read_map;
+// Fetches the |faviconURL| of this |item|, then reconfigures the item.
+- (void)fetchFaviconForItem:(ReadingListCollectionViewItem*)item;
 // Returns whether there are elements in the section identified by
 // |sectionIdentifier|.
 - (BOOL)hasItemInSection:(SectionIdentifier)sectionIdentifier;
@@ -488,48 +475,36 @@
   }
 }
 
-- (void)loadItemsFromMap:(const ItemsMapByDate&)map
-               toSection:(SectionIdentifier)sectionIdentifier {
-  if (map.size() == 0) {
+- (void)loadItemsFromArray:(NSArray<ReadingListCollectionViewItem*>*)items
+                 toSection:(SectionIdentifier)sectionIdentifier {
+  if (items.count == 0) {
     return;
   }
   CollectionViewModel* model = self.collectionViewModel;
   [model addSectionWithIdentifier:sectionIdentifier];
   [model setHeader:[self headerForSection:sectionIdentifier]
       forSectionWithIdentifier:sectionIdentifier];
-  // Reverse iterate to add newer entries at the top.
-  ItemsMapByDate::const_reverse_iterator iterator = map.rbegin();
-  for (; iterator != map.rend(); iterator++) {
-    [model addItem:iterator->second toSectionWithIdentifier:sectionIdentifier];
+  for (ReadingListCollectionViewItem* item in items) {
+    item.type = ItemTypeItem;
+    [self fetchFaviconForItem:item];
+    item.accessibilityDelegate = self;
+    [model addItem:item toSectionWithIdentifier:sectionIdentifier];
   }
 }
 
 - (void)loadItems {
-  ItemsMapByDate read_map;
-  ItemsMapByDate unread_map;
-  [self fillUnreadMap:unread_map readMap:read_map];
-  [self loadItemsFromMap:unread_map toSection:SectionIdentifierUnread];
-  [self loadItemsFromMap:read_map toSection:SectionIdentifierRead];
+  NSMutableArray<ReadingListCollectionViewItem*>* readArray =
+      [NSMutableArray array];
+  NSMutableArray<ReadingListCollectionViewItem*>* unreadArray =
+      [NSMutableArray array];
+  [self.dataSource fillReadItems:readArray unreadItems:unreadArray];
+  [self loadItemsFromArray:unreadArray toSection:SectionIdentifierUnread];
+  [self loadItemsFromArray:readArray toSection:SectionIdentifierRead];
 
-  BOOL hasRead = read_map.size() > 0;
+  BOOL hasRead = readArray.count > 0;
   [_toolbar setHasReadItem:hasRead];
 }
 
-- (void)fillUnreadMap:(ItemsMapByDate&)unread_map
-              readMap:(ItemsMapByDate&)read_map {
-  for (const auto& url : [self.dataSource keys]) {
-    const ReadingListEntry* entry = [self.dataSource entryWithURL:url];
-    ReadingListCollectionViewItem* item =
-        [self cellItemForReadingListEntry:*entry];
-    item.accessibilityDelegate = self;
-    if (entry->IsRead()) {
-      read_map.insert(std::make_pair(entry->UpdateTime(), item));
-    } else {
-      unread_map.insert(std::make_pair(entry->UpdateTime(), item));
-    }
-  }
-}
-
 - (void)applyPendingUpdates {
   if (_dataSourceHasBeenModified) {
     [self reloadData];
@@ -537,39 +512,39 @@
 }
 
 - (BOOL)hasDataSourceChanged {
-  ItemsMapByDate read_map;
-  ItemsMapByDate unread_map;
-  [self fillUnreadMap:unread_map readMap:read_map];
+  NSMutableArray<ReadingListCollectionViewItem*>* readArray =
+      [NSMutableArray array];
+  NSMutableArray<ReadingListCollectionViewItem*>* unreadArray =
+      [NSMutableArray array];
+  [self.dataSource fillReadItems:readArray unreadItems:unreadArray];
 
-  if ([self section:SectionIdentifierRead isDifferentOfMap:read_map])
+  if ([self section:SectionIdentifierRead isDifferentOfArray:readArray])
     return YES;
-  if ([self section:SectionIdentifierUnread isDifferentOfMap:unread_map])
+  if ([self section:SectionIdentifierUnread isDifferentOfArray:unreadArray])
     return YES;
 
   return NO;
 }
 
 - (BOOL)section:(SectionIdentifier)sectionIdentifier
-    isDifferentOfMap:(ItemsMapByDate&)map {
+    isDifferentOfArray:(NSArray<ReadingListCollectionViewItem*>*)array {
   if (![self.collectionViewModel
           hasSectionForSectionIdentifier:sectionIdentifier]) {
-    return !map.empty();
+    return array.count > 0;
   }
 
   NSArray* items =
       [self.collectionViewModel itemsInSectionWithIdentifier:sectionIdentifier];
-  if ([items count] != map.size())
+  if (items.count != array.count)
     return YES;
 
   NSMutableArray<ReadingListCollectionViewItem*>* itemsToReconfigure =
       [NSMutableArray array];
 
   NSInteger index = 0;
-  ItemsMapByDate::const_reverse_iterator iterator = map.rbegin();
-  for (; iterator != map.rend(); iterator++) {
+  for (ReadingListCollectionViewItem* newItem in array) {
     ReadingListCollectionViewItem* oldItem =
         base::mac::ObjCCastStrict<ReadingListCollectionViewItem>(items[index]);
-    ReadingListCollectionViewItem* newItem = iterator->second;
     if (oldItem.url == newItem.url) {
       if (![oldItem isEqual:newItem]) {
         oldItem.title = newItem.title;
@@ -580,7 +555,8 @@
         [itemsToReconfigure addObject:oldItem];
       }
       if (oldItem.faviconPageURL != newItem.faviconPageURL) {
-        [self setItem:oldItem faviconURL:newItem.faviconPageURL];
+        oldItem.faviconPageURL = newItem.faviconPageURL;
+        [self fetchFaviconForItem:oldItem];
       }
     }
     if (![oldItem isEqual:newItem]) {
@@ -592,39 +568,7 @@
   return NO;
 }
 
-- (ReadingListCollectionViewItem*)cellItemForReadingListEntry:
-    (const ReadingListEntry&)entry {
-  GURL url = entry.URL();
-  ReadingListCollectionViewItem* item = [[ReadingListCollectionViewItem alloc]
-           initWithType:ItemTypeItem
-                    url:url
-      distillationState:reading_list::UIStatusFromModelStatus(
-                            entry.DistilledState())];
-
-  [self setItem:item
-      faviconURL:entry.DistilledURL().is_valid() ? entry.DistilledURL() : url];
-
-  BOOL has_distillation_details =
-      entry.DistilledState() == ReadingListEntry::PROCESSED &&
-      entry.DistillationSize() != 0 && entry.DistillationTime() != 0;
-  NSString* fullUrlString =
-      base::SysUTF16ToNSString(url_formatter::FormatUrl(url));
-  NSString* urlString =
-      base::SysUTF16ToNSString(url_formatter::FormatUrl(url.GetOrigin()));
-  NSString* title = base::SysUTF8ToNSString(entry.Title());
-  item.title = [title length] ? title : fullUrlString;
-  item.subtitle = urlString;
-  item.distillationDate =
-      has_distillation_details ? entry.DistillationTime() : 0;
-  item.distillationSize =
-      has_distillation_details ? entry.DistillationSize() : 0;
-  return item;
-}
-
-- (void)setItem:(ReadingListCollectionViewItem*)item
-     faviconURL:(const GURL&)url {
-  item.faviconPageURL = url;
-
+- (void)fetchFaviconForItem:(ReadingListCollectionViewItem*)item {
   __weak ReadingListCollectionViewItem* weakItem = item;
   __weak ReadingListCollectionViewController* weakSelf = self;
   void (^completionBlock)(FaviconAttributes* attributes) =
@@ -642,7 +586,7 @@
         }
       };
 
-  [self.attributesProvider fetchFaviconAttributesForURL:url
+  [self.attributesProvider fetchFaviconAttributesForURL:item.faviconPageURL
                                              completion:completionBlock];
 }
 
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_data_source.h b/ios/chrome/browser/ui/reading_list/reading_list_data_source.h
index 0d052e7..0feb01d 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_data_source.h
+++ b/ios/chrome/browser/ui/reading_list/reading_list_data_source.h
@@ -12,6 +12,7 @@
 
 class GURL;
 class ReadingListEntry;
+@class ReadingListCollectionViewItem;
 @protocol ReadingListDataSink;
 
 // Data Source for the Reading List UI, providing the data sink with the data to
@@ -36,8 +37,14 @@
 // Removes the entry associated with |URL|.
 - (void)removeEntryWithURL:(const GURL&)URL;
 
+// Fills the |readArray| and |unreadArray| with the corresponding items from the
+// model. The items are sorted most recent first.
+- (void)fillReadItems:
+            (nullable NSMutableArray<ReadingListCollectionViewItem*>*)readArray
+          unreadItems:(nullable NSMutableArray<ReadingListCollectionViewItem*>*)
+                          unreadArray;
+
 // TODO(crbug.com/721758): Return ReadingListItem directly.
-- (const std::vector<GURL>)keys;
 - (const ReadingListEntry* _Nullable)entryWithURL:(const GURL&)URL;
 
 // TODO(crbug.com/721758): Batch updates should be done in the mediator.
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm b/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm
index 8156730..6738d8d 100644
--- a/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm
+++ b/ios/chrome/browser/ui/reading_list/reading_list_mediator.mm
@@ -4,15 +4,27 @@
 
 #import "ios/chrome/browser/ui/reading_list/reading_list_mediator.h"
 
+#include <algorithm>
+
 #include "base/metrics/histogram_macros.h"
+#include "base/strings/sys_string_conversions.h"
 #include "components/reading_list/core/reading_list_model.h"
 #import "components/reading_list/ios/reading_list_model_bridge_observer.h"
+#include "components/url_formatter/url_formatter.h"
+#import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_item.h"
 #import "ios/chrome/browser/ui/reading_list/reading_list_data_sink.h"
+#import "ios/chrome/browser/ui/reading_list/reading_list_utils.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
 #error "This file requires ARC support."
 #endif
 
+namespace {
+bool EntrySorter(const ReadingListEntry* rhs, const ReadingListEntry* lhs) {
+  return rhs->UpdateTime() > lhs->UpdateTime();
+}
+}  // namespace
+
 @interface ReadingListMediator ()<ReadingListModelBridgeObserver> {
   std::unique_ptr<ReadingListModelBridge> _modelBridge;
 }
@@ -51,10 +63,6 @@
   self.model->SetReadStatus(URL, read);
 }
 
-- (const std::vector<GURL>)keys {
-  return self.model->Keys();
-}
-
 - (const ReadingListEntry*)entryWithURL:(const GURL&)URL {
   return self.model->GetEntryByURL(URL);
 }
@@ -63,6 +71,36 @@
   self.model->RemoveEntryByURL(URL);
 }
 
+- (void)fillReadItems:(NSMutableArray<ReadingListCollectionViewItem*>*)readArray
+          unreadItems:
+              (NSMutableArray<ReadingListCollectionViewItem*>*)unreadArray {
+  std::vector<const ReadingListEntry*> readEntries;
+  std::vector<const ReadingListEntry*> unreadEntries;
+
+  for (const auto& url : self.model->Keys()) {
+    const ReadingListEntry* entry = self.model->GetEntryByURL(url);
+    DCHECK(entry);
+    if (entry->IsRead()) {
+      readEntries.push_back(entry);
+    } else {
+      unreadEntries.push_back(entry);
+    }
+  }
+
+  std::sort(readEntries.begin(), readEntries.end(), EntrySorter);
+  std::sort(unreadEntries.begin(), unreadEntries.end(), EntrySorter);
+
+  for (const ReadingListEntry* entry : readEntries) {
+    [readArray addObject:[self cellItemForReadingListEntry:entry]];
+  }
+
+  for (const ReadingListEntry* entry : unreadEntries) {
+    [unreadArray addObject:[self cellItemForReadingListEntry:entry]];
+  }
+
+  DCHECK(self.model->Keys().size() == [readArray count] + [unreadArray count]);
+}
+
 - (std::unique_ptr<ReadingListModel::ScopedReadingListBatchUpdate>)
     beginBatchUpdates {
   return self.model->BeginBatchUpdates();
@@ -110,4 +148,38 @@
   [self.dataSink readingListModelCompletedBatchUpdates];
 }
 
+#pragma mark - Private
+
+// Creates a ReadingListCollectionViewItem from a ReadingListEntry |entry|.
+- (ReadingListCollectionViewItem*)cellItemForReadingListEntry:
+    (const ReadingListEntry*)entry {
+  const GURL& url = entry->URL();
+  ReadingListCollectionViewItem* item = [[ReadingListCollectionViewItem alloc]
+           initWithType:0
+                    url:url
+      distillationState:reading_list::UIStatusFromModelStatus(
+                            entry->DistilledState())];
+
+  item.faviconPageURL =
+      entry->DistilledURL().is_valid() ? entry->DistilledURL() : url;
+
+  BOOL has_distillation_details =
+      entry->DistilledState() == ReadingListEntry::PROCESSED &&
+      entry->DistillationSize() != 0 && entry->DistillationTime() != 0;
+  NSString* title = base::SysUTF8ToNSString(entry->Title());
+  if ([title length]) {
+    item.title = title;
+  } else {
+    item.title =
+        base::SysUTF16ToNSString(url_formatter::FormatUrl(url.GetOrigin()));
+  }
+  item.subtitle =
+      base::SysUTF16ToNSString(url_formatter::FormatUrl(url.GetOrigin()));
+  item.distillationDate =
+      has_distillation_details ? entry->DistillationTime() : 0;
+  item.distillationSize =
+      has_distillation_details ? entry->DistillationSize() : 0;
+  return item;
+}
+
 @end
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
index 6b6c99c..d34592b0 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -111,7 +111,6 @@
 Bug(none) virtual/new-remote-playback-pipeline/media/controls/video-controls-with-cast-rendering.html [ Failure ]
 Bug(none) virtual/new-remote-playback-pipeline/media/controls/video-overlay-cast-dark-rendering.html [ Failure ]
 Bug(none) virtual/new-remote-playback-pipeline/media/controls/video-overlay-cast-light-rendering.html [ Failure ]
-Bug(none) virtual/new-remote-playback-pipeline/media/controls/controls-cast-do-not-fade-out.html [ Failure Crash ]
 Bug(none) svg/foreignObject/overflow-clip-in-hidden-container-crash.html [ Crash ]
 Bug(none) images/rendering-broken-0px-images.html [ Failure ]
 Bug(none) images/rendering-broken-0px-images-quirk.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 83b6a0d..8dea114c 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -431,7 +431,6 @@
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/margin-collapse-clear-014.xht [ Failure ]
 
 ### virtual/layout_ng/external/wpt/css/CSS2/linebox
-crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/empty-inline-002.xht [ Crash Failure ]
 crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-001.xht [ Failure ]
 crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-002.xht [ Failure ]
 crbug.com/636993 virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-003.xht [ Failure ]
@@ -485,16 +484,8 @@
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-001.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-context-height-002.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-formatting-contexts-015.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-001a.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-001f.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-002f.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-003.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-004.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-007.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-008a.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-009.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-010.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-insert-011.xht [ Failure ]
 crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-001a.xht [ Failure ]
 crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-001b.xht [ Failure ]
 crbug.com/719646 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/block-in-inline-margins-002a.xht [ Failure ]
@@ -564,7 +555,6 @@
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-006.xht [ Skip ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-013.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-017.xht [ Failure ]
-crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inlines-020.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-002.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-004.xht [ Failure ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/normal-flow/max-height-005.xht [ Failure ]
@@ -1087,24 +1077,6 @@
 
 crbug.com/543110 [ Mac ] fast/text/international/text-shaping-arabic.html [ Failure ]
 
-crbug.com/729318 [ Win ] editing/selection/select-text-overflow-ellipsis.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/text-overflow-ellipsis-text-align-center.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/text-overflow-ellipsis-text-align-justify.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/text-overflow-ellipsis-text-align-left.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/text-overflow-ellipsis-text-align-right.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/text-overflow-input.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/vertical-text-overflow-ellipsis-text-align-center.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/css/vertical-text-overflow-ellipsis-text-align-right.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux Win ] fast/overflow/line-clamp.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux ] fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux ] fast/text/place-mixed-ellipsis-in-inline-blocks-2.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux ] fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux ] fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux ] fast/text/place-mixed-ellipsis-in-inline-blocks-align-left.html [ NeedsRebaseline ]
-crbug.com/729318 [ Linux ] fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2.html [ NeedsRebaseline ]
-crbug.com/729318 [ Win ] paint/spellmarkers/inline_spelling_markers.html [ NeedsRebaseline ]
-crbug.com/729318 [ Win ] virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers.html [ NeedsRebaseline ]
-
 # Will be re-enabled and rebaselined once we remove the '--enable-file-cookies' flag.
 crbug.com/470482 fast/cookies/local-file-can-set-cookies.html [ Skip ]
 
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png
index 086eb67..0b12418 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.txt
index 1168d64b0..f1097e8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.txt
@@ -51,13 +51,13 @@
     LayoutText {#text} at (2,61) size 696x19
       text run at (2,61) width 696: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-layer at (8,352) size 310x32 clip at (9,353) size 308x30 scrollWidth 751
+layer at (8,352) size 310x32 clip at (9,353) size 308x30 scrollWidth 747
   LayoutBlockFlow {DIV} at (0,343.88) size 310x32 [border: (1px solid #000000)]
-    LayoutText {#text} at (4,11) size 182x19
-      text run at (4,11) width 182: "Lorem ipsum dolor sit amet, "
-    LayoutImage {IMG} at (185.50,1) size 25x25
-    LayoutText {#text} at (210,11) size 542x19
-      text run at (210,11) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (1,11) size 181x19
+      text run at (1,11) width 181: "Lorem ipsum dolor sit amet, "
+    LayoutImage {IMG} at (182,1) size 25x25
+    LayoutText {#text} at (207,11) size 542x19
+      text run at (207,11) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,446) size 310x32 clip at (9,447) size 308x30 scrollWidth 743
   LayoutBlockFlow {DIV} at (0,437.59) size 310x32 [border: (1px solid #000000)]
     LayoutText {#text} at (1,11) size 271x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png
index 01aed3169..3a187567 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png
index b032e144..04c5d1dc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png
index fc96808e..95636a0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.txt
index f38b78c..f8cd53bd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.txt
@@ -51,13 +51,13 @@
     LayoutText {#text} at (4,61) size 696x19
       text run at (4,61) width 696: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-layer at (8,352) size 310x32 clip at (9,353) size 308x30 scrollWidth 754
+layer at (8,352) size 310x32 clip at (9,353) size 308x30 scrollWidth 747
   LayoutBlockFlow {DIV} at (0,343.88) size 310x32 [border: (1px solid #000000)]
-    LayoutText {#text} at (8,11) size 181x19
-      text run at (8,11) width 181: "Lorem ipsum dolor sit amet, "
-    LayoutImage {IMG} at (189,1) size 25x25
-    LayoutText {#text} at (214,11) size 542x19
-      text run at (214,11) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (1,11) size 181x19
+      text run at (1,11) width 181: "Lorem ipsum dolor sit amet, "
+    LayoutImage {IMG} at (182,1) size 25x25
+    LayoutText {#text} at (207,11) size 542x19
+      text run at (207,11) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,446) size 310x32 clip at (9,447) size 308x30 scrollWidth 743
   LayoutBlockFlow {DIV} at (0,437.59) size 310x32 [border: (1px solid #000000)]
     LayoutText {#text} at (1,11) size 271x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-input-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-input-expected.png
index 7f7f529a..3e183cfc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-input-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-input-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
index e342f30..b4a850f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
@@ -45,13 +45,13 @@
     LayoutText {#text} at (61,2) size 19x696
       text run at (61,2) width 696: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-layer at (8,793) size 32x310 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 751
+layer at (8,793) size 32x310 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 747
   LayoutBlockFlow {DIV} at (0,785.16) size 32x310 [border: (1px solid #000000)]
-    LayoutText {#text} at (11,4) size 19x182
-      text run at (11,4) width 181: "Lorem ipsum dolor sit amet, "
-    LayoutImage {IMG} at (1,185.50) size 25x25
-    LayoutText {#text} at (11,210) size 19x542
-      text run at (11,210) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (11,1) size 19x181
+      text run at (11,1) width 181: "Lorem ipsum dolor sit amet, "
+    LayoutImage {IMG} at (1,182) size 25x25
+    LayoutText {#text} at (11,207) size 19x542
+      text run at (11,207) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,1165) size 32x310 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 743
   LayoutBlockFlow {DIV} at (0,1156.88) size 32x310 [border: (1px solid #000000)]
     LayoutText {#text} at (11,1) size 19x271
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
index 3749faa..d9fae9e2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
@@ -45,13 +45,13 @@
     LayoutText {#text} at (61,4) size 19x696
       text run at (61,4) width 696: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-layer at (8,793) size 32x310 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 754
+layer at (8,793) size 32x310 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 747
   LayoutBlockFlow {DIV} at (0,785.16) size 32x310 [border: (1px solid #000000)]
-    LayoutText {#text} at (11,8) size 19x181
-      text run at (11,8) width 181: "Lorem ipsum dolor sit amet, "
-    LayoutImage {IMG} at (1,189) size 25x25
-    LayoutText {#text} at (11,214) size 19x542
-      text run at (11,214) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (11,1) size 19x181
+      text run at (11,1) width 181: "Lorem ipsum dolor sit amet, "
+    LayoutImage {IMG} at (1,182) size 25x25
+    LayoutText {#text} at (11,207) size 19x542
+      text run at (11,207) width 542: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,1165) size 32x310 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 743
   LayoutBlockFlow {DIV} at (0,1156.88) size 32x310 [border: (1px solid #000000)]
     LayoutText {#text} at (11,1) size 19x271
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/line-clamp-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/line-clamp-expected.png
index efdaba0..3cf3f40d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/line-clamp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/line-clamp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png
index b5f48f6..7678c35 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png
index 6724aed..0d91d53 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png
index 2a3dbe0b..f335eb8f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png
index 90f148f..ecb0186 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png
index 1a4d7c6..0a2b744 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png
index 91ebe2d9..6b3078d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png
new file mode 100644
index 0000000..67c1b5e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-text-overflow-ellipsis-expected.png b/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-text-overflow-ellipsis-expected.png
index 95be8fe..0b22f1a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-text-overflow-ellipsis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-text-overflow-ellipsis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png
index 745f2b4f..e7a61ed 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.txt
index 3800b4c..2039b534d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.txt
@@ -45,8 +45,8 @@
     LayoutText {#text} at (2,21) size 674x19
       text run at (2,21) width 674: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-    LayoutText {#text} at (3,41) size 666x19
-      text run at (3,41) width 666: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (1,41) size 666x19
+      text run at (1,41) width 666: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
     LayoutText {#text} at (3,61) size 661x19
       text run at (3,61) width 661: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png
index 89299a1..e850040 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png
index 780519f3..aa621ef 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png
index 4331fbd0..522831f4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.txt
index 51989d2..43ebeb41 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.txt
@@ -45,8 +45,8 @@
     LayoutText {#text} at (4,21) size 674x19
       text run at (4,21) width 674: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-    LayoutText {#text} at (5,41) size 666x19
-      text run at (5,41) width 666: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (1,41) size 666x19
+      text run at (1,41) width 666: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
     LayoutText {#text} at (6,61) size 661x19
       text run at (6,61) width 661: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-input-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-input-expected.png
index 03e3ad7..5b451f7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-input-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-input-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png
index 34baf97..2a3406f4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
index 3245a3d4..1cec4c0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
@@ -39,8 +39,8 @@
     LayoutText {#text} at (21,2) size 19x674
       text run at (21,2) width 673: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-    LayoutText {#text} at (41,3) size 19x665
-      text run at (41,3) width 665: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (41,1) size 19x665
+      text run at (41,1) width 665: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
     LayoutText {#text} at (61,3) size 19x661
       text run at (61,3) width 660: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png
index 27d97645..f198580f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
index 016d3d89..2d4f6d8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
@@ -39,8 +39,8 @@
     LayoutText {#text} at (21,4) size 19x673
       text run at (21,4) width 673: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
-    LayoutText {#text} at (41,5) size 19x665
-      text run at (41,5) width 665: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    LayoutText {#text} at (41,1) size 19x665
+      text run at (41,1) width 665: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     LayoutBR {BR} at (0,0) size 0x0
     LayoutText {#text} at (61,6) size 19x660
       text run at (61,6) width 660: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/overflow/line-clamp-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/overflow/line-clamp-expected.png
index 381f323..9ed7bcb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/overflow/line-clamp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/overflow/line-clamp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/inline_spelling_markers-expected.png b/third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/inline_spelling_markers-expected.png
index ef6ae48..253eca56 100644
--- a/third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/inline_spelling_markers-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/inline_spelling_markers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png
new file mode 100644
index 0000000..253eca56
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png
Binary files differ
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp
index 9fea296..6950a92 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -756,10 +756,11 @@
     if (target_element->GetLayoutObject() &&
         target_element->GetLayoutObject()->IsBoxModelObject() &&
         target_element->GetLayoutObject()->HasLayer()) {
+      PaintLayer* paint_layer =
+          ToLayoutBoxModelObject(target_element->GetLayoutObject())->Layer();
       CompositorElementId target_element_id =
-          CompositorElementIdFromLayoutObjectId(
-              target_element->GetLayoutObject()->UniqueId(),
-              CompositorElementIdNamespace::kPrimary);
+          CompositorElementIdFromPaintLayerId(
+              paint_layer->UniqueId(), CompositorElementIdNamespace::kPrimary);
       if (!composited_element_ids->Contains(target_element_id))
         return false;
     } else {
diff --git a/third_party/WebKit/Source/core/animation/AnimationTest.cpp b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
index 1aaf462..14fc316c 100644
--- a/third_party/WebKit/Source/core/animation/AnimationTest.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
@@ -807,8 +807,8 @@
   Optional<CompositorElementIdSet> composited_element_ids =
       CompositorElementIdSet();
   CompositorElementId expected_compositor_element_id =
-      CompositorElementIdFromLayoutObjectId(
-          ToLayoutBoxModelObject(object_composited)->UniqueId(),
+      CompositorElementIdFromPaintLayerId(
+          ToLayoutBoxModelObject(object_composited)->Layer()->UniqueId(),
           CompositorElementIdNamespace::kPrimary);
   composited_element_ids->insert(expected_compositor_element_id);
 
diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
index d450391..7b2c1ea 100644
--- a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
+++ b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp
@@ -467,9 +467,8 @@
   }
 
   CompositorAnimationPlayer* compositor_player = animation.CompositorPlayer();
-  compositor_player->AttachElement(CompositorElementIdFromLayoutObjectId(
-      element.GetLayoutObject()->UniqueId(),
-      CompositorElementIdNamespace::kPrimary));
+  compositor_player->AttachElement(CompositorElementIdFromPaintLayerId(
+      layer->UniqueId(), CompositorElementIdNamespace::kPrimary));
 }
 
 bool CompositorAnimations::ConvertTimingForCompositor(
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
index ccec0ab4..42139dd 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
@@ -37,6 +37,7 @@
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/weborigin/SecurityPolicy.h"
 #include "platform/wtf/text/StringBuilder.h"
 
@@ -92,7 +93,10 @@
     ResourceRequest resource_request(absolute_resource_);
     resource_request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer(
         referrer_.referrer_policy, resource_request.Url(), referrer_.referrer));
-    FetchParameters params(resource_request, FetchInitiatorTypeNames::css);
+    ResourceLoaderOptions options(kAllowStoredCredentials,
+                                  kClientRequestedCredentials);
+    options.initiator_info.name = FetchInitiatorTypeNames::css;
+    FetchParameters params(resource_request, options);
     if (RuntimeEnabledFeatures::webFontsCacheAwareTimeoutAdaptationEnabled())
       params.SetCacheAwareLoadingEnabled(kIsCacheAwareLoadingEnabled);
     params.SetContentSecurityCheck(should_check_content_security_policy_);
diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
index e0e48a96..55b9873 100644
--- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
@@ -113,7 +113,10 @@
     ImageWithScale image = BestImageForScaleFactor(device_scale_factor);
     ResourceRequest resource_request(document.CompleteURL(image.image_url));
     resource_request.SetHTTPReferrer(image.referrer);
-    FetchParameters params(resource_request, FetchInitiatorTypeNames::css);
+    ResourceLoaderOptions options(kAllowStoredCredentials,
+                                  kClientRequestedCredentials);
+    options.initiator_info.name = FetchInitiatorTypeNames::css;
+    FetchParameters params(resource_request, options);
 
     if (cross_origin != kCrossOriginAttributeNotSet) {
       params.SetCrossOriginAccessControl(document.GetSecurityOrigin(),
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
index fc34201f..1012766 100644
--- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
@@ -30,6 +30,7 @@
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/SecurityPolicy.h"
 
@@ -60,9 +61,12 @@
     ResourceRequest resource_request(absolute_url_);
     resource_request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer(
         referrer_.referrer_policy, resource_request.Url(), referrer_.referrer));
-    FetchParameters params(resource_request, initiator_name_.IsEmpty()
-                                                 ? FetchInitiatorTypeNames::css
-                                                 : initiator_name_);
+    ResourceLoaderOptions options(kAllowStoredCredentials,
+                                  kClientRequestedCredentials);
+    options.initiator_info.name = initiator_name_.IsEmpty()
+                                      ? FetchInitiatorTypeNames::css
+                                      : initiator_name_;
+    FetchParameters params(resource_request, options);
 
     if (cross_origin != kCrossOriginAttributeNotSet) {
       params.SetCrossOriginAccessControl(document.GetSecurityOrigin(),
diff --git a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
index a236a30..5856e93 100644
--- a/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
+++ b/third_party/WebKit/Source/core/css/StyleRuleImport.cpp
@@ -28,6 +28,7 @@
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 
 namespace blink {
 
@@ -130,8 +131,11 @@
     root_sheet = sheet;
   }
 
-  FetchParameters params(ResourceRequest(abs_url), FetchInitiatorTypeNames::css,
-                         parent_style_sheet_->Charset());
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = FetchInitiatorTypeNames::css;
+  FetchParameters params(ResourceRequest(abs_url), options);
+  params.SetCharset(parent_style_sheet_->Charset());
   resource_ = CSSStyleSheetResource::Fetch(params, fetcher);
   if (resource_) {
     // if the import rule is issued dynamically, the sheet may be
diff --git a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp
index b966b4c..ff2108be 100644
--- a/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp
+++ b/third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp
@@ -35,6 +35,7 @@
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 
 namespace blink {
 
@@ -149,8 +150,11 @@
   String url = GetDocument().CompleteURL(href).GetString();
 
   StyleSheetResource* resource = nullptr;
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = FetchInitiatorTypeNames::processinginstruction;
   FetchParameters params(ResourceRequest(GetDocument().CompleteURL(href)),
-                         FetchInitiatorTypeNames::processinginstruction);
+                         options);
   if (is_xsl_) {
     if (RuntimeEnabledFeatures::xsltEnabled())
       resource = XSLStyleSheetResource::Fetch(params, GetDocument().Fetcher());
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index 33e3fa9..b66277a 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -721,7 +721,10 @@
         DocumentWriteIntervention::kDoNotFetchDocWrittenScript;
   }
 
-  FetchParameters params(resource_request, element_->InitiatorName());
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = element_->InitiatorName();
+  FetchParameters params(resource_request, options);
 
   // "... cryptographic nonce, ..."
   params.SetContentSecurityPolicyNonce(nonce);
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h
index 862d0a57..343619e 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -26,6 +26,7 @@
 #include "core/dom/Script.h"
 #include "core/dom/ScriptRunner.h"
 #include "core/html/CrossOriginAttribute.h"
+#include "platform/loader/fetch/IntegrityMetadata.h"
 #include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/wtf/text/TextPosition.h"
 #include "platform/wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp b/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp
index 8d84e1a..edb04ed 100644
--- a/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp
+++ b/third_party/WebKit/Source/core/exported/WebAssociatedURLLoaderImpl.cpp
@@ -44,6 +44,7 @@
 #include "platform/loader/fetch/CrossOriginAccessControl.h"
 #include "platform/loader/fetch/FetchUtils.h"
 #include "platform/loader/fetch/ResourceError.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/network/HTTPParsers.h"
 #include "platform/wtf/HashSet.h"
 #include "platform/wtf/PtrUtil.h"
@@ -392,10 +393,11 @@
         static_cast<PreflightPolicy>(options_.preflight_policy);
     options.fetch_request_mode = options_.fetch_request_mode;
 
-    ResourceLoaderOptions resource_loader_options;
-    resource_loader_options.allow_credentials =
-        options_.allow_credentials ? kAllowStoredCredentials
-                                   : kDoNotAllowStoredCredentials;
+    StoredCredentials allow_credentials = options_.allow_credentials
+                                              ? kAllowStoredCredentials
+                                              : kDoNotAllowStoredCredentials;
+    ResourceLoaderOptions resource_loader_options(
+        allow_credentials, kClientDidNotRequestCredentials);
     resource_loader_options.data_buffering_policy = kDoNotBufferData;
 
     const ResourceRequest& webcore_request = new_request.ToResourceRequest();
diff --git a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
index 646b749..2a81b7dd 100644
--- a/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
+++ b/third_party/WebKit/Source/core/fileapi/FileReaderLoader.cpp
@@ -41,6 +41,7 @@
 #include "platform/blob/BlobURL.h"
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/ResourceError.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/wtf/PassRefPtr.h"
@@ -100,11 +101,12 @@
   // FIXME: Is there a directive to which this load should be subject?
   options.content_security_policy_enforcement =
       kDoNotEnforceContentSecurityPolicy;
-  // Use special initiator to hide the request from the inspector.
-  options.initiator = FetchInitiatorTypeNames::internal;
 
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.allow_credentials = kAllowStoredCredentials;
+  ResourceLoaderOptions resource_loader_options(
+      kAllowStoredCredentials, kClientDidNotRequestCredentials);
+  // Use special initiator to hide the request from the inspector.
+  resource_loader_options.initiator_info.name =
+      FetchInitiatorTypeNames::internal;
 
   if (client_) {
     DCHECK(!loader_);
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 621ff4c..9a40729 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -1180,10 +1180,12 @@
 }
 
 void HTMLCanvasElement::PageVisibilityChanged() {
+  bool hidden = !GetPage()->IsPageVisible();
+  SetSuspendOffscreenCanvasAnimation(hidden);
+
   if (!context_)
     return;
 
-  bool hidden = !GetPage()->IsPageVisible();
   context_->SetIsHidden(hidden);
   if (hidden) {
     ClearCopiedImage();
diff --git a/third_party/WebKit/Source/core/html/LinkStyle.cpp b/third_party/WebKit/Source/core/html/LinkStyle.cpp
index 0dd8b39..3a49da4 100644
--- a/third_party/WebKit/Source/core/html/LinkStyle.cpp
+++ b/third_party/WebKit/Source/core/html/LinkStyle.cpp
@@ -16,6 +16,7 @@
 #include "core/loader/resource/CSSStyleSheetResource.h"
 #include "platform/Histogram.h"
 #include "platform/loader/fetch/FetchParameters.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/network/mime/ContentType.h"
 #include "platform/network/mime/MIMETypeRegistry.h"
@@ -325,7 +326,11 @@
         referrer_policy, url, GetDocument().OutgoingReferrer()));
   }
 
-  FetchParameters params(resource_request, owner_->localName(), charset);
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = owner_->localName();
+  FetchParameters params(resource_request, options);
+  params.SetCharset(charset);
 
   // Load stylesheets that are not needed for the layout immediately with low
   // priority.  When the link element is created by scripts, load the
diff --git a/third_party/WebKit/Source/core/html/imports/LinkImport.cpp b/third_party/WebKit/Source/core/html/imports/LinkImport.cpp
index eefcb06..d3bcae9 100644
--- a/third_party/WebKit/Source/core/html/imports/LinkImport.cpp
+++ b/third_party/WebKit/Source/core/html/imports/LinkImport.cpp
@@ -38,6 +38,7 @@
 #include "core/html/imports/HTMLImportTreeRoot.h"
 #include "core/html/imports/HTMLImportsController.h"
 #include "platform/loader/fetch/FetchParameters.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/ReferrerPolicy.h"
@@ -96,7 +97,11 @@
         referrer_policy, url, GetDocument().OutgoingReferrer()));
   }
 
-  FetchParameters params(resource_request, owner_->localName(), GetCharset());
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = owner_->localName();
+  FetchParameters params(resource_request, options);
+  params.SetCharset(GetCharset());
   params.SetContentSecurityPolicyNonce(owner_->nonce());
 
   child_ = controller->Load(parent, this, params);
diff --git a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
index fa7d2f4..4e5baee 100644
--- a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
+++ b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
@@ -11,6 +11,7 @@
 #include "platform/loader/fetch/FetchInitiatorInfo.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/weborigin/SecurityPolicy.h"
 
 namespace blink {
@@ -51,7 +52,10 @@
   if (resource_type_ == Resource::kScript)
     MaybeDisallowFetchForDocWrittenScript(resource_request, defer_, *document);
 
-  FetchParameters params(resource_request, initiator_info);
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info = initiator_info;
+  FetchParameters params(resource_request, options);
 
   if (resource_type_ == Resource::kImportResource) {
     SecurityOrigin* security_origin =
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
index ba11004..4ab6f2cf 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
@@ -19,6 +19,7 @@
 #include "platform/loader/fetch/RawResource.h"
 #include "platform/loader/fetch/Resource.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "public/platform/WebCachePolicy.h"
 #include "public/platform/WebURLRequest.h"
 
@@ -124,8 +125,10 @@
 
     if (!resource_request.Url().GetString().IsEmpty()) {
       urls_to_fetch.insert(resource_request.Url().GetString());
-      FetchParameters params(resource_request,
-                             FetchInitiatorTypeNames::internal);
+      ResourceLoaderOptions options(kAllowStoredCredentials,
+                                    kClientRequestedCredentials);
+      options.initiator_info.name = FetchInitiatorTypeNames::internal;
+      FetchParameters params(resource_request, options);
       Resource* resource = RawResource::Fetch(params, document->Fetcher());
       if (resource) {
         // Prevent garbage collection by holding a reference to this resource.
@@ -148,8 +151,10 @@
       ResourceRequest resource_request(url);
       resource_request.SetRequestContext(
           WebURLRequest::kRequestContextInternal);
-      FetchParameters params(resource_request,
-                             FetchInitiatorTypeNames::internal);
+      ResourceLoaderOptions options(kAllowStoredCredentials,
+                                    kClientRequestedCredentials);
+      options.initiator_info.name = FetchInitiatorTypeNames::internal;
+      FetchParameters params(resource_request, options);
       Resource* resource =
           CSSStyleSheetResource::Fetch(params, document->Fetcher());
       if (!resource)
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 7a4a215..f8c02f8c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -405,11 +405,6 @@
     return rare_paint_data_ ? rare_paint_data_->PaintProperties() : nullptr;
   }
 
-  LayoutObjectId UniqueId() const {
-    DCHECK(rare_paint_data_);
-    return rare_paint_data_ ? rare_paint_data_->UniqueId() : 0;
-  }
-
   // The complete set of property nodes that should be used as a starting point
   // to paint this LayoutObject. See also the comment for
   // RarePaintData::local_border_box_properties_.
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 6092e73..bea0b2b 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -2275,9 +2275,8 @@
                                  CompositorMutableProperty::kScrollTop) &
                                 compositor_mutable_properties;
   } else {
-    element_id = CompositorElementIdFromLayoutObjectId(
-        owning_layer_.GetLayoutObject().UniqueId(),
-        CompositorElementIdNamespace::kPrimary);
+    element_id = CompositorElementIdFromPaintLayerId(
+        owning_layer_.UniqueId(), CompositorElementIdNamespace::kPrimary);
   }
 
   graphics_layer_->SetElementId(element_id);
@@ -2411,9 +2410,8 @@
             DOMNodeIds::IdForNode(data.owning_node),
             CompositorElementIdNamespace::kScrollCompositorProxy);
       } else {
-        element_id = CompositorElementIdFromLayoutObjectId(
-            owning_layer_.GetLayoutObject().UniqueId(),
-            CompositorElementIdNamespace::kScroll);
+        element_id = CompositorElementIdFromPaintLayerId(
+            owning_layer_.UniqueId(), CompositorElementIdNamespace::kScroll);
       }
 
       scrolling_contents_layer_->SetElementId(element_id);
diff --git a/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.cc b/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.cc
index 648f563..eabdcad 100644
--- a/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.cc
+++ b/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.cc
@@ -6,47 +6,31 @@
 
 namespace blink {
 
-namespace NGBorderEdges {
-
-Physical ToPhysical(Logical logical_edges, NGWritingMode writing_mode) {
-  static_assert(kBlockStart == static_cast<Logical>(kTop) &&
-                    kBlockEnd == static_cast<Logical>(kBottom) &&
-                    kLineLeft == static_cast<Logical>(kLeft) &&
-                    kLineRight == static_cast<Logical>(kRight),
-                "Physical and Logical must match");
-
-  if (writing_mode == kHorizontalTopBottom || logical_edges == kAll)
-    return static_cast<Physical>(logical_edges);
-
-  if (writing_mode != kSidewaysLeftRight) {
-    return static_cast<Physical>((logical_edges & kBlockStart ? kRight : 0) |
-                                 (logical_edges & kBlockEnd ? kLeft : 0) |
-                                 (logical_edges & kLineLeft ? kTop : 0) |
-                                 (logical_edges & kLineRight ? kBottom : 0));
+NGBorderEdges NGBorderEdges::FromPhysical(unsigned physical_edges,
+                                          NGWritingMode writing_mode) {
+  if (writing_mode == kHorizontalTopBottom) {
+    return NGBorderEdges(physical_edges & kTop, physical_edges & kRight,
+                         physical_edges & kBottom, physical_edges & kLeft);
   }
-  return static_cast<Physical>((logical_edges & kBlockStart ? kLeft : 0) |
-                               (logical_edges & kBlockEnd ? kRight : 0) |
-                               (logical_edges & kLineLeft ? kBottom : 0) |
-                               (logical_edges & kLineRight ? kTop : 0));
+  if (writing_mode != kSidewaysLeftRight) {
+    return NGBorderEdges(physical_edges & kRight, physical_edges & kBottom,
+                         physical_edges & kLeft, physical_edges & kTop);
+  }
+  return NGBorderEdges(physical_edges & kLeft, physical_edges & kTop,
+                       physical_edges & kRight, physical_edges & kBottom);
 }
 
-Logical ToLogical(Physical physical_edges, NGWritingMode writing_mode) {
-  if (writing_mode == kHorizontalTopBottom ||
-      physical_edges == static_cast<Physical>(kAll))
-    return static_cast<Logical>(physical_edges);
-
-  if (writing_mode != kSidewaysLeftRight) {
-    return static_cast<Logical>((physical_edges & kTop ? kLineLeft : 0) |
-                                (physical_edges & kBottom ? kLineRight : 0) |
-                                (physical_edges & kLeft ? kBlockEnd : 0) |
-                                (physical_edges & kRight ? kBlockStart : 0));
+unsigned NGBorderEdges::ToPhysical(NGWritingMode writing_mode) const {
+  if (writing_mode == kHorizontalTopBottom) {
+    return (block_start ? kTop : 0) | (line_right ? kRight : 0) |
+           (block_end ? kBottom : 0) | (line_left ? kLeft : 0);
   }
-  return static_cast<Logical>((physical_edges & kTop ? kLineRight : 0) |
-                              (physical_edges & kBottom ? kLineLeft : 0) |
-                              (physical_edges & kLeft ? kBlockStart : 0) |
-                              (physical_edges & kRight ? kBlockEnd : 0));
+  if (writing_mode != kSidewaysLeftRight) {
+    return (block_start ? kRight : 0) | (line_right ? kBottom : 0) |
+           (block_end ? kLeft : 0) | (line_left ? kTop : 0);
+  }
+  return (block_start ? kLeft : 0) | (line_right ? kTop : 0) |
+         (block_end ? kRight : 0) | (line_left ? kBottom : 0);
 }
 
-}  // namespace NGBorderEdges
-
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.h b/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.h
index db3e57b3..a8194500 100644
--- a/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.h
+++ b/third_party/WebKit/Source/core/layout/ng/geometry/ng_border_edges.h
@@ -10,25 +10,36 @@
 
 namespace blink {
 
-namespace NGBorderEdges {
-
 // Which border edges should be painted. Due to fragmentation one or more may
 // be skipped.
-enum Physical { kTop = 1, kRight = 2, kBottom = 4, kLeft = 8 };
+struct CORE_EXPORT NGBorderEdges {
+  unsigned block_start : 1;
+  unsigned line_right : 1;
+  unsigned block_end : 1;
+  unsigned line_left : 1;
 
-enum Logical {
-  kBlockStart = Physical::kTop,
-  kLineRight = Physical::kRight,
-  kBlockEnd = Physical::kBottom,
-  kLineLeft = Physical::kLeft,
-  kAll = kBlockStart | kLineRight | kBlockEnd | kLineLeft
+  NGBorderEdges()
+      : block_start(true), line_right(true), block_end(true), line_left(true) {}
+  NGBorderEdges(bool block_start,
+                bool line_right,
+                bool block_end,
+                bool line_left)
+      : block_start(block_start),
+        line_right(line_right),
+        block_end(block_end),
+        line_left(line_left) {}
+
+  enum Physical {
+    kTop = 1,
+    kRight = 2,
+    kBottom = 4,
+    kLeft = 8,
+    kAll = kTop | kRight | kBottom | kLeft
+  };
+  static NGBorderEdges FromPhysical(unsigned, NGWritingMode);
+  unsigned ToPhysical(NGWritingMode) const;
 };
 
-CORE_EXPORT Physical ToPhysical(Logical, NGWritingMode);
-CORE_EXPORT Logical ToLogical(Physical, NGWritingMode);
-
-}  // namespace NGBorderEdges
-
 }  // namespace blink
 
 #endif  // NGBorderEdges_h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc
index 64cdfd1..5a5b989 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.cc
@@ -4,6 +4,7 @@
 
 #include "core/layout/ng/inline/ng_inline_box_state.h"
 
+#include "core/layout/ng/inline/ng_inline_item_result.h"
 #include "core/layout/ng/inline/ng_inline_node.h"
 #include "core/layout/ng/inline/ng_line_box_fragment_builder.h"
 #include "core/layout/ng/inline/ng_text_fragment_builder.h"
@@ -38,16 +39,6 @@
   }
 }
 
-void NGInlineBoxState::SetNeedsBoxFragment(
-    LayoutUnit position,
-    LayoutUnit borders_paddings_block_start,
-    LayoutUnit borders_paddings_block_height) {
-  needs_box_fragment = true;
-  line_left_position = position;
-  this->borders_paddings_block_start = borders_paddings_block_start;
-  this->borders_paddings_block_height = borders_paddings_block_height;
-}
-
 NGInlineBoxState* NGInlineLayoutStateStack::OnBeginPlaceItems(
     const ComputedStyle* line_style,
     FontBaseline baseline_type) {
@@ -61,6 +52,8 @@
     for (auto& box : stack_) {
       box.fragment_start = 0;
       box.metrics = NGLineHeightMetrics();
+      // Existing box states are wrapped boxes, and hence no left edges.
+      box.border_edges.line_left = false;
       DCHECK(box.pending_descendants.IsEmpty());
     }
   }
@@ -92,9 +85,8 @@
     const NGInlineItem& item,
     NGLineBoxFragmentBuilder* line_box,
     NGInlineBoxState* box,
-    FontBaseline baseline_type,
-    LayoutUnit position) {
-  EndBoxState(box, line_box, baseline_type, position);
+    FontBaseline baseline_type) {
+  EndBoxState(box, line_box, baseline_type);
   // TODO(kojii): When the algorithm restarts from a break token, the stack may
   // underflow. We need either synthesize a missing box state, or push all
   // parents on initialize.
@@ -108,7 +100,8 @@
     LayoutUnit position) {
   for (auto it = stack_.rbegin(); it != stack_.rend(); ++it) {
     NGInlineBoxState* box = &(*it);
-    EndBoxState(box, line_box, baseline_type, position);
+    box->line_right_position = position;
+    EndBoxState(box, line_box, baseline_type);
   }
 
   if (!box_placeholders_.IsEmpty())
@@ -120,10 +113,9 @@
 
 void NGInlineLayoutStateStack::EndBoxState(NGInlineBoxState* box,
                                            NGLineBoxFragmentBuilder* line_box,
-                                           FontBaseline baseline_type,
-                                           LayoutUnit position) {
+                                           FontBaseline baseline_type) {
   if (box->needs_box_fragment)
-    AddBoxFragmentPlaceholder(box, line_box, baseline_type, position);
+    AddBoxFragmentPlaceholder(box, line_box, baseline_type);
 
   PositionPending position_pending =
       ApplyBaselineShift(box, line_box, baseline_type);
@@ -134,6 +126,36 @@
   }
 }
 
+void NGInlineBoxState::SetNeedsBoxFragment(
+    const NGInlineItem& item,
+    const NGInlineItemResult& item_result,
+    LayoutUnit position) {
+  needs_box_fragment = true;
+  line_left_position = position + item_result.margins.inline_start;
+  borders_paddings_block_start = item_result.borders_paddings_block_start;
+  borders_paddings_block_end = item_result.borders_paddings_block_end;
+  // We have left edge on open tag, and if the box is not a continuation.
+  // TODO(kojii): Needs review when we change SplitInlines().
+  bool has_line_left_edge = item.Style()->IsLeftToRightDirection()
+                                ? item.HasStartEdge()
+                                : item.HasEndEdge();
+  border_edges = {true, false, true, has_line_left_edge};
+}
+
+void NGInlineBoxState::SetLineRightForBoxFragment(
+    const NGInlineItem& item,
+    const NGInlineItemResult& item_result,
+    LayoutUnit position) {
+  DCHECK(needs_box_fragment);
+  line_right_position = position - item_result.margins.inline_end;
+  // We have right edge on close tag, and if the box does not have a
+  // continuation.
+  // TODO(kojii): Needs review when we change SplitInlines().
+  border_edges.line_right = item.Style()->IsLeftToRightDirection()
+                                ? item.HasEndEdge()
+                                : item.HasStartEdge();
+}
+
 // Crete a placeholder for a box fragment.
 // We keep a flat list of fragments because it is more suitable for operations
 // such as ApplyBaselineShift. Later, CreateBoxFragments() creates box fragments
@@ -141,16 +163,14 @@
 void NGInlineLayoutStateStack::AddBoxFragmentPlaceholder(
     NGInlineBoxState* box,
     NGLineBoxFragmentBuilder* line_box,
-    FontBaseline baseline_type,
-    LayoutUnit position) {
-  if (box->fragment_start == line_box->Children().size()) {
-    // Don't create a placeholder if the inline box is empty.
+    FontBaseline baseline_type) {
+  LayoutUnit inline_size = box->line_right_position - box->line_left_position;
+  if (box->fragment_start == line_box->Children().size() && inline_size <= 0) {
+    // Don't create a box if the inline box is "empty".
+    // Inline boxes with inline margins/borders/paddings are not "empty",
+    // but background doesn't make difference in this context.
     // Whether to create this box or not affects layout when the line contains
     // only this box, since this box participates the line height.
-    // TODO(kojii): Testing indicates that we should create a box if it has
-    // borders, but not for backgrounds. But creating such a RootInlineBox needs
-    // additional code. The plan is to enable such line box when NG paint is
-    // enabled.
     return;
   }
 
@@ -165,9 +185,9 @@
   // direction is already included into positions in NGLineBreaker.
   NGLogicalRect bounds(
       box->line_left_position,
-      -metrics.ascent - box->borders_paddings_block_start,
-      position - box->line_left_position,
-      metrics.LineHeight() + box->borders_paddings_block_height);
+      -metrics.ascent - box->borders_paddings_block_start, inline_size,
+      metrics.LineHeight() + box->borders_paddings_block_start +
+          box->borders_paddings_block_end);
 
   // The start is marked only in BoxFragmentPlaceholder, while end is marked
   // in both BoxFragmentPlaceholder and the list itself.
@@ -180,8 +200,9 @@
   // The "null" is added to the list to compute baseline shift of the box
   // separately from text fragments.
   unsigned fragment_end = line_box->Children().size();
-  box_placeholders_.push_back(BoxFragmentPlaceholder{
-      box->fragment_start, fragment_end, box->item, bounds.size});
+  box_placeholders_.push_back(
+      BoxFragmentPlaceholder{box->fragment_start, fragment_end, box->item,
+                             bounds.size, box->border_edges});
   line_box->AddChild(nullptr, bounds.offset);
 }
 
@@ -216,6 +237,10 @@
 
     box.SetWritingMode(line_box->WritingMode());
     box.SetDirection(placeholder.item->Direction());
+    // Inline boxes have block start/end borders, even when its containing block
+    // was fragmented. Fragmenting a line box in block direction is not
+    // supported today.
+    box.SetBorderEdges(placeholder.border_edges);
     box.SetSize(placeholder.size);
     // TODO(kojii): Overflow size should be computed from children.
     box.SetOverflowSize(placeholder.size);
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
index 5fcc396..4e24390 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_box_state.h
@@ -16,6 +16,7 @@
 namespace blink {
 
 class NGInlineItem;
+struct NGInlineItemResult;
 class NGLineBoxFragmentBuilder;
 
 // Fragments that require the layout position/size of ancestor are packed in
@@ -30,6 +31,7 @@
 // Represents the current box while NGInlineLayoutAlgorithm performs layout.
 // Used 1) to cache common values for a box, and 2) to layout children that
 // require ancestor position or size.
+// This is a transient object only while building line boxes in a block.
 struct NGInlineBoxState {
   unsigned fragment_start;
   const NGInlineItem* item;
@@ -41,8 +43,10 @@
   // These values are to create a box fragment. Set only when needs_box_fragment
   // is set.
   LayoutUnit line_left_position;
+  LayoutUnit line_right_position;
   LayoutUnit borders_paddings_block_start;
-  LayoutUnit borders_paddings_block_height;
+  LayoutUnit borders_paddings_block_end;
+  NGBorderEdges border_edges;
 
   Vector<NGPendingPositions> pending_descendants;
   bool include_used_fonts = false;
@@ -56,9 +60,12 @@
                            FontBaseline);
 
   // Create a box fragment for this box.
-  void SetNeedsBoxFragment(LayoutUnit line_left_position,
-                           LayoutUnit borders_paddings_block_start,
-                           LayoutUnit borders_paddings_block_height);
+  void SetNeedsBoxFragment(const NGInlineItem&,
+                           const NGInlineItemResult&,
+                           LayoutUnit position);
+  void SetLineRightForBoxFragment(const NGInlineItem&,
+                                  const NGInlineItemResult&,
+                                  LayoutUnit position);
 };
 
 // Represents the inline tree structure. This class provides:
@@ -81,8 +88,7 @@
   NGInlineBoxState* OnCloseTag(const NGInlineItem&,
                                NGLineBoxFragmentBuilder*,
                                NGInlineBoxState*,
-                               FontBaseline,
-                               LayoutUnit position);
+                               FontBaseline);
 
   // Compute all the pending positioning at the end of a line.
   void OnEndPlaceItems(NGLineBoxFragmentBuilder*,
@@ -92,15 +98,11 @@
  private:
   // End of a box state, either explicitly by close tag, or implicitly at the
   // end of a line.
-  void EndBoxState(NGInlineBoxState*,
-                   NGLineBoxFragmentBuilder*,
-                   FontBaseline,
-                   LayoutUnit position);
+  void EndBoxState(NGInlineBoxState*, NGLineBoxFragmentBuilder*, FontBaseline);
 
   void AddBoxFragmentPlaceholder(NGInlineBoxState*,
                                  NGLineBoxFragmentBuilder*,
-                                 FontBaseline,
-                                 LayoutUnit position);
+                                 FontBaseline);
   void CreateBoxFragments(NGLineBoxFragmentBuilder*);
 
   enum PositionPending { kPositionNotPending, kPositionPending };
@@ -116,11 +118,13 @@
                                      FontBaseline);
 
   // Data for a box fragment placeholder. See AddBoxFragmentPlaceholder().
+  // This is a transient object only while building a line box.
   struct BoxFragmentPlaceholder {
     unsigned fragment_start;
     unsigned fragment_end;
     const NGInlineItem* item;
     NGLogicalSize size;
+    NGBorderEdges border_edges;
   };
 
   Vector<NGInlineBoxState, 4> stack_;
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
index 12dd1b6..2be86d0 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
@@ -39,9 +39,13 @@
   // NGLayoutResult for atomic inline items.
   RefPtr<NGLayoutResult> layout_result;
 
-  // NGBoxStrut for atomic inline items.
+  // Margins for atomic inline items and open/close tags.
   NGBoxStrut margins;
 
+  // Borders/padding for open tags.
+  LayoutUnit borders_paddings_block_start;
+  LayoutUnit borders_paddings_block_end;
+
   // Inside of this is not breakable.
   // Used only during line breaking.
   unsigned no_break_opportunities_inside : 1;
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc
index ccfccce..fa0e6e1 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -259,20 +259,13 @@
       box->ComputeTextMetrics(*item.Style(), baseline_type_);
       text_builder.SetDirection(box->style->Direction());
       // TODO(kojii): We may need more conditions to create box fragments.
-      if (item.Style()->HasBoxDecorationBackground()) {
-        // TODO(kojii): These are once computed in NGLineBreaker. Should copy to
-        // NGInlineItemResult to reuse here.
-        NGBoxStrut borders = ComputeBorders(*constraint_space_, *item.Style());
-        NGBoxStrut paddings = ComputePadding(*constraint_space_, *item.Style());
-        // TODO(kojii): Set paint edges.
-        box->SetNeedsBoxFragment(position,
-                                 borders.block_start + paddings.block_start,
-                                 borders.BlockSum() + paddings.BlockSum());
-      }
+      if (item.Style()->HasBoxDecorationBackground())
+        box->SetNeedsBoxFragment(item, item_result, position);
     } else if (item.Type() == NGInlineItem::kCloseTag) {
       position += item_result.inline_size;
-      box = box_states_.OnCloseTag(item, &line_box, box, baseline_type_,
-                                   position);
+      if (box->needs_box_fragment)
+        box->SetLineRightForBoxFragment(item, item_result, position);
+      box = box_states_.OnCloseTag(item, &line_box, box, baseline_type_);
       continue;
     } else if (item.Type() == NGInlineItem::kAtomicInline) {
       box = PlaceAtomicInline(item, &item_result, position, &line_box,
@@ -387,8 +380,7 @@
       item_result->end_offset);
   line_box->AddChild(std::move(text_fragment), {position, line_top});
 
-  return box_states_.OnCloseTag(item, line_box, box, baseline_type_,
-                                LayoutUnit(0));
+  return box_states_.OnCloseTag(item, line_box, box, baseline_type_);
 }
 
 void NGInlineLayoutAlgorithm::ApplyTextAlign(LayoutUnit* line_left,
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
index 9ce10e86..9a262aac 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
@@ -37,6 +37,7 @@
 struct FragmentPosition {
   NGLogicalOffset offset;
   LayoutUnit inline_size;
+  NGBorderEdges border_edges;
 };
 
 // Create BidiRuns from a list of NGPhysicalFragment.
@@ -85,12 +86,20 @@
           ToNGPhysicalBoxFragment(child.Get());
       NGBoxFragment fragment(constraint_space.WritingMode(), physical_fragment);
       NGLogicalOffset child_offset = fragment.Offset() + parent_offset;
-      CreateBidiRuns(bidi_runs, physical_fragment->Children(), constraint_space,
-                     child_offset, items, text_offsets,
-                     positions_for_bidi_runs_out, positions_out);
+      if (physical_fragment->Children().size()) {
+        CreateBidiRuns(bidi_runs, physical_fragment->Children(),
+                       constraint_space, child_offset, items, text_offsets,
+                       positions_for_bidi_runs_out, positions_out);
+      } else {
+        // An empty inline needs a BidiRun for itself.
+        LayoutObject* layout_object = physical_fragment->GetLayoutObject();
+        BidiRun* run = new BidiRun(0, 1, 0, LineLayoutItem(layout_object));
+        bidi_runs->AddRun(run);
+      }
       // Store box fragments in a map by LineLayoutItem.
       positions_out->Set(LineLayoutItem(child->GetLayoutObject()),
-                         FragmentPosition{child_offset, fragment.InlineSize()});
+                         FragmentPosition{child_offset, fragment.InlineSize(),
+                                          fragment.BorderEdges()});
     }
   }
 }
@@ -110,17 +119,20 @@
   for (InlineBox* inline_box = parent->FirstChild(); inline_box;
        inline_box = inline_box->NextOnLine()) {
     if (inline_box->IsInlineFlowBox()) {
+      InlineFlowBox* flow_box = ToInlineFlowBox(inline_box);
       const auto& iter = positions.find(inline_box->GetLineLayoutItem());
       if (iter != positions.end()) {
         const FragmentPosition& position = iter->value;
         inline_box->SetLogicalLeft(position.offset.inline_offset);
         inline_box->SetLogicalTop(position.offset.block_offset);
         inline_box->SetLogicalWidth(position.inline_size);
+        flow_box->SetEdges(position.border_edges.line_left,
+                           position.border_edges.line_right);
       }
 
-      text_index = PlaceInlineBoxChildren(ToInlineFlowBox(inline_box),
-                                          positions_for_bidi_runs, positions,
-                                          text_index, iter == positions.end());
+      text_index =
+          PlaceInlineBoxChildren(flow_box, positions_for_bidi_runs, positions,
+                                 text_index, iter == positions.end());
     } else {
       const FragmentPosition& position = positions_for_bidi_runs[text_index++];
       inline_box->SetLogicalLeft(position.offset.inline_offset);
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
index cf7d1dc..ecd4e770 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
@@ -292,20 +292,26 @@
 
 void NGLineBreaker::HandleOpenTag(const NGInlineItem& item,
                                   NGInlineItemResult* item_result) {
-  if (item.HasStartEdge()) {
-    DCHECK(item.Style());
-    // TODO(kojii): We compute 16 values and discard 12 out of that, and do it 3
-    // times per element. We may want to cache this. crrev.com/2865903002/#msg14
-    NGBoxStrut margins = ComputeMargins(*constraint_space_, *item.Style(),
-                                        constraint_space_->WritingMode(),
-                                        constraint_space_->Direction());
-    NGBoxStrut borders = ComputeBorders(*constraint_space_, *item.Style());
-    NGBoxStrut paddings = ComputePadding(*constraint_space_, *item.Style());
-    item_result->inline_size =
-        margins.inline_start + borders.inline_start + paddings.inline_start;
-    position_ += item_result->inline_size;
+  DCHECK(item.Style());
+  const ComputedStyle& style = *item.Style();
+  if (style.HasBorder() || style.HasPadding() ||
+      (style.HasMargin() && item.HasStartEdge())) {
+    NGBoxStrut borders = ComputeBorders(*constraint_space_, style);
+    NGBoxStrut paddings = ComputePadding(*constraint_space_, style);
+    item_result->borders_paddings_block_start =
+        borders.block_start + paddings.block_start;
+    item_result->borders_paddings_block_end =
+        borders.block_end + paddings.block_end;
+    if (item.HasStartEdge()) {
+      item_result->margins = ComputeMargins(*constraint_space_, style,
+                                            constraint_space_->WritingMode(),
+                                            constraint_space_->Direction());
+      item_result->inline_size = item_result->margins.inline_start +
+                                 borders.inline_start + paddings.inline_start;
+      position_ += item_result->inline_size;
+    }
   }
-  UpdateBreakIterator(*item.Style());
+  UpdateBreakIterator(style);
   MoveToNextOf(item);
 }
 
@@ -313,13 +319,13 @@
                                    NGInlineItemResult* item_result) {
   if (item.HasEndEdge()) {
     DCHECK(item.Style());
-    NGBoxStrut margins = ComputeMargins(*constraint_space_, *item.Style(),
-                                        constraint_space_->WritingMode(),
-                                        constraint_space_->Direction());
+    item_result->margins = ComputeMargins(*constraint_space_, *item.Style(),
+                                          constraint_space_->WritingMode(),
+                                          constraint_space_->Direction());
     NGBoxStrut borders = ComputeBorders(*constraint_space_, *item.Style());
     NGBoxStrut paddings = ComputePadding(*constraint_space_, *item.Style());
-    item_result->inline_size =
-        margins.inline_end + borders.inline_end + paddings.inline_end;
+    item_result->inline_size = item_result->margins.inline_end +
+                               borders.inline_end + paddings.inline_end;
     position_ += item_result->inline_size;
   }
   DCHECK(item.GetLayoutObject() && item.GetLayoutObject()->Parent());
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
index 7bbdf34..5dc1dcb 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment.cc
@@ -41,9 +41,9 @@
   return NGLogicalOffset(InlineOffset(), BlockOffset());
 }
 
-NGBorderEdges::Logical NGFragment::BorderEdges() const {
-  return NGBorderEdges::ToLogical(physical_fragment_->BorderEdges(),
-                                  WritingMode());
+NGBorderEdges NGFragment::BorderEdges() const {
+  return NGBorderEdges::FromPhysical(physical_fragment_->BorderEdges(),
+                                     WritingMode());
 }
 
 NGPhysicalFragment::NGFragmentType NGFragment::Type() const {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment.h
index 96d7a14..e1fdb9f7 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment.h
@@ -34,7 +34,7 @@
   LayoutUnit BlockOffset() const;
   NGLogicalOffset Offset() const;
 
-  NGBorderEdges::Logical BorderEdges() const;
+  NGBorderEdges BorderEdges() const;
 
   NGPhysicalFragment::NGFragmentType Type() const;
 
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
index b4e2080..6967109 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
@@ -23,8 +23,7 @@
       direction_(TextDirection::kLtr),
       node_(node),
       layout_object_(node.GetLayoutObject()),
-      did_break_(false),
-      border_edges_(NGBorderEdges::kAll) {}
+      did_break_(false) {}
 
 NGFragmentBuilder::NGFragmentBuilder(NGPhysicalFragment::NGFragmentType type,
                                      LayoutObject* layout_object)
@@ -230,8 +229,7 @@
   RefPtr<NGPhysicalBoxFragment> fragment = AdoptRef(new NGPhysicalBoxFragment(
       layout_object_, physical_size, overflow_.ConvertToPhysical(writing_mode_),
       children_, positioned_floats_, bfc_offset_, end_margin_strut_,
-      NGBorderEdges::ToPhysical(border_edges_, writing_mode_),
-      std::move(break_token)));
+      border_edges_.ToPhysical(writing_mode_), std::move(break_token)));
 
   return AdoptRef(
       new NGLayoutResult(std::move(fragment), out_of_flow_descendants_,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
index 27a8896..d54b264b 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
@@ -129,7 +129,7 @@
 
   bool DidBreak() const { return did_break_; }
 
-  NGFragmentBuilder& SetBorderEdges(NGBorderEdges::Logical border_edges) {
+  NGFragmentBuilder& SetBorderEdges(NGBorderEdges border_edges) {
     border_edges_ = border_edges;
     return *this;
   }
@@ -187,7 +187,7 @@
   WTF::Optional<NGLogicalOffset> bfc_offset_;
   NGMarginStrut end_margin_strut_;
 
-  NGBorderEdges::Logical border_edges_;
+  NGBorderEdges border_edges_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
index 16e8108..d21294d4 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
@@ -16,7 +16,7 @@
     Vector<NGPositionedFloat>& positioned_floats,
     const WTF::Optional<NGLogicalOffset>& bfc_offset,
     const NGMarginStrut& end_margin_strut,
-    NGBorderEdges::Physical border_edges,
+    unsigned border_edges,  // NGBorderEdges::Physical
     RefPtr<NGBreakToken> break_token)
     : NGPhysicalFragment(layout_object,
                          size,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h
index 09f736d..176c96d 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h
@@ -24,7 +24,7 @@
                         Vector<NGPositionedFloat>& positioned_floats,
                         const WTF::Optional<NGLogicalOffset>& bfc_offset,
                         const NGMarginStrut& end_margin_strut,
-                        NGBorderEdges::Physical,
+                        unsigned,  // NGBorderEdges::Physical
                         RefPtr<NGBreakToken> break_token = nullptr);
 
   // Returns the total size, including the contents outside of the border-box.
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
index 81ec470..dbf8786 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
@@ -54,10 +54,8 @@
   // Returns the border-box size.
   NGPhysicalSize Size() const { return size_; }
 
-  // Bitmask for border edges, see NGPaintBorderEdge.
-  NGBorderEdges::Physical BorderEdges() const {
-    return static_cast<NGBorderEdges::Physical>(border_edge_);
-  }
+  // Bitmask for border edges, see NGBorderEdges::Physical.
+  unsigned BorderEdges() const { return border_edge_; }
   NGPixelSnappedPhysicalBoxStrut BorderWidths() const;
 
   // Returns the offset relative to the parent fragment's content-box.
@@ -104,7 +102,7 @@
 
   unsigned type_ : 2;  // NGFragmentType
   unsigned is_placed_ : 1;
-  unsigned border_edge_ : 4;  // NGPhysicalBorderEdges
+  unsigned border_edge_ : 4;  // NGBorderEdges::Physical
 
  private:
   void Destroy() const;
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
index dd96202..d162d57 100644
--- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -256,12 +256,13 @@
   KURL url(KURL(), "http://baz.test");
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextScript);
-  EXPECT_EQ(
-      ResourceRequestBlockedReason::CSP,
-      fetch_context_->CanFollowRedirect(
-          Resource::kScript, resource_request, url, ResourceLoaderOptions(),
-          SecurityViolationReportingPolicy::kReport,
-          FetchParameters::kUseDefaultOriginRestrictionForType));
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
+  EXPECT_EQ(ResourceRequestBlockedReason::CSP,
+            fetch_context_->CanFollowRedirect(
+                Resource::kScript, resource_request, url, options,
+                SecurityViolationReportingPolicy::kReport,
+                FetchParameters::kUseDefaultOriginRestrictionForType));
   EXPECT_EQ(2u, policy->violation_reports_sent_.size());
 }
 
@@ -278,9 +279,11 @@
   KURL url(KURL(), "http://baz.test");
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextScript);
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
   EXPECT_EQ(ResourceRequestBlockedReason::CSP,
             fetch_context_->AllowResponse(Resource::kScript, resource_request,
-                                          url, ResourceLoaderOptions()));
+                                          url, options));
   EXPECT_EQ(2u, policy->violation_reports_sent_.size());
 }
 
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index d32a415a..a8e43d2 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -72,6 +72,7 @@
 #include "platform/loader/fetch/FetchUtils.h"
 #include "platform/loader/fetch/MemoryCache.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceTimingInfo.h"
 #include "platform/mhtml/ArchiveResource.h"
 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
@@ -859,12 +860,11 @@
     GetTiming().MarkFetchStart();
   }
 
-  DEFINE_STATIC_LOCAL(
-      ResourceLoaderOptions, main_resource_load_options,
-      (kDoNotBufferData, kAllowStoredCredentials, kClientRequestedCredentials,
-       kCheckContentSecurityPolicy, kDocumentContext));
-  FetchParameters fetch_params(request_, FetchInitiatorTypeNames::document,
-                               main_resource_load_options);
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.data_buffering_policy = kDoNotBufferData;
+  options.initiator_info.name = FetchInitiatorTypeNames::document;
+  FetchParameters fetch_params(request_, options);
   main_resource_ =
       RawResource::FetchMainResource(fetch_params, Fetcher(), substitute_data_);
 
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h
index 895a01e..9fa3c9e 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.h
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h
@@ -46,7 +46,6 @@
 #include "platform/loader/fetch/ClientHintsPreferences.h"
 #include "platform/loader/fetch/RawResource.h"
 #include "platform/loader/fetch/ResourceError.h"
-#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/loader/fetch/SubstituteData.h"
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
index 037b7efb..9884feea 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -53,6 +53,7 @@
 #include "platform/loader/fetch/FetchUtils.h"
 #include "platform/loader/fetch/Resource.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/weborigin/SchemeRegistry.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -172,6 +173,7 @@
       is_using_data_consumer_handle_(false),
       async_(blocking_behavior == kLoadAsynchronously),
       request_context_(WebURLRequest::kRequestContextUnspecified),
+      actual_options_(kAllowStoredCredentials, kClientRequestedCredentials),
       timeout_timer_(loading_context_->GetTaskRunner(TaskType::kNetworking),
                      this,
                      &DocumentThreadableLoader::DidTimeout),
@@ -980,7 +982,8 @@
   ResourceRequest actual_request = actual_request_;
   ResourceLoaderOptions actual_options = actual_options_;
   actual_request_ = ResourceRequest();
-  actual_options_ = ResourceLoaderOptions();
+  actual_options_ = ResourceLoaderOptions(kAllowStoredCredentials,
+                                          kClientRequestedCredentials);
 
   ClearResource();
 
@@ -1025,8 +1028,7 @@
                                 BLINK_FROM_HERE);
   }
 
-  FetchParameters new_params(request, options_.initiator,
-                             resource_loader_options);
+  FetchParameters new_params(request, resource_loader_options);
   if (options_.fetch_request_mode == WebURLRequest::kFetchRequestModeNoCORS)
     new_params.SetOriginRestriction(FetchParameters::kNoOriginRestriction);
   DCHECK(!GetResource());
@@ -1070,8 +1072,7 @@
 void DocumentThreadableLoader::LoadRequestSync(
     const ResourceRequest& request,
     ResourceLoaderOptions resource_loader_options) {
-  FetchParameters fetch_params(request, options_.initiator,
-                               resource_loader_options);
+  FetchParameters fetch_params(request, resource_loader_options);
   if (options_.fetch_request_mode == WebURLRequest::kFetchRequestModeNoCORS)
     fetch_params.SetOriginRestriction(FetchParameters::kNoOriginRestriction);
   Resource* resource = RawResource::FetchSynchronously(
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
index 17d1675..1d81f49f 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -43,6 +43,7 @@
 #include "core/page/Page.h"
 #include "core/testing/DummyPageHolder.h"
 #include "platform/loader/fetch/FetchInitiatorInfo.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/UniqueIdentifier.h"
 #include "platform/loader/testing/MockResource.h"
@@ -188,8 +189,10 @@
       SecurityViolationReportingPolicy reporting_policy) {
     KURL input_url(kParsedURLString, "http://example.com/");
     ResourceRequest resource_request(input_url);
+    ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                  kClientDidNotRequestCredentials);
     return fetch_context->CanRequest(
-        Resource::kImage, resource_request, input_url, ResourceLoaderOptions(),
+        Resource::kImage, resource_request, input_url, options,
         reporting_policy, FetchParameters::kUseDefaultOriginRestrictionForType);
   }
 
@@ -486,9 +489,11 @@
   KURL url(KURL(), "http://baz.test");
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextScript);
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
   fetch_context->PopulateResourceRequest(
       url, Resource::kScript, ClientHintsPreferences(),
-      FetchParameters::ResourceWidth(), ResourceLoaderOptions(),
+      FetchParameters::ResourceWidth(), options,
       SecurityViolationReportingPolicy::kReport, resource_request);
   EXPECT_EQ(1u, policy->violation_reports_sent_.size());
   // Check that the resource was upgraded to a secure URL.
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
index 9662b1b3..0bbe164 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -305,8 +305,9 @@
   if (!url.IsNull() && !url.IsEmpty()) {
     // Unlike raw <img>, we block mixed content inside of <picture> or
     // <img srcset>.
-    ResourceLoaderOptions resource_loader_options =
-        ResourceFetcher::DefaultResourceOptions();
+    ResourceLoaderOptions resource_loader_options(kAllowStoredCredentials,
+                                                  kClientRequestedCredentials);
+    resource_loader_options.initiator_info.name = GetElement()->localName();
     ResourceRequest resource_request(url);
     if (update_behavior == kUpdateForcedReload) {
       resource_request.SetCachePolicy(WebCachePolicy::kBypassingCache);
@@ -322,8 +323,7 @@
         !GetElement()->FastGetAttribute(HTMLNames::srcsetAttr).IsNull())
       resource_request.SetRequestContext(
           WebURLRequest::kRequestContextImageSet);
-    FetchParameters params(resource_request, GetElement()->localName(),
-                           resource_loader_options);
+    FetchParameters params(resource_request, resource_loader_options);
     ConfigureRequest(params, bypass_behavior, *element_,
                      document.GetClientHintsPreferences());
 
diff --git a/third_party/WebKit/Source/core/loader/LinkLoader.cpp b/third_party/WebKit/Source/core/loader/LinkLoader.cpp
index 51e005b..f76101d 100644
--- a/third_party/WebKit/Source/core/loader/LinkLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/LinkLoader.cpp
@@ -52,6 +52,7 @@
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/network/mime/MIMETypeRegistry.h"
 #include "public/platform/WebPrerender.h"
 
@@ -356,8 +357,11 @@
         referrer_policy, href, document.OutgoingReferrer()));
   }
 
-  FetchParameters link_fetch_params(
-      resource_request, FetchInitiatorTypeNames::link, document.EncodingName());
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = FetchInitiatorTypeNames::link;
+  FetchParameters link_fetch_params(resource_request, options);
+  link_fetch_params.SetCharset(document.EncodingName());
 
   if (cross_origin != kCrossOriginAttributeNotSet) {
     link_fetch_params.SetCrossOriginAccessControl(document.GetSecurityOrigin(),
@@ -388,8 +392,10 @@
           referrer_policy, href, document.OutgoingReferrer()));
     }
 
-    FetchParameters link_fetch_params(resource_request,
-                                      FetchInitiatorTypeNames::link);
+    ResourceLoaderOptions options(kAllowStoredCredentials,
+                                  kClientRequestedCredentials);
+    options.initiator_info.name = FetchInitiatorTypeNames::link;
+    FetchParameters link_fetch_params(resource_request, options);
     if (cross_origin != kCrossOriginAttributeNotSet) {
       link_fetch_params.SetCrossOriginAccessControl(
           document.GetSecurityOrigin(), cross_origin);
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.cpp b/third_party/WebKit/Source/core/loader/PingLoader.cpp
index 15e33dc8..78f8725 100644
--- a/third_party/WebKit/Source/core/loader/PingLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/PingLoader.cpp
@@ -56,6 +56,7 @@
 #include "platform/loader/fetch/FetchUtils.h"
 #include "platform/loader/fetch/ResourceError.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/loader/fetch/UniqueIdentifier.h"
@@ -308,7 +309,8 @@
     DCHECK(!redirect_response.IsNull());
 
     String error_description;
-    ResourceLoaderOptions options;
+    ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                  kClientDidNotRequestCredentials);
     // TODO(tyoshino): Save updated data in options.securityOrigin and pass it
     // on the next time.
     if (!CrossOriginAccessControl::HandleRedirect(
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.h b/third_party/WebKit/Source/core/loader/PingLoader.h
index ea36c6b..e0a39e4 100644
--- a/third_party/WebKit/Source/core/loader/PingLoader.h
+++ b/third_party/WebKit/Source/core/loader/PingLoader.h
@@ -37,7 +37,6 @@
 #include "platform/Timer.h"
 #include "platform/heap/Handle.h"
 #include "platform/heap/SelfKeepAlive.h"
-#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/wtf/Forward.h"
 #include "platform/wtf/Noncopyable.h"
 #include "public/platform/WebURLLoaderClient.h"
diff --git a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
index c0cd4f1f..22d553c 100644
--- a/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/TextTrackLoader.cpp
@@ -33,6 +33,7 @@
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/RawResource.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/weborigin/SecurityOrigin.h"
 
 namespace blink {
@@ -125,8 +126,10 @@
                            CrossOriginAttributeValue cross_origin) {
   CancelLoad();
 
-  FetchParameters cue_fetch_params(ResourceRequest(url),
-                                   FetchInitiatorTypeNames::texttrack);
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = FetchInitiatorTypeNames::texttrack;
+  FetchParameters cue_fetch_params(ResourceRequest(url), options);
 
   if (cross_origin != kCrossOriginAttributeNotSet) {
     cue_fetch_params.SetCrossOriginAccessControl(
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoader.h b/third_party/WebKit/Source/core/loader/ThreadableLoader.h
index 131ddb2..912b02af 100644
--- a/third_party/WebKit/Source/core/loader/ThreadableLoader.h
+++ b/third_party/WebKit/Source/core/loader/ThreadableLoader.h
@@ -68,7 +68,6 @@
   PreflightPolicy preflight_policy;
 
   WebURLRequest::FetchRequestMode fetch_request_mode;
-  AtomicString initiator;
   ContentSecurityPolicyEnforcement content_security_policy_enforcement;
   unsigned long timeout_milliseconds;
 };
@@ -80,7 +79,6 @@
       const ThreadableLoaderOptions& options)
       : preflight_policy(options.preflight_policy),
         fetch_request_mode(options.fetch_request_mode),
-        initiator(options.initiator.GetString().IsolatedCopy()),
         content_security_policy_enforcement(
             options.content_security_policy_enforcement),
         timeout_milliseconds(options.timeout_milliseconds) {}
@@ -89,7 +87,6 @@
     ThreadableLoaderOptions options;
     options.preflight_policy = preflight_policy;
     options.fetch_request_mode = fetch_request_mode;
-    options.initiator = AtomicString(initiator);
     options.content_security_policy_enforcement =
         content_security_policy_enforcement;
     options.timeout_milliseconds = timeout_milliseconds;
@@ -98,7 +95,6 @@
 
   PreflightPolicy preflight_policy;
   WebURLRequest::FetchRequestMode fetch_request_mode;
-  String initiator;
   ContentSecurityPolicyEnforcement content_security_policy_enforcement;
   unsigned long timeout_milliseconds;
 };
diff --git a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
index aac07e5..a1555c0c 100644
--- a/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
+++ b/third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp
@@ -132,7 +132,8 @@
       WebURLRequest::FetchRequestMode fetch_request_mode) override {
     ThreadableLoaderOptions options;
     options.fetch_request_mode = fetch_request_mode;
-    ResourceLoaderOptions resource_loader_options;
+    ResourceLoaderOptions resource_loader_options(
+        kDoNotAllowStoredCredentials, kClientDidNotRequestCredentials);
     loader_ = DocumentThreadableLoader::Create(
         *ThreadableLoadingContext::Create(GetDocument()), client, options,
         resource_loader_options);
@@ -283,7 +284,8 @@
 
     ThreadableLoaderOptions options;
     options.fetch_request_mode = fetch_request_mode;
-    ResourceLoaderOptions resource_loader_options;
+    ResourceLoaderOptions resource_loader_options(
+        kDoNotAllowStoredCredentials, kClientDidNotRequestCredentials);
 
     // Ensure that WorkerThreadableLoader is created.
     // ThreadableLoader::create() determines whether it should create
diff --git a/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp b/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp
index 3d46d2b..d274d90 100644
--- a/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/WorkletScriptLoader.cpp
@@ -7,6 +7,7 @@
 #include "bindings/core/v8/ScriptSourceCode.h"
 #include "core/loader/FrameFetchContext.h"
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/wtf/WTF.h"
 
 namespace blink {
@@ -22,7 +23,10 @@
 
   ResourceRequest resource_request(module_url_record);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextScript);
-  FetchParameters params(resource_request, FetchInitiatorTypeNames::internal);
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = FetchInitiatorTypeNames::internal;
+  FetchParameters params(resource_request, options);
   ScriptResource* resource = ScriptResource::Fetch(params, fetcher_);
   if (!resource) {
     NotifyFinished(nullptr);
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
index e6d6844b..8f1676a 100644
--- a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
@@ -10,6 +10,7 @@
 #include "core/loader/modulescript/ModuleScriptLoaderRegistry.h"
 #include "platform/loader/fetch/FetchUtils.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceLoadingLog.h"
 #include "platform/network/mime/MIMETypeRegistry.h"
 #include "platform/weborigin/SecurityPolicy.h"
@@ -90,8 +91,14 @@
   // -> FetchResourceType is specified by ScriptResource::fetch
 
   // parser metadata is parser state,
-  ResourceLoaderOptions options;
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
   options.parser_disposition = module_request.ParserState();
+  // As initiator for module script fetch is not specified in HTML spec,
+  // we specity "" as initiator per:
+  // https://fetch.spec.whatwg.org/#concept-request-initiator
+  options.initiator_info.name = g_empty_atom;
+
   // referrer is referrer,
   if (!module_request.GetReferrer().IsNull()) {
     resource_request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer(
@@ -100,12 +107,7 @@
   }
   // and client is fetch client settings object. -> set by ResourceFetcher
 
-  // As initiator for module script fetch is not specified in HTML spec,
-  // we specity "" as initiator per:
-  // https://fetch.spec.whatwg.org/#concept-request-initiator
-  const AtomicString& initiator_name = g_empty_atom;
-
-  FetchParameters fetch_params(resource_request, initiator_name, options);
+  FetchParameters fetch_params(resource_request, options);
   // ... cryptographic nonce metadata is cryptographic nonce, ...
   fetch_params.SetContentSecurityPolicyNonce(module_request.Nonce());
   // Note: The fetch request's "origin" isn't specified in
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h
index c317983..2f6205b 100644
--- a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.h
@@ -9,7 +9,6 @@
 #include "core/loader/modulescript/ModuleScriptFetchRequest.h"
 #include "core/loader/resource/ScriptResource.h"
 #include "platform/heap/Handle.h"
-#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceOwner.h"
 #include "platform/weborigin/KURL.h"
 #include "public/platform/WebURLRequest.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
index 2d0c315..1cb7788 100644
--- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
@@ -34,6 +34,7 @@
 #include "platform/loader/fetch/MemoryCache.h"
 #include "platform/loader/fetch/ResourceClientWalker.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/weborigin/SecurityPolicy.h"
 #include "platform/wtf/CurrentTime.h"
 
@@ -55,7 +56,9 @@
 CSSStyleSheetResource* CSSStyleSheetResource::CreateForTest(
     const ResourceRequest& request,
     const String& charset) {
-  return new CSSStyleSheetResource(request, ResourceLoaderOptions(), charset);
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
+  return new CSSStyleSheetResource(request, options, charset);
 }
 
 CSSStyleSheetResource::CSSStyleSheetResource(
diff --git a/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp
index 0301696..5f076167 100644
--- a/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/FontResourceTest.cpp
@@ -6,7 +6,6 @@
 
 #include "core/loader/resource/MockFontResourceClient.h"
 #include "platform/exported/WrappedResourceResponse.h"
-#include "platform/loader/fetch/FetchInitiatorInfo.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/MemoryCache.h"
 #include "platform/loader/fetch/ResourceError.h"
@@ -51,8 +50,7 @@
 
   // Fetch to cache a resource.
   ResourceRequest request1(url);
-  FetchParameters fetch_params1 =
-      FetchParameters(request1, FetchInitiatorInfo());
+  FetchParameters fetch_params1(request1);
   Resource* resource1 = FontResource::Fetch(fetch_params1, fetcher);
   ASSERT_TRUE(resource1);
   fetcher->StartLoad(resource1);
@@ -66,8 +64,7 @@
   // Revalidate the resource.
   ResourceRequest request2(url);
   request2.SetCachePolicy(WebCachePolicy::kValidatingCacheData);
-  FetchParameters fetch_params2 =
-      FetchParameters(request2, FetchInitiatorInfo());
+  FetchParameters fetch_params2(request2);
   Resource* resource2 = FontResource::Fetch(fetch_params2, fetcher);
   ASSERT_TRUE(resource2);
   EXPECT_EQ(resource1, resource2);
@@ -77,8 +74,7 @@
   // Fetch the same resource again before actual load operation starts.
   ResourceRequest request3(url);
   request3.SetCachePolicy(WebCachePolicy::kValidatingCacheData);
-  FetchParameters fetch_params3 =
-      FetchParameters(request3, FetchInitiatorInfo());
+  FetchParameters fetch_params3(request3);
   Resource* resource3 = FontResource::Fetch(fetch_params3, fetcher);
   ASSERT_TRUE(resource3);
   EXPECT_EQ(resource2, resource3);
@@ -112,8 +108,7 @@
   ResourceFetcher* fetcher =
       ResourceFetcher::Create(context, context->GetTaskRunner());
 
-  FetchParameters fetch_params =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params{ResourceRequest(url)};
   fetch_params.SetCacheAwareLoadingEnabled(kIsCacheAwareLoadingEnabled);
   FontResource* resource = FontResource::Fetch(fetch_params, fetcher);
   ASSERT_TRUE(resource);
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
index a289ea6d..e3a454a 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -37,6 +37,7 @@
 #include "platform/loader/fetch/ResourceClient.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
 #include "platform/loader/fetch/ResourceLoader.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceLoadingLog.h"
 #include "platform/network/HTTPParsers.h"
 #include "platform/weborigin/SecurityViolationReportingPolicy.h"
@@ -193,7 +194,9 @@
 }
 
 ImageResource* ImageResource::Create(const ResourceRequest& request) {
-  return new ImageResource(request, ResourceLoaderOptions(),
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
+  return new ImageResource(request, options,
                            ImageResourceContent::CreateNotStarted(), false);
 }
 
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
index e27e51fb..3d99402 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -662,7 +662,7 @@
 
   ResourceRequest request = ResourceRequest(test_url);
   request.SetPreviewsState(WebURLRequest::kServerLoFiOn);
-  FetchParameters fetch_params(request, FetchInitiatorInfo());
+  FetchParameters fetch_params(request);
   ImageResource* image_resource = ImageResource::Fetch(fetch_params, fetcher);
   ImageResourceContent* content = image_resource->GetContent();
 
@@ -702,7 +702,7 @@
 
   ResourceRequest request(test_url);
   request.SetPreviewsState(WebURLRequest::kServerLoFiOn);
-  FetchParameters fetch_params(request, FetchInitiatorInfo());
+  FetchParameters fetch_params(request);
   ResourceFetcher* fetcher = CreateFetcher();
 
   ImageResource* image_resource = ImageResource::Fetch(fetch_params, fetcher);
@@ -747,7 +747,7 @@
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
   ResourceFetcher* fetcher = CreateFetcher();
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   params.SetAllowImagePlaceholder();
   ImageResource* image_resource = ImageResource::Fetch(params, fetcher);
   EXPECT_EQ(FetchParameters::kAllowPlaceholder,
@@ -1082,7 +1082,7 @@
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
   ResourceFetcher* fetcher = CreateFetcher();
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   ImageResource* image_resource = ImageResource::Fetch(params, fetcher);
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::Create(image_resource->GetContent());
@@ -1109,7 +1109,7 @@
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
   ResourceFetcher* fetcher = CreateFetcher();
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   ImageResource* image_resource = ImageResource::Fetch(params, fetcher);
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::Create(image_resource->GetContent());
@@ -1141,7 +1141,7 @@
 
   ResourceRequest resource_request(test_url);
   resource_request.SetHTTPHeaderField("range", "bytes=0-2");
-  FetchParameters params(resource_request, FetchInitiatorInfo());
+  FetchParameters params(resource_request);
   ResourceFetcher* fetcher = CreateFetcher();
   ImageResource* image_resource = ImageResource::Fetch(params, fetcher);
   std::unique_ptr<MockImageResourceObserver> observer =
@@ -1183,7 +1183,7 @@
   KURL test_url(kParsedURLString, kTestURL);
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   ImageResource* image_resource = ImageResource::Fetch(params, CreateFetcher());
   EXPECT_EQ(FetchParameters::kDisallowPlaceholder,
             params.GetPlaceholderImageRequestType());
@@ -1199,7 +1199,7 @@
                 "data:image/jpeg;base64," +
                     Base64Encode(reinterpret_cast<const char*>(kJpegImage),
                                  sizeof(kJpegImage)));
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   params.SetAllowImagePlaceholder();
   ImageResource* image_resource = ImageResource::Fetch(params, CreateFetcher());
   EXPECT_EQ(FetchParameters::kDisallowPlaceholder,
@@ -1214,7 +1214,7 @@
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
   ResourceRequest resource_request(test_url);
   resource_request.SetHTTPMethod("POST");
-  FetchParameters params(resource_request, FetchInitiatorInfo());
+  FetchParameters params(resource_request);
   params.SetAllowImagePlaceholder();
   ImageResource* image_resource = ImageResource::Fetch(params, CreateFetcher());
   EXPECT_EQ(FetchParameters::kDisallowPlaceholder,
@@ -1231,7 +1231,7 @@
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
   ResourceRequest resource_request(test_url);
   resource_request.SetHTTPHeaderField("range", "bytes=128-255");
-  FetchParameters params(resource_request, FetchInitiatorInfo());
+  FetchParameters params(resource_request);
   params.SetAllowImagePlaceholder();
   ImageResource* image_resource = ImageResource::Fetch(params, CreateFetcher());
   EXPECT_EQ(FetchParameters::kDisallowPlaceholder,
@@ -1247,7 +1247,7 @@
   KURL test_url(kParsedURLString, kTestURL);
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   params.SetAllowImagePlaceholder();
   ImageResource* image_resource = ImageResource::Fetch(params, CreateFetcher());
   EXPECT_EQ(FetchParameters::kAllowPlaceholder,
@@ -1263,7 +1263,7 @@
   KURL test_url(kParsedURLString, kTestURL);
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
-  FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+  FetchParameters params{ResourceRequest(test_url)};
   params.SetAllowImagePlaceholder();
   ImageResource* image_resource = ImageResource::Fetch(params, CreateFetcher());
   EXPECT_EQ(FetchParameters::kAllowPlaceholder,
@@ -1316,7 +1316,7 @@
 
     ResourceRequest resource_request(test_url);
     resource_request.SetPreviewsState(test.initial_previews_state);
-    FetchParameters params{resource_request, FetchInitiatorInfo()};
+    FetchParameters params(resource_request);
 
     params.SetAllowImagePlaceholder();
     ImageResource* image_resource =
@@ -1371,16 +1371,14 @@
 
   ResourceFetcher* fetcher = CreateFetcher();
 
-  FetchParameters placeholder_params{ResourceRequest(test_url),
-                                     FetchInitiatorInfo()};
+  FetchParameters placeholder_params{ResourceRequest(test_url)};
   placeholder_params.SetAllowImagePlaceholder();
   ImageResource* image_resource =
       ImageResource::Fetch(placeholder_params, fetcher);
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::Create(image_resource->GetContent());
 
-  FetchParameters non_placeholder_params{ResourceRequest(test_url),
-                                         FetchInitiatorInfo()};
+  FetchParameters non_placeholder_params{ResourceRequest(test_url)};
   ImageResource* image_resource2 =
       ImageResource::Fetch(non_placeholder_params, fetcher);
   std::unique_ptr<MockImageResourceObserver> observer2 =
@@ -1423,8 +1421,7 @@
   ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
   ResourceFetcher* fetcher = CreateFetcher();
-  FetchParameters placeholder_params{ResourceRequest(test_url),
-                                     FetchInitiatorInfo()};
+  FetchParameters placeholder_params{ResourceRequest(test_url)};
   placeholder_params.SetAllowImagePlaceholder();
   ImageResource* image_resource =
       ImageResource::Fetch(placeholder_params, fetcher);
@@ -1434,8 +1431,7 @@
   TestThatIsPlaceholderRequestAndServeResponse(test_url, image_resource,
                                                observer.get());
 
-  FetchParameters non_placeholder_params{ResourceRequest(test_url),
-                                         FetchInitiatorInfo()};
+  FetchParameters non_placeholder_params{ResourceRequest(test_url)};
   ImageResource* image_resource2 =
       ImageResource::Fetch(non_placeholder_params, fetcher);
   std::unique_ptr<MockImageResourceObserver> observer2 =
@@ -1472,7 +1468,7 @@
     KURL test_url(kParsedURLString, kTestURL);
     ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
-    FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+    FetchParameters params{ResourceRequest(test_url)};
     params.SetAllowImagePlaceholder();
     ImageResource* image_resource =
         ImageResource::Fetch(params, CreateFetcher());
@@ -1531,7 +1527,7 @@
     KURL test_url(kParsedURLString, kTestURL);
     ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
-    FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+    FetchParameters params{ResourceRequest(test_url)};
     params.SetAllowImagePlaceholder();
     ImageResource* image_resource =
         ImageResource::Fetch(params, CreateFetcher());
@@ -1564,7 +1560,7 @@
     KURL test_url(kParsedURLString, kTestURL);
     ScopedMockedURLLoad scoped_mocked_url_load(test_url, GetTestFilePath());
 
-    FetchParameters params{ResourceRequest(test_url), FetchInitiatorInfo()};
+    FetchParameters params{ResourceRequest(test_url)};
     params.SetAllowImagePlaceholder();
     ImageResource* image_resource =
         ImageResource::Fetch(params, CreateFetcher());
diff --git a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
index 4cea90a..d07c6ebf 100644
--- a/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
+++ b/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
@@ -31,6 +31,7 @@
 #include "platform/loader/fetch/AccessControlStatus.h"
 #include "platform/loader/fetch/IntegrityMetadata.h"
 #include "platform/loader/fetch/ResourceClient.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 
 namespace blink {
 
@@ -59,7 +60,9 @@
   // Public for testing
   static ScriptResource* Create(const ResourceRequest& request,
                                 const String& charset) {
-    return new ScriptResource(request, ResourceLoaderOptions(), charset);
+    ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                  kClientDidNotRequestCredentials);
+    return new ScriptResource(request, options, charset);
   }
 
   ~ScriptResource() override;
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
index 4602de6..d501e2b 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h
@@ -155,6 +155,7 @@
   DECLARE_VIRTUAL_TRACE();
 
  private:
+  friend class OffscreenCanvasTest;
   explicit OffscreenCanvas(const IntSize&);
   OffscreenCanvasFrameDispatcher* GetOrCreateFrameDispatcher();
   void DoCommit();
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
index c63e8c6..3fe3c0b 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -8,6 +8,7 @@
 #include <memory>
 #include "core/CoreExport.h"
 #include "platform/geometry/LayoutPoint.h"
+#include "platform/graphics/CompositorElementId.h"
 #include "platform/graphics/paint/ClipPaintPropertyNode.h"
 #include "platform/graphics/paint/EffectPaintPropertyNode.h"
 #include "platform/graphics/paint/PaintChunkProperties.h"
@@ -274,6 +275,13 @@
   }
 #endif
 
+  CompositorElementId& GetCompositorElementId() {
+    return compositor_element_id_;
+  }
+  void SetCompositorElementId(const CompositorElementId& id) {
+    compositor_element_id_ = id;
+  }
+
  private:
   ObjectPaintProperties() {}
 
@@ -319,6 +327,7 @@
   RefPtr<TransformPaintPropertyNode> svg_local_to_border_box_transform_;
   RefPtr<TransformPaintPropertyNode> scroll_translation_;
   RefPtr<TransformPaintPropertyNode> scrollbar_paint_offset_;
+  CompositorElementId compositor_element_id_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index f3a77ae..a1b946e2 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -105,6 +105,7 @@
     void* pointer;
     LayoutRect rect;
   } previous_paint_status;
+  uint64_t unique_id;
 };
 
 static_assert(sizeof(PaintLayer) == sizeof(SameSizeAsPaintLayer),
@@ -167,6 +168,8 @@
       static_inline_position_(0),
       static_block_position_(0),
       ancestor_overflow_layer_(nullptr) {
+  static PaintLayerId paint_layer_id_counter = 0;
+  unique_id_ = ++paint_layer_id_counter;
   UpdateStackingNode();
 
   is_self_painting_layer_ = ShouldBeSelfPaintingLayer();
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h
index 71fab18..f1630b4 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -1025,6 +1025,9 @@
   void EndShouldKeepAliveAllClientsRecursive();
 #endif
 
+  // An id for this PaintLayer that is unique for the lifetime of the WebView.
+  PaintLayerId UniqueId() const { return unique_id_; }
+
  private:
   void SetNeedsCompositingInputsUpdateInternal();
 
@@ -1272,6 +1275,8 @@
 
   std::unique_ptr<PaintLayerRareData> rare_data_;
 
+  PaintLayerId unique_id_;
+
   FRIEND_TEST_ALL_PREFIXES(PaintLayerTest,
                            DescendantDependentFlagsStopsAtThrottledFrames);
   FRIEND_TEST_ALL_PREFIXES(PaintLayerTest,
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index 6a65d096..8f109f6 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -72,6 +72,14 @@
   return true;
 }
 
+static CompositorElementId CreatePaintLayereBasedCompositorElementId(
+    const LayoutObject& object) {
+  DCHECK(object.IsBoxModelObject() && object.HasLayer());
+  return CompositorElementIdFromPaintLayerId(
+      ToLayoutBoxModelObject(object).Layer()->UniqueId(),
+      CompositorElementIdNamespace::kPrimary);
+}
+
 // True if a new property was created or a main thread scrolling reason changed
 // (which can affect descendants), false if an existing one was updated.
 static bool UpdateScrollTranslation(
@@ -87,27 +95,24 @@
     MainThreadScrollingReasons main_thread_scrolling_reasons,
     WebLayerScrollClient* scroll_client) {
   DCHECK(!RuntimeEnabledFeatures::rootLayerScrollingEnabled());
+  CompositorElementId compositor_element_id =
+      CreatePaintLayereBasedCompositorElementId(*frame_view.GetLayoutView());
   if (auto* existing_scroll_translation = frame_view.ScrollTranslation()) {
     auto existing_reasons = existing_scroll_translation->ScrollNode()
                                 ->GetMainThreadScrollingReasons();
     existing_scroll_translation->UpdateScrollTranslation(
         std::move(parent), matrix, origin, false, 0, kCompositingReasonNone,
-        CompositorElementIdFromLayoutObjectId(
-            frame_view.GetLayoutView()->UniqueId(),
-            CompositorElementIdNamespace::kScrollTranslation),
-        std::move(scroll_parent), clip, bounds, user_scrollable_horizontal,
-        user_scrollable_vertical, main_thread_scrolling_reasons, scroll_client);
+        compositor_element_id, std::move(scroll_parent), clip, bounds,
+        user_scrollable_horizontal, user_scrollable_vertical,
+        main_thread_scrolling_reasons, scroll_client);
     return existing_reasons != main_thread_scrolling_reasons;
   }
   frame_view.SetScrollTranslation(
       TransformPaintPropertyNode::CreateScrollTranslation(
           std::move(parent), matrix, origin, false, 0, kCompositingReasonNone,
-          CompositorElementIdFromLayoutObjectId(
-              frame_view.GetLayoutView()->UniqueId(),
-              CompositorElementIdNamespace::kScrollTranslation),
-          std::move(scroll_parent), clip, bounds, user_scrollable_horizontal,
-          user_scrollable_vertical, main_thread_scrolling_reasons,
-          scroll_client));
+          compositor_element_id, std::move(scroll_parent), clip, bounds,
+          user_scrollable_horizontal, user_scrollable_vertical,
+          main_thread_scrolling_reasons, scroll_client));
   return true;
 }
 
@@ -424,8 +429,7 @@
           context.current.transform, matrix, TransformOrigin(box),
           context.current.should_flatten_inherited_transform,
           rendering_context_id, compositing_reasons,
-          CompositorElementIdFromLayoutObjectId(
-              object.UniqueId(), CompositorElementIdNamespace::kPrimary));
+          properties.GetCompositorElementId());
     } else {
       force_subtree_update |= properties.ClearTransform();
     }
@@ -585,12 +589,11 @@
 
       DCHECK(!style.HasCurrentOpacityAnimation() ||
              compositing_reasons != kCompositingReasonNone);
+
       force_subtree_update |= properties.UpdateEffect(
           context.current_effect, context.current.transform, output_clip,
           kColorFilterNone, CompositorFilterOperations(), style.Opacity(),
-          blend_mode, compositing_reasons,
-          CompositorElementIdFromLayoutObjectId(
-              object.UniqueId(), CompositorElementIdNamespace::kPrimary));
+          blend_mode, compositing_reasons, properties.GetCompositorElementId());
       if (has_mask) {
         // TODO(crbug.com/683425): PaintArtifactCompositor does not handle
         // grouping (i.e. descendant-dependent compositing reason) properly
@@ -601,8 +604,7 @@
             properties.Effect(), context.current.transform, output_clip,
             mask_color_filter, CompositorFilterOperations(), 1.f,
             SkBlendMode::kDstIn, kCompositingReasonSquashingDisallowed,
-            CompositorElementIdFromLayoutObjectId(
-                object.UniqueId(), CompositorElementIdNamespace::kEffectMask));
+            CompositorElementId());
       } else {
         force_subtree_update |= properties.ClearMask();
       }
@@ -681,9 +683,7 @@
       force_subtree_update |= properties.UpdateFilter(
           context.current_effect, context.current.transform, output_clip,
           kColorFilterNone, std::move(filter), 1.f, SkBlendMode::kSrcOver,
-          compositing_reasons,
-          CompositorElementIdFromLayoutObjectId(
-              object.UniqueId(), CompositorElementIdNamespace::kEffectFilter));
+          compositing_reasons, properties.GetCompositorElementId());
     } else {
       force_subtree_update |= properties.ClearFilter();
     }
@@ -958,12 +958,9 @@
           context.current.transform, matrix, FloatPoint3D(),
           context.current.should_flatten_inherited_transform,
           context.current.rendering_context_id, kCompositingReasonNone,
-          CompositorElementIdFromLayoutObjectId(
-              object.UniqueId(),
-              CompositorElementIdNamespace::kScrollTranslation),
-          context.current.scroll, scroll_clip, scroll_bounds,
-          user_scrollable_horizontal, user_scrollable_vertical, reasons,
-          scrollable_area);
+          properties.GetCompositorElementId(), context.current.scroll,
+          scroll_clip, scroll_bounds, user_scrollable_horizontal,
+          user_scrollable_vertical, reasons, scrollable_area);
     } else {
       // Ensure pre-existing properties are cleared.
       force_subtree_update |= properties.ClearScrollTranslation();
@@ -1170,7 +1167,12 @@
   bool had_paint_properties = object.PaintProperties();
 
   if (needs_paint_properties && !had_paint_properties) {
-    object.GetMutableForPainting().EnsurePaintProperties();
+    ObjectPaintProperties& paint_properties =
+        object.GetMutableForPainting().EnsurePaintProperties();
+    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && object.HasLayer()) {
+      paint_properties.SetCompositorElementId(
+          CreatePaintLayereBasedCompositorElementId(object));
+    }
   } else if (!needs_paint_properties && had_paint_properties) {
     object.GetMutableForPainting().ClearPaintProperties();
     full_context.force_subtree_update = true;
diff --git a/third_party/WebKit/Source/core/paint/RarePaintData.cpp b/third_party/WebKit/Source/core/paint/RarePaintData.cpp
index 310097a..1a47a61 100644
--- a/third_party/WebKit/Source/core/paint/RarePaintData.cpp
+++ b/third_party/WebKit/Source/core/paint/RarePaintData.cpp
@@ -9,10 +9,7 @@
 
 namespace blink {
 
-RarePaintData::RarePaintData() {
-  static LayoutObjectId layout_object_id_counter = 0;
-  unique_id_ = ++layout_object_id_counter;
-}
+RarePaintData::RarePaintData() {}
 
 RarePaintData::~RarePaintData() {}
 
diff --git a/third_party/WebKit/Source/core/paint/RarePaintData.h b/third_party/WebKit/Source/core/paint/RarePaintData.h
index 4d094d9..9353473 100644
--- a/third_party/WebKit/Source/core/paint/RarePaintData.h
+++ b/third_party/WebKit/Source/core/paint/RarePaintData.h
@@ -51,9 +51,6 @@
   // to contents.
   PropertyTreeState ContentsProperties() const;
 
-  // An id for this object that is unique for the lifetime of the WebView.
-  LayoutObjectId UniqueId() const { return unique_id_; }
-
  private:
   // The PaintLayer associated with this LayoutBoxModelObject. This can be null
   // depending on the return value of LayoutBoxModelObject::layerTypeRequired().
@@ -72,8 +69,6 @@
   //   properties would have a transform node that points to the div's
   //   ancestor transform space.
   std::unique_ptr<PropertyTreeState> local_border_box_properties_;
-
-  LayoutObjectId unique_id_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp b/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp
index 4448e3e..36cdc7d 100644
--- a/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElementProxy.cpp
@@ -10,6 +10,7 @@
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 
 namespace blink {
 
@@ -135,7 +136,10 @@
 void SVGElementProxy::Resolve(Document& document) {
   if (is_local_ || id_.IsEmpty() || url_.IsEmpty())
     return;
-  FetchParameters params(ResourceRequest(url_), FetchInitiatorTypeNames::css);
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = FetchInitiatorTypeNames::css;
+  FetchParameters params(ResourceRequest(url_), options);
   document_ = DocumentResource::FetchSVGDocument(params, document.Fetcher());
   url_ = String();
 }
diff --git a/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp b/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp
index abcf84b5..1901564 100644
--- a/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp
@@ -30,6 +30,7 @@
 #include "platform/graphics/Image.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 
 namespace blink {
 
@@ -70,8 +71,11 @@
 }
 
 void SVGFEImageElement::FetchImageResource() {
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = localName();
   FetchParameters params(
-      ResourceRequest(GetDocument().CompleteURL(HrefString())), localName());
+      ResourceRequest(GetDocument().CompleteURL(HrefString())), options);
   cached_image_ = ImageResourceContent::Fetch(params, GetDocument().Fetcher());
 
   if (cached_image_)
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
index 0f377678..32d7fceb 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -44,6 +44,7 @@
 #include "core/xml/parser/XMLDocumentParser.h"
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/wtf/Vector.h"
 
 namespace blink {
@@ -210,7 +211,10 @@
       (resource_ &&
        EqualIgnoringFragmentIdentifier(resolved_url, resource_->Url())))
     return;
-  FetchParameters params(ResourceRequest(resolved_url), localName());
+  ResourceLoaderOptions options(kAllowStoredCredentials,
+                                kClientRequestedCredentials);
+  options.initiator_info.name = localName();
+  FetchParameters params(ResourceRequest(resolved_url), options);
   SetDocumentResource(
       DocumentResource::FetchSVGDocument(params, GetDocument().Fetcher()));
 }
diff --git a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
index 5f8886b..ad26ca3 100644
--- a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
@@ -36,6 +36,7 @@
 #include "core/origin_trials/OriginTrialContext.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "platform/HTTPNames.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
 #include "platform/network/NetworkUtils.h"
@@ -78,8 +79,8 @@
   options.content_security_policy_enforcement =
       kDoNotEnforceContentSecurityPolicy;
 
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.allow_credentials = kAllowStoredCredentials;
+  ResourceLoaderOptions resource_loader_options(
+      kAllowStoredCredentials, kClientDidNotRequestCredentials);
 
   WorkerThreadableLoader::LoadResourceSynchronously(
       ToWorkerGlobalScope(execution_context), request, *this, options,
@@ -103,8 +104,8 @@
   ThreadableLoaderOptions options;
   options.fetch_request_mode = fetch_request_mode;
 
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.allow_credentials = kAllowStoredCredentials;
+  ResourceLoaderOptions resource_loader_options(
+      kAllowStoredCredentials, kClientDidNotRequestCredentials);
 
   // During create, callbacks may happen which could remove the last reference
   // to this object, while some of the callchain assumes that the client and
diff --git a/third_party/WebKit/Source/core/xml/XSLImportRule.cpp b/third_party/WebKit/Source/core/xml/XSLImportRule.cpp
index e50da78..883df75 100644
--- a/third_party/WebKit/Source/core/xml/XSLImportRule.cpp
+++ b/third_party/WebKit/Source/core/xml/XSLImportRule.cpp
@@ -28,6 +28,7 @@
 #include "platform/loader/fetch/FetchParameters.h"
 #include "platform/loader/fetch/RawResource.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/wtf/text/TextEncoding.h"
 
 namespace blink {
@@ -87,10 +88,11 @@
       return;
   }
 
-  ResourceLoaderOptions fetch_options(
-      ResourceFetcher::DefaultResourceOptions());
+  ResourceLoaderOptions fetch_options(kAllowStoredCredentials,
+                                      kClientRequestedCredentials);
+  fetch_options.initiator_info.name = FetchInitiatorTypeNames::xml;
   FetchParameters params(ResourceRequest(owner_document->CompleteURL(abs_href)),
-                         FetchInitiatorTypeNames::xml, fetch_options);
+                         fetch_options);
   params.SetOriginRestriction(FetchParameters::kRestrictToSameOrigin);
   XSLStyleSheetResource* resource = XSLStyleSheetResource::FetchSynchronously(
       params, owner_document->Fetcher());
diff --git a/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp b/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
index b610c52..f64bed106 100644
--- a/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
+++ b/third_party/WebKit/Source/core/xml/XSLTProcessorLibxslt.cpp
@@ -43,6 +43,7 @@
 #include "platform/loader/fetch/Resource.h"
 #include "platform/loader/fetch/ResourceError.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -104,10 +105,10 @@
                reinterpret_cast<const char*>(uri));
       xmlFree(base);
 
-      ResourceLoaderOptions fetch_options(
-          ResourceFetcher::DefaultResourceOptions());
-      FetchParameters params(ResourceRequest(url), FetchInitiatorTypeNames::xml,
-                             fetch_options);
+      ResourceLoaderOptions fetch_options(kAllowStoredCredentials,
+                                          kClientRequestedCredentials);
+      fetch_options.initiator_info.name = FetchInitiatorTypeNames::xml;
+      FetchParameters params(ResourceRequest(url), fetch_options);
       params.SetOriginRestriction(FetchParameters::kRestrictToSameOrigin);
       Resource* resource =
           RawResource::FetchSynchronously(params, g_global_resource_fetcher);
diff --git a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
index 7c15ff6d..d1af447 100644
--- a/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -648,8 +648,10 @@
     Document* document = XMLDocumentParserScope::current_document_;
     XMLDocumentParserScope scope(0);
     // FIXME: We should restore the original global error handler as well.
-    FetchParameters params(ResourceRequest(url), FetchInitiatorTypeNames::xml,
-                           ResourceFetcher::DefaultResourceOptions());
+    ResourceLoaderOptions options(kAllowStoredCredentials,
+                                  kClientRequestedCredentials);
+    options.initiator_info.name = FetchInitiatorTypeNames::xml;
+    FetchParameters params(ResourceRequest(url), options);
     Resource* resource =
         RawResource::FetchSynchronously(params, document->Fetcher());
     if (resource && !resource->ErrorOccurred()) {
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index d1ccf8c..be28efee 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -1015,22 +1015,24 @@
   options.fetch_request_mode =
       upload_events ? WebURLRequest::kFetchRequestModeCORSWithForcedPreflight
                     : WebURLRequest::kFetchRequestModeCORS;
-  options.initiator = FetchInitiatorTypeNames::xmlhttprequest;
   options.content_security_policy_enforcement =
       ContentSecurityPolicy::ShouldBypassMainWorld(&execution_context)
           ? kDoNotEnforceContentSecurityPolicy
           : kEnforceContentSecurityPolicy;
   options.timeout_milliseconds = timeout_milliseconds_;
 
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.allow_credentials =
+  StoredCredentials allow_credentials =
       (same_origin_request_ || include_credentials)
           ? kAllowStoredCredentials
           : kDoNotAllowStoredCredentials;
-  resource_loader_options.credentials_requested =
+  CredentialRequest credentials_requested =
       include_credentials ? kClientRequestedCredentials
                           : kClientDidNotRequestCredentials;
+  ResourceLoaderOptions resource_loader_options(allow_credentials,
+                                                credentials_requested);
   resource_loader_options.security_origin = GetSecurityOrigin();
+  resource_loader_options.initiator_info.name =
+      FetchInitiatorTypeNames::xmlhttprequest;
 
   // When responseType is set to "blob", we redirect the downloaded data to a
   // file-handle directly.
diff --git a/third_party/WebKit/Source/modules/BUILD.gn b/third_party/WebKit/Source/modules/BUILD.gn
index a652254..21cd314 100644
--- a/third_party/WebKit/Source/modules/BUILD.gn
+++ b/third_party/WebKit/Source/modules/BUILD.gn
@@ -284,6 +284,7 @@
     "notifications/NotificationDataTest.cpp",
     "notifications/NotificationImageLoaderTest.cpp",
     "notifications/NotificationResourcesLoaderTest.cpp",
+    "offscreencanvas/OffscreenCanvasTest.cpp",
     "payments/AbortTest.cpp",
     "payments/CanMakePaymentTest.cpp",
     "payments/CompleteTest.cpp",
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp
index a307e66..297d48f 100644
--- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.cpp
@@ -45,17 +45,19 @@
 AnimationWorkletGlobalScope::~AnimationWorkletGlobalScope() {}
 
 DEFINE_TRACE(AnimationWorkletGlobalScope) {
-  visitor->Trace(m_animatorDefinitions);
-  visitor->Trace(m_animators);
+  visitor->Trace(animator_definitions_);
+  visitor->Trace(animators_);
   ThreadedWorkletGlobalScope::Trace(visitor);
 }
 
-void AnimationWorkletGlobalScope::Dispose() {
-  DCHECK(IsContextThread());
-  // Clear animators and definitions to avoid reference cycle.
-  m_animatorDefinitions.clear();
-  m_animators.clear();
-  ThreadedWorkletGlobalScope::Dispose();
+DEFINE_TRACE_WRAPPERS(AnimationWorkletGlobalScope) {
+  for (auto animator : animators_)
+    visitor->TraceWrappers(animator);
+
+  for (auto definition : animator_definitions_)
+    visitor->TraceWrappers(definition.value);
+
+  ThreadedWorkletGlobalScope::TraceWrappers(visitor);
 }
 
 void AnimationWorkletGlobalScope::registerAnimator(
@@ -63,7 +65,7 @@
     const ScriptValue& ctorValue,
     ExceptionState& exceptionState) {
   DCHECK(IsContextThread());
-  if (m_animatorDefinitions.Contains(name)) {
+  if (animator_definitions_.Contains(name)) {
     exceptionState.ThrowDOMException(
         kNotSupportedError,
         "A class with name:'" + name + "' is already registered.");
@@ -122,16 +124,18 @@
 
   AnimatorDefinition* definition =
       new AnimatorDefinition(isolate, constructor, animate);
-  m_animatorDefinitions.Set(name, definition);
+  animator_definitions_.Set(
+      name, TraceWrapperMember<AnimatorDefinition>(this, definition));
 
   // Immediately instantiate an animator for the registered definition.
   // TODO(majidvp): Remove this once you add alternative way to instantiate
-  m_animators.push_back(CreateInstance(name));
+  Animator* animator = CreateInstance(name);
+  animators_.push_back(TraceWrapperMember<Animator>(this, animator));
 }
 
 Animator* AnimationWorkletGlobalScope::CreateInstance(const String& name) {
   DCHECK(IsContextThread());
-  AnimatorDefinition* definition = m_animatorDefinitions.at(name);
+  AnimatorDefinition* definition = animator_definitions_.at(name);
   if (!definition)
     return nullptr;
 
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
index cf39c13..f525cdc 100644
--- a/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimationWorkletGlobalScope.h
@@ -9,6 +9,7 @@
 #include "core/workers/ThreadedWorkletGlobalScope.h"
 #include "modules/compositorworker/Animator.h"
 #include "modules/compositorworker/AnimatorDefinition.h"
+#include "platform/bindings/ScriptWrappable.h"
 
 namespace blink {
 
@@ -26,8 +27,7 @@
                                              WorkerClients*);
   ~AnimationWorkletGlobalScope() override;
   DECLARE_TRACE();
-
-  void Dispose() final;
+  DECLARE_TRACE_WRAPPERS();
 
   void registerAnimator(const String& name,
                         const ScriptValue& ctorValue,
@@ -43,11 +43,12 @@
                               WorkerThread*,
                               WorkerClients*);
 
-  typedef HeapHashMap<String, Member<AnimatorDefinition>> DefinitionMap;
-  DefinitionMap m_animatorDefinitions;
+  typedef HeapHashMap<String, TraceWrapperMember<AnimatorDefinition>>
+      DefinitionMap;
+  DefinitionMap animator_definitions_;
 
-  typedef HeapVector<Member<Animator>> AnimatorList;
-  AnimatorList m_animators;
+  typedef HeapVector<TraceWrapperMember<Animator>> AnimatorList;
+  AnimatorList animators_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/compositorworker/Animator.cpp b/third_party/WebKit/Source/modules/compositorworker/Animator.cpp
index ee7bfeb0b..2c7908d 100644
--- a/third_party/WebKit/Source/modules/compositorworker/Animator.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/Animator.cpp
@@ -12,7 +12,7 @@
 Animator::Animator(v8::Isolate* isolate,
                    AnimatorDefinition* definition,
                    v8::Local<v8::Object> instance)
-    : definition_(definition), instance_(isolate, instance) {}
+    : definition_(this, definition), instance_(isolate, this, instance) {}
 
 Animator::~Animator() {}
 
@@ -20,4 +20,9 @@
   visitor->Trace(definition_);
 }
 
+DEFINE_TRACE_WRAPPERS(Animator) {
+  visitor->TraceWrappers(definition_);
+  visitor->TraceWrappers(instance_.Cast<v8::Value>());
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/compositorworker/Animator.h b/third_party/WebKit/Source/modules/compositorworker/Animator.h
index b46b4f7..c1b8812 100644
--- a/third_party/WebKit/Source/modules/compositorworker/Animator.h
+++ b/third_party/WebKit/Source/modules/compositorworker/Animator.h
@@ -5,7 +5,9 @@
 #ifndef Animator_h
 #define Animator_h
 
-#include "platform/bindings/ScopedPersistent.h"
+#include "platform/bindings/ScriptWrappable.h"
+#include "platform/bindings/TraceWrapperMember.h"
+#include "platform/bindings/TraceWrapperV8Reference.h"
 #include "platform/heap/Handle.h"
 #include "v8/include/v8.h"
 
@@ -13,19 +15,19 @@
 
 class AnimatorDefinition;
 
-class Animator final : public GarbageCollectedFinalized<Animator> {
+class Animator final : public GarbageCollectedFinalized<Animator>,
+                       public TraceWrapperBase {
  public:
   Animator(v8::Isolate*, AnimatorDefinition*, v8::Local<v8::Object> instance);
   ~Animator();
   DECLARE_TRACE();
+  DECLARE_TRACE_WRAPPERS();
 
  private:
   // This object keeps the definition object, and animator instance alive.
-  // It needs to be destroyed to break a reference cycle between it and the
-  // AnimationWorkletGlobalScope. The reference cycle is broken at
-  // |AnimationWorkletGlobalScope::Dispose()|.
-  Member<AnimatorDefinition> definition_;
-  ScopedPersistent<v8::Object> instance_;
+  // It participates in wrapper tracing as it holds onto V8 wrappers.
+  TraceWrapperMember<AnimatorDefinition> definition_;
+  TraceWrapperV8Reference<v8::Object> instance_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.cpp b/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.cpp
index 225d14b7..b36aa1f5 100644
--- a/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.cpp
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.cpp
@@ -15,10 +15,16 @@
 AnimatorDefinition::AnimatorDefinition(v8::Isolate* isolate,
                                        v8::Local<v8::Function> constructor,
                                        v8::Local<v8::Function> animate)
-    : constructor_(isolate, constructor), animate_(isolate, animate) {}
+    : constructor_(isolate, this, constructor),
+      animate_(isolate, this, animate) {}
 
 AnimatorDefinition::~AnimatorDefinition() {}
 
+DEFINE_TRACE_WRAPPERS(AnimatorDefinition) {
+  visitor->TraceWrappers(constructor_.Cast<v8::Value>());
+  visitor->TraceWrappers(animate_.Cast<v8::Value>());
+}
+
 v8::Local<v8::Function> AnimatorDefinition::ConstructorLocal(
     v8::Isolate* isolate) {
   return constructor_.NewLocal(isolate);
diff --git a/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.h b/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.h
index b59cf65d..483f3b4 100644
--- a/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.h
+++ b/third_party/WebKit/Source/modules/compositorworker/AnimatorDefinition.h
@@ -5,7 +5,8 @@
 #ifndef AnimatorDefinition_h
 #define AnimatorDefinition_h
 
-#include "platform/bindings/ScopedPersistent.h"
+#include "platform/bindings/ScriptWrappable.h"
+#include "platform/bindings/TraceWrapperV8Reference.h"
 #include "platform/heap/Handle.h"
 #include "v8/include/v8.h"
 
@@ -17,23 +18,23 @@
 // It can be used to instantiate new animators and also to call the Javascript
 // 'animate' callback on a given instance.
 class AnimatorDefinition final
-    : public GarbageCollectedFinalized<AnimatorDefinition> {
+    : public GarbageCollectedFinalized<AnimatorDefinition>,
+      public TraceWrapperBase {
  public:
   AnimatorDefinition(v8::Isolate*,
                      v8::Local<v8::Function> constructor,
                      v8::Local<v8::Function> animate);
   ~AnimatorDefinition();
   DEFINE_INLINE_TRACE() {}
+  DECLARE_TRACE_WRAPPERS();
 
   v8::Local<v8::Function> ConstructorLocal(v8::Isolate*);
 
  private:
   // This object keeps the constructor function, and animate function alive.
-  // It needs to be destroyed to break a reference cycle between it and the
-  // AnimationWorkletGlobalScope. This cycle is broken in
-  // |AnimationWorkletGlobalScope::Dispose()|.
-  ScopedPersistent<v8::Function> constructor_;
-  ScopedPersistent<v8::Function> animate_;
+  // It participates in wrapper tracing as it holds onto V8 wrappers.
+  TraceWrapperV8Reference<v8::Function> constructor_;
+  TraceWrapperV8Reference<v8::Function> animate_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
index 7a6adbb4..2765bde 100644
--- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp
@@ -55,8 +55,9 @@
     Vector<CSSSyntaxDescriptor>& input_argument_types,
     bool has_alpha)
     : script_state_(script_state),
-      constructor_(script_state->GetIsolate(), constructor),
-      paint_(script_state->GetIsolate(), paint),
+      constructor_(script_state->GetIsolate(), this, constructor),
+      paint_(script_state->GetIsolate(), this, paint),
+      instance_(this),
       did_call_constructor_(false),
       has_alpha_(has_alpha) {
   native_invalidation_properties_.swap(native_invalidation_properties);
@@ -145,4 +146,10 @@
   did_call_constructor_ = true;
 }
 
+DEFINE_TRACE_WRAPPERS(CSSPaintDefinition) {
+  visitor->TraceWrappers(constructor_.Cast<v8::Value>());
+  visitor->TraceWrappers(paint_.Cast<v8::Value>());
+  visitor->TraceWrappers(instance_.Cast<v8::Value>());
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
index 2c95acb..adcd75c 100644
--- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
+++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
@@ -8,7 +8,9 @@
 #include "core/CSSPropertyNames.h"
 #include "core/css/CSSSyntaxDescriptor.h"
 #include "core/css/cssom/CSSStyleValue.h"
-#include "platform/bindings/ScopedPersistent.h"
+#include "platform/bindings/ScriptWrappable.h"
+#include "platform/bindings/TraceWrapperMember.h"
+#include "platform/bindings/TraceWrapperV8Reference.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/heap/Handle.h"
 #include "v8/include/v8.h"
@@ -23,7 +25,8 @@
 // the author. It will store the properties for invalidation and input argument
 // types as well.
 class CSSPaintDefinition final
-    : public GarbageCollectedFinalized<CSSPaintDefinition> {
+    : public GarbageCollectedFinalized<CSSPaintDefinition>,
+      public TraceWrapperBase {
  public:
   static CSSPaintDefinition* Create(
       ScriptState*,
@@ -62,6 +65,7 @@
   }
 
   DEFINE_INLINE_TRACE(){};
+  DECLARE_TRACE_WRAPPERS();
 
  private:
   CSSPaintDefinition(ScriptState*,
@@ -77,13 +81,13 @@
   RefPtr<ScriptState> script_state_;
 
   // This object keeps the class instance object, constructor function and
-  // paint function alive. This object needs to be destroyed to break a
-  // reference cycle between it and the PaintWorkletGlobalScope.
-  ScopedPersistent<v8::Function> constructor_;
-  ScopedPersistent<v8::Function> paint_;
+  // paint function alive. It participates in wrapper tracing as it holds onto
+  // V8 wrappers.
+  TraceWrapperV8Reference<v8::Function> constructor_;
+  TraceWrapperV8Reference<v8::Function> paint_;
 
   // At the moment there is only ever one instance of a paint class per type.
-  ScopedPersistent<v8::Object> instance_;
+  TraceWrapperV8Reference<v8::Object> instance_;
 
   bool did_call_constructor_;
 
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
index 253e2149..d82cd5f5 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
@@ -57,10 +57,6 @@
   MainThreadDebugger::Instance()->ContextWillBeDestroyed(
       ScriptController()->GetScriptState());
 
-  // Explicitly clear the paint defininitions to break a reference cycle
-  // between them and this global scope.
-  paint_definitions_.clear();
-
   pending_generator_registry_ = nullptr;
   WorkletGlobalScope::Dispose();
 }
@@ -198,7 +194,8 @@
       ScriptController()->GetScriptState(), constructor, paint,
       native_invalidation_properties, custom_invalidation_properties,
       input_argument_types, has_alpha);
-  paint_definitions_.Set(name, definition);
+  paint_definitions_.Set(
+      name, TraceWrapperMember<CSSPaintDefinition>(this, definition));
   pending_generator_registry_->SetDefinition(name, definition);
 }
 
@@ -213,4 +210,10 @@
   MainThreadWorkletGlobalScope::Trace(visitor);
 }
 
+DEFINE_TRACE_WRAPPERS(PaintWorkletGlobalScope) {
+  for (auto definition : paint_definitions_)
+    visitor->TraceWrappers(definition.value);
+  MainThreadWorkletGlobalScope::TraceWrappers(visitor);
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
index a2a514b..ffbdfcc8 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.h
@@ -10,6 +10,7 @@
 #include "core/workers/MainThreadWorkletGlobalScope.h"
 #include "modules/ModulesExport.h"
 #include "modules/csspaint/PaintWorkletPendingGeneratorRegistry.h"
+#include "platform/bindings/ScriptWrappable.h"
 #include "platform/graphics/ImageBuffer.h"
 
 namespace blink {
@@ -40,6 +41,7 @@
   CSSPaintDefinition* FindDefinition(const String& name);
 
   DECLARE_VIRTUAL_TRACE();
+  DECLARE_TRACE_WRAPPERS();
 
  private:
   PaintWorkletGlobalScope(LocalFrame*,
@@ -51,7 +53,8 @@
 
   // The implementation of the "paint definition" concept:
   // https://drafts.css-houdini.org/css-paint-api/#paint-definition
-  typedef HeapHashMap<String, Member<CSSPaintDefinition>> DefinitionMap;
+  typedef HeapHashMap<String, TraceWrapperMember<CSSPaintDefinition>>
+      DefinitionMap;
   DefinitionMap paint_definitions_;
 
   Member<PaintWorkletPendingGeneratorRegistry> pending_generator_registry_;
diff --git a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
index b339f75..1aa3044 100644
--- a/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
+++ b/third_party/WebKit/Source/modules/eventsource/EventSource.cpp
@@ -53,6 +53,7 @@
 #include "modules/eventsource/EventSourceInit.h"
 #include "platform/HTTPNames.h"
 #include "platform/loader/fetch/ResourceError.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -156,14 +157,15 @@
           ? kDoNotEnforceContentSecurityPolicy
           : kEnforceContentSecurityPolicy;
 
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.allow_credentials =
+  StoredCredentials allow_credentials =
       (origin->CanRequestNoSuborigin(current_url_) || with_credentials_)
           ? kAllowStoredCredentials
           : kDoNotAllowStoredCredentials;
-  resource_loader_options.credentials_requested =
+  CredentialRequest credentials_requested =
       with_credentials_ ? kClientRequestedCredentials
                         : kClientDidNotRequestCredentials;
+  ResourceLoaderOptions resource_loader_options(allow_credentials,
+                                                credentials_requested);
   resource_loader_options.data_buffering_policy = kDoNotBufferData;
   resource_loader_options.security_origin = origin;
 
diff --git a/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp b/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp
index dc41e63..ad7768b 100644
--- a/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp
@@ -11,6 +11,7 @@
 #include "platform/blob/BlobURL.h"
 #include "platform/loader/fetch/FetchInitiatorTypeNames.h"
 #include "platform/loader/fetch/ResourceError.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/SecurityOrigin.h"
@@ -282,10 +283,12 @@
   options.fetch_request_mode = WebURLRequest::kFetchRequestModeSameOrigin;
   options.content_security_policy_enforcement =
       kDoNotEnforceContentSecurityPolicy;
-  options.initiator = FetchInitiatorTypeNames::internal;
 
-  ResourceLoaderOptions resource_loader_options;
+  ResourceLoaderOptions resource_loader_options(
+      kDoNotAllowStoredCredentials, kClientDidNotRequestCredentials);
   resource_loader_options.data_buffering_policy = kDoNotBufferData;
+  resource_loader_options.initiator_info.name =
+      FetchInitiatorTypeNames::internal;
 
   return ThreadableLoader::Create(*GetExecutionContext(), this, options,
                                   resource_loader_options);
diff --git a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
index cd2c746..60e69cdf8 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchManager.cpp
@@ -33,6 +33,7 @@
 #include "platform/bindings/V8ThrowException.h"
 #include "platform/loader/fetch/FetchUtils.h"
 #include "platform/loader/fetch/ResourceError.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceResponse.h"
 #include "platform/network/NetworkUtils.h"
@@ -773,8 +774,6 @@
   // "request's credentials mode is "same-origin" and request's environment
   // settings object has the suborigin unsafe credentials flag set and the
   // request’s current url is same-physical-origin with request origin."
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.data_buffering_policy = kDoNotBufferData;
   bool suborigin_forces_credentials =
       (request_->Credentials() ==
            WebURLRequest::kFetchCredentialsModeSameOrigin &&
@@ -783,19 +782,24 @@
            Suborigin::SuboriginPolicyOptions::kUnsafeCredentials) &&
        SecurityOrigin::Create(request_->Url())
            ->IsSameSchemeHostPort(request_->Origin().Get()));
+  StoredCredentials allow_credentials = kDoNotAllowStoredCredentials;
   if (request_->Credentials() == WebURLRequest::kFetchCredentialsModeInclude ||
       request_->Credentials() == WebURLRequest::kFetchCredentialsModePassword ||
       (request_->Credentials() ==
            WebURLRequest::kFetchCredentialsModeSameOrigin &&
        !cors_flag) ||
       suborigin_forces_credentials) {
-    resource_loader_options.allow_credentials = kAllowStoredCredentials;
+    allow_credentials = kAllowStoredCredentials;
   }
+  CredentialRequest credentials_requested = kClientDidNotRequestCredentials;
   if (request_->Credentials() == WebURLRequest::kFetchCredentialsModeInclude ||
       request_->Credentials() == WebURLRequest::kFetchCredentialsModePassword ||
       suborigin_forces_credentials) {
-    resource_loader_options.credentials_requested = kClientRequestedCredentials;
+    credentials_requested = kClientRequestedCredentials;
   }
+  ResourceLoaderOptions resource_loader_options(allow_credentials,
+                                                credentials_requested);
+  resource_loader_options.data_buffering_policy = kDoNotBufferData;
   resource_loader_options.security_origin = request_->Origin().Get();
 
   ThreadableLoaderOptions threadable_loader_options;
@@ -850,7 +854,8 @@
   // We intentionally skip 'setExternalRequestStateFromRequestorAddressSpace',
   // as 'data:' can never be external.
 
-  ResourceLoaderOptions resource_loader_options;
+  ResourceLoaderOptions resource_loader_options(
+      kDoNotAllowStoredCredentials, kClientDidNotRequestCredentials);
   resource_loader_options.data_buffering_policy = kDoNotBufferData;
   resource_loader_options.security_origin = request_->Origin().Get();
 
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
index d80b5dde..4eb7074 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
@@ -111,8 +111,8 @@
 
   // TODO(mvanouwerkerk): Add an entry for notifications to
   // FetchInitiatorTypeNames and use it.
-  ResourceLoaderOptions resource_loader_options;
-  resource_loader_options.allow_credentials = kAllowStoredCredentials;
+  ResourceLoaderOptions resource_loader_options(
+      kAllowStoredCredentials, kClientDidNotRequestCredentials);
   if (execution_context->IsWorkerGlobalScope())
     resource_loader_options.request_initiator_context = kWorkerContext;
 
diff --git a/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasTest.cpp b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasTest.cpp
new file mode 100644
index 0000000..4ac0309c
--- /dev/null
+++ b/third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasTest.cpp
@@ -0,0 +1,106 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/dom/Document.h"
+#include "core/frame/LocalFrameView.h"
+#include "core/frame/Settings.h"
+#include "core/html/HTMLCanvasElement.h"
+#include "core/loader/EmptyClients.h"
+#include "core/offscreencanvas/OffscreenCanvas.h"
+#include "core/testing/DummyPageHolder.h"
+#include "modules/canvas/HTMLCanvasElementModule.h"
+#include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
+#include "platform/testing/TestingPlatformSupport.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using ::testing::Mock;
+
+namespace blink {
+
+class OffscreenCanvasTest : public ::testing::Test {
+ protected:
+  OffscreenCanvasTest();
+  void SetUp() override;
+
+  DummyPageHolder& Page() const { return *dummy_page_holder_; }
+  Document& GetDocument() const { return *document_; }
+  HTMLCanvasElement& CanvasElement() const { return *canvas_element_; }
+  OffscreenCanvas& OSCanvas() const { return *offscreen_canvas_; }
+  OffscreenCanvasFrameDispatcher* Dispatcher() const {
+    return offscreen_canvas_->GetOrCreateFrameDispatcher();
+  }
+  OffscreenCanvasRenderingContext2D& Context() const { return *context_; }
+  ScriptState* GetScriptState() const {
+    return ToScriptStateForMainWorld(GetDocument().GetFrame());
+  }
+  ScopedTestingPlatformSupport<TestingPlatformSupport>& platform() {
+    return platform_;
+  }
+
+ private:
+  std::unique_ptr<DummyPageHolder> dummy_page_holder_;
+  Persistent<Document> document_;
+  Persistent<HTMLCanvasElement> canvas_element_;
+  Persistent<OffscreenCanvas> offscreen_canvas_;
+  Persistent<OffscreenCanvasRenderingContext2D> context_;
+  ScopedTestingPlatformSupport<TestingPlatformSupport> platform_;
+};
+
+OffscreenCanvasTest::OffscreenCanvasTest() {}
+
+void OffscreenCanvasTest::SetUp() {
+  Page::PageClients page_clients;
+  FillWithEmptyClients(page_clients);
+  dummy_page_holder_ =
+      DummyPageHolder::Create(IntSize(800, 600), &page_clients);
+  document_ = &dummy_page_holder_->GetDocument();
+  document_->documentElement()->setInnerHTML(
+      "<body><canvas id='c'></canvas></body>");
+  document_->View()->UpdateAllLifecyclePhases();
+  canvas_element_ = toHTMLCanvasElement(document_->getElementById("c"));
+  DummyExceptionStateForTesting exception_state;
+  offscreen_canvas_ = HTMLCanvasElementModule::transferControlToOffscreen(
+      *canvas_element_, exception_state);
+  CanvasContextCreationAttributes attrs;
+  context_ = static_cast<OffscreenCanvasRenderingContext2D*>(
+      offscreen_canvas_->GetCanvasRenderingContext(document_, String("2d"),
+                                                   attrs));
+}
+
+TEST_F(OffscreenCanvasTest, AnimationNotInitiallySuspended) {
+  ScriptState::Scope scope(GetScriptState());
+  EXPECT_FALSE(Dispatcher()->IsAnimationSuspended());
+}
+
+TEST_F(OffscreenCanvasTest, AnimationActiveAfterCommit) {
+  ScriptState::Scope scope(GetScriptState());
+  DummyExceptionStateForTesting exception_state;
+  EXPECT_FALSE(Dispatcher()->NeedsBeginFrame());
+  Context().commit(GetScriptState(), exception_state);
+  EXPECT_TRUE(Dispatcher()->NeedsBeginFrame());
+}
+
+TEST_F(OffscreenCanvasTest, AnimationSuspendedWhilePlaceholderHidden) {
+  ScriptState::Scope scope(GetScriptState());
+  DummyExceptionStateForTesting exception_state;
+
+  // Do a commit and run it to completion so that the frame dispatcher
+  // instance becomes known to OffscreenCanvas (async).
+  Context().commit(GetScriptState(), exception_state);  // necessary
+  platform()->RunUntilIdle();
+  EXPECT_FALSE(Dispatcher()->IsAnimationSuspended());
+
+  // Change visibility to hidden -> animation should be suspended
+  Page().GetPage().SetVisibilityState(kPageVisibilityStateHidden, false);
+  platform()->RunUntilIdle();
+  EXPECT_TRUE(Dispatcher()->IsAnimationSuspended());
+
+  // Change visibility to visible -> animation should resume
+  Page().GetPage().SetVisibilityState(kPageVisibilityStateVisible, false);
+  platform()->RunUntilIdle();
+  EXPECT_FALSE(Dispatcher()->IsAnimationSuspended());
+}
+
+}  // blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp
index f97e28ee..0afd125b 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.cpp
@@ -45,13 +45,6 @@
 
 AudioWorkletGlobalScope::~AudioWorkletGlobalScope() {}
 
-void AudioWorkletGlobalScope::Dispose() {
-  DCHECK(IsContextThread());
-  processor_definition_map_.clear();
-  processor_instances_.clear();
-  ThreadedWorkletGlobalScope::Dispose();
-}
-
 void AudioWorkletGlobalScope::registerProcessor(
     const String& name,
     const ScriptValue& class_definition,
@@ -120,7 +113,9 @@
           isolate, name, class_definition_local, process_function_local);
   DCHECK(definition);
 
-  processor_definition_map_.Set(name, definition);
+  processor_definition_map_.Set(
+      name,
+      TraceWrapperMember<AudioWorkletProcessorDefinition>(this, definition));
 }
 
 AudioWorkletProcessor* AudioWorkletGlobalScope::CreateInstance(
@@ -145,7 +140,8 @@
   DCHECK(processor);
 
   processor->SetInstance(isolate, instance_local);
-  processor_instances_.push_back(processor);
+  processor_instances_.push_back(
+      TraceWrapperMember<AudioWorkletProcessor>(this, processor));
 
   return processor;
 }
@@ -195,4 +191,14 @@
   ThreadedWorkletGlobalScope::Trace(visitor);
 }
 
+DEFINE_TRACE_WRAPPERS(AudioWorkletGlobalScope) {
+  for (auto definition : processor_definition_map_)
+    visitor->TraceWrappers(definition.value);
+
+  for (auto processor : processor_instances_)
+    visitor->TraceWrappers(processor);
+
+  ThreadedWorkletGlobalScope::TraceWrappers(visitor);
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
index 78b0643..2935d97 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletGlobalScope.h
@@ -9,6 +9,7 @@
 #include "core/dom/ExecutionContext.h"
 #include "core/workers/ThreadedWorkletGlobalScope.h"
 #include "modules/ModulesExport.h"
+#include "platform/bindings/ScriptWrappable.h"
 
 namespace blink {
 
@@ -31,7 +32,6 @@
                                          WorkerThread*,
                                          WorkerClients*);
   ~AudioWorkletGlobalScope() override;
-  void Dispose() final;
   bool IsAudioWorkletGlobalScope() const final { return true; }
   void registerProcessor(const String& name,
                          const ScriptValue& class_definition,
@@ -51,6 +51,7 @@
   AudioWorkletProcessorDefinition* FindDefinition(const String& name);
 
   DECLARE_TRACE();
+  DECLARE_TRACE_WRAPPERS();
 
  private:
   AudioWorkletGlobalScope(const KURL&,
@@ -60,9 +61,11 @@
                           WorkerThread*,
                           WorkerClients*);
 
-  typedef HeapHashMap<String, Member<AudioWorkletProcessorDefinition>>
+  typedef HeapHashMap<String,
+                      TraceWrapperMember<AudioWorkletProcessorDefinition>>
       ProcessorDefinitionMap;
-  typedef HeapVector<Member<AudioWorkletProcessor>> ProcessorInstances;
+  typedef HeapVector<TraceWrapperMember<AudioWorkletProcessor>>
+      ProcessorInstances;
 
   ProcessorDefinitionMap processor_definition_map_;
   ProcessorInstances processor_instances_;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.cpp
index 0ed47cb..3a43f7d6 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.cpp
@@ -22,7 +22,7 @@
 AudioWorkletProcessor::AudioWorkletProcessor(
     AudioWorkletGlobalScope* global_scope,
     const String& name)
-    : global_scope_(global_scope), name_(name) {}
+    : global_scope_(global_scope), name_(name), instance_(this) {}
 
 AudioWorkletProcessor::~AudioWorkletProcessor() {}
 
@@ -48,4 +48,8 @@
   visitor->Trace(global_scope_);
 }
 
+DEFINE_TRACE_WRAPPERS(AudioWorkletProcessor) {
+  visitor->TraceWrappers(instance_.Cast<v8::Value>());
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
index 33bc46a..df1a5b56 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.h
@@ -6,7 +6,8 @@
 #define AudioWorkletProcessor_h
 
 #include "modules/ModulesExport.h"
-#include "platform/bindings/ScopedPersistent.h"
+#include "platform/bindings/ScriptWrappable.h"
+#include "platform/bindings/TraceWrapperV8Reference.h"
 #include "platform/heap/Handle.h"
 #include "platform/wtf/text/WTFString.h"
 #include "v8/include/v8.h"
@@ -24,7 +25,8 @@
 // This is constructed and destroyed on a worker thread, and all methods also
 // must be called on the worker thread.
 class MODULES_EXPORT AudioWorkletProcessor
-    : public GarbageCollectedFinalized<AudioWorkletProcessor> {
+    : public GarbageCollectedFinalized<AudioWorkletProcessor>,
+      public TraceWrapperBase {
  public:
   static AudioWorkletProcessor* Create(AudioWorkletGlobalScope*,
                                        const String& name);
@@ -40,13 +42,14 @@
   const String& GetName() const { return name_; }
 
   DECLARE_TRACE();
+  DECLARE_TRACE_WRAPPERS();
 
  private:
   AudioWorkletProcessor(AudioWorkletGlobalScope*, const String& name);
 
   Member<AudioWorkletGlobalScope> global_scope_;
   const String name_;
-  ScopedPersistent<v8::Object> instance_;
+  TraceWrapperV8Reference<v8::Object> instance_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp
index b055c2ff..e6a6d05 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.cpp
@@ -22,8 +22,8 @@
     v8::Local<v8::Function> constructor,
     v8::Local<v8::Function> process)
     : name_(name),
-      constructor_(isolate, constructor),
-      process_(isolate, process) {}
+      constructor_(isolate, this, constructor),
+      process_(isolate, this, process) {}
 
 AudioWorkletProcessorDefinition::~AudioWorkletProcessorDefinition() {}
 
@@ -39,4 +39,9 @@
   return process_.NewLocal(isolate);
 }
 
+DEFINE_TRACE_WRAPPERS(AudioWorkletProcessorDefinition) {
+  visitor->TraceWrappers(constructor_.Cast<v8::Value>());
+  visitor->TraceWrappers(process_.Cast<v8::Value>());
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.h b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.h
index 6e2ddab..26e9f55c 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.h
+++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessorDefinition.h
@@ -6,7 +6,8 @@
 #define AudioWorkletProcessorDefinition_h
 
 #include "modules/ModulesExport.h"
-#include "platform/bindings/ScopedPersistent.h"
+#include "platform/bindings/ScriptWrappable.h"
+#include "platform/bindings/TraceWrapperV8Reference.h"
 #include "platform/heap/Handle.h"
 #include "platform/wtf/text/WTFString.h"
 #include "v8/include/v8.h"
@@ -21,7 +22,8 @@
 // This is constructed and destroyed on a worker thread, and all methods also
 // must be called on the worker thread.
 class MODULES_EXPORT AudioWorkletProcessorDefinition final
-    : public GarbageCollectedFinalized<AudioWorkletProcessorDefinition> {
+    : public GarbageCollectedFinalized<AudioWorkletProcessorDefinition>,
+      public TraceWrapperBase {
  public:
   static AudioWorkletProcessorDefinition* Create(
       v8::Isolate*,
@@ -36,6 +38,7 @@
   v8::Local<v8::Function> ProcessLocal(v8::Isolate*);
 
   DEFINE_INLINE_TRACE(){};
+  DECLARE_TRACE_WRAPPERS();
 
  private:
   AudioWorkletProcessorDefinition(v8::Isolate*,
@@ -47,8 +50,8 @@
 
   // The definition is per global scope. The active instance of
   // |AudioProcessorWorklet| should be passed into these to perform JS function.
-  ScopedPersistent<v8::Function> constructor_;
-  ScopedPersistent<v8::Function> process_;
+  TraceWrapperV8Reference<v8::Function> constructor_;
+  TraceWrapperV8Reference<v8::Function> process_;
 
   // TODO(hongchan): A container for AudioParamDescriptor objects.
   // ScopedPersistent<v8::Array> m_parameterDescriptors;
diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
index 24c0ae0..ecfb7f5 100644
--- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridge.cpp
@@ -62,7 +62,8 @@
       observer_(observer),
       binding_(this),
       frame_sink_id_(Platform::Current()->GenerateFrameSinkId()),
-      parent_frame_sink_id_(layer_tree_view->GetFrameSinkId()) {
+      parent_frame_sink_id_(layer_tree_view ? layer_tree_view->GetFrameSinkId()
+                                            : cc::FrameSinkId()) {
   ref_factory_ =
       new OffscreenCanvasSurfaceReferenceFactory(weak_factory_.GetWeakPtr());
 
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorElementId.cpp b/third_party/WebKit/Source/platform/graphics/CompositorElementId.cpp
index 45c3d6690..1ce0571 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.cpp
@@ -23,14 +23,11 @@
   return CompositorElementId(id);
 }
 
-CompositorElementId PLATFORM_EXPORT CompositorElementIdFromLayoutObjectId(
-    LayoutObjectId id,
-    CompositorElementIdNamespace namespace_id) {
+CompositorElementId PLATFORM_EXPORT
+CompositorElementIdFromPaintLayerId(PaintLayerId id,
+                                    CompositorElementIdNamespace namespace_id) {
   DCHECK(namespace_id == CompositorElementIdNamespace::kPrimary ||
-         namespace_id == CompositorElementIdNamespace::kScroll ||
-         namespace_id == CompositorElementIdNamespace::kEffectFilter ||
-         namespace_id == CompositorElementIdNamespace::kEffectMask ||
-         namespace_id == CompositorElementIdNamespace::kScrollTranslation);
+         namespace_id == CompositorElementIdNamespace::kScroll);
   return CreateCompositorElementId(id, namespace_id);
 }
 
@@ -54,11 +51,6 @@
   return CreateCompositorElementId(id, namespace_id);
 }
 
-CompositorElementId CompositorElementIdFromRootEffectId(uint64_t id) {
-  return CreateCompositorElementId(id,
-                                   CompositorElementIdNamespace::kEffectRoot);
-}
-
 CompositorElementIdNamespace NamespaceFromCompositorElementId(
     CompositorElementId element_id) {
   return static_cast<CompositorElementIdNamespace>(
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
index 9942ab4..42b99f0 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
@@ -13,7 +13,7 @@
 
 namespace blink {
 
-const int kCompositorNamespaceBitCount = 4;
+const int kCompositorNamespaceBitCount = 3;
 
 enum class CompositorElementIdNamespace {
   kPrimary,
@@ -25,31 +25,26 @@
   kLinkHighlight,
   kPrimaryCompositorProxy,
   kScrollCompositorProxy,
-  // The following are SPv2-only.
-  kEffectFilter,
-  kEffectMask,
-  kEffectRoot,
-  kScrollTranslation,
   // A sentinel to indicate the maximum representable namespace id
   // (the maximum is one less than this value).
   kMaxRepresentableNamespaceId = 1 << kCompositorNamespaceBitCount
 };
 
 using CompositorElementId = cc::ElementId;
-using LayoutObjectId = uint64_t;
+using PaintLayerId = uint64_t;
 using ScrollbarId = uint64_t;
 using DOMNodeId = uint64_t;
 
 CompositorElementId PLATFORM_EXPORT
-    CompositorElementIdFromLayoutObjectId(LayoutObjectId,
-                                          CompositorElementIdNamespace);
+    CompositorElementIdFromPaintLayerId(PaintLayerId,
+                                        CompositorElementIdNamespace);
 
 // This method should only be used for "special" layers that are not allocated
 // during the normal lifecycle. Examples include VisualViewport,
 // root scrolling (when rootLayerScrollingEnabled is off), and LinkHighlight,
 // or when CompositorProxies are involved.
 
-// Otherwise, CompositorElementIdFromLayoutObjectId is preferred for performance
+// Otherwise, CompositorElementIdFromPaintLayerId is preferred for performance
 // reasons (since computing a DOMNodeId requires a hash map lookup),
 // and future compatibility with multicol/pagination.
 CompositorElementId PLATFORM_EXPORT
@@ -59,9 +54,6 @@
     CompositorElementIdFromScrollbarId(ScrollbarId,
                                        CompositorElementIdNamespace);
 
-CompositorElementId PLATFORM_EXPORT
-CompositorElementIdFromRootEffectId(uint64_t id);
-
 // Note cc::ElementId has a hash function already implemented via
 // ElementIdHash::operator(). However for consistency's sake we choose to use
 // Blink's hash functions with Blink specific data structures.
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp b/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp
index ad80575..50a5c61 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementIdTest.cpp
@@ -15,7 +15,7 @@
 }
 
 TEST_F(CompositorElementIdTest, EncodeDecode) {
-  CompositorElementId element_id = CompositorElementIdFromLayoutObjectId(
+  CompositorElementId element_id = CompositorElementIdFromPaintLayerId(
       1, CompositorElementIdNamespace::kPrimary);
   EXPECT_EQ(1u, IdFromCompositorElementId(element_id));
   EXPECT_EQ(CompositorElementIdNamespace::kPrimary,
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcher.h b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcher.h
index 726af80..9baba42 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcher.h
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcher.h
@@ -27,8 +27,11 @@
                              double commit_start_time,
                              const SkIRect& damage_rect,
                              bool is_web_gl_software_rendering) = 0;
-  virtual void SetNeedsBeginFrame(bool) = 0;
   virtual void ReclaimResource(unsigned resource_id) = 0;
+  virtual void SetNeedsBeginFrame(bool) = 0;
+  virtual void SetSuspendAnimation(bool) = 0;
+  virtual bool NeedsBeginFrame() const = 0;
+  virtual bool IsAnimationSuspended() const = 0;
 
   virtual void Reshape(int width, int height) = 0;
 
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
index 420579c..9b8248e 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -433,9 +433,25 @@
 
 void OffscreenCanvasFrameDispatcherImpl::SetNeedsBeginFrame(
     bool needs_begin_frame) {
-  if (sink_ && needs_begin_frame != needs_begin_frame_) {
-    needs_begin_frame_ = needs_begin_frame;
-    sink_->SetNeedsBeginFrame(needs_begin_frame);
+  if (needs_begin_frame_ == needs_begin_frame)
+    return;
+  needs_begin_frame_ = needs_begin_frame;
+  if (!suspend_animation_)
+    SetNeedsBeginFrameInternal();
+}
+
+void OffscreenCanvasFrameDispatcherImpl::SetSuspendAnimation(
+    bool suspend_animation) {
+  if (suspend_animation_ == suspend_animation)
+    return;
+  suspend_animation_ = suspend_animation;
+  if (needs_begin_frame_)
+    SetNeedsBeginFrameInternal();
+}
+
+void OffscreenCanvasFrameDispatcherImpl::SetNeedsBeginFrameInternal() {
+  if (sink_) {
+    sink_->SetNeedsBeginFrame(needs_begin_frame_ && !suspend_animation_);
   }
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h
index 88f205af..8c66a57 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.h
@@ -33,6 +33,9 @@
   // OffscreenCanvasFrameDispatcher implementation.
   ~OffscreenCanvasFrameDispatcherImpl() final;
   void SetNeedsBeginFrame(bool) final;
+  void SetSuspendAnimation(bool) final;
+  bool NeedsBeginFrame() const final { return needs_begin_frame_; }
+  bool IsAnimationSuspended() const final { return suspend_animation_; }
   void DispatchFrame(RefPtr<StaticBitmapImage>,
                      double commit_start_time,
                      const SkIRect& damage_rect,
@@ -64,7 +67,8 @@
   int width_;
   int height_;
   bool change_size_for_next_commit_;
-  bool needs_begin_frame_;
+  bool suspend_animation_ = false;
+  bool needs_begin_frame_ = false;
   int pending_compositor_frames_ = 0;
 
   unsigned next_resource_id_;
@@ -84,6 +88,8 @@
   std::unique_ptr<FrameResource> recycleable_resource_;
   std::unique_ptr<FrameResource> createOrRecycleFrameResource();
 
+  void SetNeedsBeginFrameInternal();
+
   typedef HashMap<unsigned, std::unique_ptr<FrameResource>> ResourceMap;
   void ReclaimResourceInternal(const ResourceMap::iterator&);
   ResourceMap resources_;
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp
index b692061..10c1daa 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp
@@ -30,6 +30,14 @@
   }
 }
 
+void SetSuspendAnimation(
+    WeakPtr<blink::OffscreenCanvasFrameDispatcher> dispatcher,
+    bool suspend) {
+  if (dispatcher) {
+    dispatcher->SetSuspendAnimation(suspend);
+  }
+}
+
 }  // unnamed namespace
 
 namespace blink {
@@ -73,6 +81,16 @@
   frame_dispatcher_ = std::move(dispatcher);
   frame_dispatcher_task_runner_ = std::move(task_runner);
   placeholder_frame_resource_id_ = resource_id;
+
+  if (animation_state_ == kShouldSuspendAnimation) {
+    bool success = PostSetSuspendAnimationToOffscreenCanvasThread(true);
+    DCHECK(success);
+    animation_state_ = kSuspendedAnimation;
+  } else if (animation_state_ == kShouldActivateAnimation) {
+    bool success = PostSetSuspendAnimationToOffscreenCanvasThread(false);
+    DCHECK(success);
+    animation_state_ = kActiveAnimation;
+  }
 }
 
 void OffscreenCanvasPlaceholder::ReleasePlaceholderFrame() {
@@ -87,4 +105,50 @@
   }
 }
 
+void OffscreenCanvasPlaceholder::SetSuspendOffscreenCanvasAnimation(
+    bool suspend) {
+  switch (animation_state_) {
+    case kActiveAnimation:
+      if (suspend) {
+        if (PostSetSuspendAnimationToOffscreenCanvasThread(suspend)) {
+          animation_state_ = kSuspendedAnimation;
+        } else {
+          animation_state_ = kShouldSuspendAnimation;
+        }
+      }
+      break;
+    case kSuspendedAnimation:
+      if (!suspend) {
+        if (PostSetSuspendAnimationToOffscreenCanvasThread(suspend)) {
+          animation_state_ = kActiveAnimation;
+        } else {
+          animation_state_ = kShouldActivateAnimation;
+        }
+      }
+      break;
+    case kShouldSuspendAnimation:
+      if (!suspend) {
+        animation_state_ = kActiveAnimation;
+      }
+      break;
+    case kShouldActivateAnimation:
+      if (suspend) {
+        animation_state_ = kSuspendedAnimation;
+      }
+      break;
+    default:
+      NOTREACHED();
+  }
+}
+
+bool OffscreenCanvasPlaceholder::PostSetSuspendAnimationToOffscreenCanvasThread(
+    bool suspend) {
+  if (!frame_dispatcher_task_runner_)
+    return false;
+  frame_dispatcher_task_runner_->PostTask(
+      BLINK_FROM_HERE,
+      CrossThreadBind(SetSuspendAnimation, frame_dispatcher_, suspend));
+  return true;
+}
+
 }  // blink
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h
index b2e0326..9969b4e 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h
@@ -26,6 +26,8 @@
                                    unsigned resource_id);
   void ReleasePlaceholderFrame();
 
+  void SetSuspendOffscreenCanvasAnimation(bool);
+
   static OffscreenCanvasPlaceholder* GetPlaceholderById(
       unsigned placeholder_id);
 
@@ -39,6 +41,7 @@
   bool IsPlaceholderRegistered() const {
     return placeholder_id_ != kNoPlaceholderId;
   }
+  bool PostSetSuspendAnimationToOffscreenCanvasThread(bool suspend);
 
   RefPtr<StaticBitmapImage> placeholder_frame_;
   WeakPtr<OffscreenCanvasFrameDispatcher> frame_dispatcher_;
@@ -49,6 +52,14 @@
     kNoPlaceholderId = -1,
   };
   int placeholder_id_ = kNoPlaceholderId;
+
+  enum AnimationState {
+    kActiveAnimation,
+    kSuspendedAnimation,
+    kShouldSuspendAnimation,
+    kShouldActivateAnimation,
+  };
+  AnimationState animation_state_ = kActiveAnimation;
 };
 
 }  // blink
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
index 60749c7..a3e3182 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -647,7 +647,7 @@
       EffectPaintPropertyNode::Root(), TransformPaintPropertyNode::Root(),
       ClipPaintPropertyNode::Root(), kColorFilterNone,
       CompositorFilterOperations(), 0.5, SkBlendMode::kSrcOver,
-      kCompositingReasonAll, CompositorElementId(2));
+      kCompositingReasonAll);
   RefPtr<EffectPaintPropertyNode> effect2 = EffectPaintPropertyNode::Create(
       effect1, TransformPaintPropertyNode::Root(),
       ClipPaintPropertyNode::Root(), kColorFilterNone,
@@ -684,13 +684,10 @@
 
   const cc::EffectNode& converted_root_effect = *effect_tree.Node(1);
   EXPECT_EQ(-1, converted_root_effect.parent_id);
-  EXPECT_EQ(CompositorElementIdFromRootEffectId(1).id_,
-            converted_root_effect.stable_id);
 
   const cc::EffectNode& converted_effect1 = *effect_tree.Node(2);
   EXPECT_EQ(converted_root_effect.id, converted_effect1.parent_id);
   EXPECT_FLOAT_EQ(0.5, converted_effect1.opacity);
-  EXPECT_EQ(2u, converted_effect1.stable_id);
 
   const cc::EffectNode& converted_effect2 = *effect_tree.Node(3);
   EXPECT_EQ(converted_effect1.id, converted_effect2.parent_id);
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
index 4f91a4ba..9ad9dd7 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
@@ -126,12 +126,11 @@
   cc::EffectNode& effect_node =
       *effect_tree.Node(effect_tree.Insert(cc::EffectNode(), kInvalidNodeId));
   DCHECK_EQ(effect_node.id, kSecondaryRootNodeId);
-  effect_node.stable_id =
-      CompositorElementIdFromRootEffectId(kSecondaryRootNodeId).id_;
+  effect_node.stable_id = root_layer_->id();
   effect_node.transform_id = kRealRootNodeId;
   effect_node.clip_id = kSecondaryRootNodeId;
   effect_node.has_render_surface = true;
-  effect_tree.SetOwningLayerIdForNode(&effect_node, kSecondaryRootNodeId);
+  effect_tree.SetOwningLayerIdForNode(&effect_node, effect_node.stable_id);
 
   effect_stack_.push_back(
       BlinkEffectAndCcIdPair{EffectPaintPropertyNode::Root(), effect_node.id});
@@ -417,7 +416,7 @@
 
   cc::EffectNode& effect_node = *GetEffectTree().Node(GetEffectTree().Insert(
       cc::EffectNode(), GetCurrentCompositorEffectNodeIndex()));
-  effect_node.stable_id = next_effect->GetCompositorElementId().id_;
+  effect_node.stable_id = dummy_layer->id();
   effect_node.clip_id = output_clip_id;
   // Every effect is supposed to have render surface enabled for grouping,
   // but we can get away without one if the effect is opacity-only and has only
@@ -449,9 +448,6 @@
   CompositorElementId compositor_element_id =
       next_effect->GetCompositorElementId();
   if (compositor_element_id) {
-    DCHECK(property_trees_.element_id_to_effect_node_index.find(
-               compositor_element_id) ==
-           property_trees_.element_id_to_effect_node_index.end());
     property_trees_.element_id_to_effect_node_index[compositor_element_id] =
         effect_node.id;
   }
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp
index 2094d35..fe812f2 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.cpp
@@ -33,22 +33,16 @@
 
 namespace blink {
 
-FetchParameters::FetchParameters(const ResourceRequest& resource_request,
-                                 const AtomicString& initiator,
-                                 const String& charset)
+FetchParameters::FetchParameters(const ResourceRequest& resource_request)
     : resource_request_(resource_request),
-      charset_(charset),
-      options_(ResourceFetcher::DefaultResourceOptions()),
+      options_(kAllowStoredCredentials, kClientRequestedCredentials),
       speculative_preload_type_(SpeculativePreloadType::kNotSpeculative),
       preload_discovery_time_(0.0),
       defer_(kNoDefer),
       origin_restriction_(kUseDefaultOriginRestrictionForType),
-      placeholder_image_request_type_(kDisallowPlaceholder) {
-  options_.initiator_info.name = initiator;
-}
+      placeholder_image_request_type_(kDisallowPlaceholder) {}
 
 FetchParameters::FetchParameters(const ResourceRequest& resource_request,
-                                 const AtomicString& initiator,
                                  const ResourceLoaderOptions& options)
     : resource_request_(resource_request),
       options_(options),
@@ -56,23 +50,7 @@
       preload_discovery_time_(0.0),
       defer_(kNoDefer),
       origin_restriction_(kUseDefaultOriginRestrictionForType),
-      placeholder_image_request_type_(
-          PlaceholderImageRequestType::kDisallowPlaceholder) {
-  options_.initiator_info.name = initiator;
-}
-
-FetchParameters::FetchParameters(const ResourceRequest& resource_request,
-                                 const FetchInitiatorInfo& initiator)
-    : resource_request_(resource_request),
-      options_(ResourceFetcher::DefaultResourceOptions()),
-      speculative_preload_type_(SpeculativePreloadType::kNotSpeculative),
-      preload_discovery_time_(0.0),
-      defer_(kNoDefer),
-      origin_restriction_(kUseDefaultOriginRestrictionForType),
-      placeholder_image_request_type_(
-          PlaceholderImageRequestType::kDisallowPlaceholder) {
-  options_.initiator_info = initiator;
-}
+      placeholder_image_request_type_(kDisallowPlaceholder) {}
 
 FetchParameters::~FetchParameters() {}
 
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
index f5b4842..bf09ced 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
@@ -29,7 +29,6 @@
 #include "platform/CrossOriginAttributeValue.h"
 #include "platform/PlatformExport.h"
 #include "platform/loader/fetch/ClientHintsPreferences.h"
-#include "platform/loader/fetch/FetchInitiatorInfo.h"
 #include "platform/loader/fetch/IntegrityMetadata.h"
 #include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
@@ -74,13 +73,8 @@
     ResourceWidth() : width(0), is_set(false) {}
   };
 
-  FetchParameters(const ResourceRequest&,
-                  const AtomicString& initiator,
-                  const String& charset = String());
-  FetchParameters(const ResourceRequest&,
-                  const AtomicString& initiator,
-                  const ResourceLoaderOptions&);
-  FetchParameters(const ResourceRequest&, const FetchInitiatorInfo&);
+  explicit FetchParameters(const ResourceRequest&);
+  FetchParameters(const ResourceRequest&, const ResourceLoaderOptions&);
   ~FetchParameters();
 
   ResourceRequest& MutableResourceRequest() { return resource_request_; }
diff --git a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
index c6e4294..ee4e29d 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
@@ -84,13 +84,12 @@
   RawResource* FetchRawResource() {
     ResourceRequest resource_request(KURL(kParsedURLString, kResourceURL));
     resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-    FetchParameters fetch_params(resource_request, FetchInitiatorInfo());
+    FetchParameters fetch_params(resource_request);
     return RawResource::Fetch(fetch_params, Fetcher());
   }
   MockResource* FetchMockResource() {
     FetchParameters fetch_params(
-        ResourceRequest(KURL(kParsedURLString, kResourceURL)),
-        FetchInitiatorInfo());
+        ResourceRequest(KURL(kParsedURLString, kResourceURL)));
     return MockResource::Fetch(fetch_params, Fetcher());
   }
   ResourceFetcher* Fetcher() const { return fetcher_.Get(); }
@@ -436,7 +435,7 @@
 
   ResourceRequest request2(KURL(kParsedURLString, kResourceURL));
   request2.SetHTTPMethod(HTTPNames::POST);
-  FetchParameters fetch2(request2, FetchInitiatorInfo());
+  FetchParameters fetch2(request2);
   RawResource* resource2 = RawResource::FetchSynchronously(fetch2, Fetcher());
 
   EXPECT_EQ(resource2, GetMemoryCache()->ResourceForURL(request2.Url()));
diff --git a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp
index 0972810..669aead 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheTest.cpp
@@ -31,6 +31,7 @@
 #include "platform/loader/fetch/MemoryCache.h"
 
 #include "platform/loader/fetch/RawResource.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/testing/MockResourceClient.h"
 #include "platform/testing/TestingPlatformSupport.h"
@@ -46,7 +47,9 @@
    public:
     static FakeDecodedResource* Create(const ResourceRequest& request,
                                        Type type) {
-      return new FakeDecodedResource(request, type, ResourceLoaderOptions());
+      ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                    kClientDidNotRequestCredentials);
+      return new FakeDecodedResource(request, type, options);
     }
 
     virtual void AppendData(const char* data, size_t len) {
@@ -66,7 +69,9 @@
   class FakeResource final : public Resource {
    public:
     static FakeResource* Create(const ResourceRequest& request, Type type) {
-      return new FakeResource(request, type, ResourceLoaderOptions());
+      ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                    kClientDidNotRequestCredentials);
+      return new FakeResource(request, type, options);
     }
 
     void FakeEncodedSize(size_t size) { SetEncodedSize(size); }
diff --git a/third_party/WebKit/Source/platform/loader/fetch/RawResource.h b/third_party/WebKit/Source/platform/loader/fetch/RawResource.h
index 6c692aad..7bc1ab9 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/RawResource.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/RawResource.h
@@ -27,6 +27,7 @@
 #include "platform/PlatformExport.h"
 #include "platform/loader/fetch/Resource.h"
 #include "platform/loader/fetch/ResourceClient.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/wtf/WeakPtr.h"
 #include "public/platform/WebDataConsumerHandle.h"
 
@@ -52,7 +53,9 @@
 
   // Exposed for testing
   static RawResource* Create(const ResourceRequest& request, Type type) {
-    return new RawResource(request, type, ResourceLoaderOptions());
+    ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                  kClientDidNotRequestCredentials);
+    return new RawResource(request, type, options);
   }
 
   // FIXME: AssociatedURLLoader shouldn't be a DocumentThreadableLoader and
diff --git a/third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp
index 6478c90..45e4b3f 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/RawResourceTest.cpp
@@ -116,8 +116,7 @@
   ResourceRequest png_request;
   png_request.SetHTTPAccept("image/png");
 
-  EXPECT_FALSE(jpeg_resource->CanReuse(
-      FetchParameters(png_request, FetchInitiatorInfo())));
+  EXPECT_FALSE(jpeg_resource->CanReuse(FetchParameters(png_request)));
 }
 
 class DummyClient final : public GarbageCollectedFinalized<DummyClient>,
@@ -583,8 +582,8 @@
   request.SetHTTPHeaderField(
       HTTPNames::X_DevTools_Emulate_Network_Conditions_Client_Id, "Foo");
   Resource* raw = RawResource::Create(request, Resource::kRaw);
-  EXPECT_TRUE(raw->CanReuse(FetchParameters(ResourceRequest("data:text/html,"),
-                                            FetchInitiatorInfo())));
+  EXPECT_TRUE(
+      raw->CanReuse(FetchParameters(ResourceRequest("data:text/html,"))));
 }
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index 079c0ab..b94eeafe 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -1636,14 +1636,6 @@
     raw_preload_misses.Count(raw_misses);
 }
 
-const ResourceLoaderOptions& ResourceFetcher::DefaultResourceOptions() {
-  DEFINE_STATIC_LOCAL(
-      ResourceLoaderOptions, options,
-      (kBufferData, kAllowStoredCredentials, kClientRequestedCredentials,
-       kCheckContentSecurityPolicy, kDocumentContext));
-  return options;
-}
-
 String ResourceFetcher::GetCacheIdentifier() const {
   if (Context().IsControlledByServiceWorker())
     return String::Number(Context().ServiceWorkerID());
@@ -1659,7 +1651,9 @@
     return;
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(request_context);
-  FetchParameters params(resource_request, initiator_name, resource->Options());
+  ResourceLoaderOptions options = resource->Options();
+  options.initiator_info.name = initiator_name;
+  FetchParameters params(resource_request, options);
   Context().CanRequest(resource->GetType(), resource->LastResourceRequest(),
                        resource->LastResourceRequest().Url(), params.Options(),
                        SecurityViolationReportingPolicy::kReport,
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
index 0493f69..6b431e2 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
@@ -127,8 +127,6 @@
   void HandleLoaderError(Resource*, const ResourceError&);
   bool IsControlledByServiceWorker() const;
 
-  static const ResourceLoaderOptions& DefaultResourceOptions();
-
   String GetCacheIdentifier() const;
 
   enum IsImageSet { kImageNotImageSet, kImageIsImageSet };
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
index e0810d6..f659f72 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp
@@ -43,6 +43,7 @@
 #include "platform/loader/fetch/RawResource.h"
 #include "platform/loader/fetch/ResourceError.h"
 #include "platform/loader/fetch/ResourceLoader.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/loader/fetch/ResourceRequest.h"
 #include "platform/loader/fetch/ResourceTimingInfo.h"
 #include "platform/loader/testing/FetchTestingPlatformSupport.h"
@@ -113,8 +114,7 @@
 
   ResourceRequest resource_request(secure_url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-  FetchParameters fetch_params =
-      FetchParameters(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   Resource* resource = RawResource::Fetch(fetch_params, fetcher);
   ASSERT_TRUE(resource);
   EXPECT_TRUE(resource->ErrorOccurred());
@@ -138,8 +138,7 @@
   response.SetHTTPHeaderField(HTTPNames::Cache_Control, "max-age=3600");
   RegisterMockedURLLoadWithCustomResponse(url, response);
 
-  FetchParameters fetch_params =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params{ResourceRequest(url)};
   Resource* resource = MockResource::Fetch(fetch_params, fetcher);
   ASSERT_TRUE(resource);
   Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
@@ -168,8 +167,7 @@
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-  FetchParameters fetch_params =
-      FetchParameters(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   Platform::Current()->GetURLLoaderMockFactory()->RegisterURL(
       url, WebURLResponse(), "");
   Resource* new_resource = RawResource::Fetch(fetch_params, fetcher);
@@ -188,8 +186,7 @@
   ResourceRequest resource_request(url);
   resource_request.SetFrameType(WebURLRequest::kFrameTypeNested);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextForm);
-  FetchParameters fetch_params =
-      FetchParameters(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   Platform::Current()->GetURLLoaderMockFactory()->RegisterURL(
       url, WebURLResponse(), "");
   Resource* resource =
@@ -237,8 +234,7 @@
   ResourceRequest resource_request(url);
   resource_request.SetCachePolicy(WebCachePolicy::kReturnCacheDataElseLoad);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-  FetchParameters fetch_params =
-      FetchParameters(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   Resource* new_resource = RawResource::Fetch(fetch_params, fetcher);
   EXPECT_EQ(resource, new_resource);
 }
@@ -255,15 +251,13 @@
   response.SetHTTPHeaderField(HTTPNames::Vary, "*");
   RegisterMockedURLLoadWithCustomResponse(url, response);
 
-  FetchParameters fetch_params_original =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_original{ResourceRequest(url)};
   Resource* resource = MockResource::Fetch(fetch_params_original, fetcher);
   ASSERT_TRUE(resource);
   Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
   ASSERT_TRUE(resource->MustReloadDueToVaryHeader(ResourceRequest(url)));
 
-  FetchParameters fetch_params =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params{ResourceRequest(url)};
   Resource* new_resource = MockResource::Fetch(fetch_params, fetcher);
   EXPECT_EQ(resource, new_resource);
 }
@@ -285,7 +279,7 @@
         ResourceFetcher::Create(context, context->GetTaskRunner());
     ResourceRequest resource_request2(resource_->Url());
     resource_request2.SetCachePolicy(WebCachePolicy::kValidatingCacheData);
-    FetchParameters fetch_params2(resource_request2, FetchInitiatorInfo());
+    FetchParameters fetch_params2(resource_request2);
     Resource* resource2 = MockResource::Fetch(fetch_params2, fetcher2);
     EXPECT_EQ(resource_, resource2);
     notify_finished_called_ = true;
@@ -316,8 +310,7 @@
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
   ResourceRequest request1(url);
   request1.SetHTTPHeaderField(HTTPNames::Cache_Control, "no-cache");
-  FetchParameters fetch_params1 =
-      FetchParameters(request1, FetchInitiatorInfo());
+  FetchParameters fetch_params1(request1);
   Resource* resource1 = MockResource::Fetch(fetch_params1, fetcher1);
   Persistent<RequestSameResourceOnComplete> client =
       new RequestSameResourceOnComplete(resource1);
@@ -332,10 +325,11 @@
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
   ResourceRequest request(KURL(kParsedURLString, "data:text/html,foo"));
   request.SetRequestContext(WebURLRequest::kRequestContextVideo);
-  ResourceLoaderOptions options;
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
   options.data_buffering_policy = kDoNotBufferData;
-  FetchParameters fetch_params =
-      FetchParameters(request, FetchInitiatorTypeNames::internal, options);
+  options.initiator_info.name = FetchInitiatorTypeNames::internal;
+  FetchParameters fetch_params(request, options);
   Resource* resource1 = RawResource::FetchMedia(fetch_params, fetcher);
   Resource* resource2 = RawResource::FetchMedia(fetch_params, fetcher);
   EXPECT_NE(resource1, resource2);
@@ -396,8 +390,7 @@
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-  FetchParameters fetch_params =
-      FetchParameters(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   Resource* resource = RawResource::Fetch(fetch_params, fetcher);
   Persistent<ServeRequestsOnCompleteClient> client =
       new ServeRequestsOnCompleteClient();
@@ -435,8 +428,7 @@
         ResourceFetcher::Create(context_, context_->GetTaskRunner());
     ResourceRequest resource_request(url);
     resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-    FetchParameters fetch_params =
-        FetchParameters(resource_request, FetchInitiatorInfo());
+    FetchParameters fetch_params(resource_request);
     RawResource::Fetch(fetch_params, fetcher);
     Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
   }
@@ -491,7 +483,7 @@
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-  FetchParameters fetch_params(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   fetch_params.MakeSynchronous();
   Resource* resource = RawResource::Fetch(fetch_params, fetcher);
   EXPECT_TRUE(resource->IsLoaded());
@@ -506,8 +498,7 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_original =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_original{ResourceRequest(url)};
   fetch_params_original.SetLinkPreload(true);
   Resource* resource = MockResource::Fetch(fetch_params_original, fetcher);
   ASSERT_TRUE(resource);
@@ -515,8 +506,7 @@
   EXPECT_TRUE(fetcher->ContainsAsPreload(resource));
   Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
 
-  FetchParameters fetch_params =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params{ResourceRequest(url)};
   fetch_params.SetLinkPreload(true);
   Resource* new_resource = MockResource::Fetch(fetch_params, fetcher);
   EXPECT_EQ(resource, new_resource);
@@ -536,8 +526,7 @@
   RegisterMockedURLLoad(url);
 
   // Link preload preload scanner
-  FetchParameters fetch_params_original =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_original{ResourceRequest(url)};
   fetch_params_original.SetLinkPreload(true);
   Resource* resource = MockResource::Fetch(fetch_params_original, fetcher);
   ASSERT_TRUE(resource);
@@ -545,16 +534,14 @@
   Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
 
   // Resource created by preload scanner
-  FetchParameters fetch_params_preload_scanner =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_preload_scanner{ResourceRequest(url)};
   Resource* preload_scanner_resource =
       MockResource::Fetch(fetch_params_preload_scanner, fetcher);
   EXPECT_EQ(resource, preload_scanner_resource);
   EXPECT_FALSE(resource->IsLinkPreload());
 
   // Resource created by parser
-  FetchParameters fetch_params =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params{ResourceRequest(url)};
   Resource* new_resource = MockResource::Fetch(fetch_params, fetcher);
   Persistent<MockResourceClient> client = new MockResourceClient(new_resource);
   EXPECT_EQ(resource, new_resource);
@@ -572,16 +559,14 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_original =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_original{ResourceRequest(url)};
   fetch_params_original.SetLinkPreload(true);
   Resource* resource = MockResource::Fetch(fetch_params_original, fetcher);
   ASSERT_TRUE(resource);
   EXPECT_TRUE(resource->IsLinkPreload());
   Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
 
-  FetchParameters fetch_params_second =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_second{ResourceRequest(url)};
   fetch_params_second.MutableResourceRequest().SetCachePolicy(
       WebCachePolicy::kBypassingCache);
   Resource* second_resource = MockResource::Fetch(fetch_params_second, fetcher);
@@ -598,16 +583,14 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_original =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_original{ResourceRequest(url)};
   fetch_params_original.SetLinkPreload(true);
   Resource* resource = MockResource::Fetch(fetch_params_original, fetcher);
   ASSERT_TRUE(resource);
   EXPECT_TRUE(resource->IsLinkPreload());
   Platform::Current()->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
 
-  FetchParameters fetch_params_second =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_second{ResourceRequest(url)};
   fetch_params_second.MutableResourceRequest().SetCachePolicy(
       WebCachePolicy::kBypassingCache);
   Resource* second_resource =
@@ -624,8 +607,7 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_for_request =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_for_request{ResourceRequest(url)};
   FetchParameters fetch_params_for_preload = fetch_params_for_request;
   fetch_params_for_preload.SetLinkPreload(true);
 
@@ -655,8 +637,7 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_for_request =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_for_request{ResourceRequest(url)};
   FetchParameters fetch_params_for_preload = fetch_params_for_request;
   fetch_params_for_preload.SetSpeculativePreloadType(
       FetchParameters::SpeculativePreloadType::kInDocument);
@@ -687,8 +668,7 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_for_request =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_for_request{ResourceRequest(url)};
   FetchParameters fetch_params_for_speculative_preload =
       fetch_params_for_request;
   fetch_params_for_speculative_preload.SetSpeculativePreloadType(
@@ -736,8 +716,7 @@
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
   ResourceRequest resource_request(url);
   resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal);
-  FetchParameters fetch_params =
-      FetchParameters(resource_request, FetchInitiatorInfo());
+  FetchParameters fetch_params(resource_request);
   Platform::Current()->GetURLLoaderMockFactory()->RegisterURL(
       url, WebURLResponse(), "");
   Resource* new_resource = RawResource::Fetch(fetch_params, fetcher);
@@ -755,8 +734,7 @@
   KURL url(kParsedURLString, "http://127.0.0.1:8000/foo.png");
   RegisterMockedURLLoad(url);
 
-  FetchParameters fetch_params_original =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params_original{ResourceRequest(url)};
   fetch_params_original.SetLinkPreload(true);
   Resource* resource = MockResource::Fetch(fetch_params_original, fetcher);
   ASSERT_TRUE(resource);
@@ -764,8 +742,7 @@
   EXPECT_FALSE(fetcher->IsFetching());
 
   // Resource created by parser on the second fetcher
-  FetchParameters fetch_params2 =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_params2{ResourceRequest(url)};
   Resource* new_resource2 = MockResource::Fetch(fetch_params2, fetcher2);
   Persistent<MockResourceClient> client2 =
       new MockResourceClient(new_resource2);
@@ -777,8 +754,7 @@
 TEST_F(ResourceFetcherTest, ContentTypeDataURL) {
   ResourceFetcher* fetcher =
       ResourceFetcher::Create(Context(), Context()->GetTaskRunner());
-  FetchParameters fetch_params = FetchParameters(
-      ResourceRequest("data:text/testmimetype,foo"), FetchInitiatorInfo());
+  FetchParameters fetch_params{ResourceRequest("data:text/testmimetype,foo")};
   Resource* resource = MockResource::Fetch(fetch_params, fetcher);
   ASSERT_TRUE(resource);
   EXPECT_EQ(ResourceStatus::kCached, resource->GetStatus());
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h
index 3331d806..00d9381 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptions.h
@@ -83,28 +83,13 @@
   USING_FAST_MALLOC(ResourceLoaderOptions);
 
  public:
-  ResourceLoaderOptions()
+  ResourceLoaderOptions(StoredCredentials allow_credentials,
+                        CredentialRequest credentials_requested)
       : data_buffering_policy(kBufferData),
-        allow_credentials(kDoNotAllowStoredCredentials),
-        credentials_requested(kClientDidNotRequestCredentials),
-        content_security_policy_option(kCheckContentSecurityPolicy),
-        request_initiator_context(kDocumentContext),
-        synchronous_policy(kRequestAsynchronously),
-        cors_enabled(kNotCORSEnabled),
-        parser_disposition(kParserInserted),
-        cache_aware_loading_enabled(kNotCacheAwareLoadingEnabled) {}
-
-  ResourceLoaderOptions(
-      DataBufferingPolicy data_buffering_policy,
-      StoredCredentials allow_credentials,
-      CredentialRequest credentials_requested,
-      ContentSecurityPolicyDisposition content_security_policy_option,
-      RequestInitiatorContext request_initiator_context)
-      : data_buffering_policy(data_buffering_policy),
         allow_credentials(allow_credentials),
         credentials_requested(credentials_requested),
-        content_security_policy_option(content_security_policy_option),
-        request_initiator_context(request_initiator_context),
+        content_security_policy_option(kCheckContentSecurityPolicy),
+        request_initiator_context(kDocumentContext),
         synchronous_policy(kRequestAsynchronously),
         cors_enabled(kNotCORSEnabled),
         parser_disposition(kParserInserted),
@@ -174,10 +159,8 @@
         cache_aware_loading_enabled(options.cache_aware_loading_enabled) {}
 
   operator ResourceLoaderOptions() const {
-    ResourceLoaderOptions options;
+    ResourceLoaderOptions options(allow_credentials, credentials_requested);
     options.data_buffering_policy = data_buffering_policy;
-    options.allow_credentials = allow_credentials;
-    options.credentials_requested = credentials_requested;
     options.content_security_policy_option = content_security_policy_option;
     options.initiator_info = initiator_info;
     options.request_initiator_context = request_initiator_context;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp
index 61df689..99dec5c 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoaderOptionsTest.cpp
@@ -29,7 +29,8 @@
   static_assert(std::is_enum<CORSEnabled>::value,
                 "CORSEnabled should be an enum");
 
-  ResourceLoaderOptions original;
+  ResourceLoaderOptions original(kDoNotAllowStoredCredentials,
+                                 kClientDidNotRequestCredentials);
   RefPtr<SecurityOrigin> security_origin =
       SecurityOrigin::CreateFromString("http://www.google.com");
   original.security_origin = security_origin;
diff --git a/third_party/WebKit/Source/platform/loader/testing/MockResource.cpp b/third_party/WebKit/Source/platform/loader/testing/MockResource.cpp
index e407673..4289b332 100644
--- a/third_party/WebKit/Source/platform/loader/testing/MockResource.cpp
+++ b/third_party/WebKit/Source/platform/loader/testing/MockResource.cpp
@@ -35,7 +35,9 @@
 
 // static
 MockResource* MockResource::Create(const ResourceRequest& request) {
-  return new MockResource(request, ResourceLoaderOptions());
+  ResourceLoaderOptions options(kDoNotAllowStoredCredentials,
+                                kClientDidNotRequestCredentials);
+  return new MockResource(request, options);
 }
 
 MockResource::MockResource(const ResourceRequest& request,
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/DEPS b/third_party/WebKit/Source/platform/scheduler/renderer/DEPS
index 1a5c72e..f9b2e0b 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/DEPS
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/DEPS
@@ -1,6 +1,7 @@
 include_rules = [
   "+platform/scheduler/base",
   "+platform/scheduler/child",
+  "+base/metrics/single_sample_metrics.h",
   "+source/platform/scheduler/base",
   "+source/platform/scheduler/child",
   "+cc",
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
index 1578d3e9..cad8b3a8 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -220,6 +220,7 @@
       use_virtual_time(false),
       is_audio_playing(false),
       virtual_time_paused(false),
+      has_navigated(false),
       rail_mode_observer(nullptr),
       wake_up_budget_pool(nullptr),
       task_duration_reporter("RendererScheduler.TaskDurationPerQueueType2"),
@@ -1646,6 +1647,12 @@
   }
 }
 
+std::unique_ptr<base::SingleSampleMetric>
+RendererSchedulerImpl::CreateMaxQueueingTimeMetric() {
+  return base::SingleSampleMetricsFactory::Get()->CreateCustomCountsMetric(
+      "RendererScheduler.MaxQueueingTime", 1, 10000, 50);
+}
+
 void RendererSchedulerImpl::OnNavigationStarted() {
   TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
                "RendererSchedulerImpl::OnNavigationStarted");
@@ -1653,6 +1660,19 @@
   ResetForNavigationLocked();
 }
 
+void RendererSchedulerImpl::OnCommitProvisionalLoad() {
+  // Initialize |max_queueing_time_metric| lazily so that
+  // |SingleSampleMetricsFactory::SetFactory()| is called before
+  // |SingleSampleMetricsFactory::Get()|
+  if (!GetMainThreadOnly().max_queueing_time_metric) {
+    GetMainThreadOnly().max_queueing_time_metric =
+        CreateMaxQueueingTimeMetric();
+  }
+  GetMainThreadOnly().max_queueing_time_metric.reset();
+  GetMainThreadOnly().max_queueing_time = base::TimeDelta();
+  GetMainThreadOnly().has_navigated = true;
+}
+
 void RendererSchedulerImpl::OnFirstMeaningfulPaint() {
   TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
                "RendererSchedulerImpl::OnFirstMeaningfulPaint");
@@ -1914,6 +1934,18 @@
 void RendererSchedulerImpl::OnQueueingTimeForWindowEstimated(
     base::TimeDelta queueing_time,
     base::TimeTicks window_start_time) {
+  if (GetMainThreadOnly().has_navigated) {
+    if (GetMainThreadOnly().max_queueing_time < queueing_time) {
+      if (!GetMainThreadOnly().max_queueing_time_metric) {
+        GetMainThreadOnly().max_queueing_time_metric =
+            CreateMaxQueueingTimeMetric();
+      }
+      GetMainThreadOnly().max_queueing_time_metric->SetSample(
+          queueing_time.InMilliseconds());
+      GetMainThreadOnly().max_queueing_time = queueing_time;
+    }
+  }
+
   // RendererScheduler reports the queueing time once per window's duration.
   //          |stepEQT|stepEQT|stepEQT|stepEQT|stepEQT|stepEQT|
   // Report:  |-------window EQT------|
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
index 2ba9c645..9911395 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
@@ -9,6 +9,7 @@
 #include "base/gtest_prod_util.h"
 #include "base/macros.h"
 #include "base/message_loop/message_loop.h"
+#include "base/metrics/single_sample_metrics.h"
 #include "base/single_thread_task_runner.h"
 #include "base/synchronization/lock.h"
 #include "base/trace_event/trace_log.h"
@@ -108,6 +109,7 @@
   void AddPendingNavigation(NavigatingFrameType type) override;
   void RemovePendingNavigation(NavigatingFrameType type) override;
   void OnNavigationStarted() override;
+  void OnCommitProvisionalLoad() override;
   bool IsHighPriorityWorkAnticipated() override;
   bool ShouldYieldForHighPriorityWork() override;
   bool CanExceedIdleDeadlineIfRequired() const override;
@@ -378,6 +380,8 @@
       base::TimeTicks now,
       base::TimeDelta* expected_use_case_duration) const;
 
+  std::unique_ptr<base::SingleSampleMetric> CreateMaxQueueingTimeMetric();
+
   // An input event of some sort happened, the policy may need updating.
   void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type,
                                              InputEventState input_event_state);
@@ -495,6 +499,9 @@
     bool use_virtual_time;
     bool is_audio_playing;
     bool virtual_time_paused;
+    bool has_navigated;
+    std::unique_ptr<base::SingleSampleMetric> max_queueing_time_metric;
+    base::TimeDelta max_queueing_time;
     std::set<WebViewSchedulerImpl*> web_view_schedulers;  // Not owned.
     RAILModeObserver* rail_mode_observer;                 // Not owned.
     WakeUpBudgetPool* wake_up_budget_pool;                // Not owned.
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
index 9571ca3..fb008e4e 100644
--- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
@@ -12,6 +12,7 @@
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
+#include "base/test/histogram_tester.h"
 #include "base/test/simple_test_tick_clock.h"
 #include "cc/output/begin_frame_args.h"
 #include "cc/test/ordered_simple_task_runner.h"
@@ -3947,5 +3948,50 @@
       scheduler_->MainThreadSeemsUnresponsive(responsiveness_threshold()));
 }
 
+//                  Nav Start     Nav Start            assert
+//                     |             |                   |
+//                     v             v                   v
+//    ------------------------------------------------------------>
+//     |---long task---|---1s task---|-----long task ----|
+//
+//                     (---MaxEQT1---)
+//                                   (---MaxEQT2---)
+//
+// --- EQT untracked---|             |---EQT unflushed-----
+//
+// MaxEQT1 = 500ms is recorded and observed in histogram.
+// MaxEQT2 is recorded but not yet in histogram for not being flushed.
+TEST_F(RendererSchedulerImplTest,
+       MaxQueueingTimeMetricRecordedOnlyDuringNavigation) {
+  base::HistogramTester tester;
+  // Start with a long task whose queueing time will be ignored.
+  AdvanceTimeWithTask(10);
+  // Navigation start.
+  scheduler_->OnCommitProvisionalLoad();
+  // The max queueing time of the following task will be recorded.
+  AdvanceTimeWithTask(1);
+  // The smaller queuing time will be ignored.
+  AdvanceTimeWithTask(0.5);
+  scheduler_->OnCommitProvisionalLoad();
+  // Add another long task after navigation start but without navigation end.
+  // This value won't be recorded as there is not navigation.
+  AdvanceTimeWithTask(10);
+  // The expected queueing time of 1s task in 1s window is 500ms.
+  tester.ExpectUniqueSample("RendererScheduler.MaxQueueingTime", 500, 1);
+}
+
+// Only the max of all the queueing times is recorded.
+TEST_F(RendererSchedulerImplTest, MaxQueueingTimeMetricRecordTheMax) {
+  base::HistogramTester tester;
+  scheduler_->OnCommitProvisionalLoad();
+  // The smaller queuing time will be ignored.
+  AdvanceTimeWithTask(0.5);
+  // The max queueing time of the following task will be recorded.
+  AdvanceTimeWithTask(1);
+  // The smaller queuing time will be ignored.
+  AdvanceTimeWithTask(0.5);
+  scheduler_->OnCommitProvisionalLoad();
+  tester.ExpectUniqueSample("RendererScheduler.MaxQueueingTime", 500, 1);
+}
 }  // namespace scheduler
 }  // namespace blink
diff --git a/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc b/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
index f45154cc..124e760 100644
--- a/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
+++ b/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
@@ -76,6 +76,8 @@
 
 void FakeRendererScheduler::OnRendererForegrounded() {}
 
+void FakeRendererScheduler::OnCommitProvisionalLoad() {}
+
 void FakeRendererScheduler::SuspendRenderer() {}
 
 void FakeRendererScheduler::ResumeRenderer() {}
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index c48b1d5..0e7d46f 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -97,6 +97,7 @@
 #include "platform/loader/fetch/MemoryCache.h"
 #include "platform/loader/fetch/ResourceError.h"
 #include "platform/loader/fetch/ResourceFetcher.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
 #include "platform/scroll/Scrollbar.h"
 #include "platform/scroll/ScrollbarTestSuite.h"
 #include "platform/scroll/ScrollbarTheme.h"
@@ -8655,8 +8656,7 @@
 }
 
 static Resource* FetchManifest(Document* document, const KURL& url) {
-  FetchParameters fetch_parameters =
-      FetchParameters(ResourceRequest(url), FetchInitiatorInfo());
+  FetchParameters fetch_parameters{ResourceRequest(url)};
   fetch_parameters.SetRequestContext(WebURLRequest::kRequestContextManifest);
 
   return RawResource::FetchSynchronously(fetch_parameters, document->Fetcher());
@@ -9788,7 +9788,8 @@
 
   // First try to load the request with regular access. Should fail.
   options.fetch_request_mode = WebURLRequest::kFetchRequestModeCORS;
-  ResourceLoaderOptions resource_loader_options;
+  ResourceLoaderOptions resource_loader_options(
+      kDoNotAllowStoredCredentials, kClientDidNotRequestCredentials);
   DocumentThreadableLoader::LoadResourceSynchronously(
       *frame->GetDocument(), request, client, options, resource_loader_options);
   EXPECT_TRUE(client.Failed());
diff --git a/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h b/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
index 65b3f5ab..86a362e8 100644
--- a/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
+++ b/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
@@ -151,8 +151,15 @@
   // Tells the scheduler that a navigation has started.  The scheduler will
   // prioritize loading tasks for a short duration afterwards.
   // Must be called from the main thread.
+  // TODO(maxlg): remove OnNavigationStarted and migrate this part into
+  // OnCommitProvisionalLoad.
   virtual void OnNavigationStarted() = 0;
 
+  // Tells the scheduler that the provisional load has been committed. This
+  // signals the point that activity stops happening in the old page and the
+  // renderer starts parsing and rendering the new page.
+  virtual void OnCommitProvisionalLoad() = 0;
+
   // Returns true if the scheduler has reason to believe that high priority work
   // may soon arrive on the main thread, e.g., if gesture events were observed
   // recently.
diff --git a/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h b/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
index 52d1fb4b..958d204 100644
--- a/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
+++ b/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
@@ -39,6 +39,7 @@
   void DidAnimateForInputOnCompositorThread() override;
   void OnRendererBackgrounded() override;
   void OnRendererForegrounded() override;
+  void OnCommitProvisionalLoad() override;
   void SuspendRenderer() override;
   void ResumeRenderer() override;
   void AddPendingNavigation(NavigatingFrameType type) override;
diff --git a/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h b/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h
index bd997bed..0a3801a2 100644
--- a/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h
+++ b/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h
@@ -49,6 +49,7 @@
   MOCK_METHOD1(AddPendingNavigation, void(NavigatingFrameType));
   MOCK_METHOD1(RemovePendingNavigation, void(NavigatingFrameType));
   MOCK_METHOD0(OnNavigationStarted, void());
+  MOCK_METHOD0(OnCommitProvisionalLoad, void());
   MOCK_METHOD0(IsHighPriorityWorkAnticipated, bool());
   MOCK_CONST_METHOD0(CanExceedIdleDeadlineIfRequired, bool());
   MOCK_METHOD0(ShouldYieldForHighPriorityWork, bool());
diff --git a/third_party/closure_compiler/compiled_resources2.gyp b/third_party/closure_compiler/compiled_resources2.gyp
index da2bfa5..7b412d9 100644
--- a/third_party/closure_compiler/compiled_resources2.gyp
+++ b/third_party/closure_compiler/compiled_resources2.gyp
@@ -22,7 +22,6 @@
         '<(DEPTH)/chrome/browser/resources/chromeos/quick_unlock/compiled_resources2.gyp:*',
         '<(DEPTH)/chrome/browser/resources/chromeos/select_to_speak/compiled_resources2.gyp:*',
         '<(DEPTH)/chrome/browser/resources/chromeos/switch_access/compiled_resources2.gyp:*',
-        '<(DEPTH)/chrome/browser/resources/cleanup_tool/compiled_resources2.gyp:*',
         '<(DEPTH)/chrome/browser/resources/extensions/compiled_resources2.gyp:*',
         '<(DEPTH)/chrome/browser/resources/help/compiled_resources2.gyp:*',
         '<(DEPTH)/chrome/browser/resources/md_bookmarks/compiled_resources2.gyp:*',
diff --git a/third_party/closure_compiler/externs/automation.js b/third_party/closure_compiler/externs/automation.js
index 2028d33..128d92f 100644
--- a/third_party/closure_compiler/externs/automation.js
+++ b/third_party/closure_compiler/externs/automation.js
@@ -435,6 +435,13 @@
 chrome.automation.AutomationNode.prototype.placeholder;
 
 /**
+ * The role description for this node.
+ * @type {(string|undefined)}
+ * @see https://developer.chrome.com/extensions/automation#type-roleDescription
+ */
+chrome.automation.AutomationNode.prototype.roleDescription;
+
+/**
  * The accessible name for this node, via the <a href="http://www.w3.org/TR/wai-aria/roles#namecalculation"> Accessible Name Calculation</a> process.
  * @type {(string|undefined)}
  * @see https://developer.chrome.com/extensions/automation#type-name
diff --git a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h
index 9974176..a5cb67e 100644
--- a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h
+++ b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h
@@ -203,9 +203,9 @@
 	 */
 	ZCR_REMOTE_SHELL_V1_ERROR_ROLE = 0,
 	/**
-	 * invalid notification id
+	 * invalid notification key
 	 */
-	ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_ID = 1,
+	ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_KEY = 1,
 };
 #endif /* ZCR_REMOTE_SHELL_V1_ERROR_ENUM */
 
@@ -405,15 +405,15 @@
  * @ingroup iface_zcr_remote_shell_v1
  *
  * Creates a notification_surface for the given surface, gives it the
- * notification_surface role and associated it with a notification id.
+ * notification_surface role and associated it with a notification key.
  */
 static inline struct zcr_notification_surface_v1 *
-zcr_remote_shell_v1_get_notification_surface(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, struct wl_surface *surface, const char *notification_id)
+zcr_remote_shell_v1_get_notification_surface(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, struct wl_surface *surface, const char *notification_key)
 {
 	struct wl_proxy *id;
 
 	id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_remote_shell_v1,
-			 ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE, &zcr_notification_surface_v1_interface, NULL, surface, notification_id);
+			 ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE, &zcr_notification_surface_v1_interface, NULL, surface, notification_key);
 
 	return (struct zcr_notification_surface_v1 *) id;
 }
diff --git a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h
index bd16496..3c1b7bca 100644
--- a/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h
+++ b/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h
@@ -206,9 +206,9 @@
 	 */
 	ZCR_REMOTE_SHELL_V1_ERROR_ROLE = 0,
 	/**
-	 * invalid notification id
+	 * invalid notification key
 	 */
-	ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_ID = 1,
+	ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_KEY = 1,
 };
 #endif /* ZCR_REMOTE_SHELL_V1_ERROR_ENUM */
 
@@ -270,13 +270,13 @@
 	 *
 	 * Creates a notification_surface for the given surface, gives it
 	 * the notification_surface role and associated it with a
-	 * notification id.
+	 * notification key.
 	 */
 	void (*get_notification_surface)(struct wl_client *client,
 					 struct wl_resource *resource,
 					 uint32_t id,
 					 struct wl_resource *surface,
-					 const char *notification_id);
+					 const char *notification_key);
 };
 
 #define ZCR_REMOTE_SHELL_V1_ACTIVATED 0
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 8bd2a96..d04ba7e 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -29867,8 +29867,9 @@
   <int value="23" label="Margarita"/>
   <int value="24" label="Note"/>
   <int value="25" label="Sun And Cloud"/>
-  <int value="26" label="Unknown"/>
-  <int value="27" label="GAIA"/>
+  <int value="26" label="Placeholder"/>
+  <int value="27" label="Unknown"/>
+  <int value="28" label="GAIA"/>
 </enum>
 
 <enum name="ProfileCreateResult" type="int">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index ba8bf977..93369d1 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -15846,6 +15846,19 @@
   </summary>
 </histogram>
 
+<histogram name="Enterprise.PublicSession.ExtensionPermissions"
+    enum="ExtensionPermission3">
+  <owner>isandrk@chromium.org</owner>
+  <owner>sduraisamy@chromium.org</owner>
+  <summary>
+    Extensions (and apps) are quite restricted in public sessions for security
+    and privacy concerns - some permissions are blocked which means the
+    extension itself is blocked (prevented from loading). This histogram counts
+    requested permissions on extension installation in public sessions (both
+    installed and blocked extensions).
+  </summary>
+</histogram>
+
 <histogram name="Enterprise.PublicSession.SessionLength" units="minutes">
   <owner>xiyuan@chromium.org</owner>
   <owner>sduraisamy@chromium.org</owner>
@@ -60245,6 +60258,25 @@
   </summary>
 </histogram>
 
+<histogram name="RendererScheduler.MaxQueueingTime" units="ms">
+  <owner>maxlg@chromium.org</owner>
+  <summary>
+    The single maximum estimated queueing duration (or max queueing time)
+    between when user starts navigation and user navigates away. Navigate-away
+    is defined as a fast shutdown or a natural ending of renderer, or the new
+    navigation start which replacing the old navigation.
+
+    The queueing time is estimated on a sliding window basis. The width of the
+    sliding window is 1 second, the sliding step being 50ms. The max queueing
+    time keeps track of the largest queueing time on each slide.
+
+    This metric resets itself at navigation start, updates the max of queueing
+    time with the sliding window moving, reports the max queueing times to the
+    histogram at the next navigation start of the same or different renderer
+    process.
+  </summary>
+</histogram>
+
 <histogram name="RendererScheduler.NumberOfTasksPerQueueType"
     enum="RendererSchedulerTaskQueueType">
   <obsolete>
diff --git a/tools/perf/page_sets/key_mobile_sites.py b/tools/perf/page_sets/key_mobile_sites.py
index df78a8f..b73a474 100644
--- a/tools/perf/page_sets/key_mobile_sites.py
+++ b/tools/perf/page_sets/key_mobile_sites.py
@@ -12,6 +12,8 @@
 
   def __init__(self, url, page_set, name='', tags=None,
                action_on_load_complete=False):
+    if name == '':
+      name = url
     super(KeyMobileSitesPage, self).__init__(
         url=url, page_set=page_set, name=name,
         shared_page_state_class=shared_page_state.SharedMobilePageState,
@@ -27,7 +29,8 @@
   def __init__(self):
     super(KeyMobileSitesPageSet, self).__init__(
       archive_data_file='data/key_mobile_sites.json',
-      cloud_storage_bucket=story.PARTNER_BUCKET)
+      cloud_storage_bucket=story.PARTNER_BUCKET,
+      verify_names=True)
 
 
     # Add pages with predefined classes that contain custom navigation logic.
diff --git a/tools/perf/page_sets/key_mobile_sites_pages.py b/tools/perf/page_sets/key_mobile_sites_pages.py
index cf79415..7754298 100644
--- a/tools/perf/page_sets/key_mobile_sites_pages.py
+++ b/tools/perf/page_sets/key_mobile_sites_pages.py
@@ -8,6 +8,8 @@
 class KeyMobileSitesPage(page_module.Page):
 
   def __init__(self, url, page_set, name='', tags=None):
+    if name == '':
+      name = url
     super(KeyMobileSitesPage, self).__init__(
         url=url, page_set=page_set, name=name,
         shared_page_state_class=shared_page_state.SharedMobilePageState,
diff --git a/tools/perf/page_sets/key_silk_cases.py b/tools/perf/page_sets/key_silk_cases.py
index ee9395f..cd98a27b 100644
--- a/tools/perf/page_sets/key_silk_cases.py
+++ b/tools/perf/page_sets/key_silk_cases.py
@@ -17,7 +17,8 @@
     """
     super(KeySilkCasesPage, self).__init__(
         url=url, page_set=page_set, credentials_path = 'data/credentials.json',
-        shared_page_state_class=shared_page_state.SharedMobilePageState)
+        shared_page_state_class=shared_page_state.SharedMobilePageState,
+        name=url)
     self.archive_data_file = 'data/key_silk_cases.json'
     self._run_no_page_interactions = run_no_page_interactions
 
@@ -723,7 +724,8 @@
   def __init__(self, run_no_page_interactions=False):
     super(KeySilkCasesPageSet, self).__init__(
       archive_data_file='data/key_silk_cases.json',
-      cloud_storage_bucket=story.PARTNER_BUCKET)
+      cloud_storage_bucket=story.PARTNER_BUCKET,
+      verify_names=True)
 
     self.AddStory(Page1(self, run_no_page_interactions))
     self.AddStory(Page2(self, run_no_page_interactions))
diff --git a/tools/perf/page_sets/partial_invalidation_cases.py b/tools/perf/page_sets/partial_invalidation_cases.py
index 3db80f13..700eed1 100644
--- a/tools/perf/page_sets/partial_invalidation_cases.py
+++ b/tools/perf/page_sets/partial_invalidation_cases.py
@@ -14,7 +14,7 @@
 
   def __init__(self, url, page_set):
     super(PartialInvalidationCasesPage, self).__init__(
-        url=url, page_set=page_set)
+        url=url, page_set=page_set, name=url)
 
 
 class PartialInvalidationCasesPageSet(story.StorySet):
@@ -24,7 +24,7 @@
 
   def __init__(self):
     super(PartialInvalidationCasesPageSet, self).__init__(
-        cloud_storage_bucket=story.PARTNER_BUCKET)
+        cloud_storage_bucket=story.PARTNER_BUCKET, verify_names=True)
 
     other_urls = [
         # Why: Reduced test case similar to the single page html5 spec wherein
diff --git a/tools/perf/page_sets/polymer.py b/tools/perf/page_sets/polymer.py
index 47665aa..bb8b998 100644
--- a/tools/perf/page_sets/polymer.py
+++ b/tools/perf/page_sets/polymer.py
@@ -19,7 +19,8 @@
     super(PolymerPage, self).__init__(
       url=url,
       shared_page_state_class=shared_page_state.SharedMobilePageState,
-      page_set=page_set)
+      page_set=page_set,
+      name=url)
     self.script_to_evaluate_on_commit = '''
       document.addEventListener("polymer-ready", function() {
         window.__polymer_ready = true;
@@ -223,7 +224,8 @@
   def __init__(self, run_no_page_interactions=False):
     super(PolymerPageSet, self).__init__(
       archive_data_file='data/polymer.json',
-      cloud_storage_bucket=story.PUBLIC_BUCKET)
+      cloud_storage_bucket=story.PUBLIC_BUCKET,
+      verify_names=True)
 
     self.AddStory(PolymerCalculatorPage(self, run_no_page_interactions))
     self.AddStory(PolymerShadowPage(self, run_no_page_interactions))
diff --git a/tools/perf/page_sets/service_worker.py b/tools/perf/page_sets/service_worker.py
index 798bfc5..58e2eea 100644
--- a/tools/perf/page_sets/service_worker.py
+++ b/tools/perf/page_sets/service_worker.py
@@ -15,7 +15,8 @@
   def __init__(self):
     super(ServiceWorkerPageSet, self).__init__(
         archive_data_file=archive_data_file_path,
-        cloud_storage_bucket=story.PARTNER_BUCKET)
+        cloud_storage_bucket=story.PARTNER_BUCKET,
+        verify_names=True)
 
     # Why: the first application using ServiceWorker
     # 1st time: registration
diff --git a/tools/perf/page_sets/service_worker_micro_benchmark.py b/tools/perf/page_sets/service_worker_micro_benchmark.py
index 21f1c8e..57f9848 100644
--- a/tools/perf/page_sets/service_worker_micro_benchmark.py
+++ b/tools/perf/page_sets/service_worker_micro_benchmark.py
@@ -20,7 +20,8 @@
   def __init__(self):
     super(ServiceWorkerMicroBenchmarkPageSet, self).__init__(
         archive_data_file='data/service_worker_micro_benchmark.json',
-        cloud_storage_bucket=story.PUBLIC_BUCKET)
+        cloud_storage_bucket=story.PUBLIC_BUCKET,
+        verify_names=True)
 
     # pylint: disable=line-too-long
     # The latest code of localhost:8091 is from:
@@ -31,4 +32,5 @@
     # Why: to measure performance of many concurrent fetches
     self.AddStory(ServiceWorkerBenchmarkPage(
         'http://localhost:8091/index.html', self,
-        make_javascript_deterministic=False))
+        make_javascript_deterministic=False,
+        name='http://localhost:8091/index.html'))
diff --git a/tools/perf/page_sets/top_25_pages.py b/tools/perf/page_sets/top_25_pages.py
index fbbc609..670aaa39 100644
--- a/tools/perf/page_sets/top_25_pages.py
+++ b/tools/perf/page_sets/top_25_pages.py
@@ -15,7 +15,8 @@
   def __init__(self):
     super(Top25PageSet, self).__init__(
         archive_data_file='data/top_25.json',
-        cloud_storage_bucket=story.PARTNER_BUCKET)
+        cloud_storage_bucket=story.PARTNER_BUCKET,
+        verify_names=True)
 
     shared_desktop_state = shared_page_state.SharedDesktopPageState
     self.AddStory(top_pages.GoogleWebSearchPage(self, shared_desktop_state))
@@ -60,4 +61,5 @@
 
     for url in other_urls:
       self.AddStory(
-          page.Page(url, self, shared_page_state_class=shared_desktop_state))
+          page.Page(url, self, shared_page_state_class=shared_desktop_state,
+                    name=url))
diff --git a/tools/perf/page_sets/top_pages.py b/tools/perf/page_sets/top_pages.py
index 7f0d187..d27d519 100644
--- a/tools/perf/page_sets/top_pages.py
+++ b/tools/perf/page_sets/top_pages.py
@@ -9,6 +9,8 @@
 
   def __init__(self, url, page_set, shared_page_state_class,
                name='', credentials=None):
+    if name == '':
+      name = url
     super(TopPages, self).__init__(
         url=url, page_set=page_set, name=name,
         credentials_path='data/credentials.json',
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index 13f77b98..f913e11 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -30,6 +30,7 @@
 #include "ui/app_list/views/search_box_view.h"
 #include "ui/app_list/views/search_result_page_view.h"
 #include "ui/app_list/views/start_page_view.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/button.h"
 #include "ui/views/controls/button/custom_button.h"
@@ -51,8 +52,8 @@
   SetLayoutManager(
       features::IsAnswerCardEnabled()
           ? static_cast<views::LayoutManager*>(new views::FillLayout)
-          : static_cast<views::LayoutManager*>(
-                new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0)));
+          : static_cast<views::LayoutManager*>(new views::BoxLayout(
+                views::BoxLayout::kVertical, gfx::Insets(), 0)));
   model_->AddObserver(this);
 }
 
diff --git a/ui/app_list/views/page_switcher.cc b/ui/app_list/views/page_switcher.cc
index 4f9a649a..a2c427f 100644
--- a/ui/app_list/views/page_switcher.cc
+++ b/ui/app_list/views/page_switcher.cc
@@ -12,6 +12,7 @@
 #include "ui/app_list/pagination_model.h"
 #include "ui/gfx/animation/throb_animation.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/skia_util.h"
 #include "ui/views/controls/button/custom_button.h"
 #include "ui/views/layout/box_layout.h"
@@ -220,7 +221,8 @@
                           std::max(kMinButtonWidth, button_width));
 
   buttons_->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kHorizontal, kButtonStripPadding, 0, button_spacing));
+      views::BoxLayout::kHorizontal, gfx::Insets(0, kButtonStripPadding),
+      button_spacing));
   for (int i = 0; i < button_count; ++i) {
     PageSwitcherButton* button =
         static_cast<PageSwitcherButton*>(buttons_->child_at(i));
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc
index 420aede..0d8aec2 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -23,6 +23,7 @@
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/events/event.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/shadow_value.h"
 #include "ui/strings/grit/ui_strings.h"
 #include "ui/views/background.h"
@@ -138,9 +139,9 @@
   content_container_->AddChildView(back_button_);
   content_container_->SetBackground(base::MakeUnique<SearchBoxBackground>());
 
-  views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, kPadding, 0,
-                           kInnerPadding - views::Textfield::kTextPadding);
+  views::BoxLayout* layout = new views::BoxLayout(
+      views::BoxLayout::kHorizontal, gfx::Insets(0, kPadding),
+      kInnerPadding - views::Textfield::kTextPadding);
   content_container_->SetLayoutManager(layout);
   layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
diff --git a/ui/app_list/views/search_result_actions_view.cc b/ui/app_list/views/search_result_actions_view.cc
index 39dabf79..d57f2df 100644
--- a/ui/app_list/views/search_result_actions_view.cc
+++ b/ui/app_list/views/search_result_actions_view.cc
@@ -11,6 +11,7 @@
 #include "ui/app_list/views/search_result_actions_view_delegate.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/image_button.h"
 #include "ui/views/controls/button/md_text_button.h"
@@ -22,8 +23,8 @@
     SearchResultActionsViewDelegate* delegate)
     : delegate_(delegate),
       selected_action_(-1) {
-  SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 10, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
+                                        gfx::Insets(10, 0), 0));
 }
 
 SearchResultActionsView::~SearchResultActionsView() {}
diff --git a/ui/app_list/views/search_result_answer_card_view.cc b/ui/app_list/views/search_result_answer_card_view.cc
index 3e36ba06..f51bf652 100644
--- a/ui/app_list/views/search_result_answer_card_view.cc
+++ b/ui/app_list/views/search_result_answer_card_view.cc
@@ -23,7 +23,7 @@
       : CustomButton(this), view_delegate_(view_delegate) {
     // Center the card horizontally in the container.
     views::BoxLayout* answer_container_layout =
-        new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
+        new views::BoxLayout(views::BoxLayout::kHorizontal);
     answer_container_layout->set_main_axis_alignment(
         views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
     SetLayoutManager(answer_container_layout);
diff --git a/ui/app_list/views/search_result_list_view.cc b/ui/app_list/views/search_result_list_view.cc
index 44a58346..4835d5f 100644
--- a/ui/app_list/views/search_result_list_view.cc
+++ b/ui/app_list/views/search_result_list_view.cc
@@ -18,6 +18,7 @@
 #include "ui/app_list/views/search_result_view.h"
 #include "ui/events/event.h"
 #include "ui/gfx/animation/linear_animation.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/layout/box_layout.h"
 
@@ -40,7 +41,7 @@
       results_container_(new views::View),
       auto_launch_indicator_(new views::View) {
   results_container_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
 
   for (int i = 0; i < kMaxResults; ++i)
     results_container_->AddChildView(new SearchResultView(this));
diff --git a/ui/app_list/views/search_result_page_view.cc b/ui/app_list/views/search_result_page_view.cc
index 20ab5e4..cda5251 100644
--- a/ui/app_list/views/search_result_page_view.cc
+++ b/ui/app_list/views/search_result_page_view.cc
@@ -16,6 +16,7 @@
 #include "ui/app_list/views/search_box_view.h"
 #include "ui/app_list/views/search_result_list_view.h"
 #include "ui/app_list/views/search_result_tile_item_list_view.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/shadow_value.h"
 #include "ui/views/background.h"
 #include "ui/views/layout/box_layout.h"
@@ -58,8 +59,8 @@
       gfx::Insets(kTopPadding, kSearchBoxPadding, 0, kSearchBoxPadding);
   insets += -border->GetInsets();
 
-  views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, kGroupSpacing);
+  views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical,
+                                                  gfx::Insets(), kGroupSpacing);
   layout->set_inside_border_insets(insets);
 
   SetLayoutManager(layout);
diff --git a/ui/app_list/views/search_result_tile_item_list_view.cc b/ui/app_list/views/search_result_tile_item_list_view.cc
index 6ff0a83..5f163b0c 100644
--- a/ui/app_list/views/search_result_tile_item_list_view.cc
+++ b/ui/app_list/views/search_result_tile_item_list_view.cc
@@ -11,6 +11,7 @@
 #include "ui/app_list/app_list_view_delegate.h"
 #include "ui/app_list/search_result.h"
 #include "ui/app_list/views/search_result_tile_item_view.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/textfield/textfield.h"
@@ -32,9 +33,9 @@
     views::Textfield* search_box,
     AppListViewDelegate* view_delegate)
     : search_box_(search_box) {
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
-                                        kHorizontalBorderSpacing, 0,
-                                        kBetweenTileSpacing));
+  SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kHorizontal, gfx::Insets(0, kHorizontalBorderSpacing),
+      kBetweenTileSpacing));
 
   for (size_t i = 0; i < kNumSearchResultTiles; ++i) {
     SearchResultTileItemView* tile_item =
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc
index 7206b6f6..27dce46 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -26,6 +26,7 @@
 #include "ui/app_list/views/search_result_tile_item_view.h"
 #include "ui/app_list/views/tile_item_view.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/controls/image_view.h"
 #include "ui/views/controls/label.h"
@@ -284,7 +285,7 @@
 
 void StartPageView::InitInstantContainer() {
   views::BoxLayout* instant_layout_manager = new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0, kInstantContainerSpacing);
+      views::BoxLayout::kVertical, gfx::Insets(), kInstantContainerSpacing);
   instant_layout_manager->set_inside_border_insets(
       gfx::Insets(0, 0, kSearchBoxAndTilesSpacing, 0));
   instant_layout_manager->set_main_axis_alignment(
diff --git a/ui/arc/notification/arc_notification_content_view.cc b/ui/arc/notification/arc_notification_content_view.cc
index a8c8254..824f337 100644
--- a/ui/arc/notification/arc_notification_content_view.cc
+++ b/ui/arc/notification/arc_notification_content_view.cc
@@ -19,6 +19,7 @@
 #include "ui/gfx/animation/linear_animation.h"
 #include "ui/gfx/animation/tween.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/transform.h"
 #include "ui/message_center/message_center_style.h"
 #include "ui/message_center/views/toast_contents_view.h"
@@ -315,7 +316,7 @@
   // a horizontal box.
   control_buttons_view_ = new views::View();
   control_buttons_view_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kHorizontal));
 
   if (item_->IsOpeningSettingsSupported())
     CreateSettingsButton();
@@ -686,7 +687,7 @@
 
 void ArcNotificationContentView::OnNotificationSurfaceAdded(
     exo::NotificationSurface* surface) {
-  if (surface->notification_id() != notification_key_)
+  if (surface->notification_key() != notification_key_)
     return;
 
   SetSurface(surface);
@@ -694,7 +695,7 @@
 
 void ArcNotificationContentView::OnNotificationSurfaceRemoved(
     exo::NotificationSurface* surface) {
-  if (surface->notification_id() != notification_key_)
+  if (surface->notification_key() != notification_key_)
     return;
 
   SetSurface(nullptr);
diff --git a/ui/arc/notification/arc_notification_surface_manager.cc b/ui/arc/notification/arc_notification_surface_manager.cc
index dbc03b4..719c7dc 100644
--- a/ui/arc/notification/arc_notification_surface_manager.cc
+++ b/ui/arc/notification/arc_notification_surface_manager.cc
@@ -39,13 +39,13 @@
 
 void ArcNotificationSurfaceManager::AddSurface(
     exo::NotificationSurface* surface) {
-  if (notification_surface_map_.find(surface->notification_id()) !=
+  if (notification_surface_map_.find(surface->notification_key()) !=
       notification_surface_map_.end()) {
     NOTREACHED();
     return;
   }
 
-  notification_surface_map_[surface->notification_id()] = surface;
+  notification_surface_map_[surface->notification_key()] = surface;
 
   for (auto& observer : observers_)
     observer.OnNotificationSurfaceAdded(surface);
@@ -53,7 +53,7 @@
 
 void ArcNotificationSurfaceManager::RemoveSurface(
     exo::NotificationSurface* surface) {
-  auto it = notification_surface_map_.find(surface->notification_id());
+  auto it = notification_surface_map_.find(surface->notification_key());
   if (it == notification_surface_map_.end())
     return;
 
diff --git a/ui/aura/BUILD.gn b/ui/aura/BUILD.gn
index 43e7845..9b06c4b 100644
--- a/ui/aura/BUILD.gn
+++ b/ui/aura/BUILD.gn
@@ -313,7 +313,7 @@
     "//base:i18n",
     "//build/config:exe_and_shlib_deps",
     "//build/win:default_exe_manifest",
-    "//cc/surfaces",
+    "//components/viz/host",
     "//skia",
     "//third_party/icu",
     "//ui/base",
diff --git a/ui/aura/demo/DEPS b/ui/aura/demo/DEPS
index 681cd24..4026dbd 100644
--- a/ui/aura/demo/DEPS
+++ b/ui/aura/demo/DEPS
@@ -1,5 +1,5 @@
 include_rules = [
-  "+cc/surfaces/surface_manager.h",
+  "+components/viz/host",
   "+ui/display",          # Windows DPI Initialization.
   "+ui/gl/init/gl_factory.h",  # To initialize GL bindings.
 ]
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index 0af26d7..74b131bb 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -14,7 +14,7 @@
 #include "base/power_monitor/power_monitor_device_source.h"
 #include "base/run_loop.h"
 #include "build/build_config.h"
-#include "cc/surfaces/surface_manager.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "third_party/skia/include/core/SkBlendMode.h"
 #include "ui/aura/client/default_capture_client.h"
 #include "ui/aura/client/window_parenting_client.h"
@@ -138,9 +138,9 @@
 #endif
 
   // The ContextFactory must exist before any Compositors are created.
-  cc::SurfaceManager surface_manager;
+  viz::FrameSinkManagerHost frame_sink_manager;
   auto context_factory =
-      base::MakeUnique<ui::InProcessContextFactory>(&surface_manager);
+      base::MakeUnique<ui::InProcessContextFactory>(&frame_sink_manager);
   context_factory->set_use_test_surface(false);
 
   // Create the message-loop here before creating the root window.
diff --git a/ui/chromeos/ime/candidate_view_unittest.cc b/ui/chromeos/ime/candidate_view_unittest.cc
index 0d004ac0..26dcf638 100644
--- a/ui/chromeos/ime/candidate_view_unittest.cc
+++ b/ui/chromeos/ime/candidate_view_unittest.cc
@@ -11,6 +11,7 @@
 #include "base/strings/utf_string_conversions.h"
 #include "ui/aura/window.h"
 #include "ui/events/test/event_generator.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/button/button.h"
 #include "ui/views/layout/box_layout.h"
 #include "ui/views/layout/fill_layout.h"
@@ -45,7 +46,7 @@
 
     container_ = init_params.delegate->GetContentsView();
     container_->SetLayoutManager(
-        new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+        new views::BoxLayout(views::BoxLayout::kVertical));
     for (size_t i = 0; i < arraysize(kDummyCandidates); ++i) {
       CandidateView* candidate = new CandidateView(
           this, ui::CandidateWindow::VERTICAL);
diff --git a/ui/chromeos/ime/candidate_window_view.cc b/ui/chromeos/ime/candidate_window_view.cc
index 77dd05a19..961a0a8 100644
--- a/ui/chromeos/ime/candidate_window_view.cc
+++ b/ui/chromeos/ime/candidate_window_view.cc
@@ -17,6 +17,7 @@
 #include "ui/display/screen.h"
 #include "ui/gfx/color_palette.h"
 #include "ui/gfx/color_utils.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
@@ -159,7 +160,7 @@
       1, GetNativeTheme()->GetSystemColor(
              ui::NativeTheme::kColorId_MenuBorderColor)));
 
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical));
   auxiliary_text_ = new InformationTextArea(gfx::ALIGN_RIGHT, 0);
   preedit_ = new InformationTextArea(gfx::ALIGN_LEFT, kMinPreeditAreaWidth);
   candidate_area_ = new views::View;
@@ -172,16 +173,16 @@
     AddChildView(candidate_area_);
     AddChildView(auxiliary_text_);
     auxiliary_text_->SetBorderFromPosition(InformationTextArea::TOP);
-    candidate_area_->SetLayoutManager(new views::BoxLayout(
-        views::BoxLayout::kVertical, 0, 0, 0));
+    candidate_area_->SetLayoutManager(
+        new views::BoxLayout(views::BoxLayout::kVertical));
   } else {
     AddChildView(preedit_);
     AddChildView(auxiliary_text_);
     AddChildView(candidate_area_);
     auxiliary_text_->SetAlignment(gfx::ALIGN_LEFT);
     auxiliary_text_->SetBorderFromPosition(InformationTextArea::BOTTOM);
-    candidate_area_->SetLayoutManager(new views::BoxLayout(
-        views::BoxLayout::kHorizontal, 0, 0, 0));
+    candidate_area_->SetLayoutManager(
+        new views::BoxLayout(views::BoxLayout::kHorizontal));
   }
 }
 
@@ -247,14 +248,14 @@
         ReorderChildView(auxiliary_text_, -1);
         auxiliary_text_->SetAlignment(gfx::ALIGN_RIGHT);
         auxiliary_text_->SetBorderFromPosition(InformationTextArea::TOP);
-        candidate_area_->SetLayoutManager(new views::BoxLayout(
-            views::BoxLayout::kVertical, 0, 0, 0));
+        candidate_area_->SetLayoutManager(
+            new views::BoxLayout(views::BoxLayout::kVertical));
       } else {
         ReorderChildView(auxiliary_text_, 1);
         auxiliary_text_->SetAlignment(gfx::ALIGN_LEFT);
         auxiliary_text_->SetBorderFromPosition(InformationTextArea::BOTTOM);
-        candidate_area_->SetLayoutManager(new views::BoxLayout(
-            views::BoxLayout::kHorizontal, 0, 0, 0));
+        candidate_area_->SetLayoutManager(
+            new views::BoxLayout(views::BoxLayout::kHorizontal));
       }
     }
 
diff --git a/ui/chromeos/ime/infolist_window.cc b/ui/chromeos/ime/infolist_window.cc
index 6ca2381..d1f1389 100644
--- a/ui/chromeos/ime/infolist_window.cc
+++ b/ui/chromeos/ime/infolist_window.cc
@@ -15,6 +15,7 @@
 #include "ui/chromeos/ime/candidate_window_constants.h"
 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h"
 #include "ui/gfx/color_utils.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
@@ -116,7 +117,7 @@
                                      const gfx::FontList& title_font_list,
                                      const gfx::FontList& description_font_list)
     : entry_(entry) {
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical));
 
   title_label_ = new views::Label(entry.title, {title_font_list});
   title_label_->SetPosition(gfx::Point(0, 0));
@@ -184,7 +185,7 @@
       1, GetNativeTheme()->GetSystemColor(
              ui::NativeTheme::kColorId_MenuBorderColor)));
 
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical));
 
   views::Label* caption_label = new views::Label(
       l10n_util::GetStringUTF16(IDS_CHROMEOS_IME_INFOLIST_WINDOW_TITLE));
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index 83ca119..f97a41d 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -153,6 +153,7 @@
     "//cc",
     "//cc:test_support",
     "//cc/surfaces",
+    "//components/viz/host",
     "//gpu/command_buffer/client:gles2_c_lib",
     "//gpu/command_buffer/client:gles2_implementation",
     "//gpu/command_buffer/common:gles2_utils",
diff --git a/ui/compositor/DEPS b/ui/compositor/DEPS
index 60a4b3d..4a9a27f6 100644
--- a/ui/compositor/DEPS
+++ b/ui/compositor/DEPS
@@ -1,6 +1,7 @@
 include_rules = [
   "+cc",
   "-cc/blink",
+  "+components/viz/host",
   "+gpu/command_buffer/client/gles2_interface.h",
   "+services/ui/public/cpp",
   "+skia/ext/refptr.h",
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index a623386..25c3e0c 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -60,6 +60,10 @@
 class GpuMemoryBufferManager;
 }
 
+namespace viz {
+class FrameSinkManagerHost;
+}
+
 namespace ui {
 
 class Compositor;
@@ -103,6 +107,9 @@
   // Gets the surface manager.
   virtual cc::SurfaceManager* GetSurfaceManager() = 0;
 
+  // Gets the frame sink manager host instance.
+  virtual viz::FrameSinkManagerHost* GetFrameSinkManagerHost() = 0;
+
   // Inform the display corresponding to this compositor if it is visible. When
   // false it does not need to produce any frames. Visibility is reset for each
   // call to CreateCompositorFrameSink.
diff --git a/ui/compositor/test/context_factories_for_test.cc b/ui/compositor/test/context_factories_for_test.cc
index 85dc87c..d1b18c8 100644
--- a/ui/compositor/test/context_factories_for_test.cc
+++ b/ui/compositor/test/context_factories_for_test.cc
@@ -6,7 +6,7 @@
 
 #include "base/command_line.h"
 #include "base/sys_info.h"
-#include "cc/surfaces/surface_manager.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "ui/compositor/compositor.h"
 #include "ui/compositor/compositor_switches.h"
 #include "ui/compositor/test/in_process_context_factory.h"
@@ -14,7 +14,7 @@
 
 namespace {
 
-static cc::SurfaceManager* g_surface_manager = nullptr;
+static viz::FrameSinkManagerHost* g_frame_sink_manager = nullptr;
 static ui::InProcessContextFactory* g_implicit_factory = NULL;
 static gl::DisableNullDrawGLBindings* g_disable_null_draw = NULL;
 
@@ -34,8 +34,8 @@
     enable_pixel_output = true;
   if (enable_pixel_output)
     g_disable_null_draw = new gl::DisableNullDrawGLBindings;
-  g_surface_manager = new cc::SurfaceManager;
-  g_implicit_factory = new InProcessContextFactory(g_surface_manager);
+  g_frame_sink_manager = new viz::FrameSinkManagerHost;
+  g_implicit_factory = new InProcessContextFactory(g_frame_sink_manager);
   g_implicit_factory->SetUseFastRefreshRateForTests();
   *context_factory = g_implicit_factory;
   *context_factory_private = g_implicit_factory;
@@ -47,8 +47,8 @@
     delete g_implicit_factory;
     g_implicit_factory = NULL;
   }
-  delete g_surface_manager;
-  g_surface_manager = nullptr;
+  delete g_frame_sink_manager;
+  g_frame_sink_manager = nullptr;
   delete g_disable_null_draw;
   g_disable_null_draw = NULL;
 }
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc
index 1c301a12..e0b23166f 100644
--- a/ui/compositor/test/in_process_context_factory.cc
+++ b/ui/compositor/test/in_process_context_factory.cc
@@ -23,6 +23,7 @@
 #include "cc/surfaces/display_scheduler.h"
 #include "cc/surfaces/local_surface_id_allocator.h"
 #include "cc/test/pixel_test_output_surface.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "gpu/command_buffer/client/context_support.h"
 #include "gpu/command_buffer/client/gles2_interface.h"
 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -134,11 +135,11 @@
 };
 
 InProcessContextFactory::InProcessContextFactory(
-    cc::SurfaceManager* surface_manager)
+    viz::FrameSinkManagerHost* frame_sink_manager)
     : frame_sink_id_allocator_(kDefaultClientId),
       use_test_surface_(true),
-      surface_manager_(surface_manager) {
-  DCHECK(surface_manager);
+      frame_sink_manager_(frame_sink_manager) {
+  DCHECK(frame_sink_manager);
   DCHECK_NE(gl::GetGLImplementation(), gl::kGLImplementationNone)
       << "If running tests, ensure that main() is calling "
       << "gl::GLSurfaceTestSupport::InitializeOneOff()";
@@ -247,9 +248,9 @@
 
   auto* display = per_compositor_data_[compositor.get()]->display.get();
   auto compositor_frame_sink = base::MakeUnique<cc::DirectCompositorFrameSink>(
-      compositor->frame_sink_id(), surface_manager_, display, context_provider,
-      shared_worker_context_provider_, &gpu_memory_buffer_manager_,
-      &shared_bitmap_manager_);
+      compositor->frame_sink_id(), GetSurfaceManager(), display,
+      context_provider, shared_worker_context_provider_,
+      &gpu_memory_buffer_manager_, &shared_bitmap_manager_);
   compositor->SetCompositorFrameSink(std::move(compositor_frame_sink));
 
   data->display->Resize(compositor->size());
@@ -311,7 +312,11 @@
 }
 
 cc::SurfaceManager* InProcessContextFactory::GetSurfaceManager() {
-  return surface_manager_;
+  return frame_sink_manager_->surface_manager();
+}
+
+viz::FrameSinkManagerHost* InProcessContextFactory::GetFrameSinkManagerHost() {
+  return frame_sink_manager_;
 }
 
 void InProcessContextFactory::SetDisplayVisible(ui::Compositor* compositor,
diff --git a/ui/compositor/test/in_process_context_factory.h b/ui/compositor/test/in_process_context_factory.h
index d2bf234..c8595878 100644
--- a/ui/compositor/test/in_process_context_factory.h
+++ b/ui/compositor/test/in_process_context_factory.h
@@ -23,6 +23,10 @@
 class SurfaceManager;
 }
 
+namespace viz {
+class FrameSinkManagerHost;
+}
+
 namespace ui {
 class InProcessContextProvider;
 
@@ -31,7 +35,7 @@
  public:
   // surface_manager is owned by the creator of this and must outlive the
   // context factory.
-  explicit InProcessContextFactory(cc::SurfaceManager* surface_manager);
+  explicit InProcessContextFactory(viz::FrameSinkManagerHost* manager);
   ~InProcessContextFactory() override;
 
   // If true (the default) an OutputSurface is created that does not display
@@ -62,6 +66,7 @@
   cc::TaskGraphRunner* GetTaskGraphRunner() override;
   cc::FrameSinkId AllocateFrameSinkId() override;
   cc::SurfaceManager* GetSurfaceManager() override;
+  viz::FrameSinkManagerHost* GetFrameSinkManagerHost() override;
   void SetDisplayVisible(ui::Compositor* compositor, bool visible) override;
   void ResizeDisplay(ui::Compositor* compositor,
                      const gfx::Size& size) override;
@@ -93,7 +98,7 @@
   cc::FrameSinkIdAllocator frame_sink_id_allocator_;
   bool use_test_surface_;
   double refresh_rate_ = 60.0;
-  cc::SurfaceManager* surface_manager_;
+  viz::FrameSinkManagerHost* frame_sink_manager_;
   base::ObserverList<ContextFactoryObserver> observer_list_;
 
   cc::RendererSettings renderer_settings_;
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index 30bfed6..6ff1983 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -266,7 +266,7 @@
       uma_latency_reporting_enabled_(base::TimeTicks::IsHighResolution()),
       touchpad_and_wheel_scroll_latching_enabled_(
           touchpad_and_wheel_scroll_latching_enabled),
-      touch_start_result_(kEventDispositionUndefined),
+      touch_result_(kEventDispositionUndefined),
       mouse_wheel_result_(kEventDispositionUndefined),
       current_overscroll_params_(nullptr),
       has_ongoing_compositor_scroll_fling_pinch_(false),
@@ -616,7 +616,7 @@
   if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) {
     int32_t event_disposition_result =
         (device == blink::kWebGestureDeviceTouchpad ? mouse_wheel_result_
-                                                    : touch_start_result_);
+                                                    : touch_result_);
     switch (event_disposition_result) {
       case kEventDispositionUndefined:
       case DID_NOT_HANDLE_NON_BLOCKING_DUE_TO_FLING:
@@ -1040,22 +1040,26 @@
   return DID_NOT_HANDLE;
 }
 
-InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchStart(
-    const blink::WebTouchEvent& touch_event) {
+InputHandlerProxy::EventDisposition InputHandlerProxy::HitTestTouchEvent(
+    const blink::WebTouchEvent& touch_event,
+    bool* is_touching_scrolling_layer) {
+  *is_touching_scrolling_layer = false;
   EventDisposition result = DROP_EVENT;
-  bool is_touching_scrolling_layer = false;
   for (size_t i = 0; i < touch_event.touches_length; ++i) {
-    if (touch_event.touches[i].state != WebTouchPoint::kStatePressed)
+    if (touch_event.GetType() == WebInputEvent::kTouchStart &&
+        touch_event.touches[i].state != WebTouchPoint::kStatePressed) {
       continue;
-    cc::InputHandler::TouchStartEventListenerType event_listener_type =
-        input_handler_->EventListenerTypeForTouchStartAt(
+    }
+    cc::InputHandler::TouchStartOrMoveEventListenerType event_listener_type =
+        input_handler_->EventListenerTypeForTouchStartOrMoveAt(
             gfx::Point(touch_event.touches[i].PositionInWidget().x,
                        touch_event.touches[i].PositionInWidget().y));
     if (event_listener_type !=
-        cc::InputHandler::TouchStartEventListenerType::NO_HANDLER) {
-      is_touching_scrolling_layer =
-          event_listener_type == cc::InputHandler::TouchStartEventListenerType::
-                                     HANDLER_ON_SCROLLING_LAYER;
+        cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER) {
+      *is_touching_scrolling_layer =
+          event_listener_type ==
+          cc::InputHandler::TouchStartOrMoveEventListenerType::
+              HANDLER_ON_SCROLLING_LAYER;
       result = DID_NOT_HANDLE;
       break;
     }
@@ -1088,16 +1092,23 @@
     }
   }
 
-  // Merge |touch_start_result_| and |result| so the result has the highest
+  // Merge |touch_result_| and |result| so the result has the highest
   // priority value according to the sequence; (DROP_EVENT,
   // DID_HANDLE_NON_BLOCKING, DID_NOT_HANDLE).
-  if (touch_start_result_ == kEventDispositionUndefined ||
-      touch_start_result_ == DROP_EVENT || result == DID_NOT_HANDLE)
-    touch_start_result_ = result;
+  if (touch_result_ == kEventDispositionUndefined ||
+      touch_result_ == DROP_EVENT || result == DID_NOT_HANDLE)
+    touch_result_ = result;
+  return result;
+}
 
+InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchStart(
+    const blink::WebTouchEvent& touch_event) {
+  bool is_touching_scrolling_layer;
+  EventDisposition result =
+      HitTestTouchEvent(touch_event, &is_touching_scrolling_layer);
   // If |result| is still DROP_EVENT look at the touch end handler as
   // we may not want to discard the entire touch sequence. Note this
-  // code is explicitly after the assignment of the |touch_start_result_|
+  // code is explicitly after the assignment of the |touch_result_|
   // so the touch moves are not sent to the main thread un-necessarily.
   if (result == DROP_EVENT &&
       input_handler_->GetEventListenerProperties(
@@ -1116,15 +1127,20 @@
 
 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchMove(
     const blink::WebTouchEvent& touch_event) {
-  if (touch_start_result_ != kEventDispositionUndefined)
-    return static_cast<EventDisposition>(touch_start_result_);
-  return DID_NOT_HANDLE;
+  // Hit test if this is the first touch move or we don't have any results
+  // from a previous hit test.
+  if (touch_result_ == kEventDispositionUndefined ||
+      touch_event.touch_start_or_first_touch_move) {
+    bool is_touching_scrolling_layer;
+    return HitTestTouchEvent(touch_event, &is_touching_scrolling_layer);
+  }
+  return static_cast<EventDisposition>(touch_result_);
 }
 
 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchEnd(
     const blink::WebTouchEvent& touch_event) {
   if (touch_event.touches_length == 1)
-    touch_start_result_ = kEventDispositionUndefined;
+    touch_result_ = kEventDispositionUndefined;
   return DID_NOT_HANDLE;
 }
 
diff --git a/ui/events/blink/input_handler_proxy.h b/ui/events/blink/input_handler_proxy.h
index 0db37a1..1306ee8 100644
--- a/ui/events/blink/input_handler_proxy.h
+++ b/ui/events/blink/input_handler_proxy.h
@@ -184,6 +184,9 @@
 
   void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock);
 
+  EventDisposition HitTestTouchEvent(const blink::WebTouchEvent& touch_event,
+                                     bool* is_touching_scrolling_layer);
+
   std::unique_ptr<blink::WebGestureCurve> fling_curve_;
   // Parameters for the active fling animation, stored in case we need to
   // transfer it out later.
@@ -238,10 +241,10 @@
   bool uma_latency_reporting_enabled_;
   const bool touchpad_and_wheel_scroll_latching_enabled_;
 
-  // The merged result of the last touch start with previous touch starts.
+  // The merged result of the last touch event with previous touch events.
   // This value will get returned for subsequent TouchMove events to allow
   // passive events not to block scrolling.
-  int32_t touch_start_result_;
+  int32_t touch_result_;
 
   // The result of the last mouse wheel event. This value is used to determine
   // whether the next wheel scroll is blocked on the Main thread or not.
diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc
index 9ce7a41..4ea540ad 100644
--- a/ui/events/blink/input_handler_proxy_unittest.cc
+++ b/ui/events/blink/input_handler_proxy_unittest.cc
@@ -216,9 +216,9 @@
   MOCK_CONST_METHOD1(
       GetEventListenerProperties,
       cc::EventListenerProperties(cc::EventListenerClass event_class));
-  MOCK_METHOD1(
-      EventListenerTypeForTouchStartAt,
-      cc::InputHandler::TouchStartEventListenerType(const gfx::Point& point));
+  MOCK_METHOD1(EventListenerTypeForTouchStartOrMoveAt,
+               cc::InputHandler::TouchStartOrMoveEventListenerType(
+                   const gfx::Point& point));
 
   MOCK_METHOD0(RequestUpdateForSynchronousInputHandler, void());
   MOCK_METHOD1(SetSynchronousInputHandlerRootScrollOffset,
@@ -2427,10 +2427,11 @@
       mock_input_handler_,
       GetEventListenerProperties(cc::EventListenerClass::kTouchEndOrCancel))
       .WillOnce(testing::Return(cc::EventListenerProperties::kNone));
-  EXPECT_CALL(mock_input_handler_, EventListenerTypeForTouchStartAt(testing::_))
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartOrMoveAt(testing::_))
       .Times(2)
       .WillRepeatedly(testing::Return(
-          cc::InputHandler::TouchStartEventListenerType::NO_HANDLER));
+          cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER));
 
   WebTouchEvent touch(WebInputEvent::kTouchStart, WebInputEvent::kNoModifiers,
                       WebInputEvent::kTimeStampForTesting);
@@ -2451,15 +2452,16 @@
   VERIFY_AND_RESET_MOCKS();
 
   EXPECT_CALL(mock_input_handler_,
-              EventListenerTypeForTouchStartAt(
+              EventListenerTypeForTouchStartOrMoveAt(
                   testing::Property(&gfx::Point::x, testing::Eq(0))))
       .WillOnce(testing::Return(
-          cc::InputHandler::TouchStartEventListenerType::NO_HANDLER));
+          cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER));
   EXPECT_CALL(mock_input_handler_,
-              EventListenerTypeForTouchStartAt(
+              EventListenerTypeForTouchStartOrMoveAt(
                   testing::Property(&gfx::Point::x, testing::Gt(0))))
-      .WillOnce(testing::Return(cc::InputHandler::TouchStartEventListenerType::
-                                    HANDLER_ON_SCROLLING_LAYER));
+      .WillOnce(
+          testing::Return(cc::InputHandler::TouchStartOrMoveEventListenerType::
+                              HANDLER_ON_SCROLLING_LAYER));
   // Since the second touch point hits a touch-region, there should be no
   // hit-testing for the third touch point.
 
@@ -2485,9 +2487,10 @@
       mock_input_handler_,
       GetEventListenerProperties(cc::EventListenerClass::kTouchStartOrMove))
       .WillRepeatedly(testing::Return(cc::EventListenerProperties::kPassive));
-  EXPECT_CALL(mock_input_handler_, EventListenerTypeForTouchStartAt(testing::_))
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartOrMoveAt(testing::_))
       .WillRepeatedly(testing::Return(
-          cc::InputHandler::TouchStartEventListenerType::NO_HANDLER));
+          cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER));
 
   WebTouchEvent touch(WebInputEvent::kTouchStart, WebInputEvent::kNoModifiers,
                       WebInputEvent::kTimeStampForTesting);
@@ -2516,9 +2519,10 @@
       mock_input_handler_,
       GetEventListenerProperties(cc::EventListenerClass::kTouchEndOrCancel))
       .WillOnce(testing::Return(cc::EventListenerProperties::kBlocking));
-  EXPECT_CALL(mock_input_handler_, EventListenerTypeForTouchStartAt(testing::_))
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartOrMoveAt(testing::_))
       .WillOnce(testing::Return(
-          cc::InputHandler::TouchStartEventListenerType::NO_HANDLER));
+          cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER));
 
   WebTouchEvent touch(WebInputEvent::kTouchStart, WebInputEvent::kNoModifiers,
                       WebInputEvent::kTimeStampForTesting);
@@ -2534,16 +2538,52 @@
   VERIFY_AND_RESET_MOCKS();
 }
 
+TEST_P(InputHandlerProxyTest, TouchMoveBlockingAddedAfterPassiveTouchStart) {
+  // The touch start is not in a touch-region but there is a touch end handler
+  // so to maintain targeting we need to dispatch the touch start as
+  // non-blocking but drop all touch moves.
+  VERIFY_AND_RESET_MOCKS();
+
+  EXPECT_CALL(
+      mock_input_handler_,
+      GetEventListenerProperties(cc::EventListenerClass::kTouchStartOrMove))
+      .WillOnce(testing::Return(cc::EventListenerProperties::kPassive));
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartOrMoveAt(testing::_))
+      .WillOnce(testing::Return(
+          cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER));
+
+  WebTouchEvent touch(WebInputEvent::kTouchStart, WebInputEvent::kNoModifiers,
+                      WebInputEvent::kTimeStampForTesting);
+  touch.touches_length = 1;
+  touch.touches[0] = CreateWebTouchPoint(WebTouchPoint::kStatePressed, 0, 0);
+  EXPECT_EQ(InputHandlerProxy::DID_HANDLE_NON_BLOCKING,
+            input_handler_->HandleInputEvent(touch));
+
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartOrMoveAt(testing::_))
+      .WillOnce(testing::Return(
+          cc::InputHandler::TouchStartOrMoveEventListenerType::HANDLER));
+
+  touch.SetType(WebInputEvent::kTouchMove);
+  touch.touches_length = 1;
+  touch.touch_start_or_first_touch_move = true;
+  touch.touches[0] = CreateWebTouchPoint(WebTouchPoint::kStateMoved, 10, 10);
+  EXPECT_EQ(InputHandlerProxy::DID_NOT_HANDLE,
+            input_handler_->HandleInputEvent(touch));
+  VERIFY_AND_RESET_MOCKS();
+}
+
 TEST_P(InputHandlerProxyTest, GestureFlingCancelledByKeyboardEvent) {
   // We shouldn't send any events to the widget for this gesture.
-  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
   VERIFY_AND_RESET_MOCKS();
 
   EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
       .WillOnce(testing::Return(kImplThreadScrollState));
   gesture_.SetType(WebInputEvent::kGestureScrollBegin);
   gesture_.source_device = blink::kWebGestureDeviceTouchscreen;
-  EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(gesture_));
+  EXPECT_EQ(InputHandlerProxy::DID_HANDLE,
+            input_handler_->HandleInputEvent(gesture_));
   EXPECT_TRUE(input_handler_->gesture_scroll_on_impl_thread_for_testing());
   VERIFY_AND_RESET_MOCKS();
 
@@ -3312,10 +3352,10 @@
 
   // Touch start with passive event listener.
   EXPECT_CALL(mock_input_handler_,
-              EventListenerTypeForTouchStartAt(
+              EventListenerTypeForTouchStartOrMoveAt(
                   testing::Property(&gfx::Point::x, testing::Gt(0))))
       .WillOnce(testing::Return(
-          cc::InputHandler::TouchStartEventListenerType::NO_HANDLER));
+          cc::InputHandler::TouchStartOrMoveEventListenerType::NO_HANDLER));
   EXPECT_CALL(
       mock_input_handler_,
       GetEventListenerProperties(cc::EventListenerClass::kTouchStartOrMove))
@@ -3344,10 +3384,11 @@
 
   // Touch event with HANDLER_ON_SCROLLING_LAYER event listener.
   EXPECT_CALL(mock_input_handler_,
-              EventListenerTypeForTouchStartAt(
+              EventListenerTypeForTouchStartOrMoveAt(
                   testing::Property(&gfx::Point::x, testing::Gt(0))))
-      .WillOnce(testing::Return(cc::InputHandler::TouchStartEventListenerType::
-                                    HANDLER_ON_SCROLLING_LAYER));
+      .WillOnce(
+          testing::Return(cc::InputHandler::TouchStartOrMoveEventListenerType::
+                              HANDLER_ON_SCROLLING_LAYER));
 
   expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
   EXPECT_EQ(expected_disposition_,
diff --git a/ui/message_center/views/constants.h b/ui/message_center/views/constants.h
index 9942ed8..a99a199 100644
--- a/ui/message_center/views/constants.h
+++ b/ui/message_center/views/constants.h
@@ -22,7 +22,7 @@
 
 const int kTextBottomPadding = 12;
 const int kItemTitleToMessagePadding = 3;
-const int kButtonVecticalPadding = 0;
+const int kButtonVerticalPadding = 0;
 const int kButtonTitleTopPadding = 0;
 const int kNotificationSettingsPadding = 5;
 
diff --git a/ui/message_center/views/message_center_button_bar.cc b/ui/message_center/views/message_center_button_bar.cc
index 19538d1..f08fc16 100644
--- a/ui/message_center/views/message_center_button_bar.cc
+++ b/ui/message_center/views/message_center_button_bar.cc
@@ -9,6 +9,7 @@
 #include "ui/base/models/simple_menu_model.h"
 #include "ui/base/resource/resource_bundle.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/text_constants.h"
 #include "ui/message_center/message_center.h"
 #include "ui/message_center/message_center_style.h"
@@ -103,7 +104,7 @@
 
   button_container_ = new views::View;
   button_container_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kHorizontal));
   quiet_mode_button_ = CreateNotificationCenterButton(
       this, IDR_NOTIFICATION_DO_NOT_DISTURB,
       IDR_NOTIFICATION_DO_NOT_DISTURB_HOVER,
diff --git a/ui/message_center/views/message_list_view.cc b/ui/message_center/views/message_list_view.cc
index a5c77aa..7d3543e4 100644
--- a/ui/message_center/views/message_list_view.cc
+++ b/ui/message_center/views/message_list_view.cc
@@ -10,6 +10,7 @@
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "ui/gfx/animation/slide_animation.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/message_center/message_center_style.h"
 #include "ui/message_center/message_center_switches.h"
 #include "ui/message_center/views/message_center_view.h"
@@ -35,7 +36,7 @@
       quit_message_loop_after_animation_for_test_(false),
       weak_ptr_factory_(this) {
   views::BoxLayout* layout =
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1);
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(), 1);
   layout->SetDefaultFlex(1);
   SetLayoutManager(layout);
 
diff --git a/ui/message_center/views/notification_button.cc b/ui/message_center/views/notification_button.cc
index c42b6d7..fe0877a 100644
--- a/ui/message_center/views/notification_button.cc
+++ b/ui/message_center/views/notification_button.cc
@@ -5,6 +5,7 @@
 #include "ui/message_center/views/notification_button.h"
 
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/message_center/message_center_style.h"
 #include "ui/message_center/views/constants.h"
 #include "ui/views/background.h"
@@ -23,11 +24,11 @@
   // background changes to show touch feedback
   SetBackground(views::CreateSolidBackground(kNotificationBackgroundColor));
   set_notify_enter_exit_on_child(true);
-  SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kHorizontal,
-                           message_center::kButtonHorizontalPadding,
-                           kButtonVecticalPadding,
-                           message_center::kButtonIconToTitlePadding));
+  SetLayoutManager(new views::BoxLayout(
+      views::BoxLayout::kHorizontal,
+      gfx::Insets(kButtonVerticalPadding,
+                  message_center::kButtonHorizontalPadding),
+      message_center::kButtonIconToTitlePadding));
   SetFocusPainter(views::Painter::CreateSolidFocusPainter(
       message_center::kFocusBorderColor, gfx::Insets(1, 2, 2, 2)));
 }
diff --git a/ui/message_center/views/notification_view.cc b/ui/message_center/views/notification_view.cc
index f65b597..b39503ab 100644
--- a/ui/message_center/views/notification_view.cc
+++ b/ui/message_center/views/notification_view.cc
@@ -17,6 +17,7 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/layout.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/skia_util.h"
 #include "ui/gfx/text_elider.h"
@@ -102,8 +103,9 @@
 };
 
 ItemView::ItemView(const message_center::NotificationItem& item) {
-  SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
-      0, 0, message_center::kItemTitleToMessagePadding));
+  SetLayoutManager(
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(),
+                           message_center::kItemTitleToMessagePadding));
 
   views::Label* title = new views::Label(item.title);
   title->set_collapse_when_hidden(true);
@@ -188,7 +190,7 @@
   // close button.
   top_view_ = new views::View();
   top_view_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   top_view_->SetBorder(
       MakeEmptyBorder(kTextTopPadding - 8, 0, kTextBottomPadding - 5, 0));
   AddChildView(top_view_);
@@ -196,7 +198,7 @@
   // below the notification icon.
   bottom_view_ = new views::View();
   bottom_view_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   AddChildView(bottom_view_);
 
   views::ImageView* small_image_view = new views::ImageView();
diff --git a/ui/message_center/views/notification_view_md.cc b/ui/message_center/views/notification_view_md.cc
index 5bc79bc9..3a6bc12 100644
--- a/ui/message_center/views/notification_view_md.cc
+++ b/ui/message_center/views/notification_view_md.cc
@@ -138,7 +138,7 @@
                                        const Notification& notification)
     : MessageView(controller, notification),
       clickable_(notification.clickable()) {
-  layout_ = new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 2);
+  layout_ = new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(), 2);
   layout_->set_inside_border_insets(kNotificationPadding);
   SetLayoutManager(layout_);
 
@@ -147,7 +147,7 @@
   // close button.
   top_view_ = new views::View();
   views::BoxLayout* top_box_layout =
-      new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 1, 5);
+      new views::BoxLayout(views::BoxLayout::kHorizontal, gfx::Insets(1, 0), 5);
   top_box_layout->set_cross_axis_alignment(
       views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
   top_view_->SetLayoutManager(top_box_layout);
@@ -155,13 +155,13 @@
 
   main_view_ = new views::View();
   main_view_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   AddChildView(main_view_);
 
   // Create the bottom_view_, which collects notification icon.
   bottom_view_ = new views::View();
   bottom_view_->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   AddChildView(bottom_view_);
 
   views::ImageView* small_image_view = new views::ImageView();
diff --git a/ui/message_center/views/notifier_settings_view.cc b/ui/message_center/views/notifier_settings_view.cc
index f2fc81f..4eafd70 100644
--- a/ui/message_center/views/notifier_settings_view.cc
+++ b/ui/message_center/views/notifier_settings_view.cc
@@ -21,6 +21,7 @@
 #include "ui/events/event_utils.h"
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/image/image.h"
 #include "ui/message_center/message_center_style.h"
@@ -488,12 +489,14 @@
   buttons_.clear();
 
   views::View* contents_view = new views::View();
-  contents_view->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kVertical, settings::kHorizontalMargin, 0, 0));
+  contents_view->SetLayoutManager(
+      new views::BoxLayout(views::BoxLayout::kVertical,
+                           gfx::Insets(0, settings::kHorizontalMargin)));
 
   views::View* contents_title_view = new views::View();
-  contents_title_view->SetLayoutManager(new views::BoxLayout(
-      views::BoxLayout::kVertical, 0, 0, kComputedTitleElementSpacing));
+  contents_title_view->SetLayoutManager(
+      new views::BoxLayout(views::BoxLayout::kVertical, gfx::Insets(),
+                           kComputedTitleElementSpacing));
 
   bool need_account_switcher =
       provider_ && provider_->GetNotifierGroupCount() > 1;
diff --git a/ui/ozone/common/BUILD.gn b/ui/ozone/common/BUILD.gn
index 67e65754..c9c6fcf 100644
--- a/ui/ozone/common/BUILD.gn
+++ b/ui/ozone/common/BUILD.gn
@@ -8,8 +8,6 @@
 
 source_set("common") {
   sources = [
-    "display_mode_proxy.cc",
-    "display_mode_proxy.h",
     "display_snapshot_proxy.cc",
     "display_snapshot_proxy.h",
     "egl_util.cc",
diff --git a/ui/ozone/common/display_mode_proxy.cc b/ui/ozone/common/display_mode_proxy.cc
deleted file mode 100644
index e1f3447..0000000
--- a/ui/ozone/common/display_mode_proxy.cc
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/memory/ptr_util.h"
-
-#include "ui/ozone/common/display_mode_proxy.h"
-
-#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
-
-namespace ui {
-
-DisplayModeProxy::DisplayModeProxy(const DisplayMode_Params& params)
-    : DisplayMode(params.size, params.is_interlaced, params.refresh_rate) {
-}
-
-DisplayModeProxy::DisplayModeProxy(const gfx::Size& size,
-                                   bool interlaced,
-                                   float refresh_rate)
-    : DisplayMode(size, interlaced, refresh_rate) {}
-
-DisplayModeProxy::~DisplayModeProxy() {
-}
-
-std::unique_ptr<display::DisplayMode> DisplayModeProxy::Clone() const {
-  return base::WrapUnique(
-      new DisplayModeProxy(size(), is_interlaced(), refresh_rate()));
-}
-
-}  // namespace ui
diff --git a/ui/ozone/common/display_mode_proxy.h b/ui/ozone/common/display_mode_proxy.h
deleted file mode 100644
index 97dfd1bf..0000000
--- a/ui/ozone/common/display_mode_proxy.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_OZONE_COMMON_DISPLAY_MODE_PROXY_H_
-#define UI_OZONE_COMMON_DISPLAY_MODE_PROXY_H_
-
-#include "base/macros.h"
-#include "ui/display/types/display_mode.h"
-
-namespace ui {
-
-struct DisplayMode_Params;
-
-class DisplayModeProxy : public display::DisplayMode {
- public:
-  explicit DisplayModeProxy(const DisplayMode_Params& params);
-  ~DisplayModeProxy() override;
-  std::unique_ptr<display::DisplayMode> Clone() const override;
-
- private:
-  DisplayModeProxy(const gfx::Size& size, bool interlaced, float refresh_rate);
-
-  DISALLOW_COPY_AND_ASSIGN(DisplayModeProxy);
-};
-
-}  // namespace ui
-
-#endif  // UI_OZONE_COMMON_DISPLAY_MODE_PROXY_H_
diff --git a/ui/ozone/common/display_snapshot_proxy.cc b/ui/ozone/common/display_snapshot_proxy.cc
index 143b34e..415d53f7 100644
--- a/ui/ozone/common/display_snapshot_proxy.cc
+++ b/ui/ozone/common/display_snapshot_proxy.cc
@@ -2,13 +2,12 @@
 // 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 "ui/ozone/common/display_snapshot_proxy.h"
 
 #include <stddef.h>
 
-#include "ui/ozone/common/display_mode_proxy.h"
+#include "base/memory/ptr_util.h"
+#include "ui/display/types/display_mode.h"
 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
 
 namespace ui {
@@ -39,7 +38,9 @@
           NULL),
       string_representation_(params.string_representation) {
   for (size_t i = 0; i < params.modes.size(); ++i) {
-    modes_.push_back(base::MakeUnique<DisplayModeProxy>(params.modes[i]));
+    modes_.push_back(base::MakeUnique<display::DisplayMode>(
+        params.modes[i].size, params.modes[i].is_interlaced,
+        params.modes[i].refresh_rate));
 
     if (params.has_current_mode &&
         SameModes(params.modes[i], params.current_mode))
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index 17c86ee..2dd002e5 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -410,8 +410,7 @@
   DCHECK(!footnote_container_);
   footnote_container_ = new views::View();
   footnote_container_->SetLayoutManager(
-      new BoxLayout(BoxLayout::kVertical, content_margins_.left(),
-                    content_margins_.top(), 0));
+      new BoxLayout(BoxLayout::kVertical, content_margins_, 0));
   footnote_container_->SetBackground(
       CreateSolidBackground(kFootnoteBackgroundColor));
   footnote_container_->SetBorder(
diff --git a/ui/views/bubble/tray_bubble_view.cc b/ui/views/bubble/tray_bubble_view.cc
index a7657e9..9f106c1 100644
--- a/ui/views/bubble/tray_bubble_view.cc
+++ b/ui/views/bubble/tray_bubble_view.cc
@@ -134,9 +134,7 @@
 class BottomAlignedBoxLayout : public BoxLayout {
  public:
   explicit BottomAlignedBoxLayout(TrayBubbleView* bubble_view)
-      : BoxLayout(BoxLayout::kVertical, 0, 0, 0),
-        bubble_view_(bubble_view) {
-  }
+      : BoxLayout(BoxLayout::kVertical), bubble_view_(bubble_view) {}
 
   ~BottomAlignedBoxLayout() override {}
 
diff --git a/ui/views/color_chooser/color_chooser_view.cc b/ui/views/color_chooser/color_chooser_view.cc
index 4daa497..3eb3970 100644
--- a/ui/views/color_chooser/color_chooser_view.cc
+++ b/ui/views/color_chooser/color_chooser_view.cc
@@ -18,6 +18,7 @@
 #include "ui/events/event.h"
 #include "ui/events/keycodes/keyboard_codes.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/color_chooser/color_chooser_listener.h"
@@ -363,12 +364,12 @@
   DCHECK(listener_);
 
   SetBackground(CreateSolidBackground(SK_ColorLTGRAY));
-  SetLayoutManager(new BoxLayout(BoxLayout::kVertical, kMarginWidth,
-                                 kMarginWidth, kMarginWidth));
+  SetLayoutManager(new BoxLayout(BoxLayout::kVertical,
+                                 gfx::Insets(kMarginWidth), kMarginWidth));
 
   View* container = new View();
-  container->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0,
-                                            kMarginWidth));
+  container->SetLayoutManager(
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(), kMarginWidth));
   saturation_value_ = new SaturationValueView(this);
   container->AddChildView(saturation_value_);
   hue_ = new HueView(this);
diff --git a/ui/views/controls/message_box_view.cc b/ui/views/controls/message_box_view.cc
index eeebaa3..2445444 100644
--- a/ui/views/controls/message_box_view.cc
+++ b/ui/views/controls/message_box_view.cc
@@ -13,6 +13,7 @@
 #include "ui/accessibility/ax_node_data.h"
 #include "ui/base/clipboard/clipboard.h"
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/button/checkbox.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/link.h"
@@ -232,7 +233,7 @@
   const int kMaxScrollViewHeight = 400;
   views::View* message_contents = new views::View();
   message_contents->SetLayoutManager(
-      new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 0));
+      new views::BoxLayout(views::BoxLayout::kVertical));
   for (size_t i = 0; i < message_labels_.size(); ++i)
     message_contents->AddChildView(message_labels_[i]);
   ScrollView* scroll_view = new views::ScrollView();
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc
index 33e35b9..be383ce 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -19,6 +19,7 @@
 #include "ui/gfx/animation/tween.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/font_list.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/label.h"
@@ -320,8 +321,8 @@
 
 TabStrip::TabStrip() {
   const int kTabStripLeadingEdgePadding = 9;
-  BoxLayout* layout =
-      new BoxLayout(BoxLayout::kHorizontal, kTabStripLeadingEdgePadding, 0, 0);
+  BoxLayout* layout = new BoxLayout(
+      BoxLayout::kHorizontal, gfx::Insets(0, kTabStripLeadingEdgePadding));
   layout->set_main_axis_alignment(BoxLayout::MAIN_AXIS_ALIGNMENT_START);
   layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_END);
   layout->SetDefaultFlex(0);
@@ -392,7 +393,7 @@
 }
 
 MdTabStrip::MdTabStrip() {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal);
   layout->set_main_axis_alignment(BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
   layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_STRETCH);
   layout->SetDefaultFlex(1);
diff --git a/ui/views/examples/BUILD.gn b/ui/views/examples/BUILD.gn
index 3053d67..106cfb66 100644
--- a/ui/views/examples/BUILD.gn
+++ b/ui/views/examples/BUILD.gn
@@ -110,7 +110,7 @@
     "//base/test:test_support",
     "//build/config:exe_and_shlib_deps",
     "//build/win:default_exe_manifest",
-    "//cc/surfaces",
+    "//components/viz/host",
     "//ui/base",
     "//ui/compositor",
     "//ui/compositor:test_support",
diff --git a/ui/views/examples/DEPS b/ui/views/examples/DEPS
index dcab197..c55d1e8 100644
--- a/ui/views/examples/DEPS
+++ b/ui/views/examples/DEPS
@@ -1,5 +1,5 @@
 include_rules = [
-  "+cc/surfaces/surface_manager.h",
+  "+components/viz/host",
   "+content/public",
   "+content/shell",
   "+sandbox",
diff --git a/ui/views/examples/bubble_example.cc b/ui/views/examples/bubble_example.cc
index 6aa4790..6f21b7a 100644
--- a/ui/views/examples/bubble_example.cc
+++ b/ui/views/examples/bubble_example.cc
@@ -6,6 +6,7 @@
 
 #include "base/macros.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/bubble/bubble_dialog_delegate.h"
 #include "ui/views/controls/button/label_button.h"
 #include "ui/views/controls/label.h"
@@ -58,7 +59,7 @@
   int GetDialogButtons() const override { return ui::DIALOG_BUTTON_NONE; }
 
   void Init() override {
-    SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 50, 50, 0));
+    SetLayoutManager(new BoxLayout(BoxLayout::kVertical, gfx::Insets(50)));
     AddChildView(new Label(GetArrowName(arrow())));
   }
 
@@ -75,7 +76,8 @@
 void BubbleExample::CreateExampleView(View* container) {
   PrintStatus("Click with optional modifiers: [Ctrl] for set_arrow(NONE), "
      "[Alt] for set_arrow(FLOAT), or [Shift] to reverse the arrow iteration.");
-  container->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, 10));
+  container->SetLayoutManager(
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(), 10));
   no_shadow_ = new LabelButton(this, ASCIIToUTF16("No Shadow"));
   container->AddChildView(no_shadow_);
   no_shadow_opaque_ = new LabelButton(this, ASCIIToUTF16("Opaque Border"));
diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc
index bb4790a..a13bb25 100644
--- a/ui/views/examples/button_example.cc
+++ b/ui/views/examples/button_example.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/utf_string_conversions.h"
 #include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/image/image.h"
 #include "ui/views/background.h"
 #include "ui/views/controls/button/blue_button.h"
@@ -38,7 +39,7 @@
 
 void ButtonExample::CreateExampleView(View* container) {
   container->SetBackground(CreateSolidBackground(SK_ColorWHITE));
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 10, 10, 10);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, gfx::Insets(10), 10);
   layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
   container->SetLayoutManager(layout);
 
diff --git a/ui/views/examples/combobox_example.cc b/ui/views/examples/combobox_example.cc
index 790d024..8fd871b 100644
--- a/ui/views/examples/combobox_example.cc
+++ b/ui/views/examples/combobox_example.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/combobox/combobox.h"
 #include "ui/views/layout/box_layout.h"
 
@@ -54,9 +55,8 @@
   // Note: STYLE_ACTION comboboxes always have the first item selected by
   // default.
 
-  container->SetLayoutManager(new BoxLayout(
-      BoxLayout::kVertical,
-      0, 10, 5));
+  container->SetLayoutManager(
+      new BoxLayout(BoxLayout::kVertical, gfx::Insets(10, 0), 5));
   container->AddChildView(combobox_);
   container->AddChildView(disabled_combobox_);
   container->AddChildView(action_combobox_);
diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc
index ece993be..7c44a31c 100644
--- a/ui/views/examples/examples_main.cc
+++ b/ui/views/examples/examples_main.cc
@@ -16,7 +16,7 @@
 #include "base/run_loop.h"
 #include "base/test/test_discardable_memory_allocator.h"
 #include "build/build_config.h"
-#include "cc/surfaces/surface_manager.h"
+#include "components/viz/host/frame_sink_manager_host.h"
 #include "ui/base/ime/input_method_initializer.h"
 #include "ui/base/material_design/material_design_controller.h"
 #include "ui/base/resource/resource_bundle.h"
@@ -67,9 +67,9 @@
   gl::init::InitializeGLOneOff();
 
   // The ContextFactory must exist before any Compositors are created.
-  cc::SurfaceManager surface_manager;
+  viz::FrameSinkManagerHost frame_sink_manager_;
   auto context_factory =
-      base::MakeUnique<ui::InProcessContextFactory>(&surface_manager);
+      base::MakeUnique<ui::InProcessContextFactory>(&frame_sink_manager_);
   context_factory->set_use_test_surface(false);
 
   base::MessageLoopForUI message_loop;
diff --git a/ui/views/examples/label_example.cc b/ui/views/examples/label_example.cc
index 9507b13..3244135 100644
--- a/ui/views/examples/label_example.cc
+++ b/ui/views/examples/label_example.cc
@@ -7,6 +7,7 @@
 #include "base/macros.h"
 #include "base/memory/ptr_util.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/vector2d.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
@@ -67,7 +68,8 @@
 
 void LabelExample::CreateExampleView(View* container) {
   // A very simple label example, followed by additional helpful examples.
-  container->SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 0, 0, 10));
+  container->SetLayoutManager(
+      new BoxLayout(BoxLayout::kVertical, gfx::Insets(), 10));
   Label* label = new Label(ASCIIToUTF16("Hello world!"));
   container->AddChildView(label);
 
diff --git a/ui/views/examples/slider_example.cc b/ui/views/examples/slider_example.cc
index db33940..4bc4820 100644
--- a/ui/views/examples/slider_example.cc
+++ b/ui/views/examples/slider_example.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/label.h"
 #include "ui/views/controls/slider.h"
 #include "ui/views/layout/box_layout.h"
@@ -29,7 +30,8 @@
 
   slider_->SetValue(0.5);
 
-  container->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 3, 3, 3));
+  container->SetLayoutManager(
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(3), 3));
   container->AddChildView(slider_);
   container->AddChildView(label_);
 }
diff --git a/ui/views/examples/toggle_button_example.cc b/ui/views/examples/toggle_button_example.cc
index 903fef24..7cec6167 100644
--- a/ui/views/examples/toggle_button_example.cc
+++ b/ui/views/examples/toggle_button_example.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/stringprintf.h"
 #include "base/strings/utf_string_conversions.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/controls/button/toggle_button.h"
 #include "ui/views/layout/box_layout.h"
 
@@ -19,7 +20,7 @@
 
 void ToggleButtonExample::CreateExampleView(View* container) {
   button_ = new ToggleButton(this);
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical);
   layout->set_cross_axis_alignment(BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
   container->SetLayoutManager(layout);
   container->AddChildView(button_);
diff --git a/ui/views/examples/vector_example.cc b/ui/views/examples/vector_example.cc
index f44d607..b2f1081 100644
--- a/ui/views/examples/vector_example.cc
+++ b/ui/views/examples/vector_example.cc
@@ -10,6 +10,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/views/border.h"
 #include "ui/views/controls/button/button.h"
@@ -46,7 +47,7 @@
     AddChildView(color_input_);
 
     image_view_container_->AddChildView(image_view_);
-    BoxLayout* image_layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+    BoxLayout* image_layout = new BoxLayout(BoxLayout::kHorizontal);
     image_layout->set_cross_axis_alignment(
         BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
     image_layout->set_main_axis_alignment(
@@ -55,14 +56,15 @@
     image_view_->SetBorder(CreateSolidSidedBorder(1, 1, 1, 1, SK_ColorBLACK));
     AddChildView(image_view_container_);
 
-    BoxLayout* box = new BoxLayout(BoxLayout::kVertical, 10, 10, 10);
+    BoxLayout* box = new BoxLayout(BoxLayout::kVertical, gfx::Insets(10), 10);
     SetLayoutManager(box);
     box->SetFlexForView(image_view_container_, 1);
 
     file_chooser_->set_placeholder_text(
         base::ASCIIToUTF16("Enter a file to read"));
     View* file_container = new View();
-    BoxLayout* file_box = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+    BoxLayout* file_box =
+        new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
     file_container->SetLayoutManager(file_box);
     file_container->AddChildView(file_chooser_);
     file_container->AddChildView(file_go_button_);
diff --git a/ui/views/examples/widget_example.cc b/ui/views/examples/widget_example.cc
index 835272f..9b7a292 100644
--- a/ui/views/examples/widget_example.cc
+++ b/ui/views/examples/widget_example.cc
@@ -7,6 +7,7 @@
 #include "base/macros.h"
 #include "base/strings/utf_string_conversions.h"
 #include "build/build_config.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/background.h"
 #include "ui/views/controls/button/md_text_button.h"
 #include "ui/views/controls/label.h"
@@ -44,7 +45,7 @@
 
 DialogExample::DialogExample() {
   SetBackground(CreateSolidBackground(SK_ColorGRAY));
-  SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 10, 10, 10));
+  SetLayoutManager(new BoxLayout(BoxLayout::kVertical, gfx::Insets(10), 10));
   AddChildView(new Label(ASCIIToUTF16("Dialog contents label!")));
 }
 
@@ -72,7 +73,8 @@
 }
 
 void WidgetExample::CreateExampleView(View* container) {
-  container->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, 10));
+  container->SetLayoutManager(
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(), 10));
   BuildButton(container, "Popup widget", POPUP);
   BuildButton(container, "Dialog widget", DIALOG);
   BuildButton(container, "Modal Dialog", MODAL_DIALOG);
@@ -104,7 +106,7 @@
   // If the Widget has no contents by default, add a view with a 'Close' button.
   if (!widget->GetContentsView()) {
     View* contents = new View();
-    contents->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0));
+    contents->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal));
     contents->SetBackground(CreateSolidBackground(SK_ColorGRAY));
     BuildButton(contents, "Close", CLOSE_WIDGET);
     widget->SetContentsView(contents);
diff --git a/ui/views/layout/box_layout.cc b/ui/views/layout/box_layout.cc
index 7e5abff4..defbcd3 100644
--- a/ui/views/layout/box_layout.cc
+++ b/ui/views/layout/box_layout.cc
@@ -12,19 +12,16 @@
 namespace views {
 
 BoxLayout::BoxLayout(BoxLayout::Orientation orientation,
-                     int inside_border_horizontal_spacing,
-                     int inside_border_vertical_spacing,
+                     const gfx::Insets& inside_border_insets,
                      int between_child_spacing)
     : orientation_(orientation),
-      inside_border_insets_(inside_border_vertical_spacing,
-                            inside_border_horizontal_spacing),
+      inside_border_insets_(inside_border_insets),
       between_child_spacing_(between_child_spacing),
       main_axis_alignment_(MAIN_AXIS_ALIGNMENT_START),
       cross_axis_alignment_(CROSS_AXIS_ALIGNMENT_STRETCH),
       default_flex_(0),
       minimum_cross_axis_size_(0),
-      host_(NULL) {
-}
+      host_(nullptr) {}
 
 BoxLayout::~BoxLayout() {
 }
diff --git a/ui/views/layout/box_layout.h b/ui/views/layout/box_layout.h
index 9a87984..c32c047 100644
--- a/ui/views/layout/box_layout.h
+++ b/ui/views/layout/box_layout.h
@@ -55,14 +55,12 @@
     CROSS_AXIS_ALIGNMENT_END,
   };
 
-  // Use |inside_border_horizontal_spacing| and
-  // |inside_border_vertical_spacing| to add additional space between the child
+  // Use |inside_border_insets| to add additional space between the child
   // view area and the host view border. |between_child_spacing| controls the
   // space in between child views.
   BoxLayout(Orientation orientation,
-            int inside_border_horizontal_spacing,
-            int inside_border_vertical_spacing,
-            int between_child_spacing);
+            const gfx::Insets& inside_border_insets = gfx::Insets(),
+            int between_child_spacing = 0);
   ~BoxLayout() override;
 
   void set_main_axis_alignment(MainAxisAlignment main_axis_alignment) {
diff --git a/ui/views/layout/box_layout_unittest.cc b/ui/views/layout/box_layout_unittest.cc
index d2d073e..b14a80c 100644
--- a/ui/views/layout/box_layout_unittest.cc
+++ b/ui/views/layout/box_layout_unittest.cc
@@ -7,6 +7,7 @@
 #include <stddef.h>
 
 #include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/views/test/test_views.h"
 #include "ui/views/view.h"
 
@@ -24,13 +25,14 @@
 }  // namespace
 
 TEST_F(BoxLayoutTest, Empty) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 20);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 20);
   host_->SetLayoutManager(layout);
   EXPECT_EQ(gfx::Size(20, 20), layout->GetPreferredSize(host_.get()));
 }
 
 TEST_F(BoxLayoutTest, AlignmentHorizontal) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(10, 20));
   host_->AddChildView(v1);
@@ -44,7 +46,7 @@
 }
 
 TEST_F(BoxLayoutTest, AlignmentVertical) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 10));
   host_->AddChildView(v1);
@@ -58,7 +60,8 @@
 }
 
 TEST_F(BoxLayoutTest, SetInsideBorderInsets) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 20, 0);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(20, 10));
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(10, 20));
   host_->AddChildView(v1);
@@ -80,7 +83,7 @@
 }
 
 TEST_F(BoxLayoutTest, Spacing) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 7, 7, 8);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(7), 8);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(10, 20));
   host_->AddChildView(v1);
@@ -94,7 +97,7 @@
 }
 
 TEST_F(BoxLayoutTest, Overflow) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
   host_->AddChildView(v1);
@@ -126,7 +129,8 @@
 }
 
 TEST_F(BoxLayoutTest, NoSpace) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
   View* childView = new StaticSizedView(gfx::Size(20, 20));
   host_->AddChildView(childView);
@@ -136,7 +140,8 @@
 }
 
 TEST_F(BoxLayoutTest, InvisibleChild) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
   v1->SetVisible(false);
@@ -150,7 +155,7 @@
 }
 
 TEST_F(BoxLayoutTest, UseHeightForWidth) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 10));
   host_->AddChildView(v1);
@@ -184,7 +189,7 @@
     BoxLayout::Orientation orientation = i == 0 ? BoxLayout::kHorizontal :
                                                   BoxLayout::kVertical;
     host_->RemoveAllChildViews(true);
-    host_->SetLayoutManager(new BoxLayout(orientation, 0, 0, 5));
+    host_->SetLayoutManager(new BoxLayout(orientation, gfx::Insets(), 5));
     View* v1 = new StaticSizedView(gfx::Size());
     host_->AddChildView(v1);
     View* v2 = new StaticSizedView(gfx::Size(10, 10));
@@ -205,7 +210,7 @@
 // empty preferred size, simultaneously.
 TEST_F(BoxLayoutTest, EmptyPreferredSizeWithFlexLayoutAndChildSpacing) {
   host_->RemoveAllChildViews(true);
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 5);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(), 5);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size());
   host_->AddChildView(v1);
@@ -221,7 +226,8 @@
 }
 
 TEST_F(BoxLayoutTest, MainAxisAlignmentHorizontal) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
 
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
@@ -257,7 +263,7 @@
 }
 
 TEST_F(BoxLayoutTest, MainAxisAlignmentVertical) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 10, 10, 10);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
 
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
@@ -293,7 +299,8 @@
 }
 
 TEST_F(BoxLayoutTest, CrossAxisAlignmentHorizontal) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
 
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
@@ -335,7 +342,7 @@
 }
 
 TEST_F(BoxLayoutTest, CrossAxisAlignmentVertical) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 10, 10, 10);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
 
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
@@ -377,7 +384,8 @@
 }
 
 TEST_F(BoxLayoutTest, FlexAll) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
   layout->SetDefaultFlex(1);
 
@@ -397,7 +405,7 @@
 }
 
 TEST_F(BoxLayoutTest, FlexGrowVertical) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 10, 10, 10);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
 
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
@@ -454,7 +462,7 @@
 }
 
 TEST_F(BoxLayoutTest, FlexGrowHorizontalWithRemainder) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal);
   host_->SetLayoutManager(layout);
   layout->SetDefaultFlex(1);
   std::vector<View*> views;
@@ -478,7 +486,7 @@
 }
 
 TEST_F(BoxLayoutTest, FlexGrowHorizontalWithRemainder2) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal);
   host_->SetLayoutManager(layout);
   layout->SetDefaultFlex(1);
   std::vector<View*> views;
@@ -501,7 +509,8 @@
 }
 
 TEST_F(BoxLayoutTest, FlexShrinkHorizontal) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 10, 10, 10);
+  BoxLayout* layout =
+      new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(10), 10);
   host_->SetLayoutManager(layout);
 
   View* v1 = new StaticSizedView(gfx::Size(20, 20));
@@ -560,7 +569,7 @@
 }
 
 TEST_F(BoxLayoutTest, FlexShrinkVerticalWithRemainder) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 10));
   host_->AddChildView(v1);
@@ -610,7 +619,7 @@
 }
 
 TEST_F(BoxLayoutTest, MinimumCrossAxisVertical) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kVertical);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 10));
   host_->AddChildView(v1);
@@ -620,7 +629,7 @@
 }
 
 TEST_F(BoxLayoutTest, MinimumCrossAxisHorizontal) {
-  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal, 0, 0, 0);
+  BoxLayout* layout = new BoxLayout(BoxLayout::kHorizontal);
   host_->SetLayoutManager(layout);
   View* v1 = new StaticSizedView(gfx::Size(20, 10));
   host_->AddChildView(v1);
diff --git a/ui/views/touchui/touch_selection_menu_runner_views.cc b/ui/views/touchui/touch_selection_menu_runner_views.cc
index f57c39e..7a6c5c77 100644
--- a/ui/views/touchui/touch_selection_menu_runner_views.cc
+++ b/ui/views/touchui/touch_selection_menu_runner_views.cc
@@ -11,6 +11,7 @@
 #include "ui/aura/window.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/insets.h"
 #include "ui/gfx/geometry/rect.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/text_utils.h"
@@ -100,8 +101,8 @@
   set_adjust_if_offscreen(true);
   EnableCanvasFlippingForRTLUI(true);
 
-  SetLayoutManager(
-      new BoxLayout(BoxLayout::kHorizontal, 0, 0, kSpacingBetweenButtons));
+  SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, gfx::Insets(),
+                                 kSpacingBetweenButtons));
   CreateButtons();
 
   // After buttons are created, check if there is enough room between handles to