diff --git a/DEPS b/DEPS
index 36c25ee..94b7574 100644
--- a/DEPS
+++ b/DEPS
@@ -40,7 +40,7 @@
   # 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': '7fee90cb5eda2345bb8ec9be706aea1a09866005',
+  'skia_revision': '7d22a33e219ba8038821b378ab80ed9028723d49',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index aceb5340..eded7406 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -1102,10 +1102,6 @@
   wm_shelf_->UpdateVisibilityState();
 }
 
-void RootWindowController::OnLoginStateChanged(LoginStatus status) {
-  wm_shelf_->UpdateVisibilityState();
-}
-
 void RootWindowController::OnTouchHudProjectionToggled(bool enabled) {
   if (enabled)
     EnableTouchHudProjection();
diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h
index 2bca0fa..50f8d8a 100644
--- a/ash/root_window_controller.h
+++ b/ash/root_window_controller.h
@@ -280,7 +280,6 @@
                        ui::MenuSourceType source_type);
 
   // Called when the login status changes after login (such as lock/unlock).
-  // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
   void UpdateAfterLoginStatusChange(LoginStatus status);
 
  private:
@@ -323,7 +322,6 @@
   void OnMenuClosed();
 
   // Overridden from ShellObserver.
-  void OnLoginStateChanged(LoginStatus status) override;
   void OnTouchHudProjectionToggled(bool enabled) override;
 
   std::unique_ptr<AshWindowTreeHost> ash_host_;
diff --git a/ash/session/session_controller.cc b/ash/session/session_controller.cc
index 9e7dd763..041259cd 100644
--- a/ash/session/session_controller.cc
+++ b/ash/session/session_controller.cc
@@ -158,7 +158,7 @@
 
   *it = std::move(user_session);
   for (auto& observer : observers_)
-    observer.UserSessionUpdated((*it)->account_id);
+    observer.OnUserSessionUpdated((*it)->account_id);
 
   UpdateLoginStatus();
 }
@@ -189,7 +189,7 @@
     active_session_id_ = user_sessions_[0]->session_id;
 
     for (auto& observer : observers_)
-      observer.ActiveUserChanged(user_sessions_[0]->account_id);
+      observer.OnActiveUserSessionChanged(user_sessions_[0]->account_id);
 
     UpdateLoginStatus();
   }
@@ -224,7 +224,7 @@
   const bool was_locked = state_ == SessionState::LOCKED;
   state_ = state;
   for (auto& observer : observers_)
-    observer.SessionStateChanged(state_);
+    observer.OnSessionStateChanged(state_);
 
   UpdateLoginStatus();
 
@@ -234,7 +234,7 @@
       is_unlocking_ = false;
 
     for (auto& observer : observers_)
-      observer.LockStateChanged(locked);
+      observer.OnLockStateChanged(locked);
   }
 }
 
@@ -244,7 +244,7 @@
   user_sessions_.push_back(std::move(user_session));
 
   for (auto& observer : observers_)
-    observer.UserAddedToSession(account_id);
+    observer.OnUserSessionAdded(account_id);
 }
 
 LoginStatus SessionController::CalculateLoginStatus() const {
@@ -312,7 +312,7 @@
 
   login_status_ = new_login_status;
   for (auto& observer : observers_)
-    observer.LoginStatusChanged(login_status_);
+    observer.OnLoginStatusChanged(login_status_);
 }
 
 }  // namespace ash
diff --git a/ash/session/session_controller_unittest.cc b/ash/session/session_controller_unittest.cc
index f011548..2fb05f8 100644
--- a/ash/session/session_controller_unittest.cc
+++ b/ash/session/session_controller_unittest.cc
@@ -30,15 +30,15 @@
   ~TestSessionStateObserver() override {}
 
   // SessionStateObserver:
-  void ActiveUserChanged(const AccountId& account_id) override {
+  void OnActiveUserSessionChanged(const AccountId& account_id) override {
     active_account_id_ = account_id;
   }
 
-  void UserAddedToSession(const AccountId& account_id) override {
+  void OnUserSessionAdded(const AccountId& account_id) override {
     user_session_account_ids_.push_back(account_id);
   }
 
-  void SessionStateChanged(SessionState state) override { state_ = state; }
+  void OnSessionStateChanged(SessionState state) override { state_ = state; }
 
   std::string GetUserSessionEmails() const {
     std::string emails;
diff --git a/ash/session/session_state_observer.h b/ash/session/session_state_observer.h
index 736679b8..7732f53 100644
--- a/ash/session/session_state_observer.h
+++ b/ash/session/session_state_observer.h
@@ -18,23 +18,23 @@
 // TODO(xiyuan): Rename to On*Changed().
 class ASH_EXPORT SessionStateObserver {
  public:
-  // Called when active user has changed.
-  virtual void ActiveUserChanged(const AccountId& account_id) {}
+  // Called when the active user session has changed.
+  virtual void OnActiveUserSessionChanged(const AccountId& account_id) {}
 
-  // Called when another user gets added to the existing session.
-  virtual void UserAddedToSession(const AccountId& account_id) {}
+  // Called when a user session gets added to the existing session.
+  virtual void OnUserSessionAdded(const AccountId& account_id) {}
 
   // Called when a user session is updated, such as avatar change.
-  virtual void UserSessionUpdated(const AccountId& account_id) {}
+  virtual void OnUserSessionUpdated(const AccountId& account_id) {}
 
   // Called when the session state is changed.
-  virtual void SessionStateChanged(session_manager::SessionState state) {}
+  virtual void OnSessionStateChanged(session_manager::SessionState state) {}
 
   // Called when the login status is changed. |login_status| is the new status.
-  virtual void LoginStatusChanged(LoginStatus login_status) {}
+  virtual void OnLoginStatusChanged(LoginStatus login_status) {}
 
   // Called when the lock state is changed. |locked| is the current lock stated.
-  virtual void LockStateChanged(bool locked) {}
+  virtual void OnLockStateChanged(bool locked) {}
 
  protected:
   virtual ~SessionStateObserver() {}
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index ad89d6d7..a054cc9 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -994,7 +994,7 @@
   MaybeUpdateShelfBackground(AnimationChangeType::ANIMATE);
 }
 
-void ShelfLayoutManager::SessionStateChanged(
+void ShelfLayoutManager::OnSessionStateChanged(
     session_manager::SessionState state) {
   // Check transition changes to/from the add user to session and change the
   // shelf alignment accordingly
@@ -1019,6 +1019,10 @@
   UpdateVisibilityState();
 }
 
+void ShelfLayoutManager::OnLoginStatusChanged(LoginStatus loing_status) {
+  UpdateVisibilityState();
+}
+
 void ShelfLayoutManager::UpdateShelfVisibilityAfterLoginUIChange() {
   UpdateVisibilityState();
   LayoutShelf();
diff --git a/ash/shelf/shelf_layout_manager.h b/ash/shelf/shelf_layout_manager.h
index 9aa3d0e3..4130b8d 100644
--- a/ash/shelf/shelf_layout_manager.h
+++ b/ash/shelf/shelf_layout_manager.h
@@ -151,7 +151,8 @@
   void OnLockStateEvent(LockStateObserver::EventType event) override;
 
   // Overridden from SessionStateObserver:
-  void SessionStateChanged(session_manager::SessionState state) override;
+  void OnSessionStateChanged(session_manager::SessionState state) override;
+  void OnLoginStatusChanged(LoginStatus loing_status) override;
 
   // TODO(harrym|oshima): These templates will be moved to a new Shelf class.
   // A helper function for choosing values specific to a shelf alignment.
diff --git a/ash/shelf/shelf_locking_manager.cc b/ash/shelf/shelf_locking_manager.cc
index 9a10b8f..39e4535 100644
--- a/ash/shelf/shelf_locking_manager.cc
+++ b/ash/shelf/shelf_locking_manager.cc
@@ -34,7 +34,7 @@
   UpdateLockedState();
 }
 
-void ShelfLockingManager::SessionStateChanged(
+void ShelfLockingManager::OnSessionStateChanged(
     session_manager::SessionState state) {
   session_locked_ = state != session_manager::SessionState::ACTIVE;
   UpdateLockedState();
diff --git a/ash/shelf/shelf_locking_manager.h b/ash/shelf/shelf_locking_manager.h
index 5b3f160..fb4f7b79 100644
--- a/ash/shelf/shelf_locking_manager.h
+++ b/ash/shelf/shelf_locking_manager.h
@@ -30,7 +30,7 @@
   void OnLockStateChanged(bool locked) override;
 
   // SessionStateObserver:
-  void SessionStateChanged(session_manager::SessionState state) override;
+  void OnSessionStateChanged(session_manager::SessionState state) override;
 
   // LockStateObserver:
   void OnLockStateEvent(EventType event) override;
diff --git a/ash/shelf/shelf_locking_manager_unittest.cc b/ash/shelf/shelf_locking_manager_unittest.cc
index 3af05cac..4272e0a 100644
--- a/ash/shelf/shelf_locking_manager_unittest.cc
+++ b/ash/shelf/shelf_locking_manager_unittest.cc
@@ -25,7 +25,7 @@
   }
 
   void SetSessionState(session_manager::SessionState state) {
-    GetShelfLockingManager()->SessionStateChanged(state);
+    GetShelfLockingManager()->OnSessionStateChanged(state);
   }
 
  private:
diff --git a/ash/shell.cc b/ash/shell.cc
index 10f49c9..3a2b370 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -1214,7 +1214,7 @@
     root_window_for_new_windows_ = gained_active_wm->GetRootWindow();
 }
 
-void Shell::SessionStateChanged(session_manager::SessionState state) {
+void Shell::OnSessionStateChanged(session_manager::SessionState state) {
   // Create the shelf when a session becomes active. It's safe to do this
   // multiple times (e.g. initial login vs. multiprofile add session).
   if (state == session_manager::SessionState::ACTIVE) {
@@ -1227,7 +1227,7 @@
   }
 }
 
-void Shell::LoginStatusChanged(LoginStatus login_status) {
+void Shell::OnLoginStatusChanged(LoginStatus login_status) {
   UpdateAfterLoginStatusChange(login_status);
 
   // TODO(xiyuan): Update OnLoginStateChanged -> OnLoginStatusChanged.
@@ -1235,7 +1235,7 @@
     observer.OnLoginStateChanged(login_status);
 }
 
-void Shell::LockStateChanged(bool locked) {
+void Shell::OnLockStateChanged(bool locked) {
   // TODO(xiyuan): Convert OnLockStateChanged() ShellObservers to
   // SessionStateObservers.
   for (auto& observer : shell_observers_)
diff --git a/ash/shell.h b/ash/shell.h
index c674dd7..bfb2267 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -632,9 +632,9 @@
                          aura::Window* lost_active) override;
 
   // SessionStateObserver:
-  void SessionStateChanged(session_manager::SessionState state) override;
-  void LoginStatusChanged(LoginStatus login_status) override;
-  void LockStateChanged(bool locked) override;
+  void OnSessionStateChanged(session_manager::SessionState state) override;
+  void OnLoginStatusChanged(LoginStatus login_status) override;
+  void OnLockStateChanged(bool locked) override;
 
   // Callback for prefs::ConnectToPrefService.
   void OnPrefServiceInitialized(std::unique_ptr<::PrefService> pref_service);
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc
index 0000a42..5102aa6 100644
--- a/ash/system/overview/overview_button_tray.cc
+++ b/ash/system/overview/overview_button_tray.cc
@@ -55,7 +55,7 @@
   return performed;
 }
 
-void OverviewButtonTray::SessionStateChanged(
+void OverviewButtonTray::OnSessionStateChanged(
     session_manager::SessionState state) {
   UpdateIconVisibility();
 }
diff --git a/ash/system/overview/overview_button_tray.h b/ash/system/overview/overview_button_tray.h
index 7a009c81..35a96d3e 100644
--- a/ash/system/overview/overview_button_tray.h
+++ b/ash/system/overview/overview_button_tray.h
@@ -37,7 +37,7 @@
   bool PerformAction(const ui::Event& event) override;
 
   // SessionStateObserver:
-  void SessionStateChanged(session_manager::SessionState state) override;
+  void OnSessionStateChanged(session_manager::SessionState state) override;
 
   // ShellObserver:
   void OnMaximizeModeStarted() override;
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc
index 33a7ae7..a752f13 100644
--- a/ash/system/overview/overview_button_tray_unittest.cc
+++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -74,7 +74,7 @@
 }
 
 void OverviewButtonTrayTest::NotifySessionStateChanged() {
-  GetTray()->SessionStateChanged(
+  GetTray()->OnSessionStateChanged(
       Shell::Get()->session_controller()->GetSessionState());
 }
 
diff --git a/ash/system/palette/palette_tray.cc b/ash/system/palette/palette_tray.cc
index 73c9797..4054cccb 100644
--- a/ash/system/palette/palette_tray.cc
+++ b/ash/system/palette/palette_tray.cc
@@ -249,7 +249,7 @@
   return bubble_ && bubble_->bubble_view()->GetBoundsInScreen().Contains(point);
 }
 
-void PaletteTray::SessionStateChanged(session_manager::SessionState state) {
+void PaletteTray::OnSessionStateChanged(session_manager::SessionState state) {
   UpdateIconVisibility();
 }
 
diff --git a/ash/system/palette/palette_tray.h b/ash/system/palette/palette_tray.h
index 23a295a8..d5ca55bb 100644
--- a/ash/system/palette/palette_tray.h
+++ b/ash/system/palette/palette_tray.h
@@ -49,7 +49,7 @@
   bool PerformAction(const ui::Event& event) override;
 
   // SessionStateObserver:
-  void SessionStateChanged(session_manager::SessionState state) override;
+  void OnSessionStateChanged(session_manager::SessionState state) override;
 
   // ShellObserver:
   void OnLockStateChanged(bool locked) override;
diff --git a/ash/system/user/tray_user.cc b/ash/system/user/tray_user.cc
index 31561e8..47c6e87 100644
--- a/ash/system/user/tray_user.cc
+++ b/ash/system/user/tray_user.cc
@@ -210,11 +210,11 @@
   }
 }
 
-void TrayUser::ActiveUserChanged(const AccountId& account_id) {
-  UserSessionUpdated(account_id);
+void TrayUser::OnActiveUserSessionChanged(const AccountId& account_id) {
+  OnUserSessionUpdated(account_id);
 }
 
-void TrayUser::UserAddedToSession(const AccountId& account_id) {
+void TrayUser::OnUserSessionAdded(const AccountId& account_id) {
   const SessionController* const session_controller =
       Shell::Get()->session_controller();
   // Only create views for user items which are logged in.
@@ -228,7 +228,7 @@
   UpdateAvatarImage(Shell::Get()->session_controller()->login_status());
 }
 
-void TrayUser::UserSessionUpdated(const AccountId& account_id) {
+void TrayUser::OnUserSessionUpdated(const AccountId& account_id) {
   UpdateAvatarImage(Shell::Get()->session_controller()->login_status());
 }
 
diff --git a/ash/system/user/tray_user.h b/ash/system/user/tray_user.h
index d023bba..ceffa7e 100644
--- a/ash/system/user/tray_user.h
+++ b/ash/system/user/tray_user.h
@@ -70,9 +70,9 @@
   void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;
 
   // Overridden from SessionStateObserver.
-  void ActiveUserChanged(const AccountId& account_id) override;
-  void UserAddedToSession(const AccountId& account_id) override;
-  void UserSessionUpdated(const AccountId& account_id) override;
+  void OnActiveUserSessionChanged(const AccountId& account_id) override;
+  void OnUserSessionAdded(const AccountId& account_id) override;
+  void OnUserSessionUpdated(const AccountId& account_id) override;
 
   void UpdateAvatarImage(LoginStatus status);
 
diff --git a/ash/wallpaper/wallpaper_controller.cc b/ash/wallpaper/wallpaper_controller.cc
index caf6d11b..b858cf3 100644
--- a/ash/wallpaper/wallpaper_controller.cc
+++ b/ash/wallpaper/wallpaper_controller.cc
@@ -213,7 +213,7 @@
   InstallDesktopController(root_window);
 }
 
-void WallpaperController::SessionStateChanged(
+void WallpaperController::OnSessionStateChanged(
     session_manager::SessionState state) {
   CalculateWallpaperColors();
 }
diff --git a/ash/wallpaper/wallpaper_controller.h b/ash/wallpaper/wallpaper_controller.h
index af4aa74c..4ccda4c0 100644
--- a/ash/wallpaper/wallpaper_controller.h
+++ b/ash/wallpaper/wallpaper_controller.h
@@ -98,7 +98,7 @@
   void OnRootWindowAdded(WmWindow* root_window) override;
 
   // SessionStateObserver:
-  void SessionStateChanged(session_manager::SessionState state) override;
+  void OnSessionStateChanged(session_manager::SessionState state) override;
 
   // Returns the maximum size of all displays combined in native
   // resolutions.  Note that this isn't the bounds of the display who
diff --git a/base/android/java/src/org/chromium/base/CommandLine.java b/base/android/java/src/org/chromium/base/CommandLine.java
index b6246f3..0f49d88 100644
--- a/base/android/java/src/org/chromium/base/CommandLine.java
+++ b/base/android/java/src/org/chromium/base/CommandLine.java
@@ -134,8 +134,8 @@
      * @param file The fully qualified command line file.
      */
     public static void initFromFile(String file) {
-        // Arbitrary clamp of 16k on the amount of file we read in.
-        char[] buffer = readUtf8FileFullyCrashIfTooBig(file, 16 * 1024);
+        // Just field trials can take upto 10K of command line.
+        char[] buffer = readUtf8FileFullyCrashIfTooBig(file, 64 * 1024);
         init(buffer == null ? null : tokenizeQuotedAruments(buffer));
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java
index 8007e82..c8399e60 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelBase.java
@@ -197,7 +197,7 @@
     private float mMaximumHeight;
 
     private boolean mIsFullWidthSizePanelForTesting;
-    private boolean mOverrideIsFullWidthSizePanelForTesting;
+    protected boolean mOverrideIsFullWidthSizePanelForTesting;
 
     /**
      * Called when the layout has changed.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
index 3d9bbcae..d769f08 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
@@ -415,6 +415,15 @@
         addBarHandle(mActivity.getToolbarManager().getToolbar().getHeight());
     }
 
+    @Override
+    protected boolean doesMatchFullWidthCriteria(float containerWidth) {
+        if (!mOverrideIsFullWidthSizePanelForTesting && mActivity != null
+                && mActivity.getBottomSheet() != null) {
+            return true;
+        }
+        return super.doesMatchFullWidthCriteria(containerWidth);
+    }
+
     // ============================================================================================
     // Animation Handling
     // ============================================================================================
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
index a66d9a7..314eebe2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java
@@ -314,6 +314,11 @@
         return mShouldHideEndToolbarButtons;
     }
 
+    @Override
+    protected void onHomeButtonUpdate(boolean homeButtonEnabled) {
+        // Intentionally does not call super. Chrome Home does not support a home button.
+    }
+
     /**
      * Sets the height and title text appearance of the provided toolbar so that its style is
      * consistent with BottomToolbarPhone.
diff --git a/chrome/app/bookmarks_strings.grdp b/chrome/app/bookmarks_strings.grdp
index 52fd6de0..7710ba0 100644
--- a/chrome/app/bookmarks_strings.grdp
+++ b/chrome/app/bookmarks_strings.grdp
@@ -63,15 +63,24 @@
 
   <!-- Begin of Bookmarks Bar Context Menu strings. -->
   <if expr="not use_titlecase">
-    <message name="IDS_BOOKMARK_BAR_OPEN_ALL" desc="Menu title for opening all urls in a bookmark folder">
-      &amp;Open all bookmarks
-    </message>
-    <message name="IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW" desc="Menu title for opening all urls in a bookmark folder in a new window">
-      Open all bookmarks in &amp;new window
-    </message>
-    <message name="IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO" desc="Menu description for opening all urls in a bookmark folder in an incognito window">
-      Open all bookmarks in &amp;incognito window
-    </message>
+  <message name="IDS_BOOKMARK_BAR_OPEN_ALL" desc="Menu title for opening all urls in a bookmark folder">
+      {COUNT, plural,
+        =0 {&amp;Open all}
+        =1 {&amp;Open bookmark}
+        other {&amp;Open all (#)}}
+  </message>
+  <message name="IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW" desc="Menu title for opening all urls in a bookmark folder in a new window">
+      {COUNT, plural,
+        =0 {Open all in &amp;new window}
+        =1 {Open in &amp;new window}
+        other {Open all (#) in &amp;new window}}
+  </message>
+  <message name="IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO" desc="Menu description for opening all urls in a bookmark folder in an incognito window">
+      {COUNT, plural,
+        =0 {Open all in &amp;incognito window}
+        =1 {Open in &amp;incognito window}
+        other {Open all (#) in &amp;incognito window}}
+  </message>
     <message name="IDS_BOOKMARK_BAR_OPEN_IN_NEW_TAB" desc="Menu description for loading bookmark in a new tab">
       &amp;Open in new tab
     </message>
@@ -103,15 +112,24 @@
     </if>
   </if>
   <if expr="use_titlecase">
-    <message name="IDS_BOOKMARK_BAR_OPEN_ALL" desc="In Title Case: Menu title for opening all urls in a bookmark folder">
-      &amp;Open All Bookmarks
-    </message>
-    <message name="IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW" desc="In Title Case: Menu title for opening all urls in a bookmark folder in a new window">
-      Open All Bookmarks in &amp;New Window
-    </message>
-    <message name="IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO" desc="In Title Case: Menu description for opening all urls in a bookmark folder in an incognito window">
-      Open All Bookmarks in &amp;Incognito Window
-    </message>
+  <message name="IDS_BOOKMARK_BAR_OPEN_ALL" desc="In Title Case: Menu title for opening all urls in a bookmark folder">
+      {COUNT, plural,
+        =0 {&amp;Open All}
+        =1 {&amp;Open Bookmark}
+        other {&amp;Open All (#)}}
+  </message>
+  <message name="IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW" desc="In Title Case: Menu title for opening all urls in a bookmark folder in a new window">
+      {COUNT, plural,
+        =0 {Open All in &amp;New Window}
+        =1 {Open in &amp;New Window}
+        other {Open All (#) in &amp;New Window}}
+  </message>
+  <message name="IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO" desc="In Title Case: Menu description for opening all urls in a bookmark folder in an incognito window">
+      {COUNT, plural,
+        =0 {Open All in &amp;Incognito Window}
+        =1 {Open in &amp;Incognito Window}
+        other {Open All (#) in &amp;Incognito Window}}
+  </message>
     <message name="IDS_BOOKMARK_BAR_OPEN_IN_NEW_TAB" desc="In Title Case: Menu description for loading bookmark in a new tab">
       &amp;Open in New Tab
     </message>
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_crypto.cc b/chrome/browser/extensions/api/networking_private/networking_private_crypto.cc
index bf05b1d..3c82b8b5 100644
--- a/chrome/browser/extensions/api/networking_private/networking_private_crypto.cc
+++ b/chrome/browser/extensions/api/networking_private/networking_private_crypto.cc
@@ -14,10 +14,8 @@
 #include "crypto/openssl_util.h"
 #include "crypto/rsa_private_key.h"
 #include "net/cert/pem_tokenizer.h"
-#include "third_party/boringssl/src/include/openssl/digest.h"
 #include "third_party/boringssl/src/include/openssl/evp.h"
 #include "third_party/boringssl/src/include/openssl/rsa.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
 
 namespace {
 
diff --git a/chrome/browser/extensions/api/permissions/permissions_apitest.cc b/chrome/browser/extensions/api/permissions/permissions_apitest.cc
index 3de54c7..910bf62 100644
--- a/chrome/browser/extensions/api/permissions/permissions_apitest.cc
+++ b/chrome/browser/extensions/api/permissions/permissions_apitest.cc
@@ -5,6 +5,7 @@
 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
 #include "chrome/browser/extensions/extension_apitest.h"
 #include "chrome/browser/extensions/extension_management_test_util.h"
+#include "chrome/browser/extensions/extension_with_management_policy_apitest.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/ui/browser.h"
 #include "components/policy/core/browser/browser_policy_connector.h"
@@ -33,21 +34,6 @@
   }
 };
 
-class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest {
- public:
-  void SetUpInProcessBrowserTestFixture() override {
-    ExtensionApiTest::SetUpInProcessBrowserTestFixture();
-    EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_))
-        .WillRepeatedly(testing::Return(true));
-    policy_provider_.SetAutoRefresh();
-    policy::BrowserPolicyConnector::SetPolicyProviderForTesting(
-        &policy_provider_);
-  }
-
- protected:
-  policy::MockConfigurationPolicyProvider policy_provider_;
-};
-
 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, PermissionsFail) {
   ASSERT_TRUE(RunExtensionTest("permissions/disabled")) << message_;
 
diff --git a/chrome/browser/extensions/content_script_apitest.cc b/chrome/browser/extensions/content_script_apitest.cc
index 251ec77..839c2f97 100644
--- a/chrome/browser/extensions/content_script_apitest.cc
+++ b/chrome/browser/extensions/content_script_apitest.cc
@@ -13,7 +13,9 @@
 #include "build/build_config.h"
 #include "chrome/browser/extensions/api/permissions/permissions_api.h"
 #include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/extensions/extension_management_test_util.h"
 #include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_with_management_policy_apitest.h"
 #include "chrome/browser/extensions/test_extension_dir.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -503,6 +505,18 @@
   ASSERT_TRUE(RunExtensionTest("content_scripts/permissions")) << message_;
 }
 
+IN_PROC_BROWSER_TEST_F(ExtensionApiTestWithManagementPolicy,
+                       ContentScriptPolicy) {
+  // Set enterprise policy to block injection to policy specified host.
+  {
+    ExtensionManagementPolicyUpdater pref(&policy_provider_);
+    pref.AddRuntimeBlockedHost("*", "*://example.com/*");
+  }
+  host_resolver()->AddRule("*.com", "127.0.0.1");
+  ASSERT_TRUE(StartEmbeddedTestServer());
+  ASSERT_TRUE(RunExtensionTest("content_scripts/policy")) << message_;
+}
+
 IN_PROC_BROWSER_TEST_P(ContentScriptApiTest, ContentScriptBypassPageCSP) {
   ASSERT_TRUE(StartEmbeddedTestServer());
   ASSERT_TRUE(RunExtensionTest("content_scripts/bypass_page_csp")) << message_;
diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc
index c564797..559efe8a 100644
--- a/chrome/browser/extensions/extension_management.cc
+++ b/chrome/browser/extensions/extension_management.cc
@@ -198,6 +198,16 @@
   return default_settings_->blocked_permissions;
 }
 
+const URLPatternSet& ExtensionManagement::GetDefaultRuntimeBlockedHosts()
+    const {
+  return default_settings_->runtime_blocked_hosts;
+}
+
+const URLPatternSet& ExtensionManagement::GetDefaultRuntimeAllowedHosts()
+    const {
+  return default_settings_->runtime_allowed_hosts;
+}
+
 const URLPatternSet& ExtensionManagement::GetRuntimeBlockedHosts(
     const Extension* extension) const {
   auto iter_id = settings_by_id_.find(extension->id());
@@ -214,8 +224,13 @@
   return default_settings_->runtime_allowed_hosts;
 }
 
-bool ExtensionManagement::IsBlockedHost(const Extension* extension,
-                                        const GURL& url) const {
+bool ExtensionManagement::UsesDefaultRuntimeHostRestrictions(
+    const Extension* extension) const {
+  return settings_by_id_.find(extension->id()) == settings_by_id_.end();
+}
+
+bool ExtensionManagement::IsRuntimeBlockedHost(const Extension* extension,
+                                               const GURL& url) const {
   auto iter_id = settings_by_id_.find(extension->id());
   if (iter_id != settings_by_id_.end())
     return iter_id->second->runtime_blocked_hosts.MatchesURL(url);
diff --git a/chrome/browser/extensions/extension_management.h b/chrome/browser/extensions/extension_management.h
index 1dca6061..719c779 100644
--- a/chrome/browser/extensions/extension_management.h
+++ b/chrome/browser/extensions/extension_management.h
@@ -117,12 +117,30 @@
   // Returns the list of hosts blocked by policy for |extension|.
   const URLPatternSet& GetRuntimeBlockedHosts(const Extension* extension) const;
 
-  // Returns the list of hosts |extension| is limited to by policy.
+  // Returns the hosts exempted by policy from the RuntimeBlockedHosts for
+  // |extension|.
   const URLPatternSet& GetRuntimeAllowedHosts(const Extension* extension) const;
 
+  // Returns the list of hosts blocked by policy for Default scope. This can be
+  // overridden by an invividual scope which is queried via
+  // GetRuntimeBlockedHosts.
+  const URLPatternSet& GetDefaultRuntimeBlockedHosts() const;
+
+  // Returns the hosts exempted by policy from RuntimeBlockedHosts for
+  // the default scope. This can be overridden by an individual scope which is
+  // queries via GetRuntimeAllowedHosts. This should only be used to
+  // initialize a new renderer.
+  const URLPatternSet& GetDefaultRuntimeAllowedHosts() const;
+
+  // Checks if an |extension| has its own runtime_blocked_hosts or
+  // runtime_allowed_hosts defined in the individual scope of the
+  // ExtensionSettings policy.
+  // Returns false if an individual scoped setting isn't defined.
+  bool UsesDefaultRuntimeHostRestrictions(const Extension* extension) const;
+
   // Checks if a URL is on the blocked host permissions list for a specific
   // extension.
-  bool IsBlockedHost(const Extension* extension, const GURL& url) const;
+  bool IsRuntimeBlockedHost(const Extension* extension, const GURL& url) const;
 
   // Returns blocked permission set for |extension|.
   std::unique_ptr<const PermissionSet> GetBlockedPermissions(
diff --git a/chrome/browser/extensions/extension_management_constants.cc b/chrome/browser/extensions/extension_management_constants.cc
index 11747e58..29e438b8 100644
--- a/chrome/browser/extensions/extension_management_constants.cc
+++ b/chrome/browser/extensions/extension_management_constants.cc
@@ -22,6 +22,7 @@
 
 const char kRuntimeBlockedHosts[] = "runtime_blocked_hosts";
 const char kRuntimeAllowedHosts[] = "runtime_allowed_hosts";
+const size_t kMaxItemsURLPatternSet = 100;
 
 const char kUpdateUrl[] = "update_url";
 const char kInstallSources[] = "install_sources";
diff --git a/chrome/browser/extensions/extension_management_constants.h b/chrome/browser/extensions/extension_management_constants.h
index a548572..3ab1cb2d 100644
--- a/chrome/browser/extensions/extension_management_constants.h
+++ b/chrome/browser/extensions/extension_management_constants.h
@@ -27,6 +27,7 @@
 
 extern const char kRuntimeBlockedHosts[];
 extern const char kRuntimeAllowedHosts[];
+extern const size_t kMaxItemsURLPatternSet;
 
 extern const char kUpdateUrl[];
 extern const char kInstallSources[];
diff --git a/chrome/browser/extensions/extension_management_internal.cc b/chrome/browser/extensions/extension_management_internal.cc
index a2596ae..cab0415b 100644
--- a/chrome/browser/extensions/extension_management_internal.cc
+++ b/chrome/browser/extensions/extension_management_internal.cc
@@ -115,6 +115,14 @@
     // Get the list of URLPatterns.
     if (dict->GetListWithoutPathExpansion(key,
                                           &host_list_value)) {
+      if (host_list_value->GetSize() >
+          schema_constants::kMaxItemsURLPatternSet) {
+        LOG(WARNING) << "Exceeded maximum number of URL match patterns ("
+                     << schema_constants::kMaxItemsURLPatternSet
+                     << ") for attribute '" << key << "'";
+        return false;
+      }
+
       out_value->ClearPatterns();
       const int extension_scheme_mask =
           URLPattern::GetValidSchemeMaskForExtensions();
@@ -122,7 +130,8 @@
         std::string unparsed_str;
         host_list_value->GetString(i, &unparsed_str);
         URLPattern pattern = URLPattern(extension_scheme_mask);
-        URLPattern::ParseResult parse_result = pattern.Parse(unparsed_str);
+        URLPattern::ParseResult parse_result = pattern.Parse(
+            unparsed_str, URLPattern::ALLOW_WILDCARD_FOR_EFFECTIVE_TLD);
         if (parse_result != URLPattern::PARSE_SUCCESS) {
           LOG(WARNING) << kMalformedPreferenceWarning;
           LOG(WARNING) << "Invalid URL pattern '" + unparsed_str +
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 41f485b7..de3963ce 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1257,6 +1257,21 @@
 
   extensions::ExtensionManagement* management =
       extensions::ExtensionManagementFactory::GetForBrowserContext(profile());
+  extensions::PermissionsUpdater(profile()).SetDefaultPolicyHostRestrictions(
+      management->GetDefaultRuntimeBlockedHosts(),
+      management->GetDefaultRuntimeAllowedHosts());
+  for (const auto& extension : registry_->enabled_extensions()) {
+    bool uses_default =
+        management->UsesDefaultRuntimeHostRestrictions(extension.get());
+    if (uses_default) {
+      extensions::PermissionsUpdater(profile()).SetUsesDefaultHostRestrictions(
+          extension.get());
+    } else {
+      extensions::PermissionsUpdater(profile()).SetPolicyHostRestrictions(
+          extension.get(), management->GetRuntimeBlockedHosts(extension.get()),
+          management->GetRuntimeAllowedHosts(extension.get()));
+    }
+  }
 
   // Loop through the disabled extension list, find extensions to re-enable
   // automatically. These extensions are exclusive from the |to_disable| and
diff --git a/chrome/browser/extensions/extension_with_management_policy_apitest.cc b/chrome/browser/extensions/extension_with_management_policy_apitest.cc
new file mode 100644
index 0000000..8ffaef6
--- /dev/null
+++ b/chrome/browser/extensions/extension_with_management_policy_apitest.cc
@@ -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.
+
+#include "chrome/browser/extensions/extension_with_management_policy_apitest.h"
+#include "components/policy/core/browser/browser_policy_connector.h"
+#include "net/test/embedded_test_server/http_request.h"
+
+ExtensionApiTestWithManagementPolicy::ExtensionApiTestWithManagementPolicy()
+    : ExtensionApiTest() {}
+
+ExtensionApiTestWithManagementPolicy::~ExtensionApiTestWithManagementPolicy() {}
+
+void ExtensionApiTestWithManagementPolicy::SetUpInProcessBrowserTestFixture() {
+  ExtensionApiTest::SetUpInProcessBrowserTestFixture();
+  EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_))
+      .WillRepeatedly(testing::Return(true));
+  policy_provider_.SetAutoRefresh();
+  policy::BrowserPolicyConnector::SetPolicyProviderForTesting(
+      &policy_provider_);
+}
diff --git a/chrome/browser/extensions/extension_with_management_policy_apitest.h b/chrome/browser/extensions/extension_with_management_policy_apitest.h
new file mode 100644
index 0000000..f0787f6
--- /dev/null
+++ b/chrome/browser/extensions/extension_with_management_policy_apitest.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 CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_
+
+#include <string>
+#include <vector>
+
+#include "chrome/browser/extensions/extension_apitest.h"
+#include "components/policy/core/common/mock_configuration_policy_provider.h"
+
+// The ExtensionSettings policy affects host permissions which impacts several
+// API integration tests. This class enables easy declaration of
+// ExtensionSettings policies and functions commonly used during these tests.
+class ExtensionApiTestWithManagementPolicy : public ExtensionApiTest {
+ public:
+  ExtensionApiTestWithManagementPolicy();
+  ~ExtensionApiTestWithManagementPolicy() override;
+  void SetUpInProcessBrowserTestFixture() override;
+
+ protected:
+  policy::MockConfigurationPolicyProvider policy_provider_;
+
+  DISALLOW_COPY_AND_ASSIGN(ExtensionApiTestWithManagementPolicy);
+};
+
+#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_WITH_MANAGEMENT_POLICY_APITEST_H_
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc
index a26f0ea..67e3ccb 100644
--- a/chrome/browser/extensions/permissions_updater.cc
+++ b/chrome/browser/extensions/permissions_updater.cc
@@ -146,6 +146,38 @@
   NotifyPermissionsUpdated(REMOVED, extension, to_remove);
 }
 
+void PermissionsUpdater::SetPolicyHostRestrictions(
+    const Extension* extension,
+    const URLPatternSet& runtime_blocked_hosts,
+    const URLPatternSet& runtime_allowed_hosts) {
+  extension->permissions_data()->SetPolicyHostRestrictions(
+      runtime_blocked_hosts, runtime_allowed_hosts);
+
+  // Send notification to the currently running renderers of the runtime block
+  // hosts settings.
+  const PermissionSet perms;
+  NotifyPermissionsUpdated(POLICY, extension, perms);
+}
+
+void PermissionsUpdater::SetUsesDefaultHostRestrictions(
+    const Extension* extension) {
+  extension->permissions_data()->SetUsesDefaultHostRestrictions();
+  const PermissionSet perms;
+  NotifyPermissionsUpdated(POLICY, extension, perms);
+}
+
+void PermissionsUpdater::SetDefaultPolicyHostRestrictions(
+    const URLPatternSet& default_runtime_blocked_hosts,
+    const URLPatternSet& default_runtime_allowed_hosts) {
+  PermissionsData::SetDefaultPolicyHostRestrictions(
+      default_runtime_blocked_hosts, default_runtime_allowed_hosts);
+
+  // Send notification to the currently running renderers of the runtime block
+  // hosts settings.
+  NotifyDefaultPolicyHostRestrictionsUpdated(default_runtime_blocked_hosts,
+                                             default_runtime_allowed_hosts);
+}
+
 void PermissionsUpdater::RemovePermissionsUnsafe(
     const Extension* extension,
     const PermissionSet& to_remove) {
@@ -257,28 +289,31 @@
     const Extension* extension,
     const PermissionSet& changed) {
   DCHECK_EQ(0, init_flag_ & INIT_FLAG_TRANSIENT);
-  if (changed.IsEmpty())
+
+  if (changed.IsEmpty() && event_type != POLICY)
     return;
 
   UpdatedExtensionPermissionsInfo::Reason reason;
-  events::HistogramValue histogram_value;
+  events::HistogramValue histogram_value = events::UNKNOWN;
   const char* event_name = NULL;
+  Profile* profile = Profile::FromBrowserContext(browser_context_);
 
   if (event_type == REMOVED) {
     reason = UpdatedExtensionPermissionsInfo::REMOVED;
     histogram_value = events::PERMISSIONS_ON_REMOVED;
     event_name = permissions::OnRemoved::kEventName;
-  } else {
-    CHECK_EQ(ADDED, event_type);
+  } else if (event_type == ADDED) {
     reason = UpdatedExtensionPermissionsInfo::ADDED;
     histogram_value = events::PERMISSIONS_ON_ADDED;
     event_name = permissions::OnAdded::kEventName;
+  } else {
+    DCHECK_EQ(POLICY, event_type);
+    reason = UpdatedExtensionPermissionsInfo::POLICY;
   }
 
   // Notify other APIs or interested parties.
-  UpdatedExtensionPermissionsInfo info = UpdatedExtensionPermissionsInfo(
-      extension, changed, reason);
-  Profile* profile = Profile::FromBrowserContext(browser_context_);
+  UpdatedExtensionPermissionsInfo info =
+      UpdatedExtensionPermissionsInfo(extension, changed, reason);
   content::NotificationService::current()->Notify(
       extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
       content::Source<Profile>(profile),
@@ -290,6 +325,14 @@
       extension->permissions_data()->active_permissions());
   params.withheld_permissions = ExtensionMsg_PermissionSetStruct(
       extension->permissions_data()->withheld_permissions());
+  params.uses_default_policy_host_restrictions =
+      extension->permissions_data()->UsesDefaultPolicyHostRestrictions();
+  if (!params.uses_default_policy_host_restrictions) {
+    params.policy_blocked_hosts =
+        extension->permissions_data()->policy_blocked_hosts();
+    params.policy_allowed_hosts =
+        extension->permissions_data()->policy_allowed_hosts();
+  }
 
   // Send the new permissions to the renderers.
   for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
@@ -301,8 +344,35 @@
     }
   }
 
-  // Trigger the onAdded and onRemoved events in the extension.
-  DispatchEvent(extension->id(), histogram_value, event_name, changed);
+  // Trigger the onAdded and onRemoved events in the extension. We explicitly
+  // don't do this for policy-related events.
+  if (event_name)
+    DispatchEvent(extension->id(), histogram_value, event_name, changed);
+}
+
+// Notify the renderers that extension policy (policy_blocked_hosts) is updated
+// and provide new set of hosts.
+void PermissionsUpdater::NotifyDefaultPolicyHostRestrictionsUpdated(
+    const URLPatternSet& default_runtime_blocked_hosts,
+    const URLPatternSet& default_runtime_allowed_hosts) {
+  DCHECK_EQ(0, init_flag_ & INIT_FLAG_TRANSIENT);
+
+  Profile* profile = Profile::FromBrowserContext(browser_context_);
+
+  ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params params;
+  params.default_policy_blocked_hosts = default_runtime_blocked_hosts;
+  params.default_policy_allowed_hosts = default_runtime_allowed_hosts;
+
+  // Send the new policy to the renderers.
+  for (RenderProcessHost::iterator host_iterator(
+           RenderProcessHost::AllHostsIterator());
+       !host_iterator.IsAtEnd(); host_iterator.Advance()) {
+    RenderProcessHost* host = host_iterator.GetCurrentValue();
+    if (profile->IsSameProfile(
+            Profile::FromBrowserContext(host->GetBrowserContext()))) {
+      host->Send(new ExtensionMsg_UpdateDefaultPolicyHostRestrictions(params));
+    }
+  }
 }
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/permissions_updater.h b/chrome/browser/extensions/permissions_updater.h
index 249c704..2b8597e7 100644
--- a/chrome/browser/extensions/permissions_updater.h
+++ b/chrome/browser/extensions/permissions_updater.h
@@ -19,6 +19,7 @@
 
 class Extension;
 class PermissionSet;
+class URLPatternSet;
 
 // Updates an Extension's active and granted permissions in persistent storage
 // and notifies interested parties of the changes.
@@ -81,6 +82,21 @@
   void RemovePermissionsUnsafe(const Extension* extension,
                                const PermissionSet& permissions);
 
+  // Sets list of hosts |extension| may not interact with (overrides default).
+  void SetPolicyHostRestrictions(const Extension* extension,
+                                 const URLPatternSet& runtime_blocked_hosts,
+                                 const URLPatternSet& runtime_allowed_hosts);
+
+  // Sets extension to use the default list of policy host restrictions.
+  void SetUsesDefaultHostRestrictions(const Extension* extension);
+
+  // Sets list of hosts extensions may not interact with. Extension specific
+  // exceptions to this default policy are defined with
+  // SetPolicyHostRestrictions.
+  void SetDefaultPolicyHostRestrictions(
+      const URLPatternSet& default_runtime_blocked_hosts,
+      const URLPatternSet& default_runtime_allowed_hosts);
+
   // Returns the set of revokable permissions.
   std::unique_ptr<const PermissionSet> GetRevokablePermissions(
       const Extension* extension) const;
@@ -98,6 +114,7 @@
   enum EventType {
     ADDED,
     REMOVED,
+    POLICY,
   };
 
   // Sets the |extension|'s active permissions to |active| and records the
@@ -123,6 +140,14 @@
                                 const Extension* extension,
                                 const PermissionSet& changed);
 
+  // Issues the relevant events, messages and notifications when the
+  // default scope management policy have changed.
+  // Specifically, this sends the ExtensionMsg_UpdateDefaultHostRestrictions
+  // IPC message.
+  void NotifyDefaultPolicyHostRestrictionsUpdated(
+      const URLPatternSet& default_runtime_blocked_hosts,
+      const URLPatternSet& default_runtime_allowed_hosts);
+
   // The associated BrowserContext.
   content::BrowserContext* browser_context_;
 
diff --git a/chrome/browser/extensions/permissions_updater_unittest.cc b/chrome/browser/extensions/permissions_updater_unittest.cc
index 67e31dfb..fd14606 100644
--- a/chrome/browser/extensions/permissions_updater_unittest.cc
+++ b/chrome/browser/extensions/permissions_updater_unittest.cc
@@ -271,6 +271,15 @@
         APIPermissionSet(), ManifestPermissionSet(), set, URLPatternSet());
   };
 
+  auto can_access_page =
+      [](scoped_refptr<const extensions::Extension> extension,
+         const GURL& document_url) -> bool {
+    PermissionsData::AccessType access =
+        extension.get()->permissions_data()->GetPageAccess(
+            extension.get(), document_url, -1, nullptr);
+    return access == PermissionsData::ACCESS_ALLOWED;
+  };
+
   {
     // Test revoking optional permissions.
     ListBuilder optional_permissions;
@@ -346,6 +355,7 @@
     // By default, all-hosts was withheld, so the extension shouldn't have
     // access to any site (like foo.com).
     const GURL kOrigin("http://foo.com");
+
     EXPECT_FALSE(extension->permissions_data()
                      ->active_permissions()
                      .HasExplicitAccessToOrigin(kOrigin));
@@ -381,6 +391,103 @@
                     .HasExplicitAccessToOrigin(kOrigin));
     EXPECT_TRUE(updater.GetRevokablePermissions(extension.get())->IsEmpty());
   }
+
+  {
+    // Make sure policy restriction updates update permission data.
+    URLPatternSet default_policy_blocked_hosts;
+    URLPatternSet default_policy_allowed_hosts;
+    URLPatternSet policy_blocked_hosts;
+    URLPatternSet policy_allowed_hosts;
+    ListBuilder optional_permissions;
+    ListBuilder required_permissions;
+    required_permissions.Append("tabs").Append("http://*/*");
+    scoped_refptr<const Extension> extension =
+        CreateExtensionWithOptionalPermissions(optional_permissions.Build(),
+                                               required_permissions.Build(),
+                                               "ExtensionSettings");
+    AddPattern(&default_policy_blocked_hosts, "http://*.google.com/*");
+    PermissionsUpdater updater(profile());
+    updater.InitializePermissions(extension.get());
+    extension->permissions_data()->SetDefaultPolicyHostRestrictions(
+        default_policy_blocked_hosts, default_policy_allowed_hosts);
+
+    // By default, all subdomains of google.com should be blocked.
+    const GURL kOrigin("http://foo.com");
+    const GURL kGoogle("http://www.google.com");
+    const GURL kExampleGoogle("http://example.google.com");
+    EXPECT_TRUE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    EXPECT_TRUE(can_access_page(extension, kOrigin));
+    EXPECT_FALSE(can_access_page(extension, kGoogle));
+    EXPECT_FALSE(can_access_page(extension, kExampleGoogle));
+
+    AddPattern(&default_policy_allowed_hosts, "http://example.google.com/*");
+    // Give the extension access to example.google.com. Now the
+    // example.google.com should not be a runtime blocked host.
+    updater.SetDefaultPolicyHostRestrictions(default_policy_blocked_hosts,
+                                             default_policy_allowed_hosts);
+
+    EXPECT_TRUE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    EXPECT_TRUE(can_access_page(extension, kOrigin));
+    EXPECT_FALSE(can_access_page(extension, kGoogle));
+    EXPECT_TRUE(can_access_page(extension, kExampleGoogle));
+
+    // Revoke extension access to foo.com. Now, foo.com should be a runtime
+    // blocked host.
+    AddPattern(&default_policy_blocked_hosts, "*://*.foo.com/");
+    updater.SetDefaultPolicyHostRestrictions(default_policy_blocked_hosts,
+                                             default_policy_allowed_hosts);
+    EXPECT_TRUE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    EXPECT_FALSE(can_access_page(extension, kOrigin));
+    EXPECT_FALSE(can_access_page(extension, kGoogle));
+    EXPECT_TRUE(can_access_page(extension, kExampleGoogle));
+
+    // Remove foo.com from blocked hosts. The extension should no longer have
+    // be a runtime blocked host.
+    default_policy_blocked_hosts.ClearPatterns();
+    AddPattern(&default_policy_blocked_hosts, "*://*.foo.com/");
+    updater.SetDefaultPolicyHostRestrictions(default_policy_blocked_hosts,
+                                             default_policy_allowed_hosts);
+    EXPECT_TRUE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    EXPECT_FALSE(can_access_page(extension, kOrigin));
+    EXPECT_TRUE(can_access_page(extension, kGoogle));
+    EXPECT_TRUE(can_access_page(extension, kExampleGoogle));
+
+    // Set an empty individual policy, should not affect default policy.
+    updater.SetPolicyHostRestrictions(extension.get(), policy_blocked_hosts,
+                                      policy_allowed_hosts);
+    EXPECT_FALSE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    EXPECT_TRUE(can_access_page(extension, kOrigin));
+    EXPECT_TRUE(can_access_page(extension, kGoogle));
+    EXPECT_TRUE(can_access_page(extension, kExampleGoogle));
+
+    // Block google.com for the Individual scope.
+    // Whitelist example.google.com for the Indiviaul scope.
+    // Leave google.com and example.google.com off both the whitelist and
+    // blacklist for Default scope.
+    AddPattern(&policy_blocked_hosts, "*://*.google.com/*");
+    AddPattern(&policy_allowed_hosts, "*://example.google.com/*");
+    updater.SetPolicyHostRestrictions(extension.get(), policy_blocked_hosts,
+                                      policy_allowed_hosts);
+    EXPECT_FALSE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    EXPECT_TRUE(can_access_page(extension, kOrigin));
+    EXPECT_FALSE(can_access_page(extension, kGoogle));
+    EXPECT_TRUE(can_access_page(extension, kExampleGoogle));
+
+    // Switch back to default scope for extension.
+    updater.SetUsesDefaultHostRestrictions(extension.get());
+    EXPECT_TRUE(
+        extension->permissions_data()->UsesDefaultPolicyHostRestrictions());
+    default_policy_blocked_hosts.ClearPatterns();
+    default_policy_allowed_hosts.ClearPatterns();
+    updater.SetDefaultPolicyHostRestrictions(default_policy_blocked_hosts,
+                                             default_policy_allowed_hosts);
+  }
 }
 
 // Test that the permissions updater delegate works - in this test it removes
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 11a0084..ab30a18 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -976,16 +976,6 @@
                   switches::kQuicConnectionOptions));
     }
 
-    if (command_line.HasSwitch(switches::kQuicHostWhitelist)) {
-      std::string whitelist =
-          command_line.GetSwitchValueASCII(switches::kQuicHostWhitelist);
-      params->quic_host_whitelist.clear();
-      for (const std::string& host : base::SplitString(
-               whitelist, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
-        params->quic_host_whitelist.insert(host);
-      }
-    }
-
     if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) {
       unsigned value;
       if (base::StringToUint(
diff --git a/chrome/browser/io_thread_unittest.cc b/chrome/browser/io_thread_unittest.cc
index 352d037..118a20c 100644
--- a/chrome/browser/io_thread_unittest.cc
+++ b/chrome/browser/io_thread_unittest.cc
@@ -275,7 +275,6 @@
   EXPECT_EQ(1350u, params_.quic_max_packet_length);
   EXPECT_EQ(net::QuicTagVector(), params_.quic_connection_options);
   EXPECT_TRUE(params_.origins_to_force_quic_on.empty());
-  EXPECT_TRUE(params_.quic_host_whitelist.empty());
   EXPECT_FALSE(params_.enable_user_alternate_protocol_ports);
   EXPECT_FALSE(params_.ignore_certificate_errors);
   EXPECT_EQ(0, params_.testing_fixed_http_port);
@@ -307,15 +306,12 @@
   base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");
 
   command_line_.AppendSwitch("disable-quic");
-  command_line_.AppendSwitchASCII("quic-host-whitelist",
-                                  "www.example.org, www.example.com");
 
   ConfigureParamsFromFieldTrialsAndCommandLine();
 
   EXPECT_FALSE(params_.enable_quic);
   EXPECT_FALSE(params_.quic_always_require_handshake_confirmation);
   EXPECT_TRUE(params_.quic_delay_tcp_race);
-  EXPECT_TRUE(params_.quic_host_whitelist.empty());
 }
 
 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
@@ -406,21 +402,6 @@
 }
 
 TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
-       QuicWhitelistFromCommandLinet) {
-  command_line_.AppendSwitch("enable-quic");
-  command_line_.AppendSwitchASCII("quic-host-whitelist",
-                                  "www.example.org, www.example.com");
-
-  ConfigureParamsFromFieldTrialsAndCommandLine();
-
-  EXPECT_EQ(2u, params_.quic_host_whitelist.size());
-  EXPECT_TRUE(
-      base::ContainsKey(params_.quic_host_whitelist, "www.example.org"));
-  EXPECT_TRUE(
-      base::ContainsKey(params_.quic_host_whitelist, "www.example.com"));
-}
-
-TEST_F(ConfigureParamsFromFieldTrialsAndCommandLineTest,
        QuicDisallowedByPolicy) {
   command_line_.AppendSwitch("enable-quic");
   is_quic_allowed_by_policy_ = false;
diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
index c458e03..f7362408 100644
--- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.cc
@@ -77,11 +77,18 @@
     AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO,
             IDS_BOOKMARK_BAR_OPEN_INCOGNITO);
   } else {
-    AddItem(IDC_BOOKMARK_BAR_OPEN_ALL, IDS_BOOKMARK_BAR_OPEN_ALL);
+    int count = chrome::OpenCount(parent_window_, selection_);
+    AddItem(IDC_BOOKMARK_BAR_OPEN_ALL,
+            l10n_util::GetPluralStringFUTF16(IDS_BOOKMARK_BAR_OPEN_ALL, count));
     AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW,
-            IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW);
+            l10n_util::GetPluralStringFUTF16(
+                IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW, count));
+
+    int incognito_count =
+        chrome::OpenCount(parent_window_, selection_, profile_);
     AddItem(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO,
-            IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO);
+            l10n_util::GetPluralStringFUTF16(
+                IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO, incognito_count));
   }
 
   AddSeparator();
@@ -120,6 +127,10 @@
   AddCheckboxItem(IDC_BOOKMARK_BAR_ALWAYS_SHOW, IDS_SHOW_BOOKMARK_BAR);
 }
 
+void BookmarkContextMenuController::AddItem(int id, const base::string16 str) {
+  menu_model_->AddItem(id, str);
+}
+
 void BookmarkContextMenuController::AddItem(int id, int localization_id) {
   menu_model_->AddItemWithStringId(id, localization_id);
 }
@@ -391,7 +402,7 @@
     case IDC_BOOKMARK_BAR_NEW_FOLDER:
     case IDC_BOOKMARK_BAR_ADD_NEW_BOOKMARK:
       return can_edit && model_->client()->CanBeEditedByUser(parent_) &&
-             bookmarks::GetParentForNewNodes(parent_, selection_, NULL) != NULL;
+             bookmarks::GetParentForNewNodes(parent_, selection_, nullptr);
 
     case IDC_BOOKMARK_BAR_ALWAYS_SHOW:
       return !prefs->IsManagedPreference(bookmarks::prefs::kShowBookmarkBar);
diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h
index 03eba597..3a021e2f 100644
--- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h
+++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h
@@ -46,7 +46,7 @@
       public ui::SimpleMenuModel::Delegate {
  public:
   // Creates the bookmark context menu.
-  // |browser| is used to open the bookmark manager and is NULL in tests.
+  // |browser| is used to open the bookmark manager and is null in tests.
   // |profile| is used for opening urls as well as enabling 'open incognito'.
   // |navigator| is used if |browser| is null, and is provided for testing.
   // |parent| is the parent for newly created nodes if |selection| is empty.
@@ -78,6 +78,8 @@
  private:
   void BuildMenu();
 
+  // Adds a IDC_* style command to the menu with a string16.
+  void AddItem(int id, const base::string16 str);
   // Adds a IDC_* style command to the menu with a localized string.
   void AddItem(int id, int localization_id);
   // Adds a separator to the menu.
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
index e80f319..d429ad7 100644
--- a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
@@ -58,91 +58,52 @@
 
 namespace chrome {
 
-int num_bookmark_urls_before_prompting = 15;
+size_t kNumBookmarkUrlsBeforePrompting = 15;
 
 namespace {
 
-// Iterator that iterates through a set of BookmarkNodes returning the URLs
-// for nodes that are urls, or the URLs for the children of non-url urls.
-// This does not recurse through all descendants, only immediate children.
-// The following illustrates
-// typical usage:
-// OpenURLIterator iterator(nodes);
-// while (iterator.has_next()) {
-//   const GURL* url = iterator.NextURL();
-//   // do something with |urll|.
-// }
-class OpenURLIterator {
- public:
-  explicit OpenURLIterator(const std::vector<const BookmarkNode*>& nodes)
-      : child_index_(0),
-        next_(NULL),
-        parent_(nodes.begin()),
-        end_(nodes.end()) {
-    FindNext();
-  }
+// Returns a vector of all URLs in |nodes| and their immediate children.  Only
+// recurses one level deep, not infinitely.  TODO(pkasting): It's not clear why
+// this shouldn't just recurse infinitely.
+std::vector<GURL> GetURLsToOpen(
+    const std::vector<const BookmarkNode*>& nodes,
+    content::BrowserContext* browser_context = nullptr,
+    bool incognito_urls_only = false) {
+  std::vector<GURL> urls;
 
-  bool has_next() { return next_ != NULL;}
+  const auto AddUrlIfLegal = [&](const GURL url) {
+    if (!incognito_urls_only || IsURLAllowedInIncognito(url, browser_context))
+      urls.push_back(url);
+  };
 
-  const GURL* NextURL() {
-    if (!has_next()) {
-      NOTREACHED();
-      return NULL;
-    }
-
-    const GURL* next = next_;
-    FindNext();
-    return next;
-  }
-
- private:
-  // Seach next node which has URL.
-  void FindNext() {
-    for (; parent_ < end_; ++parent_, child_index_ = 0) {
-      if ((*parent_)->is_url()) {
-        next_ = &(*parent_)->url();
-        ++parent_;
-        child_index_ = 0;
-        return;
-      } else {
-        for (; child_index_ < (*parent_)->child_count(); ++child_index_) {
-          const BookmarkNode* child = (*parent_)->GetChild(child_index_);
-          if (child->is_url()) {
-            next_ = &child->url();
-            ++child_index_;
-            return;
-          }
-        }
+  for (const BookmarkNode* node : nodes) {
+    if (node->is_url()) {
+      AddUrlIfLegal(node->url());
+    } else {
+      // If the node is not a URL, it is a folder. We want to add those of its
+      // children which are URLs.
+      for (int child_index = 0; child_index < node->child_count();
+           ++child_index) {
+        const BookmarkNode* child = node->GetChild(child_index);
+        if (child->is_url())
+          AddUrlIfLegal(child->url());
       }
     }
-    next_ = NULL;
   }
-
-  int child_index_;
-  const GURL* next_;
-  std::vector<const BookmarkNode*>::const_iterator parent_;
-  const std::vector<const BookmarkNode*>::const_iterator end_;
-
-  DISALLOW_COPY_AND_ASSIGN(OpenURLIterator);
-};
+  return urls;
+}
 
 #if !defined(OS_ANDROID)
 bool ShouldOpenAll(gfx::NativeWindow parent,
                    const std::vector<const BookmarkNode*>& nodes) {
-  int child_count = 0;
-  OpenURLIterator iterator(nodes);
-  while (iterator.has_next()) {
-    iterator.NextURL();
-    child_count++;
-  }
-
-  if (child_count < num_bookmark_urls_before_prompting)
+  size_t child_count = GetURLsToOpen(nodes).size();
+  if (child_count < kNumBookmarkUrlsBeforePrompting)
     return true;
 
   return ShowQuestionMessageBox(
              parent, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
              l10n_util::GetStringFUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL,
-                                        base::IntToString16(child_count))) ==
+                                        base::SizeTToString16(child_count))) ==
          MESSAGE_BOX_RESULT_YES;
 }
 #endif
@@ -185,34 +146,27 @@
 
   // Opens all |nodes| of type URL and any children of |nodes| that are of type
   // URL. |navigator| is the PageNavigator used to open URLs. After the first
-  // url is opened |opened_first_url| is set to true and |navigator| is set to
-  // the PageNavigator of the last active tab. This is done to handle a window
-  // disposition of new window, in which case we want subsequent tabs to open in
-  // that window.
-  bool opened_first_url = false;
+  // url is opened |navigator| is set to the PageNavigator of the last active
+  // tab. This is done to handle a window disposition of new window, in which
+  // case we want subsequent tabs to open in that window.
+
+  std::vector<GURL> urls = GetURLsToOpen(
+      nodes, browser_context,
+      initial_disposition == WindowOpenDisposition::OFF_THE_RECORD);
+
   WindowOpenDisposition disposition = initial_disposition;
-  OpenURLIterator iterator(nodes);
-  while (iterator.has_next()) {
-    const GURL* url = iterator.NextURL();
-    // When |initial_disposition| is OFF_THE_RECORD, a node which can't be
-    // opened in incognito window, it is detected using |browser_context|, is
-    // not opened.
-    if (initial_disposition == WindowOpenDisposition::OFF_THE_RECORD &&
-        !IsURLAllowedInIncognito(*url, browser_context))
-      continue;
-
+  for (std::vector<GURL>::const_iterator url_it = urls.begin();
+       url_it != urls.end(); ++url_it) {
     content::WebContents* opened_tab = navigator->OpenURL(
-        content::OpenURLParams(*url, content::Referrer(), disposition,
+        content::OpenURLParams(*url_it, content::Referrer(), disposition,
                                ui::PAGE_TRANSITION_AUTO_BOOKMARK, false));
-
-    if (!opened_first_url) {
-      opened_first_url = true;
-      disposition = WindowOpenDisposition::NEW_BACKGROUND_TAB;
+    if (url_it == urls.begin()) {
       // We opened the first URL which may have opened a new window or clobbered
       // the current page, reset the navigator just to be sure. |opened_tab| may
-      // be NULL in tests.
+      // be null in tests.
       if (opened_tab)
         navigator = opened_tab;
+      disposition = WindowOpenDisposition::NEW_BACKGROUND_TAB;
     }
   }
 }
@@ -224,7 +178,24 @@
              content::BrowserContext* browser_context) {
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(node);
-  OpenAll(parent, navigator, nodes, initial_disposition, browser_context);
+  OpenAll(parent, navigator, std::vector<const bookmarks::BookmarkNode*>{node},
+          initial_disposition, browser_context);
+}
+
+int OpenCount(gfx::NativeWindow parent,
+              const std::vector<const bookmarks::BookmarkNode*>& nodes,
+              content::BrowserContext* incognito_context) {
+  return GetURLsToOpen(nodes, incognito_context, incognito_context != nullptr)
+      .size();
+}
+
+int OpenCount(gfx::NativeWindow parent,
+              const BookmarkNode* node,
+              content::BrowserContext* incognito_context) {
+  std::vector<const BookmarkNode*> nodes;
+  nodes.push_back(node);
+  return OpenCount(parent, std::vector<const bookmarks::BookmarkNode*>{node},
+                   incognito_context);
 }
 
 bool ConfirmDeleteBookmarkNode(const BookmarkNode* node,
@@ -254,20 +225,13 @@
 }
 
 bool HasBookmarkURLs(const std::vector<const BookmarkNode*>& selection) {
-  OpenURLIterator iterator(selection);
-  return iterator.has_next();
+  return !GetURLsToOpen(selection).empty();
 }
 
 bool HasBookmarkURLsAllowedInIncognitoMode(
     const std::vector<const BookmarkNode*>& selection,
     content::BrowserContext* browser_context) {
-  OpenURLIterator iterator(selection);
-  while (iterator.has_next()) {
-    const GURL* url = iterator.NextURL();
-    if (IsURLAllowedInIncognito(*url, browser_context))
-      return true;
-  }
-  return false;
+  return !GetURLsToOpen(selection, browser_context, true).empty();
 }
 #endif  // !defined(OS_ANDROID)
 
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.h b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.h
index 062817b..2e5e7ec 100644
--- a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.h
+++ b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.h
@@ -28,7 +28,7 @@
 //
 // NOTE: treat this as a const. It is not const so unit tests can change the
 // value.
-extern int num_bookmark_urls_before_prompting;
+extern size_t kNumBookmarkUrlsBeforePrompting;
 
 // Opens all the bookmarks in |nodes| that are of type url and all the child
 // bookmarks that are of type url for folders in |nodes|. |initial_disposition|
@@ -47,6 +47,18 @@
              WindowOpenDisposition initial_disposition,
              content::BrowserContext* browser_context);
 
+// Returns the count of bookmarks that would be opened by OpenAll. If
+// |incognito_context| is set, the function will use it to check if the URLs can
+// be opened in incognito mode, which may affect the count.
+int OpenCount(gfx::NativeWindow parent,
+              const std::vector<const bookmarks::BookmarkNode*>& nodes,
+              content::BrowserContext* incognito_context = nullptr);
+
+// Convenience for OpenCount() with a single BookmarkNode.
+int OpenCount(gfx::NativeWindow parent,
+              const bookmarks::BookmarkNode* node,
+              content::BrowserContext* incognito_context = nullptr);
+
 // Asks the user before deleting a non-empty bookmark folder.
 bool ConfirmDeleteBookmarkNode(const bookmarks::BookmarkNode* node,
                                gfx::NativeWindow window);
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
index 38db688..8778882 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
@@ -12,6 +12,7 @@
 #include "chrome/browser/prefs/incognito_mode_prefs.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h"
 #include "chrome/browser/ui/browser_list.h"
 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
@@ -202,7 +203,7 @@
 
 BookmarkModel* BookmarkMenuBridge::GetBookmarkModel() {
   if (!profile_)
-    return NULL;
+    return nullptr;
   return BookmarkModelFactory::GetForBrowserContext(profile_);
 }
 
@@ -312,7 +313,11 @@
                                        const BookmarkNode* node,
                                        NSMenu* menu,
                                        bool enabled) {
-  NSString* title = l10n_util::GetNSStringWithFixup(message_id);
+  int count = (message_id == IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO)
+                  ? chrome::OpenCount(nullptr, node, profile_)
+                  : chrome::OpenCount(nullptr, node);
+
+  NSString* title = l10n_util::GetPluralNSStringF(message_id, count);
   SEL action;
   if (!enabled) {
     // A nil action makes a menu item appear disabled. NSMenuItem setEnabled
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm
index b17c02e..23562e7 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm
@@ -81,7 +81,8 @@
   }
 
   NSMenuItem* AddTestMenuItem(NSMenu *menu, NSString *title, SEL selector) {
-    NSMenuItem *item = [[[NSMenuItem alloc] initWithTitle:title action:NULL
+    NSMenuItem* item = [[[NSMenuItem alloc] initWithTitle:title
+                                                   action:nullptr
                                             keyEquivalent:@""] autorelease];
     if (selector)
       [item setAction:selector];
@@ -182,7 +183,7 @@
 
   // 3 nodes; middle one has a child, last one has a HUGE URL
   // Set their titles to be the same as the URLs
-  const BookmarkNode* node = NULL;
+  const BookmarkNode* node = nullptr;
   model->AddURL(root, 0, ASCIIToUTF16(short_url), GURL(short_url));
   bridge_->UpdateMenu(menu);
   int prev_count = [menu numberOfItems] - 1; // "extras" added at this point
@@ -260,19 +261,20 @@
                 IDS_BOOKMARK_BAR_OPEN_INCOGNITO, root, menu, true);
   EXPECT_EQ(3, [menu numberOfItems]);
 
-  title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BAR_OPEN_ALL);
+  title = l10n_util::GetPluralNSStringF(IDS_BOOKMARK_BAR_OPEN_ALL, 0);
   item = [menu itemWithTitle:title];
   EXPECT_TRUE(item);
   EXPECT_EQ(@selector(openAllBookmarks:), [item action]);
   EXPECT_TRUE([item isEnabled]);
 
-  title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW);
+  title =
+      l10n_util::GetPluralNSStringF(IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW, 0);
   item = [menu itemWithTitle:title];
   EXPECT_TRUE(item);
   EXPECT_EQ(@selector(openAllBookmarksNewWindow:), [item action]);
   EXPECT_TRUE([item isEnabled]);
 
-  title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BAR_OPEN_INCOGNITO);
+  title = l10n_util::GetPluralNSStringF(IDS_BOOKMARK_BAR_OPEN_INCOGNITO, 0);
   item = [menu itemWithTitle:title];
   EXPECT_TRUE(item);
   EXPECT_EQ(@selector(openAllBookmarksIncognitoWindow:), [item action]);
@@ -289,19 +291,20 @@
                 IDS_BOOKMARK_BAR_OPEN_INCOGNITO, root, menu, false);
   EXPECT_EQ(3, [menu numberOfItems]);
 
-  title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BAR_OPEN_ALL);
+  title = l10n_util::GetPluralNSStringF(IDS_BOOKMARK_BAR_OPEN_ALL, 0);
   item = [menu itemWithTitle:title];
   EXPECT_TRUE(item);
   EXPECT_EQ(nil, [item action]);
   EXPECT_FALSE([item isEnabled]);
 
-  title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW);
+  title =
+      l10n_util::GetPluralNSStringF(IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW, 0);
   item = [menu itemWithTitle:title];
   EXPECT_TRUE(item);
   EXPECT_EQ(nil, [item action]);
   EXPECT_FALSE([item isEnabled]);
 
-  title = l10n_util::GetNSStringWithFixup(IDS_BOOKMARK_BAR_OPEN_INCOGNITO);
+  title = l10n_util::GetPluralNSStringF(IDS_BOOKMARK_BAR_OPEN_INCOGNITO, 0);
   item = [menu itemWithTitle:title];
   EXPECT_TRUE(item);
   EXPECT_EQ(nil, [item action]);
@@ -337,7 +340,7 @@
 
   const BookmarkNode empty_node(GURL("http://no-where/"));
   EXPECT_FALSE(MenuItemForNode(bridge_.get(), &empty_node));
-  EXPECT_FALSE(MenuItemForNode(bridge_.get(), NULL));
+  EXPECT_FALSE(MenuItemForNode(bridge_.get(), nullptr));
 }
 
 // Test that Loaded() adds both the bookmark bar nodes and the "other" nodes.
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
index 22868be0..5b201c2d 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm
@@ -120,7 +120,7 @@
   if (!node || !browser)
     return; // shouldn't be reached
 
-  chrome::OpenAll(NULL, browser, node, disposition, browser->profile());
+  chrome::OpenAll(nullptr, browser, node, disposition, browser->profile());
 
   if (disposition == WindowOpenDisposition::NEW_FOREGROUND_TAB) {
     base::RecordAction(UserMetricsAction("OpenAllBookmarks"));
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk2.cc b/chrome/browser/ui/libgtkui/native_theme_gtk2.cc
index c1a1621..af67e834 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk2.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk2.cc
@@ -156,15 +156,9 @@
     case kColorId_MenuItemSubtitleColor:
     case kColorId_DisabledMenuItemForegroundColor:
       return GetTextColor(GetMenuItem(), INSENSITIVE);
-    case kColorId_FocusedMenuButtonBorderColor:
-      return GetBgColor(GetEntry(), NORMAL);
-    case kColorId_HoverMenuButtonBorderColor:
-      return GetTextAAColor(GetEntry(), PRELIGHT);
     case kColorId_MenuBorderColor:
-    case kColorId_EnabledMenuButtonBorderColor:
-    case kColorId_MenuSeparatorColor: {
+    case kColorId_MenuSeparatorColor:
       return GetTextColor(GetMenuItem(), INSENSITIVE);
-    }
     case kColorId_MenuBackgroundColor:
       return GetBgColor(GetMenu(), NORMAL);
 
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
index 38db84c..e7cf499f 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
@@ -14,6 +14,7 @@
 #include "ui/gfx/color_utils.h"
 #include "ui/gfx/geometry/rect.h"
 #include "ui/gfx/skbitmap_operations.h"
+#include "ui/gfx/skia_util.h"
 #include "ui/native_theme/native_theme_dark_aura.h"
 
 namespace libgtkui {
@@ -110,10 +111,6 @@
       return GetFgColor(
           "GtkMenu#menu GtkMenuItem#menuitem GtkLabel.accelerator");
     case ui::NativeTheme::kColorId_MenuSeparatorColor:
-    // MenuButton borders are used as vertical menu separators in Chrome.
-    case ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor:
-    case ui::NativeTheme::kColorId_FocusedMenuButtonBorderColor:
-    case ui::NativeTheme::kColorId_HoverMenuButtonBorderColor:
       if (GtkVersionCheck(3, 20)) {
         return GetSeparatorColor(
             "GtkMenu#menu GtkSeparator#separator.horizontal");
@@ -520,6 +517,17 @@
     State state,
     const gfx::Rect& rect,
     const MenuSeparatorExtraParams& menu_separator) const {
+  // TODO(estade): use GTK to draw vertical separators too. See
+  // crbug.com/710183
+  if (menu_separator.type == ui::VERTICAL_SEPARATOR) {
+    cc::PaintFlags paint;
+    paint.setStyle(cc::PaintFlags::kFill_Style);
+    paint.setColor(
+        GetSystemColor(ui::NativeTheme::kColorId_MenuSeparatorColor));
+    canvas->drawRect(gfx::RectToSkRect(rect), paint);
+    return;
+  }
+
   auto separator_offset = [&](int separator_thickness) {
     switch (menu_separator.type) {
       case ui::LOWER_SEPARATOR:
diff --git a/chrome/browser/ui/toolbar/OWNERS b/chrome/browser/ui/toolbar/OWNERS
index f81f7fdb..d1e4ee4 100644
--- a/chrome/browser/ui/toolbar/OWNERS
+++ b/chrome/browser/ui/toolbar/OWNERS
@@ -3,3 +3,6 @@
 per-file browser_actions_bar_browsertest*=rdevlin.cronin@chromium.org
 per-file *toolbar_action*=finnur@chromium.org
 per-file *toolbar_action*=rdevlin.cronin@chromium.org
+
+# Media Router Action Files
+per-file *media_router*=file://chrome/browser/media/router/OWNERS
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index 6f2584e..05238eb7 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -1310,11 +1310,11 @@
     ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT,
         ui_controls::DOWN | ui_controls::UP,
         CreateEventTask(this, &BookmarkBarViewTest12::Step2));
-    chrome::num_bookmark_urls_before_prompting = 1;
+    chrome::kNumBookmarkUrlsBeforePrompting = 1;
   }
 
   ~BookmarkBarViewTest12() override {
-    chrome::num_bookmark_urls_before_prompting = 15;
+    chrome::kNumBookmarkUrlsBeforePrompting = 15;
   }
 
  private:
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc
index 1fa8186..6fa5774 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc
@@ -54,7 +54,7 @@
  public:
   WebContents* OpenURL(const OpenURLParams& params) override {
     urls_.push_back(params.url);
-    return NULL;
+    return nullptr;
   }
 
   std::vector<GURL> urls_;
@@ -120,8 +120,8 @@
 TEST_F(BookmarkContextMenuTest, DeleteURL) {
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(0));
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0]->parent(), nodes, false);
   GURL url = model_->bookmark_bar_node()->GetChild(0)->url();
   ASSERT_TRUE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_REMOVE));
   // Delete the URL.
@@ -133,8 +133,8 @@
 // Tests open all on a folder with a couple of bookmarks.
 TEST_F(BookmarkContextMenuTest, OpenAll) {
   const BookmarkNode* folder = model_->bookmark_bar_node()->GetChild(1);
-  chrome::OpenAll(NULL, &navigator_, folder,
-                  WindowOpenDisposition::NEW_FOREGROUND_TAB, NULL);
+  chrome::OpenAll(nullptr, &navigator_, folder,
+                  WindowOpenDisposition::NEW_FOREGROUND_TAB, nullptr);
 
   // Should have navigated to F1's child but not F11's child.
   ASSERT_EQ(static_cast<size_t>(2), navigator_.urls_.size());
@@ -144,7 +144,7 @@
 // Tests open all on a folder with a couple of bookmarks in incognito window.
 TEST_F(BookmarkContextMenuTest, OpenAllIncognito) {
   const BookmarkNode* folder = model_->bookmark_bar_node()->GetChild(1);
-  chrome::OpenAll(NULL, &navigator_, folder,
+  chrome::OpenAll(nullptr, &navigator_, folder,
                   WindowOpenDisposition::OFF_THE_RECORD, profile_.get());
 
   // Should have navigated to only f1a but not f2a.
@@ -152,11 +152,29 @@
   ASSERT_TRUE(folder->GetChild(0)->url() == navigator_.urls_[0]);
 }
 
+// Tests counting tabs for 'open all' on a folder with a couple of bookmarks.
+TEST_F(BookmarkContextMenuTest, OpenCount) {
+  const BookmarkNode* folder = model_->bookmark_bar_node()->GetChild(1);
+
+  // Should count F1's child but not F11's child, as that's what OpenAll would
+  // open.
+  EXPECT_EQ(2, chrome::OpenCount(nullptr, folder));
+}
+
+// Same as above, but for counting bookmarks that would be opened in an
+// incognito window.
+TEST_F(BookmarkContextMenuTest, OpenCountIncognito) {
+  const BookmarkNode* folder = model_->bookmark_bar_node()->GetChild(1);
+
+  // Should count f1a but not f2a, as that's what OpenAll would open.
+  EXPECT_EQ(1, chrome::OpenCount(nullptr, folder, profile_.get()));
+}
+
 // Tests the enabled state of the menus when supplied an empty vector.
 TEST_F(BookmarkContextMenuTest, EmptyNodes) {
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, model_->other_node(),
-      std::vector<const BookmarkNode*>(), false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 model_->other_node(),
+                                 std::vector<const BookmarkNode*>(), false);
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_FALSE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -174,8 +192,8 @@
 TEST_F(BookmarkContextMenuTest, SingleURL) {
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(0));
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0]->parent(), nodes, false);
   EXPECT_TRUE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_TRUE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -193,8 +211,8 @@
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(0));
   nodes.push_back(model_->bookmark_bar_node()->GetChild(1)->GetChild(0));
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0]->parent(), nodes, false);
   EXPECT_TRUE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_TRUE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -211,8 +229,8 @@
 TEST_F(BookmarkContextMenuTest, SingleFolder) {
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(2));
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0]->parent(), nodes, false);
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_FALSE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -231,8 +249,8 @@
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(2));
   nodes.push_back(model_->bookmark_bar_node()->GetChild(3));
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0]->parent(), nodes, false);
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_FALSE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -251,8 +269,8 @@
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(3));
   nodes.push_back(model_->bookmark_bar_node()->GetChild(4));
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0]->parent(), nodes, false);
   EXPECT_TRUE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_TRUE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -269,8 +287,8 @@
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->bookmark_bar_node()->GetChild(0));
   Profile* incognito = profile_->GetOffTheRecordProfile();
-  BookmarkContextMenu controller(
-      NULL, NULL, incognito, NULL, nodes[0]->parent(), nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, incognito, nullptr,
+                                 nodes[0]->parent(), nodes, false);
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_INCOGNITO));
   EXPECT_FALSE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO));
@@ -280,8 +298,8 @@
 TEST_F(BookmarkContextMenuTest, DisabledItemsWithOtherNode) {
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(model_->other_node());
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, nodes[0], nodes, false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nodes[0], nodes, false);
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_EDIT));
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_REMOVE));
 }
@@ -289,9 +307,9 @@
 // Tests the enabled state of the menus when supplied an empty vector and null
 // parent.
 TEST_F(BookmarkContextMenuTest, EmptyNodesNullParent) {
-  BookmarkContextMenu controller(
-      NULL, NULL, profile_.get(), NULL, NULL,
-      std::vector<const BookmarkNode*>(), false);
+  BookmarkContextMenu controller(nullptr, nullptr, profile_.get(), nullptr,
+                                 nullptr, std::vector<const BookmarkNode*>(),
+                                 false);
   EXPECT_FALSE(controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL));
   EXPECT_FALSE(
       controller.IsCommandEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
@@ -308,16 +326,18 @@
   const BookmarkNode* bb_node = model_->bookmark_bar_node();
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(bb_node->GetChild(0));
-  std::unique_ptr<BookmarkContextMenu> controller(new BookmarkContextMenu(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false));
+  std::unique_ptr<BookmarkContextMenu> controller(
+      new BookmarkContextMenu(nullptr, nullptr, profile_.get(), nullptr,
+                              nodes[0]->parent(), nodes, false));
   EXPECT_TRUE(controller->IsCommandEnabled(IDC_COPY));
   EXPECT_TRUE(controller->IsCommandEnabled(IDC_CUT));
 
   // Copy the URL.
   controller->ExecuteCommand(IDC_COPY, 0);
 
-  controller.reset(new BookmarkContextMenu(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false));
+  controller.reset(new BookmarkContextMenu(nullptr, nullptr, profile_.get(),
+                                           nullptr, nodes[0]->parent(), nodes,
+                                           false));
   int old_count = bb_node->child_count();
   controller->ExecuteCommand(IDC_PASTE, 0);
 
@@ -325,8 +345,9 @@
   ASSERT_EQ(old_count + 1, bb_node->child_count());
   ASSERT_EQ(bb_node->GetChild(0)->url(), bb_node->GetChild(1)->url());
 
-  controller.reset(new BookmarkContextMenu(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false));
+  controller.reset(new BookmarkContextMenu(nullptr, nullptr, profile_.get(),
+                                           nullptr, nodes[0]->parent(), nodes,
+                                           false));
   // Cut the URL.
   controller->ExecuteCommand(IDC_CUT, 0);
   ASSERT_TRUE(bb_node->GetChild(0)->is_url());
@@ -341,8 +362,9 @@
   const BookmarkNode* bb_node = model_->bookmark_bar_node();
   std::vector<const BookmarkNode*> nodes;
   nodes.push_back(bb_node->GetChild(0));
-  std::unique_ptr<BookmarkContextMenu> controller(new BookmarkContextMenu(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false));
+  std::unique_ptr<BookmarkContextMenu> controller(
+      new BookmarkContextMenu(nullptr, nullptr, profile_.get(), nullptr,
+                              nodes[0]->parent(), nodes, false));
 
   // Verify that there are no managed nodes yet.
   bookmarks::ManagedBookmarkService* managed =
@@ -371,8 +393,9 @@
   EXPECT_FALSE(managed->managed_node()->empty());
 
   // New context menus now show the "Show managed bookmarks" option.
-  controller.reset(new BookmarkContextMenu(
-      NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false));
+  controller.reset(new BookmarkContextMenu(nullptr, nullptr, profile_.get(),
+                                           nullptr, nodes[0]->parent(), nodes,
+                                           false));
   EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER));
   EXPECT_TRUE(
       controller->IsCommandVisible(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS));
diff --git a/chrome/browser/ui/views/toolbar/app_menu.cc b/chrome/browser/ui/views/toolbar/app_menu.cc
index 0309da71..9b6ffe26 100644
--- a/chrome/browser/ui/views/toolbar/app_menu.cc
+++ b/chrome/browser/ui/views/toolbar/app_menu.cc
@@ -154,8 +154,6 @@
   // Overridden from views::Background.
   void Paint(gfx::Canvas* canvas, View* view) const override {
     CustomButton* button = CustomButton::AsCustomButton(view);
-    views::Button::ButtonState state =
-        button ? button->state() : views::Button::STATE_NORMAL;
     int h = view->height();
 
     // Draw leading border if desired.
@@ -165,32 +163,26 @@
       // already, so we end up flipping exactly once.
       gfx::ScopedRTLFlipCanvas scoped_canvas(
           canvas, view->width(), !view->flip_canvas_on_paint_for_rtl_ui());
-      canvas->FillRect(gfx::Rect(0, 0, 1, h),
-                       BorderColor(view, views::Button::STATE_NORMAL));
-      bounds.Inset(gfx::Insets(0, 1, 0, 0));
+      ui::NativeTheme::ExtraParams params;
+      gfx::Rect separator_bounds =
+          gfx::Rect(0, 0, MenuConfig::instance().separator_thickness, h);
+      params.menu_separator.paint_rect = &separator_bounds;
+      params.menu_separator.type = ui::VERTICAL_SEPARATOR;
+      view->GetNativeTheme()->Paint(
+          canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator,
+          ui::NativeTheme::kNormal, separator_bounds, params);
+      bounds.Inset(
+          gfx::Insets(0, MenuConfig::instance().separator_thickness, 0, 0));
     }
 
     // Fill in background for state.
     bounds.set_x(view->GetMirroredXForRect(bounds));
+    views::Button::ButtonState state =
+        button ? button->state() : views::Button::STATE_NORMAL;
     DrawBackground(canvas, view, bounds, state);
   }
 
  private:
-  static SkColor BorderColor(View* view, views::Button::ButtonState state) {
-    ui::NativeTheme* theme = view->GetNativeTheme();
-    switch (state) {
-      case views::Button::STATE_HOVERED:
-        return theme->GetSystemColor(
-            ui::NativeTheme::kColorId_HoverMenuButtonBorderColor);
-      case views::Button::STATE_PRESSED:
-        return theme->GetSystemColor(
-            ui::NativeTheme::kColorId_FocusedMenuButtonBorderColor);
-      default:
-        return theme->GetSystemColor(
-            ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor);
-    }
-  }
-
   static SkColor BackgroundColor(const View* view,
                                  views::Button::ButtonState state) {
     const ui::NativeTheme* theme = view->GetNativeTheme();
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
index bfd56ed..7bfb4be 100644
--- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -254,12 +254,37 @@
 void EncryptionMigrationScreenHandler::StartMigration() {
   UpdateUIState(UIState::MIGRATING);
 
+  // Mount the existing eCryptfs vault to a temporary location for migration.
+  cryptohome::MountParameters mount(false);
+  mount.to_migrate_from_ecryptfs = true;
+  cryptohome::HomedirMethods::GetInstance()->MountEx(
+      cryptohome::Identification(user_context_.GetAccountId()),
+      cryptohome::Authorization(GetAuthKey()), mount,
+      base::Bind(&EncryptionMigrationScreenHandler::OnMountExistingVault,
+                 weak_ptr_factory_.GetWeakPtr()));
+}
+
+void EncryptionMigrationScreenHandler::OnMountExistingVault(
+    bool success,
+    cryptohome::MountError return_code,
+    const std::string& mount_hash) {
+  if (!success || return_code != cryptohome::MOUNT_ERROR_NONE) {
+    UpdateUIState(UIState::MIGRATION_FAILED);
+    return;
+  }
+
   DBusThreadManager::Get()
       ->GetCryptohomeClient()
       ->SetDircryptoMigrationProgressHandler(
           base::Bind(&EncryptionMigrationScreenHandler::OnMigrationProgress,
                      weak_ptr_factory_.GetWeakPtr()));
+  cryptohome::HomedirMethods::GetInstance()->MigrateToDircrypto(
+      cryptohome::Identification(user_context_.GetAccountId()),
+      base::Bind(&EncryptionMigrationScreenHandler::OnMigrationRequested,
+                 weak_ptr_factory_.GetWeakPtr()));
+}
 
+cryptohome::KeyDefinition EncryptionMigrationScreenHandler::GetAuthKey() {
   // |auth_key| is created in the same manner as CryptohomeAuthenticator.
   const Key* key = user_context_.GetKey();
   // If the |key| is a plain text password, crash rather than attempting to
@@ -270,13 +295,8 @@
   // Chrome OS M38 and older will have a legacy key with no label while those
   // created by Chrome OS M39 and newer will have a key with the label
   // kCryptohomeGAIAKeyLabel.
-  const cryptohome::KeyDefinition auth_key(key->GetSecret(), std::string(),
-                                           cryptohome::PRIV_DEFAULT);
-  cryptohome::HomedirMethods::GetInstance()->MigrateToDircrypto(
-      cryptohome::Identification(user_context_.GetAccountId()),
-      cryptohome::Authorization(auth_key),
-      base::Bind(&EncryptionMigrationScreenHandler::OnMigrationRequested,
-                 weak_ptr_factory_.GetWeakPtr()));
+  return cryptohome::KeyDefinition(key->GetSecret(), std::string(),
+                                   cryptohome::PRIV_DEFAULT);
 }
 
 void EncryptionMigrationScreenHandler::OnMigrationProgress(
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
index de278cd6..f5b5a212 100644
--- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
@@ -8,6 +8,7 @@
 #include "base/macros.h"
 #include "chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h"
 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
+#include "chromeos/cryptohome/cryptohome_parameters.h"
 #include "chromeos/dbus/power_manager_client.h"
 #include "chromeos/login/auth/user_context.h"
 #include "third_party/cros_system_api/dbus/cryptohome/dbus-constants.h"
@@ -61,11 +62,15 @@
   // Updates UI state.
   void UpdateUIState(UIState state);
 
-  // Requests cryptohome to start encryption migration.
   void CheckAvailableStorage();
   void OnGetAvailableStorage(int64_t size);
   void WaitBatteryAndMigrate();
   void StartMigration();
+  void OnMountExistingVault(bool success,
+                            cryptohome::MountError return_code,
+                            const std::string& mount_hash);
+  // Creates authorization key for MountEx method using |user_context_|.
+  cryptohome::KeyDefinition GetAuthKey();
 
   // Handlers for cryptohome API callbacks.
   void OnMigrationProgress(cryptohome::DircryptoMigrationStatus status,
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 0ef0201..3bf58d9 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -736,9 +736,6 @@
 // the server.
 const char kQuicConnectionOptions[] = "quic-connection-options";
 
-// Specifies a comma separated list of hosts to whitelist QUIC for.
-const char kQuicHostWhitelist[] = "quic-host-whitelist";
-
 // Specifies the maximum length for a QUIC packet.
 const char kQuicMaxPacketLength[] = "quic-max-packet-length";
 
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 2a94775..4f08189a 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -209,7 +209,6 @@
 extern const char kProxyPacUrl[];
 extern const char kProxyServer[];
 extern const char kQuicConnectionOptions[];
-extern const char kQuicHostWhitelist[];
 extern const char kQuicMaxPacketLength[];
 extern const char kQuicVersion[];
 extern const char kRemoteDebuggingTargets[];
diff --git a/chrome/common/extensions/permissions/permissions_data_unittest.cc b/chrome/common/extensions/permissions/permissions_data_unittest.cc
index 5147af4..c86741d 100644
--- a/chrome/common/extensions/permissions/permissions_data_unittest.cc
+++ b/chrome/common/extensions/permissions/permissions_data_unittest.cc
@@ -15,6 +15,7 @@
 #include "chrome/common/extensions/extension_test_util.h"
 #include "components/crx_file/id_util.h"
 #include "content/public/common/socket_permission_request.h"
+#include "extensions/common/constants.h"
 #include "extensions/common/error_utils.h"
 #include "extensions/common/extension.h"
 #include "extensions/common/extension_builder.h"
@@ -224,11 +225,13 @@
   extension->permissions_data()->UpdateTabSpecificPermissions(
       1, PermissionSet(APIPermissionSet(), ManifestPermissionSet(), new_hosts,
                        URLPatternSet()));
-  EXPECT_TRUE(extension->permissions_data()->GetEffectiveHostPermissions().
-      MatchesURL(tab_url));
+  EXPECT_TRUE(
+      extension->permissions_data()->GetEffectiveHostPermissions().MatchesURL(
+          tab_url));
   extension->permissions_data()->ClearTabSpecificPermissions(1);
-  EXPECT_FALSE(extension->permissions_data()->GetEffectiveHostPermissions().
-      MatchesURL(tab_url));
+  EXPECT_FALSE(
+      extension->permissions_data()->GetEffectiveHostPermissions().MatchesURL(
+          tab_url));
 }
 
 TEST(PermissionsDataTest, SocketPermissions) {
@@ -236,8 +239,8 @@
   std::string error;
 
   extension = LoadManifest("socket_permissions", "empty.json");
-  EXPECT_FALSE(CheckSocketPermission(extension,
-      SocketPermissionRequest::TCP_CONNECT, "www.example.com", 80));
+  EXPECT_FALSE(CheckSocketPermission(
+      extension, SocketPermissionRequest::TCP_CONNECT, "www.example.com", 80));
 
   extension = LoadManifestUnchecked("socket_permissions",
                                     "socket1.json",
@@ -251,19 +254,18 @@
   EXPECT_EQ(expected_error_msg_header, error);
 
   extension = LoadManifest("socket_permissions", "socket2.json");
-  EXPECT_TRUE(CheckSocketPermission(extension,
-      SocketPermissionRequest::TCP_CONNECT, "www.example.com", 80));
-  EXPECT_FALSE(CheckSocketPermission(
-        extension, SocketPermissionRequest::UDP_BIND, "", 80));
   EXPECT_TRUE(CheckSocketPermission(
-        extension, SocketPermissionRequest::UDP_BIND, "", 8888));
+      extension, SocketPermissionRequest::TCP_CONNECT, "www.example.com", 80));
+  EXPECT_FALSE(CheckSocketPermission(
+      extension, SocketPermissionRequest::UDP_BIND, "", 80));
+  EXPECT_TRUE(CheckSocketPermission(
+      extension, SocketPermissionRequest::UDP_BIND, "", 8888));
 
   EXPECT_FALSE(CheckSocketPermission(
-        extension, SocketPermissionRequest::UDP_SEND_TO, "example.com", 1900));
-  EXPECT_TRUE(CheckSocketPermission(
-        extension,
-        SocketPermissionRequest::UDP_SEND_TO,
-        "239.255.255.250", 1900));
+      extension, SocketPermissionRequest::UDP_SEND_TO, "example.com", 1900));
+  EXPECT_TRUE(CheckSocketPermission(extension,
+                                    SocketPermissionRequest::UDP_SEND_TO,
+                                    "239.255.255.250", 1900));
 }
 
 TEST(PermissionsDataTest, IsRestrictedUrl) {
@@ -381,6 +383,9 @@
       : http_url("http://www.google.com"),
         http_url_with_path("http://www.google.com/index.html"),
         https_url("https://www.google.com"),
+        example_com("https://example.com"),
+        test_example_com("https://test.example.com"),
+        sample_example_com("https://sample.example.com"),
         file_url("file:///foo/bar"),
         favicon_url("chrome://favicon/http://www.google.com"),
         extension_url("chrome-extension://" +
@@ -391,6 +396,9 @@
     urls_.insert(http_url);
     urls_.insert(http_url_with_path);
     urls_.insert(https_url);
+    urls_.insert(example_com);
+    urls_.insert(test_example_com);
+    urls_.insert(sample_example_com);
     urls_.insert(file_url);
     urls_.insert(favicon_url);
     urls_.insert(extension_url);
@@ -476,6 +484,9 @@
   const GURL http_url;
   const GURL http_url_with_path;
   const GURL https_url;
+  const GURL example_com;
+  const GURL test_example_com;
+  const GURL sample_example_com;
   const GURL file_url;
 
   // We should allow host permission but not scripting permission for favicon
@@ -592,8 +603,8 @@
   scoped_refptr<Extension> extension;
 
   // Test <all_urls> for regular extensions.
-  extension = LoadManifestStrict("script_and_capture",
-      "extension_regular_all.json");
+  extension =
+      LoadManifestStrict("script_and_capture", "extension_regular_all.json");
   EXPECT_TRUE(Allowed(extension.get(), http_url));
   EXPECT_TRUE(Allowed(extension.get(), https_url));
   EXPECT_TRUE(CaptureOnly(extension.get(), file_url));
@@ -616,8 +627,8 @@
   EXPECT_TRUE(permissions_data->HasHostPermission(favicon_url));
 
   // Test * for scheme, which implies just the http/https schemes.
-  extension = LoadManifestStrict("script_and_capture",
-      "extension_wildcard.json");
+  extension =
+      LoadManifestStrict("script_and_capture", "extension_wildcard.json");
   EXPECT_TRUE(ScriptOnly(extension.get(), http_url));
   EXPECT_TRUE(ScriptOnly(extension.get(), https_url));
   EXPECT_TRUE(Blocked(extension.get(), settings_url));
@@ -645,21 +656,21 @@
 
   // Having chrome://favicon/* should not give you chrome://*
   extension = LoadManifestStrict("script_and_capture",
-      "extension_chrome_favicon_wildcard.json");
+                                 "extension_chrome_favicon_wildcard.json");
   EXPECT_TRUE(Blocked(extension.get(), settings_url));
   EXPECT_TRUE(ScriptOnly(extension.get(), favicon_url));
   EXPECT_TRUE(Blocked(extension.get(), about_url));
   EXPECT_TRUE(extension->permissions_data()->HasHostPermission(favicon_url));
 
   // Having http://favicon should not give you chrome://favicon
-  extension = LoadManifestStrict("script_and_capture",
-      "extension_http_favicon.json");
+  extension =
+      LoadManifestStrict("script_and_capture", "extension_http_favicon.json");
   EXPECT_TRUE(Blocked(extension.get(), settings_url));
   EXPECT_TRUE(Blocked(extension.get(), favicon_url));
 
   // Component extensions with <all_urls> should get everything.
   extension = LoadManifest("script_and_capture", "extension_component_all.json",
-      Manifest::COMPONENT, Extension::NO_FLAGS);
+                           Manifest::COMPONENT, Extension::NO_FLAGS);
   EXPECT_TRUE(Allowed(extension.get(), http_url));
   EXPECT_TRUE(Allowed(extension.get(), https_url));
   EXPECT_TRUE(Allowed(extension.get(), settings_url));
@@ -668,9 +679,9 @@
   EXPECT_TRUE(extension->permissions_data()->HasHostPermission(favicon_url));
 
   // Component extensions should only get access to what they ask for.
-  extension = LoadManifest("script_and_capture",
-      "extension_component_google.json", Manifest::COMPONENT,
-      Extension::NO_FLAGS);
+  extension =
+      LoadManifest("script_and_capture", "extension_component_google.json",
+                   Manifest::COMPONENT, Extension::NO_FLAGS);
   EXPECT_TRUE(ScriptOnly(extension.get(), http_url));
   EXPECT_TRUE(Blocked(extension.get(), https_url));
   EXPECT_TRUE(Blocked(extension.get(), file_url));
@@ -832,4 +843,164 @@
   }
 }
 
+TEST_F(ExtensionScriptAndCaptureVisibleTest, PolicyHostRestrictionsSwap) {
+  // Makes sure when an extension gets an individual policy for host
+  // restrictions it overrides the default policy. Also tests transitioning back
+  // to the default policy when an individual policy is removed.
+  URLPattern example_com_pattern =
+      URLPattern(URLPattern::SCHEME_ALL, "*://*.example.com/*");
+  URLPattern test_example_com_pattern =
+      URLPattern(URLPattern::SCHEME_ALL, "*://test.example.com/*");
+  URLPatternSet default_blocked;
+  URLPatternSet default_allowed;
+  default_blocked.AddPattern(example_com_pattern);
+  default_allowed.AddPattern(test_example_com_pattern);
+
+  // Test <all_urls> for regular extensions.
+  scoped_refptr<Extension> extension =
+      LoadManifestStrict("script_and_capture", "extension_regular_all.json");
+  extension->permissions_data()->SetDefaultPolicyHostRestrictions(
+      default_blocked, default_allowed);
+
+  // The default policy applies to all extensions at this point. The extension
+  // should be able to access test.example.com but be blocked from
+  // accessing any other subdomains of example.com or example.com itself.
+  EXPECT_TRUE(CaptureOnly(extension.get(), example_com));
+  EXPECT_TRUE(CaptureOnly(extension.get(), sample_example_com));
+  EXPECT_TRUE(Allowed(extension.get(), test_example_com));
+
+  URLPatternSet blocked;
+  blocked.AddPattern(test_example_com_pattern);
+  URLPatternSet allowed;
+  extension->permissions_data()->SetPolicyHostRestrictions(blocked, allowed);
+
+  // We've applied an individual policy which overrides the default policy.
+  // The only URL that should be blocked is test.example.com.
+  EXPECT_TRUE(Allowed(extension.get(), example_com));
+  EXPECT_TRUE(Allowed(extension.get(), sample_example_com));
+  EXPECT_TRUE(CaptureOnly(extension.get(), test_example_com));
+
+  blocked.AddPattern(example_com_pattern);
+  allowed.AddPattern(test_example_com_pattern);
+  extension->permissions_data()->SetPolicyHostRestrictions(blocked, allowed);
+
+  // Adding example.com and all its subdomains to the blocked list and
+  // test.example.com to the whitelist. This is still the individual policy
+  // Since the whitelist overrides a blacklist we expect to allow access to
+  // test.example.com but block access to all other example.com subdomains
+  // (sample.example.com) and example.com itself.
+  EXPECT_TRUE(CaptureOnly(extension.get(), example_com));
+  EXPECT_TRUE(CaptureOnly(extension.get(), sample_example_com));
+  EXPECT_TRUE(Allowed(extension.get(), test_example_com));
+
+  blocked.ClearPatterns();
+  allowed.ClearPatterns();
+  extension->permissions_data()->SetPolicyHostRestrictions(blocked, allowed);
+
+  // Cleared all URLs from the individual policy, so all URLs should have
+  // access. We want to make sure that a block at the default level doesn't
+  // apply since we're still definining an individual policy.
+  EXPECT_TRUE(Allowed(extension.get(), example_com));
+  EXPECT_TRUE(Allowed(extension.get(), sample_example_com));
+  EXPECT_TRUE(Allowed(extension.get(), test_example_com));
+
+  // Flip back to using default policy for this extension.
+  extension->permissions_data()->SetUsesDefaultHostRestrictions();
+
+  // Make sure the default policy has the same effect as before we defined an
+  // individual policy. Access to test.example.com should be allowed, but all
+  // other subdomains and example.com itself should be blocked.
+  EXPECT_TRUE(CaptureOnly(extension.get(), example_com));
+  EXPECT_TRUE(CaptureOnly(extension.get(), sample_example_com));
+  EXPECT_TRUE(Allowed(extension.get(), test_example_com));
+}
+
+TEST_F(ExtensionScriptAndCaptureVisibleTest, PolicyHostRestrictions) {
+  // Test that host restrictions applied by policy take effect on normal URLs,
+  // iframe urls, different schemes, and components.
+  URLPatternSet default_blocked;
+  URLPatternSet default_allowed;
+  default_blocked.AddPattern(
+      URLPattern(URLPattern::SCHEME_ALL, "https://*.example.com/*"));
+  default_allowed.AddPattern(
+      URLPattern(URLPattern::SCHEME_ALL, "https://test.example.com/*"));
+
+  // In all of these tests, test.example.com should have scripting allowed, with
+  // all other subdomains and example.com itself blocked.
+
+  // Test <all_urls> for regular extensions.
+  scoped_refptr<Extension> extension =
+      LoadManifestStrict("script_and_capture", "extension_regular_all.json");
+  extension->permissions_data()->SetDefaultPolicyHostRestrictions(
+      default_blocked, default_allowed);
+
+  EXPECT_TRUE(Allowed(extension.get(), http_url));
+  EXPECT_TRUE(Allowed(extension.get(), https_url));
+  EXPECT_TRUE(CaptureOnly(extension.get(), example_com));
+  EXPECT_TRUE(Allowed(extension.get(), test_example_com));
+  EXPECT_TRUE(CaptureOnly(extension.get(), sample_example_com));
+  EXPECT_TRUE(CaptureOnly(extension.get(), file_url));
+  EXPECT_TRUE(CaptureOnly(extension.get(), settings_url));
+  EXPECT_TRUE(CaptureOnly(extension.get(), favicon_url));
+  EXPECT_TRUE(CaptureOnly(extension.get(), about_url));
+  EXPECT_TRUE(CaptureOnly(extension.get(), extension_url));
+
+  // Test access to iframed content.
+  GURL within_extension_url = extension->GetResourceURL("page.html");
+  EXPECT_TRUE(AllowedScript(extension.get(), http_url));
+  EXPECT_TRUE(AllowedScript(extension.get(), http_url_with_path));
+  EXPECT_TRUE(BlockedScript(extension.get(), example_com));
+  EXPECT_TRUE(AllowedScript(extension.get(), test_example_com));
+  EXPECT_TRUE(BlockedScript(extension.get(), sample_example_com));
+  EXPECT_TRUE(AllowedScript(extension.get(), https_url));
+  EXPECT_TRUE(BlockedScript(extension.get(), within_extension_url));
+  EXPECT_TRUE(BlockedScript(extension.get(), extension_url));
+
+  // Supress host permission for example.com since its on the blocklist
+  EXPECT_FALSE(extension->permissions_data()->HasHostPermission(example_com));
+  // Allow host permission for test.example.com since its on the whitelist and
+  // blacklist. The whitelist overrides the blacklist.
+  EXPECT_TRUE(
+      extension->permissions_data()->HasHostPermission(test_example_com));
+  EXPECT_FALSE(extension->permissions_data()->HasHostPermission(settings_url));
+  EXPECT_FALSE(extension->permissions_data()->HasHostPermission(about_url));
+  EXPECT_TRUE(extension->permissions_data()->HasHostPermission(favicon_url));
+
+  // Test * for scheme, which implies just the http/https schemes.
+  extension =
+      LoadManifestStrict("script_and_capture", "extension_wildcard.json");
+  extension->permissions_data()->SetDefaultPolicyHostRestrictions(
+      default_blocked, default_allowed);
+  EXPECT_TRUE(ScriptOnly(extension.get(), http_url));
+  EXPECT_TRUE(Blocked(extension.get(), example_com));
+  EXPECT_TRUE(ScriptOnly(extension.get(), test_example_com));
+  EXPECT_TRUE(Blocked(extension.get(), sample_example_com));
+  EXPECT_TRUE(ScriptOnly(extension.get(), https_url));
+  EXPECT_TRUE(Blocked(extension.get(), settings_url));
+  EXPECT_TRUE(Blocked(extension.get(), about_url));
+  EXPECT_TRUE(Blocked(extension.get(), file_url));
+  EXPECT_TRUE(Blocked(extension.get(), favicon_url));
+  extension =
+      LoadManifest("script_and_capture", "extension_wildcard_settings.json");
+  extension->permissions_data()->SetDefaultPolicyHostRestrictions(
+      default_blocked, default_allowed);
+  EXPECT_TRUE(Blocked(extension.get(), settings_url));
+
+  // Component extensions with <all_urls> should get everything regardless of
+  // policy.
+  extension = LoadManifest("script_and_capture", "extension_component_all.json",
+                           Manifest::COMPONENT, Extension::NO_FLAGS);
+  extension->permissions_data()->SetDefaultPolicyHostRestrictions(
+      default_blocked, default_allowed);
+  EXPECT_TRUE(Allowed(extension.get(), http_url));
+  EXPECT_TRUE(Allowed(extension.get(), https_url));
+  EXPECT_TRUE(Allowed(extension.get(), example_com));
+  EXPECT_TRUE(Allowed(extension.get(), test_example_com));
+  EXPECT_TRUE(Allowed(extension.get(), sample_example_com));
+  EXPECT_TRUE(Allowed(extension.get(), settings_url));
+  EXPECT_TRUE(Allowed(extension.get(), about_url));
+  EXPECT_TRUE(Allowed(extension.get(), favicon_url));
+  EXPECT_TRUE(extension->permissions_data()->HasHostPermission(favicon_url));
+}
+
 }  // namespace extensions
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 3ed3b79..a388079 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -2083,6 +2083,8 @@
         "../browser/extensions/extension_browsertest.h",
         "../browser/extensions/extension_function_test_utils.cc",
         "../browser/extensions/extension_function_test_utils.h",
+        "../browser/extensions/extension_with_management_policy_apitest.cc",
+        "../browser/extensions/extension_with_management_policy_apitest.h",
         "../browser/extensions/updater/extension_cache_fake.cc",
         "../browser/extensions/updater/extension_cache_fake.h",
         "../browser/safe_browsing/settings_reset_prompt/settings_reset_prompt_model_browsertest_win.cc",
diff --git a/chrome/test/chromedriver/test/test_expectations b/chrome/test/chromedriver/test/test_expectations
index 2f0a982..4797d5f3 100644
--- a/chrome/test/chromedriver/test/test_expectations
+++ b/chrome/test/chromedriver/test/test_expectations
@@ -210,10 +210,6 @@
     'JavascriptEnabledDriverTest.testChangeEventIsFiredAppropriatelyWhenFocusIsLost',
     'TypingTest.testShouldBeAbleToTypeIntoEmptyContentEditableElement',
 
-    # https://bugs.chromium.org/p/chromedriver/issues/detail?id=922
-    'CorrectEventFiringTest.testShouldEmitOnClickEventsWhenSelectingElements',
-    'CorrectEventFiringTest.testSendingKeysToAnotherElementShouldCauseTheBlurEventToFire',
-
     # https://bugs.chromium.org/p/chromedriver/issues/detail?id=1176
     'ChromeDriverTests.clientLogShouldBeEnabledByDefault',
 
@@ -249,18 +245,6 @@
         'BasicMouseInterfaceTest.testDraggingElementWithMouseMovesItToAnotherList',
          # https://bugs.chromium.org/p/chromedriver/issues/detail?id=998
         'ImplicitWaitTest.testShouldImplicitlyWaitForASingleElement',
-         # https://bugs.chromium.org/p/chromedriver/issues/detail?id=922
-        'ClickTest.testCanClickOnAnElementWithTopSetToANegativeNumber',
-        'CorrectEventFiringTest.testClickEventsShouldBubble',
-        'CorrectEventFiringTest.testShouldFireMouseUpEventWhenClicking',
-        'CorrectEventFiringTest.testShouldFireMouseDownEventWhenClicking',
-        'CorrectEventFiringTest.testSendingKeysToAFocusedElementShouldNotBlurThatElement',
-        'ImplicitWaitTest.testShouldImplicitlyWaitUntilAtLeastOneElementIsFoundWhenSearchingForMany',
-        'ImplicitWaitTest.testShouldImplicitlyWaitForAnElementToBeVisibleBeforeInteracting',
-        'JavascriptEnabledDriverTest.testShouldBeAbleToClickOnSubmitButtons',
-        'JavascriptEnabledDriverTest.testIssue80ClickShouldGenerateClickEvent',
-        'TypingTest.testShiftSelectionDeletes',
-        'VisibilityTest.testShouldModifyTheVisibilityOfAnElementDynamically',
     ]
 )
 _OS_NEGATIVE_FILTER['android:chromedriver_webview_shell'] = (
diff --git a/chrome/test/data/extensions/api_test/content_scripts/policy/background.js b/chrome/test/data/extensions/api_test/content_scripts/policy/background.js
new file mode 100644
index 0000000..7376923
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/content_scripts/policy/background.js
@@ -0,0 +1,53 @@
+// 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.
+
+var pass = chrome.test.callbackPass;
+var callbackFail = chrome.test.callbackFail;
+var listenForever = chrome.test.listenForever;
+
+var port;
+
+function testUrl(domain) {
+  return 'http://' + domain + ':' + port +
+      '/extensions/test_file.html';
+}
+
+function error(domain) {
+  return 'Cannot access contents of url "' + testUrl(domain) + '".' +
+    ' Extension manifest must request permission to access this host.';
+}
+
+// Creates a new tab, navigated to the specified |domain|.
+function createTestTab(domain, callback) {
+  var createdTabId = -1;
+  var done = listenForever(
+      chrome.tabs.onUpdated,
+      function(tabId, changeInfo, tab) {
+    if (tabId == createdTabId && changeInfo.status != 'loading') {
+      callback(tab);
+      done();
+    }
+  });
+
+  chrome.tabs.create({url: testUrl(domain)}, pass(function(tab) {
+    createdTabId = tab.id;
+  }));
+}
+
+chrome.test.getConfig(function(config) {
+  port = config.testServer.port;
+  chrome.test.runTests([
+
+   // Make sure we can't inject a script into a policy blocked host.
+   function policyBlocksInjection() {
+    createTestTab('example.com', pass(function(tab) {
+        chrome.tabs.executeScript(
+            tab.id, {code: 'document.title = "success"'},
+            callbackFail(
+                'This page cannot be scripted due to ' +
+                'an ExtensionsSettings policy.'));
+        }));
+   },
+  ]);
+});
diff --git a/chrome/test/data/extensions/api_test/content_scripts/policy/manifest.json b/chrome/test/data/extensions/api_test/content_scripts/policy/manifest.json
new file mode 100644
index 0000000..48de7c0
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/content_scripts/policy/manifest.json
@@ -0,0 +1,7 @@
+{
+  "name": "content_scripts/policy",
+  "version": "1",
+  "manifest_version": 2,
+  "permissions": ["tabs", "*://example.com/*"],
+  "background": { "scripts": ["background.js"] }
+}
diff --git a/chrome_elf/blacklist/test/blacklist_test.cc b/chrome_elf/blacklist/test/blacklist_test.cc
index ef7d607..ddcff2b 100644
--- a/chrome_elf/blacklist/test/blacklist_test.cc
+++ b/chrome_elf/blacklist/test/blacklist_test.cc
@@ -287,7 +287,8 @@
   }
 }
 
-TEST_F(BlacklistTest, LoadBlacklistedLibrary) {
+// Disabled due to flakiness.  https://crbug.com/711651.
+TEST_F(BlacklistTest, DISABLED_LoadBlacklistedLibrary) {
   base::FilePath current_dir;
   ASSERT_TRUE(PathService::Get(base::DIR_EXE, &current_dir));
 
diff --git a/chromeos/cryptohome/cryptohome_parameters.h b/chromeos/cryptohome/cryptohome_parameters.h
index 7e60fc6..bf3d290 100644
--- a/chromeos/cryptohome/cryptohome_parameters.h
+++ b/chromeos/cryptohome/cryptohome_parameters.h
@@ -170,6 +170,10 @@
   // forces to use the new encryption. That is, makes it an error to mount
   // an existing home directory encrypted in the old way (ecryptfs).
   bool force_dircrypto_if_available = false;
+
+  // If |true|, mounts the existing ecryptfs vault to a temporary location while
+  // setting up a new dircrypto directory.
+  bool to_migrate_from_ecryptfs = false;
 };
 
 // This function returns true if cryptohome of |account_id| is migrated to
diff --git a/chromeos/cryptohome/homedir_methods.cc b/chromeos/cryptohome/homedir_methods.cc
index c98e9912..53603a1 100644
--- a/chromeos/cryptohome/homedir_methods.cc
+++ b/chromeos/cryptohome/homedir_methods.cc
@@ -222,6 +222,9 @@
     if (request.force_dircrypto_if_available)
       request_proto.set_force_dircrypto_if_available(true);
 
+    if (request.to_migrate_from_ecryptfs)
+      request_proto.set_to_migrate_from_ecryptfs(true);
+
     DBusThreadManager::Get()->GetCryptohomeClient()->MountEx(
         id, auth_proto, request_proto,
         base::Bind(&HomedirMethodsImpl::OnMountExCallback,
@@ -297,15 +300,10 @@
   }
 
   void MigrateToDircrypto(const Identification& id,
-                          const Authorization& auth,
                           const DBusResultCallback& callback) override {
-    cryptohome::AuthorizationRequest auth_proto;
-    FillAuthorizationProtobuf(auth, &auth_proto);
-
     DBusThreadManager::Get()->GetCryptohomeClient()->MigrateToDircrypto(
-        id, auth_proto,
-        base::Bind(&HomedirMethodsImpl::OnDBusResultCallback,
-                   weak_ptr_factory_.GetWeakPtr(), callback));
+        id, base::Bind(&HomedirMethodsImpl::OnDBusResultCallback,
+                       weak_ptr_factory_.GetWeakPtr(), callback));
   }
 
  private:
diff --git a/chromeos/cryptohome/homedir_methods.h b/chromeos/cryptohome/homedir_methods.h
index fdd3e630..c89b8ea 100644
--- a/chromeos/cryptohome/homedir_methods.h
+++ b/chromeos/cryptohome/homedir_methods.h
@@ -107,9 +107,8 @@
       const GetAccountDiskUsageCallback& callback) = 0;
 
   // Asks cryptohomed to migrate the cryptohome to the new encryption method
-  // for the user specified by |id|, using |auth| to unlock the key.
+  // for the user specified by |id|.
   virtual void MigrateToDircrypto(const Identification& id,
-                                  const Authorization& auth,
                                   const DBusResultCallback& callback) = 0;
 
   // Creates the global HomedirMethods instance.
diff --git a/chromeos/cryptohome/mock_homedir_methods.h b/chromeos/cryptohome/mock_homedir_methods.h
index 48cb465e..023c9f3 100644
--- a/chromeos/cryptohome/mock_homedir_methods.h
+++ b/chromeos/cryptohome/mock_homedir_methods.h
@@ -58,9 +58,8 @@
   MOCK_METHOD2(GetAccountDiskUsage,
                void(const Identification& id,
                     const GetAccountDiskUsageCallback& callback));
-  MOCK_METHOD3(MigrateToDircrypto,
+  MOCK_METHOD2(MigrateToDircrypto,
                void(const Identification& id,
-                    const Authorization& auth,
                     const DBusResultCallback& callback));
 
   void set_mount_callback(const base::Closure& callback) {
diff --git a/chromeos/dbus/cryptohome_client.cc b/chromeos/dbus/cryptohome_client.cc
index dadb5c6e..1d469b7 100644
--- a/chromeos/dbus/cryptohome_client.cc
+++ b/chromeos/dbus/cryptohome_client.cc
@@ -922,7 +922,6 @@
   }
 
   void MigrateToDircrypto(const cryptohome::Identification& cryptohome_id,
-                          const cryptohome::AuthorizationRequest& auth,
                           const VoidDBusMethodCallback& callback) override {
     dbus::MethodCall method_call(cryptohome::kCryptohomeInterface,
                                  cryptohome::kCryptohomeMigrateToDircrypto);
@@ -932,7 +931,6 @@
 
     dbus::MessageWriter writer(&method_call);
     writer.AppendProtoAsArrayOfBytes(id_proto);
-    writer.AppendProtoAsArrayOfBytes(auth);
 
     // The migration progress takes unpredicatable time depending on the
     // user file size and the number. Setting the time limit to infinite.
diff --git a/chromeos/dbus/cryptohome_client.h b/chromeos/dbus/cryptohome_client.h
index b306d1f..58851ea 100644
--- a/chromeos/dbus/cryptohome_client.h
+++ b/chromeos/dbus/cryptohome_client.h
@@ -573,11 +573,10 @@
   // start migration, and is immediately called back by |callback|. The actual
   // result response is done via DircryptoMigrationProgress callback with its
   // status flag indicating the completion.
-  // MigrateToDircrypto attempts to migrate the home dir using given
-  // authorization to the new "dircrypto" encryption.
+  // MigrateToDircrypto attempts to migrate the home dir to the new "dircrypto"
+  // encryption.
   virtual void MigrateToDircrypto(
       const cryptohome::Identification& cryptohome_id,
-      const cryptohome::AuthorizationRequest& auth,
       const VoidDBusMethodCallback& callback) = 0;
 
   // Asynchronously calls RemoveFirmwareManagementParameters method. |callback|
diff --git a/chromeos/dbus/fake_cryptohome_client.cc b/chromeos/dbus/fake_cryptohome_client.cc
index 1410ec5..d3bae2d 100644
--- a/chromeos/dbus/fake_cryptohome_client.cc
+++ b/chromeos/dbus/fake_cryptohome_client.cc
@@ -533,7 +533,8 @@
       reply.MutableExtension(cryptohome::MountReply::reply);
   mount->set_sanitized_username(GetStubSanitizedUsername(cryptohome_id));
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
-          switches::kTestEncryptionMigrationUI)) {
+          switches::kTestEncryptionMigrationUI) &&
+      !request.to_migrate_from_ecryptfs()) {
     reply.set_error(cryptohome::CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION);
   }
   ReturnProtobufMethodCallback(reply, callback);
@@ -592,7 +593,6 @@
 
 void FakeCryptohomeClient::MigrateToDircrypto(
     const cryptohome::Identification& cryptohome_id,
-    const cryptohome::AuthorizationRequest& auth,
     const VoidDBusMethodCallback& callback) {
   base::ThreadTaskRunnerHandle::Get()->PostTask(
       FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS));
diff --git a/chromeos/dbus/fake_cryptohome_client.h b/chromeos/dbus/fake_cryptohome_client.h
index e1b5d94..87b0780 100644
--- a/chromeos/dbus/fake_cryptohome_client.h
+++ b/chromeos/dbus/fake_cryptohome_client.h
@@ -197,7 +197,6 @@
       const cryptohome::FlushAndSignBootAttributesRequest& request,
       const ProtobufMethodCallback& callback) override;
   void MigrateToDircrypto(const cryptohome::Identification& cryptohome_id,
-                          const cryptohome::AuthorizationRequest& auth,
                           const VoidDBusMethodCallback& callback) override;
   void SetDircryptoMigrationProgressHandler(
       const DircryptoMigrationProgessHandler& handler) override;
diff --git a/chromeos/dbus/mock_cryptohome_client.h b/chromeos/dbus/mock_cryptohome_client.h
index 4b4dde4..549e9a82 100644
--- a/chromeos/dbus/mock_cryptohome_client.h
+++ b/chromeos/dbus/mock_cryptohome_client.h
@@ -222,9 +222,8 @@
       FlushAndSignBootAttributes,
       void(const cryptohome::FlushAndSignBootAttributesRequest& request,
            const ProtobufMethodCallback& callback));
-  MOCK_METHOD3(MigrateToDircrypto,
+  MOCK_METHOD2(MigrateToDircrypto,
                void(const cryptohome::Identification& cryptohome_id,
-                    const cryptohome::AuthorizationRequest& auth,
                     const VoidDBusMethodCallback& callback));
   MOCK_METHOD1(SetDircryptoMigrationProgressHandler,
                void(const DircryptoMigrationProgessHandler& handler));
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm
index e8866591..651af1d 100644
--- a/components/cronet/ios/cronet_environment.mm
+++ b/components/cronet/ios/cronet_environment.mm
@@ -319,7 +319,6 @@
           [NSHTTPCookieStorage sharedHTTPCookieStorage]);
   context_builder.SetCookieAndChannelIdStores(std::move(cookie_store), nullptr);
 
-  std::unordered_set<std::string> quic_host_whitelist;
   std::unique_ptr<net::HttpServerProperties> http_server_properties(
       new net::HttpServerPropertiesImpl());
   for (const auto& quic_hint : quic_hints_) {
@@ -329,11 +328,9 @@
                                          quic_hint.port());
     http_server_properties->SetAlternativeService(
         quic_hint_server, alternative_service, base::Time::Max());
-    quic_host_whitelist.insert(quic_hint.host());
   }
 
   context_builder.SetHttpServerProperties(std::move(http_server_properties));
-  context_builder.set_quic_host_whitelist(quic_host_whitelist);
 
   main_context_ = context_builder.Build();
 }
diff --git a/components/cronet/url_request_context_config.cc b/components/cronet/url_request_context_config.cc
index f9b64d60..9e5da57 100644
--- a/components/cronet/url_request_context_config.cc
+++ b/components/cronet/url_request_context_config.cc
@@ -44,7 +44,6 @@
 const char kQuicDelayTcpRace[] = "delay_tcp_race";
 const char kQuicIdleConnectionTimeoutSeconds[] =
     "idle_connection_timeout_seconds";
-const char kQuicHostWhitelist[] = "host_whitelist";
 const char kQuicCloseSessionsOnIpChange[] = "close_sessions_on_ip_change";
 const char kQuicMigrateSessionsOnNetworkChange[] =
     "migrate_sessions_on_network_change";
@@ -174,17 +173,6 @@
             quic_idle_connection_timeout_seconds);
       }
 
-      std::string quic_host_whitelist;
-      if (quic_args->GetString(kQuicHostWhitelist, &quic_host_whitelist)) {
-        std::unordered_set<std::string> hosts;
-        for (const std::string& host :
-             base::SplitString(quic_host_whitelist, ",", base::TRIM_WHITESPACE,
-                               base::SPLIT_WANT_ALL)) {
-          hosts.insert(host);
-        }
-        context_builder->set_quic_host_whitelist(hosts);
-      }
-
       bool quic_close_sessions_on_ip_change = false;
       if (quic_args->GetBoolean(kQuicCloseSessionsOnIpChange,
                                 &quic_close_sessions_on_ip_change)) {
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 88ef494..1535bac0 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -1667,13 +1667,14 @@
           widget_->non_client_view()->frame_view()->GetBoundsForClientView());
     }
 
+    shadow_underlay_->Show();
+
     // TODO(oshima): Setting to the same value should be no-op.
     // crbug.com/642223.
     if (shadow_underlay_opacity !=
         shadow_underlay_->layer()->GetTargetOpacity()) {
       shadow_underlay_->layer()->SetOpacity(shadow_underlay_opacity);
     }
-    shadow_underlay_->Show();
 
     wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window);
     // Maximized/Fullscreen window does not create a shadow.
diff --git a/components/grpc_support/test/get_stream_engine.cc b/components/grpc_support/test/get_stream_engine.cc
index 73745b5..8e6e429 100644
--- a/components/grpc_support/test/get_stream_engine.cc
+++ b/components/grpc_support/test/get_stream_engine.cc
@@ -53,7 +53,6 @@
       url::SchemeHostPort quic_hint_server("https", kTestServerHost, 443);
       server_properties_->SetAlternativeService(
           quic_hint_server, alternative_service, base::Time::Max());
-      params->quic_host_whitelist.insert(kTestServerHost);
 
       request_context_->set_cert_verifier(mock_cert_verifier_.get());
       request_context_->set_host_resolver(host_resolver_.get());
diff --git a/components/network_session_configurator/network_session_configurator.cc b/components/network_session_configurator/network_session_configurator.cc
index 06d6c166..8ce11b0 100644
--- a/components/network_session_configurator/network_session_configurator.cc
+++ b/components/network_session_configurator/network_session_configurator.cc
@@ -123,13 +123,6 @@
       "true");
 }
 
-bool ShouldQuicDisableConnectionPooling(
-    const VariationParameters& quic_trial_params) {
-  return base::LowerCaseEqualsASCII(
-      GetVariationParam(quic_trial_params, "disable_connection_pooling"),
-      "true");
-}
-
 bool ShouldQuicEnableAlternativeServicesForDifferentHost(
     const VariationParameters& quic_trial_params) {
   return !base::LowerCaseEqualsASCII(
@@ -265,18 +258,6 @@
       "true");
 }
 
-std::unordered_set<std::string> GetQuicHostWhitelist(
-    const VariationParameters& quic_trial_params) {
-  std::string whitelist =
-      GetVariationParam(quic_trial_params, "quic_host_whitelist");
-  std::unordered_set<std::string> hosts;
-  for (const std::string& host : base::SplitString(
-           whitelist, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
-    hosts.insert(host);
-  }
-  return hosts;
-}
-
 bool ShouldQuicMigrateSessionsOnNetworkChange(
     const VariationParameters& quic_trial_params) {
   return base::LowerCaseEqualsASCII(
@@ -351,8 +332,6 @@
   if (params->enable_quic) {
     params->quic_always_require_handshake_confirmation =
         ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params);
-    params->quic_disable_connection_pooling =
-        ShouldQuicDisableConnectionPooling(quic_trial_params);
     params->quic_delay_tcp_race = ShouldQuicDelayTcpRace(quic_trial_params);
     float load_server_info_timeout_srtt_multiplier =
         GetQuicLoadServerInfoTimeoutSrttMultiplier(quic_trial_params);
@@ -398,7 +377,6 @@
         ShouldQuicEstimateInitialRtt(quic_trial_params);
     params->quic_disable_preconnect_if_0rtt =
         ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params);
-    params->quic_host_whitelist = GetQuicHostWhitelist(quic_trial_params);
     params->quic_migrate_sessions_on_network_change =
         ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params);
     params->quic_migrate_sessions_early =
diff --git a/components/network_session_configurator/network_session_configurator_unittest.cc b/components/network_session_configurator/network_session_configurator_unittest.cc
index 56e3904..6272dbc 100644
--- a/components/network_session_configurator/network_session_configurator_unittest.cc
+++ b/components/network_session_configurator/network_session_configurator_unittest.cc
@@ -72,7 +72,6 @@
   EXPECT_EQ(1350u, params_.quic_max_packet_length);
   EXPECT_EQ(net::QuicTagVector(), params_.quic_connection_options);
   EXPECT_FALSE(params_.quic_always_require_handshake_confirmation);
-  EXPECT_FALSE(params_.quic_disable_connection_pooling);
   EXPECT_EQ(0.25f, params_.quic_load_server_info_timeout_srtt_multiplier);
   EXPECT_FALSE(params_.quic_enable_connection_racing);
   EXPECT_FALSE(params_.enable_server_push_cancellation);
@@ -94,7 +93,6 @@
   EXPECT_FALSE(params_.quic_migrate_sessions_on_network_change);
   EXPECT_FALSE(params_.quic_migrate_sessions_early);
   EXPECT_FALSE(params_.quic_allow_server_migration);
-  EXPECT_TRUE(params_.quic_host_whitelist.empty());
   EXPECT_FALSE(params_.quic_force_hol_blocking);
 
   net::HttpNetworkSession::Params default_params;
@@ -371,18 +369,6 @@
 }
 
 TEST_F(NetworkSessionConfiguratorTest,
-       QuicDisableConnectionPoolingFromFieldTrialParams) {
-  std::map<std::string, std::string> field_trial_params;
-  field_trial_params["disable_connection_pooling"] = "true";
-  variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params);
-  base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");
-
-  ParseFieldTrials();
-
-  EXPECT_TRUE(params_.quic_disable_connection_pooling);
-}
-
-TEST_F(NetworkSessionConfiguratorTest,
        QuicLoadServerInfoTimeToSmoothedRttFromFieldTrialParams) {
   std::map<std::string, std::string> field_trial_params;
   field_trial_params["load_server_info_time_to_srtt"] = "0.5";
@@ -461,22 +447,6 @@
   EXPECT_FALSE(params_.quic_delay_tcp_race);
 }
 
-TEST_F(NetworkSessionConfiguratorTest, QuicWhitelistFromParams) {
-  std::map<std::string, std::string> field_trial_params;
-  field_trial_params["quic_host_whitelist"] =
-      "www.example.org, www.example.com";
-  variations::AssociateVariationParams("QUIC", "Enabled", field_trial_params);
-  base::FieldTrialList::CreateFieldTrial("QUIC", "Enabled");
-
-  ParseFieldTrials();
-
-  EXPECT_EQ(2u, params_.quic_host_whitelist.size());
-  EXPECT_TRUE(
-      base::ContainsKey(params_.quic_host_whitelist, "www.example.org"));
-  EXPECT_TRUE(
-      base::ContainsKey(params_.quic_host_whitelist, "www.example.com"));
-}
-
 TEST_F(NetworkSessionConfiguratorTest, TCPFastOpenHttpsEnabled) {
   base::FieldTrialList::CreateFieldTrial("TCPFastOpen", "HttpsEnabled");
 
diff --git a/components/payments/mojom/payment_app.mojom b/components/payments/mojom/payment_app.mojom
index f7eae0a4..5cc4e3b 100644
--- a/components/payments/mojom/payment_app.mojom
+++ b/components/payments/mojom/payment_app.mojom
@@ -28,12 +28,30 @@
   array<PaymentAppOption> options;
 };
 
+enum PaymentHandlerStatus {
+  SUCCESS,
+  NOT_IMPLEMENTED,
+  NOT_FOUND,
+  NO_ACTIVE_WORKER,
+  STORAGE_OPERATION_FAILED,
+};
+
+struct PaymentInstrument {
+  string name;
+  array<string> enabled_methods;
+  string stringified_capabilities;
+};
+
 interface PaymentManager {
   Init(string service_worker_scope);
   SetManifest(PaymentAppManifest payment_app_manifest)
       => (PaymentAppManifestError error);
   GetManifest()
       => (PaymentAppManifest payment_app_manifest, PaymentAppManifestError error);
+  SetPaymentInstrument(string instrumentKey, PaymentInstrument instrument)
+      => (PaymentHandlerStatus status);
+  GetPaymentInstrument(string instrumentKey)
+      => (PaymentInstrument instrument, PaymentHandlerStatus status);
 };
 
 struct PaymentAppRequest {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 580a9d28..56cde403 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -1164,8 +1164,10 @@
     "renderer_host/media/audio_renderer_host.h",
     "renderer_host/media/audio_sync_reader.cc",
     "renderer_host/media/audio_sync_reader.h",
-    "renderer_host/media/in_process_buildable_video_capture_device.cc",
-    "renderer_host/media/in_process_buildable_video_capture_device.h",
+    "renderer_host/media/in_process_launched_video_capture_device.cc",
+    "renderer_host/media/in_process_launched_video_capture_device.h",
+    "renderer_host/media/in_process_video_capture_device_launcher.cc",
+    "renderer_host/media/in_process_video_capture_device_launcher.h",
     "renderer_host/media/in_process_video_capture_provider.cc",
     "renderer_host/media/in_process_video_capture_provider.h",
     "renderer_host/media/media_capture_devices_impl.cc",
@@ -1192,6 +1194,7 @@
     "renderer_host/media/video_capture_controller.cc",
     "renderer_host/media/video_capture_controller.h",
     "renderer_host/media/video_capture_controller_event_handler.h",
+    "renderer_host/media/video_capture_device_launch_observer.h",
     "renderer_host/media/video_capture_gpu_jpeg_decoder.cc",
     "renderer_host/media/video_capture_gpu_jpeg_decoder.h",
     "renderer_host/media/video_capture_host.cc",
diff --git a/content/browser/payments/payment_app.proto b/content/browser/payments/payment_app.proto
index df8a8c2a..06c647e4 100644
--- a/content/browser/payments/payment_app.proto
+++ b/content/browser/payments/payment_app.proto
@@ -20,3 +20,9 @@
   optional string id = 3;
   repeated string enabled_methods = 4;
 }
+
+message PaymentInstrumentProto {
+  optional string name = 1;
+  repeated string enabled_methods = 2;
+  optional string stringified_capabilities = 3;
+}
diff --git a/content/browser/payments/payment_app_database.cc b/content/browser/payments/payment_app_database.cc
index 1809cc3..51a4dae 100644
--- a/content/browser/payments/payment_app_database.cc
+++ b/content/browser/payments/payment_app_database.cc
@@ -17,6 +17,10 @@
 namespace content {
 namespace {
 
+using ::payments::mojom::PaymentHandlerStatus;
+using ::payments::mojom::PaymentInstrument;
+using ::payments::mojom::PaymentInstrumentPtr;
+
 const char kPaymentAppManifestDataKey[] = "PaymentAppManifestData";
 
 payments::mojom::PaymentAppManifestPtr DeserializePaymentAppManifest(
@@ -45,6 +49,21 @@
   return manifest;
 }
 
+PaymentInstrumentPtr DeserializePaymentInstrument(const std::string& input) {
+  PaymentInstrumentProto instrument_proto;
+  if (!instrument_proto.ParseFromString(input))
+    return nullptr;
+
+  PaymentInstrumentPtr instrument = PaymentInstrument::New();
+  instrument->name = instrument_proto.name();
+  for (const auto& method : instrument_proto.enabled_methods())
+    instrument->enabled_methods.push_back(method);
+  instrument->stringified_capabilities =
+      instrument_proto.stringified_capabilities();
+
+  return instrument;
+}
+
 }  // namespace
 
 PaymentAppDatabase::PaymentAppDatabase(
@@ -88,6 +107,36 @@
                  weak_ptr_factory_.GetWeakPtr(), callback));
 }
 
+void PaymentAppDatabase::ReadPaymentInstrument(
+    const GURL& scope,
+    const std::string& instrumentKey,
+    ReadPaymentInstrumentCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  service_worker_context_->FindReadyRegistrationForPattern(
+      scope,
+      base::Bind(
+          &PaymentAppDatabase::DidFindRegistrationToReadPaymentInstrument,
+          weak_ptr_factory_.GetWeakPtr(), instrumentKey,
+          base::Passed(std::move(callback))));
+}
+
+void PaymentAppDatabase::WritePaymentInstrument(
+    const GURL& scope,
+    const std::string& instrumentKey,
+    PaymentInstrumentPtr instrument,
+    WritePaymentInstrumentCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  service_worker_context_->FindReadyRegistrationForPattern(
+      scope,
+      base::Bind(
+          &PaymentAppDatabase::DidFindRegistrationToWritePaymentInstrument,
+          weak_ptr_factory_.GetWeakPtr(), instrumentKey,
+          base::Passed(std::move(instrument)),
+          base::Passed(std::move(callback))));
+}
+
 void PaymentAppDatabase::DidFindRegistrationToWriteManifest(
     payments::mojom::PaymentAppManifestPtr manifest,
     const WriteManifestCallback& callback,
@@ -200,4 +249,86 @@
   callback.Run(std::move(manifests));
 }
 
+void PaymentAppDatabase::DidFindRegistrationToReadPaymentInstrument(
+    const std::string& instrumentKey,
+    ReadPaymentInstrumentCallback callback,
+    ServiceWorkerStatusCode status,
+    scoped_refptr<ServiceWorkerRegistration> registration) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (status != SERVICE_WORKER_OK) {
+    std::move(callback).Run(PaymentInstrument::New(),
+                            PaymentHandlerStatus::NO_ACTIVE_WORKER);
+    return;
+  }
+
+  service_worker_context_->GetRegistrationUserData(
+      registration->id(), {instrumentKey},
+      base::Bind(&PaymentAppDatabase::DidReadPaymentInstrument,
+                 weak_ptr_factory_.GetWeakPtr(),
+                 base::Passed(std::move(callback))));
+}
+
+void PaymentAppDatabase::DidReadPaymentInstrument(
+    ReadPaymentInstrumentCallback callback,
+    const std::vector<std::string>& data,
+    ServiceWorkerStatusCode status) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (status != SERVICE_WORKER_OK || data.size() != 1) {
+    std::move(callback).Run(PaymentInstrument::New(),
+                            PaymentHandlerStatus::NOT_FOUND);
+    return;
+  }
+
+  PaymentInstrumentPtr instrument = DeserializePaymentInstrument(data[0]);
+  if (!instrument) {
+    std::move(callback).Run(PaymentInstrument::New(),
+                            PaymentHandlerStatus::STORAGE_OPERATION_FAILED);
+    return;
+  }
+
+  std::move(callback).Run(std::move(instrument), PaymentHandlerStatus::SUCCESS);
+}
+
+void PaymentAppDatabase::DidFindRegistrationToWritePaymentInstrument(
+    const std::string& instrumentKey,
+    PaymentInstrumentPtr instrument,
+    WritePaymentInstrumentCallback callback,
+    ServiceWorkerStatusCode status,
+    scoped_refptr<ServiceWorkerRegistration> registration) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (status != SERVICE_WORKER_OK) {
+    std::move(callback).Run(PaymentHandlerStatus::NO_ACTIVE_WORKER);
+    return;
+  }
+
+  PaymentInstrumentProto instrument_proto;
+  instrument_proto.set_name(instrument->name);
+  for (const auto& method : instrument->enabled_methods) {
+    instrument_proto.add_enabled_methods(method);
+  }
+  instrument_proto.set_stringified_capabilities(
+      instrument->stringified_capabilities);
+
+  std::string serialized;
+  bool success = instrument_proto.SerializeToString(&serialized);
+  DCHECK(success);
+
+  service_worker_context_->StoreRegistrationUserData(
+      registration->id(), registration->pattern().GetOrigin(),
+      {{instrumentKey, serialized}},
+      base::Bind(&PaymentAppDatabase::DidWritePaymentInstrument,
+                 weak_ptr_factory_.GetWeakPtr(),
+                 base::Passed(std::move(callback))));
+}
+
+void PaymentAppDatabase::DidWritePaymentInstrument(
+    WritePaymentInstrumentCallback callback,
+    ServiceWorkerStatusCode status) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  return std::move(callback).Run(
+      status == SERVICE_WORKER_OK
+          ? PaymentHandlerStatus::SUCCESS
+          : PaymentHandlerStatus::STORAGE_OPERATION_FAILED);
+}
+
 }  // namespace content
diff --git a/content/browser/payments/payment_app_database.h b/content/browser/payments/payment_app_database.h
index 2e6ec55..bac4c9c 100644
--- a/content/browser/payments/payment_app_database.h
+++ b/content/browser/payments/payment_app_database.h
@@ -32,6 +32,11 @@
       std::pair<int64_t, payments::mojom::PaymentAppManifestPtr>;
   using Manifests = std::vector<ManifestWithID>;
   using ReadAllManifestsCallback = base::Callback<void(Manifests)>;
+  using ReadPaymentInstrumentCallback =
+      base::OnceCallback<void(payments::mojom::PaymentInstrumentPtr,
+                              payments::mojom::PaymentHandlerStatus)>;
+  using WritePaymentInstrumentCallback =
+      base::OnceCallback<void(payments::mojom::PaymentHandlerStatus)>;
 
   explicit PaymentAppDatabase(
       scoped_refptr<ServiceWorkerContextWrapper> service_worker_context);
@@ -42,6 +47,13 @@
                      const WriteManifestCallback& callback);
   void ReadManifest(const GURL& scope, const ReadManifestCallback& callback);
   void ReadAllManifests(const ReadAllManifestsCallback& callback);
+  void ReadPaymentInstrument(const GURL& scope,
+                             const std::string& instrumentKey,
+                             ReadPaymentInstrumentCallback callback);
+  void WritePaymentInstrument(const GURL& scope,
+                              const std::string& instrumentKey,
+                              payments::mojom::PaymentInstrumentPtr instrument,
+                              WritePaymentInstrumentCallback callback);
 
  private:
   // WriteManifest callbacks
@@ -68,6 +80,26 @@
       const std::vector<std::pair<int64_t, std::string>>& raw_data,
       ServiceWorkerStatusCode status);
 
+  // ReadPaymentInstrument callbacks
+  void DidFindRegistrationToReadPaymentInstrument(
+      const std::string& instrumentKey,
+      ReadPaymentInstrumentCallback callback,
+      ServiceWorkerStatusCode status,
+      scoped_refptr<ServiceWorkerRegistration> registration);
+  void DidReadPaymentInstrument(ReadPaymentInstrumentCallback callback,
+                                const std::vector<std::string>& data,
+                                ServiceWorkerStatusCode status);
+
+  // WritePaymentInstrument callbacks
+  void DidFindRegistrationToWritePaymentInstrument(
+      const std::string& instrumentKey,
+      payments::mojom::PaymentInstrumentPtr instrument,
+      WritePaymentInstrumentCallback callback,
+      ServiceWorkerStatusCode status,
+      scoped_refptr<ServiceWorkerRegistration> registration);
+  void DidWritePaymentInstrument(WritePaymentInstrumentCallback callback,
+                                 ServiceWorkerStatusCode status);
+
   scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
   base::WeakPtrFactory<PaymentAppDatabase> weak_ptr_factory_;
 
diff --git a/content/browser/payments/payment_manager.cc b/content/browser/payments/payment_manager.cc
index 6d77f7c..62aca5c 100644
--- a/content/browser/payments/payment_manager.cc
+++ b/content/browser/payments/payment_manager.cc
@@ -57,6 +57,25 @@
   payment_app_context_->payment_app_database()->ReadManifest(scope_, callback);
 }
 
+void PaymentManager::SetPaymentInstrument(
+    const std::string& instrumentKey,
+    payments::mojom::PaymentInstrumentPtr details,
+    const PaymentManager::SetPaymentInstrumentCallback& callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  payment_app_context_->payment_app_database()->WritePaymentInstrument(
+      scope_, instrumentKey, std::move(details), callback);
+}
+
+void PaymentManager::GetPaymentInstrument(
+    const std::string& instrumentKey,
+    const PaymentManager::GetPaymentInstrumentCallback& callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  payment_app_context_->payment_app_database()->ReadPaymentInstrument(
+      scope_, instrumentKey, callback);
+}
+
 void PaymentManager::OnConnectionError() {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   payment_app_context_->PaymentManagerHadConnectionError(this);
diff --git a/content/browser/payments/payment_manager.h b/content/browser/payments/payment_manager.h
index 496e8ee..772b25d7 100644
--- a/content/browser/payments/payment_manager.h
+++ b/content/browser/payments/payment_manager.h
@@ -29,12 +29,20 @@
 
  private:
   friend class PaymentAppContentUnitTestBase;
+  friend class PaymentManagerTest;
 
   // payments::mojom::PaymentManager methods:
   void Init(const std::string& scope) override;
   void SetManifest(payments::mojom::PaymentAppManifestPtr manifest,
                    const SetManifestCallback& callback) override;
   void GetManifest(const GetManifestCallback& callback) override;
+  void SetPaymentInstrument(
+      const std::string& instrumentKey,
+      payments::mojom::PaymentInstrumentPtr details,
+      const SetPaymentInstrumentCallback& callback) override;
+  void GetPaymentInstrument(
+      const std::string& instrumentKey,
+      const GetPaymentInstrumentCallback& callback) override;
 
   // Called when an error is detected on binding_.
   void OnConnectionError();
diff --git a/content/browser/payments/payment_manager_unittest.cc b/content/browser/payments/payment_manager_unittest.cc
index fd01718b..1806b5d 100644
--- a/content/browser/payments/payment_manager_unittest.cc
+++ b/content/browser/payments/payment_manager_unittest.cc
@@ -5,17 +5,21 @@
 #include <utility>
 
 #include "base/macros.h"
+#include "base/run_loop.h"
 #include "components/payments/mojom/payment_app.mojom.h"
 #include "content/browser/payments/payment_app_content_unittest_base.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-using payments::mojom::PaymentAppManifestError;
-using payments::mojom::PaymentAppManifestPtr;
-
 namespace content {
 namespace {
 
+using ::payments::mojom::PaymentAppManifestError;
+using ::payments::mojom::PaymentAppManifestPtr;
+using ::payments::mojom::PaymentHandlerStatus;
+using ::payments::mojom::PaymentInstrument;
+using ::payments::mojom::PaymentInstrumentPtr;
+
 const char kServiceWorkerPattern[] = "https://example.com/a";
 const char kServiceWorkerScript[] = "https://example.com/a/script.js";
 
@@ -36,6 +40,19 @@
   *out_error = error;
 }
 
+void SetPaymentInstrumentCallback(PaymentHandlerStatus* out_status,
+                                  PaymentHandlerStatus status) {
+  *out_status = status;
+}
+
+void GetPaymentInstrumentCallback(PaymentInstrumentPtr* out_instrument,
+                                  PaymentHandlerStatus* out_status,
+                                  PaymentInstrumentPtr instrument,
+                                  PaymentHandlerStatus status) {
+  *out_instrument = std::move(instrument);
+  *out_status = status;
+}
+
 }  // namespace
 
 class PaymentManagerTest : public PaymentAppContentUnitTestBase {
@@ -48,6 +65,24 @@
 
   PaymentManager* payment_manager() const { return manager_; }
 
+  void SetPaymentInstrument(const std::string& instrumentKey,
+                            PaymentInstrumentPtr instrument,
+                            PaymentHandlerStatus* out_status) {
+    manager_->SetPaymentInstrument(
+        instrumentKey, std::move(instrument),
+        base::Bind(&SetPaymentInstrumentCallback, out_status));
+    base::RunLoop().RunUntilIdle();
+  }
+
+  void GetPaymentInstrument(const std::string& instrumentKey,
+                            PaymentInstrumentPtr* out_instrument,
+                            PaymentHandlerStatus* out_status) {
+    manager_->GetPaymentInstrument(
+        instrumentKey,
+        base::Bind(&GetPaymentInstrumentCallback, out_instrument, out_status));
+    base::RunLoop().RunUntilIdle();
+  }
+
  private:
   // Owned by payment_app_context_.
   PaymentManager* manager_;
@@ -121,4 +156,33 @@
             read_error);
 }
 
+TEST_F(PaymentManagerTest, SetAndGetPaymentInstrument) {
+  PaymentHandlerStatus write_status = PaymentHandlerStatus::NOT_FOUND;
+  PaymentInstrumentPtr write_details = PaymentInstrument::New();
+  write_details->name = "Visa ending ****4756",
+  write_details->enabled_methods.push_back("visa");
+  write_details->stringified_capabilities = "{}";
+  ASSERT_EQ(PaymentHandlerStatus::NOT_FOUND, write_status);
+  SetPaymentInstrument("test_key", std::move(write_details), &write_status);
+  ASSERT_EQ(PaymentHandlerStatus::SUCCESS, write_status);
+
+  PaymentHandlerStatus read_status = PaymentHandlerStatus::NOT_FOUND;
+  PaymentInstrumentPtr read_details;
+  ASSERT_EQ(PaymentHandlerStatus::NOT_FOUND, read_status);
+  GetPaymentInstrument("test_key", &read_details, &read_status);
+  ASSERT_EQ(PaymentHandlerStatus::SUCCESS, read_status);
+  EXPECT_EQ("Visa ending ****4756", read_details->name);
+  ASSERT_EQ(1U, read_details->enabled_methods.size());
+  EXPECT_EQ("visa", read_details->enabled_methods[0]);
+  EXPECT_EQ("{}", read_details->stringified_capabilities);
+}
+
+TEST_F(PaymentManagerTest, GetUnstoredPaymentInstrument) {
+  PaymentHandlerStatus read_status = PaymentHandlerStatus::SUCCESS;
+  PaymentInstrumentPtr read_details;
+  ASSERT_EQ(PaymentHandlerStatus::SUCCESS, read_status);
+  GetPaymentInstrument("test_key", &read_details, &read_status);
+  ASSERT_EQ(PaymentHandlerStatus::NOT_FOUND, read_status);
+}
+
 }  // namespace content
diff --git a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.cc b/content/browser/renderer_host/media/in_process_buildable_video_capture_device.cc
deleted file mode 100644
index f562158b..0000000
--- a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.cc
+++ /dev/null
@@ -1,444 +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 "content/browser/renderer_host/media/in_process_buildable_video_capture_device.h"
-
-#include "base/metrics/histogram_macros.h"
-#include "base/strings/stringprintf.h"
-#include "content/browser/media/capture/desktop_capture_device_uma_types.h"
-#include "content/browser/media/capture/web_contents_video_capture_device.h"
-#include "content/browser/renderer_host/media/video_capture_controller.h"
-#include "content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/desktop_media_id.h"
-#include "content/public/common/media_stream_request.h"
-#include "media/base/bind_to_current_loop.h"
-#include "media/capture/video/video_capture_buffer_pool_impl.h"
-#include "media/capture/video/video_capture_buffer_tracker_factory_impl.h"
-#include "media/capture/video/video_capture_device_client.h"
-#include "media/capture/video/video_frame_receiver_on_task_runner.h"
-
-#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID)
-#include "content/browser/media/capture/desktop_capture_device.h"
-#if defined(USE_AURA)
-#include "content/browser/media/capture/desktop_capture_device_aura.h"
-#endif
-#endif
-
-#if defined(ENABLE_SCREEN_CAPTURE) && defined(OS_ANDROID)
-#include "content/browser/media/capture/screen_capture_device_android.h"
-#endif
-
-namespace {
-
-class VideoFrameConsumerFeedbackObserverOnTaskRunner
-    : public media::VideoFrameConsumerFeedbackObserver {
- public:
-  VideoFrameConsumerFeedbackObserverOnTaskRunner(
-      media::VideoFrameConsumerFeedbackObserver* observer,
-      scoped_refptr<base::SingleThreadTaskRunner> task_runner)
-      : observer_(observer), task_runner_(std::move(task_runner)) {}
-
-  void OnUtilizationReport(int frame_feedback_id, double utilization) override {
-    task_runner_->PostTask(
-        FROM_HERE,
-        base::Bind(
-            &media::VideoFrameConsumerFeedbackObserver::OnUtilizationReport,
-            base::Unretained(observer_), frame_feedback_id, utilization));
-  }
-
- private:
-  media::VideoFrameConsumerFeedbackObserver* const observer_;
-  const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
-};
-
-std::unique_ptr<media::VideoCaptureJpegDecoder> CreateGpuJpegDecoder(
-    const media::VideoCaptureJpegDecoder::DecodeDoneCB& decode_done_cb) {
-  return base::MakeUnique<content::VideoCaptureGpuJpegDecoder>(decode_done_cb);
-}
-
-void StopAndReleaseDeviceOnDeviceThread(media::VideoCaptureDevice* device,
-                                        base::OnceClosure done_cb) {
-  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StopDeviceTime");
-  device->StopAndDeAllocate();
-  DVLOG(3) << "StopAndReleaseDeviceOnDeviceThread";
-  delete device;
-  base::ResetAndReturn(&done_cb).Run();
-}
-
-// The maximum number of video frame buffers in-flight at any one time. This
-// value should be based on the logical capacity of the capture pipeline, and
-// not on hardware performance.  For example, tab capture requires more buffers
-// than webcam capture because the pipeline is longer (it includes read-backs
-// pending in the GPU pipeline).
-const int kMaxNumberOfBuffers = 3;
-// TODO(miu): The value for tab capture should be determined programmatically.
-// http://crbug.com/460318
-const int kMaxNumberOfBuffersForTabCapture = 10;
-
-}  // anonymous namespace
-
-namespace content {
-
-InProcessBuildableVideoCaptureDevice::InProcessBuildableVideoCaptureDevice(
-    scoped_refptr<base::SingleThreadTaskRunner> device_task_runner,
-    media::VideoCaptureSystem* video_capture_system)
-    : device_task_runner_(std::move(device_task_runner)),
-      video_capture_system_(video_capture_system) {}
-
-InProcessBuildableVideoCaptureDevice::~InProcessBuildableVideoCaptureDevice() {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  DCHECK(!device_);
-}
-
-void InProcessBuildableVideoCaptureDevice::CreateAndStartDeviceAsync(
-    VideoCaptureController* controller,
-    const media::VideoCaptureParams& params,
-    Callbacks* callbacks,
-    base::OnceClosure done_cb) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  DCHECK_EQ(State::NO_DEVICE, state_);
-
-  const int max_buffers = (controller->stream_type() == MEDIA_TAB_VIDEO_CAPTURE
-                               ? kMaxNumberOfBuffersForTabCapture
-                               : kMaxNumberOfBuffers);
-
-  auto device_client =
-      CreateDeviceClient(max_buffers, controller->GetWeakPtrForIOThread());
-
-  base::Closure start_capture_closure;
-  // Use of Unretained() is safe, because |done_cb| guarantees that
-  // |this| stays alive.
-  ReceiveDeviceCallback after_start_capture_callback = media::BindToCurrentLoop(
-      base::Bind(&InProcessBuildableVideoCaptureDevice::OnDeviceStarted,
-                 base::Unretained(this), controller, callbacks,
-                 base::Passed(&done_cb)));
-
-  switch (controller->stream_type()) {
-    case MEDIA_DEVICE_VIDEO_CAPTURE: {
-      start_capture_closure =
-          base::Bind(&InProcessBuildableVideoCaptureDevice::
-                         DoStartDeviceCaptureOnDeviceThread,
-                     base::Unretained(this), controller->device_id(), params,
-                     base::Passed(std::move(device_client)),
-                     std::move(after_start_capture_callback));
-      break;
-    }
-    case MEDIA_TAB_VIDEO_CAPTURE:
-      start_capture_closure =
-          base::Bind(&InProcessBuildableVideoCaptureDevice::
-                         DoStartTabCaptureOnDeviceThread,
-                     base::Unretained(this), controller->device_id(), params,
-                     base::Passed(std::move(device_client)),
-                     std::move(after_start_capture_callback));
-      break;
-
-    case MEDIA_DESKTOP_VIDEO_CAPTURE:
-      start_capture_closure =
-          base::Bind(&InProcessBuildableVideoCaptureDevice::
-                         DoStartDesktopCaptureOnDeviceThread,
-                     base::Unretained(this), controller->device_id(), params,
-                     base::Passed(std::move(device_client)),
-                     std::move(after_start_capture_callback));
-      break;
-
-    default: {
-      NOTIMPLEMENTED();
-      return;
-    }
-  }
-
-  device_task_runner_->PostTask(FROM_HERE, start_capture_closure);
-  state_ = State::DEVICE_START_IN_PROGRESS;
-}
-
-void InProcessBuildableVideoCaptureDevice::ReleaseDeviceAsync(
-    VideoCaptureController* controller,
-    base::OnceClosure done_cb) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  controller->SetConsumerFeedbackObserver(nullptr);
-  switch (state_) {
-    case State::DEVICE_START_IN_PROGRESS:
-      state_ = State::DEVICE_START_ABORTING;
-      return;
-    case State::NO_DEVICE:
-    case State::DEVICE_START_ABORTING:
-      return;
-    case State::DEVICE_STARTED:
-      media::VideoCaptureDevice* device_ptr = device_.release();
-      bool posting_task_succeeded = device_task_runner_->PostTask(
-          FROM_HERE,
-          base::Bind(
-              &StopAndReleaseDeviceOnDeviceThread, device_ptr,
-              base::Bind([](scoped_refptr<base::SingleThreadTaskRunner>) {},
-                         device_task_runner_)));
-      if (posting_task_succeeded == false) {
-        // Since posting to the task runner has failed, we attempt doing it on
-        // the calling thread instead.
-        StopAndReleaseDeviceOnDeviceThread(device_ptr, base::Bind([]() {}));
-      }
-      state_ = State::NO_DEVICE;
-      return;
-  }
-  base::ResetAndReturn(&done_cb).Run();
-}
-
-bool InProcessBuildableVideoCaptureDevice::IsDeviceAlive() const {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  return device_ != nullptr;
-}
-
-void InProcessBuildableVideoCaptureDevice::GetPhotoCapabilities(
-    media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Unretained() is safe to use here because |device| would be null if it
-  // was scheduled for shutdown and destruction, and because this task is
-  // guaranteed to run before the task that destroys the |device|.
-  device_task_runner_->PostTask(
-      FROM_HERE,
-      base::Bind(&media::VideoCaptureDevice::GetPhotoCapabilities,
-                 base::Unretained(device_.get()), base::Passed(&callback)));
-}
-
-void InProcessBuildableVideoCaptureDevice::SetPhotoOptions(
-    media::mojom::PhotoSettingsPtr settings,
-    media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Unretained() is safe to use here because |device| would be null if it
-  // was scheduled for shutdown and destruction, and because this task is
-  // guaranteed to run before the task that destroys the |device|.
-  device_task_runner_->PostTask(
-      FROM_HERE, base::Bind(&media::VideoCaptureDevice::SetPhotoOptions,
-                            base::Unretained(device_.get()),
-                            base::Passed(&settings), base::Passed(&callback)));
-}
-
-void InProcessBuildableVideoCaptureDevice::TakePhoto(
-    media::VideoCaptureDevice::TakePhotoCallback callback) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Unretained() is safe to use here because |device| would be null if it
-  // was scheduled for shutdown and destruction, and because this task is
-  // guaranteed to run before the task that destroys the |device|.
-  device_task_runner_->PostTask(
-      FROM_HERE,
-      base::Bind(&media::VideoCaptureDevice::TakePhoto,
-                 base::Unretained(device_.get()), base::Passed(&callback)));
-}
-
-void InProcessBuildableVideoCaptureDevice::MaybeSuspendDevice() {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Unretained() is safe to use here because |device| would be null if it
-  // was scheduled for shutdown and destruction, and because this task is
-  // guaranteed to run before the task that destroys the |device|.
-  device_task_runner_->PostTask(
-      FROM_HERE, base::Bind(&media::VideoCaptureDevice::MaybeSuspend,
-                            base::Unretained(device_.get())));
-}
-
-void InProcessBuildableVideoCaptureDevice::ResumeDevice() {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Unretained() is safe to use here because |device| would be null if it
-  // was scheduled for shutdown and destruction, and because this task is
-  // guaranteed to run before the task that destroys the |device|.
-  device_task_runner_->PostTask(FROM_HERE,
-                                base::Bind(&media::VideoCaptureDevice::Resume,
-                                           base::Unretained(device_.get())));
-}
-
-void InProcessBuildableVideoCaptureDevice::RequestRefreshFrame() {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Unretained() is safe to use here because |device| would be null if it
-  // was scheduled for shutdown and destruction, and because this task is
-  // guaranteed to run before the task that destroys the |device|.
-  device_task_runner_->PostTask(
-      FROM_HERE, base::Bind(&media::VideoCaptureDevice::RequestRefreshFrame,
-                            base::Unretained(device_.get())));
-}
-
-void InProcessBuildableVideoCaptureDevice::SetDesktopCaptureWindowIdAsync(
-    gfx::NativeViewId window_id,
-    base::OnceClosure done_cb) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  // Post |device_| to the the |device_task_runner_|. This is safe since the
-  // device is destroyed on the |device_task_runner_| and |done_cb| guarantees
-  // that |this| stays alive.
-  device_task_runner_->PostTask(
-      FROM_HERE, base::Bind(&InProcessBuildableVideoCaptureDevice::
-                                SetDesktopCaptureWindowIdOnDeviceThread,
-                            base::Unretained(this), device_.get(), window_id,
-                            base::Passed(&done_cb)));
-}
-
-std::unique_ptr<media::VideoCaptureDeviceClient>
-InProcessBuildableVideoCaptureDevice::CreateDeviceClient(
-    int buffer_pool_max_buffer_count,
-    base::WeakPtr<media::VideoFrameReceiver> receiver) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-
-  return base::MakeUnique<media::VideoCaptureDeviceClient>(
-      base::MakeUnique<media::VideoFrameReceiverOnTaskRunner>(
-          receiver, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)),
-      new media::VideoCaptureBufferPoolImpl(
-          base::MakeUnique<media::VideoCaptureBufferTrackerFactoryImpl>(),
-          buffer_pool_max_buffer_count),
-      base::Bind(&CreateGpuJpegDecoder,
-                 base::Bind(&media::VideoFrameReceiver::OnFrameReadyInBuffer,
-                            receiver)));
-}
-
-void InProcessBuildableVideoCaptureDevice::OnDeviceStarted(
-    VideoCaptureController* controller,
-    Callbacks* callbacks,
-    base::OnceClosure done_cb,
-    std::unique_ptr<media::VideoCaptureDevice> device) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  switch (state_) {
-    case State::DEVICE_START_IN_PROGRESS:
-      if (!device) {
-        state_ = State::NO_DEVICE;
-        callbacks->OnDeviceStartFailed(controller);
-        base::ResetAndReturn(&done_cb).Run();
-        return;
-      }
-      // Passing raw pointer |device.get()| to the controller is safe,
-      // because we take ownership of |device| and we call
-      // controller->SetConsumerFeedbackObserver(nullptr) before releasing
-      // |device|.
-      controller->SetConsumerFeedbackObserver(
-          base::MakeUnique<VideoFrameConsumerFeedbackObserverOnTaskRunner>(
-              device.get(), device_task_runner_));
-      device_ = std::move(device);
-      state_ = State::DEVICE_STARTED;
-      callbacks->OnDeviceStarted(controller);
-      base::ResetAndReturn(&done_cb).Run();
-      return;
-    case State::DEVICE_START_ABORTING:
-      if (device) {
-        device_ = std::move(device);
-        state_ = State::DEVICE_STARTED;
-        // We do not move our |done_cb| to this invocation, because
-        // we still need it to stay alive for the remainder of this method
-        // execution. Our implementation of ReleaseDeviceAsync() does not
-        // actually need the context while releasing the device.
-        ReleaseDeviceAsync(controller, base::Bind([]() {}));
-      }
-      state_ = State::NO_DEVICE;
-      callbacks->OnDeviceStartAborted();
-      base::ResetAndReturn(&done_cb).Run();
-      return;
-    case State::NO_DEVICE:
-    case State::DEVICE_STARTED:
-      NOTREACHED();
-      return;
-  }
-}
-
-void InProcessBuildableVideoCaptureDevice::DoStartDeviceCaptureOnDeviceThread(
-    const std::string& device_id,
-    const media::VideoCaptureParams& params,
-    std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
-    ReceiveDeviceCallback result_callback) {
-  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
-  DCHECK(device_task_runner_->BelongsToCurrentThread());
-
-  std::unique_ptr<media::VideoCaptureDevice> video_capture_device =
-      video_capture_system_->CreateDevice(device_id);
-
-  if (!video_capture_device) {
-    result_callback.Run(nullptr);
-    return;
-  }
-
-  video_capture_device->AllocateAndStart(params, std::move(device_client));
-  result_callback.Run(std::move(video_capture_device));
-}
-
-void InProcessBuildableVideoCaptureDevice::DoStartTabCaptureOnDeviceThread(
-    const std::string& id,
-    const media::VideoCaptureParams& params,
-    std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
-    ReceiveDeviceCallback result_callback) {
-  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
-  DCHECK(device_task_runner_->BelongsToCurrentThread());
-
-  std::unique_ptr<media::VideoCaptureDevice> video_capture_device;
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-  video_capture_device = WebContentsVideoCaptureDevice::Create(id);
-#endif
-
-  if (!video_capture_device) {
-    result_callback.Run(nullptr);
-    return;
-  }
-
-  video_capture_device->AllocateAndStart(params, std::move(device_client));
-  result_callback.Run(std::move(video_capture_device));
-}
-
-void InProcessBuildableVideoCaptureDevice::DoStartDesktopCaptureOnDeviceThread(
-    const std::string& id,
-    const media::VideoCaptureParams& params,
-    std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
-    ReceiveDeviceCallback result_callback) {
-  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
-  DCHECK(device_task_runner_->BelongsToCurrentThread());
-
-  std::unique_ptr<media::VideoCaptureDevice> video_capture_device;
-#if defined(ENABLE_SCREEN_CAPTURE)
-  DesktopMediaID desktop_id = DesktopMediaID::Parse(id);
-  if (desktop_id.is_null()) {
-    DLOG(ERROR) << "Desktop media ID is null";
-    result_callback.Run(nullptr);
-    return;
-  }
-
-  if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) {
-#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
-    video_capture_device = WebContentsVideoCaptureDevice::Create(id);
-    IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED);
-    if (desktop_id.audio_share)
-      IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED_WITH_AUDIO);
-    else
-      IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED_WITHOUT_AUDIO);
-#endif
-  } else {
-#if defined(OS_ANDROID)
-    video_capture_device = base::MakeUnique<ScreenCaptureDeviceAndroid>();
-#else
-#if defined(USE_AURA)
-    video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id);
-#endif  // defined(USE_AURA)
-#if BUILDFLAG(ENABLE_WEBRTC)
-    if (!video_capture_device)
-      video_capture_device = DesktopCaptureDevice::Create(desktop_id);
-#endif  // BUILDFLAG(ENABLE_WEBRTC)
-#endif  // defined (OS_ANDROID)
-  }
-#endif  // defined(ENABLE_SCREEN_CAPTURE)
-
-  if (!video_capture_device) {
-    result_callback.Run(nullptr);
-    return;
-  }
-
-  video_capture_device->AllocateAndStart(params, std::move(device_client));
-  result_callback.Run(std::move(video_capture_device));
-}
-
-void InProcessBuildableVideoCaptureDevice::
-    SetDesktopCaptureWindowIdOnDeviceThread(media::VideoCaptureDevice* device,
-                                            gfx::NativeViewId window_id,
-                                            base::OnceClosure done_cb) {
-  DCHECK(device_task_runner_->BelongsToCurrentThread());
-#if defined(ENABLE_SCREEN_CAPTURE) && BUILDFLAG(ENABLE_WEBRTC) && \
-    !defined(OS_ANDROID)
-  DesktopCaptureDevice* desktop_device =
-      static_cast<DesktopCaptureDevice*>(device);
-  desktop_device->SetNotificationWindowId(window_id);
-  VLOG(2) << "Screen capture notification window passed on device thread.";
-#endif
-  base::ResetAndReturn(&done_cb).Run();
-}
-
-}  // namespace content
diff --git a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h b/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h
deleted file mode 100644
index 6ec80cf..0000000
--- a/content/browser/renderer_host/media/in_process_buildable_video_capture_device.h
+++ /dev/null
@@ -1,104 +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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_
-#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_
-
-#include "content/browser/renderer_host/media/video_capture_controller.h"
-#include "content/browser/renderer_host/media/video_capture_provider.h"
-#include "content/public/common/media_stream_request.h"
-#include "media/capture/video/video_capture_device.h"
-#include "media/capture/video/video_capture_device_client.h"
-#include "media/capture/video/video_capture_device_descriptor.h"
-#include "media/capture/video/video_capture_system.h"
-
-namespace content {
-
-// Implementation of BuildableVideoCaptureDevice that creates capture devices
-// in the same process as it is being operated on, which must be the Browser
-// process. The devices are operated on the given |device_task_runner|.
-// Instances of this class must be operated from the Browser process IO thread.
-class InProcessBuildableVideoCaptureDevice
-    : public BuildableVideoCaptureDevice {
- public:
-  InProcessBuildableVideoCaptureDevice(
-      scoped_refptr<base::SingleThreadTaskRunner> device_task_runner,
-      media::VideoCaptureSystem* video_capture_system);
-  ~InProcessBuildableVideoCaptureDevice() override;
-
-  // BuildableVideoCaptureDevice implementation:
-  void CreateAndStartDeviceAsync(VideoCaptureController* controller,
-                                 const media::VideoCaptureParams& params,
-                                 Callbacks* callbacks,
-                                 base::OnceClosure done_cb) override;
-  void ReleaseDeviceAsync(VideoCaptureController* controller,
-                          base::OnceClosure done_cb) override;
-  bool IsDeviceAlive() const override;
-  void GetPhotoCapabilities(
-      media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback)
-      const override;
-  void SetPhotoOptions(
-      media::mojom::PhotoSettingsPtr settings,
-      media::VideoCaptureDevice::SetPhotoOptionsCallback callback) override;
-  void TakePhoto(
-      media::VideoCaptureDevice::TakePhotoCallback callback) override;
-  void MaybeSuspendDevice() override;
-  void ResumeDevice() override;
-  void RequestRefreshFrame() override;
-
-  void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
-                                      base::OnceClosure done_cb) override;
-
- private:
-  using ReceiveDeviceCallback =
-      base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>;
-
-  enum class State {
-    NO_DEVICE,
-    DEVICE_START_IN_PROGRESS,
-    DEVICE_START_ABORTING,
-    DEVICE_STARTED
-  };
-
-  std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient(
-      int buffer_pool_max_buffer_count,
-      base::WeakPtr<media::VideoFrameReceiver> receiver);
-
-  void OnDeviceStarted(VideoCaptureController* controller,
-                       Callbacks* callbacks,
-                       base::OnceClosure done_cb,
-                       std::unique_ptr<media::VideoCaptureDevice> device);
-
-  void DoStartDeviceCaptureOnDeviceThread(
-      const std::string& device_id,
-      const media::VideoCaptureParams& params,
-      std::unique_ptr<media::VideoCaptureDeviceClient> client,
-      ReceiveDeviceCallback result_callback);
-
-  void DoStartTabCaptureOnDeviceThread(
-      const std::string& device_id,
-      const media::VideoCaptureParams& params,
-      std::unique_ptr<media::VideoCaptureDeviceClient> client,
-      ReceiveDeviceCallback result_callback);
-
-  void DoStartDesktopCaptureOnDeviceThread(
-      const std::string& device_id,
-      const media::VideoCaptureParams& params,
-      std::unique_ptr<media::VideoCaptureDeviceClient> client,
-      ReceiveDeviceCallback result_callback);
-
-  void SetDesktopCaptureWindowIdOnDeviceThread(
-      media::VideoCaptureDevice* device,
-      gfx::NativeViewId window_id,
-      base::OnceClosure done_cb);
-
-  const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
-  media::VideoCaptureSystem* const video_capture_system_;
-  std::unique_ptr<media::VideoCaptureDevice> device_;
-  State state_ = State::NO_DEVICE;
-};
-
-}  // namespace content
-
-#endif  // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_BUILDABLE_VIDEO_CAPTURE_DEVICE_H_
diff --git a/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc b/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc
new file mode 100644
index 0000000..c1305cc
--- /dev/null
+++ b/content/browser/renderer_host/media/in_process_launched_video_capture_device.cc
@@ -0,0 +1,162 @@
+// 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 "content/browser/renderer_host/media/in_process_launched_video_capture_device.h"
+
+#include "base/metrics/histogram_macros.h"
+#include "content/public/browser/browser_thread.h"
+
+#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID)
+#include "content/browser/media/capture/desktop_capture_device.h"
+#if defined(USE_AURA)
+#include "content/browser/media/capture/desktop_capture_device_aura.h"
+#endif
+#endif
+
+#if defined(ENABLE_SCREEN_CAPTURE) && defined(OS_ANDROID)
+#include "content/browser/media/capture/screen_capture_device_android.h"
+#endif
+
+namespace {
+
+void StopAndReleaseDeviceOnDeviceThread(media::VideoCaptureDevice* device,
+                                        base::OnceClosure done_cb) {
+  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StopDeviceTime");
+  device->StopAndDeAllocate();
+  DVLOG(3) << "StopAndReleaseDeviceOnDeviceThread";
+  delete device;
+  base::ResetAndReturn(&done_cb).Run();
+}
+
+}  // anonymous namespace
+
+namespace content {
+
+InProcessLaunchedVideoCaptureDevice::InProcessLaunchedVideoCaptureDevice(
+    std::unique_ptr<media::VideoCaptureDevice> device,
+    scoped_refptr<base::SingleThreadTaskRunner> device_task_runner)
+    : device_(std::move(device)),
+      device_task_runner_(std::move(device_task_runner)) {}
+
+InProcessLaunchedVideoCaptureDevice::~InProcessLaunchedVideoCaptureDevice() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(device_);
+  media::VideoCaptureDevice* device_ptr = device_.release();
+  device_task_runner_->PostTask(
+      FROM_HERE,
+      base::Bind(&StopAndReleaseDeviceOnDeviceThread, device_ptr,
+                 base::Bind([](scoped_refptr<base::SingleThreadTaskRunner>) {},
+                            device_task_runner_)));
+}
+
+void InProcessLaunchedVideoCaptureDevice::GetPhotoCapabilities(
+    media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(
+      FROM_HERE,
+      base::Bind(&media::VideoCaptureDevice::GetPhotoCapabilities,
+                 base::Unretained(device_.get()), base::Passed(&callback)));
+}
+
+void InProcessLaunchedVideoCaptureDevice::SetPhotoOptions(
+    media::mojom::PhotoSettingsPtr settings,
+    media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(
+      FROM_HERE, base::Bind(&media::VideoCaptureDevice::SetPhotoOptions,
+                            base::Unretained(device_.get()),
+                            base::Passed(&settings), base::Passed(&callback)));
+}
+
+void InProcessLaunchedVideoCaptureDevice::TakePhoto(
+    media::VideoCaptureDevice::TakePhotoCallback callback) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(
+      FROM_HERE,
+      base::Bind(&media::VideoCaptureDevice::TakePhoto,
+                 base::Unretained(device_.get()), base::Passed(&callback)));
+}
+
+void InProcessLaunchedVideoCaptureDevice::MaybeSuspendDevice() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(
+      FROM_HERE, base::Bind(&media::VideoCaptureDevice::MaybeSuspend,
+                            base::Unretained(device_.get())));
+}
+
+void InProcessLaunchedVideoCaptureDevice::ResumeDevice() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(FROM_HERE,
+                                base::Bind(&media::VideoCaptureDevice::Resume,
+                                           base::Unretained(device_.get())));
+}
+
+void InProcessLaunchedVideoCaptureDevice::RequestRefreshFrame() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(
+      FROM_HERE, base::Bind(&media::VideoCaptureDevice::RequestRefreshFrame,
+                            base::Unretained(device_.get())));
+}
+
+void InProcessLaunchedVideoCaptureDevice::SetDesktopCaptureWindowIdAsync(
+    gfx::NativeViewId window_id,
+    base::OnceClosure done_cb) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Post |device_| to the the device_task_runner_. This is safe since the
+  // device is destroyed on the device_task_runner_ and |done_cb|
+  // guarantees that |this| stays alive.
+  device_task_runner_->PostTask(
+      FROM_HERE, base::Bind(&InProcessLaunchedVideoCaptureDevice::
+                                SetDesktopCaptureWindowIdOnDeviceThread,
+                            base::Unretained(this), device_.get(), window_id,
+                            base::Passed(&done_cb)));
+}
+
+void InProcessLaunchedVideoCaptureDevice::OnUtilizationReport(
+    int frame_feedback_id,
+    double utilization) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  // Unretained() is safe to use here because |device| would be null if it
+  // was scheduled for shutdown and destruction, and because this task is
+  // guaranteed to run before the task that destroys the |device|.
+  device_task_runner_->PostTask(
+      FROM_HERE, base::Bind(&media::VideoCaptureDevice::OnUtilizationReport,
+                            base::Unretained(device_.get()), frame_feedback_id,
+                            utilization));
+}
+
+void InProcessLaunchedVideoCaptureDevice::
+    SetDesktopCaptureWindowIdOnDeviceThread(media::VideoCaptureDevice* device,
+                                            gfx::NativeViewId window_id,
+                                            base::OnceClosure done_cb) {
+  DCHECK(device_task_runner_->BelongsToCurrentThread());
+#if defined(ENABLE_SCREEN_CAPTURE) && BUILDFLAG(ENABLE_WEBRTC) && \
+    !defined(OS_ANDROID)
+  DesktopCaptureDevice* desktop_device =
+      static_cast<DesktopCaptureDevice*>(device);
+  desktop_device->SetNotificationWindowId(window_id);
+  VLOG(2) << "Screen capture notification window passed on device thread.";
+#endif
+  base::ResetAndReturn(&done_cb).Run();
+}
+
+}  // namespace content
diff --git a/content/browser/renderer_host/media/in_process_launched_video_capture_device.h b/content/browser/renderer_host/media/in_process_launched_video_capture_device.h
new file mode 100644
index 0000000..4c482fa
--- /dev/null
+++ b/content/browser/renderer_host/media/in_process_launched_video_capture_device.h
@@ -0,0 +1,49 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_LAUNCHED_VIDEO_CAPTURE_DEVICE_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_LAUNCHED_VIDEO_CAPTURE_DEVICE_H_
+
+#include "content/browser/renderer_host/media/video_capture_provider.h"
+#include "media/capture/video/video_capture_device.h"
+
+namespace content {
+
+class InProcessLaunchedVideoCaptureDevice : public LaunchedVideoCaptureDevice {
+ public:
+  InProcessLaunchedVideoCaptureDevice(
+      std::unique_ptr<media::VideoCaptureDevice> device,
+      scoped_refptr<base::SingleThreadTaskRunner> device_task_runner);
+  ~InProcessLaunchedVideoCaptureDevice() override;
+
+  void GetPhotoCapabilities(
+      media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback)
+      const override;
+  void SetPhotoOptions(
+      media::mojom::PhotoSettingsPtr settings,
+      media::VideoCaptureDevice::SetPhotoOptionsCallback callback) override;
+  void TakePhoto(
+      media::VideoCaptureDevice::TakePhotoCallback callback) override;
+  void MaybeSuspendDevice() override;
+  void ResumeDevice() override;
+  void RequestRefreshFrame() override;
+
+  void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
+                                      base::OnceClosure done_cb) override;
+
+  void OnUtilizationReport(int frame_feedback_id, double utilization) override;
+
+ private:
+  void SetDesktopCaptureWindowIdOnDeviceThread(
+      media::VideoCaptureDevice* device,
+      gfx::NativeViewId window_id,
+      base::OnceClosure done_cb);
+
+  std::unique_ptr<media::VideoCaptureDevice> device_;
+  const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
+};
+
+}  // namespace content
+
+#endif  // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_LAUNCHED_VIDEO_CAPTURE_DEVICE_H_
diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
new file mode 100644
index 0000000..cbe2305
--- /dev/null
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
@@ -0,0 +1,286 @@
+// 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 "content/browser/renderer_host/media/in_process_video_capture_device_launcher.h"
+
+#include "base/metrics/histogram_macros.h"
+#include "base/strings/stringprintf.h"
+#include "content/browser/media/capture/desktop_capture_device_uma_types.h"
+#include "content/browser/media/capture/web_contents_video_capture_device.h"
+#include "content/browser/renderer_host/media/in_process_launched_video_capture_device.h"
+#include "content/browser/renderer_host/media/video_capture_controller.h"
+#include "content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/desktop_media_id.h"
+#include "content/public/common/media_stream_request.h"
+#include "media/base/bind_to_current_loop.h"
+#include "media/capture/video/video_capture_buffer_pool_impl.h"
+#include "media/capture/video/video_capture_buffer_tracker_factory_impl.h"
+#include "media/capture/video/video_capture_device_client.h"
+#include "media/capture/video/video_frame_receiver.h"
+#include "media/capture/video/video_frame_receiver_on_task_runner.h"
+
+#if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID)
+#include "content/browser/media/capture/desktop_capture_device.h"
+#if defined(USE_AURA)
+#include "content/browser/media/capture/desktop_capture_device_aura.h"
+#endif
+#endif
+
+#if defined(ENABLE_SCREEN_CAPTURE) && defined(OS_ANDROID)
+#include "content/browser/media/capture/screen_capture_device_android.h"
+#endif
+
+namespace {
+
+std::unique_ptr<media::VideoCaptureJpegDecoder> CreateGpuJpegDecoder(
+    const media::VideoCaptureJpegDecoder::DecodeDoneCB& decode_done_cb) {
+  return base::MakeUnique<content::VideoCaptureGpuJpegDecoder>(decode_done_cb);
+}
+
+// The maximum number of video frame buffers in-flight at any one time. This
+// value should be based on the logical capacity of the capture pipeline, and
+// not on hardware performance.  For example, tab capture requires more buffers
+// than webcam capture because the pipeline is longer (it includes read-backs
+// pending in the GPU pipeline).
+const int kMaxNumberOfBuffers = 3;
+// TODO(miu): The value for tab capture should be determined programmatically.
+// http://crbug.com/460318
+const int kMaxNumberOfBuffersForTabCapture = 10;
+
+}  // anonymous namespace
+
+namespace content {
+
+InProcessVideoCaptureDeviceLauncher::InProcessVideoCaptureDeviceLauncher(
+    scoped_refptr<base::SingleThreadTaskRunner> device_task_runner,
+    media::VideoCaptureSystem* video_capture_system)
+    : device_task_runner_(std::move(device_task_runner)),
+      video_capture_system_(video_capture_system),
+      state_(State::READY_TO_LAUNCH) {}
+
+InProcessVideoCaptureDeviceLauncher::~InProcessVideoCaptureDeviceLauncher() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(state_ == State::READY_TO_LAUNCH);
+}
+
+void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
+    const std::string& device_id,
+    MediaStreamType stream_type,
+    const media::VideoCaptureParams& params,
+    base::WeakPtr<media::VideoFrameReceiver> receiver,
+    Callbacks* callbacks,
+    base::OnceClosure done_cb) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(state_ == State::READY_TO_LAUNCH);
+
+  const int max_buffers =
+      (stream_type == MEDIA_TAB_VIDEO_CAPTURE ? kMaxNumberOfBuffersForTabCapture
+                                              : kMaxNumberOfBuffers);
+
+  auto device_client = CreateDeviceClient(max_buffers, std::move(receiver));
+
+  base::Closure start_capture_closure;
+  // Use of |this| is safe, because |done_cb| guarantees that |this|
+  // stays alive.
+  ReceiveDeviceCallback after_start_capture_callback = media::BindToCurrentLoop(
+      base::Bind(&InProcessVideoCaptureDeviceLauncher::OnDeviceStarted,
+                 base::Unretained(this), callbacks, base::Passed(&done_cb)));
+
+  switch (stream_type) {
+    case MEDIA_DEVICE_VIDEO_CAPTURE: {
+      start_capture_closure =
+          base::Bind(&InProcessVideoCaptureDeviceLauncher::
+                         DoStartDeviceCaptureOnDeviceThread,
+                     base::Unretained(this), device_id, params,
+                     base::Passed(std::move(device_client)),
+                     std::move(after_start_capture_callback));
+      break;
+    }
+    case MEDIA_TAB_VIDEO_CAPTURE:
+      start_capture_closure = base::Bind(
+          &InProcessVideoCaptureDeviceLauncher::DoStartTabCaptureOnDeviceThread,
+          base::Unretained(this), device_id, params,
+          base::Passed(std::move(device_client)),
+          std::move(after_start_capture_callback));
+      break;
+
+    case MEDIA_DESKTOP_VIDEO_CAPTURE:
+      start_capture_closure =
+          base::Bind(&InProcessVideoCaptureDeviceLauncher::
+                         DoStartDesktopCaptureOnDeviceThread,
+                     base::Unretained(this), device_id, params,
+                     base::Passed(std::move(device_client)),
+                     std::move(after_start_capture_callback));
+      break;
+
+    default: {
+      NOTIMPLEMENTED();
+      return;
+    }
+  }
+
+  device_task_runner_->PostTask(FROM_HERE, start_capture_closure);
+  state_ = State::DEVICE_START_IN_PROGRESS;
+}
+
+void InProcessVideoCaptureDeviceLauncher::AbortLaunch() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (state_ == State::DEVICE_START_IN_PROGRESS)
+    state_ = State::DEVICE_START_ABORTING;
+}
+
+std::unique_ptr<media::VideoCaptureDeviceClient>
+InProcessVideoCaptureDeviceLauncher::CreateDeviceClient(
+    int buffer_pool_max_buffer_count,
+    base::WeakPtr<media::VideoFrameReceiver> receiver) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+
+  scoped_refptr<media::VideoCaptureBufferPool> buffer_pool =
+      new media::VideoCaptureBufferPoolImpl(
+          base::MakeUnique<media::VideoCaptureBufferTrackerFactoryImpl>(),
+          buffer_pool_max_buffer_count);
+
+  return base::MakeUnique<media::VideoCaptureDeviceClient>(
+      base::MakeUnique<media::VideoFrameReceiverOnTaskRunner>(
+          receiver, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)),
+      std::move(buffer_pool),
+      base::Bind(&CreateGpuJpegDecoder,
+                 base::Bind(&media::VideoFrameReceiver::OnFrameReadyInBuffer,
+                            receiver)));
+}
+
+void InProcessVideoCaptureDeviceLauncher::OnDeviceStarted(
+    Callbacks* callbacks,
+    base::OnceClosure done_cb,
+    std::unique_ptr<media::VideoCaptureDevice> device) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  State state_copy = state_;
+  state_ = State::READY_TO_LAUNCH;
+  if (!device) {
+    switch (state_copy) {
+      case State::DEVICE_START_IN_PROGRESS:
+        callbacks->OnDeviceLaunchFailed();
+        return;
+      case State::DEVICE_START_ABORTING:
+        callbacks->OnDeviceLaunchAborted();
+        return;
+      case State::READY_TO_LAUNCH:
+        NOTREACHED();
+        return;
+    }
+  }
+
+  auto launched_device = base::MakeUnique<InProcessLaunchedVideoCaptureDevice>(
+      std::move(device), device_task_runner_);
+
+  switch (state_copy) {
+    case State::DEVICE_START_IN_PROGRESS:
+      callbacks->OnDeviceLaunched(std::move(launched_device));
+      return;
+    case State::DEVICE_START_ABORTING:
+      launched_device.reset();
+      callbacks->OnDeviceLaunchAborted();
+      return;
+    case State::READY_TO_LAUNCH:
+      NOTREACHED();
+      return;
+  }
+  base::ResetAndReturn(&done_cb).Run();
+}
+
+void InProcessVideoCaptureDeviceLauncher::DoStartDeviceCaptureOnDeviceThread(
+    const std::string& device_id,
+    const media::VideoCaptureParams& params,
+    std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
+    ReceiveDeviceCallback result_callback) {
+  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
+  DCHECK(device_task_runner_->BelongsToCurrentThread());
+
+  std::unique_ptr<media::VideoCaptureDevice> video_capture_device =
+      video_capture_system_->CreateDevice(device_id);
+
+  if (!video_capture_device) {
+    result_callback.Run(nullptr);
+    return;
+  }
+
+  video_capture_device->AllocateAndStart(params, std::move(device_client));
+  result_callback.Run(std::move(video_capture_device));
+}
+
+void InProcessVideoCaptureDeviceLauncher::DoStartTabCaptureOnDeviceThread(
+    const std::string& id,
+    const media::VideoCaptureParams& params,
+    std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
+    ReceiveDeviceCallback result_callback) {
+  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
+  DCHECK(device_task_runner_->BelongsToCurrentThread());
+
+  std::unique_ptr<media::VideoCaptureDevice> video_capture_device;
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
+  video_capture_device = WebContentsVideoCaptureDevice::Create(id);
+#endif
+
+  if (!video_capture_device) {
+    result_callback.Run(nullptr);
+    return;
+  }
+
+  video_capture_device->AllocateAndStart(params, std::move(device_client));
+  result_callback.Run(std::move(video_capture_device));
+}
+
+void InProcessVideoCaptureDeviceLauncher::DoStartDesktopCaptureOnDeviceThread(
+    const std::string& id,
+    const media::VideoCaptureParams& params,
+    std::unique_ptr<media::VideoCaptureDeviceClient> device_client,
+    ReceiveDeviceCallback result_callback) {
+  SCOPED_UMA_HISTOGRAM_TIMER("Media.VideoCaptureManager.StartDeviceTime");
+  DCHECK(device_task_runner_->BelongsToCurrentThread());
+
+  std::unique_ptr<media::VideoCaptureDevice> video_capture_device;
+#if defined(ENABLE_SCREEN_CAPTURE)
+  DesktopMediaID desktop_id = DesktopMediaID::Parse(id);
+  if (desktop_id.is_null()) {
+    DLOG(ERROR) << "Desktop media ID is null";
+    result_callback.Run(nullptr);
+    return;
+  }
+
+  if (desktop_id.type == DesktopMediaID::TYPE_WEB_CONTENTS) {
+#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN)
+    video_capture_device = WebContentsVideoCaptureDevice::Create(id);
+    IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED);
+    if (desktop_id.audio_share) {
+      IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED_WITH_AUDIO);
+    } else {
+      IncrementDesktopCaptureCounter(TAB_VIDEO_CAPTURER_CREATED_WITHOUT_AUDIO);
+    }
+#endif
+  } else {
+#if defined(OS_ANDROID)
+    video_capture_device = base::MakeUnique<ScreenCaptureDeviceAndroid>();
+#else
+#if defined(USE_AURA)
+    video_capture_device = DesktopCaptureDeviceAura::Create(desktop_id);
+#endif  // defined(USE_AURA)
+#if BUILDFLAG(ENABLE_WEBRTC)
+    if (!video_capture_device)
+      video_capture_device = DesktopCaptureDevice::Create(desktop_id);
+#endif  // BUILDFLAG(ENABLE_WEBRTC)
+#endif  // defined (OS_ANDROID)
+  }
+#endif  // defined(ENABLE_SCREEN_CAPTURE)
+
+  if (!video_capture_device) {
+    result_callback.Run(nullptr);
+    return;
+  }
+
+  video_capture_device->AllocateAndStart(params, std::move(device_client));
+  result_callback.Run(std::move(video_capture_device));
+}
+
+}  // namespace content
diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.h b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.h
new file mode 100644
index 0000000..0a58eba
--- /dev/null
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.h
@@ -0,0 +1,81 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUNCHER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUNCHER_H_
+
+#include "content/browser/renderer_host/media/video_capture_controller.h"
+#include "content/browser/renderer_host/media/video_capture_provider.h"
+#include "content/public/common/media_stream_request.h"
+#include "media/capture/video/video_capture_device.h"
+#include "media/capture/video/video_capture_device_client.h"
+#include "media/capture/video/video_capture_device_descriptor.h"
+#include "media/capture/video/video_capture_system.h"
+
+namespace content {
+
+// Implementation of BuildableVideoCaptureDevice that creates capture devices
+// in the same process as it is being operated on, which must be the Browser
+// process. The devices are operated on the given |device_task_runner|.
+// Instances of this class must be operated from the Browser process IO thread.
+class InProcessVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher {
+ public:
+  InProcessVideoCaptureDeviceLauncher(
+      scoped_refptr<base::SingleThreadTaskRunner> device_task_runner,
+      media::VideoCaptureSystem* video_capture_system);
+  ~InProcessVideoCaptureDeviceLauncher() override;
+
+  void LaunchDeviceAsync(const std::string& device_id,
+                         MediaStreamType stream_type,
+                         const media::VideoCaptureParams& params,
+                         base::WeakPtr<media::VideoFrameReceiver> receiver,
+                         Callbacks* callbacks,
+                         base::OnceClosure done_cb) override;
+
+  void AbortLaunch() override;
+
+ private:
+  using ReceiveDeviceCallback =
+      base::Callback<void(std::unique_ptr<media::VideoCaptureDevice> device)>;
+
+  enum class State {
+    READY_TO_LAUNCH,
+    DEVICE_START_IN_PROGRESS,
+    DEVICE_START_ABORTING
+  };
+
+  std::unique_ptr<media::VideoCaptureDeviceClient> CreateDeviceClient(
+      int buffer_pool_max_buffer_count,
+      base::WeakPtr<media::VideoFrameReceiver> receiver);
+
+  void OnDeviceStarted(Callbacks* callbacks,
+                       base::OnceClosure done_cb,
+                       std::unique_ptr<media::VideoCaptureDevice> device);
+
+  void DoStartDeviceCaptureOnDeviceThread(
+      const std::string& device_id,
+      const media::VideoCaptureParams& params,
+      std::unique_ptr<media::VideoCaptureDeviceClient> client,
+      ReceiveDeviceCallback result_callback);
+
+  void DoStartTabCaptureOnDeviceThread(
+      const std::string& device_id,
+      const media::VideoCaptureParams& params,
+      std::unique_ptr<media::VideoCaptureDeviceClient> client,
+      ReceiveDeviceCallback result_callback);
+
+  void DoStartDesktopCaptureOnDeviceThread(
+      const std::string& device_id,
+      const media::VideoCaptureParams& params,
+      std::unique_ptr<media::VideoCaptureDeviceClient> client,
+      ReceiveDeviceCallback result_callback);
+
+  const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
+  media::VideoCaptureSystem* const video_capture_system_;
+  State state_;
+};
+
+}  // namespace content
+
+#endif  // CONTENT_BROWSER_RENDERER_HOST_MEDIA_IN_PROCESS_VIDEO_CAPTURE_DEVICE_LAUNCHER_H_
diff --git a/content/browser/renderer_host/media/in_process_video_capture_provider.cc b/content/browser/renderer_host/media/in_process_video_capture_provider.cc
index 4c60e63..6e9fea1c 100644
--- a/content/browser/renderer_host/media/in_process_video_capture_provider.cc
+++ b/content/browser/renderer_host/media/in_process_video_capture_provider.cc
@@ -4,7 +4,7 @@
 
 #include "content/browser/renderer_host/media/in_process_video_capture_provider.h"
 
-#include "content/browser/renderer_host/media/in_process_buildable_video_capture_device.h"
+#include "content/browser/renderer_host/media/in_process_video_capture_device_launcher.h"
 
 namespace content {
 
@@ -27,11 +27,9 @@
                             result_callback));
 }
 
-std::unique_ptr<BuildableVideoCaptureDevice>
-InProcessVideoCaptureProvider::CreateBuildableDevice(
-    const std::string& device_id,
-    MediaStreamType stream_type) {
-  return base::MakeUnique<InProcessBuildableVideoCaptureDevice>(
+std::unique_ptr<VideoCaptureDeviceLauncher>
+InProcessVideoCaptureProvider::CreateDeviceLauncher() {
+  return base::MakeUnique<InProcessVideoCaptureDeviceLauncher>(
       device_task_runner_, video_capture_system_.get());
 }
 
diff --git a/content/browser/renderer_host/media/in_process_video_capture_provider.h b/content/browser/renderer_host/media/in_process_video_capture_provider.h
index 5777613..b5ecc8c8 100644
--- a/content/browser/renderer_host/media/in_process_video_capture_provider.h
+++ b/content/browser/renderer_host/media/in_process_video_capture_provider.h
@@ -25,9 +25,7 @@
           const std::vector<media::VideoCaptureDeviceInfo>&)>& result_callback)
       override;
 
-  std::unique_ptr<BuildableVideoCaptureDevice> CreateBuildableDevice(
-      const std::string& device_id,
-      MediaStreamType stream_type) override;
+  std::unique_ptr<VideoCaptureDeviceLauncher> CreateDeviceLauncher() override;
 
  private:
   const std::unique_ptr<media::VideoCaptureSystem> video_capture_system_;
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
index f91700b..485eae1 100644
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc
@@ -23,6 +23,7 @@
 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
 #include "content/browser/renderer_host/media/media_stream_manager.h"
 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
+#include "content/browser/renderer_host/media/mock_video_capture_provider.h"
 #include "content/browser/renderer_host/media/video_capture_manager.h"
 #include "content/common/media/media_stream_messages.h"
 #include "content/common/media/media_stream_options.h"
@@ -237,19 +238,6 @@
            const MediaStreamUIProxy::WindowIdCallback& window_id_callback));
 };
 
-class MockVideoCaptureProvider : public VideoCaptureProvider {
- public:
-  MOCK_METHOD1(GetDeviceInfosAsync,
-               void(const base::Callback<
-                    void(const std::vector<media::VideoCaptureDeviceInfo>&)>&
-                        result_callback));
-
-  MOCK_METHOD2(CreateBuildableDevice,
-               std::unique_ptr<BuildableVideoCaptureDevice>(
-                   const std::string& device_id,
-                   MediaStreamType stream_type));
-};
-
 class MediaStreamDispatcherHostTest : public testing::Test {
  public:
   MediaStreamDispatcherHostTest()
diff --git a/content/browser/renderer_host/media/mock_video_capture_provider.cc b/content/browser/renderer_host/media/mock_video_capture_provider.cc
new file mode 100644
index 0000000..c22f723
--- /dev/null
+++ b/content/browser/renderer_host/media/mock_video_capture_provider.cc
@@ -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.
+
+#include "content/browser/renderer_host/media/mock_video_capture_provider.h"
+
+namespace content {
+
+MockVideoCaptureProvider::MockVideoCaptureProvider() = default;
+
+MockVideoCaptureProvider::~MockVideoCaptureProvider() = default;
+
+MockVideoCaptureDeviceLauncher::MockVideoCaptureDeviceLauncher() = default;
+
+MockVideoCaptureDeviceLauncher::~MockVideoCaptureDeviceLauncher() = default;
+
+MockLaunchedVideoCaptureDevice::MockLaunchedVideoCaptureDevice() = default;
+
+MockLaunchedVideoCaptureDevice::~MockLaunchedVideoCaptureDevice() = default;
+
+}  // namespace content
diff --git a/content/browser/renderer_host/media/mock_video_capture_provider.h b/content/browser/renderer_host/media/mock_video_capture_provider.h
new file mode 100644
index 0000000..30f72969
--- /dev/null
+++ b/content/browser/renderer_host/media/mock_video_capture_provider.h
@@ -0,0 +1,100 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_
+
+#include "content/browser/renderer_host/media/video_capture_provider.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace content {
+
+class MockVideoCaptureProvider : public VideoCaptureProvider {
+ public:
+  MockVideoCaptureProvider();
+  ~MockVideoCaptureProvider() override;
+
+  MOCK_METHOD1(GetDeviceInfosAsync,
+               void(const base::Callback<
+                    void(const std::vector<media::VideoCaptureDeviceInfo>&)>&
+                        result_callback));
+
+  MOCK_METHOD0(CreateDeviceLauncher,
+               std::unique_ptr<VideoCaptureDeviceLauncher>());
+};
+
+class MockVideoCaptureDeviceLauncher : public VideoCaptureDeviceLauncher {
+ public:
+  MockVideoCaptureDeviceLauncher();
+  ~MockVideoCaptureDeviceLauncher() override;
+
+  MOCK_METHOD6(DoLaunchDeviceAsync,
+               void(const std::string& device_id,
+                    MediaStreamType stream_type,
+                    const media::VideoCaptureParams& params,
+                    base::WeakPtr<media::VideoFrameReceiver>* receiver,
+                    Callbacks* callbacks,
+                    base::OnceClosure* done_cb));
+
+  MOCK_METHOD0(AbortLaunch, void());
+
+  void LaunchDeviceAsync(const std::string& device_id,
+                         MediaStreamType stream_type,
+                         const media::VideoCaptureParams& params,
+                         base::WeakPtr<media::VideoFrameReceiver> receiver,
+                         Callbacks* callbacks,
+                         base::OnceClosure done_cb) override {
+    DoLaunchDeviceAsync(device_id, stream_type, params, &receiver, callbacks,
+                        &done_cb);
+  }
+};
+
+class MockLaunchedVideoCaptureDevice : public LaunchedVideoCaptureDevice {
+ public:
+  MockLaunchedVideoCaptureDevice();
+  ~MockLaunchedVideoCaptureDevice() override;
+
+  MOCK_CONST_METHOD1(
+      DoGetPhotoCapabilities,
+      void(media::VideoCaptureDevice::GetPhotoCapabilitiesCallback* callback));
+  MOCK_METHOD2(
+      DoSetPhotoOptions,
+      void(media::mojom::PhotoSettingsPtr* settings,
+           media::VideoCaptureDevice::SetPhotoOptionsCallback* callback));
+  MOCK_METHOD1(DoTakePhoto,
+               void(media::VideoCaptureDevice::TakePhotoCallback* callback));
+  MOCK_METHOD0(MaybeSuspendDevice, void());
+  MOCK_METHOD0(ResumeDevice, void());
+  MOCK_METHOD0(RequestRefreshFrame, void());
+  MOCK_METHOD2(DoSetDesktopCaptureWindowId,
+               void(gfx::NativeViewId window_id, base::OnceClosure* done_cb));
+  MOCK_METHOD2(OnUtilizationReport,
+               void(int frame_feedback_id, double utilization));
+
+  void GetPhotoCapabilities(
+      media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback)
+      const override {
+    DoGetPhotoCapabilities(&callback);
+  }
+
+  void SetPhotoOptions(
+      media::mojom::PhotoSettingsPtr settings,
+      media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
+    DoSetPhotoOptions(&settings, &callback);
+  }
+
+  void TakePhoto(
+      media::VideoCaptureDevice::TakePhotoCallback callback) override {
+    DoTakePhoto(&callback);
+  }
+
+  void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
+                                      base::OnceClosure done_cb) override {
+    DoSetDesktopCaptureWindowId(window_id, &done_cb);
+  }
+};
+
+}  // namespace content
+
+#endif  // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_VIDEO_CAPTURE_PROVIDER_H_
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
index 22578ac1..c291a144 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -167,13 +167,13 @@
     const std::string& device_id,
     MediaStreamType stream_type,
     const media::VideoCaptureParams& params,
-    std::unique_ptr<BuildableVideoCaptureDevice> buildable_device)
+    std::unique_ptr<VideoCaptureDeviceLauncher> device_launcher)
     : serial_id_(g_device_start_id++),
       device_id_(device_id),
       stream_type_(stream_type),
       parameters_(params),
-      buildable_device_(std::move(buildable_device)),
-      consumer_feedback_observer_(nullptr),
+      device_launcher_(std::move(device_launcher)),
+      device_launch_observer_(nullptr),
       state_(VIDEO_CAPTURE_STATE_STARTING),
       has_received_frames_(false),
       weak_ptr_factory_(this) {
@@ -187,16 +187,6 @@
   return weak_ptr_factory_.GetWeakPtr();
 }
 
-void VideoCaptureController::SetConsumerFeedbackObserver(
-    std::unique_ptr<media::VideoFrameConsumerFeedbackObserver>
-        consumer_feedback_observer) {
-  DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  consumer_feedback_observer_ = std::move(consumer_feedback_observer);
-  // Update existing BufferContext entries.
-  for (auto& entry : buffer_contexts_)
-    entry.set_consumer_feedback_observer(consumer_feedback_observer_.get());
-}
-
 void VideoCaptureController::AddClient(
     VideoCaptureControllerID id,
     VideoCaptureControllerEventHandler* event_handler,
@@ -385,7 +375,7 @@
   DCHECK(FindUnretiredBufferContextFromBufferId(buffer_id) ==
          buffer_contexts_.end());
   buffer_contexts_.emplace_back(
-      next_buffer_context_id_++, buffer_id, consumer_feedback_observer_.get(),
+      next_buffer_context_id_++, buffer_id, launched_device_.get(),
       handle_provider->GetHandleForInterProcessTransit());
 }
 
@@ -497,55 +487,106 @@
   PerformForClientsWithOpenSession(base::Bind(&CallOnStartedUsingGpuDecode));
 }
 
+void VideoCaptureController::OnDeviceLaunched(
+    std::unique_ptr<LaunchedVideoCaptureDevice> device) {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  launched_device_ = std::move(device);
+  for (auto& entry : buffer_contexts_)
+    entry.set_consumer_feedback_observer(launched_device_.get());
+  if (device_launch_observer_) {
+    device_launch_observer_->OnDeviceLaunched(this);
+    device_launch_observer_ = nullptr;
+  }
+}
+
+void VideoCaptureController::OnDeviceLaunchFailed() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (device_launch_observer_) {
+    device_launch_observer_->OnDeviceLaunchFailed(this);
+    device_launch_observer_ = nullptr;
+  }
+}
+
+void VideoCaptureController::OnDeviceLaunchAborted() {
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (device_launch_observer_) {
+    device_launch_observer_->OnDeviceLaunchAborted();
+    device_launch_observer_ = nullptr;
+  }
+}
+
 void VideoCaptureController::CreateAndStartDeviceAsync(
     const media::VideoCaptureParams& params,
-    BuildableVideoCaptureDevice::Callbacks* callbacks,
+    VideoCaptureDeviceLaunchObserver* observer,
     base::OnceClosure done_cb) {
-  buildable_device_->CreateAndStartDeviceAsync(this, params, callbacks,
-                                               std::move(done_cb));
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  device_launch_observer_ = observer;
+  device_launcher_->LaunchDeviceAsync(device_id_, stream_type_, params,
+                                      GetWeakPtrForIOThread(), this,
+                                      std::move(done_cb));
 }
 
 void VideoCaptureController::ReleaseDeviceAsync(base::OnceClosure done_cb) {
-  buildable_device_->ReleaseDeviceAsync(this, std::move(done_cb));
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  if (!launched_device_) {
+    device_launcher_->AbortLaunch();
+    return;
+  }
+  launched_device_.reset();
 }
 
 bool VideoCaptureController::IsDeviceAlive() const {
-  return buildable_device_->IsDeviceAlive();
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  return launched_device_ != nullptr;
 }
 
 void VideoCaptureController::GetPhotoCapabilities(
     media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback) const {
-  buildable_device_->GetPhotoCapabilities(std::move(callback));
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->GetPhotoCapabilities(std::move(callback));
 }
 
 void VideoCaptureController::SetPhotoOptions(
     media::mojom::PhotoSettingsPtr settings,
     media::VideoCaptureDevice::SetPhotoOptionsCallback callback) {
-  buildable_device_->SetPhotoOptions(std::move(settings), std::move(callback));
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->SetPhotoOptions(std::move(settings), std::move(callback));
 }
 
 void VideoCaptureController::TakePhoto(
     media::VideoCaptureDevice::TakePhotoCallback callback) {
-  buildable_device_->TakePhoto(std::move(callback));
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->TakePhoto(std::move(callback));
 }
 
 void VideoCaptureController::MaybeSuspend() {
-  buildable_device_->MaybeSuspendDevice();
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->MaybeSuspendDevice();
 }
 
 void VideoCaptureController::Resume() {
-  buildable_device_->ResumeDevice();
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->ResumeDevice();
 }
 
 void VideoCaptureController::RequestRefreshFrame() {
-  buildable_device_->RequestRefreshFrame();
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->RequestRefreshFrame();
 }
 
 void VideoCaptureController::SetDesktopCaptureWindowIdAsync(
     gfx::NativeViewId window_id,
     base::OnceClosure done_cb) {
-  buildable_device_->SetDesktopCaptureWindowIdAsync(window_id,
-                                                    std::move(done_cb));
+  DCHECK_CURRENTLY_ON(BrowserThread::IO);
+  DCHECK(launched_device_);
+  launched_device_->SetDesktopCaptureWindowIdAsync(window_id,
+                                                   std::move(done_cb));
 }
 
 VideoCaptureController::ControllerClient* VideoCaptureController::FindClient(
diff --git a/content/browser/renderer_host/media/video_capture_controller.h b/content/browser/renderer_host/media/video_capture_controller.h
index a75de3c2..e1224f2 100644
--- a/content/browser/renderer_host/media/video_capture_controller.h
+++ b/content/browser/renderer_host/media/video_capture_controller.h
@@ -23,6 +23,8 @@
 
 namespace content {
 
+class VideoCaptureDeviceLaunchObserver;
+
 // Implementation of media::VideoFrameReceiver that distributes received frames
 // to potentially multiple connected clients.
 // A call to CreateAndStartDeviceAsync() asynchronously brings up the device. If
@@ -31,28 +33,21 @@
 // Instances must be RefCountedThreadSafe, because an owner
 // (VideoCaptureManager) wants to be able to release its reference during an
 // (asynchronously executing) run of CreateAndStartDeviceAsync(). To this end,
-// the owner passes in the shared ownership as part of |context_reference| into
+// the owner passes in the shared ownership as part of |done_cb| into
 // CreateAndStartDeviceAsync().
 class CONTENT_EXPORT VideoCaptureController
     : public media::VideoFrameReceiver,
+      public VideoCaptureDeviceLauncher::Callbacks,
       public base::RefCountedThreadSafe<VideoCaptureController> {
  public:
   VideoCaptureController(
       const std::string& device_id,
       MediaStreamType stream_type,
       const media::VideoCaptureParams& params,
-      std::unique_ptr<BuildableVideoCaptureDevice> buildable_device);
+      std::unique_ptr<VideoCaptureDeviceLauncher> device_launcher);
 
   base::WeakPtr<VideoCaptureController> GetWeakPtrForIOThread();
 
-  // Factory code creating instances of VideoCaptureController may optionally
-  // set a VideoFrameConsumerFeedbackObserver. Setting the observer is done in
-  // this method separate from the constructor to allow clients to create and
-  // use instances before they can provide the observer. (This is the case with
-  // VideoCaptureManager).
-  void SetConsumerFeedbackObserver(
-      std::unique_ptr<media::VideoFrameConsumerFeedbackObserver> observer);
-
   // Start video capturing and try to use the resolution specified in |params|.
   // Buffers will be shared to the client as necessary. The client will continue
   // to receive frames from the device until RemoveClient() is called.
@@ -119,10 +114,15 @@
   void OnStarted() override;
   void OnStartedUsingGpuDecode() override;
 
-  void CreateAndStartDeviceAsync(
-      const media::VideoCaptureParams& params,
-      BuildableVideoCaptureDevice::Callbacks* callbacks,
-      base::OnceClosure done_cb);
+  // Implementation of VideoCaptureDeviceLauncher::Callbacks interface:
+  void OnDeviceLaunched(
+      std::unique_ptr<LaunchedVideoCaptureDevice> device) override;
+  void OnDeviceLaunchFailed() override;
+  void OnDeviceLaunchAborted() override;
+
+  void CreateAndStartDeviceAsync(const media::VideoCaptureParams& params,
+                                 VideoCaptureDeviceLaunchObserver* callbacks,
+                                 base::OnceClosure done_cb);
   void ReleaseDeviceAsync(base::OnceClosure done_cb);
   bool IsDeviceAlive() const;
   void GetPhotoCapabilities(
@@ -222,10 +222,9 @@
   const std::string device_id_;
   const MediaStreamType stream_type_;
   const media::VideoCaptureParams parameters_;
-  std::unique_ptr<BuildableVideoCaptureDevice> buildable_device_;
-
-  std::unique_ptr<media::VideoFrameConsumerFeedbackObserver>
-      consumer_feedback_observer_;
+  std::unique_ptr<VideoCaptureDeviceLauncher> device_launcher_;
+  std::unique_ptr<LaunchedVideoCaptureDevice> launched_device_;
+  VideoCaptureDeviceLaunchObserver* device_launch_observer_;
 
   std::vector<BufferContext> buffer_contexts_;
 
diff --git a/content/browser/renderer_host/media/video_capture_controller_unittest.cc b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
index 45f164f..162369f 100644
--- a/content/browser/renderer_host/media/video_capture_controller_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_controller_unittest.cc
@@ -21,6 +21,7 @@
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "content/browser/renderer_host/media/media_stream_provider.h"
+#include "content/browser/renderer_host/media/mock_video_capture_provider.h"
 #include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
 #include "content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h"
 #include "content/browser/renderer_host/media/video_capture_manager.h"
@@ -115,38 +116,6 @@
   bool enable_auto_return_buffer_on_buffer_ready_ = true;
 };
 
-class MockConsumerFeedbackObserver
-    : public media::VideoFrameConsumerFeedbackObserver {
- public:
-  MOCK_METHOD2(OnUtilizationReport,
-               void(int frame_feedback_id, double utilization));
-};
-
-class MockBuildableVideoCaptureDevice : public BuildableVideoCaptureDevice {
- public:
-  void CreateAndStartDeviceAsync(
-      VideoCaptureController* controller,
-      const media::VideoCaptureParams& params,
-      BuildableVideoCaptureDevice::Callbacks* callbacks,
-      base::OnceClosure done_cb) override {}
-  void ReleaseDeviceAsync(VideoCaptureController* controller,
-                          base::OnceClosure done_cb) override {}
-  bool IsDeviceAlive() const override { return false; }
-  void GetPhotoCapabilities(
-      media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback)
-      const override {}
-  void SetPhotoOptions(
-      media::mojom::PhotoSettingsPtr settings,
-      media::VideoCaptureDevice::SetPhotoOptionsCallback callback) override {}
-  void TakePhoto(
-      media::VideoCaptureDevice::TakePhotoCallback callback) override {}
-  void MaybeSuspendDevice() override {}
-  void ResumeDevice() override {}
-  void RequestRefreshFrame() override {}
-  void SetDesktopCaptureWindowIdAsync(gfx::NativeViewId window_id,
-                                      base::OnceClosure done_cb) override {}
-};
-
 // Test fixture for testing a unit consisting of an instance of
 // VideoCaptureController connected to an instance of VideoCaptureDeviceClient,
 // an instance of VideoCaptureBufferPoolImpl, as well as related threading glue
@@ -169,16 +138,15 @@
     const MediaStreamType arbitrary_stream_type =
         content::MEDIA_DEVICE_VIDEO_CAPTURE;
     const media::VideoCaptureParams arbitrary_params;
-    auto buildable_device = base::MakeUnique<MockBuildableVideoCaptureDevice>();
+    auto device_launcher = base::MakeUnique<MockVideoCaptureDeviceLauncher>();
     controller_ = new VideoCaptureController(
         arbitrary_device_id, arbitrary_stream_type, arbitrary_params,
-        std::move(buildable_device));
+        std::move(device_launcher));
     InitializeNewDeviceClientAndBufferPoolInstances();
-    auto consumer_feedback_observer =
-        base::MakeUnique<MockConsumerFeedbackObserver>();
-    mock_consumer_feedback_observer_ = consumer_feedback_observer.get();
-    controller_->SetConsumerFeedbackObserver(
-        std::move(consumer_feedback_observer));
+    auto mock_launched_device =
+        base::MakeUnique<MockLaunchedVideoCaptureDevice>();
+    mock_launched_device_ = mock_launched_device.get();
+    controller_->OnDeviceLaunched(std::move(mock_launched_device));
     client_a_.reset(
         new MockVideoCaptureControllerEventHandler(controller_.get()));
     client_b_.reset(
@@ -222,7 +190,7 @@
   std::unique_ptr<MockVideoCaptureControllerEventHandler> client_b_;
   scoped_refptr<VideoCaptureController> controller_;
   std::unique_ptr<media::VideoCaptureDevice::Client> device_client_;
-  MockConsumerFeedbackObserver* mock_consumer_feedback_observer_;
+  MockLaunchedVideoCaptureDevice* mock_launched_device_;
   const float arbitrary_frame_rate_ = 10.0f;
   const base::TimeTicks arbitrary_reference_time_ = base::TimeTicks();
   const base::TimeDelta arbitrary_timestamp_ = base::TimeDelta();
@@ -380,7 +348,7 @@
   client_b_->resource_utilization_ = -1.0;
   // Expect VideoCaptureController to call the load observer with a
   // resource utilization of 0.5 (the largest of all reported values).
-  EXPECT_CALL(*mock_consumer_feedback_observer_,
+  EXPECT_CALL(*mock_launched_device_,
               OnUtilizationReport(arbitrary_frame_feedback_id, 0.5));
 
   device_client_->OnIncomingCapturedBuffer(std::move(buffer), device_format,
@@ -390,7 +358,7 @@
   base::RunLoop().RunUntilIdle();
   Mock::VerifyAndClearExpectations(client_a_.get());
   Mock::VerifyAndClearExpectations(client_b_.get());
-  Mock::VerifyAndClearExpectations(mock_consumer_feedback_observer_);
+  Mock::VerifyAndClearExpectations(mock_launched_device_);
 
   // Second buffer which ought to use the same shared memory buffer. In this
   // case pretend that the Buffer pointer is held by the device for a long
@@ -407,7 +375,7 @@
   client_b_->resource_utilization_ = 3.14;
   // Expect VideoCaptureController to call the load observer with a
   // resource utilization of 3.14 (the largest of all reported values).
-  EXPECT_CALL(*mock_consumer_feedback_observer_,
+  EXPECT_CALL(*mock_launched_device_,
               OnUtilizationReport(arbitrary_frame_feedback_id_2, 3.14));
 
   device_client_->OnIncomingCapturedBuffer(std::move(buffer2), device_format,
@@ -436,7 +404,7 @@
   base::RunLoop().RunUntilIdle();
   Mock::VerifyAndClearExpectations(client_a_.get());
   Mock::VerifyAndClearExpectations(client_b_.get());
-  Mock::VerifyAndClearExpectations(mock_consumer_feedback_observer_);
+  Mock::VerifyAndClearExpectations(mock_launched_device_);
 
   // Add a fourth client now that some buffers have come through.
   controller_->AddClient(client_b_route_2, client_b_.get(), 1, session_1);
@@ -653,7 +621,7 @@
                 DoBufferReady(route_id, arbitrary_format.frame_size))
         .Times(1);
     EXPECT_CALL(
-        *mock_consumer_feedback_observer_,
+        *mock_launched_device_,
         OnUtilizationReport(stub_frame_feedback_id, stub_consumer_utilization))
         .Times(1);
 
@@ -679,7 +647,7 @@
 
     base::RunLoop().RunUntilIdle();
     Mock::VerifyAndClearExpectations(client_a_.get());
-    Mock::VerifyAndClearExpectations(mock_consumer_feedback_observer_);
+    Mock::VerifyAndClearExpectations(mock_launched_device_);
   }
 }
 
diff --git a/content/browser/renderer_host/media/video_capture_device_launch_observer.h b/content/browser/renderer_host/media/video_capture_device_launch_observer.h
new file mode 100644
index 0000000..49812ba
--- /dev/null
+++ b/content/browser/renderer_host/media/video_capture_device_launch_observer.h
@@ -0,0 +1,24 @@
+// 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_LAUNCH_OBSERVER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_LAUNCH_OBSERVER_H_
+
+#include "content/common/content_export.h"
+
+namespace content {
+
+class VideoCaptureController;
+
+class CONTENT_EXPORT VideoCaptureDeviceLaunchObserver {
+ public:
+  virtual ~VideoCaptureDeviceLaunchObserver() {}
+  virtual void OnDeviceLaunched(VideoCaptureController* controller) = 0;
+  virtual void OnDeviceLaunchFailed(VideoCaptureController* controller) = 0;
+  virtual void OnDeviceLaunchAborted() = 0;
+};
+
+}  // namespace content
+
+#endif  // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_DEVICE_LAUNCH_OBSERVER_H_
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index 169daaa8..bc60336 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -26,7 +26,6 @@
 #include "content/browser/media/capture/web_contents_video_capture_device.h"
 #include "content/browser/media/media_internals.h"
 #include "content/browser/renderer_host/media/video_capture_controller.h"
-#include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/desktop_media_id.h"
 #include "content/public/common/media_stream_request.h"
@@ -287,7 +286,7 @@
     const media::VideoCaptureDeviceInfo* device_info =
         GetDeviceInfoById(controller->device_id());
     if (!device_info) {
-      OnDeviceStartFailed(controller);
+      OnDeviceLaunchFailed(controller);
       return;
     }
     for (auto& observer : capture_observers_)
@@ -302,15 +301,14 @@
   // TODO(chfremer): Check if request->params() can actually be different from
   // controller->parameters, and simplify if this is not the case.
   controller->CreateAndStartDeviceAsync(
-      request->params(),
-      static_cast<BuildableVideoCaptureDevice::Callbacks*>(this),
+      request->params(), static_cast<VideoCaptureDeviceLaunchObserver*>(this),
       base::Bind([](scoped_refptr<VideoCaptureManager>,
                     scoped_refptr<VideoCaptureController>) {},
                  scoped_refptr<VideoCaptureManager>(this),
                  GetControllerSharedRef(controller)));
 }
 
-void VideoCaptureManager::OnDeviceStarted(VideoCaptureController* controller) {
+void VideoCaptureManager::OnDeviceLaunched(VideoCaptureController* controller) {
   DVLOG(3) << __func__;
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(!device_start_request_queue_.empty());
@@ -339,7 +337,7 @@
   ProcessDeviceStartRequestQueue();
 }
 
-void VideoCaptureManager::OnDeviceStartFailed(
+void VideoCaptureManager::OnDeviceLaunchFailed(
     VideoCaptureController* controller) {
   const std::string log_message = base::StringPrintf(
       "Starting device %s has failed. Maybe recently disconnected?",
@@ -352,7 +350,7 @@
   ProcessDeviceStartRequestQueue();
 }
 
-void VideoCaptureManager::OnDeviceStartAborted() {
+void VideoCaptureManager::OnDeviceLaunchAborted() {
   device_start_request_queue_.pop_front();
   ProcessDeviceStartRequestQueue();
 }
@@ -786,10 +784,9 @@
     return existing_device;
   }
 
-  VideoCaptureController* new_controller =
-      new VideoCaptureController(device_info.id, device_info.type, params,
-                                 video_capture_provider_->CreateBuildableDevice(
-                                     device_info.id, device_info.type));
+  VideoCaptureController* new_controller = new VideoCaptureController(
+      device_info.id, device_info.type, params,
+      video_capture_provider_->CreateDeviceLauncher());
   controllers_.emplace_back(new_controller);
   return new_controller;
 }
diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h
index e79103fa..be614cfeb 100644
--- a/content/browser/renderer_host/media/video_capture_manager.h
+++ b/content/browser/renderer_host/media/video_capture_manager.h
@@ -21,6 +21,7 @@
 #include "build/build_config.h"
 #include "content/browser/renderer_host/media/media_stream_provider.h"
 #include "content/browser/renderer_host/media/video_capture_controller_event_handler.h"
+#include "content/browser/renderer_host/media/video_capture_device_launch_observer.h"
 #include "content/browser/renderer_host/media/video_capture_provider.h"
 #include "content/common/content_export.h"
 #include "content/common/media/media_stream_options.h"
@@ -44,7 +45,7 @@
 // the Browser::IO thread. A device can only be opened once.
 class CONTENT_EXPORT VideoCaptureManager
     : public MediaStreamProvider,
-      public BuildableVideoCaptureDevice::Callbacks {
+      public VideoCaptureDeviceLaunchObserver {
  public:
   using VideoCaptureDevice = media::VideoCaptureDevice;
 
@@ -178,10 +179,10 @@
   // As a side-effect, updates |devices_info_cache_|.
   void EnumerateDevices(const EnumerationCallback& client_callback);
 
-  // Implementation of BuildableVideoCaptureDevice::Callbacks:
-  void OnDeviceStarted(VideoCaptureController* controller) override;
-  void OnDeviceStartFailed(VideoCaptureController* controller) override;
-  void OnDeviceStartAborted() override;
+  // VideoCaptureDeviceLaunchObserver implementation:
+  void OnDeviceLaunched(VideoCaptureController* controller) override;
+  void OnDeviceLaunchFailed(VideoCaptureController* controller) override;
+  void OnDeviceLaunchAborted() override;
 
   // Retrieves camera calibration information for a particular device. Returns
   // nullopt_t if the |device_id| is not found or camera calibration information
diff --git a/content/browser/renderer_host/media/video_capture_provider.h b/content/browser/renderer_host/media/video_capture_provider.h
index 8515a53..fb49298 100644
--- a/content/browser/renderer_host/media/video_capture_provider.h
+++ b/content/browser/renderer_host/media/video_capture_provider.h
@@ -7,47 +7,49 @@
 
 #include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
 #include "content/public/common/media_stream_request.h"
 #include "media/capture/video/video_capture_device.h"
 #include "media/capture/video/video_capture_device_info.h"
+#include "media/capture/video/video_frame_receiver.h"
 #include "media/capture/video_capture_types.h"
 
 namespace content {
 
-class VideoCaptureController;
+class LaunchedVideoCaptureDevice;
 
-// Abstraction for a video capture device that must be "built" before it can be
-// operated and must be "stopped", before it can be released. Typical operation
-// is that a newly created instance initially reports IsDeviceAlive() == false.
-// Clients call CreateAndStartDeviceAsync(), which kicks off the asynchronous
-// building of the device. The outcome of the device building is reported to an
-// instance of Callbacks. Once the device has been built successfully, the
-// "Device operation methods", are allowed to be called. ReleaseDeviceAsync()
-// must be called in order to release the device if it has before been built
-// successfully. After calling ReleaseDeviceAsync(), it is legal to call
-// CreateAndStartDeviceAsync() to rebuild and start the device again.
-class CONTENT_EXPORT BuildableVideoCaptureDevice {
+// Asynchronously launches video capture devices. After a call to
+// LaunchDeviceAsync() it is illegal to call LaunchDeviceAsync() again until
+// |callbacks| has been notified about the outcome of the asynchronous launch.
+class CONTENT_EXPORT VideoCaptureDeviceLauncher {
  public:
   class CONTENT_EXPORT Callbacks {
    public:
     virtual ~Callbacks() {}
-    virtual void OnDeviceStarted(VideoCaptureController* controller) = 0;
-    virtual void OnDeviceStartFailed(VideoCaptureController* controller) = 0;
-    virtual void OnDeviceStartAborted() = 0;
+    virtual void OnDeviceLaunched(
+        std::unique_ptr<LaunchedVideoCaptureDevice> device) = 0;
+    virtual void OnDeviceLaunchFailed() = 0;
+    virtual void OnDeviceLaunchAborted() = 0;
   };
 
-  virtual ~BuildableVideoCaptureDevice() {}
+  virtual ~VideoCaptureDeviceLauncher() {}
 
-  // Device management methods.
-  virtual void CreateAndStartDeviceAsync(
-      VideoCaptureController* controller,
+  // The passed-in |done_cb| must guarantee that the context relevant
+  // during the asynchronous processing stays alive.
+  virtual void LaunchDeviceAsync(
+      const std::string& device_id,
+      MediaStreamType stream_type,
       const media::VideoCaptureParams& params,
+      base::WeakPtr<media::VideoFrameReceiver> receiver,
       Callbacks* callbacks,
       base::OnceClosure done_cb) = 0;
-  virtual void ReleaseDeviceAsync(VideoCaptureController* controller,
-                                  base::OnceClosure done_cb) = 0;
-  virtual bool IsDeviceAlive() const = 0;
 
+  virtual void AbortLaunch() = 0;
+};
+
+class LaunchedVideoCaptureDevice
+    : public media::VideoFrameConsumerFeedbackObserver {
+ public:
   // Device operation methods.
   virtual void GetPhotoCapabilities(
       media::VideoCaptureDevice::GetPhotoCapabilitiesCallback callback)
@@ -77,9 +79,8 @@
           void(const std::vector<media::VideoCaptureDeviceInfo>&)>&
           result_callback) = 0;
 
-  virtual std::unique_ptr<BuildableVideoCaptureDevice> CreateBuildableDevice(
-      const std::string& device_id,
-      MediaStreamType stream_type) = 0;
+  virtual std::unique_ptr<VideoCaptureDeviceLauncher>
+  CreateDeviceLauncher() = 0;
 };
 
 }  // namespace content
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index a1ac65ff..4410322 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -1224,6 +1224,8 @@
     "../browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc",
     "../browser/renderer_host/media/media_stream_manager_unittest.cc",
     "../browser/renderer_host/media/media_stream_ui_proxy_unittest.cc",
+    "../browser/renderer_host/media/mock_video_capture_provider.cc",
+    "../browser/renderer_host/media/mock_video_capture_provider.h",
     "../browser/renderer_host/media/render_frame_audio_output_stream_factory_unittest.cc",
     "../browser/renderer_host/media/renderer_audio_output_stream_factory_context_impl_unittest.cc",
     "../browser/renderer_host/media/video_capture_buffer_pool_unittest.cc",
diff --git a/extensions/browser/renderer_startup_helper.cc b/extensions/browser/renderer_startup_helper.cc
index 30bd75ee..55f6509 100644
--- a/extensions/browser/renderer_startup_helper.cc
+++ b/extensions/browser/renderer_startup_helper.cc
@@ -23,6 +23,7 @@
 #include "extensions/common/extensions_client.h"
 #include "extensions/common/features/feature_channel.h"
 #include "extensions/common/features/feature_session_type.h"
+#include "extensions/common/permissions/permissions_data.h"
 #include "ui/base/webui/web_ui_util.h"
 
 using content::BrowserContext;
@@ -123,6 +124,15 @@
         WebViewGuest::GetPartitionID(process)));
   }
 
+  // Load default policy_blocked_hosts and policy_allowed_hosts settings, part
+  // of the ExtensionSettings policy.
+  ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params params;
+  params.default_policy_blocked_hosts =
+      PermissionsData::default_policy_blocked_hosts();
+  params.default_policy_allowed_hosts =
+      PermissionsData::default_policy_allowed_hosts();
+  process->Send(new ExtensionMsg_UpdateDefaultPolicyHostRestrictions(params));
+
   // Loaded extensions.
   std::vector<ExtensionMsg_Loaded_Params> loaded_extensions;
   BrowserContext* renderer_context = process->GetBrowserContext();
diff --git a/extensions/common/constants.cc b/extensions/common/constants.cc
index c569a2d..7770085 100644
--- a/extensions/common/constants.cc
+++ b/extensions/common/constants.cc
@@ -112,4 +112,8 @@
     // Keep in sync with _api_features.json and _manifest_features.json.
 };
 
+// Error returned when scripting of a page is denied due to enterprise policy.
+const char kPolicyBlockedScripting[] =
+    "This page cannot be scripted due to an ExtensionsSettings policy.";
+
 }  // namespace extension_misc
diff --git a/extensions/common/constants.h b/extensions/common/constants.h
index 587299f..06f7f6f 100644
--- a/extensions/common/constants.h
+++ b/extensions/common/constants.h
@@ -220,6 +220,9 @@
 // Extension ids used by Hangouts.
 extern const char* const kHangoutsExtensionIds[6];
 
+// Error message when enterprise policy blocks scripting of webpage.
+extern const char kPolicyBlockedScripting[];
+
 }  // namespace extension_misc
 
 #endif  // EXTENSIONS_COMMON_CONSTANTS_H_
diff --git a/extensions/common/extension.h b/extensions/common/extension.h
index 97c0ca6eb..b87cc5f2dd 100644
--- a/extensions/common/extension.h
+++ b/extensions/common/extension.h
@@ -542,6 +542,7 @@
   enum Reason {
     ADDED,    // The permissions were added to the extension.
     REMOVED,  // The permissions were removed from the extension.
+    POLICY,   // The policy that affects permissions was updated.
   };
 
   Reason reason;
diff --git a/extensions/common/extension_messages.cc b/extensions/common/extension_messages.cc
index 8e56f09..4998ca8d 100644
--- a/extensions/common/extension_messages.cc
+++ b/extensions/common/extension_messages.cc
@@ -64,8 +64,14 @@
       location(extension->location()),
       path(extension->path()),
       active_permissions(extension->permissions_data()->active_permissions()),
-      withheld_permissions(extension->permissions_data()
-                               ->withheld_permissions()),
+      withheld_permissions(
+          extension->permissions_data()->withheld_permissions()),
+      policy_blocked_hosts(
+          extension->permissions_data()->policy_blocked_hosts()),
+      policy_allowed_hosts(
+          extension->permissions_data()->policy_allowed_hosts()),
+      uses_default_policy_blocked_allowed_hosts(
+          extension->permissions_data()->UsesDefaultPolicyHostRestrictions()),
       id(extension->id()),
       creation_flags(extension->creation_flags()) {
   if (include_tab_permissions) {
@@ -92,6 +98,12 @@
         extension->permissions_data();
     permissions_data->SetPermissions(active_permissions.ToPermissionSet(),
                                      withheld_permissions.ToPermissionSet());
+    if (uses_default_policy_blocked_allowed_hosts) {
+      permissions_data->SetUsesDefaultHostRestrictions();
+    } else {
+      permissions_data->SetPolicyHostRestrictions(policy_blocked_hosts,
+                                                  policy_allowed_hosts);
+    }
     for (const auto& pair : tab_specific_permissions) {
       permissions_data->UpdateTabSpecificPermissions(
           pair.first, *pair.second.ToPermissionSet());
@@ -321,6 +333,9 @@
   GetParamSize(s, p.manifest_permissions);
   GetParamSize(s, p.explicit_hosts);
   GetParamSize(s, p.scriptable_hosts);
+  GetParamSize(s, p.policy_blocked_hosts);
+  GetParamSize(s, p.policy_allowed_hosts);
+  GetParamSize(s, p.uses_default_policy_host_restrictions);
 }
 
 void ParamTraits<ExtensionMsg_PermissionSetStruct>::Write(base::Pickle* m,
@@ -329,6 +344,9 @@
   WriteParam(m, p.manifest_permissions);
   WriteParam(m, p.explicit_hosts);
   WriteParam(m, p.scriptable_hosts);
+  WriteParam(m, p.policy_blocked_hosts);
+  WriteParam(m, p.policy_allowed_hosts);
+  WriteParam(m, p.uses_default_policy_host_restrictions);
 }
 
 bool ParamTraits<ExtensionMsg_PermissionSetStruct>::Read(
@@ -338,7 +356,10 @@
   return ReadParam(m, iter, &p->apis) &&
          ReadParam(m, iter, &p->manifest_permissions) &&
          ReadParam(m, iter, &p->explicit_hosts) &&
-         ReadParam(m, iter, &p->scriptable_hosts);
+         ReadParam(m, iter, &p->scriptable_hosts) &&
+         ReadParam(m, iter, &p->policy_blocked_hosts) &&
+         ReadParam(m, iter, &p->policy_allowed_hosts) &&
+         ReadParam(m, iter, &p->uses_default_policy_host_restrictions);
 }
 
 void ParamTraits<ExtensionMsg_PermissionSetStruct>::Log(const param_type& p,
@@ -347,6 +368,9 @@
   LogParam(p.manifest_permissions, l);
   LogParam(p.explicit_hosts, l);
   LogParam(p.scriptable_hosts, l);
+  LogParam(p.policy_blocked_hosts, l);
+  LogParam(p.policy_allowed_hosts, l);
+  LogParam(p.uses_default_policy_host_restrictions, l);
 }
 
 void ParamTraits<ExtensionMsg_Loaded_Params>::Write(base::Pickle* m,
@@ -359,6 +383,9 @@
   WriteParam(m, p.active_permissions);
   WriteParam(m, p.withheld_permissions);
   WriteParam(m, p.tab_specific_permissions);
+  WriteParam(m, p.policy_blocked_hosts);
+  WriteParam(m, p.policy_allowed_hosts);
+  WriteParam(m, p.uses_default_policy_blocked_allowed_hosts);
 }
 
 bool ParamTraits<ExtensionMsg_Loaded_Params>::Read(const base::Pickle* m,
@@ -370,7 +397,10 @@
          ReadParam(m, iter, &p->creation_flags) && ReadParam(m, iter, &p->id) &&
          ReadParam(m, iter, &p->active_permissions) &&
          ReadParam(m, iter, &p->withheld_permissions) &&
-         ReadParam(m, iter, &p->tab_specific_permissions);
+         ReadParam(m, iter, &p->tab_specific_permissions) &&
+         ReadParam(m, iter, &p->policy_blocked_hosts) &&
+         ReadParam(m, iter, &p->policy_allowed_hosts) &&
+         ReadParam(m, iter, &p->uses_default_policy_blocked_allowed_hosts);
 }
 
 void ParamTraits<ExtensionMsg_Loaded_Params>::Log(const param_type& p,
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index f7952e8..78ed533 100644
--- a/extensions/common/extension_messages.h
+++ b/extensions/common/extension_messages.h
@@ -293,6 +293,9 @@
   extensions::ManifestPermissionSet manifest_permissions;
   extensions::URLPatternSet explicit_hosts;
   extensions::URLPatternSet scriptable_hosts;
+  extensions::URLPatternSet policy_blocked_hosts;
+  extensions::URLPatternSet policy_allowed_hosts;
+  bool uses_default_policy_host_restrictions;
 };
 
 struct ExtensionMsg_Loaded_Params {
@@ -321,6 +324,14 @@
   ExtensionMsg_PermissionSetStruct withheld_permissions;
   std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions;
 
+  // Contains URLPatternSets defining which URLs an extension may not interact
+  // with by policy.
+  extensions::URLPatternSet policy_blocked_hosts;
+  extensions::URLPatternSet policy_allowed_hosts;
+
+  // If the extension uses the default list of blocked / allowed URLs.
+  bool uses_default_policy_blocked_allowed_hosts;
+
   // We keep this separate so that it can be used in logging.
   std::string id;
 
@@ -442,6 +453,15 @@
   IPC_STRUCT_MEMBER(std::string, extension_id)
   IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions)
   IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions)
+  IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_blocked_hosts)
+  IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_allowed_hosts)
+  IPC_STRUCT_MEMBER(bool, uses_default_policy_host_restrictions)
+IPC_STRUCT_END()
+
+// Parameters structure for ExtensionMsg_UpdateDefaultPolicyHostRestrictions.
+IPC_STRUCT_BEGIN(ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
+  IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_blocked_hosts)
+  IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_allowed_hosts)
 IPC_STRUCT_END()
 
 // Messages sent from the browser to the renderer:
@@ -548,6 +568,10 @@
 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions,
                      ExtensionMsg_UpdatePermissions_Params)
 
+// Tell the renderer to update an extension's policy_blocked_hosts set.
+IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateDefaultPolicyHostRestrictions,
+                     ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
+
 // Tell the render view about new tab-specific permissions for an extension.
 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions,
                      GURL /* url */,
diff --git a/extensions/common/permissions/permissions_data.cc b/extensions/common/permissions/permissions_data.cc
index 4025d23c..fb9cecb 100644
--- a/extensions/common/permissions/permissions_data.cc
+++ b/extensions/common/permissions/permissions_data.cc
@@ -8,6 +8,7 @@
 #include <utility>
 
 #include "base/command_line.h"
+#include "base/lazy_instance.h"
 #include "base/macros.h"
 #include "content/public/common/url_constants.h"
 #include "extensions/common/constants.h"
@@ -30,6 +31,17 @@
 
 PermissionsData::PolicyDelegate* g_policy_delegate = nullptr;
 
+struct DefaultRuntimePolicy {
+  URLPatternSet blocked_hosts;
+  URLPatternSet allowed_hosts;
+};
+
+// URLs an extension can't interact with. An extension can override these
+// settings by declaring its own list of blocked and allowed hosts using
+// policy_blocked_hosts and policy_allowed_hosts.
+base::LazyInstance<DefaultRuntimePolicy>::Leaky default_runtime_policy =
+    LAZY_INSTANCE_INITIALIZER;
+
 class AutoLockOnValidThread {
  public:
   AutoLockOnValidThread(base::Lock& lock, base::ThreadChecker* thread_checker)
@@ -127,6 +139,45 @@
   return false;
 }
 
+bool PermissionsData::UsesDefaultPolicyHostRestrictions() const {
+  DCHECK(!thread_checker_ || thread_checker_->CalledOnValidThread());
+  return uses_default_policy_host_restrictions;
+}
+
+const URLPatternSet& PermissionsData::default_policy_blocked_hosts() {
+  return default_runtime_policy.Get().blocked_hosts;
+}
+
+const URLPatternSet& PermissionsData::default_policy_allowed_hosts() {
+  return default_runtime_policy.Get().allowed_hosts;
+}
+
+const URLPatternSet PermissionsData::policy_blocked_hosts() const {
+  base::AutoLock auto_lock(runtime_lock_);
+  return PolicyBlockedHostsUnsafe();
+}
+
+const URLPatternSet& PermissionsData::PolicyBlockedHostsUnsafe() const {
+  DCHECK(!thread_checker_ || thread_checker_->CalledOnValidThread());
+  if (uses_default_policy_host_restrictions)
+    return default_policy_blocked_hosts();
+  runtime_lock_.AssertAcquired();
+  return policy_blocked_hosts_unsafe_;
+}
+
+const URLPatternSet PermissionsData::policy_allowed_hosts() const {
+  base::AutoLock auto_lock(runtime_lock_);
+  return PolicyAllowedHostsUnsafe();
+}
+
+const URLPatternSet& PermissionsData::PolicyAllowedHostsUnsafe() const {
+  DCHECK(!thread_checker_ || thread_checker_->CalledOnValidThread());
+  if (uses_default_policy_host_restrictions)
+    return default_policy_allowed_hosts();
+  runtime_lock_.AssertAcquired();
+  return policy_allowed_hosts_unsafe_;
+}
+
 void PermissionsData::BindToCurrentThread() const {
   DCHECK(!thread_checker_);
   thread_checker_.reset(new base::ThreadChecker());
@@ -140,6 +191,28 @@
   withheld_permissions_unsafe_ = std::move(withheld);
 }
 
+void PermissionsData::SetPolicyHostRestrictions(
+    const URLPatternSet& runtime_blocked_hosts,
+    const URLPatternSet& runtime_allowed_hosts) const {
+  AutoLockOnValidThread lock(runtime_lock_, thread_checker_.get());
+  policy_blocked_hosts_unsafe_ = runtime_blocked_hosts;
+  policy_allowed_hosts_unsafe_ = runtime_allowed_hosts;
+  uses_default_policy_host_restrictions = false;
+}
+
+void PermissionsData::SetUsesDefaultHostRestrictions() const {
+  AutoLockOnValidThread lock(runtime_lock_, thread_checker_.get());
+  uses_default_policy_host_restrictions = true;
+}
+
+// static
+void PermissionsData::SetDefaultPolicyHostRestrictions(
+    const URLPatternSet& default_runtime_blocked_hosts,
+    const URLPatternSet& default_runtime_allowed_hosts) {
+  default_runtime_policy.Get().blocked_hosts = default_runtime_blocked_hosts;
+  default_runtime_policy.Get().allowed_hosts = default_runtime_allowed_hosts;
+}
+
 void PermissionsData::SetActivePermissions(
     std::unique_ptr<const PermissionSet> active) const {
   AutoLockOnValidThread lock(runtime_lock_, thread_checker_.get());
@@ -208,7 +281,8 @@
 
 bool PermissionsData::HasHostPermission(const GURL& url) const {
   base::AutoLock auto_lock(runtime_lock_);
-  return active_permissions_unsafe_->HasExplicitAccessToOrigin(url);
+  return active_permissions_unsafe_->HasExplicitAccessToOrigin(url) &&
+         !IsRuntimeBlockedHost(url);
 }
 
 bool PermissionsData::HasEffectiveAccessToAllHosts() const {
@@ -327,6 +401,12 @@
   return false;
 }
 
+bool PermissionsData::IsRuntimeBlockedHost(const GURL& url) const {
+  runtime_lock_.AssertAcquired();
+  return PolicyBlockedHostsUnsafe().MatchesURL(url) &&
+         !PolicyAllowedHostsUnsafe().MatchesURL(url);
+}
+
 PermissionsData::AccessType PermissionsData::CanRunOnPage(
     const Extension* extension,
     const GURL& document_url,
@@ -335,9 +415,14 @@
     const URLPatternSet& withheld_url_patterns,
     std::string* error) const {
   runtime_lock_.AssertAcquired();
-  if (g_policy_delegate &&
-      !g_policy_delegate->CanExecuteScriptOnPage(extension, document_url,
-                                                 tab_id, error)) {
+  if (g_policy_delegate && !g_policy_delegate->CanExecuteScriptOnPage(
+                               extension, document_url, tab_id, error))
+    return ACCESS_DENIED;
+
+  if (extension->location() != Manifest::COMPONENT &&
+      extension->permissions_data()->IsRuntimeBlockedHost(document_url)) {
+    if (error)
+      *error = extension_misc::kPolicyBlockedScripting;
     return ACCESS_DENIED;
   }
 
diff --git a/extensions/common/permissions/permissions_data.h b/extensions/common/permissions/permissions_data.h
index 3b87e79..6997403 100644
--- a/extensions/common/permissions/permissions_data.h
+++ b/extensions/common/permissions/permissions_data.h
@@ -82,6 +82,10 @@
                               const Extension* extension,
                               std::string* error);
 
+  // Is this extension using the default scope for policy_blocked_hosts and
+  // policy_allowed_hosts of the ExtensionSettings policy.
+  bool UsesDefaultPolicyHostRestrictions() const;
+
   // Locks the permissions data to the current thread. We don't do this on
   // construction, since extensions are initialized across multiple threads.
   void BindToCurrentThread() const;
@@ -91,6 +95,27 @@
   void SetPermissions(std::unique_ptr<const PermissionSet> active,
                       std::unique_ptr<const PermissionSet> withheld) const;
 
+  // Applies restrictions from enterprise policy limiting which URLs this
+  // extension can interact with. The same policy can also define a default set
+  // of URL restrictions using SetDefaultPolicyHostRestrictions. This function
+  // overrides any default host restriction policy.
+  void SetPolicyHostRestrictions(
+      const URLPatternSet& runtime_blocked_hosts,
+      const URLPatternSet& runtime_allowed_hosts) const;
+
+  // Marks this extension as using default enterprise policy limiting
+  // which URLs extensions can interact with. A default policy can be set with
+  // SetDefaultPolicyHostRestrictions. A policy specific to this extension
+  // can be set with SetPolicyHostRestrictions.
+  void SetUsesDefaultHostRestrictions() const;
+
+  // Applies restrictions from enterprise policy limiting which URLs all
+  // extensions can interact with. This restriction can be overridden on a
+  // per-extension basis with SetPolicyHostRestrictions.
+  static void SetDefaultPolicyHostRestrictions(
+      const URLPatternSet& default_runtime_blocked_hosts,
+      const URLPatternSet& default_runtime_allowed_hosts);
+
   // Sets the active permissions, leaving withheld the same.
   void SetActivePermissions(std::unique_ptr<const PermissionSet> active) const;
 
@@ -201,11 +226,42 @@
     return *withheld_permissions_unsafe_;
   }
 
+  // Returns list of hosts this extension may not interact with by policy.
+  // This should only be used for 1. Serialization when initializing renderers
+  // or 2. Called from utility methods above. For all other uses, call utility
+  // methods instead (e.g. CanAccessPage()).
+  static const URLPatternSet& default_policy_blocked_hosts();
+
+  // Returns list of hosts this extension may interact with regardless of
+  // what is defined by policy_blocked_hosts().
+  // This should only be used for 1. Serialization when initializing renderers
+  // or 2. Called from utility methods above. For all other uses, call utility
+  // methods instead (e.g. CanAccessPage()).
+  static const URLPatternSet& default_policy_allowed_hosts();
+
+  // Returns list of hosts this extension may not interact with by policy.
+  // This should only be used for 1. Serialization when initializing renderers
+  // or 2. Called from utility methods above. For all other uses, call utility
+  // methods instead (e.g. CanAccessPage()).
+  const URLPatternSet policy_blocked_hosts() const;
+
+  // Returns list of hosts this extension may interact with regardless of
+  // what is defined by policy_blocked_hosts().
+  // This should only be used for 1. Serialization when initializing renderers
+  // or 2. Called from utility methods above. For all other uses, call utility
+  // methods instead (e.g. CanAccessPage()).
+  const URLPatternSet policy_allowed_hosts() const;
+
 #if defined(UNIT_TEST)
   const PermissionSet* GetTabSpecificPermissionsForTesting(int tab_id) const {
     base::AutoLock auto_lock(runtime_lock_);
     return GetTabSpecificPermissions(tab_id);
   }
+
+  bool IsRuntimeBlockedHostForTesting(const GURL& url) const {
+    base::AutoLock auto_lock(runtime_lock_);
+    return IsRuntimeBlockedHost(url);
+  }
 #endif
 
  private:
@@ -233,6 +289,17 @@
                           const URLPatternSet& withheld_url_patterns,
                           std::string* error) const;
 
+  // Check if a specific URL is blocked by policy from extension use at runtime.
+  bool IsRuntimeBlockedHost(const GURL& url) const;
+
+  // Same as policy_blocked_hosts but instead returns a reference.
+  // You must acquire runtime_lock_ before calling this.
+  const URLPatternSet& PolicyBlockedHostsUnsafe() const;
+
+  // Same as policy_allowed_hosts but instead returns a reference.
+  // You must acquire runtime_lock_ before calling this.
+  const URLPatternSet& PolicyAllowedHostsUnsafe() const;
+
   // The associated extension's id.
   std::string extension_id_;
 
@@ -255,6 +322,20 @@
   // withheld_permissions() accessor.
   mutable std::unique_ptr<const PermissionSet> withheld_permissions_unsafe_;
 
+  // The list of hosts an extension may not interact with by policy.
+  // Unless you need to change |policy_blocked_hosts_unsafe_|, use the (safe)
+  // policy_blocked_hosts() accessor.
+  mutable URLPatternSet policy_blocked_hosts_unsafe_;
+
+  // The exclusive list of hosts an extension may interact with by policy.
+  // Unless you need to change |policy_allowed_hosts_unsafe_|, use the (safe)
+  // policy_allowed_hosts() accessor.
+  mutable URLPatternSet policy_allowed_hosts_unsafe_;
+
+  // If the ExtensionSettings policy is not being used, or no per-extension
+  // exception to the default policy was declared for this extension.
+  mutable bool uses_default_policy_host_restrictions = true;
+
   mutable TabPermissionsMap tab_specific_permissions_;
 
   mutable std::unique_ptr<base::ThreadChecker> thread_checker_;
diff --git a/extensions/common/url_pattern.cc b/extensions/common/url_pattern.cc
index 5677fbc83..dba84a5 100644
--- a/extensions/common/url_pattern.cc
+++ b/extensions/common/url_pattern.cc
@@ -141,12 +141,14 @@
     : valid_schemes_(SCHEME_NONE),
       match_all_urls_(false),
       match_subdomains_(false),
+      match_effective_tld_(true),
       port_("*") {}
 
 URLPattern::URLPattern(int valid_schemes)
     : valid_schemes_(valid_schemes),
       match_all_urls_(false),
       match_subdomains_(false),
+      match_effective_tld_(true),
       port_("*") {}
 
 URLPattern::URLPattern(int valid_schemes, base::StringPiece pattern)
@@ -155,6 +157,7 @@
     : valid_schemes_(valid_schemes),
       match_all_urls_(false),
       match_subdomains_(false),
+      match_effective_tld_(true),
       port_("*") {
   ParseResult result = Parse(pattern);
   if (PARSE_SUCCESS != result)
@@ -183,9 +186,15 @@
 }
 
 URLPattern::ParseResult URLPattern::Parse(base::StringPiece pattern) {
+  return Parse(pattern, DENY_WILDCARD_FOR_EFFECTIVE_TLD);
+}
+
+URLPattern::ParseResult URLPattern::Parse(base::StringPiece pattern,
+                                          ParseOptions parse_options) {
   spec_.clear();
   SetMatchAllURLs(false);
   SetMatchSubdomains(false);
+  SetMatchEffectiveTld(true);
   SetPort("*");
 
   // Special case pattern to match every valid URL.
@@ -267,6 +276,14 @@
       host_components.erase(host_components.begin(),
                             host_components.begin() + 1);
     }
+
+    // If explicitly allowed, the last component can optionally be '*' to
+    // match all effective TLDs.
+    if (parse_options == ALLOW_WILDCARD_FOR_EFFECTIVE_TLD &&
+        host_components.size() > 1 && host_components.back() == "*") {
+      match_effective_tld_ = false;
+      host_components.pop_back();
+    }
     host_ = base::JoinString(host_components, ".");
 
     path_start_pos = host_end_pos;
@@ -321,6 +338,11 @@
   match_subdomains_ = val;
 }
 
+void URLPattern::SetMatchEffectiveTld(bool val) {
+  spec_.clear();
+  match_effective_tld_ = val;
+}
+
 bool URLPattern::SetScheme(base::StringPiece scheme) {
   spec_.clear();
   scheme.CopyToString(&scheme_);
@@ -421,10 +443,19 @@
 }
 
 bool URLPattern::MatchesHost(const GURL& test) const {
-  const base::StringPiece test_host(
-      CanonicalizeHostForMatching(test.host_piece()));
+  base::StringPiece test_host(CanonicalizeHostForMatching(test.host_piece()));
   const base::StringPiece pattern_host(CanonicalizeHostForMatching(host_));
 
+  // If we don't care about matching the effective TLD, remove it.
+  if (!match_effective_tld_) {
+    int reg_length = net::registry_controlled_domains::GetRegistryLength(
+        test, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+        net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
+    if (reg_length > 0) {
+      test_host = test_host.substr(0, test_host.size() - reg_length - 1);
+    }
+  }
+
   // If the hosts are exactly equal, we have a match.
   if (test_host == pattern_host)
     return true;
@@ -529,6 +560,12 @@
     if (!host_.empty())
       spec += host_;
 
+    if (!match_effective_tld_) {
+      if (!host_.empty())
+        spec += ".";
+      spec += "*";
+    }
+
     if (port_ != "*") {
       spec += ":";
       spec += port_;
diff --git a/extensions/common/url_pattern.h b/extensions/common/url_pattern.h
index 23f06878..efb93fa 100644
--- a/extensions/common/url_pattern.h
+++ b/extensions/common/url_pattern.h
@@ -81,6 +81,12 @@
     NUM_PARSE_RESULTS
   };
 
+  // Types of URLPattern that Parse() considers valid.
+  enum ParseOptions {
+    DENY_WILDCARD_FOR_EFFECTIVE_TLD,
+    ALLOW_WILDCARD_FOR_EFFECTIVE_TLD,
+  };
+
   // The <all_urls> string pattern.
   static const char kAllUrlsPattern[];
 
@@ -107,8 +113,10 @@
   // Initializes this instance by parsing the provided string. Returns
   // URLPattern::PARSE_SUCCESS on success, or an error code otherwise. On
   // failure, this instance will have some intermediate values and is in an
-  // invalid state.
+  // invalid state. If you want to allow the match pattern to specify a wildcard
+  // for the effective TLD, specify in |parse_options|.
   ParseResult Parse(base::StringPiece pattern_str);
+  ParseResult Parse(base::StringPiece pattern_str, ParseOptions parse_options);
 
   // Gets the bitmask of valid schemes.
   int valid_schemes() const { return valid_schemes_; }
@@ -123,6 +131,15 @@
   bool match_subdomains() const { return match_subdomains_; }
   void SetMatchSubdomains(bool val);
 
+  // Gets whether host() contains an effective TLD. If false, during
+  // a match, the URL you're comparing must have its TLD removed
+  // prior to comparison.
+  // e.g. For the match pattern https://google.com/*
+  //      If this is true: host() would be google.com
+  //      If this is false: host() would be google
+  bool match_effective_tld() const { return match_effective_tld_; }
+  void SetMatchEffectiveTld(bool val);
+
   // Gets the path the pattern matches with the leading slash. This can have
   // embedded asterisks which are interpreted using glob rules.
   const std::string& path() const { return path_; }
@@ -247,6 +264,12 @@
   // component of the pattern's host was "*".
   bool match_subdomains_;
 
+  // Whether we should match the effective TLD of the host. This is true by
+  // default and only false if ParseOptions is ALLOW_WILDCARD_FOR_EFFECTIVE_TLD
+  // and is only applicable when the the pattern's host ends with ".*"
+  // (e.g. https://example.*/*).
+  bool match_effective_tld_;
+
   // The port.
   std::string port_;
 
diff --git a/extensions/common/url_pattern_unittest.cc b/extensions/common/url_pattern_unittest.cc
index 860d487..8c29964 100644
--- a/extensions/common/url_pattern_unittest.cc
+++ b/extensions/common/url_pattern_unittest.cc
@@ -30,19 +30,19 @@
     const char* pattern;
     URLPattern::ParseResult expected_result;
   } kInvalidPatterns[] = {
-    { "http", URLPattern::PARSE_ERROR_MISSING_SCHEME_SEPARATOR },
-    { "http:", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR },
-    { "http:/", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR },
-    { "about://", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR },
-    { "http://", URLPattern::PARSE_ERROR_EMPTY_HOST },
-    { "http:///", URLPattern::PARSE_ERROR_EMPTY_HOST },
-    { "http:// /", URLPattern::PARSE_ERROR_EMPTY_HOST },
-    { "http://*foo/bar", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD },
-    { "http://foo.*.bar/baz", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD },
-    { "http://fo.*.ba:123/baz", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD },
-    { "http:/bar", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR },
-    { "http://bar", URLPattern::PARSE_ERROR_EMPTY_PATH },
-  };
+      {"http", URLPattern::PARSE_ERROR_MISSING_SCHEME_SEPARATOR},
+      {"http:", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR},
+      {"http:/", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR},
+      {"about://", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR},
+      {"http://", URLPattern::PARSE_ERROR_EMPTY_HOST},
+      {"http:///", URLPattern::PARSE_ERROR_EMPTY_HOST},
+      {"http:// /", URLPattern::PARSE_ERROR_EMPTY_HOST},
+      {"http://*foo/bar", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD},
+      {"http://foo.*.bar/baz", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD},
+      {"http://fo.*.ba:123/baz", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD},
+      {"http:/bar", URLPattern::PARSE_ERROR_WRONG_SCHEME_SEPARATOR},
+      {"http://bar", URLPattern::PARSE_ERROR_EMPTY_PATH},
+      {"http://foo.*/bar", URLPattern::PARSE_ERROR_INVALID_HOST_WILDCARD}};
 
   for (size_t i = 0; i < arraysize(kInvalidPatterns); ++i) {
     URLPattern pattern(URLPattern::SCHEME_ALL);
@@ -67,30 +67,31 @@
     URLPattern::ParseResult expected_result;
     const char* expected_port;
   } kTestPatterns[] = {
-    { "http://foo:1234/", URLPattern::PARSE_SUCCESS, "1234" },
-    { "http://foo:1234/bar", URLPattern::PARSE_SUCCESS, "1234" },
-    { "http://*.foo:1234/", URLPattern::PARSE_SUCCESS, "1234" },
-    { "http://*.foo:1234/bar", URLPattern::PARSE_SUCCESS, "1234" },
-    { "http://:1234/", URLPattern::PARSE_SUCCESS, "1234" },
-    { "http://foo:/", URLPattern::PARSE_ERROR_INVALID_PORT, "*" },
-    { "http://foo:*/", URLPattern::PARSE_SUCCESS, "*" },
-    { "http://*.foo:/", URLPattern::PARSE_ERROR_INVALID_PORT, "*" },
-    { "http://foo:com/", URLPattern::PARSE_ERROR_INVALID_PORT, "*" },
-    { "http://foo:123456/", URLPattern::PARSE_ERROR_INVALID_PORT, "*" },
-    { "http://foo:80:80/monkey", URLPattern::PARSE_ERROR_INVALID_PORT, "*" },
-    { "file://foo:1234/bar", URLPattern::PARSE_SUCCESS, "*" },
-    { "chrome://foo:1234/bar", URLPattern::PARSE_ERROR_INVALID_PORT, "*" },
+      {"http://foo:1234/", URLPattern::PARSE_SUCCESS, "1234"},
+      {"http://foo:1234/bar", URLPattern::PARSE_SUCCESS, "1234"},
+      {"http://*.foo:1234/", URLPattern::PARSE_SUCCESS, "1234"},
+      {"http://*.foo:1234/bar", URLPattern::PARSE_SUCCESS, "1234"},
+      {"http://:1234/", URLPattern::PARSE_SUCCESS, "1234"},
+      {"http://foo:/", URLPattern::PARSE_ERROR_INVALID_PORT, "*"},
+      {"http://foo:*/", URLPattern::PARSE_SUCCESS, "*"},
+      {"http://*.foo:/", URLPattern::PARSE_ERROR_INVALID_PORT, "*"},
+      {"http://foo:com/", URLPattern::PARSE_ERROR_INVALID_PORT, "*"},
+      {"http://foo:123456/", URLPattern::PARSE_ERROR_INVALID_PORT, "*"},
+      {"http://foo:80:80/monkey", URLPattern::PARSE_ERROR_INVALID_PORT, "*"},
+      {"file://foo:1234/bar", URLPattern::PARSE_SUCCESS, "*"},
+      {"chrome://foo:1234/bar", URLPattern::PARSE_ERROR_INVALID_PORT, "*"},
 
-    // Port-like strings in the path should not trigger a warning.
-    { "http://*/:1234", URLPattern::PARSE_SUCCESS, "*" },
-    { "http://*.foo/bar:1234", URLPattern::PARSE_SUCCESS, "*" },
-    { "http://foo/bar:1234/path", URLPattern::PARSE_SUCCESS, "*" },
-  };
+      // Port-like strings in the path should not trigger a warning.
+      {"http://*/:1234", URLPattern::PARSE_SUCCESS, "*"},
+      {"http://*.foo/bar:1234", URLPattern::PARSE_SUCCESS, "*"},
+      {"http://foo/bar:1234/path", URLPattern::PARSE_SUCCESS, "*"},
+      {"http://*.foo.*/:1234", URLPattern::PARSE_SUCCESS, "*"}};
 
   for (size_t i = 0; i < arraysize(kTestPatterns); ++i) {
     URLPattern pattern(URLPattern::SCHEME_ALL);
     EXPECT_EQ(kTestPatterns[i].expected_result,
-              pattern.Parse(kTestPatterns[i].pattern))
+              pattern.Parse(kTestPatterns[i].pattern,
+                            URLPattern::ALLOW_WILDCARD_FOR_EFFECTIVE_TLD))
         << "Got unexpected result for URL pattern: "
         << kTestPatterns[i].pattern;
     EXPECT_EQ(kTestPatterns[i].expected_port, pattern.port())
@@ -105,6 +106,7 @@
   EXPECT_EQ("http", pattern.scheme());
   EXPECT_EQ("", pattern.host());
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("http://google.com")));
@@ -121,6 +123,7 @@
   EXPECT_EQ("https", pattern.scheme());
   EXPECT_EQ("", pattern.host());
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/foo*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("https://www.google.com/foo")));
@@ -139,6 +142,7 @@
   EXPECT_EQ("http", pattern.scheme());
   EXPECT_EQ("google.com", pattern.host());
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/foo*bar", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("http://google.com/foobar")));
@@ -159,6 +163,7 @@
   EXPECT_EQ("file", pattern.scheme());
   EXPECT_EQ("", pattern.host());
   EXPECT_FALSE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/foo?bar\\*baz", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("file:///foo?bar\\hellobaz")));
@@ -172,6 +177,7 @@
   EXPECT_EQ("http", pattern.scheme());
   EXPECT_EQ("127.0.0.1", pattern.host());
   EXPECT_FALSE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("http://127.0.0.1")));
@@ -185,6 +191,7 @@
   EXPECT_EQ("http", pattern.scheme());
   EXPECT_EQ("0.0.1", pattern.host());
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   // Subdomain matching is never done if the argument has an IP address host.
@@ -201,6 +208,7 @@
   EXPECT_EQ("http", pattern.scheme());
   EXPECT_EQ("xn--gkd", pattern.host());
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/a%C2%81%E1*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(
@@ -216,6 +224,7 @@
   EXPECT_EQ("chrome", pattern.scheme());
   EXPECT_EQ("favicon", pattern.host());
   EXPECT_FALSE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com")));
@@ -233,6 +242,7 @@
   EXPECT_FALSE(pattern.MatchesScheme("file"));
   EXPECT_FALSE(pattern.MatchesScheme("ftp"));
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("http://127.0.0.1")));
@@ -252,6 +262,7 @@
   EXPECT_TRUE(pattern.MatchesScheme("filesystem"));
   EXPECT_TRUE(pattern.MatchesScheme("chrome-extension"));
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_TRUE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com")));
@@ -287,6 +298,7 @@
   EXPECT_TRUE(pattern.MatchesScheme("about"));
   EXPECT_TRUE(pattern.MatchesScheme("chrome-extension"));
   EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_TRUE(pattern.match_all_urls());
   EXPECT_EQ("/*", pattern.path());
   EXPECT_TRUE(pattern.MatchesURL(GURL("chrome://favicon/http://google.com")));
@@ -338,6 +350,7 @@
   EXPECT_EQ("", pattern.host());
   EXPECT_FALSE(pattern.match_subdomains());
   EXPECT_FALSE(pattern.match_all_urls());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_EQ("/foo*", pattern.path());
   EXPECT_FALSE(pattern.MatchesURL(GURL("file://foo")));
   EXPECT_FALSE(pattern.MatchesURL(GURL("file://foobar")));
@@ -354,6 +367,7 @@
   EXPECT_EQ("", pattern.host());
   EXPECT_FALSE(pattern.match_subdomains());
   EXPECT_FALSE(pattern.match_all_urls());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_EQ("/foo*", pattern.path());
   EXPECT_FALSE(pattern.MatchesURL(GURL("file://foo")));
   EXPECT_FALSE(pattern.MatchesURL(GURL("file://foobar")));
@@ -370,6 +384,7 @@
   // Since hostname is ignored for file://.
   EXPECT_EQ("", pattern.host());
   EXPECT_FALSE(pattern.match_subdomains());
+  EXPECT_TRUE(pattern.match_effective_tld());
   EXPECT_FALSE(pattern.match_all_urls());
   EXPECT_EQ("/foo*", pattern.path());
   EXPECT_FALSE(pattern.MatchesURL(GURL("file://foo")));
@@ -437,6 +452,39 @@
       GURL("filesystem:chrome-extension://ftw/t/file.txt")));
 }
 
+// effective TLD wildcard
+TEST(URLPatternTest, EffectiveTldWildcard) {
+  URLPattern pattern(kAllSchemes);
+  EXPECT_EQ(URLPattern::PARSE_SUCCESS,
+            pattern.Parse("http://*.google.*/foo*bar",
+                          URLPattern::ALLOW_WILDCARD_FOR_EFFECTIVE_TLD));
+  EXPECT_EQ("http", pattern.scheme());
+  EXPECT_EQ("google", pattern.host());
+  EXPECT_TRUE(pattern.match_subdomains());
+  EXPECT_FALSE(pattern.match_effective_tld());
+  EXPECT_FALSE(pattern.match_all_urls());
+  EXPECT_EQ("/foo*bar", pattern.path());
+  EXPECT_TRUE(pattern.MatchesURL(GURL("http://google.com/foobar")));
+  EXPECT_TRUE(pattern.MatchesURL(GURL("http://www.google.com.br/foo?bar")));
+  EXPECT_TRUE(
+      pattern.MatchesURL(GURL("http://monkey.images.google.co.uk/foooobar")));
+  EXPECT_FALSE(pattern.MatchesURL(GURL("http://yahoo.com/foobar")));
+  EXPECT_TRUE(pattern.MatchesURL(GURL("filesystem:http://google.com/foo/bar")));
+  EXPECT_FALSE(pattern.MatchesURL(
+      GURL("filesystem:http://google.com/temporary/foobar")));
+  URLPattern pattern_sub(kAllSchemes);
+  EXPECT_EQ(URLPattern::PARSE_SUCCESS,
+            pattern_sub.Parse("https://maps.google.*/",
+                              URLPattern::ALLOW_WILDCARD_FOR_EFFECTIVE_TLD));
+  EXPECT_EQ("https", pattern_sub.scheme());
+  EXPECT_EQ("maps.google", pattern_sub.host());
+  EXPECT_FALSE(pattern_sub.match_subdomains());
+  EXPECT_FALSE(pattern_sub.match_all_urls());
+  EXPECT_EQ("/", pattern_sub.path());
+  EXPECT_TRUE(pattern_sub.MatchesURL(GURL("https://maps.google.co.uk/")));
+  EXPECT_FALSE(pattern_sub.MatchesURL(GURL("https://sub.maps.google.co.uk/")));
+}
+
 static const struct GetAsStringPatterns {
   const char* pattern;
 } kGetAsStringTestCases[] = {
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index 421e3711..c5c38777 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -922,6 +922,8 @@
   IPC_MESSAGE_HANDLER(ExtensionMsg_TransferBlobs, OnTransferBlobs)
   IPC_MESSAGE_HANDLER(ExtensionMsg_Unloaded, OnUnloaded)
   IPC_MESSAGE_HANDLER(ExtensionMsg_UpdatePermissions, OnUpdatePermissions)
+  IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateDefaultPolicyHostRestrictions,
+                      OnUpdateDefaultPolicyHostRestrictions)
   IPC_MESSAGE_HANDLER(ExtensionMsg_UpdateTabSpecificPermissions,
                       OnUpdateTabSpecificPermissions)
   IPC_MESSAGE_HANDLER(ExtensionMsg_ClearTabSpecificPermissions,
@@ -1045,7 +1047,6 @@
       extension_load_errors_[param.id] = error;
       continue;
     }
-
     RendererExtensionRegistry* extension_registry =
         RendererExtensionRegistry::Get();
     // TODO(kalman): This test is deliberately not a CHECK (though I wish it
@@ -1062,12 +1063,18 @@
       // consider making this a release CHECK.
       NOTREACHED();
     }
+    if (param.uses_default_policy_blocked_allowed_hosts) {
+      extension->permissions_data()->SetUsesDefaultHostRestrictions();
+    } else {
+      extension->permissions_data()->SetPolicyHostRestrictions(
+          param.policy_blocked_hosts, param.policy_allowed_hosts);
+    }
   }
 
   // Update the available bindings for all contexts. These may have changed if
   // an externally_connectable extension was loaded that can connect to an
   // open webpage.
-  UpdateBindings("");
+  UpdateBindings(std::string());
 }
 
 void Dispatcher::OnMessageInvoke(const std::string& extension_id,
@@ -1194,6 +1201,13 @@
   // extension's URL just won't match anything anymore.
 }
 
+void Dispatcher::OnUpdateDefaultPolicyHostRestrictions(
+    const ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params& params) {
+  PermissionsData::SetDefaultPolicyHostRestrictions(
+      params.default_policy_blocked_hosts, params.default_policy_allowed_hosts);
+  UpdateBindings(std::string());
+}
+
 void Dispatcher::OnUpdatePermissions(
     const ExtensionMsg_UpdatePermissions_Params& params) {
   const Extension* extension =
@@ -1213,6 +1227,12 @@
 
   extension->permissions_data()->SetPermissions(std::move(active),
                                                 std::move(withheld));
+  if (params.uses_default_policy_host_restrictions) {
+    extension->permissions_data()->SetUsesDefaultHostRestrictions();
+  } else {
+    extension->permissions_data()->SetPolicyHostRestrictions(
+        params.policy_blocked_hosts, params.policy_allowed_hosts);
+  }
   UpdateBindings(extension->id());
 }
 
diff --git a/extensions/renderer/dispatcher.h b/extensions/renderer/dispatcher.h
index 29b7bb8..4ef3c004 100644
--- a/extensions/renderer/dispatcher.h
+++ b/extensions/renderer/dispatcher.h
@@ -42,6 +42,7 @@
 struct ExtensionMsg_Loaded_Params;
 struct ExtensionMsg_TabConnectionInfo;
 struct ExtensionMsg_UpdatePermissions_Params;
+struct ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params;
 
 namespace blink {
 class WebLocalFrame;
@@ -183,6 +184,8 @@
   void OnTransferBlobs(const std::vector<std::string>& blob_uuids);
   void OnUnloaded(const std::string& id);
   void OnUpdatePermissions(const ExtensionMsg_UpdatePermissions_Params& params);
+  void OnUpdateDefaultPolicyHostRestrictions(
+      const ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params& params);
   void OnUpdateTabSpecificPermissions(const GURL& visible_url,
                                       const std::string& extension_id,
                                       const URLPatternSet& new_hosts,
diff --git a/ios/chrome/browser/payments/cells/BUILD.gn b/ios/chrome/browser/payments/cells/BUILD.gn
index 892e720..123a96a 100644
--- a/ios/chrome/browser/payments/cells/BUILD.gn
+++ b/ios/chrome/browser/payments/cells/BUILD.gn
@@ -10,6 +10,7 @@
     "page_info_item.mm",
     "payment_method_item.h",
     "payment_method_item.mm",
+    "payments_has_accessory_type.h",
     "payments_text_item.h",
     "payments_text_item.mm",
     "price_item.h",
diff --git a/ios/chrome/browser/payments/cells/autofill_profile_item.h b/ios/chrome/browser/payments/cells/autofill_profile_item.h
index bae30c8..6ba0da8 100644
--- a/ios/chrome/browser/payments/cells/autofill_profile_item.h
+++ b/ios/chrome/browser/payments/cells/autofill_profile_item.h
@@ -7,11 +7,12 @@
 
 #import <UIKit/UIKit.h>
 
+#import "ios/chrome/browser/payments/cells/payments_has_accessory_type.h"
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
 #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
 
 // AutofillProfileItem is the model class corresponding to AutofillProfileCell.
-@interface AutofillProfileItem : CollectionViewItem
+@interface AutofillProfileItem : CollectionViewItem<PaymentsHasAccessoryType>
 
 // Profile's name.
 @property(nonatomic, copy) NSString* name;
@@ -28,9 +29,6 @@
 // The notification message.
 @property(nonatomic, copy) NSString* notification;
 
-// The accessory type for the represented cell.
-@property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType;
-
 @end
 
 // AutofillProfileItem implements an MDCCollectionViewCell subclass containing
diff --git a/ios/chrome/browser/payments/cells/payment_method_item.h b/ios/chrome/browser/payments/cells/payment_method_item.h
index 0713ec9..5b6f4fc3 100644
--- a/ios/chrome/browser/payments/cells/payment_method_item.h
+++ b/ios/chrome/browser/payments/cells/payment_method_item.h
@@ -7,11 +7,12 @@
 
 #import <UIKit/UIKit.h>
 
+#import "ios/chrome/browser/payments/cells/payments_has_accessory_type.h"
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
 #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
 
 // PaymentMethodItem is the model class corresponding to PaymentMethodCell.
-@interface PaymentMethodItem : CollectionViewItem
+@interface PaymentMethodItem : CollectionViewItem<PaymentsHasAccessoryType>
 
 // A unique identifier for the payment method (for example, the type and last 4
 // digits of a credit card).
@@ -36,9 +37,6 @@
 // has the same size regardless of whether the accessory type is set.
 @property(nonatomic, assign) BOOL reserveRoomForAccessoryType;
 
-// The accessory type to be shown in the cell.
-@property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType;
-
 @end
 
 // PaymentMethodCell implements an MDCCollectionViewCell subclass containing
diff --git a/ios/chrome/browser/payments/cells/payments_has_accessory_type.h b/ios/chrome/browser/payments/cells/payments_has_accessory_type.h
new file mode 100644
index 0000000..8ca597c
--- /dev/null
+++ b/ios/chrome/browser/payments/cells/payments_has_accessory_type.h
@@ -0,0 +1,19 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_HAS_ACCESSORY_TYPE_H_
+#define IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_HAS_ACCESSORY_TYPE_H_
+
+#import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
+
+// Protocol adopted by the payments collection view items that set the accessory
+// view type on their represented cells.
+@protocol PaymentsHasAccessoryType
+
+// The accessory view type for the represented cell.
+@property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_PAYMENTS_CELLS_PAYMENTS_HAS_ACCESSORY_TYPE_H_
diff --git a/ios/chrome/browser/payments/cells/payments_text_item.h b/ios/chrome/browser/payments/cells/payments_text_item.h
index 8308ac2..bef73e2 100644
--- a/ios/chrome/browser/payments/cells/payments_text_item.h
+++ b/ios/chrome/browser/payments/cells/payments_text_item.h
@@ -7,11 +7,12 @@
 
 #import <UIKit/UIKit.h>
 
+#import "ios/chrome/browser/payments/cells/payments_has_accessory_type.h"
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
 #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
 
 // PaymentsTextItem is the model class corresponding to PaymentsTextCell.
-@interface PaymentsTextItem : CollectionViewItem
+@interface PaymentsTextItem : CollectionViewItem<PaymentsHasAccessoryType>
 
 // The main text to display.
 @property(nonatomic, copy) NSString* text;
diff --git a/ios/chrome/browser/payments/cells/price_item.h b/ios/chrome/browser/payments/cells/price_item.h
index ee8d71c..39ad3e0 100644
--- a/ios/chrome/browser/payments/cells/price_item.h
+++ b/ios/chrome/browser/payments/cells/price_item.h
@@ -7,14 +7,12 @@
 
 #import <UIKit/UIKit.h>
 
+#import "ios/chrome/browser/payments/cells/payments_has_accessory_type.h"
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
 #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
 
 // PriceItem is the model class corresponding to PriceCell.
-@interface PriceItem : CollectionViewItem
-
-// The accessory type to display on the trailing edge of the cell.
-@property(nonatomic) MDCCollectionViewCellAccessoryType accessoryType;
+@interface PriceItem : CollectionViewItem<PaymentsHasAccessoryType>
 
 // The leading item string.
 @property(nonatomic, copy) NSString* item;
diff --git a/ios/chrome/browser/ui/collection_view/cells/BUILD.gn b/ios/chrome/browser/ui/collection_view/cells/BUILD.gn
index f1eb535..db0bada 100644
--- a/ios/chrome/browser/ui/collection_view/cells/BUILD.gn
+++ b/ios/chrome/browser/ui/collection_view/cells/BUILD.gn
@@ -14,6 +14,7 @@
     "collection_view_detail_item.mm",
     "collection_view_footer_item.h",
     "collection_view_footer_item.mm",
+    "collection_view_item+collection_view_controller.h",
     "collection_view_item.h",
     "collection_view_item.mm",
     "collection_view_switch_item.h",
diff --git a/ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h b/ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h
new file mode 100644
index 0000000..28fb5c0
--- /dev/null
+++ b/ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h
@@ -0,0 +1,21 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_COLLECTION_VIEW_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_COLLECTION_VIEW_CONTROLLER_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
+
+// CollectionViewItem can be created with a default item type but it needs to
+// have a valid item type to be inserted in the model. Only the
+// CollectionViewController managing the item is allowed to set the item type.
+@interface CollectionViewItem (CollectionViewController)
+
+@property(nonatomic, readwrite, assign) NSInteger type;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_COLLECTION_VIEW_CELLS_COLLECTION_VIEW_ITEM_COLLECTION_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/collection_view/cells/collection_view_item.h b/ios/chrome/browser/ui/collection_view/cells/collection_view_item.h
index 78be71e..e411471 100644
--- a/ios/chrome/browser/ui/collection_view/cells/collection_view_item.h
+++ b/ios/chrome/browser/ui/collection_view/cells/collection_view_item.h
@@ -21,7 +21,6 @@
 @property(nonatomic, assign) Class cellClass;
 
 - (instancetype)initWithType:(NSInteger)type NS_DESIGNATED_INITIALIZER;
-- (instancetype)init NS_UNAVAILABLE;
 
 // Configures the given cell with the item's information. Override this method
 // to specialize. At this level, only accessibility properties are ported from
diff --git a/ios/chrome/browser/ui/collection_view/cells/collection_view_item.mm b/ios/chrome/browser/ui/collection_view/cells/collection_view_item.mm
index f4cc10d..3daa7ea 100644
--- a/ios/chrome/browser/ui/collection_view/cells/collection_view_item.mm
+++ b/ios/chrome/browser/ui/collection_view/cells/collection_view_item.mm
@@ -5,6 +5,7 @@
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
 
 #import "base/logging.h"
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h"
 #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
@@ -26,8 +27,7 @@
 }
 
 - (instancetype)init {
-  NOTREACHED();
-  return nil;
+  return [self initWithType:0];
 }
 
 - (void)setCellClass:(Class)cellClass {
@@ -42,3 +42,11 @@
 }
 
 @end
+
+@implementation CollectionViewItem (CollectionViewController)
+
+- (void)setType:(NSInteger)type {
+  _type = type;
+}
+
+@end
diff --git a/ios/chrome/browser/ui/collection_view/cells/collection_view_item_unittest.mm b/ios/chrome/browser/ui/collection_view/cells/collection_view_item_unittest.mm
index 7e2a32d8..5642c3b4 100644
--- a/ios/chrome/browser/ui/collection_view/cells/collection_view_item_unittest.mm
+++ b/ios/chrome/browser/ui/collection_view/cells/collection_view_item_unittest.mm
@@ -4,6 +4,7 @@
 
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
 
+#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item+collection_view_controller.h"
 #import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -19,6 +20,13 @@
 
   EXPECT_EQ(5, [five type]);
   EXPECT_EQ(12, [twelve type]);
+
+  // Test setting the type property used in CollectionViewController.
+  [five setType:55];
+  EXPECT_EQ(55, [five type]);
+
+  [twelve setType:1212];
+  EXPECT_EQ(1212, [twelve type]);
 }
 
 TEST(CollectionViewItemTest, ConfigureCellPortsAccessibilityProperties) {
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc
index 2f16c20..6c76522 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -374,7 +374,8 @@
       power_line_frequency_(power_line_frequency),
       is_capturing_(false),
       timeout_count_(0),
-      rotation_(0) {}
+      rotation_(0),
+      weak_factory_(this) {}
 
 void V4L2CaptureDelegate::AllocateAndStart(
     int width,
@@ -506,7 +507,7 @@
 
   // Post task to start fetching frames from v4l2.
   v4l2_task_runner_->PostTask(
-      FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, this));
+      FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, GetWeakPtr()));
 }
 
 void V4L2CaptureDelegate::StopAndDeAllocate() {
@@ -714,6 +715,10 @@
   rotation_ = rotation;
 }
 
+base::WeakPtr<V4L2CaptureDelegate> V4L2CaptureDelegate::GetWeakPtr() {
+  return weak_factory_.GetWeakPtr();
+}
+
 V4L2CaptureDelegate::~V4L2CaptureDelegate() {}
 
 bool V4L2CaptureDelegate::MapAndQueueBuffer(int index) {
@@ -820,7 +825,7 @@
   }
 
   v4l2_task_runner_->PostTask(
-      FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, this));
+      FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, GetWeakPtr()));
 }
 
 void V4L2CaptureDelegate::SetErrorState(
diff --git a/media/capture/video/linux/v4l2_capture_delegate.h b/media/capture/video/linux/v4l2_capture_delegate.h
index 82896bb..281cd11 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.h
+++ b/media/capture/video/linux/v4l2_capture_delegate.h
@@ -10,7 +10,6 @@
 
 #include "base/files/scoped_file.h"
 #include "base/macros.h"
-#include "base/memory/ref_counted.h"
 #include "build/build_config.h"
 #include "media/capture/video/video_capture_device.h"
 
@@ -27,11 +26,9 @@
 namespace media {
 
 // Class doing the actual Linux capture using V4L2 API. V4L2 SPLANE/MPLANE
-// capture specifics are implemented in derived classes. Created and destroyed
-// on the owner's thread, otherwise living and operating on |v4l2_task_runner_|.
-// TODO(mcasas): Make this class a non-ref-counted.
-class CAPTURE_EXPORT V4L2CaptureDelegate final
-    : public base::RefCountedThreadSafe<V4L2CaptureDelegate> {
+// capture specifics are implemented in derived classes. Created on the owner's
+// thread, otherwise living, operating and destroyed on |v4l2_task_runner_|.
+class CAPTURE_EXPORT V4L2CaptureDelegate final {
  public:
   // Retrieves the #planes for a given |fourcc|, or 0 if unknown.
   static size_t GetNumPlanesForFourCc(uint32_t fourcc);
@@ -47,6 +44,7 @@
       const VideoCaptureDeviceDescriptor& device_descriptor,
       const scoped_refptr<base::SingleThreadTaskRunner>& v4l2_task_runner,
       int power_line_frequency);
+  ~V4L2CaptureDelegate();
 
   // Forward-to versions of VideoCaptureDevice virtual methods.
   void AllocateAndStart(int width,
@@ -64,12 +62,11 @@
 
   void SetRotation(int rotation);
 
+  base::WeakPtr<V4L2CaptureDelegate> GetWeakPtr();
+
  private:
   friend class V4L2CaptureDelegateTest;
 
-  friend class base::RefCountedThreadSafe<V4L2CaptureDelegate>;
-  ~V4L2CaptureDelegate();
-
   class BufferTracker;
 
   // VIDIOC_QUERYBUFs a buffer from V4L2, creates a BufferTracker for it and
@@ -104,6 +101,8 @@
   // Clockwise rotation in degrees. This value should be 0, 90, 180, or 270.
   int rotation_;
 
+  base::WeakPtrFactory<V4L2CaptureDelegate> weak_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(V4L2CaptureDelegate);
 };
 
diff --git a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
index e8f586e2..a22cf59f 100644
--- a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
@@ -213,14 +213,15 @@
  public:
   V4L2CaptureDelegateTest()
       : device_descriptor_("Device 0", "/dev/video0"),
-        delegate_(new V4L2CaptureDelegate(device_descriptor_,
-                                          base::ThreadTaskRunnerHandle::Get(),
-                                          50)) {}
+        delegate_(base::MakeUnique<V4L2CaptureDelegate>(
+            device_descriptor_,
+            base::ThreadTaskRunnerHandle::Get(),
+            50)) {}
   ~V4L2CaptureDelegateTest() override = default;
 
   base::MessageLoop loop_;
   VideoCaptureDeviceDescriptor device_descriptor_;
-  scoped_refptr<V4L2CaptureDelegate> delegate_;
+  std::unique_ptr<V4L2CaptureDelegate> delegate_;
 };
 
 }  // anonymous namespace
diff --git a/media/capture/video/linux/video_capture_device_linux.cc b/media/capture/video/linux/video_capture_device_linux.cc
index d9b25b4..ff0402b 100644
--- a/media/capture/video/linux/video_capture_device_linux.cc
+++ b/media/capture/video/linux/video_capture_device_linux.cc
@@ -57,7 +57,7 @@
 
   const int line_frequency =
       TranslatePowerLineFrequencyToV4L2(GetPowerLineFrequency(params));
-  capture_impl_ = new V4L2CaptureDelegate(
+  capture_impl_ = base::MakeUnique<V4L2CaptureDelegate>(
       device_descriptor_, v4l2_thread_.task_runner(), line_frequency);
   if (!capture_impl_) {
     client->OnError(FROM_HERE, "Failed to create VideoCaptureDelegate");
@@ -65,7 +65,8 @@
   }
   v4l2_thread_.task_runner()->PostTask(
       FROM_HERE,
-      base::Bind(&V4L2CaptureDelegate::AllocateAndStart, capture_impl_,
+      base::Bind(&V4L2CaptureDelegate::AllocateAndStart,
+                 capture_impl_->GetWeakPtr(),
                  params.requested_format.frame_size.width(),
                  params.requested_format.frame_size.height(),
                  params.requested_format.frame_rate, base::Passed(&client)));
@@ -79,8 +80,9 @@
   if (!v4l2_thread_.IsRunning())
     return;  // Wrong state.
   v4l2_thread_.task_runner()->PostTask(
-      FROM_HERE,
-      base::Bind(&V4L2CaptureDelegate::StopAndDeAllocate, capture_impl_));
+      FROM_HERE, base::Bind(&V4L2CaptureDelegate::StopAndDeAllocate,
+                            capture_impl_->GetWeakPtr()));
+  v4l2_thread_.task_runner()->DeleteSoon(FROM_HERE, capture_impl_.release());
   v4l2_thread_.Stop();
 
   capture_impl_ = nullptr;
@@ -88,8 +90,9 @@
 
 void VideoCaptureDeviceLinux::TakePhoto(TakePhotoCallback callback) {
   DCHECK(capture_impl_);
-  auto functor = base::Bind(&V4L2CaptureDelegate::TakePhoto, capture_impl_,
-                            base::Passed(&callback));
+  auto functor =
+      base::Bind(&V4L2CaptureDelegate::TakePhoto, capture_impl_->GetWeakPtr(),
+                 base::Passed(&callback));
   if (!v4l2_thread_.IsRunning()) {
     // We have to wait until we get the device AllocateAndStart()ed.
     photo_requests_queue_.push_back(std::move(functor));
@@ -100,8 +103,9 @@
 
 void VideoCaptureDeviceLinux::GetPhotoCapabilities(
     GetPhotoCapabilitiesCallback callback) {
-  auto functor = base::Bind(&V4L2CaptureDelegate::GetPhotoCapabilities,
-                            capture_impl_, base::Passed(&callback));
+  auto functor =
+      base::Bind(&V4L2CaptureDelegate::GetPhotoCapabilities,
+                 capture_impl_->GetWeakPtr(), base::Passed(&callback));
   if (!v4l2_thread_.IsRunning()) {
     // We have to wait until we get the device AllocateAndStart()ed.
     photo_requests_queue_.push_back(std::move(functor));
@@ -113,9 +117,9 @@
 void VideoCaptureDeviceLinux::SetPhotoOptions(
     mojom::PhotoSettingsPtr settings,
     SetPhotoOptionsCallback callback) {
-  auto functor =
-      base::Bind(&V4L2CaptureDelegate::SetPhotoOptions, capture_impl_,
-                 base::Passed(&settings), base::Passed(&callback));
+  auto functor = base::Bind(&V4L2CaptureDelegate::SetPhotoOptions,
+                            capture_impl_->GetWeakPtr(),
+                            base::Passed(&settings), base::Passed(&callback));
   if (!v4l2_thread_.IsRunning()) {
     // We have to wait until we get the device AllocateAndStart()ed.
     photo_requests_queue_.push_back(std::move(functor));
@@ -127,8 +131,8 @@
 void VideoCaptureDeviceLinux::SetRotation(int rotation) {
   if (v4l2_thread_.IsRunning()) {
     v4l2_thread_.task_runner()->PostTask(
-        FROM_HERE,
-        base::Bind(&V4L2CaptureDelegate::SetRotation, capture_impl_, rotation));
+        FROM_HERE, base::Bind(&V4L2CaptureDelegate::SetRotation,
+                              capture_impl_->GetWeakPtr(), rotation));
   }
 }
 
diff --git a/media/capture/video/linux/video_capture_device_linux.h b/media/capture/video/linux/video_capture_device_linux.h
index f836800..abc7b2d 100644
--- a/media/capture/video/linux/video_capture_device_linux.h
+++ b/media/capture/video/linux/video_capture_device_linux.h
@@ -53,9 +53,10 @@
   static int TranslatePowerLineFrequencyToV4L2(PowerLineFrequency frequency);
 
   // Internal delegate doing the actual capture setting, buffer allocation and
-  // circulation with the V4L2 API. Created and deleted in the thread where
-  // VideoCaptureDeviceLinux lives but otherwise operating on |v4l2_thread_|.
-  scoped_refptr<V4L2CaptureDelegate> capture_impl_;
+  // circulation with the V4L2 API. Created in the thread where
+  // VideoCaptureDeviceLinux lives but otherwise operating and deleted on
+  // |v4l2_thread_|.
+  std::unique_ptr<V4L2CaptureDelegate> capture_impl_;
 
   // Photo-related requests waiting for |v4l2_thread_| to be active.
   std::list<base::Closure> photo_requests_queue_;
diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn
index ce1af0b..ef11c693 100644
--- a/mojo/public/cpp/bindings/BUILD.gn
+++ b/mojo/public/cpp/bindings/BUILD.gn
@@ -185,7 +185,7 @@
 
     public_deps = [
       ":bindings",
-      "//third_party/WebKit/Source/wtf",
+      "//third_party/WebKit/Source/platform/wtf",
     ]
 
     public_configs = [ "//third_party/WebKit/Source:config" ]
diff --git a/net/cert/cert_verify_proc_android.cc b/net/cert/cert_verify_proc_android.cc
index 31d68d7..d2a2112 100644
--- a/net/cert/cert_verify_proc_android.cc
+++ b/net/cert/cert_verify_proc_android.cc
@@ -24,7 +24,6 @@
 #include "net/cert/internal/parsed_certificate.h"
 #include "net/cert/x509_certificate.h"
 #include "net/cert/x509_util.h"
-#include "third_party/boringssl/src/include/openssl/x509v3.h"
 #include "url/gurl.h"
 
 namespace net {
diff --git a/net/cert/internal/signature_policy.cc b/net/cert/internal/signature_policy.cc
index 8f86b208..81896a99 100644
--- a/net/cert/internal/signature_policy.cc
+++ b/net/cert/internal/signature_policy.cc
@@ -7,7 +7,7 @@
 #include "base/logging.h"
 #include "net/cert/internal/cert_error_params.h"
 #include "net/cert/internal/cert_errors.h"
-#include "third_party/boringssl/src/include/openssl/obj.h"
+#include "third_party/boringssl/src/include/openssl/nid.h"
 
 namespace net {
 
diff --git a/net/cert/internal/verify_signed_data_unittest.cc b/net/cert/internal/verify_signed_data_unittest.cc
index 1f72903..70a9463 100644
--- a/net/cert/internal/verify_signed_data_unittest.cc
+++ b/net/cert/internal/verify_signed_data_unittest.cc
@@ -15,7 +15,7 @@
 #include "net/der/parse_values.h"
 #include "net/der/parser.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/boringssl/src/include/openssl/obj.h"
+#include "third_party/boringssl/src/include/openssl/nid.h"
 
 namespace net {
 
diff --git a/net/cert/x509_certificate_ios.cc b/net/cert/x509_certificate_ios.cc
index 0c3f162..df8482f 100644
--- a/net/cert/x509_certificate_ios.cc
+++ b/net/cert/x509_certificate_ios.cc
@@ -39,6 +39,15 @@
   return sanity_check != nullptr;
 }
 
+bssl::UniquePtr<X509> OSCertHandleToOpenSSL(
+    X509Certificate::OSCertHandle os_handle) {
+  std::string der_encoded;
+  if (!X509Certificate::GetDEREncoded(os_handle, &der_encoded))
+    return nullptr;
+  const uint8_t* bytes = reinterpret_cast<const uint8_t*>(der_encoded.data());
+  return bssl::UniquePtr<X509>(d2i_X509(nullptr, &bytes, der_encoded.size()));
+}
+
 void CreateOSCertHandlesFromPKCS7Bytes(
     const char* data,
     size_t length,
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index 1828d6f..0be676c 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -125,7 +125,6 @@
       mark_quic_broken_when_network_blackholes(false),
       retry_without_alt_svc_on_quic_errors(false),
       quic_always_require_handshake_confirmation(false),
-      quic_disable_connection_pooling(false),
       quic_load_server_info_timeout_srtt_multiplier(0.25f),
       quic_enable_connection_racing(false),
       quic_enable_non_blocking_io(false),
@@ -197,7 +196,6 @@
           params.quic_user_agent_id,
           params.quic_supported_versions,
           params.quic_always_require_handshake_confirmation,
-          params.quic_disable_connection_pooling,
           params.quic_load_server_info_timeout_srtt_multiplier,
           params.quic_enable_connection_racing,
           params.quic_enable_non_blocking_io,
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index acd61d32..1645a3f3 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -127,8 +127,6 @@
     bool retry_without_alt_svc_on_quic_errors;
     // Disables QUIC's 0-RTT behavior.
     bool quic_always_require_handshake_confirmation;
-    // Disables QUIC connection pooling.
-    bool quic_disable_connection_pooling;
     // If not zero, the task to load QUIC server configs from the disk cache
     // will timeout after this value multiplied by the smoothed RTT for the
     // server.
@@ -178,8 +176,6 @@
     int quic_packet_reader_yield_after_duration_milliseconds;
     // If true, disable preconnections if QUIC can do 0RTT.
     bool quic_disable_preconnect_if_0rtt;
-    // List of hosts for which QUIC is explicitly whitelisted.
-    std::unordered_set<std::string> quic_host_whitelist;
     // If true, active QUIC sessions may be migrated onto a new network when
     // the platform indicates that the default network is changing.
     bool quic_migrate_sessions_on_network_change;
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc
index 440bf4ac..a8a638b 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -915,20 +915,6 @@
   return url;
 }
 
-bool HttpStreamFactoryImpl::JobController::IsQuicWhitelistedForHost(
-    const std::string& host) {
-  bool whitelist_needed = false;
-  // The QUIC whitelist is not needed in QUIC versions after 30.
-  if (!whitelist_needed)
-    return true;
-
-  if (session_->params().transport_security_state->IsGooglePinnedHost(host))
-    return true;
-
-  return base::ContainsKey(session_->params().quic_host_whitelist,
-                           base::ToLowerASCII(host));
-}
-
 AlternativeService
 HttpStreamFactoryImpl::JobController::GetAlternativeServiceFor(
     const HttpRequestInfo& request_info,
@@ -1028,9 +1014,6 @@
     if (!session_->IsQuicEnabled())
       continue;
 
-    if (!IsQuicWhitelistedForHost(origin.host()))
-      continue;
-
     if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM &&
         session_->params().quic_disable_bidirectional_streams) {
       continue;
diff --git a/net/http/http_stream_factory_impl_job_controller.h b/net/http/http_stream_factory_impl_job_controller.h
index d912459..d321fac 100644
--- a/net/http/http_stream_factory_impl_job_controller.h
+++ b/net/http/http_stream_factory_impl_job_controller.h
@@ -243,9 +243,6 @@
   // Resumes the main job immediately.
   void ResumeMainJob();
 
-  // Returns true if QUIC is whitelisted for |host|.
-  bool IsQuicWhitelistedForHost(const std::string& host);
-
   AlternativeService GetAlternativeServiceFor(
       const HttpRequestInfo& request_info,
       HttpStreamRequest::Delegate* delegate,
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index 50a1e26..188680a7 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -2246,7 +2246,6 @@
   void Initialize() {
     params_.enable_quic = true;
     params_.http_server_properties = &http_server_properties_;
-    params_.quic_host_whitelist.insert("www.example.org");
     params_.quic_random = &random_generator_;
     params_.quic_clock = &clock_;
 
diff --git a/net/quic/chromium/quic_network_transaction_unittest.cc b/net/quic/chromium/quic_network_transaction_unittest.cc
index b72a045..77eddbdb 100644
--- a/net/quic/chromium/quic_network_transaction_unittest.cc
+++ b/net/quic/chromium/quic_network_transaction_unittest.cc
@@ -532,12 +532,6 @@
     params_.http_server_properties = &http_server_properties_;
     params_.quic_supported_versions = SupportedVersions(version_);
     params_.net_log = net_log_.bound().net_log();
-    for (const char* host :
-         {kDefaultServerHostName, "www.example.org", "news.example.org",
-          "bar.example.org", "foo.example.org", "invalid.example.org",
-          "mail.example.com"}) {
-      params_.quic_host_whitelist.insert(host);
-    }
 
     session_.reset(new HttpNetworkSession(params_));
     session_->quic_stream_factory()->set_require_confirmation(false);
@@ -4244,9 +4238,6 @@
     params.http_auth_handler_factory = auth_handler_factory_.get();
     params.http_server_properties = &http_server_properties_;
     params.quic_supported_versions = SupportedVersions(version_);
-    params.quic_host_whitelist.insert("news.example.org");
-    params.quic_host_whitelist.insert("mail.example.org");
-    params.quic_host_whitelist.insert("mail.example.com");
 
     session_.reset(new HttpNetworkSession(params));
     session_->quic_stream_factory()->set_require_confirmation(true);
diff --git a/net/quic/chromium/quic_stream_factory.cc b/net/quic/chromium/quic_stream_factory.cc
index 23a622c5..91bf749 100644
--- a/net/quic/chromium/quic_stream_factory.cc
+++ b/net/quic/chromium/quic_stream_factory.cc
@@ -772,7 +772,6 @@
     const std::string& user_agent_id,
     const QuicVersionVector& supported_versions,
     bool always_require_handshake_confirmation,
-    bool disable_connection_pooling,
     float load_server_info_timeout_srtt_multiplier,
     bool enable_connection_racing,
     bool enable_non_blocking_io,
@@ -819,7 +818,6 @@
       supported_versions_(supported_versions),
       always_require_handshake_confirmation_(
           always_require_handshake_confirmation),
-      disable_connection_pooling_(disable_connection_pooling),
       load_server_info_timeout_srtt_multiplier_(
           load_server_info_timeout_srtt_multiplier),
       enable_connection_racing_(enable_connection_racing),
@@ -1065,7 +1063,7 @@
   }
 
   // Pool to active session to |destination| if possible.
-  if (!active_sessions_.empty() && !disable_connection_pooling_) {
+  if (!active_sessions_.empty()) {
     for (const auto& key_value : active_sessions_) {
       QuicChromiumClientSession* session = key_value.second;
       if (destination.Equals(all_sessions_[session].destination()) &&
@@ -1161,8 +1159,6 @@
                                      const AddressList& address_list) {
   const QuicServerId& server_id(key.server_id());
   DCHECK(!HasActiveSession(server_id));
-  if (disable_connection_pooling_)
-    return false;
   for (const IPEndPoint& address : address_list) {
     if (!base::ContainsKey(ip_aliases_, address))
       continue;
diff --git a/net/quic/chromium/quic_stream_factory.h b/net/quic/chromium/quic_stream_factory.h
index b475d65..3c4fdd0 100644
--- a/net/quic/chromium/quic_stream_factory.h
+++ b/net/quic/chromium/quic_stream_factory.h
@@ -209,7 +209,6 @@
       const std::string& user_agent_id,
       const QuicVersionVector& supported_versions,
       bool always_require_handshake_confirmation,
-      bool disable_connection_pooling,
       float load_server_info_timeout_srtt_multiplier,
       bool enable_connection_racing,
       bool enable_non_blocking_io,
@@ -570,9 +569,6 @@
   // introduce at least one RTT for the handshake before the client sends data.
   bool always_require_handshake_confirmation_;
 
-  // Set if we do not want connection pooling.
-  bool disable_connection_pooling_;
-
   // Specifies the ratio between time to load QUIC server information from disk
   // cache to 'smoothed RTT'. This ratio is used to calculate the timeout in
   // milliseconds to wait for loading of QUIC server information. If we don't
diff --git a/net/quic/chromium/quic_stream_factory_test.cc b/net/quic/chromium/quic_stream_factory_test.cc
index 24598b1..8006c2f6 100644
--- a/net/quic/chromium/quic_stream_factory_test.cc
+++ b/net/quic/chromium/quic_stream_factory_test.cc
@@ -244,7 +244,6 @@
         url4_(kServer4Url),
         privacy_mode_(PRIVACY_MODE_DISABLED),
         always_require_handshake_confirmation_(false),
-        disable_connection_pooling_(false),
         load_server_info_timeout_srtt_multiplier_(0.0f),
         enable_connection_racing_(enable_connection_racing),
         enable_non_blocking_io_(true),
@@ -275,7 +274,7 @@
         /*SocketPerformanceWatcherFactory*/ nullptr,
         &crypto_client_stream_factory_, &random_generator_, &clock_,
         kDefaultMaxPacketSize, string(), SupportedVersions(version_),
-        always_require_handshake_confirmation_, disable_connection_pooling_,
+        always_require_handshake_confirmation_,
         load_server_info_timeout_srtt_multiplier_, enable_connection_racing_,
         enable_non_blocking_io_, disable_disk_cache_, prefer_aes_,
         delay_tcp_race_,
@@ -776,7 +775,6 @@
 
   // Variables to configure QuicStreamFactory.
   bool always_require_handshake_confirmation_;
-  bool disable_connection_pooling_;
   double load_server_info_timeout_srtt_multiplier_;
   bool enable_connection_racing_;
   bool enable_non_blocking_io_;
@@ -1189,55 +1187,6 @@
   // EXPECT_EQ(GetActiveSession(host_port_pair_), GetActiveSession(server2));
 }
 
-TEST_P(QuicStreamFactoryTest, NoPoolingIfDisabled) {
-  disable_connection_pooling_ = true;
-  Initialize();
-  ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
-  crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
-  crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
-
-  MockQuicData socket_data1;
-  socket_data1.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  socket_data1.AddWrite(
-      ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
-                              kDefaultMaxUncompressedHeaderSize, nullptr));
-  socket_data1.AddSocketDataToFactory(&socket_factory_);
-  MockQuicData socket_data2;
-  socket_data2.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  socket_data2.AddWrite(
-      ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
-                              kDefaultMaxUncompressedHeaderSize, nullptr));
-  socket_data2.AddSocketDataToFactory(&socket_factory_);
-
-  HostPortPair server2(kServer2HostName, kDefaultServerPort);
-  host_resolver_.set_synchronous_mode(true);
-  host_resolver_.rules()->AddIPLiteralRule(host_port_pair_.host(),
-                                           "192.168.0.1", "");
-  host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
-
-  QuicStreamRequest request(factory_.get(), &http_server_properties_);
-  EXPECT_EQ(OK, request.Request(host_port_pair_, privacy_mode_,
-                                /*cert_verify_flags=*/0, url_, "GET", net_log_,
-                                callback_.callback()));
-  std::unique_ptr<QuicHttpStream> stream = request.CreateStream();
-  EXPECT_TRUE(stream.get());
-
-  TestCompletionCallback callback;
-  QuicStreamRequest request2(factory_.get(), &http_server_properties_);
-  EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
-                                 /*cert_verify_flags=*/0, url2_, "GET",
-                                 net_log_, callback.callback()));
-  std::unique_ptr<QuicHttpStream> stream2 = request2.CreateStream();
-  EXPECT_TRUE(stream2.get());
-
-  EXPECT_NE(GetActiveSession(host_port_pair_), GetActiveSession(server2));
-
-  EXPECT_TRUE(socket_data1.AllReadDataConsumed());
-  EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
-  EXPECT_TRUE(socket_data2.AllReadDataConsumed());
-  EXPECT_TRUE(socket_data2.AllWriteDataConsumed());
-}
-
 TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) {
   Initialize();
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
@@ -1339,57 +1288,6 @@
   EXPECT_TRUE(socket_data.AllWriteDataConsumed());
 }
 
-TEST_P(QuicStreamFactoryTest, NoHttpsPoolingIfDisabled) {
-  disable_connection_pooling_ = true;
-  Initialize();
-
-  MockQuicData socket_data1;
-  socket_data1.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  socket_data1.AddWrite(
-      ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
-                              kDefaultMaxUncompressedHeaderSize, nullptr));
-  socket_data1.AddSocketDataToFactory(&socket_factory_);
-  MockQuicData socket_data2;
-  socket_data2.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  socket_data2.AddWrite(
-      ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
-                              kDefaultMaxUncompressedHeaderSize, nullptr));
-  socket_data2.AddSocketDataToFactory(&socket_factory_);
-
-  HostPortPair server1(kDefaultServerHostName, 443);
-  HostPortPair server2(kServer2HostName, 443);
-
-  ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
-  crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
-  crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
-
-  host_resolver_.set_synchronous_mode(true);
-  host_resolver_.rules()->AddIPLiteralRule(server1.host(), "192.168.0.1", "");
-  host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
-
-  QuicStreamRequest request(factory_.get(), &http_server_properties_);
-  EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
-                                /*cert_verify_flags=*/0, url_, "GET", net_log_,
-                                callback_.callback()));
-  std::unique_ptr<QuicHttpStream> stream = request.CreateStream();
-  EXPECT_TRUE(stream.get());
-
-  TestCompletionCallback callback;
-  QuicStreamRequest request2(factory_.get(), &http_server_properties_);
-  EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
-                                 /*cert_verify_flags=*/0, url2_, "GET",
-                                 net_log_, callback_.callback()));
-  std::unique_ptr<QuicHttpStream> stream2 = request2.CreateStream();
-  EXPECT_TRUE(stream2.get());
-
-  EXPECT_NE(GetActiveSession(server1), GetActiveSession(server2));
-
-  EXPECT_TRUE(socket_data1.AllReadDataConsumed());
-  EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
-  EXPECT_TRUE(socket_data2.AllReadDataConsumed());
-  EXPECT_TRUE(socket_data2.AllWriteDataConsumed());
-}
-
 TEST_P(QuicStreamFactoryTest, HttpsPoolingWithMatchingPins) {
   Initialize();
   MockQuicData socket_data;
@@ -1436,63 +1334,6 @@
   EXPECT_TRUE(socket_data.AllWriteDataConsumed());
 }
 
-TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithMatchingPinsIfDisabled) {
-  disable_connection_pooling_ = true;
-  Initialize();
-
-  MockQuicData socket_data1;
-  socket_data1.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  socket_data1.AddWrite(
-      ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
-                              kDefaultMaxUncompressedHeaderSize, nullptr));
-  socket_data1.AddSocketDataToFactory(&socket_factory_);
-  MockQuicData socket_data2;
-  socket_data2.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
-  socket_data2.AddWrite(
-      ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
-                              kDefaultMaxUncompressedHeaderSize, nullptr));
-  socket_data2.AddSocketDataToFactory(&socket_factory_);
-
-  HostPortPair server1(kDefaultServerHostName, 443);
-  HostPortPair server2(kServer2HostName, 443);
-  uint8_t primary_pin = 1;
-  uint8_t backup_pin = 2;
-  test::AddPin(&transport_security_state_, kServer2HostName, primary_pin,
-               backup_pin);
-
-  ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
-  verify_details.cert_verify_result.public_key_hashes.push_back(
-      test::GetTestHashValue(primary_pin));
-  crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
-  crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
-
-  host_resolver_.set_synchronous_mode(true);
-  host_resolver_.rules()->AddIPLiteralRule(server1.host(), "192.168.0.1", "");
-  host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", "");
-
-  QuicStreamRequest request(factory_.get(), &http_server_properties_);
-  EXPECT_EQ(OK, request.Request(server1, privacy_mode_,
-                                /*cert_verify_flags=*/0, url_, "GET", net_log_,
-                                callback_.callback()));
-  std::unique_ptr<QuicHttpStream> stream = request.CreateStream();
-  EXPECT_TRUE(stream.get());
-
-  TestCompletionCallback callback;
-  QuicStreamRequest request2(factory_.get(), &http_server_properties_);
-  EXPECT_EQ(OK, request2.Request(server2, privacy_mode_,
-                                 /*cert_verify_flags=*/0, url2_, "GET",
-                                 net_log_, callback_.callback()));
-  std::unique_ptr<QuicHttpStream> stream2 = request2.CreateStream();
-  EXPECT_TRUE(stream2.get());
-
-  EXPECT_NE(GetActiveSession(server1), GetActiveSession(server2));
-
-  EXPECT_TRUE(socket_data1.AllReadDataConsumed());
-  EXPECT_TRUE(socket_data1.AllWriteDataConsumed());
-  EXPECT_TRUE(socket_data2.AllReadDataConsumed());
-  EXPECT_TRUE(socket_data2.AllWriteDataConsumed());
-}
-
 TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithDifferentPins) {
   Initialize();
 
diff --git a/net/quic/core/congestion_control/bbr_sender.cc b/net/quic/core/congestion_control/bbr_sender.cc
index ead7e0d..623cfb78 100644
--- a/net/quic/core/congestion_control/bbr_sender.cc
+++ b/net/quic/core/congestion_control/bbr_sender.cc
@@ -302,8 +302,7 @@
   // Pick a random offset for the gain cycle out of {0, 2..7} range. 1 is
   // excluded because in that case increased gain and decreased gain would not
   // follow each other.
-  cycle_current_offset_ =
-      random_->RandUint64() % (sizeof(kGainCycleLength) - 1);
+  cycle_current_offset_ = random_->RandUint64() % (kGainCycleLength - 1);
   if (cycle_current_offset_ >= 1) {
     cycle_current_offset_ += 1;
   }
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc
index fee44bb1..8d28de7 100644
--- a/net/quic/test_tools/crypto_test_utils.cc
+++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -31,7 +31,7 @@
 #include "third_party/boringssl/src/include/openssl/bn.h"
 #include "third_party/boringssl/src/include/openssl/ec.h"
 #include "third_party/boringssl/src/include/openssl/ecdsa.h"
-#include "third_party/boringssl/src/include/openssl/obj_mac.h"
+#include "third_party/boringssl/src/include/openssl/nid.h"
 #include "third_party/boringssl/src/include/openssl/sha.h"
 
 using std::string;
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc
index ab4f113..3b29d41 100644
--- a/net/socket/ssl_client_socket_impl.cc
+++ b/net/socket/ssl_client_socket_impl.cc
@@ -39,7 +39,6 @@
 #include "net/cert/ct_verifier.h"
 #include "net/cert/x509_certificate_net_log_param.h"
 #include "net/cert/x509_util.h"
-#include "net/cert/x509_util_openssl.h"
 #include "net/http/transport_security_state.h"
 #include "net/log/net_log.h"
 #include "net/log/net_log_event_type.h"
diff --git a/net/ssl/openssl_ssl_util.cc b/net/ssl/openssl_ssl_util.cc
index c3988b464..21b2b565 100644
--- a/net/ssl/openssl_ssl_util.cc
+++ b/net/ssl/openssl_ssl_util.cc
@@ -17,7 +17,6 @@
 #include "net/ssl/ssl_connection_status_flags.h"
 #include "third_party/boringssl/src/include/openssl/err.h"
 #include "third_party/boringssl/src/include/openssl/ssl.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
 
 namespace net {
 
@@ -225,29 +224,4 @@
   }
 }
 
-bssl::UniquePtr<X509> OSCertHandleToOpenSSL(
-    X509Certificate::OSCertHandle os_handle) {
-#if defined(USE_OPENSSL_CERTS)
-  return bssl::UniquePtr<X509>(X509Certificate::DupOSCertHandle(os_handle));
-#else   // !defined(USE_OPENSSL_CERTS)
-  std::string der_encoded;
-  if (!X509Certificate::GetDEREncoded(os_handle, &der_encoded))
-    return bssl::UniquePtr<X509>();
-  const uint8_t* bytes = reinterpret_cast<const uint8_t*>(der_encoded.data());
-  return bssl::UniquePtr<X509>(d2i_X509(NULL, &bytes, der_encoded.size()));
-#endif  // defined(USE_OPENSSL_CERTS)
-}
-
-bssl::UniquePtr<STACK_OF(X509)> OSCertHandlesToOpenSSL(
-    const X509Certificate::OSCertHandles& os_handles) {
-  bssl::UniquePtr<STACK_OF(X509)> stack(sk_X509_new_null());
-  for (size_t i = 0; i < os_handles.size(); i++) {
-    bssl::UniquePtr<X509> x509 = OSCertHandleToOpenSSL(os_handles[i]);
-    if (!x509)
-      return nullptr;
-    sk_X509_push(stack.get(), x509.release());
-  }
-  return stack;
-}
-
 }  // namespace net
diff --git a/net/ssl/openssl_ssl_util.h b/net/ssl/openssl_ssl_util.h
index 5e533d94..ff63edd4 100644
--- a/net/ssl/openssl_ssl_util.h
+++ b/net/ssl/openssl_ssl_util.h
@@ -10,7 +10,7 @@
 #include "net/base/net_export.h"
 #include "net/cert/x509_certificate.h"
 #include "net/log/net_log_parameters_callback.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
+#include "third_party/boringssl/src/include/openssl/base.h"
 
 namespace crypto {
 class OpenSSLErrStackTracer;
@@ -78,12 +78,6 @@
 // this SSL connection.
 int GetNetSSLVersion(SSL* ssl);
 
-bssl::UniquePtr<X509> OSCertHandleToOpenSSL(
-    X509Certificate::OSCertHandle os_handle);
-
-bssl::UniquePtr<STACK_OF(X509)> OSCertHandlesToOpenSSL(
-    const X509Certificate::OSCertHandles& os_handles);
-
 }  // namespace net
 
 #endif  // NET_SSL_OPENSSL_SSL_UTIL_H_
diff --git a/net/ssl/ssl_client_session_cache.cc b/net/ssl/ssl_client_session_cache.cc
index e2c32c5..0a2f79b 100644
--- a/net/ssl/ssl_client_session_cache.cc
+++ b/net/ssl/ssl_client_session_cache.cc
@@ -12,9 +12,7 @@
 #include "base/time/clock.h"
 #include "base/time/default_clock.h"
 #include "base/trace_event/process_memory_dump.h"
-#include "net/cert/x509_util_openssl.h"
 #include "third_party/boringssl/src/include/openssl/ssl.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
 
 namespace net {
 
diff --git a/net/ssl/ssl_platform_key_win.cc b/net/ssl/ssl_platform_key_win.cc
index f325a45a..a7df502 100644
--- a/net/ssl/ssl_platform_key_win.cc
+++ b/net/ssl/ssl_platform_key_win.cc
@@ -25,7 +25,6 @@
 #include "third_party/boringssl/src/include/openssl/bn.h"
 #include "third_party/boringssl/src/include/openssl/ecdsa.h"
 #include "third_party/boringssl/src/include/openssl/evp.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
 
 namespace net {
 
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index f6bda76..893b6b81 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -27,7 +27,6 @@
 #include "net/tools/quic/quic_packet_writer_wrapper.h"
 #include "net/tools/quic/quic_spdy_client_stream.h"
 #include "net/tools/quic/test_tools/quic_client_peer.h"
-#include "third_party/boringssl/src/include/openssl/x509.h"
 
 using std::string;
 using testing::_;
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index f21b0f40b..328b696d 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -429,8 +429,6 @@
       http_network_session_params_.quic_idle_connection_timeout_seconds;
   network_session_params.quic_connection_options =
       http_network_session_params_.quic_connection_options;
-  network_session_params.quic_host_whitelist =
-      http_network_session_params_.quic_host_whitelist;
   network_session_params.quic_close_sessions_on_ip_change =
       http_network_session_params_.quic_close_sessions_on_ip_change;
   network_session_params.quic_migrate_sessions_on_network_change =
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h
index 1f93bb6..7682780 100644
--- a/net/url_request/url_request_context_builder.h
+++ b/net/url_request/url_request_context_builder.h
@@ -97,7 +97,6 @@
     std::string quic_user_agent_id;
     int quic_max_server_configs_stored_in_properties;
     bool quic_delay_tcp_race;
-    std::unordered_set<std::string> quic_host_whitelist;
     bool quic_prefer_aes;
     int quic_idle_connection_timeout_seconds;
     QuicTagVector quic_connection_options;
@@ -241,11 +240,6 @@
         quic_idle_connection_timeout_seconds;
   }
 
-  void set_quic_host_whitelist(
-      const std::unordered_set<std::string>& quic_host_whitelist) {
-    http_network_session_params_.quic_host_whitelist = quic_host_whitelist;
-  }
-
   void set_quic_close_sessions_on_ip_change(
       bool quic_close_sessions_on_ip_change) {
     http_network_session_params_.quic_close_sessions_on_ip_change =
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 95866f0..752870e 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1954,7 +1954,6 @@
 crbug.com/626703 external/wpt/streams/writable-streams/reentrant-strategy.sharedworker.html [ Timeout ]
 crbug.com/626703 external/wpt/streams/writable-streams/start.sharedworker.html [ Timeout ]
 crbug.com/626703 external/wpt/streams/writable-streams/write.sharedworker.html [ Timeout ]
-crbug.com/626703 external/wpt/css/selectors4/focus-within-shadow-006.html [ Failure ]
 crbug.com/626703 external/wpt/css/CSS2/linebox/inline-formatting-context-010b.xht [ Skip ]
 crbug.com/626703 external/wpt/css/CSS2/linebox/inline-formatting-context-012.xht [ Failure ]
 crbug.com/626703 [ Android Linux Win ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Failure ]
@@ -2733,8 +2732,6 @@
 
 crbug.com/685951 css2.1/t040304-c64-uri-00-a-g.html [ Failure Pass ]
 
-crbug.com/706792 [ Win ] fast/text/ellipsis-platform-font-change.html [ NeedsRebaseline ]
-
 # Importing 'fetch' tests from WPT.
 crbug.com/705490 external/wpt/fetch/api/basic/error-after-response.html [ Timeout Pass ]
 
diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-AddRemoveStream-expected.txt b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-AddRemoveStream-expected.txt
new file mode 100644
index 0000000..3d29fb8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-AddRemoveStream-expected.txt
@@ -0,0 +1,5 @@
+CONSOLE WARNING: line 22: RTCPeerConnection.getStreamById() is deprecated and will be removed in M62, around October 2017. See https://www.chromestatus.com/features/5751819573657600 for more details.
+This is a testharness.js-based test.
+PASS Tests RTCPeerConnection [add|remove]Stream. 
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html b/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html
new file mode 100644
index 0000000..e52f67ec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/payments/payment-instruments.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>PaymentHandler: Tests for PaymentInstruments</title>
+<link rel="help" href="https://w3c.github.io/webpayments-payment-apps-api/#payment-instruments">
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../serviceworker/resources/test-helpers.js"></script>
+<script>
+
+promise_test(test => {
+    var registration;
+    var script_url = 'resources/empty-worker.js';
+    var scope = 'resources/';
+
+    return service_worker_unregister_and_register(test, script_url, scope)
+      .then(r => {
+          registration = r;
+          return wait_for_state(test, registration.installing, 'activated');
+        })
+      .then(state => {
+          assert_equals(state, 'activated');
+          return registration.paymentManager.instruments.set(
+              'test_key',
+              {
+                name: 'Visa ending ****4756',
+                enabledMethods: ['basic-card'],
+                capabilities: {
+                  supportedNetworks: ['visa'],
+                  supportedTypes: ['credit']
+                }
+              });
+        })
+      .then(result => {
+          assert_equals(result, undefined);
+          return registration.paymentManager.instruments.get('test_key');
+        })
+      .then(stored_instrument => {
+          assert_equals(stored_instrument.name, 'Visa ending ****4756');
+          assert_array_equals(stored_instrument.enabledMethods, ['basic-card']);
+          assert_object_equals(stored_instrument.capabilities, {
+              supportedNetworks: ['visa'],
+              supportedTypes: ['credit']
+            });
+        })
+      .catch(unreached_rejection(test));
+  }, 'PaymentInstruments set/get methods test');
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/text-match-document-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/text-match-document-change-expected.png
deleted file mode 100644
index 744ffd4b..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/text-match-document-change-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/text-match-document-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/text-match-document-change-expected.png
deleted file mode 100644
index 792b6d9d..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/disable-spinvalidation/paint/invalidation/text-match-document-change-expected.png
+++ /dev/null
@@ -1,10 +0,0 @@
-
-<html><head>
-<meta http-equiv="content-type" content="text/html;charset=utf-8">
-<title>500 Server Error</title>
-</head>
-<body text=#000000 bgcolor=#ffffff>
-<h1>Error: Server Error</h1>
-<h2>The server encountered an error and could not complete your request.<p>Please try again in 30 seconds.</h2>
-<h2></h2>
-</body></html>
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png
index d38fd6421..63edba9e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/ellipsis-platform-font-change-expected.png
index 37ebb04..04ac5a1 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/Source/BUILD.gn b/third_party/WebKit/Source/BUILD.gn
index 7edbabc..4c95d09 100644
--- a/third_party/WebKit/Source/BUILD.gn
+++ b/third_party/WebKit/Source/BUILD.gn
@@ -79,11 +79,6 @@
 
 config("config") {
   include_dirs = [
-    # crbug.com/691465: Temporary solution to fix an issue related to MSVC-
-    # specific #include search order. This essentially lets
-    # #include "wtf/Foo.h" actually include "platform/wtf/Foo.h". This is okay
-    # because these files are equivalent if both exist.
-    "platform",
     ".",
     "..",
     "$root_gen_dir/blink",
diff --git a/third_party/WebKit/Source/bindings/core/v8/BUILD.gn b/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
index 086d637..87fce0f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
+++ b/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
@@ -350,7 +350,7 @@
   deps = [
     ":bindings_core_impl_generated",
     "//skia",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//v8",
   ]
 }
diff --git a/third_party/WebKit/Source/bindings/modules/BUILD.gn b/third_party/WebKit/Source/bindings/modules/BUILD.gn
index ae7cca18..f9273c1 100644
--- a/third_party/WebKit/Source/bindings/modules/BUILD.gn
+++ b/third_party/WebKit/Source/bindings/modules/BUILD.gn
@@ -195,7 +195,7 @@
     ":event_modules_names",
     ":event_target_modules_names",
     "//third_party/WebKit/Source/core",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//v8",
   ]
 }
diff --git a/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp b/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
index 776de6e..790a428 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
@@ -13,7 +13,7 @@
 #include "modules/fetch/BodyStreamBuffer.h"
 #include "modules/fetch/FetchDataLoader.h"
 #include "platform/heap/Handle.h"
-#include "wtf/RefPtr.h"
+#include "platform/wtf/RefPtr.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.h b/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.h
index 5b56dc5..2f7cd77d 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.h
+++ b/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.h
@@ -6,8 +6,8 @@
 #define WasmResponseExtensions_h
 
 #include "modules/ModulesExport.h"
+#include "platform/wtf/Allocator.h"
 #include "v8/include/v8.h"
-#include "wtf/Allocator.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_names.py b/third_party/WebKit/Source/build/scripts/make_css_property_names.py
index 949c182..10b2624 100755
--- a/third_party/WebKit/Source/build/scripts/make_css_property_names.py
+++ b/third_party/WebKit/Source/build/scripts/make_css_property_names.py
@@ -15,7 +15,7 @@
 #define %(class_name)s_h
 
 #include "core/CoreExport.h"
-#include "wtf/Assertions.h"
+#include "platform/wtf/Assertions.h"
 #include <stddef.h>
 
 namespace WTF {
@@ -85,9 +85,9 @@
 #include "core/css/HashTools.h"
 #include <string.h>
 
-#include "wtf/ASCIICType.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/WTFString.h"
+#include "platform/wtf/ASCIICType.h"
+#include "platform/wtf/text/AtomicString.h"
+#include "platform/wtf/text/WTFString.h"
 
 #ifdef _MSC_VER
 // Disable the warnings from casting a 64-bit pointer to 32-bit long
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl
index f865a43e..0d29ca1b 100644
--- a/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSOMKeywords.cpp.tmpl
@@ -6,7 +6,7 @@
 
 #include "core/css/CSSPropertyIDTemplates.h"
 #include "core/css/cssom/CSSKeywordValue.h"
-#include "wtf/HashMap.h"
+#include "platform/wtf/HashMap.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyAPI.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyAPI.h.tmpl
index 5f996a0..1fc68266 100644
--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyAPI.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyAPI.h.tmpl
@@ -6,7 +6,7 @@
 #define CSSPropertyAPI_h
 
 #include "core/CSSPropertyNames.h"
-#include "wtf/Allocator.h"
+#include "platform/wtf/Allocator.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl
index 16f0ab4..6399fe1 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl
@@ -2,7 +2,7 @@
 {{license()}}
 
 #include "core/ComputedStyleBase.h"
-#include "wtf/SizeAssertions.h"
+#include "platform/wtf/SizeAssertions.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
index 4dfd115..7624b51 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
@@ -18,7 +18,7 @@
 #include "core/dom/Document.h"
 #include "core/frame/Settings.h"
 #include "platform/RuntimeEnabledFeatures.h"
-#include "wtf/HashMap.h"
+#include "platform/wtf/HashMap.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl
index 8bd30a0..b0379ba 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.h.tmpl
@@ -6,8 +6,8 @@
 
 #include "core/dom/Document.h"
 #include "platform/heap/Handle.h"
-#include "wtf/Forward.h"
-#include "wtf/PassRefPtr.h"
+#include "platform/wtf/Forward.h"
+#include "platform/wtf/PassRefPtr.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl
index 3fc2c0a..34ec315 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ElementLookupTrie.h.tmpl
@@ -5,7 +5,7 @@
 #define {{namespace}}ElementLookupTrie_h
 
 #include "core/CoreExport.h"
-#include "wtf/text/StringImpl.h"
+#include "platform/wtf/text/StringImpl.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl
index 4afbeca..8ecbe99 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ElementTypeHelpers.cpp.tmpl
@@ -5,7 +5,7 @@
 
 #include "core/dom/Document.h"
 #include "platform/RuntimeEnabledFeatures.h"
-#include "wtf/HashMap.h"
+#include "platform/wtf/HashMap.h"
 
 namespace blink {
 {% if namespace == "HTML" %}
diff --git a/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.h.tmpl
index 54a2eba..ffb01fea 100644
--- a/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/InternalRuntimeFlags.h.tmpl
@@ -7,9 +7,9 @@
 #include "bindings/core/v8/ScriptWrappable.h"
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/heap/Handle.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefPtr.h"
-#include "wtf/RefCounted.h"
+#include "platform/wtf/PassRefPtr.h"
+#include "platform/wtf/RefPtr.h"
+#include "platform/wtf/RefCounted.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl
index f6e6b24c..6fb5d89 100644
--- a/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/InternalSettingsGenerated.h.tmpl
@@ -6,9 +6,9 @@
 
 #include "bindings/core/v8/ScriptWrappable.h"
 #include "platform/heap/Handle.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-#include "wtf/text/WTFString.h"
+#include "platform/wtf/PassRefPtr.h"
+#include "platform/wtf/RefCounted.h"
+#include "platform/wtf/text/WTFString.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl
index 01f860b..117281e 100644
--- a/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/MakeNames.cpp.tmpl
@@ -3,7 +3,7 @@
 
 #include "{{namespace}}{{suffix}}Names.h"
 
-#include "wtf/StdLibExtras.h"
+#include "platform/wtf/StdLibExtras.h"
 
 // Generated from:
 {% for entry in in_files|sort %}
diff --git a/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl
index 6ee6ad6..127eae9 100644
--- a/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/MakeNames.h.tmpl
@@ -8,7 +8,7 @@
 {% if suffix %}
 #include "core/{{namespace}}Names.h"
 {% else %}
-#include "wtf/text/AtomicString.h"
+#include "platform/wtf/text/AtomicString.h"
 {% endif %}
 {% if export == 'CORE_EXPORT' %}
 #include "core/CoreExport.h"
diff --git a/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
index 25f9ba9f..36b0b181 100644
--- a/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl
@@ -3,9 +3,9 @@
 
 #include "{{namespace}}Names.h"
 
-#include "wtf/PtrUtil.h"
-#include "wtf/StaticConstructors.h"
-#include "wtf/StdLibExtras.h"
+#include "platform/wtf/PtrUtil.h"
+#include "platform/wtf/StaticConstructors.h"
+#include "platform/wtf/StdLibExtras.h"
 #include <memory>
 
 namespace blink {
diff --git a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl
index 5b1f0c6e..dc04fb3 100644
--- a/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/OriginTrials.h.tmpl
@@ -5,7 +5,7 @@
 #define OriginTrials_h
 
 #include "core/CoreExport.h"
-#include "wtf/text/WTFString.h"
+#include "platform/wtf/text/WTFString.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
index 0ad387c..63b001b 100644
--- a/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.cpp.tmpl
@@ -3,8 +3,8 @@
 
 #include "platform/RuntimeEnabledFeatures.h"
 
-#include "wtf/Assertions.h"
-#include "wtf/text/WTFString.h"
+#include "platform/wtf/Assertions.h"
+#include "platform/wtf/text/WTFString.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl
index 847f615..a402898ce 100644
--- a/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeatures.h.tmpl
@@ -7,9 +7,9 @@
 #include <string>
 
 #include "platform/PlatformExport.h"
-#include "wtf/Allocator.h"
-#include "wtf/Forward.h"
-#include "wtf/build_config.h"
+#include "platform/wtf/Allocator.h"
+#include "platform/wtf/Forward.h"
+#include "platform/wtf/build_config.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl
index c470d93..f044dc0e 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.cpp.tmpl
@@ -22,8 +22,8 @@
 #include "StylePropertyShorthand.h"
 
 #include "platform/RuntimeEnabledFeatures.h"
-#include "wtf/HashMap.h"
-#include "wtf/StdLibExtras.h"
+#include "platform/wtf/HashMap.h"
+#include "platform/wtf/StdLibExtras.h"
 
 namespace blink {
 {% for property_id, property in properties.items() %}
diff --git a/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.h.tmpl
index 204b710d..27b81c6a 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StylePropertyShorthand.h.tmpl
@@ -23,7 +23,7 @@
 #define StylePropertyShorthand_h
 
 #include "CSSPropertyNames.h"
-#include "wtf/Vector.h"
+#include "platform/wtf/Vector.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn
index f09f49e0..741cfb3 100644
--- a/third_party/WebKit/Source/core/BUILD.gn
+++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -94,7 +94,7 @@
     "//third_party/WebKit/Source/bindings/modules:bindings_modules_generated",
     "//third_party/WebKit/Source/bindings/modules/v8:bindings_modules_generated",
     "//third_party/WebKit/Source/platform:make_platform_generated",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//url",
     "//v8",
   ]
@@ -106,7 +106,7 @@
     "//skia",
     "//third_party/WebKit/Source/core/inspector:generated",
     "//third_party/WebKit/Source/core/probe:generated",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//third_party/angle:translator",
     "//third_party/iccjpeg",
     "//third_party/icu",
@@ -166,7 +166,7 @@
     ":core_generated",
     "//skia",
     "//third_party/WebKit/Source/platform",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//url",
     "//v8",
   ]
@@ -1067,7 +1067,7 @@
     "//third_party/WebKit/Source/bindings/modules:bindings_modules_generated",
     "//third_party/WebKit/Source/bindings/modules/v8:bindings_modules_generated",
     "//third_party/WebKit/Source/platform:make_platform_generated",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//url",
     "//v8",
   ]
diff --git a/third_party/WebKit/Source/core/frame/Deprecation.cpp b/third_party/WebKit/Source/core/frame/Deprecation.cpp
index e6426cf0..279c1738 100644
--- a/third_party/WebKit/Source/core/frame/Deprecation.cpp
+++ b/third_party/WebKit/Source/core/frame/Deprecation.cpp
@@ -19,6 +19,7 @@
   M59,
   M60,
   M61,
+  M62,
 };
 
 const char* milestoneString(Milestone milestone) {
@@ -34,6 +35,8 @@
       return "M60, around August 2017";
     case M61:
       return "M61, around September 2017";
+    case M62:
+      return "M62, around October 2017";
   }
 
   ASSERT_NOT_REACHED();
@@ -441,6 +444,10 @@
           "details.",
           milestoneString(M60));
 
+    case UseCounter::kV8RTCPeerConnection_GetStreamById_Method:
+      return willBeRemoved("RTCPeerConnection.getStreamById()", M62,
+                           "5751819573657600");
+
     // Features that aren't deprecated don't have a deprecation message.
     default:
       return String();
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.h b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.h
index b7b26f5..582024e4 100644
--- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.h
+++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.h
@@ -12,7 +12,7 @@
 #include "core/dom/ExceptionCode.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/geometry/IntSize.h"
-#include "third_party/WebKit/Source/wtf/Optional.h"
+#include "platform/wtf/Optional.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/inspector/BUILD.gn b/third_party/WebKit/Source/core/inspector/BUILD.gn
index bd6c7b5f..a7a18af 100644
--- a/third_party/WebKit/Source/core/inspector/BUILD.gn
+++ b/third_party/WebKit/Source/core/inspector/BUILD.gn
@@ -188,7 +188,7 @@
     "//third_party/WebKit/Source/bindings/core/v8:bindings_core_v8_generated",
     "//third_party/WebKit/Source/core:all_generators",
     "//third_party/WebKit/Source/platform:make_platform_generated",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//v8",
   ]
 }
diff --git a/third_party/WebKit/Source/core/probe/BUILD.gn b/third_party/WebKit/Source/core/probe/BUILD.gn
index a717b49..12ddeed8 100644
--- a/third_party/WebKit/Source/core/probe/BUILD.gn
+++ b/third_party/WebKit/Source/core/probe/BUILD.gn
@@ -52,7 +52,7 @@
   deps = [
     ":instrumentation_probes",
     "//skia",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//v8",
   ]
 }
diff --git a/third_party/WebKit/Source/modules/BUILD.gn b/third_party/WebKit/Source/modules/BUILD.gn
index e42ddf0..5bf90b87 100644
--- a/third_party/WebKit/Source/modules/BUILD.gn
+++ b/third_party/WebKit/Source/modules/BUILD.gn
@@ -327,7 +327,7 @@
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/WebKit/Source/core",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//v8",
   ]
 }
diff --git a/third_party/WebKit/Source/modules/geolocation/Geoposition.h b/third_party/WebKit/Source/modules/geolocation/Geoposition.h
index b1f2598..c2419721 100644
--- a/third_party/WebKit/Source/modules/geolocation/Geoposition.h
+++ b/third_party/WebKit/Source/modules/geolocation/Geoposition.h
@@ -30,7 +30,7 @@
 #include "modules/EventModules.h"
 #include "modules/geolocation/Coordinates.h"
 #include "platform/heap/Handle.h"
-#include "wtf/Assertions.h"
+#include "platform/wtf/Assertions.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp b/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
index f89da6a..0b686f2 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentInstruments.cpp
@@ -4,12 +4,53 @@
 
 #include "modules/payments/PaymentInstruments.h"
 
+#include <utility>
+
+#include "bindings/core/v8/ExceptionState.h"
 #include "bindings/core/v8/ScriptPromise.h"
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "core/dom/DOMException.h"
 #include "modules/payments/PaymentInstrument.h"
+#include "modules/payments/PaymentManager.h"
+#include "platform/wtf/Vector.h"
 
 namespace blink {
+namespace {
 
-PaymentInstruments::PaymentInstruments() {}
+static const char kPaymentManagerUnavailable[] = "Payment manager unavailable";
+
+bool rejectError(ScriptPromiseResolver* resolver,
+                 payments::mojom::blink::PaymentHandlerStatus status) {
+  switch (status) {
+    case payments::mojom::blink::PaymentHandlerStatus::SUCCESS:
+      return false;
+    case payments::mojom::blink::PaymentHandlerStatus::NOT_IMPLEMENTED:
+      resolver->Reject(
+          DOMException::Create(kNotSupportedError, "Not implemented yet"));
+      return true;
+    case payments::mojom::blink::PaymentHandlerStatus::NOT_FOUND:
+      resolver->Reject(DOMException::Create(kNotFoundError,
+                                            "There is no stored instrument"));
+      return true;
+    case payments::mojom::blink::PaymentHandlerStatus::NO_ACTIVE_WORKER:
+      resolver->Reject(
+          DOMException::Create(kInvalidStateError, "No active service worker"));
+      return true;
+    case payments::mojom::blink::PaymentHandlerStatus::STORAGE_OPERATION_FAILED:
+      resolver->Reject(DOMException::Create(kInvalidStateError,
+                                            "Storage operation is failed"));
+      return true;
+  }
+  NOTREACHED();
+  return false;
+}
+
+}  // namespace
+
+PaymentInstruments::PaymentInstruments(
+    const payments::mojom::blink::PaymentManagerPtr& manager)
+    : manager_(manager) {}
 
 ScriptPromise PaymentInstruments::deleteInstrument(
     const String& instrument_key) {
@@ -17,9 +58,22 @@
   return ScriptPromise();
 }
 
-ScriptPromise PaymentInstruments::get(const String& instrument_key) {
-  NOTIMPLEMENTED();
-  return ScriptPromise();
+ScriptPromise PaymentInstruments::get(ScriptState* script_state,
+                                      const String& instrument_key) {
+  if (!manager_.is_bound()) {
+    return ScriptPromise::RejectWithDOMException(
+        script_state,
+        DOMException::Create(kInvalidStateError, kPaymentManagerUnavailable));
+  }
+
+  ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
+  ScriptPromise promise = resolver->Promise();
+
+  manager_->GetPaymentInstrument(
+      instrument_key, ConvertToBaseCallback(WTF::Bind(
+                          &PaymentInstruments::onGetPaymentInstrument,
+                          WrapPersistent(this), WrapPersistent(resolver))));
+  return promise;
 }
 
 ScriptPromise PaymentInstruments::keys() {
@@ -32,12 +86,90 @@
   return ScriptPromise();
 }
 
-ScriptPromise PaymentInstruments::set(const String& instrument_key,
-                                      const PaymentInstrument& details) {
-  NOTIMPLEMENTED();
-  return ScriptPromise();
+ScriptPromise PaymentInstruments::set(ScriptState* script_state,
+                                      const String& instrument_key,
+                                      const PaymentInstrument& details,
+                                      ExceptionState& exception_state) {
+  if (!manager_.is_bound()) {
+    return ScriptPromise::RejectWithDOMException(
+        script_state,
+        DOMException::Create(kInvalidStateError, kPaymentManagerUnavailable));
+  }
+
+  ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
+  ScriptPromise promise = resolver->Promise();
+
+  payments::mojom::blink::PaymentInstrumentPtr instrument =
+      payments::mojom::blink::PaymentInstrument::New();
+  instrument->name = details.hasName() ? details.name() : WTF::g_empty_string;
+  if (details.hasEnabledMethods()) {
+    instrument->enabled_methods = details.enabledMethods();
+  }
+
+  if (details.hasCapabilities()) {
+    v8::Local<v8::String> value;
+    if (!v8::JSON::Stringify(script_state->GetContext(),
+                             details.capabilities().V8Value().As<v8::Object>())
+             .ToLocal(&value)) {
+      exception_state.ThrowTypeError(
+          "Capabilities should be a JSON-serializable object");
+      return exception_state.Reject(script_state);
+    }
+    instrument->stringified_capabilities = ToCoreString(value);
+  } else {
+    instrument->stringified_capabilities = WTF::g_empty_string;
+  }
+
+  manager_->SetPaymentInstrument(
+      instrument_key, std::move(instrument),
+      ConvertToBaseCallback(
+          WTF::Bind(&PaymentInstruments::onSetPaymentInstrument,
+                    WrapPersistent(this), WrapPersistent(resolver))));
+  return promise;
 }
 
 DEFINE_TRACE(PaymentInstruments) {}
 
+void PaymentInstruments::onGetPaymentInstrument(
+    ScriptPromiseResolver* resolver,
+    payments::mojom::blink::PaymentInstrumentPtr stored_instrument,
+    payments::mojom::blink::PaymentHandlerStatus status) {
+  DCHECK(resolver);
+  if (rejectError(resolver, status))
+    return;
+  PaymentInstrument instrument;
+  instrument.setName(stored_instrument->name);
+  Vector<String> enabled_methods;
+  for (const auto& method : stored_instrument->enabled_methods) {
+    enabled_methods.push_back(method);
+  }
+
+  instrument.setEnabledMethods(enabled_methods);
+  if (!stored_instrument->stringified_capabilities.IsEmpty()) {
+    ScriptState::Scope scope(resolver->GetScriptState());
+    ExceptionState exception_state(resolver->GetScriptState()->GetIsolate(),
+                                   ExceptionState::kGetterContext,
+                                   "PaymentInstruments", "get");
+    instrument.setCapabilities(
+        ScriptValue(resolver->GetScriptState(),
+                    FromJSONString(resolver->GetScriptState()->GetIsolate(),
+                                   stored_instrument->stringified_capabilities,
+                                   exception_state)));
+    if (exception_state.HadException()) {
+      exception_state.Reject(resolver);
+      return;
+    }
+  }
+  resolver->Resolve(instrument);
+}
+
+void PaymentInstruments::onSetPaymentInstrument(
+    ScriptPromiseResolver* resolver,
+    payments::mojom::blink::PaymentHandlerStatus status) {
+  DCHECK(resolver);
+  if (rejectError(resolver, status))
+    return;
+  resolver->Resolve();
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/payments/PaymentInstruments.h b/third_party/WebKit/Source/modules/payments/PaymentInstruments.h
index c1903ed..3f837e0 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentInstruments.h
+++ b/third_party/WebKit/Source/modules/payments/PaymentInstruments.h
@@ -6,6 +6,7 @@
 #define PaymentInstruments_h
 
 #include "bindings/core/v8/ScriptWrappable.h"
+#include "components/payments/mojom/payment_app.mojom-blink.h"
 #include "modules/ModulesExport.h"
 #include "platform/heap/Handle.h"
 #include "platform/wtf/Noncopyable.h"
@@ -13,8 +14,11 @@
 
 namespace blink {
 
+class ExceptionState;
 class PaymentInstrument;
 class ScriptPromise;
+class ScriptPromiseResolver;
+class ScriptState;
 
 class MODULES_EXPORT PaymentInstruments final
     : public GarbageCollected<PaymentInstruments>,
@@ -23,16 +27,27 @@
   WTF_MAKE_NONCOPYABLE(PaymentInstruments);
 
  public:
-  PaymentInstruments();
+  explicit PaymentInstruments(const payments::mojom::blink::PaymentManagerPtr&);
 
   ScriptPromise deleteInstrument(const String& instrument_key);
-  ScriptPromise get(const String& instrument_key);
+  ScriptPromise get(ScriptState*, const String& instrument_key);
   ScriptPromise keys();
   ScriptPromise has(const String& instrument_key);
-  ScriptPromise set(const String& instrument_key,
-                    const PaymentInstrument& details);
+  ScriptPromise set(ScriptState*,
+                    const String& instrument_key,
+                    const PaymentInstrument& details,
+                    ExceptionState&);
 
   DECLARE_TRACE();
+
+ private:
+  void onSetPaymentInstrument(ScriptPromiseResolver*,
+                              payments::mojom::blink::PaymentHandlerStatus);
+  void onGetPaymentInstrument(ScriptPromiseResolver*,
+                              payments::mojom::blink::PaymentInstrumentPtr,
+                              payments::mojom::blink::PaymentHandlerStatus);
+
+  const payments::mojom::blink::PaymentManagerPtr& manager_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/payments/PaymentInstruments.idl b/third_party/WebKit/Source/modules/payments/PaymentInstruments.idl
index 0446f8d..a6c5fd8 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentInstruments.idl
+++ b/third_party/WebKit/Source/modules/payments/PaymentInstruments.idl
@@ -9,8 +9,8 @@
     Exposed=ServiceWorker
 ] interface PaymentInstruments {
     [ImplementedAs=deleteInstrument] Promise<boolean> delete(DOMString instrumentKey);
-    Promise<PaymentInstrument> get(DOMString instrumentKey);
+    [CallWith=ScriptState] Promise<PaymentInstrument> get(DOMString instrumentKey);
     Promise<sequence<DOMString>> keys();
     Promise<boolean> has(DOMString instrumentKey);
-    Promise<void> set(DOMString instrumentKey, PaymentInstrument details);
+    [CallWith=ScriptState, RaisesException] Promise<void> set(DOMString instrumentKey, PaymentInstrument details);
 };
diff --git a/third_party/WebKit/Source/modules/payments/PaymentManager.cpp b/third_party/WebKit/Source/modules/payments/PaymentManager.cpp
index 87e75cb..e26a11d 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentManager.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentManager.cpp
@@ -131,7 +131,7 @@
 
 PaymentInstruments* PaymentManager::instruments() {
   if (!instruments_)
-    instruments_ = new PaymentInstruments();
+    instruments_ = new PaymentInstruments(manager_);
   return instruments_;
 }
 
diff --git a/third_party/WebKit/Source/modules/payments/PaymentManager.h b/third_party/WebKit/Source/modules/payments/PaymentManager.h
index b20a1ff..723f67a 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentManager.h
+++ b/third_party/WebKit/Source/modules/payments/PaymentManager.h
@@ -46,8 +46,8 @@
   void OnServiceConnectionError();
 
   Member<ServiceWorkerRegistration> registration_;
-  Member<PaymentInstruments> instruments_;
   payments::mojom::blink::PaymentManagerPtr manager_;
+  Member<PaymentInstruments> instruments_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl
index 8a61a27..f7d0137 100644
--- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl
+++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.idl
@@ -128,7 +128,7 @@
     // Non-standard or removed from the spec:
     [Measure] sequence<MediaStream> getLocalStreams();
     [Measure] sequence<MediaStream> getRemoteStreams();
-    [Measure] MediaStream getStreamById(DOMString streamId);
+    [DeprecateAs=V8RTCPeerConnection_GetStreamById_Method] MediaStream getStreamById(DOMString streamId);
     [Measure, CallWith=ScriptState, RaisesException] void addStream(MediaStream? stream, optional Dictionary mediaConstraints);
     [Measure, RaisesException] void removeStream(MediaStream? stream);
     [Measure, RaisesException] RTCDTMFSender createDTMFSender(MediaStreamTrack track);
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp b/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp
index 31bef25f..a67bf5fe 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushSubscriptionOptions.cpp
@@ -8,11 +8,11 @@
 #include "core/dom/DOMArrayBuffer.h"
 #include "core/dom/ExceptionCode.h"
 #include "modules/push_messaging/PushSubscriptionOptionsInit.h"
+#include "platform/wtf/ASCIICType.h"
 #include "platform/wtf/Assertions.h"
 #include "platform/wtf/text/WTFString.h"
 #include "public/platform/WebString.h"
 #include "public/platform/modules/push_messaging/WebPushSubscriptionOptions.h"
-#include "third_party/WebKit/Source/wtf/ASCIICType.h"
 
 namespace blink {
 namespace {
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn
index 6c86a64..97296fd 100644
--- a/third_party/WebKit/Source/platform/BUILD.gn
+++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -1483,7 +1483,7 @@
     "//services/service_manager/public/interfaces:interfaces_blink",
     "//skia",
     "//third_party:jpeg",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//third_party/WebKit/public:mojo_bindings_blink",
     "//third_party/iccjpeg",
     "//third_party/libpng",
@@ -1899,7 +1899,7 @@
 
   configs += [
     ":blink_platform_pch",
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
   ]
 
@@ -1919,7 +1919,7 @@
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/WebKit/Source/platform/loader:unit_tests",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//third_party/harfbuzz-ng",
     "//ui/gfx",
     "//ui/gfx/geometry",
@@ -1947,12 +1947,12 @@
 
   deps = [
     ":platform",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//ui/gfx:test_support",
   ]
 
   configs += [
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
   ]
 
@@ -1969,7 +1969,7 @@
   configs += [
     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
     "//build/config/compiler:no_size_t_to_int_warning",
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
   ]
 
@@ -2050,7 +2050,7 @@
   dict = "//testing/libfuzzer/fuzzers/dicts/mhtml.dict"
   seed_corpus = "//third_party/WebKit/LayoutTests/mhtml"
   additional_configs = [
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
   ]
 }
diff --git a/third_party/WebKit/Source/platform/heap/BUILD.gn b/third_party/WebKit/Source/platform/heap/BUILD.gn
index b19e503..c7e0329e 100644
--- a/third_party/WebKit/Source/platform/heap/BUILD.gn
+++ b/third_party/WebKit/Source/platform/heap/BUILD.gn
@@ -85,7 +85,7 @@
   ]
 
   configs += [
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
     "//third_party/WebKit/Source:inside_blink",
   ]
@@ -97,7 +97,7 @@
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/WebKit/Source/platform:test_support",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
   ]
   if (is_android) {
     deps += [
diff --git a/third_party/WebKit/Source/platform/loader/BUILD.gn b/third_party/WebKit/Source/platform/loader/BUILD.gn
index 0b4fbeb..0673ee5 100644
--- a/third_party/WebKit/Source/platform/loader/BUILD.gn
+++ b/third_party/WebKit/Source/platform/loader/BUILD.gn
@@ -123,7 +123,7 @@
   defines = [ "INSIDE_BLINK" ]
 
   configs += [
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
   ]
 
@@ -155,7 +155,7 @@
   defines = [ "INSIDE_BLINK" ]
 
   configs += [
-    "//third_party/WebKit/Source/wtf:wtf_config",
+    "//third_party/WebKit/Source/platform/wtf:wtf_config",
     "//third_party/WebKit/Source:config",
   ]
 
diff --git a/third_party/WebKit/Source/platform/mojo/String.typemap b/third_party/WebKit/Source/platform/mojo/String.typemap
index 91204738..5ec73c8 100644
--- a/third_party/WebKit/Source/platform/mojo/String.typemap
+++ b/third_party/WebKit/Source/platform/mojo/String.typemap
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 mojom = "//mojo/common/string16.mojom"
-public_headers = [ "//third_party/WebKit/Source/wtf/text/WTFString.h" ]
+public_headers = [ "//third_party/WebKit/Source/platform/wtf/text/WTFString.h" ]
 traits_headers = [ "//third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraits.h" ]
 type_mappings =
     [ "mojo.common.mojom.String16=WTF::String[nullable_is_same_type]" ]
diff --git a/third_party/WebKit/Source/platform/wtf/BUILD.gn b/third_party/WebKit/Source/platform/wtf/BUILD.gn
index 53fb8b75..8a9f36e 100644
--- a/third_party/WebKit/Source/platform/wtf/BUILD.gn
+++ b/third_party/WebKit/Source/platform/wtf/BUILD.gn
@@ -2,25 +2,6 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-# The below is a temporary setup during the WTF migration project:
-# https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
-#
-# We are moving wtf/ files to platform/wtf/ incrementally, thus, conceptually,
-# the "wtf" target in wtf/BUILD.gn is being split into two, in a way that
-# only wtf/ can refer the contents in platform/wtf/.
-#
-# To achieve this, we introduce a new target "platform_wtf" here, and configure
-# it so the source files are compiled in the same way as the original "wtf"
-# target. This gn file should only be used from wtf/BUILD.gn, and this
-# restriction is enforced by the visibility rule below (but it's okay to
-# #include a header in this directory from core/ or modules/).
-#
-# The following configurations are mostly copied from wtf/BUILD.gn, so we
-# can build the source files in the same way.
-#
-# When we finish moving all the files, "platform_wtf" target will take over
-# the role of "wtf".
-
 assert(!is_ios)
 
 import("//testing/test.gni")
@@ -28,7 +9,8 @@
 
 visibility = [
   ":*",
-  "//third_party/WebKit/Source/wtf/*",
+  "//mojo/public/cpp/bindings/*",
+  "//third_party/WebKit/*",
 ]
 
 config("wtf_config") {
@@ -59,7 +41,7 @@
   }
 }
 
-component("platform_wtf") {
+component("wtf") {
   sources = [
     "ASCIICType.cpp",
     "ASCIICType.h",
@@ -391,7 +373,7 @@
   ]
 
   deps = [
-    ":platform_wtf",
+    ":wtf",
     "//base",
     "//base/test:test_support",
     "//testing/gmock",
diff --git a/third_party/WebKit/Source/web/BUILD.gn b/third_party/WebKit/Source/web/BUILD.gn
index e916709..22fd373b 100644
--- a/third_party/WebKit/Source/web/BUILD.gn
+++ b/third_party/WebKit/Source/web/BUILD.gn
@@ -293,7 +293,7 @@
     "//skia",
     "//third_party/WebKit/Source/core:testing",
     "//third_party/WebKit/Source/modules:modules_testing",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//v8",
   ]
 
@@ -430,7 +430,7 @@
     "//third_party/WebKit/Source/modules:unit_tests",
     "//third_party/WebKit/Source/platform:test_support",
     "//third_party/WebKit/Source/platform:unit_tests",
-    "//third_party/WebKit/Source/wtf",
+    "//third_party/WebKit/Source/platform/wtf",
     "//third_party/libwebp",
     "//third_party/zlib",
     "//url",
diff --git a/third_party/WebKit/Source/wtf/.gitignore b/third_party/WebKit/Source/wtf/.gitignore
deleted file mode 100644
index 0ba62a5..0000000
--- a/third_party/WebKit/Source/wtf/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*.Makefile
-*.mk
-*.rules
-*.sln
-*.tmp
-*.vcproj*
-*.vcxproj*
-*.xcodeproj*
diff --git a/third_party/WebKit/Source/wtf/ASCIICType.h b/third_party/WebKit/Source/wtf/ASCIICType.h
deleted file mode 100644
index 611f134..0000000
--- a/third_party/WebKit/Source/wtf/ASCIICType.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ASCIICType.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/AddressSanitizer.h b/third_party/WebKit/Source/wtf/AddressSanitizer.h
deleted file mode 100644
index 812da44..0000000
--- a/third_party/WebKit/Source/wtf/AddressSanitizer.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/AddressSanitizer.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Alignment.h b/third_party/WebKit/Source/wtf/Alignment.h
deleted file mode 100644
index a6f8295f..0000000
--- a/third_party/WebKit/Source/wtf/Alignment.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Alignment.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Allocator.h b/third_party/WebKit/Source/wtf/Allocator.h
deleted file mode 100644
index 5fd3730..0000000
--- a/third_party/WebKit/Source/wtf/Allocator.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Allocator.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Assertions.h b/third_party/WebKit/Source/wtf/Assertions.h
deleted file mode 100644
index 60242919..0000000
--- a/third_party/WebKit/Source/wtf/Assertions.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Assertions.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Atomics.h b/third_party/WebKit/Source/wtf/Atomics.h
deleted file mode 100644
index 2fb3d19..0000000
--- a/third_party/WebKit/Source/wtf/Atomics.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Atomics.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/AutoReset.h b/third_party/WebKit/Source/wtf/AutoReset.h
deleted file mode 100644
index 9af14ce..0000000
--- a/third_party/WebKit/Source/wtf/AutoReset.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/AutoReset.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/BUILD.gn b/third_party/WebKit/Source/wtf/BUILD.gn
deleted file mode 100644
index 8dee4f4..0000000
--- a/third_party/WebKit/Source/wtf/BUILD.gn
+++ /dev/null
@@ -1,206 +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.
-
-assert(!is_ios)
-
-import("//testing/test.gni")
-import("//third_party/WebKit/Source/config.gni")
-
-visibility = [
-  "//mojo/public/cpp/bindings/*",
-  "//third_party/WebKit/*",
-]
-
-config("wtf_config") {
-  configs = [ "//third_party/WebKit/Source/platform/wtf:wtf_config" ]
-}
-
-component("wtf") {
-  sources = [
-    "ASCIICType.h",
-    "AddressSanitizer.h",
-    "Alignment.h",
-    "Allocator.h",
-    "Assertions.h",
-    "Atomics.h",
-    "AutoReset.h",
-    "BitVector.h",
-    "BitwiseOperations.h",
-    "BloomFilter.h",
-    "ByteOrder.h",
-    "ByteSwap.h",
-    "CPU.h",
-    "CheckedNumeric.h",
-    "Compiler.h",
-    "ConditionalDestructor.h",
-    "ContainerAnnotations.h",
-    "CryptographicallyRandomNumber.h",
-    "CurrentTime.h",
-    "DataLog.h",
-    "DateMath.h",
-    "Deque.h",
-    "Dummy.cpp",
-    "DoublyLinkedList.h",
-    "DynamicAnnotations.h",
-    "FilePrintStream.h",
-    "Forward.h",
-    "Functional.h",
-    "GetPtr.h",
-    "HashCountedSet.h",
-    "HashFunctions.h",
-    "HashIterators.h",
-    "HashMap.h",
-    "HashSet.h",
-    "HashTable.h",
-    "HashTableDeletedValueType.h",
-    "HashTraits.h",
-    "HexNumber.h",
-    "InstanceCounter.h",
-    "LeakAnnotations.h",
-    "ListHashSet.h",
-    "Locker.h",
-    "MathExtras.h",
-    "NonCopyingSort.h",
-    "Noncopyable.h",
-    "NotFound.h",
-    "Optional.h",
-    "PassRefPtr.h",
-    "PrintStream.h",
-    "PtrUtil.h",
-    "RefCounted.h",
-    "RefPtr.h",
-    "RefVector.h",
-    "RetainPtr.h",
-    "SaturatedArithmetic.h",
-    "SizeAssertions.h",
-    "SpinLock.h",
-    "StackUtil.h",
-    "StaticConstructors.h",
-    "StdLibExtras.h",
-    "StringExtras.h",
-    "StringHasher.h",
-    "TerminatedArray.h",
-    "TerminatedArrayBuilder.h",
-    "ThreadRestrictionVerifier.h",
-    "ThreadSafeRefCounted.h",
-    "ThreadSpecific.h",
-    "Threading.h",
-    "ThreadingPrimitives.h",
-    "Time.h",
-    "TreeNode.h",
-    "TypeTraits.h",
-    "Vector.h",
-    "VectorTraits.h",
-    "WTF.h",
-    "WTFExport.h",
-    "WTFThreadData.h",
-    "WeakPtr.h",
-    "allocator/PartitionAllocator.h",
-    "allocator/Partitions.h",
-    "build_config.h",
-    "debug/Alias.h",
-    "debug/CrashLogging.h",
-    "dtoa.h",
-    "dtoa/bignum-dtoa.h",
-    "dtoa/bignum.h",
-    "dtoa/cached-powers.h",
-    "dtoa/diy-fp.h",
-    "dtoa/double-conversion.h",
-    "dtoa/double.h",
-    "dtoa/fast-dtoa.h",
-    "dtoa/fixed-dtoa.h",
-    "dtoa/strtod.h",
-    "dtoa/utils.h",
-    "text/ASCIIFastPath.h",
-    "text/AtomicString.h",
-    "text/AtomicStringHash.h",
-    "text/AtomicStringTable.h",
-    "text/Base64.h",
-    "text/CString.h",
-    "text/CharacterNames.h",
-    "text/Collator.h",
-    "text/IntegerToStringConversion.h",
-    "text/ParsingUtilities.h",
-    "text/StringBuffer.h",
-    "text/StringBuilder.h",
-    "text/StringConcatenate.h",
-    "text/StringHash.h",
-    "text/StringImpl.h",
-    "text/StringOperators.h",
-    "text/StringToNumber.h",
-    "text/StringUTF8Adaptor.h",
-    "text/StringView.h",
-    "text/TextCodec.h",
-    "text/TextCodecASCIIFastPath.h",
-    "text/TextCodecLatin1.h",
-    "text/TextCodecReplacement.h",
-    "text/TextCodecUTF16.h",
-    "text/TextCodecUTF8.h",
-    "text/TextCodecUserDefined.h",
-    "text/TextEncoding.h",
-    "text/TextEncodingRegistry.h",
-    "text/TextPosition.h",
-    "text/UTF8.h",
-    "text/Unicode.h",
-    "text/WTFString.h",
-    "text/icu/UnicodeIcu.h",
-    "typed_arrays/ArrayBuffer.h",
-    "typed_arrays/ArrayBufferBuilder.h",
-    "typed_arrays/ArrayBufferContents.h",
-    "typed_arrays/ArrayBufferView.h",
-    "typed_arrays/ArrayPiece.h",
-    "typed_arrays/Float32Array.h",
-    "typed_arrays/Float64Array.h",
-    "typed_arrays/Int16Array.h",
-    "typed_arrays/Int32Array.h",
-    "typed_arrays/Int8Array.h",
-    "typed_arrays/IntegralTypedArrayBase.h",
-    "typed_arrays/TypedArrayBase.h",
-    "typed_arrays/Uint16Array.h",
-    "typed_arrays/Uint32Array.h",
-    "typed_arrays/Uint8Array.h",
-    "typed_arrays/Uint8ClampedArray.h",
-  ]
-
-  configs += [
-    "//third_party/WebKit/Source:config",
-    "//third_party/WebKit/Source:non_test_config",
-    "//third_party/WebKit/Source:blink_pch",
-  ]
-
-  defines = [ "WTF_IMPLEMENTATION=1" ]
-
-  public_configs = [
-    ":wtf_config",
-
-    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-    "//build/config/compiler:no_size_t_to_int_warning",
-    "//third_party/WebKit/Source:features",
-  ]
-
-  public_deps = [
-    "//base",
-    "//third_party/WebKit/Source/platform/wtf:platform_wtf",
-    "//third_party/icu",
-  ]
-
-  if (is_android) {
-    libs = [ "log" ]
-  }
-  if (is_linux) {
-    libs = [ "dl" ]
-  }
-
-  if (is_mac) {
-    libs = [
-      "CoreFoundation.framework",
-      "Foundation.framework",
-    ]
-  }
-
-  if (remove_webcore_debug_symbols) {
-    configs -= [ "//build/config/compiler:default_symbols" ]
-    configs += [ "//build/config/compiler:no_symbols" ]
-  }
-}
diff --git a/third_party/WebKit/Source/wtf/BitVector.h b/third_party/WebKit/Source/wtf/BitVector.h
deleted file mode 100644
index b041aa3..0000000
--- a/third_party/WebKit/Source/wtf/BitVector.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/BitVector.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/BitwiseOperations.h b/third_party/WebKit/Source/wtf/BitwiseOperations.h
deleted file mode 100644
index f4ae1084..0000000
--- a/third_party/WebKit/Source/wtf/BitwiseOperations.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/BitwiseOperations.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/BloomFilter.h b/third_party/WebKit/Source/wtf/BloomFilter.h
deleted file mode 100644
index b37327e0..0000000
--- a/third_party/WebKit/Source/wtf/BloomFilter.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/BloomFilter.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ByteOrder.h b/third_party/WebKit/Source/wtf/ByteOrder.h
deleted file mode 100644
index 4ba9cd8f..0000000
--- a/third_party/WebKit/Source/wtf/ByteOrder.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ByteOrder.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ByteSwap.h b/third_party/WebKit/Source/wtf/ByteSwap.h
deleted file mode 100644
index 21a7fe7..0000000
--- a/third_party/WebKit/Source/wtf/ByteSwap.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ByteSwap.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/CPU.h b/third_party/WebKit/Source/wtf/CPU.h
deleted file mode 100644
index b617339..0000000
--- a/third_party/WebKit/Source/wtf/CPU.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/CPU.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/CheckedNumeric.h b/third_party/WebKit/Source/wtf/CheckedNumeric.h
deleted file mode 100644
index 4fe900f8..0000000
--- a/third_party/WebKit/Source/wtf/CheckedNumeric.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/CheckedNumeric.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Compiler.h b/third_party/WebKit/Source/wtf/Compiler.h
deleted file mode 100644
index a554dcd1..0000000
--- a/third_party/WebKit/Source/wtf/Compiler.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Compiler.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ConditionalDestructor.h b/third_party/WebKit/Source/wtf/ConditionalDestructor.h
deleted file mode 100644
index fc4ba2a4..0000000
--- a/third_party/WebKit/Source/wtf/ConditionalDestructor.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ConditionalDestructor.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ContainerAnnotations.h b/third_party/WebKit/Source/wtf/ContainerAnnotations.h
deleted file mode 100644
index ff2a3cb..0000000
--- a/third_party/WebKit/Source/wtf/ContainerAnnotations.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ContainerAnnotations.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/CryptographicallyRandomNumber.h b/third_party/WebKit/Source/wtf/CryptographicallyRandomNumber.h
deleted file mode 100644
index 8a0eab3..0000000
--- a/third_party/WebKit/Source/wtf/CryptographicallyRandomNumber.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/CryptographicallyRandomNumber.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/CurrentTime.h b/third_party/WebKit/Source/wtf/CurrentTime.h
deleted file mode 100644
index d57fec06..0000000
--- a/third_party/WebKit/Source/wtf/CurrentTime.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/CurrentTime.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/DEPS b/third_party/WebKit/Source/wtf/DEPS
deleted file mode 100644
index c208ff5..0000000
--- a/third_party/WebKit/Source/wtf/DEPS
+++ /dev/null
@@ -1,25 +0,0 @@
-include_rules = [
-    # To whitelist base/ stuff Blink is allowed to include, we list up all
-    # directories and files instead of writing 'base/'.
-    "+base/allocator/oom.h",
-    "+base/allocator/partition_allocator",
-    "+base/auto_reset.h",
-    "+base/bind.h",
-    "+base/bits.h",
-    "+base/compiler_specific.h",
-    "+base/debug",
-    "+base/logging.h",
-    "+base/memory/ptr_util.h",
-    "+base/memory/weak_ptr.h",
-    "+base/numerics",
-    "+base/optional.h",
-    "+base/rand_util.h",
-    "+base/strings",
-    "+base/threading/thread_checker.h",
-    "+base/time/time.h",
-    "+base/tuple.h",
-    "+build",
-    # Allow redirection to platform/wtf. See crbug.com/691465.
-    "+platform/wtf",
-    "-v8",
-]
diff --git a/third_party/WebKit/Source/wtf/DataLog.h b/third_party/WebKit/Source/wtf/DataLog.h
deleted file mode 100644
index 300ecf4..0000000
--- a/third_party/WebKit/Source/wtf/DataLog.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/DataLog.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/DateMath.h b/third_party/WebKit/Source/wtf/DateMath.h
deleted file mode 100644
index f2e3dfa..0000000
--- a/third_party/WebKit/Source/wtf/DateMath.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/DateMath.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Deque.h b/third_party/WebKit/Source/wtf/Deque.h
deleted file mode 100644
index d33a8a0..0000000
--- a/third_party/WebKit/Source/wtf/Deque.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Deque.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/DoublyLinkedList.h b/third_party/WebKit/Source/wtf/DoublyLinkedList.h
deleted file mode 100644
index 39fd5ad..0000000
--- a/third_party/WebKit/Source/wtf/DoublyLinkedList.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/DoublyLinkedList.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Dummy.cpp b/third_party/WebKit/Source/wtf/Dummy.cpp
deleted file mode 100644
index cb09531..0000000
--- a/third_party/WebKit/Source/wtf/Dummy.cpp
+++ /dev/null
@@ -1,22 +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.
-
-// Now that all .cpp files are gone for target "wtf". However, this seems to
-// trigger a compile error on Mac. This file gives an empty object file and
-// should make Xcode's libtool happy...
-
-// And also, MSVC seems to fail to build a .lib file for wtf.dll if there is
-// no symbol to export.
-
-#include "wtf/build_config.h"
-
-#if OS(WIN)
-
-namespace WTF {
-
-__declspec(
-    dllexport) int g_dummy_exported_value_to_force_msvc_to_generate_lib_file;
-}
-
-#endif
diff --git a/third_party/WebKit/Source/wtf/DynamicAnnotations.h b/third_party/WebKit/Source/wtf/DynamicAnnotations.h
deleted file mode 100644
index a7fc401..0000000
--- a/third_party/WebKit/Source/wtf/DynamicAnnotations.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/DynamicAnnotations.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/FilePrintStream.h b/third_party/WebKit/Source/wtf/FilePrintStream.h
deleted file mode 100644
index 56e5c54..0000000
--- a/third_party/WebKit/Source/wtf/FilePrintStream.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/FilePrintStream.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Forward.h b/third_party/WebKit/Source/wtf/Forward.h
deleted file mode 100644
index d9e42c4..0000000
--- a/third_party/WebKit/Source/wtf/Forward.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Forward.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Functional.h b/third_party/WebKit/Source/wtf/Functional.h
deleted file mode 100644
index c550eef..0000000
--- a/third_party/WebKit/Source/wtf/Functional.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Functional.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/GetPtr.h b/third_party/WebKit/Source/wtf/GetPtr.h
deleted file mode 100644
index fc06e5c..0000000
--- a/third_party/WebKit/Source/wtf/GetPtr.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/GetPtr.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashCountedSet.h b/third_party/WebKit/Source/wtf/HashCountedSet.h
deleted file mode 100644
index 39e01960..0000000
--- a/third_party/WebKit/Source/wtf/HashCountedSet.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashCountedSet.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashFunctions.h b/third_party/WebKit/Source/wtf/HashFunctions.h
deleted file mode 100644
index 4872943..0000000
--- a/third_party/WebKit/Source/wtf/HashFunctions.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashFunctions.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashIterators.h b/third_party/WebKit/Source/wtf/HashIterators.h
deleted file mode 100644
index 2b79b27..0000000
--- a/third_party/WebKit/Source/wtf/HashIterators.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashIterators.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashMap.h b/third_party/WebKit/Source/wtf/HashMap.h
deleted file mode 100644
index 525c4f26..0000000
--- a/third_party/WebKit/Source/wtf/HashMap.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashMap.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashSet.h b/third_party/WebKit/Source/wtf/HashSet.h
deleted file mode 100644
index 15b1e39b..0000000
--- a/third_party/WebKit/Source/wtf/HashSet.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashSet.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashTable.h b/third_party/WebKit/Source/wtf/HashTable.h
deleted file mode 100644
index 758d4f7..0000000
--- a/third_party/WebKit/Source/wtf/HashTable.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashTable.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashTableDeletedValueType.h b/third_party/WebKit/Source/wtf/HashTableDeletedValueType.h
deleted file mode 100644
index 7a358fd2..0000000
--- a/third_party/WebKit/Source/wtf/HashTableDeletedValueType.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashTableDeletedValueType.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HashTraits.h b/third_party/WebKit/Source/wtf/HashTraits.h
deleted file mode 100644
index 42b464e..0000000
--- a/third_party/WebKit/Source/wtf/HashTraits.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HashTraits.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/HexNumber.h b/third_party/WebKit/Source/wtf/HexNumber.h
deleted file mode 100644
index 90fe4b9..0000000
--- a/third_party/WebKit/Source/wtf/HexNumber.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/HexNumber.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/InstanceCounter.h b/third_party/WebKit/Source/wtf/InstanceCounter.h
deleted file mode 100644
index f5e7612d..0000000
--- a/third_party/WebKit/Source/wtf/InstanceCounter.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/InstanceCounter.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/LeakAnnotations.h b/third_party/WebKit/Source/wtf/LeakAnnotations.h
deleted file mode 100644
index f43de27..0000000
--- a/third_party/WebKit/Source/wtf/LeakAnnotations.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/LeakAnnotations.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/LinkedHashSet.h b/third_party/WebKit/Source/wtf/LinkedHashSet.h
deleted file mode 100644
index 534e242..0000000
--- a/third_party/WebKit/Source/wtf/LinkedHashSet.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/LinkedHashSet.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ListHashSet.h b/third_party/WebKit/Source/wtf/ListHashSet.h
deleted file mode 100644
index 0cc0ebe0..0000000
--- a/third_party/WebKit/Source/wtf/ListHashSet.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ListHashSet.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Locker.h b/third_party/WebKit/Source/wtf/Locker.h
deleted file mode 100644
index de56036..0000000
--- a/third_party/WebKit/Source/wtf/Locker.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Locker.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/MathExtras.h b/third_party/WebKit/Source/wtf/MathExtras.h
deleted file mode 100644
index b263df22..0000000
--- a/third_party/WebKit/Source/wtf/MathExtras.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/MathExtras.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/NonCopyingSort.h b/third_party/WebKit/Source/wtf/NonCopyingSort.h
deleted file mode 100644
index 616d93a5..0000000
--- a/third_party/WebKit/Source/wtf/NonCopyingSort.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/NonCopyingSort.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Noncopyable.h b/third_party/WebKit/Source/wtf/Noncopyable.h
deleted file mode 100644
index e49a54bbd..0000000
--- a/third_party/WebKit/Source/wtf/Noncopyable.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Noncopyable.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/NotFound.h b/third_party/WebKit/Source/wtf/NotFound.h
deleted file mode 100644
index 3cfe0bc5..0000000
--- a/third_party/WebKit/Source/wtf/NotFound.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/NotFound.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/OWNERS b/third_party/WebKit/Source/wtf/OWNERS
deleted file mode 100644
index 45bef0a..0000000
--- a/third_party/WebKit/Source/wtf/OWNERS
+++ /dev/null
@@ -1,12 +0,0 @@
-erik.corry@gmail.com
-esprehn@chromium.org
-haraken@chromium.org
-jochen@chromium.org
-mikhail.pozdnyakov@intel.com
-sigbjornf@opera.com
-thakis@chromium.org
-tkent@chromium.org
-yutak@chromium.org
-
-# TEAM: platform-architecture-dev@chromium.org
-# COMPONENT: Blink>Internals>WTF
diff --git a/third_party/WebKit/Source/wtf/Optional.h b/third_party/WebKit/Source/wtf/Optional.h
deleted file mode 100644
index 10216d3..0000000
--- a/third_party/WebKit/Source/wtf/Optional.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Optional.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/PassRefPtr.h b/third_party/WebKit/Source/wtf/PassRefPtr.h
deleted file mode 100644
index 0623e52b..0000000
--- a/third_party/WebKit/Source/wtf/PassRefPtr.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/PassRefPtr.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/PrintStream.h b/third_party/WebKit/Source/wtf/PrintStream.h
deleted file mode 100644
index 6c4bbda..0000000
--- a/third_party/WebKit/Source/wtf/PrintStream.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/PrintStream.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/PtrUtil.h b/third_party/WebKit/Source/wtf/PtrUtil.h
deleted file mode 100644
index b61a57b..0000000
--- a/third_party/WebKit/Source/wtf/PtrUtil.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/PtrUtil.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/README.md b/third_party/WebKit/Source/wtf/README.md
deleted file mode 100644
index 980a7bac..0000000
--- a/third_party/WebKit/Source/wtf/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# WTF -- Web Template Framework
-
-The contents in this directory are being moved to platform/wtf. See
-[platform/wtf/README.md](../platform/wtf/README.md) for details.
diff --git a/third_party/WebKit/Source/wtf/RefCounted.h b/third_party/WebKit/Source/wtf/RefCounted.h
deleted file mode 100644
index 18654e4..0000000
--- a/third_party/WebKit/Source/wtf/RefCounted.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/RefCounted.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/RefPtr.h b/third_party/WebKit/Source/wtf/RefPtr.h
deleted file mode 100644
index 4fd6f10..0000000
--- a/third_party/WebKit/Source/wtf/RefPtr.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/RefPtr.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/RefVector.h b/third_party/WebKit/Source/wtf/RefVector.h
deleted file mode 100644
index 1adeee7..0000000
--- a/third_party/WebKit/Source/wtf/RefVector.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/RefVector.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/RetainPtr.h b/third_party/WebKit/Source/wtf/RetainPtr.h
deleted file mode 100644
index 656fb32d..0000000
--- a/third_party/WebKit/Source/wtf/RetainPtr.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/RetainPtr.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/SaturatedArithmetic.h b/third_party/WebKit/Source/wtf/SaturatedArithmetic.h
deleted file mode 100644
index 5824a06..0000000
--- a/third_party/WebKit/Source/wtf/SaturatedArithmetic.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/SaturatedArithmetic.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/SizeAssertions.h b/third_party/WebKit/Source/wtf/SizeAssertions.h
deleted file mode 100644
index 406f53597..0000000
--- a/third_party/WebKit/Source/wtf/SizeAssertions.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/SizeAssertions.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/SpinLock.h b/third_party/WebKit/Source/wtf/SpinLock.h
deleted file mode 100644
index 9081317a..0000000
--- a/third_party/WebKit/Source/wtf/SpinLock.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/SpinLock.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/StackUtil.h b/third_party/WebKit/Source/wtf/StackUtil.h
deleted file mode 100644
index 7c0be57..0000000
--- a/third_party/WebKit/Source/wtf/StackUtil.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/StackUtil.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/StaticConstructors.h b/third_party/WebKit/Source/wtf/StaticConstructors.h
deleted file mode 100644
index 8866254..0000000
--- a/third_party/WebKit/Source/wtf/StaticConstructors.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/StaticConstructors.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/StdLibExtras.h b/third_party/WebKit/Source/wtf/StdLibExtras.h
deleted file mode 100644
index ec81685..0000000
--- a/third_party/WebKit/Source/wtf/StdLibExtras.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/StdLibExtras.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/StringExtras.h b/third_party/WebKit/Source/wtf/StringExtras.h
deleted file mode 100644
index be3d6ef..0000000
--- a/third_party/WebKit/Source/wtf/StringExtras.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/StringExtras.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/StringHasher.h b/third_party/WebKit/Source/wtf/StringHasher.h
deleted file mode 100644
index a7c87b7d..0000000
--- a/third_party/WebKit/Source/wtf/StringHasher.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/StringHasher.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/TerminatedArray.h b/third_party/WebKit/Source/wtf/TerminatedArray.h
deleted file mode 100644
index 8f937d8..0000000
--- a/third_party/WebKit/Source/wtf/TerminatedArray.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/TerminatedArray.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h b/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h
deleted file mode 100644
index 531d650..0000000
--- a/third_party/WebKit/Source/wtf/TerminatedArrayBuilder.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/TerminatedArrayBuilder.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ThreadRestrictionVerifier.h b/third_party/WebKit/Source/wtf/ThreadRestrictionVerifier.h
deleted file mode 100644
index fb22bea..0000000
--- a/third_party/WebKit/Source/wtf/ThreadRestrictionVerifier.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ThreadRestrictionVerifier.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h b/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h
deleted file mode 100644
index e6252f9..0000000
--- a/third_party/WebKit/Source/wtf/ThreadSafeRefCounted.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ThreadSafeRefCounted.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ThreadSpecific.h b/third_party/WebKit/Source/wtf/ThreadSpecific.h
deleted file mode 100644
index 25935b0..0000000
--- a/third_party/WebKit/Source/wtf/ThreadSpecific.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ThreadSpecific.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Threading.h b/third_party/WebKit/Source/wtf/Threading.h
deleted file mode 100644
index 0210ff1..0000000
--- a/third_party/WebKit/Source/wtf/Threading.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Threading.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/ThreadingPrimitives.h b/third_party/WebKit/Source/wtf/ThreadingPrimitives.h
deleted file mode 100644
index 0f40588..0000000
--- a/third_party/WebKit/Source/wtf/ThreadingPrimitives.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/ThreadingPrimitives.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/Time.h b/third_party/WebKit/Source/wtf/Time.h
deleted file mode 100644
index 937b28d..0000000
--- a/third_party/WebKit/Source/wtf/Time.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Time.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/TreeNode.h b/third_party/WebKit/Source/wtf/TreeNode.h
deleted file mode 100644
index 071039fb..0000000
--- a/third_party/WebKit/Source/wtf/TreeNode.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/TreeNode.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/TriState.h b/third_party/WebKit/Source/wtf/TriState.h
deleted file mode 100644
index 9ef4f1876..0000000
--- a/third_party/WebKit/Source/wtf/TriState.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/TriState.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/TypeTraits.h b/third_party/WebKit/Source/wtf/TypeTraits.h
deleted file mode 100644
index 1fafd32a..0000000
--- a/third_party/WebKit/Source/wtf/TypeTraits.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/TypeTraits.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md b/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md
deleted file mode 100644
index 1d4da3d..0000000
--- a/third_party/WebKit/Source/wtf/UniquePtrTransitionGuide.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# std::unique_ptr Transition Guide
-
-Now `std::unique_ptr<T>` is available anywhere in Blink. This document goes through various use cases of `OwnPtr<T>`
-and how they get converted to `std::unique_ptr<T>` so you can smoothly switch your mind.
-
-If you have any uncertainties on using `std::unique_ptr<T>`, ask yutak@chromium.org (or other C++ gurus around you)
-for help.
-
-## Creation and Use
-
-|||---|||
-#### OwnPtr
-
-```c++
-void f()
-{
-    OwnPtr<T> owned = adoptPtr(new T(argument));
-    owned->useThis();
-    T& reference = *owned;
-    T* pointer = owned.get();
-    owned.clear();
-    owned = adoptPtr(new T);
-    T* leakedPointer = owned.leakPtr();
-}
-```
-
-#### std::unique_ptr
-
-```c++
-void f()
-{
-    std::unique_ptr<T> owned(new T(argument));
-    // Or: auto owned = WTF::wrapUnique(new T(argument)); †1
-    owned->useThis();
-    T& reference = *owned;
-    T* pointer = owned.get();
-    owned.reset();      // Or: owned = nullptr
-    owned.reset(new T); // Or: owned = WTF::wrapUnique(new T)
-    T* leakedPointer = owned.release();
-}
-```
-|||---|||
-
-†1 `WTF::wrapUnique()` is particularly useful when you pass a `unique_ptr` to somebody else:
-
-```c++
-std::unique_ptr<T> g()
-{
-    h(WTF::wrapUnique(new T(argument))); // Pass to a function.
-    return WTF::wrapUnique(new T(argument)); // Return from a function.
-}
-
-```
-
-You need to `#include "wtf/PtrUtil.h"` for `WTF::wrapUnique()`.
-
-## Passing and Receiving
-
-|||---|||
-#### OwnPtr
-
-```c++
-void receive(PassOwnPtr<T> object)
-{
-    OwnPtr<T> localObject = object;
-}
-
-void handOver(PassOwnPtr<T> object)
-{
-    receive(object);
-}
-
-void give()
-{
-    OwnPtr<T> object = adoptPtr(new T);
-    handOver(object.release());
-    // |object| becomes null.
-}
-
-void giveDirectly()
-{
-    handOver(adoptPtr(new T));
-}
-
-PassOwnPtr<T> returning()
-{
-    OwnPtr<T> object = adoptPtr(new T);
-    return object.release();
-}
-
-PassOwnPtr<T> returnDirectly()
-{
-    return adoptPtr(new T);
-}
-```
-
-#### std::unique_ptr
-
-```c++
-void receive(std::unique_ptr<T> object)
-{
-    // It is not necessary to take the object locally. †1
-}
-
-void handOver(std::unique_ptr<T> object)
-{
-    receive(std::move(object)); // †2
-}
-
-void give()
-{
-    std::unique_ptr<T> object(new T);
-    handOver(std::move(object)); // †2
-    // |object| becomes null.
-}
-
-void giveDirectly()
-{
-    handOver(std::unique_ptr<T>(new T)); // †3
-}
-
-std::unique_ptr<T> returning()
-{
-    std::unique_ptr<T> object(new T);
-    return object; // †4
-}
-
-std::unique_ptr<T> returnDirectly()
-{
-    return std::unique_ptr<T>(new T); // †3, 4
-}
-```
-
-|||---|||
-
-†1 Both `OwnPtr<T>` and `PassOwnPtr<T>` correspond to `std::unique_ptr<T>`, so a `std::unique_ptr<T>` in the
-arugment and a `std::unique_ptr<T>` in the local variable are exactly the same.
-
-†2 When you release the ownership of an lvalue, you need to surround it with `std::move()`. What's an lvalue? If
-a value has a name and you can take its address, it's almost certainly an lvalue. In this example, `object` is
-an lvalue.
-
-†3 You don't have to do anything if you release the ownership of an rvalue. An rvalue is a value that is not
-an lvalue, such as literals (`"foobar"`) or temporaries (`111 + 222`).
-
-†4 `return` statements are kind of special in that they don't require `std::move()` on releasing ownership, even with
-an lvalue. This is possible because `return` makes all the local variables go away by going back to the caller.
-
-*** aside
-*Note:* Well, yes, I know, the definitions of lvalues and rvalues here are not very precise. However, the above
-understandings are sufficient in practice. If you want to know further, see
-[the wiki about value categories at cppreference.com](http://en.cppreference.com/w/cpp/language/value_category).
-
-See also [Dana's guide for rvalue references](https://sites.google.com/a/chromium.org/dev/rvalue-references)
-if you want to learn about move semantics.
-***
diff --git a/third_party/WebKit/Source/wtf/Vector.h b/third_party/WebKit/Source/wtf/Vector.h
deleted file mode 100644
index eb205364..0000000
--- a/third_party/WebKit/Source/wtf/Vector.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/Vector.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/VectorTraits.h b/third_party/WebKit/Source/wtf/VectorTraits.h
deleted file mode 100644
index eadd393..0000000
--- a/third_party/WebKit/Source/wtf/VectorTraits.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/VectorTraits.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/WTF.h b/third_party/WebKit/Source/wtf/WTF.h
deleted file mode 100644
index 4a8bd31..0000000
--- a/third_party/WebKit/Source/wtf/WTF.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/WTF.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/WTFExport.h b/third_party/WebKit/Source/wtf/WTFExport.h
deleted file mode 100644
index 9e313a571..0000000
--- a/third_party/WebKit/Source/wtf/WTFExport.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/WTFExport.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/WTFThreadData.h b/third_party/WebKit/Source/wtf/WTFThreadData.h
deleted file mode 100644
index 61c5dae96..0000000
--- a/third_party/WebKit/Source/wtf/WTFThreadData.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/WTFThreadData.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/WeakPtr.h b/third_party/WebKit/Source/wtf/WeakPtr.h
deleted file mode 100644
index 6f751b85..0000000
--- a/third_party/WebKit/Source/wtf/WeakPtr.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/WeakPtr.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h b/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h
deleted file mode 100644
index 4245b24..0000000
--- a/third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/allocator/PartitionAllocator.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/allocator/Partitions.h b/third_party/WebKit/Source/wtf/allocator/Partitions.h
deleted file mode 100644
index 3f316f577..0000000
--- a/third_party/WebKit/Source/wtf/allocator/Partitions.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/allocator/Partitions.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/build_config.h b/third_party/WebKit/Source/wtf/build_config.h
deleted file mode 100644
index 5980e3c..0000000
--- a/third_party/WebKit/Source/wtf/build_config.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/build_config.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/debug/Alias.h b/third_party/WebKit/Source/wtf/debug/Alias.h
deleted file mode 100644
index b7368377..0000000
--- a/third_party/WebKit/Source/wtf/debug/Alias.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/debug/Alias.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/debug/CrashLogging.h b/third_party/WebKit/Source/wtf/debug/CrashLogging.h
deleted file mode 100644
index 037a821..0000000
--- a/third_party/WebKit/Source/wtf/debug/CrashLogging.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/debug/CrashLogging.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/debug/DEPS b/third_party/WebKit/Source/wtf/debug/DEPS
deleted file mode 100644
index 2b999bc..0000000
--- a/third_party/WebKit/Source/wtf/debug/DEPS
+++ /dev/null
@@ -1,6 +0,0 @@
-include_rules = [
-    # To whitelist base/ stuff Blink is allowed to include, we list up all
-    # directories and files instead of writing 'base/'.
-    "+base/debug/alias.h",
-    "+base/debug/crash_logging.h",
-]
diff --git a/third_party/WebKit/Source/wtf/dtoa.h b/third_party/WebKit/Source/wtf/dtoa.h
deleted file mode 100644
index 501dd182..0000000
--- a/third_party/WebKit/Source/wtf/dtoa.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/bignum-dtoa.h b/third_party/WebKit/Source/wtf/dtoa/bignum-dtoa.h
deleted file mode 100644
index c65dd18d3..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/bignum-dtoa.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/bignum-dtoa.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/bignum.h b/third_party/WebKit/Source/wtf/dtoa/bignum.h
deleted file mode 100644
index 6cb6f47d..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/bignum.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/bignum.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/cached-powers.h b/third_party/WebKit/Source/wtf/dtoa/cached-powers.h
deleted file mode 100644
index 97582a6..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/cached-powers.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/cached-powers.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/diy-fp.h b/third_party/WebKit/Source/wtf/dtoa/diy-fp.h
deleted file mode 100644
index 8396908..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/diy-fp.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/diy-fp.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/double-conversion.h b/third_party/WebKit/Source/wtf/dtoa/double-conversion.h
deleted file mode 100644
index 3d7490a..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/double-conversion.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/double-conversion.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/double.h b/third_party/WebKit/Source/wtf/dtoa/double.h
deleted file mode 100644
index add5414c..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/double.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/double.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/fast-dtoa.h b/third_party/WebKit/Source/wtf/dtoa/fast-dtoa.h
deleted file mode 100644
index a98da7e..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/fast-dtoa.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/fast-dtoa.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/fixed-dtoa.h b/third_party/WebKit/Source/wtf/dtoa/fixed-dtoa.h
deleted file mode 100644
index b760d11e..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/fixed-dtoa.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/fixed-dtoa.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/strtod.h b/third_party/WebKit/Source/wtf/dtoa/strtod.h
deleted file mode 100644
index 3a49d3a..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/strtod.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/strtod.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/dtoa/utils.h b/third_party/WebKit/Source/wtf/dtoa/utils.h
deleted file mode 100644
index 7098451..0000000
--- a/third_party/WebKit/Source/wtf/dtoa/utils.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/dtoa/utils.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/ASCIIFastPath.h b/third_party/WebKit/Source/wtf/text/ASCIIFastPath.h
deleted file mode 100644
index 917e0c2..0000000
--- a/third_party/WebKit/Source/wtf/text/ASCIIFastPath.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/ASCIIFastPath.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/AtomicString.h b/third_party/WebKit/Source/wtf/text/AtomicString.h
deleted file mode 100644
index 0afb5b47..0000000
--- a/third_party/WebKit/Source/wtf/text/AtomicString.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/AtomicString.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/AtomicStringHash.h b/third_party/WebKit/Source/wtf/text/AtomicStringHash.h
deleted file mode 100644
index 6fddf59f..0000000
--- a/third_party/WebKit/Source/wtf/text/AtomicStringHash.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/AtomicStringHash.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/AtomicStringTable.h b/third_party/WebKit/Source/wtf/text/AtomicStringTable.h
deleted file mode 100644
index 6f6e002..0000000
--- a/third_party/WebKit/Source/wtf/text/AtomicStringTable.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/AtomicStringTable.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/Base64.h b/third_party/WebKit/Source/wtf/text/Base64.h
deleted file mode 100644
index 97da3b1e..0000000
--- a/third_party/WebKit/Source/wtf/text/Base64.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/Base64.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/CString.h b/third_party/WebKit/Source/wtf/text/CString.h
deleted file mode 100644
index 39f5aa1c..0000000
--- a/third_party/WebKit/Source/wtf/text/CString.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/CString.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/CharacterNames.h b/third_party/WebKit/Source/wtf/text/CharacterNames.h
deleted file mode 100644
index 5127dd1..0000000
--- a/third_party/WebKit/Source/wtf/text/CharacterNames.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/CharacterNames.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/Collator.h b/third_party/WebKit/Source/wtf/text/Collator.h
deleted file mode 100644
index cafa65c..0000000
--- a/third_party/WebKit/Source/wtf/text/Collator.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/Collator.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/IntegerToStringConversion.h b/third_party/WebKit/Source/wtf/text/IntegerToStringConversion.h
deleted file mode 100644
index d285b86..0000000
--- a/third_party/WebKit/Source/wtf/text/IntegerToStringConversion.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/IntegerToStringConversion.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/ParsingUtilities.h b/third_party/WebKit/Source/wtf/text/ParsingUtilities.h
deleted file mode 100644
index 70f6813..0000000
--- a/third_party/WebKit/Source/wtf/text/ParsingUtilities.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/ParsingUtilities.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringBuffer.h b/third_party/WebKit/Source/wtf/text/StringBuffer.h
deleted file mode 100644
index 5c1f5886..0000000
--- a/third_party/WebKit/Source/wtf/text/StringBuffer.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringBuffer.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringBuilder.h b/third_party/WebKit/Source/wtf/text/StringBuilder.h
deleted file mode 100644
index b8326738..0000000
--- a/third_party/WebKit/Source/wtf/text/StringBuilder.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringBuilder.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringConcatenate.h b/third_party/WebKit/Source/wtf/text/StringConcatenate.h
deleted file mode 100644
index 23a17f6f8..0000000
--- a/third_party/WebKit/Source/wtf/text/StringConcatenate.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringConcatenate.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringHash.h b/third_party/WebKit/Source/wtf/text/StringHash.h
deleted file mode 100644
index 62be72b0..0000000
--- a/third_party/WebKit/Source/wtf/text/StringHash.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringHash.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.h b/third_party/WebKit/Source/wtf/text/StringImpl.h
deleted file mode 100644
index a586249..0000000
--- a/third_party/WebKit/Source/wtf/text/StringImpl.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringImpl.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringOperators.h b/third_party/WebKit/Source/wtf/text/StringOperators.h
deleted file mode 100644
index c025f80..0000000
--- a/third_party/WebKit/Source/wtf/text/StringOperators.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringOperators.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringStatics.h b/third_party/WebKit/Source/wtf/text/StringStatics.h
deleted file mode 100644
index f053f43..0000000
--- a/third_party/WebKit/Source/wtf/text/StringStatics.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringStatics.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringToNumber.h b/third_party/WebKit/Source/wtf/text/StringToNumber.h
deleted file mode 100644
index 97eb31942..0000000
--- a/third_party/WebKit/Source/wtf/text/StringToNumber.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringToNumber.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h b/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
deleted file mode 100644
index 3ab6829..0000000
--- a/third_party/WebKit/Source/wtf/text/StringUTF8Adaptor.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringUTF8Adaptor.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/StringView.h b/third_party/WebKit/Source/wtf/text/StringView.h
deleted file mode 100644
index c09402d..0000000
--- a/third_party/WebKit/Source/wtf/text/StringView.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/StringView.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodec.h b/third_party/WebKit/Source/wtf/text/TextCodec.h
deleted file mode 100644
index 39fa35e..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodec.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodec.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecASCIIFastPath.h b/third_party/WebKit/Source/wtf/text/TextCodecASCIIFastPath.h
deleted file mode 100644
index d7c08ba3..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecASCIIFastPath.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecASCIIFastPath.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecICU.h b/third_party/WebKit/Source/wtf/text/TextCodecICU.h
deleted file mode 100644
index 15c1a81c..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecICU.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecICU.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecLatin1.h b/third_party/WebKit/Source/wtf/text/TextCodecLatin1.h
deleted file mode 100644
index bd8920e..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecLatin1.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecLatin1.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecReplacement.h b/third_party/WebKit/Source/wtf/text/TextCodecReplacement.h
deleted file mode 100644
index c3528d1..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecReplacement.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecReplacement.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h b/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h
deleted file mode 100644
index b5916a82..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecUTF16.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecUTF16.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecUTF8.h b/third_party/WebKit/Source/wtf/text/TextCodecUTF8.h
deleted file mode 100644
index 56a3165..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecUTF8.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecUTF8.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextCodecUserDefined.h b/third_party/WebKit/Source/wtf/text/TextCodecUserDefined.h
deleted file mode 100644
index 2a02fd18..0000000
--- a/third_party/WebKit/Source/wtf/text/TextCodecUserDefined.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextCodecUserDefined.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextEncoding.h b/third_party/WebKit/Source/wtf/text/TextEncoding.h
deleted file mode 100644
index 119a51f..0000000
--- a/third_party/WebKit/Source/wtf/text/TextEncoding.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextEncoding.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.h b/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.h
deleted file mode 100644
index 484bb01..0000000
--- a/third_party/WebKit/Source/wtf/text/TextEncodingRegistry.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextEncodingRegistry.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/TextPosition.h b/third_party/WebKit/Source/wtf/text/TextPosition.h
deleted file mode 100644
index 7b4867fc..0000000
--- a/third_party/WebKit/Source/wtf/text/TextPosition.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/TextPosition.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/UTF8.h b/third_party/WebKit/Source/wtf/text/UTF8.h
deleted file mode 100644
index aa861b9..0000000
--- a/third_party/WebKit/Source/wtf/text/UTF8.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/UTF8.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/Unicode.h b/third_party/WebKit/Source/wtf/text/Unicode.h
deleted file mode 100644
index f3db0354..0000000
--- a/third_party/WebKit/Source/wtf/text/Unicode.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/Unicode.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
deleted file mode 100644
index ac7c88f..0000000
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/WTFString.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/text/icu/UnicodeIcu.h b/third_party/WebKit/Source/wtf/text/icu/UnicodeIcu.h
deleted file mode 100644
index f714a5b..0000000
--- a/third_party/WebKit/Source/wtf/text/icu/UnicodeIcu.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/text/icu/UnicodeIcu.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h
deleted file mode 100644
index 06ffdbe..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/ArrayBuffer.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h
deleted file mode 100644
index d22d83dd..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferBuilder.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/ArrayBufferBuilder.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h
deleted file mode 100644
index 741a063..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferContents.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/ArrayBufferContents.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h
deleted file mode 100644
index 42282eeb..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayBufferView.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/ArrayBufferView.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/ArrayPiece.h b/third_party/WebKit/Source/wtf/typed_arrays/ArrayPiece.h
deleted file mode 100644
index 7632b27..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/ArrayPiece.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/ArrayPiece.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Float32Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Float32Array.h
deleted file mode 100644
index 12a9805e2..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Float32Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Float32Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Float64Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Float64Array.h
deleted file mode 100644
index c41e98f3..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Float64Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Float64Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Int16Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Int16Array.h
deleted file mode 100644
index e3917a3..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Int16Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Int16Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Int32Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Int32Array.h
deleted file mode 100644
index 1697b72..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Int32Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Int32Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Int8Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Int8Array.h
deleted file mode 100644
index e8fca27..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Int8Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Int8Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/IntegralTypedArrayBase.h b/third_party/WebKit/Source/wtf/typed_arrays/IntegralTypedArrayBase.h
deleted file mode 100644
index d6e4010..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/IntegralTypedArrayBase.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/IntegralTypedArrayBase.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/TypedArrayBase.h b/third_party/WebKit/Source/wtf/typed_arrays/TypedArrayBase.h
deleted file mode 100644
index 874d3cb..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/TypedArrayBase.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/TypedArrayBase.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Uint16Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Uint16Array.h
deleted file mode 100644
index cbde155..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Uint16Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Uint16Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Uint32Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Uint32Array.h
deleted file mode 100644
index 6627a3a6..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Uint32Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Uint32Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Uint8Array.h b/third_party/WebKit/Source/wtf/typed_arrays/Uint8Array.h
deleted file mode 100644
index 600376b..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Uint8Array.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Uint8Array.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/Source/wtf/typed_arrays/Uint8ClampedArray.h b/third_party/WebKit/Source/wtf/typed_arrays/Uint8ClampedArray.h
deleted file mode 100644
index 6229f784..0000000
--- a/third_party/WebKit/Source/wtf/typed_arrays/Uint8ClampedArray.h
+++ /dev/null
@@ -1,9 +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 "platform/wtf/typed_arrays/Uint8ClampedArray.h"
-
-// The contents of this header was moved to platform/wtf as part of
-// WTF migration project. See the following post for details:
-// https://groups.google.com/a/chromium.org/d/msg/blink-dev/tLdAZCTlcAA/bYXVT8gYCAAJ
diff --git a/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap b/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap
index 80ceda0..cd40fe2 100644
--- a/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap
+++ b/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap
@@ -4,7 +4,7 @@
 
 mojom =
     "//third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom"
-public_headers = [ "//third_party/WebKit/Source/wtf/text/WTFString.h" ]
+public_headers = [ "//third_party/WebKit/Source/platform/wtf/text/WTFString.h" ]
 traits_headers =
     [ "//third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.h" ]
 deps = [
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 19f4b0c0..f8ce2d3 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -90025,10 +90025,10 @@
 </enum>
 
 <enum name="DxgiFramePresentationMode" type="int">
-  <int value="0">Composed</int>
-  <int value="1">Overlay</int>
-  <int value="2">None (Unknown)</int>
-  <int value="3">Composition Failure</int>
+  <int value="0" label="Composed"/>
+  <int value="1" label="Overlay"/>
+  <int value="2" label="None (Unknown)"/>
+  <int value="3" label="Composition Failure"/>
 </enum>
 
 <enum name="EAPInnerProtocol" type="int">
diff --git a/ui/base/models/menu_separator_types.h b/ui/base/models/menu_separator_types.h
index 32c573d..2dcde354 100644
--- a/ui/base/models/menu_separator_types.h
+++ b/ui/base/models/menu_separator_types.h
@@ -19,7 +19,10 @@
   LOWER_SEPARATOR,
 
   // Spacing - top to bottom: Spacing only.
-  SPACING_SEPARATOR
+  SPACING_SEPARATOR,
+
+  // Vertical separator within a row.
+  VERTICAL_SEPARATOR,
 };
 
 }  // namespace ui
diff --git a/ui/base/test/OWNERS b/ui/base/test/OWNERS
index 14acb3d..744ca8d 100644
--- a/ui/base/test/OWNERS
+++ b/ui/base/test/OWNERS
@@ -5,3 +5,6 @@
 avi@chromium.org
 tapted@chromium.org
 thakis@chromium.org
+
+# Clipboard
+per-file test_clipboard*=dcheng@chromium.org
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
index 9e81966..ddb2eb0 100644
--- a/ui/native_theme/common_theme.cc
+++ b/ui/native_theme/common_theme.cc
@@ -70,10 +70,6 @@
   static const SkColor kDisabledMenuItemForegroundColor =
       SkColorSetRGB(0xA1, 0xA1, 0x92);
   static const SkColor kMenuBorderColor = SkColorSetRGB(0xBA, 0xBA, 0xBA);
-  static const SkColor kEnabledMenuButtonBorderColor =
-      SkColorSetA(SK_ColorBLACK, 0x24);
-  static const SkColor kFocusedMenuButtonBorderColor =
-      SkColorSetA(SK_ColorBLACK, 0x48);
   static const SkColor kMenuSeparatorColor = SkColorSetRGB(0xE9, 0xE9, 0xE9);
   static const SkColor kEnabledMenuItemForegroundColor = SK_ColorBLACK;
   // Separator:
@@ -169,11 +165,6 @@
       return kSelectedMenuItemForegroundColor;
     case NativeTheme::kColorId_MenuBorderColor:
       return kMenuBorderColor;
-    case NativeTheme::kColorId_EnabledMenuButtonBorderColor:
-      return kEnabledMenuButtonBorderColor;
-    case NativeTheme::kColorId_FocusedMenuButtonBorderColor:
-    case NativeTheme::kColorId_HoverMenuButtonBorderColor:
-      return kFocusedMenuButtonBorderColor;
     case NativeTheme::kColorId_MenuSeparatorColor:
       return kMenuSeparatorColor;
     case NativeTheme::kColorId_MenuBackgroundColor:
@@ -266,8 +257,7 @@
       return base_theme->GetSystemColor(
           NativeTheme::kColorId_MenuBackgroundColor);
     case NativeTheme::kColorId_TableHeaderSeparator:
-      return base_theme->GetSystemColor(
-          NativeTheme::kColorId_EnabledMenuButtonBorderColor);
+      return base_theme->GetSystemColor(NativeTheme::kColorId_MenuBorderColor);
 
     // FocusableBorder
     case NativeTheme::kColorId_FocusedBorderColor:
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 7aa469a..b149778 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -319,10 +319,6 @@
     kColorId_MenuSeparatorColor,
     kColorId_MenuBackgroundColor,
     kColorId_MenuBorderColor,
-    // MenuButton - buttons in wrench menu
-    kColorId_EnabledMenuButtonBorderColor,
-    kColorId_FocusedMenuButtonBorderColor,
-    kColorId_HoverMenuButtonBorderColor,
     // Label
     kColorId_LabelEnabledColor,
     kColorId_LabelDisabledColor,
diff --git a/ui/native_theme/native_theme_dark_aura.cc b/ui/native_theme/native_theme_dark_aura.cc
index 7e3bd07..8974c48 100644
--- a/ui/native_theme/native_theme_dark_aura.cc
+++ b/ui/native_theme/native_theme_dark_aura.cc
@@ -116,9 +116,6 @@
     case kColorId_MenuSeparatorColor:
     case kColorId_MenuBackgroundColor:
     case kColorId_MenuBorderColor:
-    case kColorId_EnabledMenuButtonBorderColor:
-    case kColorId_FocusedMenuButtonBorderColor:
-    case kColorId_HoverMenuButtonBorderColor:
     case kColorId_LinkDisabled:
     case kColorId_TextfieldReadOnlyColor:
     case kColorId_TextfieldReadOnlyBackground:
diff --git a/ui/native_theme/native_theme_mac.mm b/ui/native_theme/native_theme_mac.mm
index 35d381c..7611a11 100644
--- a/ui/native_theme/native_theme_mac.mm
+++ b/ui/native_theme/native_theme_mac.mm
@@ -182,16 +182,11 @@
 
     case kColorId_FocusedBorderColor:
       return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
-    case kColorId_FocusedMenuButtonBorderColor:
-      return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]);
     case kColorId_UnfocusedBorderColor:
       return NSSystemColorToSkColor([NSColor controlColor]);
 
     // Buttons and labels.
-    case kColorId_HoverMenuButtonBorderColor:
-      return NSSystemColorToSkColor([NSColor controlBackgroundColor]);
     case kColorId_ButtonEnabledColor:
-    case kColorId_EnabledMenuButtonBorderColor:
     case kColorId_LabelEnabledColor:
     case kColorId_ProminentButtonColor:
       return NSSystemColorToSkColor([NSColor controlTextColor]);
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 8c4a1904..adc7321 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -266,7 +266,7 @@
       PaintMenuGutter(canvas, rect);
       return;
     case kMenuPopupSeparator:
-      PaintMenuSeparator(canvas, *extra.menu_separator.paint_rect);
+      PaintMenuSeparator(canvas, extra.menu_separator);
       return;
     case kMenuPopupBackground:
       PaintMenuBackground(canvas, rect);
@@ -365,12 +365,23 @@
     system_colors_[kSystemColor] = color_utils::GetSysSkColor(kSystemColor);
 }
 
-void NativeThemeWin::PaintMenuSeparator(cc::PaintCanvas* canvas,
-                                        const gfx::Rect& rect) const {
+void NativeThemeWin::PaintMenuSeparator(
+    cc::PaintCanvas* canvas,
+    const MenuSeparatorExtraParams& params) const {
+  const gfx::RectF rect(*params.paint_rect);
+  gfx::PointF start = rect.CenterPoint();
+  gfx::PointF end = start;
+  if (params.type == ui::VERTICAL_SEPARATOR) {
+    start.set_y(rect.y());
+    end.set_y(rect.bottom());
+  } else {
+    start.set_x(rect.x());
+    end.set_x(rect.right());
+  }
+
   cc::PaintFlags flags;
   flags.setColor(GetSystemColor(NativeTheme::kColorId_MenuSeparatorColor));
-  int position_y = rect.y() + rect.height() / 2;
-  canvas->drawLine(rect.x(), position_y, rect.right(), position_y, flags);
+  canvas->drawLine(start.x(), start.y(), end.x(), end.y(), flags);
 }
 
 void NativeThemeWin::PaintMenuGutter(cc::PaintCanvas* canvas,
@@ -413,18 +424,6 @@
     case kMenuPopupArrow:
       PaintMenuArrow(hdc, state, rect, extra.menu_arrow);
       return;
-    case kMenuPopupBackground:
-      PaintMenuBackground(hdc, rect);
-      return;
-    case kMenuPopupGutter:
-      PaintMenuGutter(hdc, rect);
-      return;
-    case kMenuPopupSeparator:
-      PaintMenuSeparator(hdc, *extra.menu_separator.paint_rect);
-      return;
-    case kMenuItemBackground:
-      PaintMenuItemBackground(hdc, state, rect, extra.menu_item);
-      return;
     case kProgressBar:
       PaintProgressBar(hdc, rect, extra.progress_bar);
       return;
@@ -467,6 +466,10 @@
     case kWindowResizeGripper:
       PaintWindowResizeGripper(hdc, rect);
       return;
+    case kMenuPopupBackground:
+    case kMenuPopupGutter:
+    case kMenuPopupSeparator:
+    case kMenuItemBackground:
     case kSliderTrack:
     case kSliderThumb:
     case kMaxPart:
@@ -874,32 +877,6 @@
   return S_OK;
 }
 
-HRESULT NativeThemeWin::PaintMenuSeparator(HDC hdc,
-                                           const gfx::Rect& rect) const {
-  RECT rect_win = rect.ToRECT();
-
-  HANDLE handle = GetThemeHandle(MENU);
-  if (handle && draw_theme_) {
-    // Delta is needed for non-classic to move separator up slightly.
-    --rect_win.top;
-    --rect_win.bottom;
-    return draw_theme_(handle, hdc, MENU_POPUPSEPARATOR, MPI_NORMAL, &rect_win,
-                       NULL);
-  }
-
-  DrawEdge(hdc, &rect_win, EDGE_ETCHED, BF_TOP);
-  return S_OK;
-}
-
-HRESULT NativeThemeWin::PaintMenuGutter(HDC hdc,
-                                        const gfx::Rect& rect) const {
-  RECT rect_win = rect.ToRECT();
-  HANDLE handle = GetThemeHandle(MENU);
-  return (handle && draw_theme_) ?
-      draw_theme_(handle, hdc, MENU_POPUPGUTTER, MPI_NORMAL, &rect_win, NULL) :
-      E_NOTIMPL;
-}
-
 HRESULT NativeThemeWin::PaintMenuArrow(
     HDC hdc,
     State state,
@@ -946,22 +923,6 @@
                            state);
 }
 
-HRESULT NativeThemeWin::PaintMenuBackground(HDC hdc,
-                                            const gfx::Rect& rect) const {
-  HANDLE handle = GetThemeHandle(MENU);
-  RECT rect_win = rect.ToRECT();
-  if (handle && draw_theme_) {
-    HRESULT result = draw_theme_(handle, hdc, MENU_POPUPBACKGROUND, 0,
-                                 &rect_win, NULL);
-    FrameRect(hdc, &rect_win, GetSysColorBrush(COLOR_3DSHADOW));
-    return result;
-  }
-
-  FillRect(hdc, &rect_win, GetSysColorBrush(COLOR_MENU));
-  DrawEdge(hdc, &rect_win, EDGE_RAISED, BF_RECT);
-  return S_OK;
-}
-
 HRESULT NativeThemeWin::PaintMenuCheck(
     HDC hdc,
     State state,
@@ -994,37 +955,6 @@
                      &rect_win, NULL);
 }
 
-HRESULT NativeThemeWin::PaintMenuItemBackground(
-    HDC hdc,
-    State state,
-    const gfx::Rect& rect,
-    const MenuItemExtraParams& extra) const {
-  HANDLE handle = GetThemeHandle(MENU);
-  RECT rect_win = rect.ToRECT();
-  int state_id = MPI_NORMAL;
-  switch (state) {
-    case kDisabled:
-      state_id = extra.is_selected ? MPI_DISABLEDHOT : MPI_DISABLED;
-      break;
-    case kHovered:
-      state_id = MPI_HOT;
-      break;
-    case kNormal:
-      break;
-    case kPressed:
-    case kNumStates:
-      NOTREACHED();
-      break;
-  }
-
-  if (handle && draw_theme_)
-    return draw_theme_(handle, hdc, MENU_POPUPITEM, state_id, &rect_win, NULL);
-
-  if (extra.is_selected)
-    FillRect(hdc, &rect_win, GetSysColorBrush(COLOR_HIGHLIGHT));
-  return S_OK;
-}
-
 HRESULT NativeThemeWin::PaintPushButton(HDC hdc,
                                         Part part,
                                         State state,
diff --git a/ui/native_theme/native_theme_win.h b/ui/native_theme/native_theme_win.h
index d2585e41..716a4133 100644
--- a/ui/native_theme/native_theme_win.h
+++ b/ui/native_theme/native_theme_win.h
@@ -132,7 +132,8 @@
   void UpdateSystemColors();
 
   // Painting functions that paint to PaintCanvas.
-  void PaintMenuSeparator(cc::PaintCanvas* canvas, const gfx::Rect& rect) const;
+  void PaintMenuSeparator(cc::PaintCanvas* canvas,
+                          const MenuSeparatorExtraParams& params) const;
   void PaintMenuGutter(cc::PaintCanvas* canvas, const gfx::Rect& rect) const;
   void PaintMenuBackground(cc::PaintCanvas* canvas,
                            const gfx::Rect& rect) const;
@@ -169,10 +170,6 @@
                       int state_id,
                       RECT* rect) const;
 
-  HRESULT PaintMenuSeparator(HDC hdc, const gfx::Rect& rect) const;
-
-  HRESULT PaintMenuGutter(HDC hdc, const gfx::Rect& rect) const;
-
   // |arrow_direction| determines whether the arrow is pointing to the left or
   // to the right. In RTL locales, sub-menus open from right to left and
   // therefore the menu arrow should point to the left and not to the right.
@@ -181,8 +178,6 @@
                          const gfx::Rect& rect,
                          const MenuArrowExtraParams& extra) const;
 
-  HRESULT PaintMenuBackground(HDC hdc, const gfx::Rect& rect) const;
-
   HRESULT PaintMenuCheck(HDC hdc,
                          State state,
                          const gfx::Rect& rect,
@@ -192,11 +187,6 @@
                                    State state,
                                    const gfx::Rect& rect) const;
 
-  HRESULT PaintMenuItemBackground(HDC hdc,
-                                  State state,
-                                  const gfx::Rect& rect,
-                                  const MenuItemExtraParams& extra) const;
-
   HRESULT PaintPushButton(HDC hdc,
                           Part part,
                           State state,
diff --git a/ui/views/controls/menu/menu_separator.cc b/ui/views/controls/menu/menu_separator.cc
index d3d532e..297833a 100644
--- a/ui/views/controls/menu/menu_separator.cc
+++ b/ui/views/controls/menu/menu_separator.cc
@@ -52,9 +52,9 @@
   ui::NativeTheme::ExtraParams params;
   params.menu_separator.paint_rect = &paint_rect;
   params.menu_separator.type = type_;
-  GetNativeTheme()->Paint(
-      canvas->sk_canvas(), ui::NativeTheme::kMenuPopupSeparator,
-      ui::NativeTheme::kNormal, gfx::Rect(bounds().size()), params);
+  GetNativeTheme()->Paint(canvas->sk_canvas(),
+                          ui::NativeTheme::kMenuPopupSeparator,
+                          ui::NativeTheme::kNormal, GetLocalBounds(), params);
 }
 
 gfx::Size MenuSeparator::GetPreferredSize() const {